# Understanding Weighted Colimits as Tensor Products of Modules

Posted on 2022-10-15 | maths

If you’ve been doing category theory for any amount of time, you’ll probably have stumbled upon enriched category theory as a way of expressing categorical ideas internal to some context other than Set. Reading into it, you might have come across these foreign sounding concepts like weighted (co)limits and wondered what that was all about—and then got lost for a few days, trying to decipher what Kelly is talking about and why symbols resembling tensor products are suddenly being thrown around. At least that’s what happened to me.

After scouring the internet for good resources, I found two really enlightening blog posts: one by Todd Trimble and the other by John Baez—and they’re too good not to share. Plus, people always say that you don’t understand a concept unless you can explain it to someone else, so here’s my shot at it!

I will assume familiarity with basic notions of category theory (limits, colimits, adjunctions, monoidal categories, …), as well as elementary abstract algebra (in particular, rings and modules). If you’re not comfortable with these and have a lot of time to kill, I recommend Category Theory in Context by Emily Riehl for the former and A Course in Algebra by Ernest Vinberg for the latter.

Really, it’s good if you have heard about enriched category theory before, as this is where weighted colimits tend to naturally crop; also because I can’t possibly do the topic justice in a single blog post. I will still try, of course, but be warned. However, weighted colimits also appear in ordinary category theory, so if you don’t want to touch the enriched stuff just insert whenever I write below—it will only get easier. Further, most of the main part of the text doesn’t use enrichment at all, so don’t be too alarmed.

First and foremost I must note that—more-so than elsewhere—these are very much not my own thoughts. I’m just retelling the story in order to understand it better myself. Sources and resources for everything are linked at the end. The key insights come from the mentioned blog posts by Todd Trimble and John Baez, as well as the accompanying (resulting) nLab article.

# Enriched Category Theory

As I said, we first turn our attention to enriched category theory. Before diving into the gory details, I will first discuss things a bit more intuitively. In short, one studies not ordinary categories—whose homsets are always sets—but so-called -categories, whose hom-objects are objects in some “environmental” category . This category is what replaces , so it will usually be assumed to have some very nice properties. For the purposes of this blog post, I will assume that is a (small) complete and cocomplete closed symmetric monoidal category.1 If you don’t know what some of these words mean, you can read that as “it’s an environment in which we can think about category theory in an effective way”.

In addition, I would also like to fix a -category for the rest of this blog post. For the moment, you can think of this like an ordinary category such that for any two objects and in , we have that is an object in . Naturally, all the usual axioms of a category—like associativity and unitality of morphisms—ought to hold in this new setting. As you can imagine, this makes certain things more complicated. The fact that is an object in means that it is now a black box—we can’t peek into it anymore! Writing is no longer legal, so we somehow have to make due with not talking about individual morphisms. A little bit more care has to be taken for the precise definition of an enriched category to make sense. First, however, I will show you a few examples.

Thankfully—lest the world explodes—categories enriched in are exactly ordinary categories. Likewise, a lot of categories that people are interested in and you may be familiar with arise in this way: 2-categories (in the strict sense) are categories enriched over , preadditive categories are those enriched over , and -linear categories are ones enriched over . Further, rings can also be seen as categories. Namely, they have just a single object and forms an abelian group—more on that later.

With these examples in mind, let us explore the technical definition of a category enriched over . Formally, such a consists of:

• A collection of objects .
• For , a hom-object .
• For , a composition map in :
• For an identities map .

Further, this data has to satisfy appropriate associativity and unitality conditions:

In the above diagrams, , , and respectively denote the associativity, left, and right unitality constraints of .

If these diagrams remind you of a monoidal category, they absolutely should! Much like you can think of ordinary categories as multi-object monoids, a decent mental model for -categories is to think of them as multi-object monoidal categories.

## Functors and Natural Transformations

We furthermore need analogues for functors and natural transformations—they now also come with a - prefix. The functor laws get a bit more complicated, as we can’t simply say that , for some arrows and , and need to draw commutative diagrams instead (remember that we can’t talk about individual arrows anymore). However, most of the intuition you already have about functors and natural transformations should carry over just fine. I will leave the technical definitions of enriched functors and natural transformations as exercises to the reader—they are relatively straightforward to write down and not all that important for what follows.

The upshot of all of this is that, in order to do enriched category theory, we not only need analogues for functors and natural transformations, but also for all the other basic notions of ordinary category theory. Since limits and colimits are among the most important constructions, people naturally started to think about how one could express them in the enriched language—this is precisely what lead to the development of weighted colimits!

One interesting thing I want to highlight about enriched functors is the induced arrow on morphisms that an always comes with. Namely, . Because is symmetric monoidal, we can use the tensor-hom adjunction and rewrite the above to look more like an action:

Likewise, a -functor comes equipped with an “action” from the other side:

# Copowers

Before we get to the fun stuff, we have to talk about one more important technical detail: copowers. The basic idea is that in any ordinary monoidal category , we have the tensor-hom adjunction (also called currying) . In particular, this means that

If we’re in an enriched setting, we want to somehow “switch out” the tensor product of the monoidal category with some action, say , while retaining this nice property. As such, the copower of by a is an object , such that for all , there is a natural isomorphism

Above I have slightly abused notation; now denotes the internal hom of , instead of the external one. If is clear from the context, one also often writes here. Also do remember that is an object in now!

The best thing about copowers is their existence when it comes to and ordinary categories. If has all coproducts, there is a canonical copower .2 For all and , it is given by

The fact that this is a copower follows from

for all . Because of the closeness to the tensor product, people sometimes call copowers “tensors” and write them with the same symbol as they write the tensor product.

# Weighted Colimits

Onto the main dish. The key idea is to reframe an ordinary colimit in terms of “looking like a monoidal product”. The weighted colimit then becomes something akin to the tensor product over a k-algebra . We like rings and modules, so let’s explore this further.

To recap, when looking at bimodules and over some -algebra (ring) we can define the tensor product of and over , in symbols , as the coequaliser

where the two parallel arrows are induced by the left and right actions and , respectively.

For ease of notation, I will often write coequalisers like the above one as

Categorifying this notion, the ring can be seen as a one-object category enriched over with object . The multiplication is recovered as function composition in and the addition is given by the abelian structure. A right -module is then an enriched functor and a left R-module is an enriched functor . Inserting the definition discussed above, we have that consists of a single object and a single map . Likewise, we obtain and in . Thus, we have induced arrows

Let us forget about enrichment for a while and just study ordinary categories now. The second observation we need is the well-known fact that any colimit can be represented as a coequaliser. Suppose to be a (cocomplete) category . Given a functor we can express its colimit as

Note that we can use what we learned about (-valued) copowers above and write as , or even , as is a set in this case. Behold:

What’s left is to define the two parallel arrows.3

1. One arrow is induced by the “projection” . Note that is really a copower and so the existence of such an arrow is not immediately clear. We have a functor and so is actually the application of the unique map4 to that functor; i.e.,

2. The other arrow is induced by a collection of actions of on , indexed by arrows in ; i.e.,

So that’s the story with expressing colimits as coequalisers. What’s next is that we need to completely reframe this in terms of actions. For the second arrow we are already done: can be seen as a left -module.

Using the symmetry of the Cartesian product of sets, the arrow can be reinterpreted as the components of a right action of on the terminal functor that sends every object to the one-element set :

Putting these two observations together, we really have two induced arrows with type signature

Inserting these into Equation , this yields

This is exactly the way the tensor product of bimodules is defined in Equation , hence it is very tempting to write the resulting coequaliser as . As such, a colimit of a functor over can be seen as a tensor product of functors with the terminal functor. Now, the terminal functor is not very interesting; what if we replace it with something more complicated? Well, that’s exactly the point where weighted colimits come into play! Using a weight instead of , we would end up with something like

Because this looks like a tensor product—and it’s universal, due to it being a colimit—it should support some sort of currying operation: given an arrow , for some object , we should be able to obtain an arrow . Now’s your time to guess what exactly a weighted colimit will be!

## Definition

Still in the non-enriched setting, let me now give you the formal definition of a weighted colimit. Suppose to be a small category. Let be a presheaf—the weight—and suppose we have a functor . The -weighted colimit of comprises an object , and a natural (in ) isomorphism

Note that, by the Yoneda lemma, the above isomorphism is uniquely determined by a natural transformation . As promised, this is exactly the representation we arrived at above.

A pair of an object and a natural transformation on their own; i.e., without the universal property, is what one would normally call a -weighted cocone.

## Enriched Weighted Colimits

The enriched definition is now exactly the same! If is a small -category and we have -functors and , then we can define the -weighted colimit of as an object , and a -natural (in ) isomorphism

This is the power of this definition—it extends in a straightforward way to the enriched setting. This may now be used to great effect: in case you know what this means, among other things weighted colimits can be used to define the right notion of enriched coend.

## Examples

It’s probably about time for some examples. For the first two, let us focus on cocones only; this is perhaps a little easier to understand than also throwing the universal property in there. I learned these from Richard Garner during BCQT 2022.

1. Suppose our diagram category is the category with two objects and one non-trivial morphism; i.e., . Further, assume that the weight picks out5 the unique arrow in . The functor we would like to look at sends to and to .

Again by the Yoneda lemma we have that a cocone is given by a natural transformation . In this restricted setting, an arrow just picks out two morphisms. Thus, the whole thing amounts to the commutativity of the following diagram:

In more plain language, we have a commutative diagram of the form

2. A slightly more complicated example is the following. Assume again that as above, only this time don’t work over but over . This means that the weight is now a functor from to . Suppose it picks out the arrow

where these are understood to be categories. Now, a weighted cocone becomes something 2-categorical. We still pick out arrows and , but since the category we are looking at is not the terminal one, but contains an isomorphism, the commutative diagram also becomes more complicated. Namely, we required the commutativity of

Instead of the requiring to equal , we now only require the existence of an invertible 2-cell that mediates between the two.

3. A subcategory of is said to be dense in if we can, in some sense, approximate the objects of well enough with only objects in (think of the density of inside ). Dense categories are nice because they often tell us a lot about their super categories and are sometimes easier to reason about. For example, the category of finite-dimensional (left-)comodules of any (possibly infinite-dimensional) Hopf algebra is dense inside the category of all comodules, which makes them much easier to work with than modules.

Formally, is dense in if the restricted Yoneda embedding along the inclusion functor

is still fully faithful. Another way of saying this is that every object is the -weighted colimit of . Indeed, the isomorphism we have for a weighted colimit specialised to our situation looks like

for all . This is exactly what it means for the above arrow to be fully faithful.

Exercise: Try to find a weight such that one recovers a normal, unweighted, cocone.

Exercise: As you can imagine 1. and 2. can be used to produce all kinds of relations between and . As such, prove the following statements:

• A variant of 1.: in the case of the weight being , we obtain a not-necessarily-commutative diagram.

• A variant of 2.: in the case that the weight is (i.e., we only have an arrow between 0 and 1 and not necessarily an isomorphism), we get an ordinary (non-invertible) 2-cell as the weighted cocone.

# Conclusion

And that’s it! I’ve found this intuition very helpful in trying to wrap my head around these concepts—hopefully other people will too. As a parting gift, I leave you with some more things to think about.

First, one of the most important examples of weighted colimits—and coends, of course—is the tensor product of functors. If you ever wanted to be a ninja, now is the time! It’s a fun operation to think about and play around with, and I would invite you to do just that.

Lastly, the category of weights is actually very special: it is the free cocompletion of . Every functor extends uniquely (up to unique isomorphism) to a cocontinuous functor to by the assignment (note the tensor product of functors!).

# (Re)sources

• Monoidal Category Theory:

• Saunders Mac Lane: “Natural associativity and commutativity”. In: Rice Univ. Stud. 49.4 (1963), pp. 28–46. issn: 0035-4996.

• Pavel Etingof, Shlomo Gelaki, Dmitri Nikshych, and Victor Ostrik: “Tensor categories”. In: Vol. 205. Mathematical Surveys and Monographs. American Mathematical Society, Providence, RI, 2015, pp. xvi+343.

• nLab: monoidal category

• Enriched Category Theory:

• Max Kelly: “Basic concepts of enriched category theory”. In: London Math. Soc. Lec. Note Series 64, Cambridge Univ. Press 1982, 245 pp. (ISBN:9780521287029).

Republished as: Reprints in Theory and Applications of Categories, No. 10 (2005) pp. 1-136 (link)

• nLab: enriched category

• Copowers:

• Weighted Colimits:

1. This is also sometimes called a cosmos.↩︎

2. If the category is locally small. I will ignore those kinds of technicalities for the purposes of this post.↩︎

3. I mostly follow Trimble and the nLab here. A more explicit description (in the case of limits, but it should be easy enough to dualise) is given, for example, in Category Theory in Context, Theorem 3.2.13.↩︎

4. The one-element set is the terminal object in , hence by definition there is exactly one arrow from any other set to it.↩︎

5. By sending to , to , and to .↩︎