hcju/stacksqa huggingface dataset:
Choose a diagram $$ \xymatrix{ U \ar[r]_h \ar[d]_a & V \ar[d] \\ X \ar[r] & Y } $$ where $U$ and $V$ are schemes and the vertical arrows are surjective and \'etale, see Spaces, Lemma \ref{spaces-lemma-lift-morphism-presentations}. By Morphisms, Lemma \ref{morphisms-lemma-openness-bounded-dimension-fibres} the set $U_n$ of points where $h$ has relative dimension $\leq n$ is open in $U$. By our definition of relative dimension for morphisms of algebraic spaces at points we see that $U_n = a^{-1}(W_n)$. The lemma follows by definition of the topology on $|X|$.
Choose a diagram $$ \xymatrix{ U \ar[r]_h \ar[d]_a & V \ar[d] \\ X \ar[r] & Y } $$ where $U$ and $V$ are schemes and the vertical arrows are surjective and \'etale, see Spaces, Lemma \ref{spaces-lemma-lift-morphism-presentations}. In the proof of Lemma \ref{lemma-openness-bounded-dimension-fibres} we have seen that $a^{-1}(W_n) = U_n$ is the corresponding set for the morphism $h$. By Morphisms, Lemma \ref{morphisms-lemma-openness-bounded-dimension-fibres-finite-presentation} we see that $U_n$ is retrocompact in $U$. The lemma follows by definition of the topology on $|X|$, compare with Properties of Spaces, Lemma \ref{spaces-properties-lemma-space-locally-quasi-compact} and its proof.
Choose a diagram $$ \xymatrix{ U \ar[r]_h \ar[d]_a & V \ar[d] \\ X \ar[r] & Y } $$ where $U$ and $V$ are schemes and the vertical arrows are surjective and \'etale, see Spaces, Lemma \ref{spaces-lemma-lift-morphism-presentations}. The definitions imply that $h$ is locally quasi-finite if and only if $f$ is locally quasi-finite, and that $f$ has relative dimension $0$ at all $x \in |X|$ if and only if $h$ has relative dimension $0$ at all $u \in U$. Hence the result follows from the result for $h$ which is Morphisms, Lemma \ref{morphisms-lemma-locally-quasi-finite-rel-dimension-0}.
Choose an affine scheme $V$, an \'etale morphism $V \to Y$, and a point $v \in V$ mapping to $y$. Choose an affine scheme $U$ , an \'etale morphism $U \to X \times_Y V$ and a point $u \in U$ mapping to $v$ in $V$ and $x$ in $X$. Unwinding Definition \ref{definition-dimension-fibre} and Properties of Spaces, Definition \ref{spaces-properties-definition-dimension-local-ring} we have to show that $$ \dim(\mathcal{O}_{U, u}) \leq \dim(\mathcal{O}_{V, v}) + E - \text{trdeg}_{\kappa(v)}(\kappa(u)) $$ Let $\xi_U \in U$ be a generic point of an irreducible component of $U$ which contains $u$. Then $\xi_U$ maps to a point $\xi \in |X|$ which is in the list used to define the quantity $E$ and in fact every $\xi$ used in the definition of $E$ occurs in this manner (small detail omitted). In particular, there are only a finite number of these $\xi$ and we can take the maximum (i.e., it really is a maximum and not a supremum). The transcendence degree of $\xi$ over $f(\xi)$ is $\text{trdeg}_{\kappa(\xi_V)}(\kappa(\xi_U))$ where $\xi_V \in V$ is the image of $\xi_U$. Thus the lemma follows from Morphisms, Lemma \ref{morphisms-lemma-dimension-formula-general}.
Let $X \to Y$ be a smooth morphism of algebraic spaces. By definition this means there exists a diagram as in Lemma \ref{lemma-local-source-target} with $h$ smooth and surjective vertical arrow $a$. By Morphisms, Lemma \ref{morphisms-lemma-smooth-locally-finite-presentation} $h$ is locally of finite presentation. Hence $X \to Y$ is locally of finite presentation by definition.
Let $X \to Y$ be a smooth morphism of algebraic spaces. By definition this means there exists a diagram as in Lemma \ref{lemma-local-source-target} with $h$ smooth and surjective vertical arrow $a$. By Morphisms, Lemma \ref{morphisms-lemma-smooth-syntomic} $h$ is syntomic. Hence $X \to Y$ is syntomic by definition.
The existence of $U$ follows from the fact that the property of being smooth is Zariski (and even \'etale) local on the source, see Lemma \ref{lemma-smooth-local}. Moreover, this lemma allows us to translate properties (1) and (2) into the case of morphisms of schemes. The case of schemes is Morphisms, Lemma \ref{morphisms-lemma-set-points-where-fibres-smooth}. Some details omitted.
Let $i : X \to Y$ be an immersion of algebraic spaces. Choose a scheme $V$ and a surjective \'etale morphism $V \to Y$. Then $V \times_Y X \to V$ is an immersion of schemes, hence unramified (see Morphisms, Lemmas \ref{morphisms-lemma-open-immersion-unramified} and \ref{morphisms-lemma-closed-immersion-unramified}). Thus by definition $i$ is unramified.
We know in any case that $\Delta_{X/Y}$ is a representable monomorphism, see Lemma \ref{lemma-properties-diagonal}. Choose a scheme $V$ and a surjective \'etale morphism $V \to Y$. Choose a scheme $U$ and a surjective \'etale morphism $U \to X \times_Y V$. Consider the commutative diagram $$ \xymatrix{ U \ar[d] \ar[rr]_-{\Delta_{U/V}} & & U \times_V U \ar[d] \ar[r] & V \ar[d]^{\Delta_{V/Y}} \\ X \ar[rr]^-{\Delta_{X/Y}} & & X \times_Y X \ar[r] & V \times_Y V } $$ with cartesian right square. The left vertical arrow is surjective \'etale. The right vertical arrow is \'etale as a morphism between schemes \'etale over $Y$, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-permanence}. Hence the middle vertical arrow is \'etale too (but it need not be surjective). \medskip\noindent Assume $f$ is unramified. Then $U \to V$ is unramified, hence $\Delta_{U/V}$ is an open immersion by Morphisms, Lemma \ref{morphisms-lemma-diagonal-unramified-morphism}. Looking at the left square of the diagram above we conclude that $\Delta_{X/Y}$ is an \'etale morphism, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-local}. Hence $\Delta_{X/Y}$ is a representable \'etale monomorphism, which implies that it is an open immersion by \'Etale Morphisms, Theorem \ref{etale-theorem-etale-radicial-open}. (See also Spaces, Lemma \ref{spaces-lemma-representable-transformations-property-implication} for the translation from schemes language into the language of functors.) \medskip\noindent Assume that $f$ is locally of finite type and that $\Delta_{X/Y}$ is an open immersion. This implies that $U \to V$ is locally of finite type too (by definition of a morphism of algebraic spaces which is locally of finite type). Looking at the displayed diagram above we conclude that $\Delta_{U/V}$ is \'etale as a morphism between schemes \'etale over $X \times_Y X$, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-permanence}. But since $\Delta_{U/V}$ is the diagonal of a morphism between schemes we see that it is in any case an immersion, see Schemes, Lemma \ref{schemes-lemma-diagonal-immersion}. Hence it is an open immersion, and we conclude that $U \to V$ is unramified by Morphisms, Lemma \ref{morphisms-lemma-diagonal-unramified-morphism}. This in turn means that $f$ is unramified by definition.
This lemma is the analogue of Morphisms, Lemma \ref{morphisms-lemma-set-points-where-fibres-unramified} and in fact we will deduce the lemma from it. By Definition \ref{definition-unramified} the set $\{x \in |X| : f \text{ is unramified at }x\}$ is open in $X$. Hence we only need to prove the final statement. By Lemma \ref{lemma-permanence-finite-type} the morphism $X \to Y$ is locally of finite type. By Lemma \ref{lemma-base-change-finite-type} the morphism $X' \to Y'$ is locally of finite type. \medskip\noindent Choose a scheme $W$ and a surjective \'etale morphism $W \to Z$. Choose a scheme $V$ and a surjective \'etale morphism $V \to W \times_Z Y$. Choose a scheme $U$ and a surjective \'etale morphism $U \to V \times_Y X$. Finally, choose a scheme $W'$ and a surjective \'etale morphism $W' \to W \times_Z Z'$. Set $V' = W' \times_W V$ and $U' = W' \times_W U$, so that we obtain surjective \'etale morphisms $V' \to Y'$ and $U' \to X'$. We will use without further mention an \'etale morphism of algebraic spaces induces an open map of associated topological spaces (see Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-open}). This combined with Lemma \ref{lemma-unramified-local} implies that $U(f)$ is the image in $|X|$ of the set $T$ of points in $U$ where the morphism $U \to V$ is unramified. Similarly, $U(f')$ is the image in $|X'|$ of the set $T'$ of points in $U'$ where the morphism $U' \to V'$ is unramified. Now, by construction the diagram $$ \xymatrix{ U' \ar[r] \ar[d] & U \ar[d] \\ V' \ar[r] & V } $$ is cartesian (in the category of schemes). Hence the aforementioned Morphisms, Lemma \ref{morphisms-lemma-set-points-where-fibres-unramified} applies to show that $T'$ is the inverse image of $T$. Since $|U'| \to |X'|$ is surjective this implies the lemma.
Choose a commutative diagram $$ \xymatrix{ U \ar[d] \ar[r] & V \ar[d] \ar[r] & W \ar[d] \\ X \ar[r] & Y \ar[r] & Z } $$ with vertical arrows \'etale and surjective. (See Spaces, Lemma \ref{spaces-lemma-lift-morphism-presentations}.) Apply Morphisms, Lemma \ref{morphisms-lemma-unramified-permanence} to the top row.
Let $X \to Y$ be an \'etale morphism of algebraic spaces, see Properties of Spaces, Definition \ref{spaces-properties-definition-etale}. By Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-local} we see this means there exists a diagram as in Lemma \ref{lemma-local-source-target} with $h$ \'etale and surjective vertical arrow $a$. By Morphisms, Lemma \ref{morphisms-lemma-etale-locally-quasi-finite} $h$ is locally quasi-finite. Hence $X \to Y$ is locally quasi-finite by definition.
Let $X \to Y$ be a locally finitely presented, flat, unramified morphism of algebraic spaces. By Properties of Spaces, Lemma \ref{spaces-properties-lemma-etale-local} we see this means there exists a diagram as in Lemma \ref{lemma-local-source-target} with $h$ locally finitely presented, flat, unramified and surjective vertical arrow $a$. By Morphisms, Lemma \ref{morphisms-lemma-flat-unramified-etale} $h$ is \'etale. Hence $X \to Y$ is \'etale by definition.
Assume $X \to B$ is universally closed and $Y \to B$ is separated. We factor the morphism as $X \to X \times_B Y \to Y$. The first morphism is a closed immersion, see Lemma \ref{lemma-semi-diagonal} hence universally closed. The projection $X \times_B Y \to Y$ is the base change of a universally closed morphism and hence universally closed, see Lemma \ref{lemma-base-change-universally-closed}. Thus $X \to 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-permanence-finite-type}.
Assume $X$ is universally closed and $f$ surjective. Denote $p : X \to B$, $q : Y \to B$ the structure morphisms. Let $B' \to B$ be a morphism of algebraic spaces over $S$. The base change $f' : X_{B'} \to Y_{B'}$ is surjective (Lemma \ref{lemma-base-change-surjective}), and the base change $p' : X_{B'} \to B'$ is closed. If $T \subset Y_{B'}$ is closed, then $(f')^{-1}(T) \subset X_{B'}$ is closed, hence $p'((f')^{-1}(T)) = q'(T)$ is closed. So $q'$ is closed.
The scheme theoretic image of $h$ is constructed in Section \ref{section-scheme-theoretic-image}. Observe that $h$ is quasi-compact (Lemma \ref{lemma-quasi-compact-quasi-separated-permanence}) hence $|h|(|X|) \subset |Z|$ is dense (Lemma \ref{lemma-quasi-compact-scheme-theoretic-image}). On the other hand $|h|(|X|)$ is closed in $|Y|$ (Lemma \ref{lemma-universally-closed-permanence}) hence $X \to Z$ is surjective. Thus $Z \to B$ is a proper (Lemma \ref{lemma-image-proper-is-proper}).
The implication (1) $\Rightarrow$ (3) follows from Lemma \ref{lemma-closed-immersion-proper}. We will use Spaces, Lemma \ref{spaces-lemma-representable-transformations-property-implication} without further mention in the rest of the proof. Recall that $\Delta_{X/Y}$ is a representable monomorphism which is locally of finite type, see Lemma \ref{lemma-properties-diagonal}. Since proper $\Rightarrow$ universally closed for morphisms of schemes we conclude that (3) implies (2). If $\Delta_{X/Y}$ is universally closed then \'Etale Morphisms, Lemma \ref{etale-lemma-characterize-closed-immersion} implies that it is a closed immersion. Thus (2) $\Rightarrow$ (1) and we win.
It suffices to show that given a commutative diagram of the form $$ \xymatrix{ \Spec(K') \ar[r] \ar[d] & \Spec(K) \ar[r] & X \ar[d] \\ \Spec(A') \ar[r] \ar[rru]^\varphi & \Spec(A) \ar[r] & Y } $$ as in Definition \ref{definition-valuative-criterion}, then we can find a morphism $\Spec(A) \to X$ fitting into the diagram too. Set $X_A = \Spec(A) \times_Y Y$. As $f$ is representable we see that $X_A$ is a scheme. The morphism $\varphi$ gives a morphism $\varphi' : \Spec(A') \to X_A$. Let $x \in X_A$ be the image of the closed point of $\varphi' : \Spec(A') \to X_A$. Then we have the following commutative diagram of rings $$ \xymatrix{ K' & K \ar[l] & \mathcal{O}_{X_A, x} \ar[l] \ar[lld] \\ A' \ar[u] & A \ar[l] & A \ar[l] \ar[u] } $$ Since $A$ is a valuation ring, and since $A'$ dominates $A$, we see that $K \cap A' = A$. Hence the ring map $\mathcal{O}_{X_A, x} \to K$ has image contained in $A$. Whence a morphism $\Spec(A) \to X_A$ (see Schemes, Section \ref{schemes-section-points}) as desired.
We have to show that (1) implies (2). Suppose given a diagram $$ \xymatrix{ \Spec(K') \ar[r] \ar[d] & \Spec(K) \ar[r] & X \ar[d] \\ \Spec(A') \ar[r] \ar[rru] & \Spec(A) \ar[r] & Y } $$ as in Definition \ref{definition-valuative-criterion} with $K \subset K'$ arbitrary. Choose a scheme $U$ and a surjective \'etale morphism $U \to X$. Then $$ \Spec(A') \times_X U \longrightarrow \Spec(A') $$ is surjective \'etale. Let $p$ be a point of $\Spec(A') \times_X U$ mapping to the closed point of $\Spec(A')$. Let $p' \leadsto p$ be a generalization of $p$ mapping to the generic point of $\Spec(A')$. Such a generalization exists because generalizations lift along flat morphisms of schemes, see Morphisms, Lemma \ref{morphisms-lemma-generalizations-lift-flat}. Then $p'$ corresponds to a point of the scheme $\Spec(K') \times_X U$. Note that $$ \Spec(K') \times_X U = \Spec(K') \times_{\Spec(K)} (\Spec(K) \times_X U) $$ Hence $p'$ maps to a point $q' \in \Spec(K) \times_X U$ whose residue field is a finite separable extension of $K$. Finally, $p' \leadsto p$ maps to a specialization $u' \leadsto u$ on the scheme $U$. With all this notation we get the following diagram of rings $$ \xymatrix{ \kappa(p') & & \kappa(q') \ar[ll] & \kappa(u') \ar[l] \\ & \mathcal{O}_{\Spec(A') \times_X U, p} \ar[lu] & & \mathcal{O}_{U, u} \ar[ll] \ar[u] \\ K' \ar[uu] & A' \ar[l] \ar[u] & A \ar[l] \ar'[u][uu] } $$ This means that the ring $B \subset \kappa(q')$ generated by the images of $A$ and $\mathcal{O}_{U, u}$ maps to a subring of $\kappa(p')$ contained in the image $B'$ of $\mathcal{O}_{\Spec(A') \times_X U, p} \to \kappa(p')$. Note that $B'$ is a local ring. Let $\mathfrak m \subset B$ be the maximal ideal. By construction $A \cap \mathfrak m$, (resp.\ $\mathcal{O}_{U, u} \cap \mathfrak m$, resp.\ $A' \cap \mathfrak m$) is the maximal ideal of $A$ (resp.\ $\mathcal{O}_{U, u}$, resp.\ $A'$). Set $\mathfrak q = B \cap \mathfrak m$. This is a prime ideal such that $A \cap \mathfrak q$ is the maximal ideal of $A$. Hence $B_{\mathfrak q} \subset \kappa(q')$ is a local ring dominating $A$. By Algebra, Lemma \ref{algebra-lemma-dominate} we can find a valuation ring $A_1 \subset \kappa(q')$ with field of fractions $\kappa(q')$ dominating $B_{\mathfrak q}$. The (local) ring map $\mathcal{O}_{U, u} \to A_1$ gives a morphism $\Spec(A_1) \to U \to X$ such that the diagram $$ \xymatrix{ \Spec(\kappa(q')) \ar[r] \ar[d] & \Spec(K) \ar[r] & X \ar[d] \\ \Spec(A_1) \ar[r] \ar[rru] & \Spec(A) \ar[r] & Y } $$ is commutative. Since the fraction field of $A_1$ is $\kappa(q')$ and since $\kappa(q')/K$ is finite separable by construction the lemma is proved.
We have to show that (1) implies (2). Suppose given a commutative diagram $$ \xymatrix{ \Spec(K) \ar[r] \ar[d] & X \ar[d] \\ \Spec(A) \ar[r] & Y } $$ as in part (2). By (1) there exists a commutative diagram $$ \xymatrix{ \Spec(K') \ar[r] \ar[d] & \Spec(K) \ar[r] & X \ar[d] \\ \Spec(A') \ar[r] \ar[rru] & \Spec(A) \ar[r] & Y } $$ as in Definition \ref{definition-valuative-criterion} with $K \subset K'$ arbitrary. By Lemma \ref{lemma-push-down-solution} we can find a morphism $\Spec(A) \to X$ fitting into the diagram, i.e., (2) holds.
By Lemmas \ref{lemma-base-change-quasi-compact} and \ref{lemma-base-change-valuative-criteria} properties (1) and (2) are preserved under any base change. By Lemma \ref{lemma-universally-closed-local} we only have to show that $|T \times_Y X| \to |T|$ is closed, whenever $T$ is an affine scheme over $S$ mapping into $Y$. Hence it suffices to prove: If $Y$ is an affine scheme, $f : X \to Y$ is quasi-compact and satisfies the existence part of the valuative criterion, then $f : |X| \to |Y|$ is closed. In this situation $X$ is a quasi-compact algebraic space. By Properties of Spaces, Lemma \ref{spaces-properties-lemma-quasi-compact-affine-cover} there exists an affine scheme $U$ and a surjective \'etale morphism $\varphi : U \to X$. Let $T \subset |X|$ closed. The inverse image $\varphi^{-1}(T) \subset U$ is closed, and hence is the set of points of an affine closed subscheme $Z \subset U$. Thus, by Algebra, Lemma \ref{algebra-lemma-image-stable-specialization-closed} we see that $f(T) = f(\varphi(|Z|)) \subset |Y|$ is closed if it is closed under specialization. \medskip\noindent Let $y' \leadsto y$ be a specialization in $Y$ with $y' \in f(T)$. Choose a point $x' \in T \subset |X|$ mapping to $y'$ under $f$. We may represent $x'$ by a morphism $\Spec(K) \to X$ for some field $K$. Thus we have the following diagram $$ \xymatrix{ \Spec(K) \ar[r]_-{x'} \ar[d] & X \ar[d]^f \\ \Spec(\mathcal{O}_{Y, y}) \ar[r] & Y, } $$ see Schemes, Section \ref{schemes-section-points} for the existence of the left vertical map. Choose a valuation ring $A \subset K$ dominating the image of the ring map $\mathcal{O}_{Y, y} \to K$ (this is possible since the image is a local ring and not a field as $y' \not = y$, see Algebra, Lemma \ref{algebra-lemma-dominate}). By assumption there exists a field extension $K \subset K'$ and a valuation ring $A' \subset K'$ dominating $A$, and a morphism $\Spec(A') \to X$ fitting into the commutative diagram. Since $A'$ dominates $A$, and $A$ dominates $\mathcal{O}_{Y, y}$ we see that the closed point of $\Spec(A')$ maps to a point $x \in X$ with $f(x) = y$ which is a specialization of $x'$. Hence $x \in T$ as $T$ is closed, and hence $y \in f(T)$ as desired.
If (1) is true then combined with Lemma \ref{lemma-quasi-compact-existence-universally-closed} we obtain (2). Assume $f$ is quasi-separated and universally closed. Assume given a diagram $$ \xymatrix{ \Spec(K) \ar[r] \ar[d] & X \ar[d] \\ \Spec(A) \ar[r] & Y } $$ as in Definition \ref{definition-valuative-criterion}. A formal argument shows that the existence of the desired diagram $$ \xymatrix{ \Spec(K') \ar[r] \ar[d] & \Spec(K) \ar[r] & X \ar[d] \\ \Spec(A') \ar[r] \ar[rru] & \Spec(A) \ar[r] & Y } $$ follows from existence in the case of the morphism $X_A \to \Spec(A)$. Since being quasi-separated and universally closed are preserved by base change, the lemma follows from the result in the next paragraph. \medskip\noindent Consider a solid diagram $$ \xymatrix{ \Spec(K) \ar[r]_-x \ar[d] & X \ar[d]^f \\ \Spec(A) \ar@{=}[r] \ar@{..>}[ru] & \Spec(A) } $$ where $A$ is a valuation ring with field of fractions $K$. By Lemma \ref{lemma-quasi-compact-permanence} and the fact that $f$ is quasi-separated we have that the morphism $x$ is quasi-compact. Since $f$ is universally closed, we have in particular that $|f|(\overline{\{x\}})$ is closed in $\Spec(A)$. Since this image contains the generic point of $\Spec(A)$ there exists a point $x' \in |X|$ in the closure of $x$ mapping to the closed point of $\Spec(A)$. By Lemma \ref{lemma-reach-points-scheme-theoretic-image} we can find a commutative diagram $$ \xymatrix{ \Spec(K') \ar[r] \ar[d] & \Spec(K) \ar[d] \\ \Spec(A') \ar[r] & X } $$ such that the closed point of $\Spec(A')$ maps to $x' \in |X|$. It follows that $\Spec(A') \to \Spec(A)$ maps the closed point to the closed point, i.e., $A'$ dominates $A$ and this finishes the proof.
The base change $X_A \to \Spec(A)$ is flat (Lemma \ref{lemma-base-change-flat}) and the closed point of $\Spec(A)$ is in the image of $|X_A| \to |\Spec(A)|$ (Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian}). Thus we may assume $Y = \Spec(A)$. Let $U \to X$ be a surjective \'etale morphism where $U$ is a scheme. Let $u \in U$ map to the closed point of $\Spec(A)$. Consider the flat local ring map $A \to B = \mathcal{O}_{U, u}$. By Algebra, Lemma \ref{algebra-lemma-ff-rings} there exists a prime ideal $\mathfrak q \subset B$ such that $\mathfrak q$ lies over $(0) \subset A$. By Algebra, Lemma \ref{algebra-lemma-dominate} we can find a valuation ring $A' \subset \kappa(\mathfrak q)$ dominating $B/\mathfrak q$. The induced morphism $\Spec(A') \to U \to X$ is a solution to the problem posed by the lemma.
Let a diagram as in Definition \ref{definition-valuative-criterion} be given. Suppose there are two distinct morphisms $a, b : \Spec(A) \to X$ fitting into the diagram. Let $Z \subset \Spec(A)$ be the equalizer of $a$ and $b$. Then $Z = \Spec(A) \times_{(a, b), X \times_Y X, \Delta} X$. If $f$ is separated, then $\Delta$ is a closed immersion, and this is a closed subscheme of $\Spec(A)$. By assumption it contains the generic point of $\Spec(A)$. Since $A$ is a domain this implies $Z = \Spec(A)$. Hence $a = b$ as desired.
Assumption (1) means $\Delta_{X/Y}$ is quasi-compact. We claim the morphism $\Delta_{X/Y} : X \to X \times_Y X$ satisfies the existence part of the valuative criterion. Let a solid commutative diagram $$ \xymatrix{ \Spec(K) \ar[r] \ar[d] & X \ar[d] \\ \Spec(A) \ar[r] \ar@{-->}[ru] & X \times_Y X } $$ be given. The lower right arrow corresponds to a pair of morphisms $a, b : \Spec(A) \to X$ over $Y$. By assumption (2) we see that $a = b$. Hence using $a$ as the dotted arrow works. Hence Lemma \ref{lemma-quasi-compact-existence-universally-closed} applies, and we see that $\Delta_{X/Y}$ is universally closed. Since always $\Delta_{X/Y}$ is locally of finite type and separated, we conclude from More on Morphisms, Lemma \ref{more-morphisms-lemma-characterize-finite} that $\Delta_{X/Y}$ is a finite morphism (also, use the general principle of Spaces, Lemma \ref{spaces-lemma-representable-transformations-property-implication}). At this point $\Delta_{X/Y}$ is a representable, finite monomorphism, hence a closed immersion by Morphisms, Lemma \ref{morphisms-lemma-finite-monomorphism-closed}.
Since $f$ is quasi-separated, the uniqueness part of the valutative criterion implies $f$ is separated (Lemma \ref{lemma-valuative-criterion-separatedness}). Conversely, if $f$ is separated, then it satisfies the uniqueness part of the valuative criterion (Lemma \ref{lemma-separated-implies-valuative}). Having said this, we see that in each of the three cases the morphism $f$ is separated and satisfies the uniqueness part of the valuative criterion. In this case the lemma is a formal consequence of Lemma \ref{lemma-characterize-universally-closed-separated}.