# 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).

### Like this:

Posted by John Armstrong | 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 | 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 | 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 | 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 | March 19, 2011 | Reply

« Previous | Next »

## About this weblog

This is mainly an expository blath, with occasional high-level excursions, humorous observations, rants, and musings. The main-line exposition should be accessible to the “Generally Interested Lay Audience”, as long as you trace the links back towards the basics. Check the sidebar for specific topics (under “Categories”).

I’m in the process of tweaking some aspects of the site to make it easier to refer back to older topics, so try to make the best of it for now.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 56, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9259260296821594, "perplexity_flag": "head"}