# Reviewing Mac Lane: Kans and Ends I

There’s some topics from “Categories for the Working Mathematician” that, when I first read the book, never really sank in. Pretty much the entirety of chapters IX and X went over my head, so now we’ll talk about two topics that I keep seeing come up in literature that I really need to get down: (co)ends and Kan extensions.

We start with ends and coends. First, though, we need to define the notion of a dinatural transformation. We recall that a natural transformation $\eta$ between two functors $F : C \to D$ and $G : C \to D$ is a $C$ indexed family of arrows in $D$ such that $\eta_c : F(c) \to G(c)$ and for every $f : c \to c'$ we have the equation $\eta_{c'} \circ F(f) = G(f) \circ \eta_c$. In words, this means that we have a consistent way of transforming from the image of $F$ to the image of $G$, but since functors have an action on objects and arrows then we must have the above compatibility condition.

If we consider a special kind of functor, those with type $C^{op} \times C \to D$, then we can talk about a slightly more general notion of transformation: the dinatural transformations. A dinatural transformation $\alpha$ between two functors $F,G : C^{op} \times C \to D$ is a $C$ indexed family of arrows in $D$ such that $\eta_c : F(c,c) \to G(c,c)$ and for every $f : c \to c'$ we have the equation $G(1,f) \circ \alpha_c \circ F(f,1) = G(f,1) \circ \alpha_{c'} \circ F(1,f)$. What does this equation really mean? It’s less obvious to me what a in-words explanation would be. Maybe a stab at it would be “when $c$ and $c'$ are connected by $f$, then either way you factor $F(c',c) \to G(c,c')$ through the diagonal is the same map.” Now, every natural transformation between $F$ and $G$ induces a dinatural transformation, by taking the components of the dinatural transformation to be the diagonal of the natural transformation. Why does this automatically satisfy the criterion of a dinatural transformation?

Well, if we have a natural transformation $\eta_{(c,c')} : F(c,c') \to G(c,c')$ and the corresponding dinatural transformation $\alpha_c = \eta_{(c,c')}$ then the above equation becomes $G(1,f) \circ \eta_{(c,c)} \circ F(f,1) = G(f,1) \circ \eta_{(c',c')} \circ F(1,f)$ and we can permute the $\eta$ s to the right on each side and use the fact that functors respect composition to get both sides of the equation equal to $G(f,f) \circ \eta_{(c',c)}$. Cool, right?

There’s a special kind of dinatural transformation we need for defining ends, and they’re the ones generated by letting $G$ be a constant functor. This means that our dinatural transformation becomes a family of arrows $\alpha_c : F(c,c) \to d$ such that for every $f : c \to c'$ then $\alpha_c' \circ F(1,f) = \alpha_c \circ F(f,1)$. Mac Lane refers to these as wedges from $F$ to $d$. Similarly, if $F$ is constant but $G$ is not then we have a wedge to $G$ from $d$. Now, an end of the functor $F : C^{op} \times C \to D$ is a wedge to $F$ from $d$ that is universal, i.e. for any other wedge from $d'$ to $F$ then there is a unique factoring arrow $d' \to d$ that the wedge diagram factors through, just like with limits. Similarly, a coend is a constant $d$ such that there is a universal wedge from $F$ to $d$. We designate an end as $\int_c C(c,c)$ and the coend as $\int^c C(c,c)$. Like all things with universal properies, they are unique up to iso.

Now, this is where I get fuzzy because while these definitions are all well and good I don’t entirely understand their use. I know I’ve run into them as particular constructions in papers and books, but I don’t think I have the general feel for them the way I do with limits and adjoints. Mac Lane provides, as an example, the fact that you can define all natural transformations as ends and while that’s cute it’s not entirely motivating. On the other hand, Mac Lane does give a really cute example of coends: the geometric realization functor we saw a couple of weeks ago. I haven’t really internalized why the coend he gives is actually the same as the more explicit definition in the simplicial sets paper, but I’m guessing that since coends are like colimits and colimits can generate quotients, like with coequalizers, then maybe the coend “naturally” takes care of the quotienting?

I’m going to end this here since it took longer to even talk this much about ends and coends, so next time we’ll talk about Kan extensions and maybe I’ll have more examples of how all these constructions are useful!