hcju/stacksqa huggingface dataset:
Let $T = \overline{\{x\}} \subset |\mathcal{X}|$ be the closure of $x$. By Properties of Stacks, Lemma \ref{stacks-properties-lemma-reduced-closed-substack} there exists a reduced closed substack $\mathcal{X}' \subset \mathcal{X}$ such that $T = |\mathcal{X}'|$. Note that $\mathcal{I}_{\mathcal{X}'} = \mathcal{I}_\mathcal{X} \times_\mathcal{X} \mathcal{X}'$ by Lemma \ref{lemma-monomorphism-cartesian-square-inertia}. Hence $\mathcal{I}_{\mathcal{X}'} \to \mathcal{X}'$ is quasi-compact as a base change, see Lemma \ref{lemma-base-change-quasi-compact}. Therefore Proposition \ref{proposition-open-stratum} implies there exists a dense open substack $\mathcal{U} \subset \mathcal{X}'$ which is a gerbe. Note that $x \in |\mathcal{U}|$ because $\{x\} \subset T$ is a dense subset too. Hence a residual gerbe $\mathcal{Z}_x \subset \mathcal{U}$ of $\mathcal{U}$ at $x$ exists by Lemma \ref{lemma-gerbe-residual-gerbe-exists}. It is immediate from the definitions that $\mathcal{Z}_x \to \mathcal{X}$ is a residual gerbe of $\mathcal{X}$ at $x$.
The quotient stack $[U/R]$ is an algebraic stacks by Criteria for Representability, Theorem \ref{criteria-theorem-flat-groupoid-gives-algebraic-stack}. On the other hand, since $R \to U \times U$ is a monomorphism, it is an algebraic space (by our abuse of language and Algebraic Stacks, Proposition \ref{algebraic-proposition-algebraic-stack-no-automorphisms}) and of course it is equal to the algebraic space $U/R$ (of Bootstrap, Theorem \ref{bootstrap-theorem-final-bootstrap}). Since $U \to X$ is surjective, flat, and locally of finite presenation (Bootstrap, Lemma \ref{bootstrap-lemma-covering-quotient}) we conclude that $X \to Y$ is flat and locally of finite presentation by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-flat-permanence} and Descent on Spaces, Lemma \ref{spaces-descent-lemma-flat-finitely-presented-permanence}. Finally, consider the cartesian diagram $$ \xymatrix{ R \ar[d] \ar[r] & U \times_Y U \ar[d] \\ X \ar[r] & X \times_Y X } $$ Since the right vertical arrow is surjective, flat, and locally of finite presentation (small detail omitted), we find that $X \to X \times_Y X$ is an open immersion as the top horizonal arrow has this property by assumption (use Properties of Stacks, Lemma \ref{stacks-properties-lemma-check-property-covering}). Thus $X \to Y$ is unramified by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-diagonal-unramified-morphism}. We conclude by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-unramified-flat-lfp-etale}.
Since $P \subset R$ is open, we see that $s|_P$ and $t|_P$ are flat and locally of finite presentation. Thus $[U/R]$ and $[U/P]$ are algebraic stacks by Criteria for Representability, Theorem \ref{criteria-theorem-flat-groupoid-gives-algebraic-stack}. To see that the morphism is representable by algebraic spaces, it suffices to show that $[U/P] \to [U/R]$ is faithful on fibre categories, see Algebraic Stacks, Lemma \ref{algebraic-lemma-characterize-representable-by-algebraic-spaces}. This follows immediately from the fact that $P \to R$ is a monomorphism and the explicit description of quotient stacks given in Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-quotient-stack-objects}. Having said this, we know what it means for $[U/P] \to [U/R]$ to be surjective and \'etale by Algebraic Stacks, Definition \ref{algebraic-definition-relative-representable-property}. Surjectivity follows for example from Criteria for Representability, Lemma \ref{criteria-lemma-representable-by-spaces-surjective} and the description of objects of quotient stacks (see lemma cited above) over spectra of fields. It remains to prove that our morphism is \'etale. \medskip\noindent To do this it suffices to show that $U \times_{[U/R]} [U/P] \to U$ is \'etale, see Properties of Stacks, Lemma \ref{stacks-properties-lemma-check-property-covering}. By Groupoids in Spaces, Lemma \ref{spaces-groupoids-lemma-cartesian-square-of-morphism} the fibre product is equal to $[R/P \times_{s, U, t} R]$ with morphism to $U$ induced by $s : R \to U$. The maps $s', t' : P \times_{s, U, t} R \to R$ are given by $s' : (p, r) \mapsto r$ and $t' : (p, r) \mapsto c(p, r)$. Since $P \subset R$ is open we conclude that $(t', s') : P \times_{s, U, t} R \to R \times_{s, U, s} R$ is an open immersion. Thus we may apply Lemma \ref{lemma-quotient-etale} to conclude.
(The parenthetical statement follows from the equivalences in Lemma \ref{lemma-diagonal-diagonal}). Choose an affine scheme $U$ and a flat, locally finitely presented, locally quasi-finite morphism $U \to \mathcal{X}$ such that $x$ is the image of some point $u \in U$. This is possible by Theorem \ref{theorem-quasi-DM} and the assumption that $\mathcal{X}$ is quasi-DM. Let $(U, R, s, t, c)$ be the groupoid in algebraic spaces we obtain by setting $R = U \times_\mathcal{X} U$, see Algebraic Stacks, Lemma \ref{algebraic-lemma-map-space-into-stack}. Let $\mathcal{X}' \subset \mathcal{X}$ be the open substack corresponding to the open image of $|U| \to |\mathcal{X}|$ (Properties of Stacks, Lemmas \ref{stacks-properties-lemma-topology-points} and \ref{stacks-properties-lemma-open-substacks}). Clearly, we may replace $\mathcal{X}$ by the open substack $\mathcal{X}'$. Thus we may assume $U \to \mathcal{X}$ is surjective and then Algebraic Stacks, Remark \ref{algebraic-remark-flat-fp-presentation} gives $\mathcal{X} = [U/R]$. Observe that $s, t : R \to U$ are flat, locally of finite presentation, and locally quasi-finite. Since $R = U \times U \times_{(\mathcal{X} \times \mathcal{X})} \mathcal{X}$ and since the diagonal of $\mathcal{X}$ is separated, we find that $R$ is separated. Hence $s, t : R \to U$ are separated. It follows that $R$ is a scheme by Morphisms of Spaces, Proposition \ref{spaces-morphisms-proposition-locally-quasi-finite-separated-over-scheme} applied to $s : R \to U$. \medskip\noindent Above we have verified all the assumptions of More on Groupoids in Spaces, Lemma \ref{spaces-more-groupoids-lemma-quasi-splitting-affine-scheme} are satisfied for $(U, R, s, t, c)$ and $u$. Hence we can find an elementary \'etale neighbourhood $(U', u') \to (U, u)$ such that the restriction $R'$ of $R$ to $U'$ is quasi-split over $u$. Note that $R' = U' \times_\mathcal{X} U'$ (small detail omitted; hint: transitivity of fibre products). Replacing $(U, R, s, t, c)$ by $(U', R', s', t', c')$ and shrinking $\mathcal{X}$ as above, we may assume that $(U, R, s, t, c)$ has a quasi-splitting over $u$ (the point $u$ is irrelevant from now on as can be seen from the footnote in More on Groupoids in Spaces, Definition \ref{spaces-more-groupoids-definition-split-at-point}). Let $P \subset R$ be a quasi-splitting of $R$ over $u$. Apply Lemma \ref{lemma-quasi-splitting-etale} to see that $$ \mathcal{U} = [U/P] \longrightarrow [U/R] = \mathcal{X} $$ has all the desired properties.
Observe that $G_x$ is a group scheme by Lemma \ref{lemma-automorphism-group-scheme}. The first part of the proof is {\bf exactly} the same as the first part of the proof of Lemma \ref{lemma-etale-local-quasi-DM}. Thus we may assume $\mathcal{X} = [U/R]$ where $(U, R, s, t, c)$ and $u \in U$ mapping to $x$ satisfy all the assumptions of More on Groupoids in Spaces, Lemma \ref{spaces-more-groupoids-lemma-quasi-splitting-affine-scheme}. Our assumption on $G_x$ implies that $G_u$ is finite over $u$. Hence all the assumptions of More on Groupoids in Spaces, Lemma \ref{spaces-more-groupoids-lemma-splitting-affine-scheme} are satisfied. Hence we can find an elementary \'etale neighbourhood $(U', u') \to (U, u)$ such that the restriction $R'$ of $R$ to $U'$ is split over $u$. Note that $R' = U' \times_\mathcal{X} U'$ (small detail omitted; hint: transitivity of fibre products). Replacing $(U, R, s, t, c)$ by $(U', R', s', t', c')$ and shrinking $\mathcal{X}$ as above, we may assume that $(U, R, s, t, c)$ has a splitting over $u$. Let $P \subset R$ be a splitting of $R$ over $u$. Apply Lemma \ref{lemma-quasi-splitting-etale} to see that $$ \mathcal{U} = [U/P] \longrightarrow [U/R] = \mathcal{X} $$ is representable by algebraic spaces and \'etale. By construction $G_u$ is contained in $P$, hence this morphism defines an isomorphism on automorphism groups at $u$ as desired.
The first part of the proof is {\bf exactly} the same as the first part of the proof of Lemma \ref{lemma-etale-local-quasi-DM}. Thus we may assume $\mathcal{X} = [U/R]$ where $(U, R, s, t, c)$ and $u \in U$ mapping to $x$ satisfy all the assumptions of More on Groupoids in Spaces, Lemma \ref{spaces-more-groupoids-lemma-quasi-splitting-affine-scheme}. Observe that $u = \Spec(\kappa(u)) \to \mathcal{X}$ is quasi-compact, see Properties of Stacks, Lemma \ref{stacks-properties-lemma-UR-quasi-compact-above-x}. Consider the cartesian diagram $$ \xymatrix{ F \ar[d] \ar[r] & U \ar[d] \\ u \ar[r]^u & \mathcal{X} } $$ Since $U$ is an affine scheme and $F \to U$ is quasi-compact, we see that $F$ is quasi-compact. Since $U \to \mathcal{X}$ is locally quasi-finite, we see that $F \to u$ is locally quasi-finite. Hence $F \to u$ is quasi-finite and $F$ is an affine scheme whose underlying topological space is finite discrete (Spaces over Fields, Lemma \ref{spaces-over-fields-lemma-locally-quasi-finite-over-field}). Observe that we have a monomorphism $u \times_\mathcal{X} u \to F$. In particular the set $\{r \in R : s(r) = u, t(r) = u\}$ which is the image of $|u \times_\mathcal{X} u| \to |R|$ is finite. we conclude that all the assumptions of More on Groupoids in Spaces, Lemma \ref{spaces-more-groupoids-lemma-strong-splitting-affine-scheme} hold. \medskip\noindent Thus we can find an elementary \'etale neighbourhood $(U', u') \to (U, u)$ such that the restriction $R'$ of $R$ to $U'$ is strongly split over $u'$. Note that $R' = U' \times_\mathcal{X} U'$ (small detail omitted; hint: transitivity of fibre products). Replacing $(U, R, s, t, c)$ by $(U', R', s', t', c')$ and shrinking $\mathcal{X}$ as above, we may assume that $(U, R, s, t, c)$ has a strong splitting over $u$. Let $P \subset R$ be a strong splitting of $R$ over $u$. Apply Lemma \ref{lemma-quasi-splitting-etale} to see that $$ \mathcal{U} = [U/P] \longrightarrow [U/R] = \mathcal{X} $$ is representable by algebraic spaces and \'etale. Since $P \subset R$ is open and contains $\{r \in R : s(r) = u, t(r) = u\}$ by construction we see that $u \times_\mathcal{U} u \to u \times_\mathcal{X} u$ is an isomorphism. The statement on residual gerbes then follows from Properties of Stacks, Lemma \ref{stacks-properties-lemma-residual-gerbe-isomorphic} (we observe that the residual gerbes in question exist by Lemma \ref{lemma-every-point-residual-gerbe-quasi-DM}).
Choose a commutative diagram $$ \xymatrix{ U \ar[d]_a \ar[r]_h & V \ar[d]^b \\ \mathcal{X} \ar[r]^f & \mathcal{Y} } $$ where $U$ and $V$ are algebraic spaces, the vertical arrows are smooth, and $a : U \to \mathcal{X}$ surjective. There is a maximal open subspace $U' \subset U$ such that $h_{U'} : U' \to V$ is smooth, see Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-where-smooth}. Let $\mathcal{U} \subset \mathcal{X}$ be the open substack corresponding to the image of $|U'| \to |\mathcal{X}|$ (Properties of Stacks, Lemmas \ref{stacks-properties-lemma-topology-points} and \ref{stacks-properties-lemma-open-substacks}). By the equivalence in Lemma \ref{lemma-local-source-target} we find that $f|_\mathcal{U} : \mathcal{U} \to \mathcal{Y}$ is smooth and that $\mathcal{U}$ is the largest open substack with this property. \medskip\noindent Assertion (1) follows from the fact that being smooth is smooth local on the source (this property was used to even define smooth morphisms of algebraic stacks). Assertions (2) and (3) follow from the case of algebraic spaces, see Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-where-smooth}.
The quotient $[X/G]$ is an algebraic stack by Criteria for Representability, Theorem \ref{criteria-theorem-flat-groupoid-gives-algebraic-stack}. The smoothness of $[X/G]$ over $Y$ follows from the fact that smoothness descends under fppf coverings: Choose a surjective smooth morphism $U \to [X/G]$ where $U$ is a scheme. Smoothness of $[X/G]$ over $Y$ is equivalent to smoothness of $U$ over $Y$. Observe that $U \times_{[X/G]} X$ is smooth over $X$ and hence smooth over $Y$ (because compositions of smooth morphisms are smooth). On the other hand, $U \times_{[X/G]} X \to U$ is locally of finite presentation, flat, and surjective (because it is the base change of $X \to [X/G]$ which has those properties for example by Criteria for Representability, Lemma \ref{criteria-lemma-flat-quotient-flat-presentation}). Therefore we may apply Descent on Spaces, Lemma \ref{spaces-descent-lemma-smooth-permanence}.
We have seen surjectivity in Lemma \ref{lemma-gerbe-fppf}. By Lemma \ref{lemma-descent-smooth} it suffices to prove to the lemma after replacing $\pi$ by a base change with a surjective, flat, locally finitely presented morphism $\mathcal{Y}' \to \mathcal{Y}$. By Lemma \ref{lemma-local-structure-gerbe} we may assume $\mathcal{Y} = U$ is an algebraic space and $\mathcal{X} = [U/G]$ over $U$ with $G \to U$ flat and locally of finite presentation. Then we win by Lemma \ref{lemma-smooth-quotient-stack}.
Let $j : \mathcal{U} \to \mathcal{X}$ be an open immersion of algebraic stacks. Since $j$ is representable, it is DM by Lemma \ref{lemma-trivial-implications}. On the other hand, if $X \to \mathcal{X}$ is a smooth and surjective morphism where $X$ is a scheme, then $U = \mathcal{U} \times_\mathcal{X} X$ is an open subscheme of $X$. Hence $U \to X$ is \'etale (Morphisms, Lemma \ref{morphisms-lemma-open-immersion-etale}) and we conclude that $j$ is \'etale from the definition.
Assume (1). Then $f$ is DM and since being \'etale is preserved by base change, we see that (2) holds. \medskip\noindent Assume (2). Choose a scheme $V$ and a surjective \'etale morphism $V \to \mathcal{Y}$. Choose a scheme $U$ and a surjective \'etale morphism $U \to V \times_\mathcal{Y} \mathcal{X}$ (Lemma \ref{lemma-DM}). Thus we see that (3) holds. \medskip\noindent Assume $W \to \mathcal{Y}$ and $T \to W \times_\mathcal{Y} \mathcal{X}$ are as in (3). We first check $f$ is DM. Namely, it suffices to check $W \times_\mathcal{Y} \mathcal{X} \to W$ is DM, see Lemma \ref{lemma-check-separated-covering}. By Lemma \ref{lemma-compose-after-separated} it suffices to check $W \times_\mathcal{Y} \mathcal{X}$ is DM. This follows from the existence of $T \to W \times_\mathcal{Y} \mathcal{X}$ by (the easy direction of) Theorem \ref{theorem-DM}. \medskip\noindent Assume $f$ is DM and $W \to \mathcal{Y}$ and $T \to W \times_\mathcal{Y} \mathcal{X}$ are as in (3). Let $V$ be an algebraic space, let $V \to \mathcal{Y}$ be surjective smooth, let $U$ be an algebraic space, and let $U \to V \times_\mathcal{Y} \mathcal{X}$ is surjective and \'etale (Lemma \ref{lemma-DM}). We have to check that $U \to V$ is \'etale. It suffices to prove $U \times_\mathcal{Y} W \to V \times_\mathcal{Y} W$ is \'etale by Descent on Spaces, Lemma \ref{spaces-descent-lemma-descending-property-etale}. We may replace $\mathcal{X}, \mathcal{Y}, W, T, U, V$ by $\mathcal{X} \times_\mathcal{Y} W, W, W, T, U \times_\mathcal{Y} W, V \times_\mathcal{Y} W$ (small detail omitted). Thus we may assume that $Y = \mathcal{Y}$ is an algebraic space, there exists an algebraic space $T$ and a surjective \'etale morphism $T \to \mathcal{X}$ such that $T \to Y$ is \'etale, and $U$ and $V$ are as before. In this case we know that $$ U \to V\text{ is \'etale} \Leftrightarrow \mathcal{X} \to Y\text{ is \'etale} \Leftrightarrow T \to Y\text{ is \'etale} $$ by the equivalence of properties (1) and (2) of Lemma \ref{lemma-etale-smooth-local-source-target} and Definition \ref{definition-etale}. This finishes the proof.
The morphism $\mathcal{X} \to \mathcal{Y}$ is DM by Lemma \ref{lemma-compose-after-separated}. Let $W \to \mathcal{Z}$ be a surjective smooth morphism whose source is an algebraic space. Let $V \to \mathcal{Y} \times_\mathcal{Z} W$ be a surjective \'etale morphism whose source is an algebraic space (Lemma \ref{lemma-DM}). Let $U \to \mathcal{X} \times_\mathcal{Y} V$ be a surjective \'etale morphism whose source is an algebraic space (Lemma \ref{lemma-DM}). Then $$ U \longrightarrow \mathcal{X} \times_\mathcal{Z} W $$ is surjective \'etale as the composition of $U \to \mathcal{X} \times_\mathcal{Y} V$ and the base change of $V \to \mathcal{Y} \times_\mathcal{Z} W$ by $\mathcal{X} \times_\mathcal{Z} W \to \mathcal{Y} \times_\mathcal{Z} W$. Hence it suffices to show that $U \to W$ is \'etale. Since $U \to W$ and $V \to W$ are \'etale because $\mathcal{X} \to \mathcal{Z}$ and $\mathcal{Y} \to \mathcal{Z}$ are \'etale, this follows from the version of the lemma for algebraic spaces, namely Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-etale-permanence}.
Let $j : \mathcal{Z} \to \mathcal{X}$ be an immersion of algebraic stacks. Since $j$ is representable, it is DM by Lemma \ref{lemma-trivial-implications}. On the other hand, if $X \to \mathcal{X}$ is a smooth and surjective morphism where $X$ is a scheme, then $Z = \mathcal{Z} \times_\mathcal{X} X$ is a locally closed subscheme of $X$. Hence $Z \to X$ is unramified (Morphisms, Lemmas \ref{morphisms-lemma-open-immersion-unramified} and \ref{morphisms-lemma-closed-immersion-unramified}) and we conclude that $j$ is unramified from the definition.
Assume (1). Then $f$ is DM and since being unramified is preserved by base change, we see that (2) holds. \medskip\noindent Assume (2). Choose a scheme $V$ and a surjective \'etale morphism $V \to \mathcal{Y}$. Choose a scheme $U$ and a surjective \'etale morphism $U \to V \times_\mathcal{Y} \mathcal{X}$ (Lemma \ref{lemma-DM}). Thus we see that (3) holds. \medskip\noindent Assume $W \to \mathcal{Y}$ and $T \to W \times_\mathcal{Y} \mathcal{X}$ are as in (3). We first check $f$ is DM. Namely, it suffices to check $W \times_\mathcal{Y} \mathcal{X} \to W$ is DM, see Lemma \ref{lemma-check-separated-covering}. By Lemma \ref{lemma-compose-after-separated} it suffices to check $W \times_\mathcal{Y} \mathcal{X}$ is DM. This follows from the existence of $T \to W \times_\mathcal{Y} \mathcal{X}$ by (the easy direction of) Theorem \ref{theorem-DM}. \medskip\noindent Assume $f$ is DM and $W \to \mathcal{Y}$ and $T \to W \times_\mathcal{Y} \mathcal{X}$ are as in (3). Let $V$ be an algebraic space, let $V \to \mathcal{Y}$ be surjective smooth, let $U$ be an algebraic space, and let $U \to V \times_\mathcal{Y} \mathcal{X}$ is surjective and \'etale (Lemma \ref{lemma-DM}). We have to check that $U \to V$ is unramified. It suffices to prove $U \times_\mathcal{Y} W \to V \times_\mathcal{Y} W$ is unramified by Descent on Spaces, Lemma \ref{spaces-descent-lemma-descending-property-unramified}. We may replace $\mathcal{X}, \mathcal{Y}, W, T, U, V$ by $\mathcal{X} \times_\mathcal{Y} W, W, W, T, U \times_\mathcal{Y} W, V \times_\mathcal{Y} W$ (small detail omitted). Thus we may assume that $Y = \mathcal{Y}$ is an algebraic space, there exists an algebraic space $T$ and a surjective \'etale morphism $T \to \mathcal{X}$ such that $T \to Y$ is unramified, and $U$ and $V$ are as before. In this case we know that $$ U \to V\text{ is unramified} \Leftrightarrow \mathcal{X} \to Y\text{ is unramified} \Leftrightarrow T \to Y\text{ is unramified} $$ by the equivalence of properties (1) and (2) of Lemma \ref{lemma-etale-smooth-local-source-target} and Definition \ref{definition-unramified}. This finishes the proof.
Assume $\mathcal{X} \to \mathcal{Z}$ is unramified. By Lemma \ref{lemma-compose-after-separated} the morphism $\mathcal{X} \to \mathcal{Y}$ is DM. Choose a commutative diagram $$ \xymatrix{ U \ar[d] \ar[r] & V \ar[d] \ar[r] & W \ar[d] \\ \mathcal{X} \ar[r] & \mathcal{Y} \ar[r] & \mathcal{Z} } $$ with $U, V, W$ algebraic spaces, with $W \to \mathcal{Z}$ surjective smooth, $V \to \mathcal{Y} \times_\mathcal{Z} W$ surjective \'etale, and $U \to \mathcal{X} \times_\mathcal{Y} V$ surjective \'etale (see Lemma \ref{lemma-DM}). Then also $U \to \mathcal{X} \times_\mathcal{Z} W$ is surjective and \'etale. Hence we know that $U \to W$ is unramified and we have to show that $U \to V$ is unramified. This follows from Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-permanence-unramified}.
The equivalence of (2) and (3) follows immediately from Lemma \ref{lemma-characterize-unramified}. Thus in each case the morphism $f$ is DM. Then we can choose Then we can choose algebraic spaces $U$, $V$, a smooth surjective morphism $V \to \mathcal{Y}$ and a surjective \'etale morphism $U \to \mathcal{X} \times_\mathcal{Y} V$ (Lemma \ref{lemma-DM}). To finish the proof we have to show that $U \to V$ is \'etale if and only if it is locally of finite presentation, flat, and unramified. This follows from Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-unramified-flat-lfp-etale} (and the more trivial Morphisms of Spaces, Lemmas \ref{spaces-morphisms-lemma-etale-unramified}, \ref{spaces-morphisms-lemma-etale-locally-finite-presentation}, and \ref{spaces-morphisms-lemma-etale-flat}).
A closed immersion is by definition representable (Properties of Stacks, Definition \ref{stacks-properties-definition-immersion}). Hence this follows from the discussion in Properties of Stacks, Section \ref{stacks-properties-section-properties-morphisms} and the corresponding result for morphisms of algebraic spaces, see Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-closed-immersion-proper}.
Assume $\mathcal{X} \to \mathcal{Z}$ is universally closed and $\mathcal{Y} \to \mathcal{Z}$ is separated. We factor the morphism as $\mathcal{X} \to \mathcal{X} \times_\mathcal{Z} \mathcal{Y} \to \mathcal{Y}$. The first morphism is proper (Lemma \ref{lemma-semi-diagonal}) hence universally closed. The projection $\mathcal{X} \times_\mathcal{Z} \mathcal{Y} \to \mathcal{Y}$ is the base change of a universally closed morphism and hence universally closed, see Lemma \ref{lemma-base-change-universally-closed}. Thus $\mathcal{X} \to \mathcal{Y}$ is universally closed as the composition of universally closed morphisms, see Lemma \ref{lemma-composition-universally-closed}. This proves (1). To deduce (2) combine (1) with Lemmas \ref{lemma-compose-after-separated}, \ref{lemma-quasi-compact-permanence}, and \ref{lemma-finite-type-permanence}.
Assume $\mathcal{X}$ is universally closed and $f$ surjective. Denote $p : \mathcal{X} \to \mathcal{Z}$, $q : \mathcal{Y} \to \mathcal{Z}$ the structure morphisms. Let $\mathcal{Z}' \to \mathcal{Z}$ be a morphism of algebraic stacks. The base change $f' : \mathcal{X}' \to \mathcal{Y}'$ of $f$ by $\mathcal{Z}' \to \mathcal{Z}$ is surjective (Properties of Stacks, Lemma \ref{stacks-properties-lemma-base-change-surjective}) and the base change $p' : \mathcal{X}' \to \mathcal{Z}'$ of $p$ is closed. If $T \subset |\mathcal{Y}'|$ is closed, then $(f')^{-1}(T) \subset |\mathcal{X}'|$ is closed, hence $p'((f')^{-1}(T)) = q'(T)$ is closed. So $q'$ is closed.