# Kerodon

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

### 5.1.3 The Grothendieck Construction

We now introduce generalizations of Construction 5.1.1.1 and Variant 5.1.1.2. Throughout this section, we let $\mathbf{Cat}$ denote the (strict) $2$-category of small categories (Example 2.2.0.4).

Construction 5.1.3.1. Let $\operatorname{\mathcal{C}}$ be a category and let $\mathscr {F}: \operatorname{\mathcal{C}}^{\operatorname{op}} \rightarrow \mathbf{Cat}$ be a lax functor of $2$-categories (Definition 2.2.4.5). We define a category $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ as follows:

• The objects of $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ are pairs $(C, X)$, where $C$ is an object of $\operatorname{\mathcal{C}}$ and $X$ is an object of the category $\mathscr {F}(C)$.

• Let $(C,X)$ and $(D,Y)$ be objects of $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$. Then a morphism from $(C,X)$ to $(D,Y)$ in the category $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ is a pair $(f,u)$, where $f: C \rightarrow D$ is a morphism in the category $\operatorname{\mathcal{C}}$ and $u: X \rightarrow \mathscr {F}(f)(Y)$ is a morphism in the category $\mathscr {F}(C)$.

• Let $(f,u): (C,X) \rightarrow (D,Y)$ and $(g,v): (D,Y) \rightarrow (E,Z)$ be morphisms in the category $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$. Then the composition $(g,v) \circ (f,u)$ is the pair $(g \circ f, w)$, where $w: X \rightarrow \mathscr {F}( g \circ f)(Z)$ is the morphism of $\mathscr {F}(C)$ given by the composition

$X \xrightarrow { u } \mathscr {F}(f)(Y) \xrightarrow { \mathscr {F}(f)(v) } (\mathscr {F}(f) \circ \mathscr {F}(g))(Z) \xrightarrow { \mu _{f,g}(Z) } \mathscr {F}(g \circ f)(Z),$

where $\mu _{f,g}: \mathscr {F}(f) \circ \mathscr {F}(g) \rightarrow \mathscr {F}( g \circ f)$ denotes the composition constraint for the lax functor $\mathscr {F}$.

We will refer to $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ as the Grothendieck construction on the lax functor $\mathscr {F}$.

Proposition 5.1.3.2. Let $\operatorname{\mathcal{C}}$ be a category and let $\mathscr {F}: \operatorname{\mathcal{C}}^{\operatorname{op}} \rightarrow \mathbf{Cat}$ be a lax functor of $2$-categories. Then the Grothendieck construction $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ is well-defined: that is, the composition law described in Construction 5.1.3.1 is unital and associative.

Proof. Let $(D,Y)$ be an object of $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$. We let $\operatorname{id}_{ (D,Y)}$ denote the morphism from $(D,Y)$ to itself given by the pair $(\operatorname{id}_{D}, \epsilon _{D}(Y) )$, where $\epsilon _{D}: \operatorname{id}_{ \mathscr {F}(D) } \rightarrow \mathscr {F}( \operatorname{id}_{D} )$ is the identity constraint for the lax functor $\mathscr {F}$. We first show that $\operatorname{id}_{(D,Y)}$ is a (two-sided) unit for the composition law on $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$. We consider two cases:

• Let $(C,X)$ be another object of $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ and let $(f,u): (C,X) \rightarrow (D,Y)$ be a morphism in $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$. We wish to show that the composition $\operatorname{id}_{(D,Y)} \circ (f,u)$ is equal to $(f,u)$ (as a morphism from $(C,X)$ to $(D,Y)$). Unwinding the definitions, this is equivalent to the assertion that the morphism $u: X \rightarrow \mathscr {F}(f)(Y)$ is equal to the composition

$X \xrightarrow {u} \mathscr {F}(f)(Y) \xrightarrow { \mathscr {F}(f)( \epsilon _ D(Y) ) } (\mathscr {F}(f) \circ \mathscr {F}(\operatorname{id}_ D))(Y) \xrightarrow { \mu _{f, \operatorname{id}_{D} }(Y) } \mathscr {F}(f)(Y).$

This follows from the observation that the composite transformation

$\mathscr {F}(f) \xrightarrow { \epsilon _ D } \mathscr {F}(f) \circ \operatorname{id}_ D \xrightarrow { \mu _{f, \operatorname{id}_{D} } } \mathscr {F}(f)$

is the identity, which follows from axiom $(b)$ of Definition 2.2.4.5.

• Let $(E,Z)$ be another object of $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$, and let $(g,v): (D,Y) \rightarrow (E,Z)$ be a morphism in $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$. We wish to show that the composition $(g,v) \circ \operatorname{id}_{(D,Y)}$ is equal to $(g,v)$ (as a morphism from $(D,Y)$ to $(E,Z)$). Unwinding the definitions, this is equivalent to the assertion that the morphism $v: Y \rightarrow \mathscr {F}(g)(Z)$ is given by the upper cycle in the diagram

$\xymatrix@R =50pt@C=50pt{ Y \ar [r]^-{ \epsilon _{D}(Y) } \ar [d]^{v} & \mathscr {F}(\operatorname{id}_ D)(Y) \ar [d]^{ \mathscr {F}(\operatorname{id}_ D)(v) } & \\ \mathscr {F}(v)(Z) \ar [r]^-{\epsilon _ D( \mathscr {F}(v)(Z) )} & (\mathscr {F}(\operatorname{id}_ D) \circ \mathscr {F}(v))(Z) \ar [r]^-{ \mu _{\operatorname{id}_{D}, v)}(Z)} & \mathscr {F}(v)(Z). }$

Since $\epsilon _{D}$ is a natural transformation, this diagram commutes. It will therefore suffice to show that the lower composition is equal to $v$, which follows from axiom $(a)$ of Definition 2.2.4.5.

We now show that composition of morphisms in $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ is associative. Suppose we are given a composable sequence

$(B,W) \xrightarrow { (e,t) } (C,X) \xrightarrow { (f,u) } (D,Y) \xrightarrow { (g,v) } (E,Z)$

of morphisms of $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$. Unwinding the definitions, we obtain equalities

$(g,v) \circ ( (f,u) \circ (e,t) ) = (g \circ f \circ e, w \circ \mathscr {F}(e)(u) \circ t)$

$( (g,v) \circ (f,u) ) \circ (e,t) ) = (g \circ f \circ e, w' \circ \mathscr {F}(e)(u) \circ t),$

where $w,w': (\mathscr {F}(e) \circ \mathscr {F}(f))(Y) \rightarrow \mathscr {F}(g \circ f \circ e)(Z)$ are the morphisms in the category $\mathscr {F}(B)$ given by clockwise and counterclockwise composition in the diagram

$\xymatrix@R =50pt@C=50pt{ (\mathscr {F}(e) \circ \mathscr {F}(f))(Y) \ar [r]^-{ \mu _{e,f}(Y) } \ar [d]^{ (\mathscr {F}(e) \circ \mathscr {F}(f))(v) } & \mathscr {F}(f \circ e)(Y) \ar [d]^{ \mathscr {F}(f \circ e)(v)} \\ (\mathscr {F}(e) \circ \mathscr {F}(f) \circ \mathscr {F}(g))(Z) \ar [d]^{\mathscr {F}(e)(\mu _{g,f}(Z)) } \ar [r]^-{ \mu _{e,f}( \mathscr {F}(g)(Z) )} & (\mathscr {F}(f \circ e) \circ \mathscr {F}(g) )(Z) \ar [d]^{\mu _{g,f \circ e}(Z) } \\ (\mathscr {F}(e) \circ \mathscr {F}(g \circ f)) \ar [r]^-{ \mu _{e,g\circ f}(Z) } & \mathscr {F}( g \circ f \circ e)(Z), }$

respectively. It will therefore suffice to show that this diagram commutes. For the upper square, this follows from the naturality of the composition constraint $\mu _{e,f}$. For the lower square, it follows from axiom $(c)$ of Definition 2.2.4.5. $\square$

Variant 5.1.3.3 (Covariant Grothendieck Construction). Let $\operatorname{\mathcal{C}}$ be a category and let $\mathscr {F}$ be a colax functor from $\operatorname{\mathcal{C}}$ to the $2$-category $\mathbf{Cat}$: that is, a lax functor of $2$-categories $\operatorname{\mathcal{C}}\rightarrow \mathbf{Cat}^{\operatorname{c}}$, where $\mathbf{Cat}^{\operatorname{c}}$ is the conjugate of the $2$-category $\mathbf{Cat}$ (Construction 2.2.3.4). We define a category $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$ as follows:

• The objects of $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$ are pairs $(C, X)$, where $C$ is an object of $\operatorname{\mathcal{C}}$ and $X$ is an object of the category $\mathscr {F}(C)$.

• Let $(C,X)$ and $(D,Y)$ be objects of $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$. Then a morphism from $(C,X)$ to $(D,Y)$ in the category $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$ is a pair $(f,u)$, where $f: C \rightarrow D$ is a morphism in the category $\operatorname{\mathcal{C}}$ and $u: \mathscr {F}(f)(X) \rightarrow Y$ is a morphism in the category $\mathscr {F}(D)$.

• Let $(f,u): (C,X) \rightarrow (D,Y)$ and $(g,v): (D,Y) \rightarrow (E,Z)$ be morphisms in the category $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$. Then the composition $(g,v) \circ (f,u)$ is the pair $(g \circ f, w)$, where $w: \mathscr {F}(g \circ f)(X) \rightarrow Z$ is the morphism of $\mathscr {F}(E)$ given by the composition

$\mathscr {F}(g \circ f)(X) \xrightarrow { \mu _{g,f}(X)} (\mathscr {F}(g) \circ \mathscr {F})(X) \xrightarrow { \mathscr {F}(g)(u) } \mathscr {F}(g)(Y) \xrightarrow {v} Z,$

where $\mu _{g,f}: \mathscr {F}( g \circ f) \rightarrow \mathscr {F}(g) \circ \mathscr {F}(f)$ denotes the composition constraint for $\mathscr {F}$.

We will refer to $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$ as the Grothendieck construction on $\mathscr {F}$.

If $\mathscr {F}: \operatorname{\mathcal{C}}\rightarrow \mathbf{Cat}$ is a functor of $2$-categories, then it induces a conjugate functor

$\mathscr {F}^{\operatorname{c}}: \operatorname{\mathcal{C}}= \operatorname{\mathcal{C}}^{\operatorname{c}} \rightarrow \mathbf{Cat}^{\operatorname{c}}$

(see Remark 2.2.5.10). In this case, we will abuse notation by denoting the Grothendieck construction $\int _{\operatorname{\mathcal{C}}} \mathscr {F}^{\operatorname{c}}$ simply by $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$.

Remark 5.1.3.4. Let $\operatorname{\mathcal{C}}$ be a category and let $\mathscr {F}: \operatorname{\mathcal{C}}\rightarrow \mathbf{Cat}^{\operatorname{c}}$ be lax functor of $2$-categories. Then the construction $(C \in \operatorname{\mathcal{C}}) \mapsto \mathscr {F}(C)^{\operatorname{op}}$ determines a lax functor of $2$-categories $\mathscr {F}^{\operatorname{op}}: \operatorname{\mathcal{C}}= (\operatorname{\mathcal{C}}^{\operatorname{op}})^{\operatorname{op}} \rightarrow \mathbf{Cat}$. In this case, we have a canonical isomorphism of categories

$\int ^{ \operatorname{\mathcal{C}}^{\operatorname{op}} }(\mathscr {F}^{\operatorname{op}} ) \simeq ( \int _{\operatorname{\mathcal{C}}} \mathscr {F})^{\operatorname{op}},$

where the left hand side is given by Construction 5.1.3.1 and the right hand side by Variant 5.1.3.3.

Example 5.1.3.5 (Set-Valued Functors). Let $\operatorname{\mathcal{C}}$ be a category and let $\mathscr {F}: \operatorname{\mathcal{C}}^{\operatorname{op}} \rightarrow \operatorname{Set}$ be a functor from $\operatorname{\mathcal{C}}^{\operatorname{op}}$ to the category of sets. Then we can also regard $\mathscr {F}$ as a (lax) functor from $\operatorname{\mathcal{C}}^{\operatorname{op}}$ to the $2$-category $\mathbf{Cat}$ (by composing with the fully faithful embedding $\operatorname{Set}\hookrightarrow \mathbf{Cat}$, carrying each set $S$ to the associated discrete category). In this case, the Grothendieck construction $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ of Construction 5.1.3.1 can be identified with the category of elements of $\mathscr {F}$ defined in Variant 5.1.1.2. Similarly, for every functor $\mathscr {F}: \operatorname{\mathcal{C}}\rightarrow \operatorname{Set}$, the covariant Grothendieck construction $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$ of Variant 5.1.3.3 can be identified with the category of elements of $\mathscr {F}$ defined in Construction 5.1.1.1.

Example 5.1.3.6. Let $\mathscr {I}$ denote the inclusion from the ordinary category $\operatorname{Cat}$ (regarded as a $2$-category having only identity $2$-morphisms) to the $2$-category $\mathbf{Cat}$, and let $\operatorname{Cat}_{\ast }^{\mathrm{lax}}$ denote the Grothendieck construction $\int _{\operatorname{Cat}} \mathscr {I}$. The category $\operatorname{Cat}_{\ast }^{\mathrm{lax}}$ can be described concretely as follows:

• The objects of $\operatorname{Cat}_{\ast }^{\mathrm{lax}}$ are pairs $(\operatorname{\mathcal{C}}, X)$, where $\operatorname{\mathcal{C}}$ is a category and $X$ is an object of $\operatorname{\mathcal{C}}$.

• A morphism from $(\operatorname{\mathcal{C}}, X)$ to $(\operatorname{\mathcal{D}}, Y)$ is a pair $(F, u)$, where $F: \operatorname{\mathcal{C}}\rightarrow \operatorname{\mathcal{D}}$ is a functor and $u: F(X) \rightarrow Y$ is a morphism in the category $\operatorname{\mathcal{D}}$.

• If $(F,u): (\operatorname{\mathcal{C}}, X) \rightarrow (\operatorname{\mathcal{D}}, Y)$ and $(G,v): (\operatorname{\mathcal{D}}, Y) \rightarrow (\operatorname{\mathcal{E}}, Z)$ are morphisms in $\operatorname{Cat}_{\ast }^{\mathrm{lax}}$, then their composition is the pair $(G \circ F, w)$, where $w$ is the morphism of $\operatorname{\mathcal{E}}$ given by the composition

$(G \circ F)(X) \xrightarrow { G(u) } G(Y) \xrightarrow {v} Z.$

Example 5.1.3.7 (Kleisli Categories). Let $\operatorname{\mathcal{C}}= [0]$ denote the category having a single object and a single morphism. By virtue of Example 2.2.4.10, we can identify lax functors $\mathscr {F}: \operatorname{\mathcal{C}}^{\operatorname{op}} \rightarrow \mathbf{Cat}$ with pairs $(\operatorname{\mathcal{E}}, T)$, where $\operatorname{\mathcal{E}}$ is a category and $T$ is a monad on $\operatorname{\mathcal{E}}$: that is, a functor from $\operatorname{\mathcal{E}}$ to itself which is equipped with unit and multiplication maps

$\epsilon : \operatorname{id}_{\operatorname{\mathcal{E}}} \rightarrow T \quad \quad \mu : T \circ T \rightarrow T$

which endow $T$ with the structure of an associative algebra object of the category of endofunctors $\operatorname{Fun}(\operatorname{\mathcal{E}}, \operatorname{\mathcal{E}})$. In this case, the Grothendieck construction $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ can be identified with the Kleisli category of the monad $T$. Concretely, it can be described as follows:

• The objects of $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ are the objects of the category $\operatorname{\mathcal{E}}$.

• For every pair objects $X,Y \in \operatorname{\mathcal{E}}$, we have $\operatorname{Hom}_{ \int ^{\operatorname{\mathcal{C}}} \mathscr {F} }( X, Y) = \operatorname{Hom}_{\operatorname{\mathcal{E}}}( X, T(Y) )$.

• Let $u: X \rightarrow Y$ and $v: Y \rightarrow Z$ be morphisms in the category $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$, corresponding to a pair of morphisms $u': X \rightarrow T(Y)$ and $v': Y \rightarrow T(Z)$ in the category $\operatorname{\mathcal{E}}$. Then the composition $v \circ u$ in $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ corresponds to the composite map

$X \xrightarrow {u} T(Y) \xrightarrow { T(v) } (T \circ T)(Z) \xrightarrow { \mu (Z) } T(Z)$

in the category $\operatorname{\mathcal{E}}$.

Remark 5.1.3.8. In the situation of Example 5.1.3.7, the Kleisli category $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ is equipped with a comparison functor $H: \operatorname{\mathcal{E}}\rightarrow \int ^{\operatorname{\mathcal{C}}} \mathscr {F}$, which carries each object of $\operatorname{\mathcal{E}}$ to itself and each morphism $u: X \rightarrow Y$ in $\operatorname{\mathcal{E}}$ to the composite morphism $X \xrightarrow {u} Y \xrightarrow { \epsilon (Y) } T(Y)$ (regarded as a morphism from $X$ to $Y$ in the category $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$). The following conditions are equivalent:

• The functor $H$ is an equivalence of categories.

• The functor $H$ is an isomorphism of categories.

• The unit map $\epsilon : \operatorname{id}_{\operatorname{\mathcal{E}}} \rightarrow T$ is an isomorphism of functors.

Notation 5.1.3.9. Let $\operatorname{\mathcal{C}}$ be a category and let $\mathscr {F}: \operatorname{\mathcal{C}}^{\operatorname{op}} \rightarrow \mathbf{Cat}$ be a lax functor of $2$-categories. Then the Grothendieck construction $\int ^{\operatorname{\mathcal{C}}} \mathscr {F}$ is equipped with a forgetful functor $U: \int ^{\operatorname{\mathcal{C}}} \mathscr {F} \rightarrow \operatorname{\mathcal{C}}$, given on objects by the construction $(C,X) \mapsto C$ and on morphisms by the construction $(f,u) \mapsto f$. Similarly, if $\mathscr {F}: \operatorname{\mathcal{C}}\rightarrow \mathbf{Cat}^{\operatorname{c}}$ is a lax functor, then the Grothendieck construction $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$ of Variant 5.1.3.3 is equipped with a forgetful $U: \int _{\operatorname{\mathcal{C}}} \mathscr {F} \rightarrow \operatorname{\mathcal{C}}$.

Remark 5.1.3.10. Let $V: \operatorname{\mathcal{D}}\rightarrow \operatorname{\mathcal{C}}$ be a functor between categories. If $\mathscr {F}: \operatorname{\mathcal{C}}^{\operatorname{op}} \rightarrow \mathbf{Cat}$ is a lax functor of $2$-categories, then the composition $(\mathscr {F} \circ V^{\operatorname{op}} ): \operatorname{\mathcal{D}}^{\operatorname{op}} \rightarrow \mathbf{Cat}$ is also a lax functor of $2$-categories, and we have a pullback diagram of categories

$\xymatrix@R =50pt@C=50pt{ \int ^{\operatorname{\mathcal{D}}}( \mathscr {F} \circ V^{\operatorname{op}} ) \ar [r] \ar [d] & \int ^{\operatorname{\mathcal{C}}} \mathscr {F} \ar [d] \\ \operatorname{\mathcal{D}}\ar [r]^-{V} & \operatorname{\mathcal{C}}}$

where the vertical maps are the forgetful functors of Notation 5.1.3.9. Similarly, if $\mathscr {F}: \operatorname{\mathcal{C}}\rightarrow \mathbf{Cat}^{\operatorname{c}}$ is a lax functor of $2$-categories, then we have a pullback diagram

$\xymatrix@R =50pt@C=50pt{ \int _{\operatorname{\mathcal{D}}}( \mathscr {F} \circ V ) \ar [r] \ar [d] & \int _{\operatorname{\mathcal{C}}} \mathscr {F} \ar [d] \\ \operatorname{\mathcal{D}}\ar [r]^-{V} & \operatorname{\mathcal{C}}. }$

Example 5.1.3.11. Let $\operatorname{\mathcal{C}}$ be a category and let $\mathscr {F}: \operatorname{\mathcal{C}}\rightarrow \operatorname{Cat}$ be a functor between ordinary categories, which we can identify with a strict functor from $\operatorname{\mathcal{C}}$ to the $2$-category $\mathbf{Cat}$. Applying Remark 5.1.3.10, we deduce that the Grothendieck construction $\int _{\operatorname{\mathcal{C}}} \mathscr {F}$ fits into a pullback diagram

$\xymatrix@R =50pt@C=50pt{ \int _{\operatorname{\mathcal{C}}} \mathscr {F} \ar [d] \ar [r] & \operatorname{Cat}_{\ast }^{\mathrm{lax}} \ar [d] \\ \operatorname{\mathcal{C}}\ar [r]^-{\mathscr {F}} & \operatorname{Cat}. }$

Example 5.1.3.12 (Fibers of the Grothendieck Construction). Let $\operatorname{\mathcal{C}}$ be a category, let $\mathscr {F}: \operatorname{\mathcal{C}}^{\operatorname{op}} \rightarrow \mathbf{Cat}$ be a lax functor of $2$-categories, and let $U: (\int ^{\operatorname{\mathcal{C}}} \mathscr {F}) \rightarrow \operatorname{\mathcal{C}}$ be the forgetful functor of Remark 5.1.3.8. Let $C$ be an object of $\operatorname{\mathcal{C}}$. Combining Remark 5.1.3.10 with Example 5.1.3.7, we deduce that the fiber

$(\int ^{\operatorname{\mathcal{C}}} \mathscr {F})_{C} = \{ C\} \times _{ \operatorname{\mathcal{C}}} (\int ^{\operatorname{\mathcal{C}}} \mathscr {F})$

can be identified with the Kleisli category of $\mathscr {F}(\operatorname{id}_ C)$, regarded as a monad on the category $\mathscr {F}(C)$. Remark 5.1.3.8 then supplies a comparison map $\mathscr {F}(C) \rightarrow (\int ^{\operatorname{\mathcal{C}}} \mathscr {F})_{C}$, which is an isomorphism of categories if and only if the unit constraint $\epsilon _{C}: \operatorname{id}_{ \mathscr {F}(C) } \rightarrow \mathscr {F}(\operatorname{id}_ C)$ is an isomorphism. In particular, if the lax functor $\mathscr {F}$ is unitary (Definition 2.2.4.17), then its values can be identified with the fibers of the forgetful functor $U$.