hcju/stacksqa huggingface dataset:
Denote $i : W \to W'$ and $i'' : W \to W''$ the given thickenings. The commutativity of the diagram in the statement of the lemma means there is a $2$-morphism $\delta : x' \circ i' \to x'' \circ i''$ This is the $2$-morphism referred to in part (c) of the statement. Consider the algebraic space $$ I' = W' \times_{x', \mathcal{X}', x''} W'' $$ with projections $p' : I' \to W'$ and $q' : I' \to W''$. Observe that there is a ``universal'' $2$-morphism $\gamma : x' \circ p' \to x'' \circ q'$ (we will use this later). The choice of $\delta$ defines a morphism $$ \xymatrix{ W \ar[rr]_\delta & & I' \ar[ld]^{p'} \ar[rd]_{q'} \\ & W' & & W'' } $$ such that the compositions $W \to I' \to W'$ and $W \to I' \to W''$ are $i : W \to W'$ and $i' : W \to W''$. Since $x''$ is smooth, the morphism $p' : I' \to W'$ is smooth as a base change of $x''$. \medskip\noindent Suppose we can find an \'etale covering $\{f'_k : W'_k \to W'\}$ and morphisms $\delta_k : W'_k \to I'$ such that the restriction of $\delta_k$ to $W_k = (f'_k)^{-1}$ is equal to $\delta \circ f_k$ where $f_k = f'_k|_{W_k}$. Picture $$ \xymatrix{ W_k \ar[r]^{f_k} \ar[d] & W \ar[r]^\delta & I' \ar[d]^{p'} \\ W'_k \ar[rr]^{f'_k} \ar[rru]^{\delta_k} & & W' } $$ In other words, we want to be able to extend the given section $\delta : W \to I'$ of $p'$ to a section over $W'$ after possibly replacing $W'$ by an \'etale covering. \medskip\noindent If this is true, then we can set $f''_k = q' \circ \delta_k$ and $\gamma_k = \gamma \star \text{id}_{\delta_k}$ (more succinctly $\gamma_k = \delta_k^*\gamma$). Namely, the only thing left to show at this is that the morphism $f''_k$ is \'etale. By construction the morphism $x' \circ p'$ is $2$-isomorphic to $x'' \circ q'$. Hence $x'' \circ f''_k$ is $2$-isomorphic to $x' \circ f'_k$. We conclude that the composition $$ W'_k \xrightarrow{f''_k} W'' \xrightarrow{x''} \mathcal{X}' $$ is smooth because $x' \circ f'_k$ is so. As $f_k$ is \'etale we conclude $f''_k$ is \'etale by Lemma \ref{lemma-deform-property-fp-over-ft}. \medskip\noindent If the thickening is a first order thickening, then we can choose any \'etale covering $\{W'_k \to W'\}$ with $W_k'$ affine. Namely, since $p'$ is smooth we see that $p'$ is formally smooth by the infinitesimal lifting criterion (More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-smooth-formally-smooth}). As $W_k$ is affine and as $W_k \to W'_k$ is a first order thickening (as a base change of $\mathcal{X} \to \mathcal{X}'$, see Lemma \ref{lemma-base-change-thickening}) we get $\delta_k$ as desired. \medskip\noindent In the general case the existence of the covering and the morphisms $\delta_k$ follows from More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-smooth-strong-lift}.
In Lemma \ref{lemma-gerbe-of-lifts-stack} we have seen that it is a stack in groupoids. Thus it remains to check conditions (2) and (3) of Stacks, Definition \ref{stacks-definition-gerbe}. Condition (2) follows from Lemma \ref{lemma-etale-local-lifts}. Condition (3) follows from Lemma \ref{lemma-etale-local-lifts-isomorphic}.
Recall that $\text{Inf}_x(M)$ is the set of automorphisms of the trivial deformation of $x$ to $A[M]$ which induce the identity automorphism of $x$ over $A$. The trivial deformation is the pullback of $x$ to $\Spec(A[M])$ via $\Spec(A[M]) \to \Spec(A)$. Let $G \to \Spec(A)$ be the automorphism group algebraic space of $x$ (this exists because $\mathcal{X}$ is an algebraic space). Let $e : \Spec(A) \to G$ be the neutral element. The discussion in More on Morphisms of Spaces, Section \ref{spaces-more-morphisms-section-action-by-derivations} gives $$ \text{Inf}_x(M) = \Hom_A(e^*\Omega_{G/A}, M) $$ By the same token $$ \text{Inf}_y(M \otimes_A B) = \Hom_B(e_B^*\Omega_{G_B/B}, M \otimes_A B) $$ Since $G \to \Spec(A)$ is locally of finite presentation by assumption, we see that $\Omega_{G/A}$ is locally of finite presentation, see More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-finite-presentation-differentials}. Hence $e^*\Omega_{G/A}$ is a finitely presented $A$-module. Moreover, $\Omega_{G_B/B}$ is the pullback of $\Omega_{G/A}$ by More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-base-change-differentials}. Therefore $e_B^*\Omega_{G_B/B} = e^*\Omega_{G/A} \otimes_A B$. we conclude by More on Algebra, Lemma \ref{more-algebra-lemma-pseudo-coherence-and-base-change-ext}.
Let $\{T'_i \to T'\}_{i = 1, \ldots n}$ be a standard fppf covering of affine schemes over $A'$. Write $T' = \Spec(B')$. As usual denote $$ T'_{i_0 \ldots i_p} = T'_{i_0} \times_{T'} \ldots \times_{T'} T'_{i_p} = \Spec(B'_{i_0 \ldots i_p}) $$ where the ring is a suitable tensor product. Set $B = B' \otimes_{A'} A$ and $B_{i_0 \ldots i_p} = B'_{i_0 \ldots i_p} \otimes_{A'} A$. Denote $y = x|_B$ and $y_{i_0 \ldots i_p} = x|_{B_{i_0 \ldots i_p}}$. Let $\gamma_i \in F(B'_i)$ such that $\gamma_{i_0}$ and $\gamma_{i_1}$ map to the same element of $F(B'_{i_0i_1})$. We have to find a unique $\gamma \in F(B')$ mapping to $\gamma_i$ in $F(B'_i)$. \medskip\noindent Choose an actual object $y'_i$ of $\textit{Lift}(y_i, B'_i)$ in the isomorphism class $\gamma_i$. Choose isomorphisms $\varphi_{i_0i_1} : y'_{i_0}|_{B'_{i_0i_1}} \to y'_{i_1}|_{B'_{i_0i_1}}$ in the category $\textit{Lift}(y_{i_0i_1}, B'_{i_0i_1})$. If the maps $\varphi_{i_0i_1}$ satisfy the cocycle condition, then we obtain our object $\gamma$ because $\mathcal{X}$ is a stack in the fppf topology. The cocycle condition is that the composition $$ y'_{i_0}|_{B'_{i_0i_1i_2}} \xrightarrow{\varphi_{i_0i_1}|_{B'_{i_0i_1i_2}}} y'_{i_1}|_{B'_{i_0i_1i_2}} \xrightarrow{\varphi_{i_1i_2}|_{B'_{i_0i_1i_2}}} y'_{i_2}|_{B'_{i_0i_1i_2}} \xrightarrow{\varphi_{i_2i_0}|_{B'_{i_0i_1i_2}}} y'_{i_0}|_{B'_{i_0i_1i_2}} $$ is the identity. If not, then these maps give elements $$ \delta_{i_0i_1i_2} \in \text{Inf}_{y_{i_0i_1i_2}}(J_{i_0i_1i_2}) = \text{Inf}_y(J) \otimes_B B_{i_0i_1i_2} $$ Here $J = \Ker(B' \to B)$ and $J_{i_0 \ldots i_p} = \Ker(B'_{i_0 \ldots i_p} \to B_{i_0 \ldots i_p})$. The equality in the displayed equation holds by Lemma \ref{lemma-inf-quasi-coherent} applied to $B' \to B'_{i_0 \ldots i_p}$ and $y$ and $y_{i_0 \ldots i_p}$, the flatness of the maps $B' \to B'_{i_0 \ldots i_p}$ which also guarantees that $J_{i_0 \ldots i_p} = J \otimes_{B'} B'_{i_0 \ldots i_p}$. A computation (omitted) shows that $\delta_{i_0i_1i_2}$ gives a $2$-cocycle in the {\v C}ech complex $$ \prod \text{Inf}_y(J) \otimes_B B_{i_0} \to \prod \text{Inf}_y(J) \otimes_B B_{i_0i_1} \to \prod \text{Inf}_y(J) \otimes_B B_{i_0i_1i_2} \to \ldots $$ By Descent, Lemma \ref{descent-lemma-standard-covering-Cech-quasi-coherent} this complex is acyclic in positive degrees and has $H^0 = \text{Inf}_y(J)$. Since $\text{Inf}_{y_{i_0i_1}}(J_{i_0i_1})$ acts on morphisms (Artin's Axioms, Remark \ref{artin-remark-automorphisms}) this means we can modify our choice of $\varphi_{i_0i_1}$ to get to the case where $\delta_{i_0i_1i_2} = 0$. \medskip\noindent Uniqueness. We still have to show there is at most one $\gamma$ restricting to $\gamma_i$ for all $i$. Suppose we have objects $y', z'$ of $\textit{Lift}(y, B')$ and isomorphisms $\psi_i : y'|_{B'_i} \to z'|_{B'_i}$ in $\textit{Lift}(y_i, B'_i)$. Then we can consider $$ \psi_{i_1}^{-1} \circ \psi_{i_0} \in \text{Inf}_{y_{i_0i_1}}(J_{i_0i_1}) = \text{Inf}_y(J) \otimes_B B_{i_0i_1} $$ Arguing as before, the obstruction to finding an isomorphism between $y'$ and $z'$ over $B'$ is an element in the $H^1$ of the {\v C}ech complex displayed above which is zero.
Let $I = \Ker(A' \to A)$. Set $B'_1 = B' \otimes_{A'} B'$ and $B'_2 = B' \otimes_{A'} B' \otimes_{A'} B'$. Let $J = IB'$, $J_1 = IB'_1$, $J_2 = IB'_2$ and $B = B'/J$, $B_1 = B'_1/J_1$, $B_2 = B'_2/J_2$. Set $y = x|_B$, $y_1 = x|_{B_1}$, $y_2 = x|_{B_2}$. Let $F$ be the fppf sheaf of Lemma \ref{lemma-sheaf-of-infinitesimal-lifts} (which applies, see footnote in the proof of Lemma \ref{lemma-T-quasi-coherent}). Thus we have an equalizer diagram $$ \xymatrix{ F(A') \ar[r] & F(B') \ar@<1ex>[r] \ar@<-1ex>[r] & F(B'_1) } $$ On the other hand, we have $F(B') = \text{Lift}(y, B')$, $F(B'_1) = \text{Lift}(y_1, B'_1)$, and $F(B'_2) = \text{Lift}(y_2, B'_2)$ in the terminology from Artin's Axioms, Section \ref{artin-section-inf}. These sets are nonempty and are (canonically) principal homogeneous spaces for $T_y(J)$, $T_{y_1}(J_1)$, $T_{y_2}(J_2)$, see Artin's Axioms, Lemma \ref{artin-lemma-properties-lift-RS-star}. Thus the difference of the two images of $y'$ in $F(B'_1)$ is an element $$ \delta_1 \in T_{y_1}(J_1) = T_x(I) \otimes_A B_1 $$ The equality in the displayed equation holds by Lemma \ref{lemma-T-quasi-coherent} applied to $A' \to B'_1$ and $x$ and $y_1$, the flatness of $A' \to B'_1$ which also guarantees that $J_1 = I \otimes_{A'} B'_1$. We have similar equalities for $B'$ and $B'_2$. A computation (omitted) shows that $\delta_1$ gives a $1$-cocycle in the {\v C}ech complex $$ T_x(I) \otimes_A B \to T_x(I) \otimes_A B_1 \to T_x(I) \otimes_A B_2 \to \ldots $$ By Descent, Lemma \ref{descent-lemma-standard-covering-Cech-quasi-coherent} this complex is acyclic in positive degrees and has $H^0 = T_x(I)$. Thus we may choose an element in $T_x(I) \otimes_A B = T_y(J)$ whose boundary is $\delta_1$. Replacing $y'$ by the result of this element acting on it, we find a new choice $y'$ with $\delta_1 = 0$. Thus $y'$ maps to the same element under the two maps $F(B') \to F(B'_1)$ and we obtain an element o $F(A')$ by the sheaf condition.
We may apply the result of Lemma \ref{lemma-local-lift-enough}. Thus it suffices to construct a smooth surjective morphism $W' \to T'$ with $W'$ affine such that $x|_{T \times_{W'} T'}$ lifts to $W'$. (We urge the reader to find their own proof of this fact using the analogous result for algebraic spaces already established.) We choose a scheme $U'$ and a surjective smooth morphism $U' \to \mathcal{X}'$. Observe that $U' \to T'$ is smooth and that the projection $T \times_{\mathcal{X}'} U' \to T$ is surjective smooth. Choose an affine scheme $W$ and an \'etale morphism $W \to T \times_{\mathcal{X}'} U'$ such that $W \to T$ is surjective. Then $W \to T$ is a smooth morphism of affine schemes. After replacing $W$ by a disjoint union of principal affine opens, we may assume there exists a smooth morphism of affines $W' \to T'$ such that $W = T \times_{T'} W'$, see Algebra, Lemma \ref{algebra-lemma-lift-smooth}. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-smooth-formally-smooth} we can find a morphism $W' \to U'$ over $T'$ lifting the given morphism $W \to U'$. This finishes the proof.
Assume $f$ is smooth. Then $f$ is locally of finite presentation by Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-smooth-locally-finite-presentation}. Hence it suffices given a diagram (\ref{equation-diagram}) and a $\gamma : y \circ i \to f \circ x$ to find a dotted arrow (see Lemma \ref{lemma-reformulate-formal-smoothness}). Forming fibre products we obtain $$ \xymatrix{ T \ar[d] \ar[r] & T' \times_\mathcal{Y} \mathcal{X} \ar[d] \ar[r] & \mathcal{X} \ar[d] \\ T' \ar[r] & T' \ar[r] & \mathcal{Y} } $$ Thus we see it is sufficient to find a dotted arrow in the left square. Since $T' \times_\mathcal{Y} \mathcal{X} \to T'$ is smooth (Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-base-change-smooth}) existence of a dotted arrow in the left square is guaranteed by Lemma \ref{lemma-lift-to-smooth}. \medskip\noindent Conversely, suppose that $f$ is locally of finite presentation and formally smooth. Choose a scheme $U$ and a surjective smooth morphism $U \to \mathcal{X}$. Then $a : U \to \mathcal{X}$ and $b : U \to \mathcal{Y}$ are representable by algebraic spaces and locally of finite presentation (use Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-composition-finite-presentation} and the fact seen above that a smooth morphism is locally of finite presentation). We will apply the general principle of Algebraic Stacks, Lemma \ref{algebraic-lemma-representable-transformations-property-implication} with as input the equivalence of More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-smooth-formally-smooth} and simultaneously use the translation of Criteria for Representability, Lemma \ref{criteria-lemma-representable-by-spaces-formally-smooth}. We first apply this to $a$ to see that $a$ is formally smooth on objects. Next, we use that $f$ is formally smooth on objects by assumption (see Lemma \ref{lemma-reformulate-formal-smoothness}) and Criteria for Representability, Lemma \ref{criteria-lemma-composition-formally-smooth} to see that $b = f \circ a$ is formally smooth on objects. Then we apply the principle once more to conclude that $b$ is smooth. This means that $f$ is smooth by the definition of smoothness for morphisms of algebraic stacks and the proof is complete.
Observe that $\mathcal{X}$ is quasi-compact. Choose an affine scheme $U$ and a surjective smooth morphism $U \to \mathcal{X}$. Let $R = U \times_\mathcal{X} U$ so that we obtain a groupoid $(U, R, s, t, c)$ in algebraic spaces over $Y$ with $\mathcal{X} = [U/R]$ (Algebraic Stacks, Lemma \ref{algebraic-lemma-stack-presentation}). We may apply More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-flat-after-blowing-up} to $U \to Y$ and the open $V \subset Y$. Thus we obtain a $V$-admissible blowup $Y' \to Y$ such that the strict transform $U' \subset U_{Y'}$ is flat and of finite presentation over $Y'$. Let $R' \subset R_{Y'}$ be the strict transform of $R$. Since $s$ and $t$ are smooth (and in particular flat) it follows from Divisors on Spaces, Lemma \ref{spaces-divisors-lemma-strict-transform-flat} that we have cartesian diagrams $$ \vcenter{ \xymatrix{ R' \ar[r] \ar[d] & R_{Y'} \ar[d]^{s_{Y'}} \\ U' \ar[r] & U_{Y'} } } \quad\text{and}\quad \vcenter{ \xymatrix{ R' \ar[r] \ar[d] & R_{Y'} \ar[d]^{t_{Y'}} \\ U' \ar[r] & U_{Y'} } } $$ In other words, $U'$ is an $R_{Y'}$-invariant closed subspace of $U_{Y'}$. Thus $U'$ defines a closed substack $\mathcal{X}' \subset \mathcal{X}_{Y'}$ by Properties of Stacks, Lemma \ref{stacks-properties-lemma-substacks-presentation}. The morphism $\mathcal{X}' \to Y'$ is flat and locally of finite presentation because this is true for $U' \to Y'$. On the other hand, we already know $\mathcal{X}' \to Y'$ is quasi-compact and quasi-separated (by our assumptions on $f$ and because this is true for closed immersions). This finishes the proof.
We first prove this when $Y$ is a scheme. We may choose a scheme $U$ and a surjective smooth morphism $U \to \mathcal{X}$. Then $\{U \to V\}$ is an fppf covering of schemes. By More on Morphisms, Lemma \ref{more-morphisms-lemma-dominate-fppf-finite} there exists a finite surjective morphism $V' \to V$ such that $V' \to V$ factors Zariski locally through $U$. By More on Morphisms, Lemma \ref{more-morphisms-lemma-extend-finite-surjective-morphisms} we can find a finite surjective morphism $Y' \to Y$ whose restriction to $V$ is $V' \to V$ as desired. \medskip\noindent If $Y$ is an algebraic space, then we see the lemma is true by first doing a finite base change by a finite surjective morphism $Y' \to Y$ where $Y'$ is a scheme. See Limits of Spaces, Proposition \ref{spaces-limits-proposition-there-is-a-scheme-finite-over}.
To prove that $f$ is separated we have to show that $\Delta : \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$ is proper. We already know that $\Delta$ is representable by algebraic spaces, locally of finite type (Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-properties-diagonal}) and quasi-compact and quasi-separated (by definition of $f$ being quasi-separated). Choose a scheme $U$ and a surjective smooth morphism $U \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$. Set $$ V = \mathcal{X} \times_{\Delta, \mathcal{X} \times_\mathcal{Y} \mathcal{X}} U $$ It suffices to show that the morphism of algebraic spaces $V \to U$ is proper (Properties of Stacks, Lemma \ref{stacks-properties-lemma-check-property-covering}). Observe that $U$ is locally Noetherian (use Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-locally-finite-type-locally-noetherian} and the fact that $U \to \mathcal{Y}$ is locally of finite type) and $V \to U$ is of finite type and quasi-separated (as the base change of $\Delta$ and properties of $\Delta$ listed above). Applying Cohomology of Spaces, Lemma \ref{spaces-cohomology-lemma-check-proper-dvr} it suffices to show: Given a commutative diagram $$ \xymatrix{ \Spec(K) \ar[r]_v \ar[d]_j & V \ar[d]^g \ar[r] & \mathcal{X} \ar[d]^\Delta \\ \Spec(A) \ar[r]^u \ar@{-->}[ru] \ar@{..>}[rru] & U \ar[r] & \mathcal{X} \times_\mathcal{Y} \mathcal{X} } $$ where $A$ is a discrete valuation ring and $K$ its fraction field, there is a unique dashed arrow making the diagram commute. By Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-cat-dotted-arrows-base-change} the categories of dashed and dotted arrows are equivalent. Assumption (3) implies there is a unique dotted arrow up to isomorphism, see Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-helper-diagonal}. We conclude there is a unique dashed arrow as desired.
We have to prove $\Delta$ is a proper morphism. Assume first that $\Delta$ is separated. Then we may apply Lemma \ref{lemma-refined-valuative-criterion-proper} to the morphisms $\mathcal{U} \to \mathcal{X}$ and $\Delta : \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$. Observe that $\Delta$ is quasi-compact as $f$ is quasi-separated. Of course $\Delta$ is locally of finite type (true for any diagonal morphism, see Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-properties-diagonal}). Finally, suppose given a $2$-commutative diagram $$ \xymatrix{ \Spec(K) \ar[r]_-u \ar[d]_j & \mathcal{U} \ar[r]_h & \mathcal{X} \ar[d]^\Delta \\ \Spec(A) \ar[rr]^-y \ar@{..>}[rru] & & \mathcal{X} \times_\mathcal{Y} \mathcal{X} } $$ where $A$ is a discrete valuation ring with field of fractions $K$ and $\gamma : y \circ j \to \Delta \circ h \circ u$. By Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-helper-diagonal} and the assumption in the lemma we find there exists a unique dotted arrow. This proves the last assumption of Lemma \ref{lemma-refined-valuative-criterion-proper} holds and the result follows. \medskip\noindent In the general case, it suffices to prove $\Delta$ is separated since then we'll be back in the previous case. In fact, we claim that the assumptions of the lemma hold for $$ \mathcal{U} \to \mathcal{X} \quad\text{and}\quad \Delta : \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X} $$ Namely, since $\Delta$ is representable by algebraic spaces, the category of dotted arrows for a diagram as in the previous paragraph is a setoid (see for example Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-cat-dotted-arrows}). The argument in the preceding paragraph shows these categories are either empty or have one isomorphism class. Thus $\Delta$ is separated.
Criteria for Representability, Theorem \ref{criteria-theorem-flat-groupoid-gives-algebraic-stack} tells us $\mathcal{X}$ is an algebraic stack. Given a morphism $f : \mathcal{X} \to Y$ we let $\phi : U \to Y$ be the composition $U \to \mathcal{X} \to Y$. Since $R = U \times_\mathcal{X} U$ (Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-cartesian}) it is immediate that $\phi$ is $R$-invariant. Conversely, if $\phi : U \to Y$ is an $R$-invariant morphism towards an algebraic space, we obtain a morphism $f : \mathcal{X} \to Y$ by Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-coequalizer}. You can also construct $f$ from $\phi$ using the explicit description of the quotient stack in Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-objects}.
It is immediate from the $1$-to-$1$ correspondence established in Lemma \ref{lemma-quotient-compare} that $f$ is a categorical moduli space if and only if $\phi$ is a categorical quotient (Quotients of Groupoids, Definition \ref{groupoids-quotients-definition-categorical}). If $Y' \to Y$ is a morphism, then $U' = Y' \times_Y U \to Y' \times_Y \mathcal{X} = \mathcal{X}'$ is a surjective, flat, locally finitely presented morphism as a base change of $U \to \mathcal{X}$ (Criteria for Representability, Lemma \ref{criteria-lemma-flat-quotient-flat-presentation}). And $R' = Y' \times_Y R$ is equal to $U' \times_{\mathcal{X}'} U'$ by transitivity of fibre products. Hence $\mathcal{X}' = [U'/R']$, see Algebraic Stacks, Remark \ref{algebraic-remark-flat-fp-presentation}. Thus the base change of our situation to $Y'$ is another situation as in the statement of the lemma. From this it immediately follows that $f$ is a uniform categorical moduli space if and only if $\phi$ is a uniform categorical quotient.
Assume $\mathcal{X}$ is well-nigh affine. Choose an affine scheme $U$ and a surjective, flat, finite, and finitely presented morphism $U \to \mathcal{X}$. Set $R = U \times_\mathcal{X} U$. Then we obtain a groupoid $(U, R, s, t, c)$ in algebraic spaces and an isomorphism $[U/R] \to \mathcal{X}$, see Algebraic Stacks, Lemma \ref{algebraic-lemma-map-space-into-stack} and Remark \ref{algebraic-remark-flat-fp-presentation}. Since $s, t : R \to U$ are  flat, finite, and finitely presented morphisms (as base changes of $U \to \mathcal{X})$ we see that $s, t$ are finite locally free (Morphisms, Lemma \ref{morphisms-lemma-finite-flat}). This implies that $R$ is affine (as finite morphisms are affine) and hence (2) holds. \medskip\noindent Suppose that we have a groupoid scheme $(U, R, s, t, c)$ with $U$ and $R$ are affine and $s, t : R \to U$ finite locally free. Set $\mathcal{X} = [U/R]$. Then $\mathcal{X}$ is an algebraic stack by Criteria for Representability, Theorem \ref{criteria-theorem-flat-groupoid-gives-algebraic-stack} (strictly speaking we don't need this here, but it can't be stressed enough that this is true). The morphism $U \to \mathcal{X}$ is surjective, flat, and locally of finite presentation by Criteria for Representability, Lemma \ref{criteria-lemma-flat-quotient-flat-presentation}. Thus we can check whether $U \to \mathcal{X}$ is finite by checking whether the projection $U \times_\mathcal{X} U \to U$ has this property, see Properties of Stacks, Lemma \ref{stacks-properties-lemma-check-property-covering}. Since $U \times_\mathcal{X} U = R$ by Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-2-cartesian} we see that this is true. Thus $\mathcal{X}$ is well-nigh affine. \medskip\noindent Proof of the final statement. We see that $\mathcal{X}$ is quasi-compact by Properties of Stacks, Lemma \ref{stacks-properties-lemma-quasi-compact-stack}. We see that $\mathcal{X} = [U/R]$ is quasi-DM and separated by Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-properties-diagonal-from-presentation}.
Part (1) follows from immediately from Limits of Spaces, Lemma \ref{spaces-limits-lemma-affine}. However, this is overkill, since (1) also follows from Lemma \ref{lemma-well-nigh-affine} combined with Groupoids, Proposition \ref{groupoids-proposition-finite-flat-equivalence}. \medskip\noindent To prove (2) we choose an affine scheme $U$ and a surjective, flat, finite, and finitely presented morphism $U \to \mathcal{X}$. Then $U' = \mathcal{X}' \times_\mathcal{X} U$ admits an affine morphism to $U$ (Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-base-change-affine}). Therefore $U'$ is an affine scheme. Of course $U' \to \mathcal{X}'$ is surjective, flat, finite, and finitely presented as a base change of $U \to \mathcal{X}$.