### Review of the Elements of 2-Categories

#### Posted by Emily Riehl

*Guest post by Dimitri Zaganidis*

First of all, I would like to thank Emily for organizing the Kan extension seminar. It is a pleasure to be part of it. I want also to thank my advisor Kathryn Hess and my office mate Martina Rovelli for their revisions.

In the fifth installment of the Kan Extension Seminar we read the paper “Review of the Elements of 2-categories” by G.M Kelly and Ross Street. This article was published in the Proceedings of the Sydney Category Theory Seminar, and its purpose is to “serve as a common introduction to the authors’ paper in this volume”.

The article has three main parts, the first of them being definitions in elementary terms of double categories and 2-categories, together with the notion of pasting. In a second chapter, they review adjunctions in 2-categories with a nice expression of the naturality of the bijection given by mates using double categories. The last part of the article introduces monads in 2-categories, and specializing to 2-monads towards the end.

### Double categories and 2-categories

The article starts with the definition of a double category as a category object in the (not locally small) category of categories $\mathbf{CAT}$. (I think that there might be some set theoretic issues with such a category, but you can add small everywhere if you want to stay safe.)

The authors then switch to a description of such an object in terms of objects, horizontal arrows, vertical arrows, and squares, with various compositions and units. I will explain a bit how to go from one description to the other.

A category object is constituted of a category of objects, a category of morphisms, target and source functors, identity functor and a composition.

The category of objects is the category whose morphisms are “the objects” and whose morphisms are the vertical arrows. The category of morphisms is the category whose objects are the horizontal morphisms and whose morphisms are the squares, with vertical composition.

Since the functors $\mathrm{Obj}, \mathrm{Mor}: \mathbf{CAT} \longrightarrow \mathbf{SET}$ preserve pullbacks, by applying them to a double category seen as a category object, we get actual categories. Applying $\mathrm{Obj}$ to the double category, we get the category whose objects are “the objects” and whose morphisms are the horizontal arrows. Applying $\mathrm{Mor}$, we get the category whose objects are the vertical morphisms and whose morphisms are the squares, but this time with horizontal composition.

An interesting thing to notice is that the symmetry of the explicit description of a double category is much more apparent than the symmetry of its description as a category object.

One can define a $2$-category as a double category with a discrete category of objects, or as a $\mathbf{CAT}$-enriched category, exactly as one can define a simplicially enriched small category as either a category enriched over $\mathbf{sSet}$ or as a category object in $\mathbf{sSet}$ with a discrete simplicial set of objects.

The second viewpoint on 2-categories leads to definitions of 2-functors and 2-natural transformations and also to modifications, once one makes clear what enrichment a category of 2-functors inherits.

It is also worthwhile mentioning that the pasting operation makes computations easier to make, because they are more visual. The proof of proposition 2.1 of this paper is a good illustration of this.

The basic example of a 2-category is $\mathbf{CAT}$ itself, with natural transformations as 2-cells (squares).

As category theory describes set-like constructions, 2-category theory describes category-like constructions. You can usually build up categories with as objects sets with extra structure. In the same way, small V-categories, V-functors, and V-natural transformations form a 2-category.

My first motivation to learn about 2-categories was the 2-category of quasi-categories defined by Joyal and which has been studied by Emily Riehl and Dominic Verity in the article The 2-category theory of quasi-categories in particular the category-like constructions one can make with quasi-categories, such as adjunctions and limits.

### Adjunctions and mates in 2-categories

It is not a surprise that 2-categories are the right framework in which to define adjunctions. To build the general definition from the usual one, you just need to replace categories by objects in a 2-category, functors by 1-cells of the 2-category, and natural transformations by its 2-cells.

Adjunctions in a 2-category $\mathcal{C}$ compose (as in $\mathbf{CAT}$), and one can form two, a priori distinct double categories of adjunctions. Both of them will have the objects of $\mathcal{C}$ as objects and the horizontal morphisms being the morphisms of $\mathcal{C}$, while their vertical morphisms are the adjunctions (going in the same direction as the right adjoint, by convention). The two double categories differ on the squares. Given adjunctions $f \dashv u$ and $f' \dashv u'$ together with 1-cells $a:A \longrightarrow A'$ (between the domains of $u$ and $u'$) and $b:B \longrightarrow B'$ (between the codomains of $u$ and $u'$), the squares of the first double category are 2-cells $b u \Rightarrow u'a$ while the squares of the second are 2-cells $f'b \Rightarrow a f$.

Now, the bijective correspondence between these kind of 2-cells given by mates induces an isomorphism of double categories. This means in particular that the horizontal (or vertical) composite of mates is equal to the mate of the corresponding composite.

This is a very beautiful way to express the naturality of the mate correspondence, and it provides a one-line proof of the fact that two 1-cells that are left adjoints to a same 1-cell are naturally isomorphic.

### Monads in 2-categories

2-categories are also the right framework to define monads. A monad in a 2-category $\mathcal{C}$ and on an object $B$ is a 1-cell $t:B \longrightarrow B$ together with 2-cells $\mu: t^2 \Rightarrow t$ and $\eta: 1_B \Rightarrow t$, verifying the usual equations $\mu \circ (t\mu)= \mu \circ (\mu t)$ and $\mu \circ(t\eta) = 1_B = \mu \circ(\eta t)$. Since 2-functors preserve both horizontal and vertical compositions, for all objects $X$ of $\mathcal{C}$, $t$ induces a monad on $\mathcal{C}(X,B)$, given by post-composition $(t_{\ast},\mu_{\ast},\eta_{\ast})$. The authors call * an action of $t$ on $s:X \longrightarrow B$* a $t_\ast$ algebra structure on $s$.

The definition of monad morphism in this article is quite surprising for someone who has read the previous article by Ross Street, *The formal theory of monads*, which we read for the second meeting of the Kan extension seminar.

In Ross Street’s original paper, a monad morphism $(B,t,\mu, \eta) \longrightarrow (B',t',\mu', \eta')$ is a 1-cell $f: B \longrightarrow B'$ together with a $2$-cell $\phi: t'f \Rightarrow f t$ verifying certain conditions.

In this paper, morphisms of monads are defined only for monads on the same object, letting the $1$-cell part of a monad transformation of the previous article be the identity. This leads the authors to reverse the direction of the morphism, since the $2$-cell seems to go in the reverse direction of the $1$-cell!

One might think that fixing $f=1$ is needed by the result which explains that there is a bijection between monad morphisms $t \Rightarrow t'$ and actions of $t$ on $t'$ making $t'$ a “$(t,t')$-bimodule”. In fact, in the case where $f$ is not necessarily the identity, there is a bijection between 2-cells $\phi:t f \Rightarrow f t'$ such that $(f,\phi)$ is a monad functor and actions of $t$ on $ft'$ making $ft'$ a “$(t,t')$-bimodule”. A statement of the same kind can be also made for monad functor transformations (in the sense of the formal theory of monads). A 2-cell $\sigma : f \Rightarrow f'$ is a monad functor transformation $(f,\phi) \longrightarrow (f', \phi')$ if and only if $\sigma t': f t' \Rightarrow f' t'$ is a morphism of “$(t,t')$-bimodules”.

A 2-category admits the construction of algebras if for every monad $(B,t,\mu, \eta)$, the 2-functor $X \mapsto \mathcal {C}(X,B)^{(t_\ast, \mu_\ast, \eta_\ast)}$ is representable. The representing object is called the object of $t$-algebras. By Yoneda, the free-forgetful adjunction can be made internal in this case.

The terminology is justified, because in the $2$-category $\mathbf{CAT}$, it specializes to the usual notions of the category of $t$-algebras and the corresponding free-forgetful adjunction.

A monad in $\mathcal{C}$ is the same as a 2-functor $\mathbf{Mnd} \longrightarrow \mathcal{C}$, where $\mathbf{Mnd}$ is the 2-category with one object and $\Delta_+$, the algebraist’s simplicial category as monoidal hom-category (with ordinal sum). Since moreover, $\mathcal {C}(X,B)^{(t_\ast, \mu_\ast, \eta_\ast)} \cong [\mathbf{Mnd}, \CAT]( \Delta_{+\infty}, \mathcal{C}(X,-)),$ (where $\Delta_{+\infty}$ is the subcategory of maps of $\Delta$ preserving maxima, which is acted on by $\Delta_+$ via ordinal sum) one can see that the object of t-algebras can be expressed as a weighted limit.

As a consequence, it is not surprising that a 2-category admits the construction of algebras under some completeness assumptions.

### Doctrines

In the last part of the article, the authors review the notion of a doctrine, which is a 2-monad in 2-$\mathbf{CAT}$, i.e., a 2-functor $D: \mathcal {C} \longrightarrow \mathcal{C}$, where $\mathcal{C}$ is a 2-category, and 2-natural transformations $m$ and $j$, which are respectively the multiplication and the unit, verifying the usual identities. The fact that it is both a monad **on** a 2-category and **in** another one can be a bit disturbing at first.

If $(D,m,j)$ is a doctrine over a 2-category $\mathcal{C}$, then its algebras will be objects $X$ of $\mathcal{C}$ together with an action $DX \longrightarrow X$, exactly as in the case of algebras over a usual monad.

Already with morphisms, we can take advantage of the fact that a 2-category $\mathcal{C}$ has 2-cells, and define $D$-morphisms to be *lax* in the sense that the diagram
$\begin{matrix}
DX & \longrightarrow & DY \\
\downarrow & & \downarrow \\
X & \longrightarrow & Y
\end{matrix}$
is not supposed to be commutative, but is rather filled by a 2-cell with some coherence properties.

As one might expect, we can actually form a 2-category of such $D$-algebras by adding 2-cells, using again the $2$-cells existing in $\mathcal{C}$.

If we keep only the $D$-morphisms that are strict, we obtain the object of algebras (which should be a $2$-category) that we discussed before.

One example of a doctrine is $\Delta_+ \times - : \mathbf{CAT} \longrightarrow \mathbf{CAT}$ together with the multiplication induced by the ordinal sum, and unit given on $\mathcal {D}$ by the functor $\mathcal{D} \longrightarrow \Delta_+ \times \mathcal{D}$ that sends $d$ to $(\emptyset,d)$.

The algebras for this doctrine will be categories equipped with a monad acting on them, while the $D$-morphisms are transformations of monads, and the $D$-2-cells are exactly the monad functor transformations of Street’s article.

Here, since we have two different 2-categories of algebras (with strict $D$-morphisms or with all of them), one can wonder if monad morphisms $D \longrightarrow D'$ will induce $2$-functors $D'$-$\mathbf{Alg} \longrightarrow D$-$\mathbf{Alg}$ on the level of these $2$-categories.

This is indeed the case, and one can actually go even one step further and define monad modifications, using the fact that 2-$\mathbf{CAT}$ is in fact a 3-category! These modifications between two given monad morphisms are in fact in bijective correspondence with the 2-natural transformations between the $2$-functors induced by these monad morphisms on the level of algebras (with **lax** D-morphisms). Note that they are **not** the same as monad morphisms transformations of Street’s article.

This bijection is nice because it implies that you can compare 2-categories of algebras by only looking at the doctrines: if they are equivalent, so are the 2-categories of algebras.

The fact that this bijection does not hold when we restrict only to strict morphism was really surprising to me, but I guess this is the price to pay to use the 3-category structure.

During the last days of April, the Kan extension seminar will be reading the article “Two dimensional monad theory”, by Blackwell, Kelly and Powell. We will then have more to say about these 2-monads!

## Re: Review of the Elements of 2-Categories

In our discussion during the week, it was noted that the “naturality” of the mates bijection does not seem to resemble the more usual expressions of naturality, but is rather a matter of the correspondence respecting composition and identities, as mentioned in the paper and in Dimitri’s post. Emily mentioned that Eugenia Cheng suggests we call it “double functoriality”, which I think better conveys the result.

However, there are subtleties in understanding what we mean by this. We cannot expect the mate of an identity to be an identity (or an isomorphism): the familiar hom-set bijection of an adjunction is a special case of mateship (I wish I could draw the squares here!), hence the unit and counit of the adjunction are mates of identities, but they are not themselves isomorphisms in general.

Tim made a good comment on how to interpret the result in question in light of this subtlety, but I’ll leave that free for him to mention here.