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* between two functors and is a indexed family of arrows in such that and for every we have the equation . In words, this means that we have a consistent way of transforming from the image of to the image of , 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 , then we can talk about a slightly more general notion of transformation: the dinatural transformations. A dinatural transformation between two functors is a indexed family of arrows in such that and for every we have the equation . 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 and are connected by , then either way you factor through the diagonal is the same map.” Now, every *natural* transformation between and 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 and the corresponding dinatural transformation then the above equation becomes and we can permute the s to the right on each side *and* use the fact that functors respect composition to get both sides of the equation equal to . Cool, right?

There’s a special kind of dinatural transformation we need for defining ends, and they’re the ones generated by letting be a constant functor. This means that our dinatural transformation becomes a family of arrows such that for every then . Mac Lane refers to these as *wedges* from to . Similarly, if is constant but is not then we have a wedge *to* *from* . Now, an *end* of the functor is a wedge to from that is universal, i.e. for any other wedge from to then there is a *unique* factoring arrow that the wedge diagram factors through, just like with limits. Similarly, a coend is a constant such that there is a universal wedge from to . We designate an end as and the coend as . 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!