# Kerodon

$\Newextarrow{\xRightarrow}{5,5}{0x21D2}$ $\newcommand\empty{}$

### 2.2.2 Examples of $2$-Categories

We now collect some examples of $2$-categories which arise naturally.

Example 2.2.2.1 (Cospans). Let $\operatorname{\mathcal{C}}$ be a category containing a pair of objects $X$ and $Y$. A cospan from $X$ to $Y$ is an object $B \in \operatorname{\mathcal{C}}$ together with a pair of morphisms $X \xrightarrow {f} B \xleftarrow {g} Y$ in $\operatorname{\mathcal{C}}$. The cospans from $X$ to $Y$ can be regarded as the objects of a category $\operatorname{\mathcal{B}}_{X,Y}$, where a morphism from $(B,f,g)$ to $(B',f',g')$ in $\operatorname{\mathcal{B}}_{X,Y}$ is a morphism $u: B \rightarrow B'$ in the category $\operatorname{\mathcal{C}}$ which satisfies $f' = u \circ f$ and $g' = u \circ g$, so that the diagram

$\xymatrix@R =50pt@C=50pt{ & B \ar [dd]^{u} & \\ X \ar [ur]^{f} \ar [dr]_{f'} & & Y \ar [ul]_{g} \ar [dl]^{g'} \\ & B' & }$

is commutative.

Assume now that the category $\operatorname{\mathcal{C}}$ admits pushouts. We can then construct a $2$-category $\operatorname{Cospan}(\operatorname{\mathcal{C}})$ as follows:

• The objects of $\operatorname{Cospan}(\operatorname{\mathcal{C}})$ are the objects of $\operatorname{\mathcal{C}}$.

• For every pair of objects $X,Y \in \operatorname{\mathcal{C}}$, we define $\underline{\operatorname{Hom}}_{ \operatorname{Cospan}(\operatorname{\mathcal{C}})}(X,Y)$ to be the category $\operatorname{\mathcal{B}}_{X,Y}$; in particular, $1$-morphisms from $X$ to $Y$ in the $2$-category $\operatorname{Cospan}(\operatorname{\mathcal{C}})$ can be identified with cospans from $X$ to $Y$.

• For every triple of objects $X,Y,Z \in \operatorname{\mathcal{C}}$, the composition law

$\circ : \underline{\operatorname{Hom}}_{\operatorname{Cospan}(\operatorname{\mathcal{C}})}( Y, Z) \times \underline{\operatorname{Hom}}_{\operatorname{Cospan}(\operatorname{\mathcal{C}})}( X, Y) \rightarrow \underline{\operatorname{Hom}}_{ \operatorname{Cospan}(\operatorname{\mathcal{C}})}( X, Z )$

is given on objects by the construction $(C, B) \mapsto C \amalg _{Y} B$.

• For every object $X \in \operatorname{\mathcal{C}}$, the identity $1$-morphism from $X$ to itself in $\operatorname{\mathcal{C}}$ is given by the cospan $X \xrightarrow { \operatorname{id}_ X } X \xleftarrow { \operatorname{id}_ X} X$, and the unit constraint $\upsilon _{X}$ is given by the canonical isomorphism $X \amalg _{X} X \xrightarrow {\sim } X$.

• For every triple of composable $1$-morphisms

$W \xrightarrow {A} X \xrightarrow {B} Y \xrightarrow {C} Z$

in $\operatorname{Cospan}(\operatorname{\mathcal{C}})$, the associativity constraint $\alpha _{C,B,A}$ is the canonical isomorphism of iterated pushouts

$C \amalg _{Y} (B \amalg _{X} A) \xrightarrow {\sim } (C \amalg _{Y} B) \amalg _{X} A.$

We will refer to $\operatorname{Cospan}(\operatorname{\mathcal{C}})$ as the $2$-category of cospans in $\operatorname{\mathcal{C}}$.

Variant 2.2.2.2 (Spans). Let $\operatorname{\mathcal{C}}$ be a category. If $X$ and $Y$ are objects of $\operatorname{\mathcal{C}}$, we define a span from $X$ to $Y$ to be a diagram $X \leftarrow M \rightarrow Y$ in the category $\operatorname{\mathcal{C}}$. If $\operatorname{\mathcal{C}}$ admits fiber products, then we can dualize Example 2.2.2.1 to produce a $2$-category $\operatorname{Span}(\operatorname{\mathcal{C}})$ having the same objects, where $1$-morphisms from $X$ to $Y$ in $\operatorname{Span}(\operatorname{\mathcal{C}})$ are given by spans from $X$ to $Y$ in $\operatorname{\mathcal{C}}$. More precisely, we define $\operatorname{Span}(\operatorname{\mathcal{C}})$ to be the conjugate of the $2$-category $\operatorname{Cospan}( \operatorname{\mathcal{C}}^{\operatorname{op}} )$.

Remark 2.2.2.3. Let $\operatorname{\mathcal{C}}$ be a category which admits finite limits, and let $\mathbf{1}$ denote a final object of $\operatorname{\mathcal{C}}$. Then the endomorphism category $\underline{\operatorname{End}}_{ \operatorname{Span}(\operatorname{\mathcal{C}}) }( \mathbf{1} )$ can be identified with the category $\operatorname{\mathcal{C}}$ itself, equipped with the Cartesian monoidal structure of Example 2.1.3.2.

Example 2.2.2.4 (Bimodules). We define a $2$-category $\mathrm{Bimod}$ as follows:

• The objects of $\mathrm{Bimod}$ are associative rings.

• For every pair of associative rings $A$ and $B$, we take $\underline{\operatorname{Hom}}_{\mathrm{Bimod}}( B, A)$ to be the category whose objects are $A$-$B$ bimodules: that is, abelian groups $M = {}_{A}^{}M_{B}$ equipped with commuting actions of $A$ on the left and $B$ on the right.

• For every triple of associative rings $A$, $B$, and $C$, we take the composition law

$\underline{\operatorname{Hom}}_{\mathrm{Bimod}}( B, A) \times \underline{\operatorname{Hom}}_{\mathrm{Bimod}}( C,B ) \rightarrow \underline{\operatorname{Hom}}_{\mathrm{Bimod}}( C, A)$

to be the relative tensor product functor

$( M, N ) \mapsto M {\otimes _{B}} N$
• For every associative ring $A$, we take the identity object of $\underline{\operatorname{Hom}}_{\mathrm{Bimod}}( A, A)$ to be the ring $A$ (regarded as a bimodule over itself) and the unit constraint $\upsilon _{A}: A \otimes _{A} A \xrightarrow {\sim } A$ is the map given by $\upsilon _{A}(x \otimes y) = xy$.

• For every quadruple of associative rings $A$, $B$, $C$, and $D$ equipped with bimodules $M = {}_{A}^{}M_ B$, $N = {}_{B}^{}N_ C$, and $P = {}_{C}^{}P_ D$, we define the associativity constraint

$\alpha _{M,N,P}: M \otimes _{B} (N \otimes _{C} P) \xRightarrow {\sim } ( M \otimes _{B} N) \otimes _{C} P$

to be the isomorphism characterized by the identity $\alpha _{M, N, P}(x \otimes (y \otimes z)) = (x \otimes y) \otimes z$.

Example 2.2.2.5 (Delooping a Monoidal Category). Let $\operatorname{\mathcal{C}}$ be a monoidal category. We define a $2$-category $B\operatorname{\mathcal{C}}$ as follows:

• The $2$-category $B\operatorname{\mathcal{C}}$ has a single object, which we will denote by $X$.

• The category $\underline{\operatorname{Hom}}_{B\operatorname{\mathcal{C}}}(X,X)$ is the category $\operatorname{\mathcal{C}}$.

• The composition functor

$\circ : \underline{\operatorname{Hom}}_{B\operatorname{\mathcal{C}}}(X,X) \times \underline{\operatorname{Hom}}_{B\operatorname{\mathcal{C}}}(X,X) \rightarrow \underline{\operatorname{Hom}}_{B\operatorname{\mathcal{C}}}(X,X)$

is the tensor product functor $\otimes : \operatorname{\mathcal{C}}\times \operatorname{\mathcal{C}}\rightarrow \operatorname{\mathcal{C}}$.

• The identity morphism $\operatorname{id}_{X} \in \underline{\operatorname{Hom}}_{B\operatorname{\mathcal{C}}}( X, X)$ is the unit object $\mathbf{1} \in \operatorname{\mathcal{C}}$.

• The associativity and unit constraints of $B\operatorname{\mathcal{C}}$ are the associativity and unit constraints for the monoidal structure on $\operatorname{\mathcal{C}}$.

We will refer to the $2$-category $B \operatorname{\mathcal{C}}$ as the delooping of $\operatorname{\mathcal{C}}$. Note that $B\operatorname{\mathcal{C}}$ is strict as a $2$-category if and only if the monoidal structure on $\operatorname{\mathcal{C}}$ is strict (in which case we recover the delooping construction of Example 2.2.0.8). The construction $\operatorname{\mathcal{C}}\mapsto B \operatorname{\mathcal{C}}$ induces a bijection

$\{ \text{Monoidal Categories \operatorname{\mathcal{C}}} \} \xrightarrow {\sim } \{ \text{2-Categories \operatorname{\mathcal{E}} with \operatorname{Ob}(\operatorname{\mathcal{E}}) = \{ X \} } \}$

which can be viewed as an equivalence of categories (see Remark 2.2.5.8).

Remark 2.2.2.6. Let $M$ be a monoid, which we view as a (strict) monoidal category having only identity morphisms. Then the $2$-category $BM$ of Example 2.2.2.5 can be identified with the ordinary category $BM$ appearing in Remark 2.1.0.6.