hcju/stacksqa huggingface dataset:
Let $s \in S$ be the image of $x_0$. If $\mathcal{O}_{S, s}$ is a G-ring (a condition that is almost always satisfied in practice), then we can prove the lemma as follows. By Lemma \ref{lemma-Artin-approximation-by-smooth-morphism}, we may find a smooth morphism $U \to \mathcal{X}$, whose source is a scheme, containing a point $u_0 \in U$ of residue field $k$, such that induced morphism $\Spec(k) \to U \to \mathcal{X}$ coincides with $x_0$ and such that $A = \mathcal{O}_{U, u_0}^\wedge$. Write $R = U \times_\mathcal{X} U$. Then we may identify $\mathcal{O}_{R, e(u_0)}^\wedge$ with $B$. Hence the equality follows from the definitions. \medskip\noindent In the rest of this proof we explain how to prove the lemma in general, but we urge the reader to skip this. \medskip\noindent First let us show that the right hand side is independent of the choice of $(A, B, s, t, c)$. Namely, suppose that $(A', B', s', t', c')$ is a second choice. Since $A$ and $A'$ are versal rings to $\mathcal{X}$ at $x_0$, we can choose, after possibly switching $A$ and $A'$, a formally smooth map $A \to A'$ compatible with the given versal formal objects $\xi$ and $\xi'$ over $A$ and $A'$. Recall that $\widehat{\mathcal{C}}_\Lambda$ has coproducts and that these are given by completed tensor product over $\Lambda$, see Formal Deformation Theory, Lemma \ref{formal-defos-lemma-CLambdahat-coproducts}. Then $B$ prorepresents the functor of isomorphisms between the two pushforwards of $\xi$ to $A \widehat{\otimes}_\Lambda A$. Similarly for $B'$. We conclude that $$ B' = B \otimes_{(A \widehat{\otimes}_\Lambda A)} (A' \widehat{\otimes}_\Lambda A') $$ It is straightforward to see that $$ A \widehat{\otimes}_\Lambda A \longrightarrow A \widehat{\otimes}_\Lambda A' \longrightarrow A' \widehat{\otimes}_\Lambda A' $$ is formally smooth of relative dimension equal to $2$ times the relative dimension of the formally smooth map $A \to A'$. (This follows from general principles, but also because in this particular case $A'$ is a power series ring over $A$ in $r$ variables.) Hence $B \to B'$ is formally smooth of relative dimension $2(\dim(A') - \dim(A))$ as desired. \medskip\noindent Next, let $l/k$ be a finite extension. let $x_{l, 0} : \Spec(l) \to \mathcal{X}$ be the induced point. We claim that the right hand side of the formula is the same for $x_0$ as it is for $x_{l, 0}$. This can be shown by choosing $A \to A'$ as in Lemma \ref{lemma-versal-ring-field-extension} and arguing exactly as in the preceding paragraph. We omit the details. \medskip\noindent Finally, arguing as in the proof of Lemma \ref{lemma-versal-ring-flat} we can use the compatibilities in the previous two paragraphs to reduce to the case (discussed in the first paragraph) where $A$ is the complete local ring of $U$ at $u_0$ for some scheme smooth over $\mathcal{X}$ and finite type point $u_0$. Details omitted.
Let $E \subset |X|$ be \'etale locally constructible. Let $V \to Y$ be an \'etale morphism with $V$ affine. It suffices to show that the inverse image of $f(E)$ in $V$ is constructible, see Properties of Spaces, Definition \ref{spaces-properties-definition-locally-constructible}. Since $f$ is quasi-compact $V \times_Y X$ is a quasi-compact algebraic space. Choose an affine scheme $U$ and a surjective \'etale morphism $U \to V \times_Y X$ (Properties of Spaces, Lemma \ref{spaces-properties-lemma-quasi-compact-affine-cover}). By Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian} the inverse image of $f(E)$ in $V$ is the image under $U \to V$ of the inverse image of $E$ in $U$. Thus the result follows from the case of schemes, see Morphisms, Lemma \ref{morphisms-lemma-chevalley}.
We are going to use the fact that $\Delta_{X/S}$ is representable (by definition of an algebraic space) and that it satisfies properties (2) -- (5), see Spaces, Lemma \ref{spaces-lemma-properties-diagonal}. Note that we have a factorization $$ X \longrightarrow X \times_Y X \longrightarrow X \times_S X $$ of the diagonal $\Delta_{X/S} : X \to X \times_S X$. Since $X \times_Y X \to X \times_S X$ is a monomorphism, and since $\Delta_{X/S}$ is representable, it follows formally that $\Delta_{X/Y}$ is representable. In particular, the rest of the statements now make sense, see Section \ref{section-representable}. \medskip\noindent Choose a surjective \'etale morphism $U \to X$, with $U$ a scheme. Consider the diagram $$ \xymatrix{ R = U \times_X U \ar[r] \ar[d] & U \times_Y U \ar[d] \ar[r] & U \times_S U \ar[d] \\ X \ar[r] & X \times_Y X \ar[r] & X \times_S X } $$ Both squares are cartesian, hence so is the outer rectangle. The top row consists of schemes, and the vertical arrows are surjective \'etale morphisms. By Spaces, Lemma \ref{spaces-lemma-representable-morphisms-spaces-property} the properties (2) -- (5) for $\Delta_{X/Y}$ are equivalent to those of $R \to U \times_Y U$. In the proof of Spaces, Lemma \ref{spaces-lemma-properties-diagonal} we have seen that $R \to U \times_S U$ has properties (2) -- (5). The morphism $U \times_Y U \to U \times_S U$ is a monomorphism of schemes. These facts imply that $R \to U \times_Y U$ have properties (2) -- (5). \medskip\noindent Namely: For (3), note that $R \to U \times_Y U$ is a monomorphism as the composition $R \to U \times_S U$ is a monomorphism. For (2), note that $R \to U \times_Y U$ is locally of finite type, as the composition $R \to U \times_S U$ is locally of finite type (Morphisms, Lemma \ref{morphisms-lemma-permanence-finite-type}). A monomorphism which is locally of finite type is locally quasi-finite because it has finite fibres (Morphisms, Lemma \ref{morphisms-lemma-finite-fibre}), hence (5). A monomorphism is separated (Schemes, Lemma \ref{schemes-lemma-monomorphism-separated}), hence (4).
Let $f : X \to Y$ and $Y' \to Y$ be morphisms of algebraic spaces. Let $f' : X' \to Y'$ be the base change of $f$ by $Y' \to Y$. Then $\Delta_{X'/Y'}$ is the base change of $\Delta_{X/Y}$ by the morphism $X' \times_{Y'} X' \to X \times_Y X$. By the results of Section \ref{section-representable} each of the properties of the diagonal used in Definition \ref{definition-separated} is stable under base change. Hence the lemma is true.
By general category theory the following diagram $$ \xymatrix{ X \times_Z Y \ar[r]_i \ar[d] & X \times_T Y \ar[d] \\ Z \ar[r]^-{\Delta_{Z/T}} \ar[r] & Z \times_T Z } $$ is a fibre product diagram. Hence $i$ is the base change of the diagonal morphism $\Delta_{Z/T}$. Thus the lemma follows from Lemma \ref{lemma-properties-diagonal}, and the material in Section \ref{section-representable}.
Let $f : X \to Y$ and $g : Y \to Z$ be morphisms of algebraic spaces to which the axiom in question applies. The diagonal $\Delta_{X/Z}$ is the composition $$ X \longrightarrow X \times_Y X \longrightarrow X \times_Z X. $$ Our separation axiom is defined by requiring the diagonal to have some property $\mathcal{P}$. By Lemma \ref{lemma-fibre-product-after-map} above we see that the second arrow also has this property. Hence the lemma follows since the composition of (representable) morphisms with property $\mathcal{P}$ also is a morphism with property $\mathcal{P}$, see Section \ref{section-representable}.
Parts (4), (5), and (6) follow immediately from Lemma \ref{lemma-composition-separated} and Spaces, Definition \ref{spaces-definition-separated}. Parts (1), (2), and (3) reduce to parts (4), (5), and (6) by thinking of $X$ and $Y$ as algebraic spaces over $\Spec(\mathbf{Z})$, see Properties of Spaces, Definition \ref{spaces-properties-definition-separated}.
Parts (4), (5), and (6) follow immediately from Lemma \ref{lemma-compose-after-separated} and Spaces, Definition \ref{spaces-definition-separated}. Parts (1), (2), and (3) follow from parts (4), (5), and (6) by thinking of $X$ and $Y$ as algebraic spaces over $\Spec(\mathbf{Z})$, see Properties of Spaces, Definition \ref{spaces-properties-definition-separated}.
We will repeatedly use Lemma \ref{lemma-base-change-separated} without further mention. In particular, it is clear that (1) implies (2) and (2) implies (3). \medskip\noindent Let us prove that (3) and (4) are equivalent. Note that if $Z$ is an affine scheme, then the morphism $Z \to \Spec(\mathbf{Z})$ is a separated morphism as a morphism of algebraic spaces over $\Spec(\mathbf{Z})$. If $Z \times_Y X \to Z$ is $\mathcal{P}$, then $Z \times_Y X \to \Spec(\mathbf{Z})$ is $\mathcal{P}$ as a composition (see Lemma \ref{lemma-composition-separated}). Hence the algebraic space $Z \times_Y X$ is $\mathcal{P}$. Conversely, if the algebraic space $Z \times_Y X$ is $\mathcal{P}$, then $Z \times_Y X \to \Spec(\mathbf{Z})$ is $\mathcal{P}$, and hence by Lemma \ref{lemma-compose-after-separated} we see that $Z \times_Y X \to Z$ is $\mathcal{P}$. \medskip\noindent Let us prove that (3) implies (5). Assume (3). Let $V$ be a scheme and let $V \to Y$ be \'etale surjective. We have to show that $V \times_Y X \to V$ has property $\mathcal{P}$. In other words, we have to show that the morphism $$ V \times_Y X \longrightarrow (V \times_Y X) \times_V (V \times_Y X) = V \times_Y X \times_Y X $$ has the corresponding property (i.e., is a closed immersion, immersion, or quasi-compact). Let $V = \bigcup V_j$ be an affine open covering of $V$. By assumption we know that each of the morphisms $$ V_j \times_Y X \longrightarrow V_j \times_Y X \times_Y X $$ does have the corresponding property. Since being a closed immersion, immersion, quasi-compact immersion, or quasi-compact is Zariski local on the target, and since the $V_j$ cover $V$ we get the desired conclusion. \medskip\noindent Let us prove that (5) implies (1). Let $V \to Y$ be as in (5). Then we have the fibre product diagram $$ \xymatrix{ V \times_Y X \ar[r] \ar[d] & X \ar[d] \\ V \times_Y X \times_Y X \ar[r] & X \times_Y X } $$ By assumption the left vertical arrow is a closed immersion, immersion, quasi-compact immersion, or quasi-compact. It follows from Spaces, Lemma \ref{spaces-lemma-descent-representable-transformations-property} that also the right vertical arrow is a closed immersion, immersion, quasi-compact immersion, or quasi-compact. \medskip\noindent It is clear that (1) implies (6) by taking the covering $Y = Y$. Assume $Y = \bigcup Y_i$ is as in (6). Choose schemes $V_i$ and surjective \'etale morphisms $V_i \to Y_i$. Note that the morphisms $V_i \times_Y X \to V_i$ have $\mathcal{P}$ as they are base changes of the morphisms $f^{-1}(Y_i) \to Y_i$. Set $V = \coprod V_i$. Then $V \to Y$ is a morphism as in (5) (details omitted). Hence (6) implies (5) and we are done.
Namely, if $f : X \to Y$ is representable, then it is surjective if and only if for every scheme $T$ and every morphism $T \to Y$ the base change $f_T : T \times_Y X \to T$ of $f$ is a surjective morphism of schemes, in other words, if and only if $|f_T|$ is surjective. By Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian} the map $|T \times_Y X| \to |T| \times_{|Y|} |X|$ is always surjective. Hence $|f_T| : |T \times_Y X| \to |T|$ is surjective if $|f| : |X| \to |Y|$ is surjective. Conversely, if $|f_T|$ is surjective for every $T \to Y$ as above, then by taking $T$ to be the spectrum of a field we conclude that $|X| \to |Y|$ is surjective.
We omit the proof that (1) implies (2), and that (2) implies (3). \medskip\noindent Assume (3). Choose a surjective \'etale morphism $V \to Y$. We are going to show that $V \times_Y X \to V$ is a universally open morphism of algebraic spaces. Let $Z \to V$ be a morphism from an algebraic space to $V$. Let $W \to Z$ be a surjective \'etale morphism where $W = \coprod W_i$ is a disjoint union of affine schemes, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-cover-by-union-affines}. Then we have the following commutative diagram $$ \xymatrix{ \coprod_i |W_i \times_Y X| \ar@{=}[r] \ar[d] & |W \times_Y X| \ar[r] \ar[d] & |Z \times_Y X| \ar[d] \ar@{=}[r] & |Z \times_V (V \times_Y X)| \ar[ld] \\ \coprod |W_i| \ar@{=}[r] & |W| \ar[r] & |Z| } $$ We have to show the south-east arrow is open. The middle horizontal arrows are surjective and open (Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-open}). By assumption (3), and the fact that $W_i$ is affine we see that the left vertical arrows are open. Hence it follows that the right vertical arrow is open. \medskip\noindent Assume $V \to Y$ is as in (4). We will show that $f$ is universally open. Let $Z \to Y$ be a morphism of algebraic spaces. Consider the diagram $$ \xymatrix{ |(V \times_Y Z) \times_V (V \times_Y X)| \ar@{=}[r] \ar[rd] & |V \times_Y X| \ar[r] \ar[d] & |Z \times_Y X| \ar[d] \\  & |V \times_Y Z| \ar[r] & |Z| } $$ The south-west arrow is open by assumption. The horizontal arrows are surjective and open because the corresponding morphisms of algebraic spaces are \'etale (see Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-open}). It follows that the right vertical arrow is open. \medskip\noindent Of course (1) implies (5) by taking the covering $Y = Y$. Assume $Y = \bigcup Y_i$ is as in (5). Then for any $Z \to Y$ we get a corresponding Zariski covering $Z = \bigcup Z_i$ such that the base change of $f$ to $Z_i$ is open. By a simple topological argument this implies that $Z \times_Y X \to Z$ is open. Hence (1) holds.
Choose a scheme $U$ and a surjective \'etale morphism $U \to X$. The composition $U \to \Spec(k)$ is universally open (as a morphism of schemes) by Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open}. Let $Z \to \Spec(k)$ be a morphism of schemes. Then $U \times_{\Spec(k)} Z \to X \times_{\Spec(k)} Z$ is surjective, see Lemma \ref{lemma-base-change-surjective}. Hence the first of the maps $$ |U \times_{\Spec(k)} Z| \to |X \times_{\Spec(k)} Z| \to |Z| $$ is surjective. Since the composition is open by the above we conclude that the second map is open as well. Whence $p$ is universally open by Lemma \ref{lemma-universally-open-local}.
Assume (1), and let $Z \to Y$ be a morphism of algebraic spaces with $Z$ quasi-compact. By Properties of Spaces, Definition \ref{spaces-properties-definition-quasi-compact} there exists a quasi-compact scheme $U$ and a surjective \'etale morphism $U \to Z$. Since $f$ is representable and quasi-compact we see by definition that $U \times_Y X$ is a scheme, and that $U \times_Y X \to U$ is quasi-compact. Hence $U \times_Y X$ is a quasi-compact scheme. The morphism $U \times_Y X \to Z \times_Y X$ is \'etale and surjective (as the base change of the representable \'etale and surjective morphism $U \to Z$, see Section \ref{section-representable}). Hence by definition $Z \times_Y X$ is quasi-compact. \medskip\noindent Assume (2). Let $Z \to Y$ be a morphism, where $Z$ is a scheme. We have to show that $p : Z \times_Y X \to Z$ is quasi-compact. Let $U \subset Z$ be affine open. Then $p^{-1}(U) = U \times_Y Z$ and the scheme $U \times_Y Z$ is quasi-compact by assumption (2). Hence $p$ is quasi-compact, see Schemes, Section \ref{schemes-section-quasi-compact}.
Let $V \subset |Y|$ be quasi-compact open. By Properties of Spaces, Lemma \ref{spaces-properties-lemma-open-subspaces} there is an open subspace $Y' \subset Y$ with $V = |Y'|$. Then $Y'$ is a quasi-compact algebraic space by Properties of Spaces, Lemma \ref{spaces-properties-lemma-quasi-compact-space} and hence $X' = Y' \times_Y X$ is a quasi-compact algebraic space by Definition \ref{definition-quasi-compact}. On the other hand, $X' \subset X$ is an open subspace (Spaces, Lemma \ref{spaces-lemma-base-change-immersions}) and $|X'| = |f|^{-1}(|X'|) = |f|^{-1}(V)$ by Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian}. We conclude using Properties of Spaces, Lemma \ref{spaces-properties-lemma-quasi-compact-space} again that $|X'|$ is a quasi-compact open of $|X|$ as desired.
Assume $X$ is quasi-compact and $X \to Y$ is surjective. By Definition \ref{definition-surjective} the map $|X| \to |Y|$ is surjective, hence we see $Y$ is quasi-compact by Properties of Spaces, Lemma \ref{spaces-properties-lemma-quasi-compact-space} and the topological fact that the image of a quasi-compact space under a continuous map is quasi-compact, see Topology, Lemma \ref{topology-lemma-image-quasi-compact}. Let $f, p, q$ be as in (2). Let $T \to Z$ be a morphism whose source is a quasi-compact algebraic space. By assumption $T \times_Z X$ is quasi-compact. By Lemma \ref{lemma-base-change-surjective} the morphism $T \times_Z X \to T \times_Z Y$ is surjective. Hence by part (1) we see $T \times_Z Y$ is quasi-compact too. Thus $q$ is quasi-compact.
Let $Z \to Y$ be a morphism of algebraic spaces with $Z$ quasi-compact. As $g$ is universally open and surjective, we see that $Y' \times_Y Z \to Z$ is open and surjective. As every point of $|Y' \times_Y Z|$ has a fundamental system of quasi-compact open neighbourhoods (see Properties of Spaces, Lemma \ref{spaces-properties-lemma-space-locally-quasi-compact}) we can find a quasi-compact open $W \subset |Y' \times_Y Z|$ which surjects onto $Z$. Denote $f'' : W \times_Y X \to W$ the base change of $f'$ by $W \to Y'$. By assumption $W \times_Y X$ is quasi-compact. As $W \to Z$ is surjective we see that $W \times_Y X \to Z \times_Y X$ is surjective. Hence $Z \times_Y X$ is quasi-compact by Lemma \ref{lemma-surjection-from-quasi-compact}. Thus $f$ is quasi-compact.
We will use Lemma \ref{lemma-base-change-quasi-compact} without further mention. It is clear that (1) implies (2) and that (2) implies (3). Assume (3). Let $Z$ be a quasi-compact algebraic space over $S$, and let $Z \to Y$ be a morphism. By Properties of Spaces, Lemma \ref{spaces-properties-lemma-quasi-compact-affine-cover} there exists an affine scheme $U$ and a surjective \'etale morphism $U \to Z$. Then $U \times_Y X \to Z \times_Y X$ is a surjective morphism of algebraic spaces, see Lemma \ref{lemma-base-change-surjective}. By assumption $|U \times_Y X|$ is quasi-compact. It surjects onto $|Z \times_Y X|$, hence we conclude that $|Z \times_Y X|$ is quasi-compact, see Topology, Lemma \ref{topology-lemma-image-quasi-compact}. This proves that (3) implies (1). \medskip\noindent The implications (1) $\Rightarrow$ (4), (4) $\Rightarrow$ (5) are clear. The implication (5) $\Rightarrow$ (1) follows from Lemma \ref{lemma-descent-quasi-compact} and the fact that an \'etale morphism of algebraic spaces is universally open (see discussion following Definition \ref{definition-open}). \medskip\noindent Of course (1) implies (6) by taking the covering $Y = Y$. Assume $Y = \bigcup Y_i$ is as in (6). Let $Z$ be affine and let $Z \to Y$ be a morphism. Then there exists a finite standard affine covering $Z = Z_1 \cup \ldots \cup Z_n$ such that each $Z_j \to Y$ factors through $Y_{i_j}$ for some $i_j$. Hence the algebraic space $$ Z_j \times_Y X = Z_j \times_{Y_{i_j}} f^{-1}(Y_{i_j}) $$ is quasi-compact. Since $Z \times_Y X = \bigcup_{j = 1, \ldots, n} Z_j \times_Y X$ is a Zariski covering we see that $|Z \times_Y X| = \bigcup_{j = 1, \ldots, n} |Z_j \times_Y X|$ (see Properties of Spaces, Lemma \ref{spaces-properties-lemma-open-subspaces}) is a finite union of quasi-compact spaces, hence quasi-compact. Thus we see that (6) implies (3).
This is true because $f$ equals the composition $(1, f) : X \to X \times_Z Y \to Y$. The first map is quasi-compact by Lemma \ref{lemma-section-immersion} because it is a section of the quasi-separated morphism $X \times_Z Y \to X$ (a base change of $g$, see Lemma \ref{lemma-base-change-separated}). The second map is quasi-compact as it is the base change of $f$, see Lemma \ref{lemma-base-change-quasi-compact}. And compositions of quasi-compact morphisms are quasi-compact, see Lemma \ref{lemma-composition-quasi-compact}.
Part (1) follows from Lemma \ref{lemma-quasi-compact-permanence} with $Z = S = \Spec(\mathbf{Z})$. Part (2) follows from (1) and Lemma \ref{lemma-compose-after-separated}. For (3) let $X \to Y$ and $Z \to Y$ be morphisms of quasi-compact and quasi-separated algebraic spaces. Then $X \times_Y Z \to Z$ is quasi-compact and quasi-separated as a base change of $X \to Y$ using (2) and Lemmas \ref{lemma-base-change-quasi-compact} and \ref{lemma-base-change-separated}. Hence $X \times_Y Z$ is quasi-compact and quasi-separated as an algebraic space quasi-compact and quasi-separated over $Z$, see Lemmas \ref{lemma-separated-over-separated} and \ref{lemma-composition-quasi-compact}.
We omit the proof that (1) implies (2), and that (2) implies (3). \medskip\noindent Assume (3). Choose a surjective \'etale morphism $V \to Y$. We are going to show that $V \times_Y X \to V$ is a universally closed morphism of algebraic spaces. Let $Z \to V$ be a morphism from an algebraic space to $V$. Let $W \to Z$ be a surjective \'etale morphism where $W = \coprod W_i$ is a disjoint union of affine schemes, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-cover-by-union-affines}. Then we have the following commutative diagram $$ \xymatrix{ \coprod_i |W_i \times_Y X| \ar@{=}[r] \ar[d] & |W \times_Y X| \ar[r] \ar[d] & |Z \times_Y X| \ar[d] \ar@{=}[r] & |Z \times_V (V \times_Y X)| \ar[ld] \\ \coprod |W_i| \ar@{=}[r] & |W| \ar[r] & |Z| } $$ We have to show the south-east arrow is closed. The middle horizontal arrows are surjective and open (Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-open}). By assumption (3), and the fact that $W_i$ is affine we see that the left vertical arrows are closed. Hence it follows that the right vertical arrow is closed. \medskip\noindent Assume (4). We will show that $f$ is universally closed. Let $Z \to Y$ be a morphism of algebraic spaces. Consider the diagram $$ \xymatrix{ |(V \times_Y Z) \times_V (V \times_Y X)| \ar@{=}[r] \ar[rd] & |V \times_Y X| \ar[r] \ar[d] & |Z \times_Y X| \ar[d] \\  & |V \times_Y Z| \ar[r] & |Z| } $$ The south-west arrow is closed by assumption. The horizontal arrows are surjective and open because the corresponding morphisms of algebraic spaces are \'etale (see Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-open}). It follows that the right vertical arrow is closed. \medskip\noindent Of course (1) implies (5) by taking the covering $Y = Y$. Assume $Y = \bigcup Y_i$ is as in (5). Then for any $Z \to Y$ we get a corresponding Zariski covering $Z = \bigcup Z_i$ such that the base change of $f$ to $Z_i$ is closed. By a simple topological argument this implies that $Z \times_Y X \to Z$ is closed. Hence (1) holds.
Parts (1) and (2) are a consequence of (3) and (4) for $S = B = \Spec(\mathbf{Z})$ (see Properties of Spaces, Definition \ref{spaces-properties-definition-separated}). Consider the commutative diagram $$ \xymatrix{ X \ar[d] \ar[rr]_{\Delta_{X/B}} & & X \times_B X \ar[d] \\ Y \ar[rr]^{\Delta_{Y/B}} & & Y \times_B Y } $$ The left vertical arrow is surjective (i.e., universally surjective). The right vertical arrow is universally closed as a composition of the universally closed morphisms $X \times_B X \to X \times_B Y \to Y \times_B Y$. Hence it is also quasi-compact, see Lemma \ref{lemma-universally-closed-quasi-compact}. \medskip\noindent Assume $X$ is quasi-separated over $B$, i.e.,  $\Delta_{X/B}$ is quasi-compact. Then if $Z$ is quasi-compact and $Z \to Y \times_B Y$ is a morphism, then $Z \times_{Y \times_B Y} X \to Z \times_{Y \times_B Y} Y$ is surjective and $Z \times_{Y \times_B Y} X$ is quasi-compact by our remarks above. We conclude that $\Delta_{Y/B}$ is quasi-compact, i.e., $Y$ is quasi-separated over $B$. \medskip\noindent Assume $X$ is separated over $B$, i.e., $\Delta_{X/B}$ is a closed immersion. Then if $Z$ is affine, and $Z \to Y \times_B Y$ is a morphism, then $Z \times_{Y \times_B Y} X \to Z \times_{Y \times_B Y} Y$ is surjective and $Z \times_{Y \times_B Y} X \to Z$ is universally closed by our remarks above. We conclude that $\Delta_{Y/B}$ is universally closed. It follows that $\Delta_{Y/B}$ is representable, locally of finite type, a monomorphism (see Lemma \ref{lemma-properties-diagonal}) and universally closed, hence a closed immersion, see \'Etale Morphisms, Lemma \ref{etale-lemma-characterize-closed-immersion} (and also the abstract principle Spaces, Lemma \ref{spaces-lemma-representable-transformations-property-implication}). Thus $Y$ is separated over $B$.