# The Unapologetic Mathematician

## Functors

As with all the other algebraic structures we’ve considered, we’re interested in the “structure-preserving maps” between categories. In this case, they’re called “functors”.

A functor $F$ from a category $\mathcal{C}$ to a category $\mathcal{D}$ consists of two functions, both also called $F$. One sends objects of $\mathcal{C}$ to objects of $\mathcal{D}$, and the other sends morphisms of $\mathcal{C}$ to morphisms of $\mathcal{D}$. Of course, these are subject to a number of restrictions:

• If $m$ is a morphism from $X$ to $Y$ in $\mathcal{C}$, then $F(m)$ is a morphism from $F(X)$ to $F(Y)$ in $\mathcal{D}$.
• For every object $X$ of $\mathcal{C}$, we have $F(1_X)=1_{F(X)}$ in $\mathcal{D}$ — identities are sent to identities.
• Given morphisms $f:X\rightarrow Y$ and $g:Y\rightarrow Z$ in $\mathcal{C}$, we have $F(g\circ f)=F(g)\circ F(f)$ in $\mathcal{D}$ — a functor preserves compositions.

It’s tempting at this point to think of a “category of categories”, but unfortunately this gets hung up on the same hook as the “set of sets”. A lot of the intuition goes through, however, and we do have a category $\mathbf{Cat}$ of small categories (with only a set of objects and a set of morphisms) and functors between them.

Every category $\mathcal{C}$ comes with an identity functor $1_\mathcal{C}$. This is an example of an “endofunctor” (in analogy with “endomorphism”).

Every category of algebraic structures we’ve considered — $\mathbf{Grp}$, $\mathbf{Mon}$, $\mathbf{Ring}$, $R-\mathbf{mod}$, etc. — comes with a “forgetful” functor to the category of sets. Remember that a group (for example) is a set with extra structure on top of it, and a group homomorphism is a function that preserves the group structure. If we forget all that extra structure we’re just left with sets and functions again.

To be explicit, there is a functor $U:\mathbf{Grp}\rightarrow\mathbf{Set}$ that sends a group $(G,\cdot)$ to its underlying set $G$. It sends a homomorphism $f:G\rightarrow H$ to itself, now considered as a function on the underlying sets. It should be apparent that this sends the identity homomorphism on the group $G$ to the identity function on the set $G$, and that it preserves compositions. The same arguments go through for rings, monoids, $R$-modules.

In fact, there are other forgetful functors that behave in much the same way. A ring is an abelian group with extra structure, so we can forget that structure to get a functor from $\mathbf{Ring}$ to $\mathbf{Ab}$ — the category of abelian groups. An abelian group, in turn, is a restricted kind of group. We can forget the restriction to get a functor from $\mathbf{Ab}$ to $\mathbf{Grp}$.

Now for some more concrete examples. Remember that a monoid is a category with one object. So what’s a functor between such monoids? Consider monoids $M$ and $N$ as categories. Then there’s only one object in each, so the object function is clear. We’re left with a function on the morphisms sending the identity of $M$ to the identity of $N$ and preserving compositions — a monoid homomorphism!

What about functors between preorders, considered as categories? Now all the constraints are on the object function. Consider preorders $(P,\leq)$ and $(Q,\preceq)$ as categories. If there is an arrow from $a$ to $b$ in $P$ then there must be an arrow from $F(a)$ to $F(b)$. That is, if $a\leq b$ then $F(a)\preceq F(b)$. Functors in this case are just order-preserving functions.

These two examples show how the language of categories and functors subsumes both of these disparate notions. Preorder relations translate into the existence of certain arrows, which functors must then preserve, while monoidal multiplications translate into compositions of arrows, which functors must then preserve. The categories of (preorders, order-preserving functions) and (monoids, monoid homomorphisms) both find a natural home with in the category of (small categories, functors).

May 22, 2007 - Posted by | Category theory

## 4 Comments »

1. […] Transformations and Functor Categories So we know about categories and functors describing transformations between categories. Now we come to transformations between functors […]

Pingback by Natural Transformations and Functor Categories « The Unapologetic Mathematician | May 26, 2007 | Reply

2. […] algebras — were all asserted to be the “free” constructions. This makes them functors from the category of vector spaces over to appropriate categories of -algebras, and that means […]

Pingback by Functoriality of Tensor Algebras « The Unapologetic Mathematician | October 28, 2009 | Reply

3. […] closely, we’ll find that what we’ve defined as a presheaf is actually a contravariant functor from this category to the category of sets! For every arrow we have an arrow — in the […]

Pingback by Presheaves « The Unapologetic Mathematician | March 16, 2011 | Reply

4. […] that we ended up defining a presheaf as a functor. Given our topological space we set up the partial order category , flipped it around to so the […]

Pingback by Mappings Between Presheaves « The Unapologetic Mathematician | March 19, 2011 | Reply