In the previous chapters of this book, we have introduced various axioms for constructing and manipulating categories, and we used these axioms to build up some basic category theory. We will sometimes refer to this theory as the ‘external’ category theory: the notion of ‘category’ is taken for granted, and it is up to the user of the theory to interpret it in different contexts.
In this section, we will study ‘internal’ category theory. Recall that we introduced the universe of categories \(\Cat\) in the previous section, whose objects we may think of as small categories. We construct the internal versions of the basic categorical operations needed below: initial and terminal objects, products and coproducts, pullbacks, and functor categories. These operations will be used to define the universe \(\An\) of animae and to express the cocartesian-fibration condition internally in \(\Cat\). We refer to this collection of constructions as ‘internal category theory in \(\Cat\)’.
8.5.1 Constructions of categories
We start by discussing internal versions of initial/terminal categories, products/coproducts, pullbacks and functor categories.
Products and coproducts
Notation 8.5.1 (Initial/terminal categories). By condition (Cat2) and Lemma 8.4.9, the terminal category \(*\) and the initial category \(\emptyset\) are both small, hence are classified by objects \(\floor{*}\) and \(\floor{\emptyset}\) of \(\Cat\):
Lemma 8.5.2. The object \(\floor{*} \in \Cat\) is terminal. The object \(\floor{\emptyset} \in \Cat\) is initial.
Proof
We start with the statement about \(\floor{*}\). By Lemma 6.1.10, it suffices to show that for any other object \(c \in \Cat\) the hom anima \(\Hom_{\Cat}(c,\floor{*})\) is contractible. By directed univalence, this anima is equivalent to \(\Map(C,*)\), where \(C\) is the small category classified by \(c\). But we have \(\Fun(C,*) \iso *\) by Lemma 1.7.9 and \(*^{\simeq} \iso *\) by Example 2.4.4.
The argument for \(\floor{\emptyset}\) is analogous, except that we use the equivalence \(\Fun(\emptyset,C) \iso *\) from Lemma 1.7.14.
Notation 8.5.3 (Products). By Lemma 8.4.14, the product functor \(\pi_{\univ} \times \pi_{\univ} \colon \Cat_{\bullet} \times \Cat_{\bullet} \to \Cat \times \Cat\) is a small cocartesian fibration, and hence is classified by some functor \(- \times -\colon \Cat \times \Cat \to \Cat\):
Given two objects \(c\) and \(d\) of \(\Cat\) corresponding to small categories \(C\) and \(D\), note that the fiber of \(\pi_{\univ} \times \pi_{\univ}\) over \((c,d)\) is the product category \(C \times D\), so that the functor \(- \times -\colon \Cat \times \Cat \to \Cat\) does indeed encode the product of categories.
Notation 8.5.4 (Coproducts). By Lemma 8.4.13, the coproduct functor
\[
\lra{\pi_{\univ} \times \id, \id \times \pi_{\univ}} \colon (\Cat_{\bullet} \times \Cat) \sqcup (\Cat \times \Cat_{\bullet}) \to \Cat \times \Cat
\]
is a small cocartesian fibration, and hence is classified by some functor \(- \sqcup - \colon \Cat \times \Cat \to \Cat\):
Given two objects \(c\) and \(d\) of \(\Cat\) corresponding to small categories \(C\) and \(D\), note that the fiber of the left vertical map over \((c,d)\) is the coproduct category \(C \sqcup D\), so that the functor \(- \sqcup -\colon \Cat \times \Cat \to \Cat\) does indeed encode the coproduct of categories.
Lemma 8.5.5. For objects \(c,d \in \Cat\), the object \(c \times d\) is a product in \(\Cat\), and the object \(c \sqcup d\) is a coproduct in \(\Cat\).
Proof
The argument is similar to Lemma 8.5.2. For the product, we need to show that for any other \(e \in \Cat\) the two projection maps induce an equivalence \[ \Hom_{\Cat}(e, c \times d) \simeq \Hom_{\Cat}(e,c) \times \Hom_{\Cat}(e,d) \simeq \Hom_{\Cat \times \Cat}((e,e), (c,d)). \] Under directed univalence this follows from the equivalence \(\Map(E,C \times D) \iso \Map(E,C) \times \Map(E, D)\) from Lemma 1.7.10. The analogous argument for the coproduct uses Lemma 1.7.15.
Pullbacks
Recall from Definition 7.1.4 the category \(\pullback\), which for the purposes of this section we will display as follows:
In particular we denote its three objects by \(0\), \(1\) and \(2\). We would like to construct a pullback functor \(\lim\colon \Fun(\pullback, \Cat) \to \Cat\).
Construction 8.5.6. Let us write \(\Cat^{\pullback} := \Fun(\pullback,\Cat)\).
For \(i = 0,1,2\), we denote by \(\Cat_{\bullet,i}^{\pullback} \to \Cat^{\pullback}\) the small cocartesian fibration defined via the following pullback diagram:
Using directed univalence to translate the morphisms \(0 \to 2\) and \(1 \to 2\) in
\(\pullback\) into cocartesian functors, we obtain
It then follows from condition (Cat3) that the resulting cocartesian fibration
\[
\Cat_{\bullet,0}^{\pullback} \times_{\Cat_{\bullet,2}^{\pullback}} \Cat_{\bullet,1}^{\pullback} \to \Cat^{\pullback}
\]
is again a small cocartesian fibration, and hence is classified by some functor \(\lim\colon \Cat^{\pullback} \to \Cat\):
Observation 8.5.7. Note that an object of \(\Cat^{\pullback}\) corresponds to a pair of morphisms \(c \to e\) and \(d \to e\) in \(\Cat\), which in turn corresponds under directed univalence to a pair of functors \(C \to E\) and \(D \to E\). A computation shows that the fiber of the left vertical map over this object is the pullback \(C \times_E D\), showing that the functor \(\lim\colon \Cat^{\pullback} \to \Cat\) does indeed classify pullbacks of categories.
Lemma 8.5.8. The functor \(\lim\colon \Fun(\pullback,\Cat) \to \Cat\) is right adjoint to the diagonal map \(p_{\pullback}^*\colon \Cat \to \Fun(\pullback,\Cat)\).
Proof
Consider a cospan \(c \to e \leftarrow d\) in \(\Cat\) and an object \(x\) of \(\Cat\). We need to show that the map \[ \Hom_{\Cat}(x, c \times_e d) \to \Hom_{\Cat^{\pullback}}(x \to x \leftarrow x, c \to e \leftarrow d) \] induced by the cone diagram of \(c \times_e d\) is an equivalence. A computation shows that the right-hand side is equivalent to \[ \Hom_{\Cat}(x,c) \times_{\Hom_{\Cat}(x,e)} \Hom_{\Cat}(x,d). \] By directed univalence, the map is then equivalent to the map \[ \Map(X,C \times_E D) \to \Map(X,C) \times_{\Map(X,E)} \Map(X,D), \] which is an equivalence by Lemma 1.7.11 and Lemma 1.6.4.
Corollary 8.5.9. The category \(\Cat\) admits pullbacks.
Functor categories
We will now discuss functor categories internal to \(\Cat\).
Construction 8.5.10. Let \(c\) be an object of \(\Cat\) and let \(C\) be the associated small category. By Lemma 8.4.16, the functor
\[
(\pi_{\univ})_*\colon \Fun(C,\Cat_{\bullet}) \to \Fun(C,\Cat)
\]
is a small cocartesian fibration, hence it is classified by some functor \(\Gamma_C\colon \Fun(C,\Cat) \to \Cat\):
We define the functor \((-)^c \colon \Cat \to \Cat\) as the following composite:
\[
\Cat \xrightarrow{p_C^*} \Fun(C,\Cat) \xrightarrow{\Gamma_C} \Cat.
\]
Note that for an object \(d \in \Cat\) corresponding to a small category \(D\), the image \(d^c \in \Cat\) classifies the small category \(\Fun(C,D)\).
Lemma 8.5.11. The functor \((-)^c\colon \Cat \to \Cat\) is right adjoint to \(- \times c\colon \Cat \to \Cat\).
Proof
Using directed univalence, this follows from Lemma 1.7.12, similarly to the proofs of Lemmas 8.5.2, 8.5.5 and 8.5.8.
Construction 8.5.12. Let \(f\colon c \to d\) be a morphism in \(\Cat\) corresponding under directed univalence to a functor \(f\colon C \to D\) between small categories. We will construct a natural transformation
\[
f^*\colon (-)^d \to (-)^c.
\]
We denote by \(\Cat_{\bullet}^c \to \Cat\) the small cocartesian fibration classified by \((-)^c\colon \Cat \to \Cat\):
Precomposition with \(f\) gives rise to a commutative diagram
which induces a cocartesian functor \(\Cat^{d}_{\bullet} \to \Cat^{c}_{\bullet}\) over \(\Cat\). Under directed univalence this corresponds to a natural transformation \(f^*\colon (-)^d \to (-)^c\) as desired.
Lemma 8.5.13. There is an identification \((-)^* = \id_{\Cat}\) of functors \(\Cat \to \Cat\).
Proof
This is immediate from the equivalence \(\Cat^*_{\bullet} \simeq \Cat_{\bullet}\) over \(\Cat\), which follows from the equivalences \(\Fun(*,\Cat) \simeq \Cat\) and \(\Fun(*,\Cat_{\bullet}) \simeq \Cat_{\bullet}\) from Lemma 1.7.13.
Lemma 8.5.14. For small categories \(C\) and \(D\) there is an identification \(((-)^C)^D = (-)^{C \times D}\) of functors \(\Cat \to \Cat\).
Proof
The small cocartesian fibration classified by \(((-)^C)^D\) sits in a pullback square as follows:
Under the equivalences \(\Fun(D,\Fun(C,\Cat)) \simeq \Fun(C \times D, \Cat)\) and \(\Fun(D,\Fun(C,\Cat_{\bullet})) \simeq \Fun(C \times D, \Cat_{\bullet})\) from Lemma 1.7.12, the bottom functor is \(p_{C \times D}^*\) and we see that the left vertical map agrees with the small cocartesian fibration \(\Cat_{\bullet}^{c \times d} \to \Cat\) classifying \((-)^{c \times d}\). The claim thus follows from directed univalence.
Remark 8.5.15. Proceeding in this way, one may prove each of the following identifications:
• For \(c \in \Cat\) there is an identification \((- \times -)^c = (-)^c \times (-)^c\) of functors \(\Cat \times \Cat \to \Cat\), cf. Lemma 1.7.10;
• For \(t \in \Cat\) there is an identification \((\lim(-))^t = \lim((-)^t)\) of functors \(\Fun(\pullback, \Cat) \to \Cat\), cf. Lemma 1.7.11;
• There is an identification \((-)^{\emptyset} = \const_*\), cf. Lemma 1.7.14;
• There is an identification \((-)^{c \sqcup d} = (-)^c \times (-)^d\), cf. Lemma 1.7.15.