Proposition 12.6.7. Let \(A\) be a small category. The full embedding \[ \PSh(A)=\RFib(A)\hookrightarrow\Cat_{/A} \] has a left adjoint \(L\) sending each functor \(u\colon X\to A\) to the colimit of the functor \[ X\overset{u}{\to}A\overset{h_A}{\to}\PSh(A)\, . \]
Proof
Let \(F\colon A\catop\to\An\) be a presheaf with corresponding right fibration \(p_F\colon A_{/F}\to A\). If \(e\) denotes the constant presheaf on \(X\) with value the terminal object of \(\An\), we see that \begin{align*} \Hom_{\Cat_{/A}}((X,u),(A_{/F},p_F)) &\simeq \Hom_{\Cat_{/X}}((X,\id_X),(X\times_A A_{/F},\pr_{1}))\\ &\simeq \Hom_{\RFib(X)}((X,\id_X),(X\times_A A_{/F},\pr_{1}))\\ &\simeq \Hom(e,u^*(F))\\ &\simeq \Hom(u_!(e),F)\, . \end{align*} It suffices to check that \(u_!(e)\) is the colimit of the composition of the Yoneda embedding \(h_A\) with the functor \(u\). By virtue of Theorem 12.6.3, the colimit of the Yoneda embedding of \(X\) is \(e\). Since \(u_!\) commutes with colimits, and since \(u_!\circ h_X=h_A\circ u\), this proves that \[ \Hom_{\Cat_{/A}}((X,u),(A_{/F},p_F))=\Hom(\colim_{x : X}h_A(u(x))),F) \] holds functorially in \(F\). We conclude by applying Theorem 12.3.20 to the embedding of the category \(\PSh(A)\catop\) into \((\Cat_{/A})\catop\).
From Section 12.6, Yoneda density and categories of elements.