hcju/stacksqa huggingface dataset:
Proof of (1). Let $(\overline{m}, \overline{n})$ be an element of $\colim M_i \times \colim N_i$. Then we can find $m \in M_x$ and $n \in N_y$ for some $x, y \in \Ob(\mathcal{I})$ such that $m$ mapsto $\overline{m}$ and $n$ mapsto $\overline{n}$. See Section \ref{section-limit-sets}. Choose $a : x \to z$ and $b : y \to z$ in $\mathcal{I}$. Then $(M(a)(m), N(b)(n))$ is an element of $(M \times N)_z$ whose image in $\colim (M_i \times N_i)$ maps to $(\overline{m}, \overline{n})$ as desired. \medskip\noindent Proof of (2). Let $G$ be a non-trivial group and let $\mathcal{I}$ be the one-object category with endomorphism monoid $G$. Then $\mathcal{I}$ trivially satisfies the condition stated in the lemma. Now let $G$ act on itself by translation and view the $G$-set $G$ as a set-valued $\mathcal{I}$-diagram. Then $$ \colim_\mathcal{I} G \times \colim_\mathcal{I} G \cong G/G \times G/G $$ is not isomorphic to $$ \colim_\mathcal{I} (G \times G) \cong (G \times G)/G $$ This example indicates that you cannot just drop the additional condition Lemma \ref{lemma-directed-commutes} even if you only care about finite products.
If $\mathcal{I}$ is the empty category, then the lemma is true. Thus we may assume $\mathcal{I}$ is nonempty. In this case we can write $\mathcal{I} = \coprod \mathcal{I}_j$ where each $\mathcal{I}_j$ is nonempty and satisfies the same property, see Lemma \ref{lemma-split-into-connected}. Since $\colim_\mathcal{I} M = \coprod_j \colim_{\mathcal{I}_j} M|_{\mathcal{I}_j}$ this reduces the proof of (1) to the connected case. \medskip\noindent Assume $\mathcal{I}$ is connected and $M \to N$ is injective, i.e., all the maps $M_i \to N_i$ are injective. We identify $M_i$ with the image of $M_i \to N_i$, i.e., we will think of $M_i$ as a subset of $N_i$. We will use the description of the colimits given in Section \ref{section-limit-sets} without further mention. Let $s, s' \in \colim M_i$ map to the same element of $\colim N_i$. Say $s$ comes from an element $m$ of $M_i$ and $s'$ comes from an element $m'$ of $M_{i'}$. Then we can find a sequence $i = i_0, i_1, \ldots, i_n = i'$ of objects of $\mathcal{I}$ and morphisms $$ \xymatrix{ & i_1 \ar[ld] \ar[rd] & & i_3 \ar[ld] & & i_{2n-1} \ar[rd] & \\ i = i_0 & & i_2 & & \ldots & & i_{2n} = i' } $$ and elements $n_{i_j} \in N_{i_j}$ mapping to each other under the maps $N_{i_{2k-1}} \to N_{i_{2k-2}}$ and $N_{i_{2k-1}} \to N_{i_{2k}}$ induced from the maps in $\mathcal{I}$ above with $n_{i_0} = m$ and $n_{i_{2n}} = m'$. We will prove by induction on $n$ that this implies $s = s'$. The base case $n = 0$ is trivial. Assume $n \geq 1$. Using the assumption on $\mathcal{I}$ we find a commutative diagram $$ \xymatrix{ & i_1 \ar[ld] \ar[rd] \\ i_0 \ar[rd] & & i_2 \ar[ld] \\ & w } $$ We conclude that $m$ and $n_{i_2}$ map to the same element of $N_w$ because both are the image of the element $n_{i_1}$. In particular, this element is an element $m'' \in M_w$ which gives rise to the same element as $s$ in $\colim M_i$. Then we find the chain $$ \xymatrix{ & i_3 \ar[ld] \ar[rd] & & i_5 \ar[ld] & & i_{2n-1} \ar[rd] & \\ w & & i_4 & & \ldots & & i_{2n} = i' } $$ and the elements $n_{i_j}$ for $j \geq 3$ which has a smaller length than the chain we started with. This proves the induction step and the proof of (1) is complete. \medskip\noindent Let $G$ be a group and let $\mathcal{I}$ be the one-object category with endomorphism monoid $G$. Then $\mathcal{I}$ satisfies the condition stated in the lemma because given $g_1, g_2 \in G$ we can find $h_1, h_2 \in G$ with $h_1 g_1 = h_2 g_2$. An diagram $M$ over $\mathcal{I}$ in $\textit{Ab}$ is the same thing as an abelian group $M$ with $G$-action and $\colim_\mathcal{I} M$ is the coinvariants $M_G$ of $M$. Take $G$ the group of order $2$ acting trivially on $M = \mathbf{Z}/2\mathbf{Z}$ mapping into the first summand of $N = \mathbf{Z}/2\mathbf{Z} \times \mathbf{Z}/2\mathbf{Z}$ where the nontrivial element of $G$ acts by $(x, y) \mapsto (x + y, y)$. Then $M_G \to N_G$ is zero.
By Lemma \ref{lemma-split-into-directed} we may write $\mathcal{I} = \coprod \mathcal{I}_j$ with each $\mathcal{I}_j$ filtered. By Lemma \ref{lemma-directed-commutes} we see that colimits of $\mathcal{I}_j$ commute with equalizers and fibred products. Thus it suffices to show that equalizers and fibre products commute with coproducts in the category of sets (including empty coproducts). In other words, given a set $J$ and sets $A_j, B_j, C_j$ and set maps $A_j \to B_j$, $C_j \to B_j$ for $j \in J$ we have to show that $$ (\coprod\nolimits_{j \in J} A_j) \times_{(\coprod\nolimits_{j \in J} B_j)} (\coprod\nolimits_{j \in J} C_j) = \coprod\nolimits_{j \in J} A_j \times_{B_j} C_j $$ and given $a_j, a'_j : A_j \to B_j$ that $$ \text{Equalizer}( \coprod\nolimits_{j \in J} a_j, \coprod\nolimits_{j \in J} a'_j) = \coprod\nolimits_{j \in J} \text{Equalizer}(a_j, a'_j) $$ This is true even if $J = \emptyset$. Details omitted.
The two statements are equivalent by Lemma \ref{lemma-directed-category-system}. Let $I$ be a directed set and let $(S_i)_{i \in I}$ be an inverse system of finite nonempty sets over $I$. Let us say that a {\it subsystem} $T$ is a family $T = (T_i)_{i \in I}$ of nonempty subsets $T_i \subset S_i$ such that $T_{i'}$ is mapped into $T_i$ by the transition map $S_{i'} \to S_i$ for all $i' \geq i$. Denote $\mathcal{T}$ the set of subsystems. We order $\mathcal{T}$ by inclusion. Suppose $T_\alpha$, $\alpha \in A$ is a totally ordered family of elements of $\mathcal{T}$. Say $T_\alpha = (T_{\alpha, i})_{i \in I}$. Then we can find a lower bound $T = (T_i)_{i \in I}$ by setting $T_i = \bigcap_{\alpha \in A} T_{\alpha, i}$ which is manifestly a finite nonempty subset of $S_i$ as all the $T_{\alpha, i}$ are nonempty and as the $T_\alpha$ form a totally ordered family. Thus we may apply Zorn's lemma to see that $\mathcal{T}$ has minimal elements. \medskip\noindent Let's analyze what a minimal element $T \in \mathcal{T}$ looks like. First observe that the maps $T_{i'} \to T_i$ are all surjective. Namely, as $I$ is a directed set and $T_i$ is finite, the intersection $T'_i = \bigcap_{i' \geq i} \Im(T_{i'} \to T_i)$ is nonempty. Thus $T' = (T'_i)$ is a subsystem contained in $T$ and by minimality $T' = T$. Finally, we claim that $T_i$ is a singleton for each $i$. Namely, if $x \in T_i$, then we can define $T'_{i'} = (T_{i'} \to T_i)^{-1}(\{x\})$ for $i' \geq i$ and $T'_j = T_j$ if $j \not \geq i$. This is another subsystem as we've seen above that the transition maps of the subsystem $T$ are surjective. By minimality we see that $T = T'$ which indeed implies that $T_i$ is a singleton. This holds for every $i \in I$, hence we see that $T_i = \{x_i\}$ for some $x_i \in S_i$ with $x_{i'} \mapsto x_i$ under the map $S_{i'} \to S_i$ for every $i' \geq i$. In other words, $(x_i) \in \lim S_i$ and the lemma is proved.
Lemma \ref{lemma-limits-products-equalizers} shows that (2) implies (1). Suppose (3) holds. The fibre product over the final object is the product. If $a, b : A \to B$ are morphisms of $\mathcal{A}$, then the equalizer of $a, b$ is $$ (A \times_{a, B, b} A)\times_{(pr_1, pr_2), A \times A, \Delta} A. $$ Thus (3) implies (2). Finally (1) implies (3) because the empty limit is a final object, and fibre products are limits.
For each $y$ choose an object $v(y)$ and an isomorphism $\Mor_\mathcal{C}(-, v(y)) \to \Mor_\mathcal{D}(u(-), y)$ of functors. By Yoneda's lemma (Lemma \ref{lemma-yoneda}) for any morphism $g : y \to y'$ the transformation of functors $$ \Mor_\mathcal{C}(-, v(y)) \to \Mor_\mathcal{D}(u(-), y) \to \Mor_\mathcal{D}(u(-), y') \to \Mor_\mathcal{C}(-, v(y')) $$ corresponds to a unique morphism $v(g) : v(y) \to v(y')$. We omit the verification that $v$ is a functor and that it is right adjoint to $u$.
Proof of (1). Assume $u$ is fully faithful. We will show $\eta_X : X \to v(u(X))$ is an isomorphism. Let $X' \to v(u(X))$ be any morphism. By adjointness this corresponds to a morphism $u(X') \to u(X)$. By fully faithfulness of $u$ this corresponds to a unique morphism $X' \to X$. Thus we see that post-composing by $\eta_X$ defines a bijection $\Mor(X', X) \to \Mor(X', v(u(X)))$. Hence $\eta_X$ is an isomorphism. If there exists an isomorphism $\text{id} \cong v \circ u$ of functors, then $v \circ u$ is fully faithful. By Lemma \ref{lemma-left-adjoint-composed-fully-faithful} we see that $u$ is fully faithful. By the above this implies $\eta$ is an isomorphism. Thus all $3$ conditions are equivalent (and these conditions are also equivalent to $v \circ u$ being fully faithful). \medskip\noindent Part (2) is dual to part (1).
A morphism from a colimit into an object is the same as a compatible system of morphisms from the constituents of the limit into the object, see Remark \ref{remark-limit-colim}. So $$ \begin{matrix} \Mor_\mathcal{D}(u(\colim_{i \in \mathcal{I}} M_i), Y) & = & \Mor_\mathcal{C}(\colim_{i \in \mathcal{I}} M_i, v(Y)) \\ & = & \lim_{i \in \mathcal{I}^{opp}} \Mor_\mathcal{C}(M_i, v(Y)) \\ & = & \lim_{i \in \mathcal{I}^{opp}} \Mor_\mathcal{D}(u(M_i), Y) \end{matrix} $$ proves that $u(\colim_{i \in \mathcal{I}} M_i)$ is the colimit we are looking for. A similar argument works for the other statement.
Let us unwind the formula in (2) because this will also immediately prove (1). First, the counit of the adjunctions for the pairs $(u, v)$ and $(u', v')$ are maps $\epsilon_X^v : u(v(X)) \to X$ and $\epsilon_Y^{v'} : u'(v'(Y)) \to Y$, see discussion following Definition \ref{definition-adjoint}. With $u''$ and $v''$ as in (1) we unwind everything $$ u''(v''(X)) = u(u'(v'(v(X)))) \xrightarrow{u(\epsilon_{v(X)}^{v'})} u(v(X)) \xrightarrow{\epsilon_X^v} X $$ to get the map on the left hand side of (\ref{equation-compose-counits}). Let us denote this by $\epsilon_X^{v''}$ for now. To see that this is the counit of an adjoint pair $(u'', v'')$ we have to show that given $Z$ in $\mathcal{C}$ the rule that sends a morphism $\beta : Z \to v''(X)$ to $\alpha = \epsilon_X^{v''} \circ u''(\beta) : u''(Z) \to X$ is a bijection on sets of morphisms. This is true because, this is the composition of the rule sending $\beta$ to $\epsilon_{v(X)}^{v'} \circ u'(\beta)$ which is a bijection by assumption on $(u', v')$ and then sending this to $\epsilon_X^v \circ u(\epsilon_{v(X)}^{v'} \circ u'(\beta))$ which is a bijection by assumption on $(u, v)$.
For each $i$ choose a representative $(X_i \to Y_i, s_i : Y \to Y_i)$ of $g_i$. The lemma follows if we can find a morphism $s : Y \to Y'$ in $S$ such that for each $i$ there is a morphism $a_i : Y_i \to Y'$ with $a_i \circ s_i = s$. If we have two indices $i = 1, 2$, then we can do this by completing the square $$ \xymatrix{ Y \ar[d]_{s_1} \ar[r]_{s_2} & Y_2 \ar[d]^{t_2} \\ Y_1 \ar[r]^{a_1} & Y' } $$ with $t_2 \in S$ as is possible by Definition \ref{definition-multiplicative-system}. Then $s = t_2 \circ s_2 \in S$ works. If we have $n > 2$ morphisms, then we use the above trick to reduce to the case of $n - 1$ morphisms, and we win by induction.
Let $\mathcal{I}$ be a finite category and let $\mathcal{I} \to \mathcal{C}$, $i \mapsto X_i$ be a functor whose colimit exists. Then using (\ref{equation-left-localization-morphisms-colimit}), the fact that $Y/S$ is filtered, and Lemma \ref{lemma-directed-commutes} we have \begin{align*} \Mor_{S^{-1}\mathcal{C}}(Q(\colim X_i), Q(Y)) & = \colim_{(s : Y \to Y') \in Y/S} \Mor_\mathcal{C}(\colim X_i, Y') \\ & = \colim_{(s : Y \to Y') \in Y/S} \lim_i \Mor_\mathcal{C}(X_i, Y') \\ & = \lim_i \colim_{(s : Y \to Y') \in Y/S} \Mor_\mathcal{C}(X_i, Y') \\ & = \lim_i \Mor_{S^{-1}\mathcal{C}}(Q(X_i), Q(Y)) \end{align*} and this isomorphism commutes with the projections from both sides to the set $\Mor_{S^{-1}\mathcal{C}}(Q(X_j), Q(Y))$ for each $j \in \Ob(\mathcal{I})$. Thus, $Q(\colim X_i)$ satisfies the universal property for the colimit of the functor $i \mapsto Q(X_i)$; hence, it is this colimit, as desired.
We choose maps and objects in the following way: First write $a = s^{-1}g$ for some $s : X' \to X''$ in $S$ and $g : X \to X''$. By LMS2 we can find $t : Y' \to Y''$ in $S$ and $f'' : X'' \to Y''$ such that $$ \xymatrix{ X \ar[d]_f \ar[r]_g & X'' \ar[d]^{f''} & X' \ar[d]^{f'} \ar[l]^s \\ Y & Y'' & Y' \ar[l]_t } $$ commutes. Now in this diagram we are going to repeatedly change our choice of $$ X'' \xrightarrow{f''} Y'' \xleftarrow{t} Y' $$ by postcomposing both $t$ and $f''$ by a morphism $d : Y'' \to Y'''$ with the property that $d \circ t \in S$. According to Remark \ref{remark-left-localization-morphisms-colimit} we may after such a replacement assume that there exists a morphism $h : Y \to Y''$ such that $b = t^{-1}h$ holds\footnote{Here is a more down-to-earth way to see this: Write $b = q^{-1}i$ for some $q : Y' \to Z$ in $S$ and some $i : Y \to Z$. By LMS2 we can find $r : Y'' \to Y'''$ in $S$ and $j : Z \to Y'''$ such that $j \circ q = r \circ t$. Now, set $d = r$ and $h = j \circ i$.}. At this point we have everything as in the lemma except that we don't know that the left square of the diagram commutes. But the definition of composition in $S^{-1} \mathcal{C}$ shows that $b \circ Q\left(f\right)$ is the equivalence class of the pair $(h \circ f : X \to Y'', t : Y' \to Y'')$ (since $b$ is the equivalence class of the pair $(h : Y \to Y'', t : Y' \to Y'')$, while $Q\left(f\right)$ is the equivalence class of the pair $(f : X \to Y, \text{id} : Y \to Y)$), while $Q\left(f'\right) \circ a$ is the equivalence class of the pair $(f'' \circ g : X \to Y'', t : Y' \to Y'')$ (since $a$ is the equivalence class of the pair $(g : X \to X'', s : X' \to X'')$, while $Q\left(f'\right)$ is the equivalence class of the pair $(f' : X' \to Y', \text{id} : Y' \to Y')$). Since we know that $b \circ Q\left(f\right) = Q\left(f'\right) \circ a$, we thus conclude that the equivalence classes of the pairs $(h \circ f : X \to Y'', t : Y' \to Y'')$ and $(f'' \circ g : X \to Y'', t : Y' \to Y'')$ are equal. Hence using Lemma \ref{lemma-equality-morphisms-left-localization} we can find a morphism $d : Y'' \to Y'''$ such that $d \circ t \in S$ and $d \circ h \circ f = d \circ f'' \circ g$. Hence we make one more replacement of the kind described above and we win.
Denote $\mathcal{C}_{left}$, $\mathcal{C}_{right}$ the two categories of fractions. By the universal properties of Lemmas \ref{lemma-properties-left-localization} and \ref{lemma-properties-right-localization} we obtain functors $\mathcal{C}_{left} \to \mathcal{C}_{right}$ and $\mathcal{C}_{right} \to \mathcal{C}_{left}$. By the uniqueness statement in the universal properties, these functors are each other's inverse.
It is clear that $S \subset S' \subset \hat S$ because elements of $S'$ map to morphisms in $S^{-1}\mathcal{C}$ which have both left and right inverses. Note that $S'$ satisfies MS4, and that $\hat S$ satisfies MS1. Next, we prove that $S' = \hat S$. \medskip\noindent Let $f \in \hat S$. Let $s^{-1}g = ht^{-1}$ be the inverse morphism in $S^{-1}\mathcal{C}$. (We may use both left fractions and right fractions to describe morphisms in $S^{-1}\mathcal{C}$, see Lemma \ref{lemma-multiplicative-system}.) The relation $\text{id}_X = s^{-1}gf$ in $S^{-1}\mathcal{C}$ means there exists a commutative diagram $$ \xymatrix{  & X' \ar[d]^u & \\ X \ar[ru]^{gf} \ar[r]^{f'} \ar[rd]_{\text{id}_X} & X'' & X \ar[lu]_s \ar[l]_{s'} \ar[ld]^{\text{id}_X} \\ & X \ar[u]_v & } $$ for some morphisms $f', u, v$ and $s' \in S$. Hence $ugf = s' \in S$. Similarly, using that $\text{id}_Y = fht^{-1}$ one proves that $fhw \in S$ for some $w$. We conclude that $f \in S'$. Thus $S' = \hat S$. Provided we prove that $S' = \hat S$ is a multiplicative system it is now clear that this implies that $S' = \hat S$ is the smallest saturated system containing $S$. \medskip\noindent Our remarks above take care of MS1 and MS4, so to finish the proof of the lemma we have to show that LMS2, RMS2, LMS3, RMS3 hold for $\hat S$. Let us check that LMS2 holds for $\hat S$. Suppose we have a solid diagram $$ \xymatrix{ X \ar[d]_t \ar[r]_g & Y \ar@{..>}[d]^s \\ Z \ar@{..>}[r]^f & W } $$ with $t \in \hat S$. Pick a morphism $a : Z \to Z'$ such that $at \in S$. Then we can use LMS2 for $S$ to find a commutative diagram $$ \xymatrix{ X \ar[d]_t \ar[r]_g & Y \ar[dd]^s \\ Z \ar[d]_a  \\ Z' \ar[r]^{f'} & W } $$ and setting $f = f' \circ a$ we win. The proof of RMS2 is dual to this. Finally, suppose given a pair of morphisms $f, g : X \to Y$ and $t \in \hat S$ with target $X$ such that $ft = gt$. Then we pick a morphism $b$ such that $tb \in S$. Then $ftb = gtb$ which implies by LMS3 for $S$ that there exists an $s \in S$ with source $Y$ such that $sf = sg$ as desired. The proof of RMS3 is dual to this.
This is a purely $2$-category theoretic statement, valid in any $(2, 1)$-category with $2$-fibre products. Explicitly, it follows from the following chain of equivalences: \begin{align*} \mathcal{X} \times_{(\mathcal{X} \times_\mathcal{Y} \mathcal{X})} (\mathcal{U} \times_\mathcal{V} \mathcal{U}) & = \mathcal{X} \times_{(\mathcal{X} \times_\mathcal{Y} \mathcal{X})} ((\mathcal{X} \times_\mathcal{Y} \mathcal{V}) \times_\mathcal{V} (\mathcal{X} \times_\mathcal{Y} \mathcal{V})) \\ & = \mathcal{X} \times_{(\mathcal{X} \times_\mathcal{Y} \mathcal{X})} (\mathcal{X} \times_\mathcal{Y} \mathcal{X} \times_\mathcal{Y} \mathcal{V}) \\ & = \mathcal{X} \times_\mathcal{Y} \mathcal{V} = \mathcal{U} \end{align*} see Lemmas \ref{lemma-associativity-2-fibre-product} and \ref{lemma-2-fibre-product-erase-factor}.
Let us check the universal property: let $p_\mathcal{W} : \mathcal{W}\to \mathcal{C}$ be a category over $\mathcal{C}$, let $X : \mathcal{W} \to \mathcal{X}$ and $Y : \mathcal{W} \to \mathcal{Y}$ be functors over $\mathcal{C}$, and let $t : F \circ X \to G \circ Y$ be an isomorphism of functors over $\mathcal{C}$. The desired functor $\gamma : \mathcal{W} \to \mathcal{X} \times_\mathcal{S} \mathcal{Y}$ is given by $W \mapsto (p_\mathcal{W}(W), X(W), Y(W), t_W)$. Details omitted; compare with Lemma \ref{lemma-2-fibre-product-categories}.
Proof of (1). Let $\varphi : y \to x$ and $\psi : z \to y$ be strongly cartesian. Let $t$ be an arbitrary object of $\mathcal{S}$. Then we have \begin{align*} & \Mor_\mathcal{S}(t, z) \\ & = \Mor_\mathcal{S}(t, y) \times_{\Mor_\mathcal{C}(p(t), p(y))} \Mor_\mathcal{C}(p(t), p(z)) \\ & = \Mor_\mathcal{S}(t, x) \times_{\Mor_\mathcal{C}(p(t), p(x))} \Mor_\mathcal{C}(p(t), p(y)) \times_{\Mor_\mathcal{C}(p(t), p(y))} \Mor_\mathcal{C}(p(t), p(z)) \\ & = \Mor_\mathcal{S}(t, x) \times_{\Mor_\mathcal{C}(p(t), p(x))} \Mor_\mathcal{C}(p(t), p(z)) \end{align*} hence $z \to x$ is strongly cartesian. \medskip\noindent Proof of (2). Let $y \to x$ be an isomorphism. Then $p(y) \to p(x)$ is an isomorphism too. Hence $\Mor_\mathcal{C}(p(z), p(y)) \to \Mor_\mathcal{C}(p(z), p(x))$ is a bijection. Hence $\Mor_\mathcal{S}(z, x) \times_{\Mor_\mathcal{C}(p(z), p(x))} \Mor_\mathcal{C}(p(z), p(y))$ is bijective to $\Mor_\mathcal{S}(z, x)$. Hence the displayed map of Definition \ref{definition-cartesian-over-C} is a bijection as $y \to x$ is an isomorphism, and we conclude that $y \to x$ is strongly cartesian. \medskip\noindent Proof of (3). Assume $\varphi : y \to x$ is strongly cartesian with $p(\varphi) : p(y) \to p(x)$ an isomorphism. Applying the definition with $z = x$ shows that $(\text{id}_x, p(\varphi)^{-1})$ comes from a unique morphism $\chi : x \to y$. We omit the verification that $\chi$ is the inverse of $\varphi$.
In fact, it is clear that the commutative diagram of part (1) uniquely determines the morphism $(\alpha_{g, f})_y$ in the fibre category $\mathcal{S}_W$. It is an isomorphism since both the morphism $(f \circ g)^*y \to y$ and the composition $g^*f^*y \to f^*y \to y$ are strongly cartesian morphisms lifting $f \circ g$ (see discussion following Definition \ref{definition-cartesian-over-C} and Lemma \ref{lemma-composition-cartesian}). In the same way, since $\text{id}_x : x \to x$ is clearly strongly cartesian over $\text{id}_U$ (with $U = p(x)$) we see that there exists an isomorphism $(\alpha_U)_x : x \to (\text{id}_U)^*x$. (Of course we could have assumed beforehand that $f^*x = x$ whenever $f$ is an identity morphism, but it is better for the sake of generality not to assume this.) We omit the verification that $\alpha_{g, f}$ and $\alpha_U$ so obtained are transformations of functors. We also omit the verification of (3).
Basically what one has to show here is that given $F : \mathcal{X} \to \mathcal{S}$ and $G : \mathcal{Y} \to \mathcal{S}$ morphisms of fibred categories over $\mathcal{C}$, then the category $\mathcal{X} \times_\mathcal{S} \mathcal{Y}$ described in Lemma \ref{lemma-2-product-categories-over-C} is fibred. Let us show that $\mathcal{X} \times_\mathcal{S} \mathcal{Y}$ has plenty of strongly cartesian morphisms. Namely, suppose we have $(U, x, y, \phi)$ an object of $\mathcal{X} \times_\mathcal{S} \mathcal{Y}$. And suppose $f : V \to U$ is a morphism in $\mathcal{C}$. Choose strongly cartesian morphisms $a : f^*x \to x$ in $\mathcal{X}$ lying over $f$ and $b : f^*y \to y$ in $\mathcal{Y}$ lying over $f$. By assumption $F(a)$ and $G(b)$ are strongly cartesian. Since $\phi : F(x) \to G(y)$ is an isomorphism, by the uniqueness of strongly cartesian morphisms we find a unique isomorphism $f^*\phi : F(f^*x) \to G(f^*y)$ such that $G(b) \circ f^*\phi = \phi \circ F(a)$. In other words $(a, b) : (V, f^*x, f^*y, f^*\phi) \to (U, x, y, \phi)$ is a morphism in $\mathcal{X} \times_\mathcal{S} \mathcal{Y}$. We omit the verification that this is a strongly cartesian morphism (and that these are in fact the only strongly cartesian morphisms).
Suppose that $\varphi : x' \to x$ is strongly cartesian with respect to $p$. We claim that $\varphi$ is strongly cartesian with respect to $p'$ also. Set $g = p'(\varphi)$, so that $g : V'/U \to V/U$ for some morphisms $f : V \to U$ and $f' : V' \to U$. Let $z \in \Ob(\mathcal{S})$. Set $p'(z) = (W \to U)$. To show that $\varphi$ is strongly cartesian for $p'$ we have to show $$ \Mor_\mathcal{S}(z, x') \longrightarrow \Mor_\mathcal{S}(z, x) \times_{\Mor_{\mathcal{C}/U}(W/U, V/U)} \Mor_{\mathcal{C}/U}(W/U, V'/U), $$ given by $\psi' \longmapsto (\varphi \circ \psi', p'(\psi'))$ is bijective. Suppose given an element $(\psi, h)$ of the right hand side, then in particular $g \circ h = p(\psi)$, and by the condition that $\varphi$ is strongly cartesian we get a unique morphism $\psi' : z \to x'$ with $\psi = \varphi \circ \psi'$ and $p(\psi') = h$. OK, and now $p'(\psi') : W/U \to V/U$ is a morphism whose corresponding map $W \to V$ is $h$, hence equal to $h$ as a morphism in $\mathcal{C}/U$. Thus $\psi'$ is a unique morphism $z \to x'$ which maps to the given pair $(\psi, h)$. This proves the claim. \medskip\noindent Finally, suppose given $g : V'/U \to V/U$ and $x$ with $p'(x) = V/U$. Since $p : \mathcal{S} \to \mathcal{C}$ is a fibred category we see there exists a strongly cartesian morphism $\varphi : x' \to x$ with $p(\varphi) = g$. By the same argument as above it follows that $p'(\varphi) = g : V'/U \to V/U$. And as seen above the morphism $\varphi$ is strongly cartesian. Thus the conditions of Definition \ref{definition-fibred-category} are satisfied and we win.