hcju/stacksqa huggingface dataset:
By Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-where-unramified} (resp.\ Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-base-change-quasi-finite-locus}) there is a maximal open subspace $U \subset G$ such that $U \to B$ is unramified (resp.\ locally quasi-finite) and formation of $U$ commutes with base change. Thus we reduce to the case where $B = \Spec(k)$ is the spectrum of a field. Let $g \in G(K)$ be a point with values in an extension $K/k$. Then to check whether or not $g$ is in $U$, we may base change to $K$. Hence it suffices to show $$ G \to \Spec(k)\text{ is unramified at }e \Leftrightarrow G \to \Spec(k)\text{ is unramified at }g $$ for a $k$-rational point $g$ (resp.\ similarly for quasi-finite at $g$ and $e$). Since translation by $g$ is an automorphism of $G$ over $k$ this is clear.
By Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-where-unramified} (resp.\ Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-base-change-quasi-finite-locus}) there is a maximal open subspace $W \subset G$ such that $W \to B$ is unramified (resp.\ locally quasi-finite). Moreover formation of $W$ commutes with base change. By Lemma \ref{lemma-group-scheme-unramified-or-lqf} we see that $U = e^{-1}(W)$ in either case.
Proof of (1). By Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-where-unramified} we reduce to the case where $B$ is the spectrum of a field. If $X$ is empty, then the result holds. If $X$ is nonempty, then after increasing the field, we may assume $X$ has a point. Then $G \cong X$ and the result holds. \medskip\noindent The proof of (2) works in exactly the same way using Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-base-change-quasi-finite-locus}.
The commutativity of the diagram follows from the axioms of a groupoid. Note that, in terms of groupoids, the top left vertical arrow assigns to a pair of morphisms $(\alpha, \beta)$ with the same target, the pair of morphisms $(\alpha, \alpha^{-1} \circ \beta)$. In any groupoid this defines a bijection between $\text{Arrows} \times_{t, \text{Ob}, t} \text{Arrows}$ and $\text{Arrows} \times_{s, \text{Ob}, t} \text{Arrows}$. Hence the second assertion of the lemma. The last assertion follows from Lemma \ref{lemma-diagram}.
Pull back the commutative diagram of Definition \ref{definition-groupoid-module} by the morphism $(i, 1) : R \to R \times_{s, U, t} R$. Then we see that $i^*\alpha \circ \alpha = s^*e^*\alpha$. Pulling back by the morphism $(1, i)$ we obtain the relation $\alpha \circ i^*\alpha = t^*e^*\alpha$. By the second assumption  these morphisms are the identity. Hence $i^*\alpha$ is an inverse of $\alpha$.
Let $i \mapsto (\mathcal{F}_i, \alpha_i)$ be a diagram over the index category $\mathcal{I}$. We can form the colimit $\mathcal{F} = \colim \mathcal{F}_i$ which is a quasi-coherent sheaf on $U$, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-properties-quasi-coherent}. Since colimits commute with pullback we see that $s^*\mathcal{F} = \colim s^*\mathcal{F}_i$ and similarly $t^*\mathcal{F} = \colim t^*\mathcal{F}_i$. Hence we can set $\alpha = \colim \alpha_i$. We omit the proof that $(\mathcal{F}, \alpha)$ is the colimit of the diagram in the category of quasi-coherent modules on $(U, R, s, t, c)$.
Assume $s$ and $t$ open and $W \subset U$ open. Since $s$ is open we see that $W' = s(t^{-1}(W))$ is an open subspace of $U$. Now it is quite easy to using the functorial point of view that this is an $R$-invariant open subset of $U$, but we are going to argue this directly by some diagrams, since we think it is instructive. Note that $t^{-1}(W')$ is the image of the morphism $$ A := t^{-1}(W) \times_{s|_{t^{-1}(W)}, U, t} R \xrightarrow{\text{pr}_1} R $$ and that $s^{-1}(W')$ is the image of the morphism $$ B := R \times_{s, U, s|_{t^{-1}(W)}} t^{-1}(W) \xrightarrow{\text{pr}_0} R. $$ The algebraic spaces $A$, $B$ on the left of the arrows above are open subspaces of $R \times_{s, U, t} R$ and $R \times_{s, U, s} R$ respectively. By Lemma \ref{lemma-diagram} the diagram $$ \xymatrix{ R \times_{s, U, t} R \ar[rd]_{\text{pr}_1} \ar[rr]_{(\text{pr}_1, c)} & & R \times_{s, U, s} R \ar[ld]^{\text{pr}_0} \\ & R & } $$ is commutative, and the horizontal arrow is an isomorphism. Moreover, it is clear that $(\text{pr}_1, c)(A) = B$. Hence we conclude $s^{-1}(W') = t^{-1}(W')$, and $W'$ is $R$-invariant. This proves (1). \medskip\noindent Assume now that $s$, $t$ are both open and quasi-compact. Then, if $W \subset U$ is a quasi-compact open, then also $W' = s(t^{-1}(W))$ is a quasi-compact open, and invariant by the discussion above. Letting $W$ range over images of affines \'etale over $U$ we see (2).
Suppose $\xi, \xi' \in (U'/R')(S')$ are sections which map to the same section of $U/R$. Then we can find an fppf covering $\mathcal{S} = \{S_i \to S'\}$ of $S'$ such that $\xi|_{S_i}, \xi'|_{S_i}$ are given by $a_i, a_i' \in U'(S_i)$. By Lemma \ref{lemma-quotient-pre-equivalence} and the axioms of a site we may after refining $\mathcal{T}$ assume there exist morphisms $r_i : S_i \to R$ such that $g \circ a_i = s \circ r_i$, $g \circ a_i' = t \circ r_i$. Since by construction $R' = R \times_{U \times_S U} (U' \times_S U')$ we see that $(r_i, (a_i, a_i')) \in R'(S_i)$ and this shows that $a_i$ and $a_i'$ define the same section of $U'/R'$ over $S_i$. By the sheaf condition this implies $\xi = \xi'$. \medskip\noindent If $U' \to U$ is a surjective map of sheaves, then $U'/R' \to U/R$ is surjective also. Finally, if $\{g : U' \to U\}$ is a fppf covering, then the map of sheaves $U' \to U$ is surjective, see Topologies on Spaces, Lemma \ref{spaces-topologies-lemma-fppf-covering-surjective}.
Injectivity follows on combining Lemmas \ref{lemma-groupoid-pre-equivalence} and \ref{lemma-quotient-pre-equivalence-relation-restrict}. To see surjectivity (see Sites, Section \ref{sites-section-sheaves-injective} for a characterization of surjective maps of sheaves) we argue as follows. Suppose that $T$ is a scheme and $\sigma \in U/R(T)$. There exists a covering $\{T_i \to T\}$ such that $\sigma|_{T_i}$ is the image of some element $f_i \in U(T_i)$. Hence we may assume that $\sigma$ if the image of $f \in U(T)$. By the assumption that $h$ is a surjection of sheaves, we can find an fppf covering $\{\varphi_i : T_i \to T\}$ and morphisms $f_i : T_i \to U' \times_{g, U, t} R$ such that $f \circ \varphi_i = h \circ f_i$. Denote $f'_i = \text{pr}_0 \circ f_i : T_i \to U'$. Then we see that $f'_i \in U'(T_i)$ maps to $g \circ f'_i \in U(T_i)$ and that $g \circ f'_i \sim_{T_i} h \circ f_i = f \circ \varphi_i$ notation as in (\ref{equation-quotient-presheaf}). Namely, the element of $R(T_i)$ giving the relation is $\text{pr}_1 \circ f_i$. This means that the restriction of $\sigma$ to $T_i$ is in the image of $U'/R'(T_i) \to U/R(T_i)$ as desired. \medskip\noindent If $\{h\}$ is an fppf covering, then it induces a surjection of sheaves, see Topologies on Spaces, Lemma \ref{spaces-topologies-lemma-fppf-covering-surjective}. If $U' \to U$ is surjective, then also $h$ is surjective as $s$ has a section (namely the neutral element $e$ of the groupoid scheme).
During this proof let us denote $[U/_{\!p}R]$ the category fibred in groupoids associated to the presheaf in groupoids (\ref{equation-quotient-stack}). By construction of the stackification there is a $1$-morphism $[U/_{\!p}R] \to [U/R]$. The $1$-morphism $\mathcal{S}_U \to [U/R]$ is simply the composition $\mathcal{S}_U \to [U/_{\!p}R] \to [U/R]$, where the first arrow associates to the scheme $S'/S$ and morphism $x : S' \to U$ over $S$ the object $x \in U(S')$ of the fibre category of $[U/_{\!p}R]$ over $S'$. \medskip\noindent To construct the $1$-morphism $[U/R] \to \mathcal{S}_B$ it is enough to construct the $1$-morphism $[U/_{\!p}R] \to \mathcal{S}_B$, see Stacks, Lemma \ref{stacks-lemma-stackify-groupoids-universal-property}. On objects over $S'/S$ we just use the map $$ U(S') \longrightarrow B(S') $$ coming from the structure morphism $U \to B$. And clearly, if $a \in R(S')$ is an ``arrow'' with source $s(a) \in U(S')$ and target $t(a) \in U(S')$, then since $s$ and $t$ are morphisms {\it over} $B$ these both map to the same element $\overline{a}$ of $B(S')$. Hence we can map an arrow $a \in R(S')$ to the identity morphism of $\overline{a}$. (This is good because the fibre category $(\mathcal{S}_B)_{S'}$ only contains identities.) We omit the verification that this rule is compatible with pullback on these split fibred categories, and hence defines a $1$-morphism $[U/_{\!p}R] \to \mathcal{S}_B$ as desired. \medskip\noindent We omit the verification of the last statement.
Let $S'$ be a scheme over $S$. Let $r : S' \to R$ be a morphism over $S$. Then $r \in R(S')$ is an isomorphism between the objects $s \circ r, t \circ r \in U(S')$. Moreover, this construction is compatible with pullbacks. This gives a canonical $2$-morphism $\alpha_p : \pi_p \circ s \to \pi_p \circ t$ where $\pi_p : \mathcal{S}_U \to [U/_{\!p}R]$ is as in the proof of Lemma \ref{lemma-quotient-stack-arrows}. Thus even the diagram $$ \xymatrix{ \mathcal{S}_R \ar[r]_s \ar[d]^t & \mathcal{S}_U \ar[d]^{\pi_p} \\ \mathcal{S}_U \ar[r]^-{\pi_p} & [U/_{\!p}R] } $$ is $2$-commutative. Thus a fortiori the diagram of the lemma is $2$-commutative.
Denote $[U/_{\!p}R]$ and $[U'/_{\!p}R']$ the categories fibred in groupoids over the base site $(\Sch/S)_{fppf}$ associated to the functors (\ref{equation-quotient-stack}). It is clear that $f$ defines a $1$-morphism $[U/_{\!p}R] \to [U'/_{\!p}R']$ which we can compose with the stackyfication functor for $[U'/R']$ to get $[U/_{\!p}R] \to [U'/R']$. Then, by the universal property of the stackyfication functor $[U/_{\!p}R] \to [U/R]$, see Stacks, Lemma \ref{stacks-lemma-stackify-groupoids-universal-property} we get $[U/R] \to [U'/R']$.
The maps $[f]$ and $[g]$ come from an application of Lemma \ref{lemma-quotient-stack-functorial} and the other two maps come from Lemma \ref{lemma-quotient-stack-arrows} (and the fact that $(U'', R'', s'', t'', c'')$ lives over $U'$). To show the $2$-fibre product property, it suffices to prove the lemma for the diagram $$ \xymatrix{ [U''/_{\!p}R''] \ar[d] \ar[r]_{[g]} & [U/_{\!p}R] \ar[d]^{[f]} \\ \mathcal{S}_{U'} \ar[r] & [U'/_{\!p}R'] } $$ of categories fibred in groupoids, see Stacks, Lemma \ref{stacks-lemma-stackification-fibre-product-categories-fibred-in-groupoids}. In other words, it suffices to show that an object of the $2$-fibre product $\mathcal{S}_U \times_{[U'/_{\!p}R']} [U/_{\!p}R]$ over $T$ corresponds to a $T$-valued point of $U''$ and similarly for morphisms. And of course this is exactly how we constructed $U''$ and $R''$ in the first place. \medskip\noindent In detail, an object of $\mathcal{S}_U \times_{[U'/_{\!p}R']} [U/_{\!p}R]$ over $T$ is a triple $(u', u, r')$ where $u'$ is a $T$-valued point of $U'$, $u$ is a $T$-valued point of $U$, and $r'$ is a morphism from $u'$ to $f(u)$ in $[U'/R']_T$, i.e., $r'$ is a $T$-valued point of $R$ with $s'(r') = u'$ and $t'(r') = f(u)$. Clearly we can forget about $u'$ without losing information and we see that these objects are in one-to-one correspondence with $T$-valued points of $R''$. \medskip\noindent Similarly for morphisms: Let $(u'_1, u_1, r'_1)$ and $(u'_2, u_2, r'_2)$ be two objects of the fibre product over $T$. Then a morphism from $(u'_2, u_2, r'_2)$ to $(u'_1, u_1, r'_1)$ is given by $(1, r)$ where $1 : u'_1 \to u'_2$ means simply $u'_1 = u'_2$ (this is so because $\mathcal{S}_U$ is fibred in sets), and $r$ is a $T$-valued point of $R$ with $s(r) = u_2$, $t(r) = u_1$ and moreover $c'(f(r), r'_2) = r'_1$. Hence the arrow $$ (1, r) : (u'_2, u_2, r'_2) \to (u'_1, u_1, r'_1) $$ is completely determined by knowing the pair $(r, r'_2)$. Thus the functor of arrows is represented by $R''$, and moreover the morphisms $s''$, $t''$, and $c''$ clearly correspond to source, target and composition in the $2$-fibre product $\mathcal{S}_U \times_{[U'/_{\!p}R']} [U/_{\!p}R]$.
Let $[U/_{\!p}R]$ be the category fibred in groupoids associated to the presheaf in groupoids (\ref{equation-quotient-stack}) as in the proof of Lemma \ref{lemma-quotient-stack-arrows}. By construction the sheaf $\mathit{Isom}(x, y)$ is the sheaf associated to the presheaf $\mathit{Isom}(x', y')$. On the other hand, by definition of morphisms in $[U/_{\!p}R]$ we have $$ \mathit{Isom}(x', y') = S' \times_{(y', x'), U \times_S U} R $$ and the right hand side is an algebraic space, therefore a sheaf.
According to Stacks, Lemma \ref{stacks-lemma-2-product-stacks-in-groupoids} the lemma makes sense. It also tells us that we have to show that the functor $$ \mathcal{S}_R \longrightarrow \mathcal{S}_U \times_{[U/R]} \mathcal{S}_U $$ which maps $r : T \to R$ to $(T, t(r), s(r), \alpha(r))$ is an equivalence, where the right hand side is the $2$-fibre product as described in Categories, Lemma \ref{categories-lemma-2-product-categories-over-C}. This is, after spelling out the definitions, exactly the content of Lemma \ref{lemma-quotient-stack-morphisms}. (Alternative proof: Work out the meaning of Lemma \ref{lemma-cartesian-square-of-morphism} in this situation will give you the result also.)
Suppose given $\mathcal{X}$, $f$ and $\beta$ as in the lemma. By Stacks, Lemma \ref{stacks-lemma-stackify-groupoids-universal-property} it suffices to construct a $1$-morphism $g : [U/_{\!p}R] \to \mathcal{X}$. First we note that the $1$-morphism $\mathcal{S}_U \to [U/_{\!p}R]$ is bijective on objects. Hence on objects we can set $g(x) = f(x)$ for $x \in \Ob(\mathcal{S}_U) = \Ob([U/_{\!p}R])$. A morphism $\varphi : x \to y$ of $[U/_{\!p}R]$ arises from a commutative diagram $$ \xymatrix{ S_2 \ar[dd]_h \ar[r]_x \ar[dr]_\varphi & U \\ & R \ar[u]_s \ar[d]^t \\ S_1 \ar[r]^y & U. } $$ Thus we can set $g(\varphi)$ equal to the composition $$ \xymatrix{ f(x) \ar@{=}[r] \ar[rrrrrd] & f(s \circ \varphi) \ar@{=}[r] & (f \circ s)(\varphi) \ar[r]^\beta & (f \circ t)(\varphi) \ar@{=}[r] & f(t \circ \varphi) \ar@{=}[r] & f(y \circ h) \ar[d] \\ & & & & & f(y). } $$ The vertical arrow is the result of applying the functor $f$ to the canonical morphism $y \circ h \to y$ in $\mathcal{S}_U$ (namely, the strongly cartesian morphism lifting $h$ with target $y$). Let us verify that $f$ so defined is compatible with composition, at least on fibre categories. So let $S'$ be a scheme over $S$, and let $a : S' \to R \times_{s, U, t} R$ be a morphism. In this situation we set $x = s \circ \text{pr}_1 \circ a = s \circ c \circ a$, $y = t \circ \text{pr}_1 \circ a = s \circ \text{pr}_0 \circ a$, and $z = t \circ \text{pr}_0 \circ a = t \circ \text{pr}_0 \circ c$ to get a commutative diagram $$ \xymatrix{ x \ar[rr]_{c \circ a} \ar[rd]_{\text{pr}_1 \circ a} & & z \\ & y \ar[ru]_{\text{pr}_0 \circ a} } $$ in the fibre category $[U/_{\!p}R]_{S'}$. Moreover, any commutative triangle in this fibre category has this form. Then we see by our definitions above that $f$ maps this to a commutative diagram if and only if the diagram $$ \xymatrix{ & (f \circ s)(c \circ a) \ar[r]_-{\beta} & (f \circ t)(c \circ a) \ar@{=}[rd] & \\ (f \circ s)(\text{pr}_1 \circ a) \ar[rd]^\beta \ar@{=}[ru] & & & (f \circ t)(\text{pr}_0 \circ a) \\ & (f \circ t)(\text{pr}_1 \circ a) \ar@{=}[r] & (f \circ s)(\text{pr}_0 \circ a) \ar[ru]^\beta } $$ is commutative which is exactly the condition expressed by the formula in the lemma. We omit the verification that $f$ maps identities to identities and is compatible with composition for arbitrary morphisms.
Let $x, y$ be objects of $[U/R]$ over a scheme $T/S$. Let $x', y'$ be the images of $x, y$ in the category $[U'/R']_T$. The functor $[f]$ is fully faithful if and only if the map of sheaves $$ \mathit{Isom}(x, y) \longrightarrow \mathit{Isom}(x', y') $$ is an isomorphism for every $T, x, y$. We may test this locally on $T$ (in the fppf topology). Hence, by Lemma \ref{lemma-quotient-stack-objects} we may assume that $x, y$ come from $a, b \in U(T)$. In that case we see that $x', y'$ correspond to $f \circ a, f \circ b$. By Lemma \ref{lemma-quotient-stack-morphisms} the displayed map of sheaves in this case becomes $$ T \times_{(a, b), U \times_B U} R \longrightarrow T \times_{f \circ a, f \circ b, U' \times_B U'} R'. $$ This is an isomorphism if $R$ is the restriction, because in that case $R = (U \times_B U) \times_{U' \times_B U'} R'$, see Lemma \ref{lemma-restrict-groupoid-relation} and its proof. Conversely, if the last displayed map is an isomorphism for all $T, a, b$, then it follows that $R = (U \times_B U) \times_{U' \times_B U'} R'$, i.e., $R$ is the restriction of $R'$.
We already know that part (1) is equivalent to fully faithfulness by Lemma \ref{lemma-quotient-stack-restrict}. Hence we may assume that (1) holds and that $[f]$ is fully faithful. Our goal is to show, under these assumptions, that $[f]$ is an equivalence if and only if (2) holds. We may use Stacks, Lemma \ref{stacks-lemma-characterize-essentially-surjective-when-ff} which characterizes equivalences. \medskip\noindent Assume (2). We will use Stacks, Lemma \ref{stacks-lemma-characterize-essentially-surjective-when-ff} to prove $[f]$ is an equivalence. Suppose that $T$ is a scheme and $x' \in \Ob([U'/R']_T)$. There exists a covering $\{g_i : T_i \to T\}$ such that $g_i^*x'$ is the image of some element $a'_i \in U'(T_i)$, see Lemma \ref{lemma-quotient-stack-objects}. Hence we may assume that $x'$ is the image of $a' \in U'(T)$. By the assumption that $h$ is a surjection of sheaves, we can find an fppf covering $\{\varphi_i : T_i \to T\}$ and morphisms $b_i : T_i \to U \times_{g, U', t'} R'$ such that $a' \circ \varphi_i = h \circ b_i$. Denote $a_i = \text{pr}_0 \circ b_i : T_i \to U$. Then we see that $a_i \in U(T_i)$ maps to $f \circ a_i \in U'(T_i)$ and that $f \circ a_i \cong_{T_i} h \circ b_i = a' \circ \varphi_i$, where $\cong_{T_i}$ denotes isomorphism in the fibre category $[U'/R']_{T_i}$. Namely, the element of $R'(T_i)$ giving the isomorphism is $\text{pr}_1 \circ b_i$. This means that the restriction of $x$ to $T_i$ is in the essential image of the functor $[U/R]_{T_i} \to [U'/R']_{T_i}$ as desired. \medskip\noindent Assume $[f]$ is an equivalence. Let $\xi' \in [U'/R']_{U'}$ denote the object corresponding to the identity morphism of $U'$. Applying Stacks, Lemma \ref{stacks-lemma-characterize-essentially-surjective-when-ff} we see there exists an fppf covering $\mathcal{U}' = \{g'_i : U'_i \to U'\}$ such that $(g'_i)^*\xi' \cong [f](\xi_i)$ for some $\xi_i$ in $[U/R]_{U'_i}$. After refining the covering $\mathcal{U}'$ (using Lemma \ref{lemma-quotient-stack-objects}) we may assume $\xi_i$ comes from a morphism $a_i : U'_i \to U$. The fact that $[f](\xi_i) \cong (g'_i)^*\xi'$ means that, after possibly refining the covering $\mathcal{U}'$ once more, there exist morphisms $r'_i : U'_i \to R'$ with $t' \circ r'_i = f \circ a_i$ and $s' \circ r'_i = \text{id}_{U'} \circ g'_i$. Picture $$ \xymatrix{ U \ar[d]^f & & U'_i \ar[ll]^{a_i} \ar[ld]_{r'_i} \ar[d]^{g'_i} \\ U' & R' \ar[l]_{t'} \ar[r]^{s'} & U' } $$ Thus $(a_i, r'_i) : U'_i \to U \times_{g, U', t'} R'$ are morphisms such that $h \circ (a_i, r'_i) = g'_i$ and we conclude that $\{h : U \times_{g, U', t'} R' \to U'\}$ can be refined by the fppf covering $\mathcal{U}'$ which means that $h$ induces a surjection of sheaves, see Topologies on Spaces, Lemma \ref{spaces-topologies-lemma-fppf-covering-surjective}. \medskip\noindent If $\{h\}$ is an fppf covering, then it induces a surjection of sheaves, see Topologies on Spaces, Lemma \ref{spaces-topologies-lemma-fppf-covering-surjective}. If $U' \to U$ is surjective, then also $h$ is surjective as $s$ has a section (namely the neutral element $e$ of the groupoid in algebraic spaces).
Applying the inverse isomorphisms $i : R \to R$ and $i' : R' \to R'$ to the (first) cartesian diagram of the statement of the lemma we see that $$ \xymatrix{ R \ar[d]_t \ar[r]_f & R' \ar[d]^{t'} \\ U \ar[r]^f & U' } $$ is cartesian as well. By Lemma \ref{lemma-cartesian-square-of-morphism} we have a $2$-fibre square $$ \xymatrix{ [U''/R''] \ar[d] \ar[r] & [U/R] \ar[d] \\ \mathcal{S}_{U'} \ar[r] & [U'/R'] } $$ where $U'' = U \times_{f, U', t'} R'$ and $R'' = R \times_{f \circ s, U', t'} R'$. By the above we see that $(t, f) : R \to U''$ is an isomorphism, and that $$ R'' = R \times_{f \circ s, U', t'} R' = R \times_{s, U} U \times_{f, U', t'} R' = R \times_{s, U, t} \times R. $$ Explicitly the isomorphism $R \times_{s, U, t} R \to R''$ is given by the rule $(r_0, r_1) \mapsto (r_0, f(r_1))$. Moreover, $s'', t'', c''$ translate into the maps $$ R \times_{s, U, t} R \to R, \quad s''(r_0, r_1) = r_1, \quad t''(r_0, r_1) = c(r_0, r_1) $$ and $$ \begin{matrix} c'' : & (R \times_{s, U, t} R) \times_{s'', R, t''} (R \times_{s, U, t} R) & \longrightarrow & R \times_{s, U, t} R, \\ & ((r_0, r_1), (r_2, r_3)) & \longmapsto & (c(r_0, r_2), r_3). \end{matrix} $$ Precomposing with the isomorphism $$ R \times_{s, U, s} R \longrightarrow R \times_{s, U, t} R, \quad (r_0, r_1) \longmapsto (c(r_0, i(r_1)), r_1) $$ we see that $t''$ and $s''$ turn into $\text{pr}_0$ and $\text{pr}_1$ and that $c''$ turns into $\text{pr}_{02} : R \times_{s, U, s} R \times_{s, U, s} R \to R \times_{s, U, s} R$. Hence we see that there is an isomorphism $[U''/R''] \cong [R/R \times_{s, U, s} R]$ where as a groupoid in algebraic spaces $(R, R \times_{s, U, s} R, s'', t'', c'')$ is the restriction of the trivial groupoid $(U, U, \text{id}, \text{id}, \text{id})$ via $s : R \to U$. Since $s : R \to U$ is a surjection of fppf sheaves (as it has a right inverse) the morphism $$ [U''/R''] \cong [R/R \times_{s, U, s} R] \longrightarrow [U/U] = \mathcal{S}_U $$ is an equivalence by Lemma \ref{lemma-quotient-stack-restrict-equivalence}. This proves the lemma.
By Stacks, Lemma \ref{stacks-lemma-stackification-inertia} it suffices to prove that $\mathcal{I}_{[U/_{\!p}R]} = [G/_{\!p} R']$. Let $T$ be a scheme over $S$. Recall that an object of the inertia fibred category of $[U/_{\!p}R]$ over $T$ is given by a pair $(x, g)$ where $x$ is an object of $[U/_{\!\!p}R]$ over $T$ and $g$ is an automorphism of $x$ in its fibre category over $T$. In other words, $x : T \to U$ and $g : T \to R$ such that $x = s \circ g = t \circ g$. This means exactly that $g : T \to G$. A morphism in the inertia fibred category from $(x, g) \to (y, h)$ over $T$ is given by $r : T \to R$ such that $s(r) = x$, $t(r) = y$ and $c(r, g) = c(h, r)$, see the commutative diagram in Categories, Lemma \ref{categories-lemma-inertia-fibred-category}. In a formula $$ h = c(r, c(g, i(r))) = c(c(r, g), i(r)). $$ The notation $s(r)$, etc is a short hand for $s \circ r$, etc. The composition of $r_1 : (x_2, g_2) \to (x_1, g_1)$ and $r_2 : (x_1, g_1) \to (x_2, g_2)$ is $c(r_1, r_2) : (x_1, g_1) \to (x_3, g_3)$. \medskip\noindent Note that in the above we could have written $g$ in stead of $(x, g)$ for an object of $\mathcal{I}_{[U/_{\!p}R]}$ over $T$ as $x$ is the image of $g$ under the structure morphism $G \to U$. Then the morphisms $g \to h$ in $\mathcal{I}_{[U/_{\!p}R]}$ over $T$ correspond exactly to morphisms $r' : T \to R'$ with $s'(r') = g$ and $t'(r') = h$. Moreover, the composition corresponds to the rule explained in (3). Thus the lemma is proved.
We will verify that Stacks, Lemma \ref{stacks-lemma-when-gerbe} properties (2) (a) and (2) (b) hold. Property (2)(a) holds because $U \to U'$ is a surjective map of sheaves (use Lemma \ref{lemma-quotient-stack-objects} to see that objects in $[U'/R']$ locally come from $U'$). To prove (2)(b) let $x, y$ be objects of $[U/R]$ over a scheme $T/S$. Let $x', y'$ be the images of $x, y$ in the category $[U'/'R]_T$. Condition (2)(b) requires us to check the map of sheaves $$ \mathit{Isom}(x, y) \longrightarrow \mathit{Isom}(x', y') $$ on $(\Sch/T)_{fppf}$ is surjective. To see this we may work fppf locally on $T$ and assume that come from $a, b \in U(T)$. In that case we see that $x', y'$ correspond to $f \circ a, f \circ b$. By Lemma \ref{lemma-quotient-stack-morphisms} the displayed map of sheaves in this case becomes $$ T \times_{(a, b), U \times_B U} R \longrightarrow T \times_{f \circ a, f \circ b, U' \times_B U'} R' = T \times_{(a, b), U \times_B U} R'|_U. $$ Hence the assumption that $R \to R'|_U$ is a surjective map of fppf sheaves on $(\Sch/S)_{fppf}$ implies the desired surjectivity.