Proof of (1). By definition $\Delta_\mathcal{X}$ is representable by algebraic spaces so Lemma \ref{lemma-representable-diagonal} applies to show that $\mathcal{U} \to \mathcal{X}$ is representable by algebraic spaces. Hence the result follows from Lemma \ref{lemma-base-change-by-space-representable-by-space}. \medskip\noindent Let $T$ be a scheme over $S$. By construction of the $2$-fibre product (see Categories, Lemma \ref{categories-lemma-2-product-categories-over-C}) we see that the objects of the fibre category $\mathcal{R}_T$ are triples $(a, b, \alpha)$ where $a, b \in \Ob(\mathcal{U}_T)$ and $\alpha : f(a) \to f(b)$ is a morphism in the fibre category $\mathcal{X}_T$. \medskip\noindent Proof of (2). The equivalence comes from repeatedly applying Categories, Lemmas \ref{categories-lemma-associativity-2-fibre-product} and \ref{categories-lemma-2-fibre-product-erase-factor}. Let us identify $\mathcal{U} \times_\mathcal{X} \mathcal{U} \times_\mathcal{X} \mathcal{U}$ with $(\mathcal{U} \times_\mathcal{X} \mathcal{U}) \times_\mathcal{X} \mathcal{U}$. If $T$ is a scheme over $S$, then on fibre categories over $T$ this equivalence maps the object $((a, b, \alpha), c, \beta)$ on the left hand side to the object $((a, b, \alpha), (b, c, \beta))$ of the right hand side. \medskip\noindent Proof of (3). The $1$-morphism $\text{pr}_{02}$ is constructed in the proof of Categories, Lemma \ref{categories-lemma-triple-2-fibre-product-pr02}. In terms of the description of objects of the fibre category above we see that $((a, b, \alpha), (b, c, \beta))$ maps to $(a, c, \beta \circ \alpha)$. \medskip\noindent Unfortunately, this is {\it not compatible} with our conventions on groupoids where we always have $j = (t, s) : R \to U$, and we ``think'' of a $T$-valued point $r$ of $R$ as a morphism $r : s(r) \to t(r)$. However, this does not affect the proof of (4), since the opposite of a groupoid is a groupoid. But in the proof of (5) it is responsible for the inverses in the displayed formula below. \medskip\noindent Proof of (4). Recall that the sheaf $U$ is isomorphic to the sheaf $T \mapsto \Ob(\mathcal{U}_T)/\!\cong$, and similarly for $R$, see Lemma \ref{lemma-characterize-representable-by-space}. It follows from Categories, Lemma \ref{categories-lemma-category-fibred-setoids-presheaves-products} that this description is compatible with $2$-fibre products so we get a similar matching of $\mathcal{R} \times_{\text{pr}_1, \mathcal{U}, \text{pr}_0} \mathcal{R}$ and $R \times_{s, U, t} R$. The morphisms $t, s : R \to U$ and $c : R \times_{s, U, t} R \to R$ we get from the general equality (\ref{equation-morphisms-spaces}). Explicitly these maps are the transformations of functors that come from letting $\text{pr}_0$, $\text{pr}_0$, $\text{pr}_{02}$ act on isomorphism classes of objects of fibre categories. Hence to show that we obtain a groupoid in algebraic spaces it suffices to show that for every scheme $T$ over $S$ the structure $$ (\Ob(\mathcal{U}_T)/\!\cong, \Ob(\mathcal{R}_T)/\!\cong, \text{pr}_1, \text{pr}_0, \text{pr}_{02}) $$ is a groupoid which is clear from our description of objects of $\mathcal{R}_T$ above. \medskip\noindent Proof of (5). We will eventually apply Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-coequalizer} to obtain the functor $[U/R] \to \mathcal{X}$. Consider the $1$-morphism $f : \mathcal{U} \to \mathcal{X}$. We have a $2$-arrow $\tau : f \circ \text{pr}_1 \to f \circ \text{pr}_0$ by definition of $\mathcal{R}$ as the $2$-fibre product. Namely, on an object $(a, b, \alpha)$ of $\mathcal{R}$ over $T$ it is the map $\alpha^{-1} : b \to a$. We claim that $$ \tau \circ \text{id}_{\text{pr}_{02}} = (\tau \star \text{id}_{\text{pr}_0}) \circ (\tau \star \text{id}_{\text{pr}_1}). $$ This identity says that given an object $((a, b, \alpha), (b, c, \beta))$ of $\mathcal{R} \times_{\text{pr}_1, \mathcal{U}, \text{pr}_0} \mathcal{R}$ over $T$, then the composition of $$ \xymatrix{ c \ar[r]^{\beta^{-1}} & b \ar[r]^{\alpha^{-1}} & a } $$ is the same as the arrow $(\beta \circ \alpha)^{-1} : a \to c$. This is clearly true, hence the claim holds. In this way we see that all the assumption of Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-coequalizer} are satisfied for the structure $(\mathcal{U}, \mathcal{R}, \text{pr}_0, \text{pr}_1, \text{pr}_{02})$ and the $1$-morphism $f$ and the $2$-morphism $\tau$. Except, to apply the lemma we need to prove this holds for the structure $(\mathcal{S}_U, \mathcal{S}_R, s, t, c)$ with suitable morphisms. \medskip\noindent Now there should be some general abstract nonsense argument which transfer these data between the two, but it seems to be quite long. Instead, we use the following trick. Pick a quasi-inverse $j^{-1} : \mathcal{S}_U \to \mathcal{U}$ of the canonical equivalence $j : \mathcal{U} \to \mathcal{S}_U$ which comes from $U(T) = \Ob(\mathcal{U}_T)/\!\!\cong$. This just means that for every scheme $T/S$ and every object $a \in \mathcal{U}_T$ we have picked out a particular element of its isomorphism class, namely $j^{-1}(j(a))$. Using $j^{-1}$ we may therefore see $\mathcal{S}_U$ as a subcategory of $\mathcal{U}$. Having chosen this subcategory we can consider those objects $(a, b, \alpha)$ of $\mathcal{R}_T$ such that $a, b$ are objects of $(\mathcal{S}_U)_T$, i.e., such that $j^{-1}(j(a)) = a$ and $j^{-1}(j(b)) = b$. Then it is clear that this forms a subcategory of $\mathcal{R}$ which maps isomorphically to $\mathcal{S}_R$ via the canonical equivalence $\mathcal{R} \to \mathcal{S}_R$. Moreover, this is clearly compatible with forming the $2$-fibre product $\mathcal{R} \times_{\text{pr}_1, \mathcal{U}, \text{pr}_0} \mathcal{R}$. Hence we see that we may simply restrict $f$ to $\mathcal{S}_U$ and restrict $\tau$ to a transformation between functors $\mathcal{S}_R \to \mathcal{X}$. Hence it is clear that the displayed equality of Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-coequalizer} holds since it holds even as an equality of transformations of functors $\mathcal{R} \times_{\text{pr}_1, \mathcal{U}, \text{pr}_0} \mathcal{R} \to \mathcal{X}$ before restricting to the subcategory $\mathcal{S}_{R \times_{s, U, t} R}$. \medskip\noindent This proves that Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-coequalizer} applies and we get our desired morphism of stacks $f_{can} : [U/R] \to \mathcal{X}$. We briefly spell out how $f_{can}$ is defined in this special case. On an object $a$ of $\mathcal{S}_U$ over $T$ we have $f_{can}(a) = f(a)$, where we think of $\mathcal{S}_U \subset \mathcal{U}$ by the chosen embedding above. If $a, b$ are objects of $\mathcal{S}_U$ over $T$, then a morphism $\varphi : a \to b$ in $[U/R]$ is by definition an object of the form $\varphi = (b, a, \alpha)$ of $\mathcal{R}$ over $T$. (Note switch.) And the rule in the proof of Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-coequalizer} is that \begin{equation} \label{equation-on-morphisms} f_{can}(\varphi) = \Big(f(a) \xrightarrow{\alpha^{-1}} f(b)\Big). \end{equation} Proof of (6). Both $[U/R]$ and $\mathcal{X}$ are stacks. Hence given a scheme $T/S$ and objects $a, b$ of $[U/R]$ over $T$ we obtain a transformation of fppf sheaves $$ \mathit{Isom}(a, b) \longrightarrow \mathit{Isom}(f_{can}(a), f_{can}(b)) $$ on $(\Sch/T)_{fppf}$. We have to show that this is an isomorphism. We may work fppf locally on $T$, hence we may assume that $a, b$ come from morphisms $a, b : T \to U$. By the embedding $\mathcal{S}_U \subset \mathcal{U}$ above we may also think of $a, b$ as objects of $\mathcal{U}$ over $T$. In Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-morphisms} we have seen that the left hand sheaf is represented by the algebraic space $$ R \times_{(t, s), U \times_S U, (b, a)} T $$ over $T$. On the other hand, the right hand side is by Stacks, Lemma \ref{stacks-lemma-isom-as-2-fibre-product} equal to the sheaf associated to the following stack in setoids: $$ \mathcal{X} \times_{\mathcal{X} \times \mathcal{X}, (f \circ b, f \circ a)} T = \mathcal{X} \times_{\mathcal{X} \times \mathcal{X}, (f, f)} (\mathcal{U} \times \mathcal{U}) \times_{\mathcal{U} \times \mathcal{U}, (b, a)} T = \mathcal{R} \times_{(\text{pr}_0, \text{pr}_1), \mathcal{U} \times \mathcal{U}, (b, a)} T $$ which is representable by the fibre product displayed above. At this point we have shown that the two $\mathit{Isom}$-sheaves are isomorphic. Our $1$-morphism $f_{can} : [U/R] \to \mathcal{X}$ induces this isomorphism on $\mathit{Isom}$-sheaves by Equation (\ref{equation-on-morphisms}).