Weighted limits, ends, and Day convolution (Part 2)
15th February, 2018
Using the idea of weighted limits, defined in the last post, we can now talk about ends. The idea of an end is that, given some functor , which we can think of as defining both a left and a right action on , we wish to construct some sort of universal subobject^{1} where the two actions coincide. Dually, a motivation behind the coend is in asking for some universal quotient of that forces the two actions to agree.
Edit: If you actually want to learn this stuff then have a look at either of Emily Riehl’s books (Categorical Homotopy Theory and Category Theory in Context). I honestly don’t think there is a better teaching of this anywhere else in the literature.
Ends
Definitions and settings
We can define ends in enriched categories in a pretty slick manner, and in notnecessarilyenriched categories in a stillnottoomessy way.
First, let and be enriched categories (with a closed symmetric monoidal category) and a functor. Then the end of , written is (if it exists!) the weighted limit of :
Dually, the coend of , written , is
Alternatively now, suppose that we have some between notnecessarilyenriched categories. We can still define the end by using wedges. A wedge is the data of an object and morphisms such that, for any , the following diagram commutes:
Then we can define the end as a universal wedge (if it exists), i.e. any other wedge factors uniquely through
Examples
I’m going to talk more about the exciting examples and applications of ends (tensor products of categories, geometric realisation, and Day convolution) in the next post in this series, but I would feel awful if I didn’t mention at least a couple here.
One application of ends is in defining natural transformations, which shows how overarching the concept is. It is pretty much a triviality (from the definitions)^{2} that
This is a nice way of saying it, because it means that we can get the enriched natural transformations of enriched functors “for free” by defining them in exactly this way.
Another nice example (from the nLab) is when we take , with the monoidal product given by addition. Then a enriched category is a metric space, and the hom objects tell us the distance between points. Further, given two maps between two metric spaces, the distance between the maps is exactly the enriched functorcategory^{3} (given by the end)
Finally, for the moment, there is the example of Kan extensions. If we have some enriched category that is tensored^{4} over , and some functors and , then the left Kan extension of along is given by the coend:
where is the copower.
In particular then, we see that the generalisation of limits to weighted limits is ‘at least as general as’ the idea of Kan extensions.
Manipulation and ninja Yoneda
It’s often useful to know the following fact: continuous functors preserve ends (and, dually, cocontinuous functors preserve coends). In particular,
We can also rephrase the Yoneda lemma^{5} in terms of ends, as well as finding a coYoneda lemma.^{6} The Yoneda lemma (in the setting of enriched categories) reads
and so can be rephrased as
whence we find the coYoneda lemma:
Much better references
If you really want to read about ends then you my friend are in the wrong place. Here are some papers and blog posts that I found interesting and really well written:
 This is the (co)end, my only (co)friend
 Coends in conformal field theory
 Ends, on the the nCategory Café
 Ends and coends, on Bartosz Milewski’s Programming Cafe
Footnotes

A subobject of an object is a class of isomorphisms of monomorphisms into . ↩

One thing that I’ve learnt whilst reading about category theory, or even just modern maths in general, is that it is very tempting to accept that something is a triviality without really thinking about why it’s trivial. Many a time have I thought that I knew that something was trivial only to fail to be able to explain it to somebody when asked. My new year’s resolution is to always prove that trivialities are trivial. ↩

I’m not sure if this should be ‘enriched functorcategory’ or ‘enrichedfunctor category’. My first thought was the latter, because it’s the category of enriched functors, but I suppose that it’s clearer that our natural transformations are also enriched if we describe this as ‘the functor category enriched over ’. But then, I tend to overuse hyphens when there’s more than one adjective, just to be extra safe. ↩

‘Tensor’ is another name for ‘copower’, i.e. a category is tensored over if all pairs of objects , where and , have a copower: an object along with a natural isomorphism , where is the internal hom in . ↩

When phrased in terms of ends, this is sometimes called Yoneda reduction. ↩

This presentation of the (co)Yoneda lemma is sometimes referred to as the ninja Yoneda lemma. ↩