Another (covariant) functor

I have one more example of a (covariant) functor that I thought is worth mentioning. It’s so important, it has it’s own name.

Let $\mathcal C$ be a locally small category. Then for each $X,Y\in Ob(\mathcal C)$, $\hom_{\mathcal C}(X,Y)$ is a set. Pick a special object $S$ in $\mathcal C$, and define a functor $h_S:\mathcal C\to\textsc{Set}$ in the following way:

If $X\in Ob(\mathcal C)$, $h_S:X\mapsto \hom(S,X)$. We need $\mathcal C$ to be locally small to ensure that $\hom(S,X)$ really is a set. For a morphism $f:X\to Y$ in $h_S(f)$ is a map from $\hom(S,X)$ to $\hom(S,Y)$. It sends $\phi:S\to X$ to $f\circ\phi:S\to Y$. That is,

$h_S(f):\phi\mapsto f\circ\phi$.

We call these functors representable functors. Yes, this is complicated. The objects aren’t so hard, but the morphisms are confusing. I don’t know a good way to understand them. Beyond working through the definitions and checking that this really is a functor, I don’t know any good exercises. Try to do it yourself. If you get stuck, you can look below at what I’ve done, but as is almost always true in math, it’s best to do it yourself if you can.

We consider $h_S(1_X):\hom(S,X)\to\hom(S,X)$ by $\phi\mapsto 1_X\circ\phi=\phi$. As a set map, this is simply the identity function on the set $\hom(S,X)$. That is, it is $1_{\hom(S,X)}$. Another way to write this is $1_{h_S(X)}$.

Now let $f:X\to Y$ and $g:Y\to Z$ be morphisms in $\mathcal C$. This gives us $h_S(g\circ f):\phi\mapsto (g\circ f)\circ\phi$. We can break this map into two pieces. First, we do the piece that composes with $f$. Then we do the part that composes with $g$. That is, first we have $h_S(f):\phi\mapsto f\circ\phi$, then we apply the map $h_S(g)$ to get $h_S(g)\circ h_S(f):\phi\mapsto g\circ f\circ \phi$. That is,

$h_S(f)\circ h_S(g)=h_S(f\circ g)$

as desired. Another way to check this is to check that the diagram

commutes. Let’s check it again thinking about it this way. To see if a diagram commutes, we need to check that all paths give us the same result. In this case, there’s only one thing to check. Take $\phi\in\hom(S,X)$.

One way to get from $\hom(S,X)$ to $\hom(S,Z)$ gives us $h_S(g\circ f)(\phi)=(g\circ f)\circ \phi$. The other way is by composing $h_S(f)$ and $h_S(g)$. If we start with $\phi$, and apply the map $h_S(f)$, we get $f\circ \phi$. After applying the map $h_S(g)$, we get $g\circ(f\circ \phi)$. By associativity, these are the same results, which means the diagram commutes.