What is the distinction between morphism and functor really?

378 Views Asked by At

According to nLab:

https://ncatlab.org/nlab/show/morphism

In a general category, a morphism is an arrow between two objects.

https://ncatlab.org/nlab/show/functor

A functor is what goes between categories.

Basically, I observe these are the reason people (including here) claims "morphism and functor are different."

However, in single-sorted definition of a category,

https://ncatlab.org/nlab/show/single-sorted+definition+of+a+category

The basic idea is that an object can be identified with its identity morphism.

This concept/definition is described in Categories for the Working Mathematician I.1 and XII.5.

So, in this scheme, when one claims

"a morphism is an arrow between two objects.",

which is equivalent to claim

"a morphism is an arrow between two categories."

since an object is identified with the identity morphism that is also a category(singleton).

So,

morphism: an arrow between two categories

functor: what goes between categories

and here, "what" means morphism

because

defining a category which uses only one collection (representing the collection of morphisms)

Accordingly, morphism == functor, and usually we use the identical concept in different words everywhere (mostly with many confusions).

Some would say, "but, the scale of the perspective is different". Yes, I know, but I usually read explanations functor is somewhat special concept other than morphism, and never heard the difference is only perspective and relative.

Please tell me if there is any mistake. Thanks.

EDIT

According to nLab article:

https://ncatlab.org/nlab/show/functor


Definition

External definition

A functor $F$ from a category $C$ to a category $D$ is a map sending each object $x \in C$ to an object $F(x) \in D$ and each morphism $f : x \to y$ in $C$ to morphism $F(f) : F(x) \to F(y)$ in $D$, such that

  • $F$ preserves composition: $F(g\circ f) = F(g)\circ F(f)$ whenever the left-hand side is well-defined,

  • $F$ preserves identity morphisms: for each object $x \in C$, $F(1_x) = 1_{F(x)}$.


So, functor is often called "structure preserving".

However, there is an interesting article:

https://www.schoolofhaskell.com/user/edwardk/snippets/fmap


The free theorem for fmap

When we write down the definition of Functor we carefully state two laws:

  1. fmap id = id
  2. fmap f . fmap g = fmap (f . g)

These are pretty well known in the Haskell community.

What is less well known is that the second actually follows from the first and parametricity, so you only need to sit down and prove one Functor law when you go to supply a Functor!

This is a “folklore” result, which I've used in conversation many times before, but it continues to surprise folks, so I decided to write up a slow, step by step proof of this result as it is a fun little exercise in equational reasoning.

To prove this we're going to need the free theorem for fmap and a few lemmas.


3

There are 3 best solutions below

12
On

In the category of sets, we call the morphisms "functions".

In the category of vector spaces over a given field, we call the morphisms "linear transformations".

In the category of groups, we call the morphisms "homomorphisms".

In the category of categories (which if I recall correctly isn't actually a thing), we would call the morphsims "functors". We do have things like the category of small categories, however. And in that case, the morphisms are really called "functors".

Functors are morphisms between categories, but there are too many of them to put all of them into a single category.

8
On

I'm going to try approaching this from a different perspective.

I think you're interpreting the definition of functor and morphism incorrectly.

Let's review the definitions. (I'll use the single sorted definition of a category, although it's not really a good one for most purposes)

I'm going to stick to small categories to avoid foundational issues.

A (small) category consists of the following data. A set $C$ (whose elements we call the morphisms of $C$), two functions $s,t:C\to C$ called the source and target functions, and a composition function $\circ : C\times_{s,C,t} C\to C$ subject to the following axioms.

  1. (Compatibility of sources and targets) For all $f\in C$, $s(s(f))=t(s(f))=s(f)$, and $t(t(f))=s(t(f))=t(f)$.
  2. (Compatibility of sources/targets with composition) For all $f,g\in C$ with $s(g)=t(f)$, then $s(g\circ f)=s(f)$, and $t(g\circ f)=t(g)$.
  3. (Identity) For all $f\in C$, $t(f)\circ f = f = f\circ s(f)$ (note that composition is well defined, by Axiom 1).
  4. (Associativity) For all $f,g,h\in C$ such that $s(h)=t(g)$, and $s(g)=t(f)$, $h\circ (g\circ f) = (h\circ g)\circ f$.

Key point:

When we say some mathematical object $f$ is a morphism, we mean that $f\in C$, where $C$ is a set equipped with a specific structure of a small category.

This is just like how when I say some mathematical object $v$ is a vector, I mean that $v$ belongs to a set $V$ equipped with some specific vector space structure on $V$.

In other words, I cannot say something is a morphism without being clear what category structure I consider the morphism to belong to!

Now in practice, there are many well known categories, and people usually just say things like $\phi$ is a morphism of groups, and take for granted that we can figure out which category structure on groups they are referring to.

In particular, morphisms are not "arrows between categories." In the single sorted definition, morphisms are elements of some specified category.

Really, if we were careful we would always say something like $f$ is a morphism of $C$, where $C$ is a specific category.

Functors

A functor (of single-sorted, small categories) $F:C\to D$ is a structure preserving function.

More concretely, $F$ is a function from $C$ to $D$ such that for all $f,g,h\in C$, $F$ satisfies
$s(F(f))=F(s(f))$, $t(F(f))=F(t(f))$, and if $s(h)=t(g)$, then $F(h\circ g) = F(h)\circ F(g)$.

Functors are simply functions which preserve structure.

Key point:

Functors are not "what goes between categories." They have a concrete definition.

Question: Are morphisms always functors? No, there's no reason to expect that the set of things which I happened to put a category structure on happened to be a set of functors.

Question: Are functors always morphisms? Again, no. A functor is simply a structure preserving function. I don't have to specify a category containing a given functor for the functor to be useful, and for me to do things with it. Of course, in practice, we often do want to define a category whose morphisms are functors, because we are often interested in composite functors, but we don't need to do so.

Concluding point

It seems to me that you've gotten side tracked by taking intuitive explanations of things as if they are rigorous definitions. Mathematical terms and objects have mathematical definitions. Don't interpret intuitive explanations as definitions of things. Focus on the actual definitions.

Morphisms and functors have different (inequivalent!) definitions. They are very much not the same thing.

0
On

Functors take objects to objects; and morphisms to morphisms. That is, a functor has categories as its domain and range. In addition, certain conditions are satisfied by a functor.

Thus, as in @JohnDouma's comment, a functor is a type of morphism.