hcju/stacksqa huggingface dataset:
Let $X_i$ be a scheme representing $F_i$ and let $\xi_i \in F_i(X_i) \subset F(X_i)$ be the ``universal family''. Because $F_j \subset F$ is representable by open immersions, there exists an open $U_{ij} \subset X_i$ such that $T \to X_i$ factors through $U_{ij}$ if and only if $\xi_i|_T \in F_j(T)$. In particular $\xi_i|_{U_{ij}} \in F_j(U_{ij})$ and therefore we obtain a canonical morphism $\varphi_{ij} : U_{ij} \to X_j$ such that $\varphi_{ij}^*\xi_j = \xi_i|_{U_{ij}}$. By definition of $U_{ji}$ this implies that $\varphi_{ij}$ factors through $U_{ji}$. Since $(\varphi_{ij} \circ \varphi_{ji})^*\xi_j =\varphi_{ji}^*(\varphi_{ij}^*\xi_j) = \varphi_{ji}^*\xi_i = \xi_j$ we conclude that $\varphi_{ij} \circ \varphi_{ji} = \text{id}_{U_{ji}}$ because the pair $(X_j, \xi_j)$ represents $F_j$. In particular the maps $\varphi_{ij} : U_{ij} \to U_{ji}$ are isomorphisms of schemes. Next we have to show that $\varphi_{ij}^{-1}(U_{ji} \cap U_{jk}) = U_{ij} \cap U_{ik}$. This is true because (a) $U_{ji} \cap U_{jk}$ is the largest open of $U_{ji}$ such that $\xi_j$ restricts to an element of $F_k$, (b) $U_{ij} \cap U_{ik}$ is the largest open of $U_{ij}$ such that $\xi_i$ restricts to an element of $F_k$, and (c) $\varphi_{ij}^*\xi_j = \xi_i$. Moreover, the cocycle condition in Section \ref{section-glueing-schemes} follows because both $\varphi_{jk}|_{U_{ji} \cap U_{jk}} \circ \varphi_{ij}|_{U_{ij} \cap U_{ik}}$ and $\varphi_{ik}|_{U_{ij} \cap U_{ik}}$ pullback $\xi_k$ to the element $\xi_i$. Thus we may apply Lemma \ref{lemma-glue-schemes} to obtain a scheme $X$ with an open covering $X = \bigcup U_i$ and isomorphisms $\varphi_i : X_i \to U_i$ with properties as in Lemma \ref{lemma-glue}. Let $\xi_i' = (\varphi_i^{-1})^* \xi_i$. The conditions of Lemma \ref{lemma-glue} imply that $\xi_i'|_{U_i \cap U_j} = \xi_j'|_{U_i \cap U_j}$. Therefore, by the condition that $F$ satisfies the sheaf condition in the Zariski topology we see that there exists an element $\xi' \in F(X)$ such that $\xi_i = \varphi_i^*\xi'|_{U_i}$ for all $i$. Since $\varphi_i$ is an isomorphism we also get that $(U_i, \xi'|_{U_i})$ represents the functor $F_i$. \medskip\noindent We claim that the pair $(X, \xi')$ represents the functor $F$. To show this, let $T$ be a scheme and let $\xi \in F(T)$. We will construct a unique morphism $g : T \to X$ such that $g^*\xi' = \xi$. Namely, by the condition that the subfunctors $F_i$ cover $F$ there exists an open covering $T = \bigcup V_i$ such that for each $i$ the restriction $\xi|_{V_i} \in F_i(V_i)$. Moreover, since each of the inclusions $F_i \subset F$ are representable by open immersions we may assume that each $V_i \subset T$ is maximal open with this property. Because, $(U_i, \xi'_{U_i})$ represents the functor $F_i$ we get a unique morphism $g_i : V_i \to U_i$ such that $g_i^*\xi'|_{U_i} = \xi|_{V_i}$. On the overlaps $V_i \cap V_j$ the morphisms $g_i$ and $g_j$ agree, for example because they both pull back $\xi'|_{U_i \cap U_j} \in F_i(U_i \cap U_j)$ to the same element. Thus the morphisms $g_i$ glue to a unique morphism from $T \to X$ as desired.
Suppose that $X = \Spec(A)$, $Y = \Spec(B)$ and $S = \Spec(R)$. By Lemma \ref{lemma-fibre-product-affine-schemes} the affine scheme $\Spec(A \otimes_R B)$ is the fibre product $X \times_S Y$ in the category of locally ringed spaces. Hence it is a fortiori the fibre product in the category of schemes.
Let $z$ be a point of $X \times_S Y$ and let us construct a triple as above. Recall that we may think of $z$ as a morphism $\Spec(\kappa(z)) \to X \times_S Y$, see Lemma \ref{lemma-characterize-points}. This morphism corresponds to morphisms $a : \Spec(\kappa(z)) \to X$ and $b : \Spec(\kappa(z)) \to Y$ such that $f \circ a = g \circ b$. By the same lemma again we get points $x \in X$, $y \in Y$ lying over the same point $s \in S$ as well as field maps $\kappa(x) \to \kappa(z)$, $\kappa(y) \to \kappa(z)$ such that the compositions $\kappa(s) \to \kappa(x) \to \kappa(z)$ and $\kappa(s) \to \kappa(y) \to \kappa(z)$ are the same. In other words we get a ring map $\kappa(x) \otimes_{\kappa(s)} \kappa(y) \to \kappa(z)$. We let $\mathfrak p$ be the kernel of this map. \medskip\noindent Conversely, given a quadruple $(x, y, s, \mathfrak p)$ we get a commutative solid diagram $$ \xymatrix{ X \times_S Y \ar@/_/[dddr] \ar@/^/[rrrd] & & & \\ & \Spec(\kappa(x) \otimes_{\kappa(s)} \kappa(y)/\mathfrak p) \ar[r] \ar[d] \ar@{-->}[lu] & \Spec(\kappa(y)) \ar[d] \ar[r] & Y \ar[dd] \\ & \Spec(\kappa(x)) \ar[r] \ar[d] & \Spec(\kappa(s)) \ar[rd] & \\ & X \ar[rr] & & S } $$ see the discussion in Section \ref{section-points}. Thus we get the dotted arrow. The corresponding point $z$ of $X \times_S Y$ is the image of the generic point of $\Spec(\kappa(x) \otimes_{\kappa(s)} \kappa(y)/\mathfrak p)$. We omit the verification that the two constructions are inverse to each other.
Assume that $X \to S$ is a closed immersion corresponding to the quasi-coherent sheaf of ideals $\mathcal{I} \subset \mathcal{O}_S$. By Lemma \ref{lemma-restrict-map-to-closed} the closed subspace $Z \subset Y$ defined by the sheaf of ideals $\Im(g^*\mathcal{I} \to \mathcal{O}_Y)$ is the fibre product in the category of locally ringed spaces. By Lemma \ref{lemma-closed-subspace-scheme} $Z$ is a scheme. Hence $Z = X \times_S Y$ and the first statement follows. The second follows from Lemma \ref{lemma-open-fibre-product} for example. The third is a combination of the first two.
We can think of the base change of $f$ via the morphism $S' \to S$ as the top left vertical arrow in the following commutative diagram: $$ \xymatrix{ X_{S'} \ar[r] \ar[d] & X \ar[d] \ar@/^4ex/[dd] \\ Y_{S'} \ar[r] \ar[d] & Y \ar[d] \\ S' \ar[r] & S } $$ The diagram implies $X_{S'} \cong Y_{S'} \times_Y X$, and the lemma follows from Lemma \ref{lemma-fibre-product-immersion}.
Choose an open affine $U \subset S$ that contains $s$. The bottom horizontal morphisms factor through $U$, see Lemma \ref{lemma-morphism-from-spec-local-ring} for example. Thus we may assume that $S$ is affine. If $X$ is also affine, then the result follows from Algebra, Remark \ref{algebra-remark-fundamental-diagram}. In the general case the result follows by covering $X$ by open affines.
Suppose we are given a covering $S = \bigcup_{i \in I} U_i$ as in (3). First, let $U \subset S$ be any affine open. For any $u \in U$ we can find an index $i(u) \in I$ such that $u \in U_{i(u)}$. As standard opens form a basis for the topology on $U_{i(u)}$ we can find $W_u \subset U \cap U_{i(u)}$ which is standard open in $U_{i(u)}$. By compactness we can find finitely many points $u_1, \ldots, u_n \in U$ such that $U = \bigcup_{j = 1}^n W_{u_j}$. For each $j$ write $f^{-1}U_{i(u_j)} = \bigcup_{k \in K_j} V_{jk}$ as a finite union of affine opens. Since $W_{u_j} \subset U_{i(u_j)}$ is a standard open we see that $f^{-1}(W_{u_j}) \cap V_{jk}$ is a standard open of $V_{jk}$, see Algebra, Lemma \ref{algebra-lemma-spec-functorial}. Hence $f^{-1}(W_{u_j}) \cap V_{jk}$ is affine, and so $f^{-1}(W_{u_j})$ is a finite union of affines. This proves that the inverse image of any affine open is a finite union of affine opens. \medskip\noindent Next, assume that the inverse image of every affine open is a finite union of affine opens. Let $K \subset S$ be any quasi-compact open. Since $S$ has a basis of the topology consisting of affine opens we see that $K$ is a finite union of affine opens. Hence the inverse image of $K$ is a finite union of affine opens. Hence $f$ is quasi-compact. \medskip\noindent Finally, assume that $f$ is quasi-compact. In this case the argument of the previous paragraph shows that the inverse image of any affine is a finite union of affine opens.
We have (1) $\Rightarrow$ (2) by Topology, Lemma \ref{topology-lemma-open-closed-specialization}. Assume (2). Let $U \subset S$ be an affine open. It suffices to prove that $f(X) \cap U$ is closed. Since $U \cap f(X)$ is stable under specializations in $U$, we have reduced to the case where $S$ is affine. Because $f$ is quasi-compact we deduce that $X = f^{-1}(S)$ is quasi-compact as $S$ is affine. Thus we may write $X = \bigcup_{i = 1}^n U_i$ with $U_i \subset X$ open affine. Say $S = \Spec(R)$ and $U_i = \Spec(A_i)$ for some $R$-algebra $A_i$. Then $f(X) = \Im(\Spec(A_1 \times \ldots \times A_n) \to \Spec(R))$. Thus the lemma follows from Algebra, Lemma \ref{algebra-lemma-image-stable-specialization-closed}.
According to Topology, Lemma \ref{topology-lemma-closed-open-map-specialization} if $f$ is closed then specializations lift along $f$. Conversely, suppose that specializations lift along $f$. Let $Z \subset X$ be a closed subset. We may think of $Z$ as a scheme with the reduced induced scheme structure, see Definition \ref{definition-reduced-induced-scheme}. Since $Z \subset X$ is closed the restriction of $f$ to $Z$ is still quasi-compact. Moreover specializations lift along $Z \to S$ as well, see Topology, Lemma \ref{topology-lemma-lift-specialization-composition}. Hence it suffices to prove $f(X)$ is closed if specializations lift along $f$. In particular $f(X)$ is stable under specializations, see Topology, Lemma \ref{topology-lemma-lift-specializations-images}. Thus $f(X)$ is closed by Lemma \ref{lemma-image-quasi-compact-closed}.
Let $s' \leadsto s$ be a specialization in $S$, and let $\kappa(s') \subset K$ be an extension of fields. By Lemma \ref{lemma-specialize-points} and the discussion following Lemma \ref{lemma-characterize-points} this leads to ring maps $\mathcal{O}_{S, s} \to \kappa(s') \to K$. Let $A \subset K$ be any valuation ring whose field of fractions is $K$ and which dominates the image of $\mathcal{O}_{S, s} \to K$, see Algebra, Lemma \ref{algebra-lemma-dominate}. The ring map $\mathcal{O}_{S, s} \to A$ induces the morphism $f : \Spec(A) \to S$, see Lemma \ref{lemma-morphism-from-spec-local-ring}. This morphism has all the desired properties by construction.
Assume (1) holds. Let a solid diagram as in Definition \ref{definition-valuative-criterion} be given. In order to find the dotted arrow we may replace $X \to S$ by $X_{\Spec(A)} \to \Spec(A)$ since after all the assumption is stable under base change. Thus we may assume $S = \Spec(A)$. Let $x' \in X$ be the image of $\Spec(K) \to X$, so that we have $\kappa(x') \subset K$, see Lemma \ref{lemma-characterize-points}. By assumption there exists a specialization $x' \leadsto x$ in $X$ such that $x$ maps to the closed point of $S = \Spec(A)$. We get a local ring map $A \to \mathcal{O}_{X, x}$ and a ring map $\mathcal{O}_{X, x} \to \kappa(x')$, see Lemma \ref{lemma-specialize-points} and the discussion following Lemma \ref{lemma-characterize-points}. The composition $A \to \mathcal{O}_{X, x} \to \kappa(x') \to K$ is the given injection $A \to K$. Since $A \to \mathcal{O}_{X, x}$ is local, the image of $\mathcal{O}_{X, x} \to K$ dominates $A$ and hence is equal to $A$, by Algebra, Definition \ref{algebra-definition-valuation-ring}. Thus we obtain a ring map $\mathcal{O}_{X, x} \to A$ and hence a morphism $\Spec(A) \to X$ (see Lemma \ref{lemma-morphism-from-spec-local-ring} and discussion following it). This proves (2). \medskip\noindent Conversely, assume (2) holds. It is immediate that the existence part of the valuative criterion holds for any base change $X_{S'} \to S'$ of $f$ by considering the following commutative diagram $$ \xymatrix{ \Spec(K) \ar[r] \ar[d] & X_{S'} \ar[r] \ar[d] & X \ar[d] \\ \Spec(A) \ar[r] \ar@{-->}[ru] \ar@{-->}[rru] & S' \ar[r] & S } $$ Namely, the more horizontal dotted arrow will lead to the other one by definition of the fibre product. OK, so it clearly suffices to show that specializations lift along $f$. Let $s' \leadsto s$ be a specialization in $S$, and let $x' \in X$ be a point lying over $s'$. Apply Lemma \ref{lemma-points-specialize} to $s' \leadsto s$ and the extension of fields $\kappa(s') \subset \kappa(x') = K$. We get a commutative diagram $$ \xymatrix{ \Spec(K) \ar[rr] \ar[d] & & X \ar[d] \\ \Spec(A) \ar[r] \ar@{-->}[rru] & \Spec(\mathcal{O}_{S, s}) \ar[r] & S } $$ and by condition (2) we get the dotted arrow. The image $x$ of the closed point of $\Spec(A)$ in $X$ will be a solution to our problem, i.e., $x$ is a specialization of $x'$ and maps to $s$.
Recall that if $V \subset X$ is affine open and maps into $U \subset S$ affine open, then $V \times_U V$ is affine open in $X \times_S X$, see Lemmas \ref{lemma-fibre-product-affines} and \ref{lemma-open-fibre-product}. Consider the open subscheme $W$ of $X \times_S X$ which is the union of these affine opens $V \times_U V$. By Lemma \ref{lemma-closed-local-target} it is enough to show that each morphism $\Delta_{X/S}^{-1}(V \times_U V) \to V \times_U V$ is a closed immersion. Since $V = \Delta_{X/S}^{-1}(V \times_U V)$ we are just checking that $\Delta_{V/U}$ is a closed immersion, which is Lemma \ref{lemma-diagonal-affines-closed}.
The equalizer of $(a, b)$ is for categorical reasons the fibre product $Z$ in the following diagram $$ \xymatrix{ Z = Y \times_{(Y \times_S Y)} X \ar[r] \ar[d] &  X \ar[d]^{(a , b)} \\ Y \ar[r]^-{\Delta_{Y/S}} & Y \times_S Y } $$ Thus the lemma follows from Lemmas \ref{lemma-base-change-immersion}, \ref{lemma-diagonal-immersion} and Definition \ref{definition-separated}.
Let us prove that (3) implies (1). By Lemma \ref{lemma-affine-covering-fibre-product} the covering $X \times_S X = \bigcup_i \bigcup_{j, j'} V_j \times_{U_i} V_{j'}$ is an affine open covering of $X \times_S X$. Moreover, $\Delta_{X/S}^{-1}(V_j \times_{U_i} V_{j'}) = V_j \cap V_{j'}$. Hence the implication follows from Lemma \ref{lemma-quasi-compact-affine}. \medskip\noindent The implication (1) $\Rightarrow$ (2) follows from the fact that under the hypotheses of (2) the fibre product $U \times_S V$ is an affine open of $X \times_S X$. The implication (2) $\Rightarrow$ (3) is trivial.
Assume $f$ separated. Suppose $(U, V)$ is a pair as in (1). Let $W = \Spec(R)$ be an affine open of $S$ containing both $f(U)$ and $f(V)$. Write $U = \Spec(A)$ and $V = \Spec(B)$ for $R$-algebras $A$ and $B$. By Lemma \ref{lemma-open-fibre-product} we see that $U \times_S V = U \times_W V = \Spec(A \otimes_R B)$ is an affine open of $X \times_S X$. Hence, by Lemma \ref{lemma-closed-subspace-scheme} we see that $\Delta^{-1}(U \times_S V) \to U \times_S V$ can be identified with $\Spec(A \otimes_R B/J)$ for some ideal $J \subset A \otimes_R B$. Thus $U \cap V = \Delta^{-1}(U \times_S V)$ is affine. Assertion (1)(b) holds because $A \otimes_{\mathbf{Z}} B \to (A \otimes_R B)/J$ is surjective. \medskip\noindent Assume the hypothesis formulated in (2) holds. Clearly the collection of affine opens $U \times_S V$ for pairs $(U, V)$ as in (2) form an affine open covering of $X \times_S X$ (see e.g.\ Lemma \ref{lemma-affine-covering-fibre-product}). Hence it suffices to show that each morphism $U \cap V = \Delta_{X/S}^{-1}(U \times_S V) \to U \times_S V$ is a closed immersion, see Lemma \ref{lemma-closed-local-target}. By assumption (a) we have $U \cap V = \Spec(C)$ for some ring $C$. After choosing an affine open $W = \Spec(R)$ of $S$ into which both $U$ and $V$ map and writing $U = \Spec(A)$, $V = \Spec(B)$ we see that the assumption (b) means that the composition $$ A \otimes_{\mathbf{Z}} B \to A \otimes_R B \to C $$ is surjective. Hence $A \otimes_R B \to C$ is surjective and we conclude that $\Spec(C) \to \Spec(A \otimes_R B)$ is a closed immersion.
By general category theory the following diagram $$ \xymatrix{ X \times_T Y \ar[r] \ar[d] & X \times_S Y \ar[d] \\ T \ar[r]^{\Delta_{T/S}} \ar[r] & T \times_S T } $$ is a fibre product diagram. The lemma follows from Lemmas \ref{lemma-diagonal-immersion}, \ref{lemma-fibre-product-immersion} and \ref{lemma-quasi-compact-preserved-base-change}.
Let $X \to Y \to Z$ be morphisms. Assume that $X \to Y$ and $Y \to Z$ are separated. The composition $$ X \to X \times_Y X \to X \times_Z X $$ is closed because the first one is by assumption and the second one by Lemma \ref{lemma-fibre-product-after-map}. The same argument works for ``quasi-separated'' (with the same references). \medskip\noindent Let $f : X \to Y$ be a morphism of schemes over a base $S$. Let $S' \to S$ be a morphism of schemes. Let $f' : X_{S'} \to Y_{S'}$ be the base change of $f$. Then the diagonal morphism of $f'$ is a morphism $$ \Delta_{f'} : X_{S'} = S' \times_S X \longrightarrow X_{S'} \times_{Y_{S'}} X_{S'} = S' \times _S (X \times_Y X) $$ which is easily seen to be the base change of $\Delta_f$. Thus (3) and (4) follow from the fact that closed immersions and quasi-compact morphisms are preserved under arbitrary base change (Lemmas \ref{lemma-fibre-product-immersion} and \ref{lemma-quasi-compact-preserved-base-change}). \medskip\noindent If $f : X \to Y$ and $g : U \to V$ are morphisms of schemes over a base $S$, then $f \times g$ is the composition of $X \times_S U \to X \times_S V$ (a base change of $g$) and $X \times_S V \to Y \times_S V$ (a base change of $f$). Hence (5) and (6) follow from (1) -- (4).
Assume that $g \circ f$ is separated. Consider the factorization $X \to X \times_Y X \to X \times_Z X$ of the diagonal morphism of $g \circ f$. By Lemma \ref{lemma-fibre-product-after-map} the last morphism is an immersion. By assumption the image of $X$ in $X \times_Z X$ is closed. Hence it is also closed in $X \times_Y X$. Thus we see that $X \to X \times_Y X$ is a closed immersion by Lemma \ref{lemma-immersion-when-closed}. \medskip\noindent Assume that $g \circ f$ is quasi-separated. Let $V \subset Y$ be an affine open which maps into an affine open of $Z$. Let $U_1, U_2 \subset X$ be affine opens which map into $V$. Then $U_1 \cap U_2$ is a finite union of affine opens because $U_1, U_2$ map into a common affine open of $Z$. Since we may cover $Y$ by affine opens like $V$ we deduce the lemma from Lemma \ref{lemma-characterize-quasi-separated}.
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-separated-permanence}). The second map is quasi-compact as it is the base change of $g \circ f$, see Lemma \ref{lemma-quasi-compact-preserved-base-change}. And compositions of quasi-compact morphisms are quasi-compact, see Lemma \ref{lemma-composition-quasi-compact}.
Let $U = \Spec(A)$ be an affine scheme. Then $U \to \Spec(\mathbf{Z})$ has closed diagonal by Lemma \ref{lemma-diagonal-affines-closed}. Thus $U$ is separated by Definition \ref{definition-separated}. If $U \to X$ is a morphism of schemes, then we can apply Lemma \ref{lemma-compose-after-separated} to the morphisms $U \to X \to \Spec(\mathbf{Z})$ to conclude that $U \to X$ is separated.
Let a diagram as in Definition \ref{definition-valuative-criterion} be given. Suppose there are two morphisms $a, b : \Spec(A) \to X$ fitting into the diagram. Let $Z \subset \Spec(A)$ be the equalizer of $a$ and $b$. By Lemma \ref{lemma-where-are-they-equal} 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.
By assumption (1), Proposition \ref{proposition-characterize-universally-closed}, and Lemmas \ref{lemma-diagonal-immersion} and \ref{lemma-immersion-when-closed} we see that it suffices to prove the morphism $\Delta_{X/S} : X \to X \times_S 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_S X } $$ be given. The lower right arrow corresponds to a pair of morphisms $a, b : \Spec(A) \to X$ over $S$. By (2) we see that $a = b$. Hence using $a$ as the dotted arrow works.
Let $z$ be a point of $X \times_Y X$. Then $x = \text{pr}_1(z)$ and $\text{pr}_2(z)$ are the same because $j$ maps these points to the same point $y$ of $Y$. Then we can choose an affine open neighbourhood $V \subset Y$ of $y$ and an affine open neighbourhood $U \subset X$ of $x$ with $j(U) \subset V$. Then $z \in U \times_V U \subset X \times_Y X$. Hence $X \times_Y X$ is the union of the affine opens $U \times_V U$. Since $\Delta_{X/Y}^{-1}(U \times_V U) = U$ and since $U \to U \times_V U$ is a closed immersion, we conclude that $\Delta_{X/Y}$ is a closed immersion (see argument in the proof of Lemma \ref{lemma-diagonal-immersion}).
We can see this by checking that the criterion of Lemma \ref{lemma-injective-points-surjective-stalks} applies. More elegantly perhaps, we can use that Lemmas \ref{lemma-restrict-map-to-opens} and \ref{lemma-characterize-closed-subspace} imply that open and closed immersions are monomorphisms and hence any immersion (which is a composition of such) is a monomorphism.
First reduce to the case $n = 1$ (or $\# I = 1$) by taking the inverse images of the open and closed subschemes $\Spec(k_i)$. In this case $X$ has only one point hence is affine. The corresponding algebra problem is this: If $k \to R$ is an algebra map with $R \otimes_k R \cong R$, then $R \cong k$ or $R = 0$. This holds for dimension reasons. See also Algebra, Lemma \ref{algebra-lemma-epimorphism-over-field}
The question is local on $S$ and hence we may assume that $S$ is affine. Because $X$ is quasi-compact we may write $X = \bigcup_{i = 1}^n U_i$ with each $U_i$ open affine. Because $f$ is quasi-separated we may write $U_i \cap U_j = \bigcup_{k = 1}^{n_{ij}} U_{ijk}$ for some affine open $U_{ijk}$, see Lemma \ref{lemma-characterize-quasi-separated}. Denote $f_i : U_i \to S$ and $f_{ijk} : U_{ijk} \to S$ the restrictions of $f$. For any open $V$ of $S$ and any sheaf $\mathcal{F}$ on $X$ we have \begin{eqnarray*} f_*\mathcal{F}(V) & = & \mathcal{F}(f^{-1}V) \\ & = & \Ker\left( \bigoplus\nolimits_i \mathcal{F}(f^{-1}V \cap U_i) \to \bigoplus\nolimits_{i, j, k} \mathcal{F}(f^{-1}V \cap U_{ijk})\right) \\ & = & \Ker\left( \bigoplus\nolimits_i f_{i, *}(\mathcal{F}|_{U_i})(V) \to \bigoplus\nolimits_{i, j, k} f_{ijk, *}(\mathcal{F}|_{U_{ijk}})(V)\right) \\ & = & \Ker\left( \bigoplus\nolimits_i f_{i, *}(\mathcal{F}|_{U_i}) \to \bigoplus\nolimits_{i, j, k} f_{ijk, *}(\mathcal{F}|_{U_{ijk}})\right)(V) \end{eqnarray*} In other words there is an exact sequence of sheaves $$ 0 \to f_*\mathcal{F} \to \bigoplus f_{i, *}\mathcal{F}_i \to \bigoplus f_{ijk, *}\mathcal{F}_{ijk} $$ where $\mathcal{F}_i, \mathcal{F}_{ijk}$ denotes the restriction of $\mathcal{F}$ to the corresponding open. If $\mathcal{F}$ is a quasi-coherent $\mathcal{O}_X$-module then $\mathcal{F}_i$ is a quasi-coherent $\mathcal{O}_{U_i}$-module and $\mathcal{F}_{ijk}$ is a quasi-coherent $\mathcal{O}_{U_{ijk}}$-module. Hence by Lemma \ref{lemma-widetilde-pullback} we see that the second and third term of the exact sequence are quasi-coherent $\mathcal{O}_S$-modules. Thus we conclude that $f_*\mathcal{F}$ is a quasi-coherent $\mathcal{O}_S$-module.
Assume (1) and (2). By (1) the morphism $f$ is quasi-compact (see Topology, Lemma \ref{topology-lemma-closed-in-quasi-compact}). Conditions (1) and (2) imply conditions (1) and (2) of Lemma \ref{lemma-injective-points-surjective-stalks}. Hence $f : X \to Y$ is a monomorphism. In particular, $f$ is separated, see Lemma \ref{lemma-monomorphism-separated}. Hence Lemma \ref{lemma-push-forward-quasi-coherent} above applies and we conclude that $f_*\mathcal{O}_X$ is a quasi-coherent $\mathcal{O}_Y$-module. Therefore the kernel of $\mathcal{O}_Y \to f_*\mathcal{O}_X$ is quasi-coherent by Lemma \ref{lemma-extension-quasi-coherent}. Since a quasi-coherent sheaf is locally generated by sections (see Modules, Definition \ref{modules-definition-quasi-coherent}) this implies that $f$ is a closed immersion, see Definition \ref{definition-closed-immersion-locally-ringed-spaces}.