Construction 8.7.4. Consider an object \(s\) of \(\Cat\), corresponding to a small category \(S\):
Recall that we write \(\Cat_{/S}=\Cat_{/s}\). In order to define \(\CoCart(S)\) as a subcategory of \(\Cat_{/S}\), we first define the collection \(\CoCart(S)^\simeq\) of cocartesian fibrations between small categories. Given a functor \(p\colon X\to A\) in an anima context \(\Gamma\), the proposition asserting that a morphism \(f\) of \(X\) is \(p\)-cocartesian can be expressed as follows.
For each morphism \(f\colon x\to y\) of \(X\) in context \(\Gamma\), one gets a commutative square of the form
hence a canonical functor
\[
c_{f/p}\colon X_{y/}\to A_{p(y)/}\times_{A_{p(x)/}}X_{x/}
\]
and we have the proposition asserting that the latter is an equivalence in context \(\Gamma\):
\[
\isEquiv_\Gamma(c_{f/p})\hookrightarrow\Gamma\, .
\]
The proposition \(\isEquiv_\Gamma(c_{f/p})\) is also the assertion, in context \(\Gamma\), that \(f\) is a \(p\)-cocartesian morphism in \(X\). Let us consider the universal morphism in \(X\), in context \(\Map([1],X)\), defined through the evaluation functor:
\[
\mathit{univ_X}\colon [1]\times\Map_\Gamma([1],X)\hookrightarrow [1]\times\Fun_\Gamma([1],X)\to X\, .
\]
If we still denote by \(p\) the pullback of \(p\) along the projection of \(\Map_\Gamma([1],X)\) to \(\Gamma\), the proposition asserting that \(\mathit{univ_X}\) is \(p\)-cocartesian in context \(\Map_\Gamma([1],X)\) defines the collection of \(p\)-cocartesian morphisms in \(X\):
\[
\Map_\Gamma([1],X)_{\text{$p$-coCart}}:=\isEquiv_{\Map_\Gamma([1],X)}(c_{\mathit{univ_X}/p})\hookrightarrow \Map_\Gamma([1],X)\, .
\]
The property that \(p\) is a cocartesian fibration can be reformulated by asserting, for any object \(x_0\) in \(X\)
and any morphism \(g\colon p(x_0)\to y_1\) in \(A\), the existence of a unique \(p\)-cocartesian morphism in \(X\) of the form
\(f\colon x_0\to x_1\) equipped with an isomorphism from \(p(f)\) to \(g\). In other words, evaluation at \(0\) induces a commutative square of the form
hence a canonical functor
\[
\varphi_p\colon \Map_\Gamma([1],X)_{\text{$p$-coCart}}\to \Map_\Gamma([1],A)\times_{A^\simeq}X^\simeq\, ,
\]
and the property for the latter to be an equivalence is equivalent to the property that the functor \(p\) is
a cocartesian fibration in context \(\Gamma\). We thus define
\[
\iscoCartFib(p):=\isEquiv_{\Gamma}(\varphi_p)\hookrightarrow\Gamma\, .
\]
We consider now the universal functor from a small category to \(S\).
This is the functor of the form
corresponding through directed univalence to the morphism
\[
\univ_{/S}\colon [1]\times (\Cat_{/S})^\simeq\hookrightarrow
[1]\times\Map([1],\Cat)\hookrightarrow [1]\times\Fun([1],\Cat)\to \Cat
\]
induced by the obvious evaluation functor.
The collection of cocartesian fibrations of the form \(p\colon X\to S\) with \(X\) small is
defined to be the proposition asserting that \(p_{\univ/S}\) is a cocartesian fibration
in context \((\Cat_{/S})^\simeq\):
\[
\CoCart(S)^\simeq:=\iscoCartFib(p_{\univ/S})\hookrightarrow(\Cat_{/S})^\simeq \, .
\]
We define as an intermediate step the full subcategory \(\CoCart(S)'\) of \(\Cat_{/S}\) spanned by
cocartesian fibrations with codomain \(S\).
By directed univalence, in context \(\Map([1],\CoCart(S)')\), there is a universal functor
between cocartesian fibrations over \(S\):
Asserting that \(f_\univ\) is a cocartesian functor over \(S\) in context \(\Map([1],\CoCart(S)')\)
thus defines a collection of morphisms in \(\CoCart(S)'\):
\[
\Map([1],\CoCart(S)')_{\CoCart}
:=\isCocart(f_\univ)\hookrightarrow \Map([1],\CoCart(S)')\hookrightarrow\Map([1],\Cat_{/S})\, .
\]
We finally define \(\CoCart(S)\) as the subcategory of \(\Cat_{/S}\) generated by \(\Map([1],\CoCart(S)')_{\CoCart}\):
\[
\CoCart(S)=\langle \Map([1],\CoCart(S)')_{\CoCart} \rangle_{\Cat_{/S}}\, .
\]
By definition, a functor \(f\colon B\to\Cat_{/S}\) factors through \(\CoCart(S)\) if and only if it sends each object of \(B\)
to cocartesian fibrations over \(S\) and each morphism of \(B\) to cocartesian functors between cocartesian fibrations over \(S\).