hcju/stacksqa huggingface dataset:
Since $S$ is reduced it follows that $R$ is reduced. Let $\mathfrak p$ be a prime of $R$. We have to show that $R_{\mathfrak p}$ is a normal domain. Since $S_{\mathfrak p}$ is faithfully over $R_{\mathfrak p}$ too we may assume that $R$ is local with maximal ideal $\mathfrak m$. Let $\mathfrak q$ be a prime of $S$ lying over $\mathfrak m$. Then we see that $R \to S_{\mathfrak q}$ is faithfully flat (Lemma \ref{lemma-local-flat-ff}). Hence we may assume $S$ is local as well. In particular $S$ is a normal domain. Since $R \to S$ is faithfully flat and $S$ is a normal domain we see that $R$ is a domain. Next, suppose that $a/b$ is integral over $R$ with $a, b \in R$. Then $a/b \in S$ as $S$ is normal. Hence $a \in bS$. This means that $a : R \to R/bR$ becomes the zero map after base change to $S$. By faithful flatness we see that $a \in bR$, so $a/b \in R$. Hence $R$ is normal.
We see that $R$ is Noetherian by Lemma \ref{lemma-descent-Noetherian}. Let $\mathfrak p \subset R$ be a prime. Choose a prime $\mathfrak q \subset S$ lying over $\mathfrak p$. Then Lemma \ref{lemma-flat-under-regular} applies to $R_\mathfrak p \to S_\mathfrak q$ and we conclude that $R_\mathfrak p$ is regular. Since $\mathfrak p$ was arbitrary we see $R$ is regular.
We have already seen that (1) and (2) imply that $R$ is Noetherian, see Lemma \ref{lemma-descent-Noetherian}. Let $\mathfrak p \subset R$ be a prime ideal. Choose a prime $\mathfrak q \subset S$ lying over $\mathfrak p$ which corresponds to a minimal prime of the fibre ring $S \otimes_R \kappa(\mathfrak p)$. Then $A = R_{\mathfrak p} \to S_{\mathfrak q} = B$ is a flat local ring homomorphism of Noetherian local rings with $\mathfrak m_AB$ an ideal of definition of $B$. Hence $\dim(A) = \dim(B)$ (Lemma \ref{lemma-dimension-base-fibre-equals-total}) and $\text{depth}(A) = \text{depth}(B)$ (Lemma \ref{lemma-apply-grothendieck}). Hence since $B$ has $(S_k)$ we see that $A$ has $(S_k)$.
We have already seen that (1) and (2) imply that $R$ is Noetherian, see Lemma \ref{lemma-descent-Noetherian}. Let $\mathfrak p \subset R$ be a prime ideal and assume $\dim(R_{\mathfrak p}) \leq k$. Choose a prime $\mathfrak q \subset S$ lying over $\mathfrak p$ which corresponds to a minimal prime of the fibre ring $S \otimes_R \kappa(\mathfrak p)$. Then $A = R_{\mathfrak p} \to S_{\mathfrak q} = B$ is a flat local ring homomorphism of Noetherian local rings with $\mathfrak m_AB$ an ideal of definition of $B$. Hence $\dim(A) = \dim(B)$ (Lemma \ref{lemma-dimension-base-fibre-equals-total}). As $S$ has $(R_k)$ we conclude that $B$ is a regular local ring. By Lemma \ref{lemma-flat-under-regular} we conclude that $A$ is regular.
Recall that a Nagata ring is the same thing as a Noetherian universally Japanese ring (Proposition \ref{proposition-nagata-universally-japanese}). We have already seen that $R$ is Noetherian in Lemma \ref{lemma-descent-Noetherian}. Let $R \to A$ be a finite type ring map into a domain. According to Lemma \ref{lemma-check-universally-japanese} it suffices to check that $A$ is N-1. It is clear that $B = A \otimes_R S$ is a finite type $S$-algebra and hence Nagata (Proposition \ref{proposition-nagata-universally-japanese}). Since $A \to B$ is smooth (Lemma \ref{lemma-base-change-smooth}) we see that $B$ is reduced (Lemma \ref{lemma-reduced-goes-up}). Since $B$ is Noetherian it has only a finite number of minimal primes $\mathfrak q_1, \ldots, \mathfrak q_t$ (see Lemma \ref{lemma-Noetherian-irreducible-components}). As $A \to B$ is flat each of these lies over $(0) \subset A$ (by going down, see Lemma \ref{lemma-flat-going-down}) The total ring of fractions $Q(B)$ is the product of the $L_i = \kappa(\mathfrak q_i)$ (Lemmas \ref{lemma-total-ring-fractions-no-embedded-points} and \ref{lemma-minimal-prime-reduced-ring}). Moreover, the integral closure $B'$ of $B$ in $Q(B)$ is the product of the integral closures $B_i'$ of the $B/\mathfrak q_i$ in the factors $L_i$ (compare with Lemma \ref{lemma-characterize-reduced-ring-normal}). Since $B$ is universally Japanese the ring extensions $B/\mathfrak q_i \subset B_i'$ are finite and we conclude that $B' = \prod B_i'$ is finite over $B$. Since $A \to B$ is flat we see that any nonzerodivisor on $A$ maps to a nonzerodivisor on $B$. The corresponding map $$ Q(A) \otimes_A B = (A \setminus \{0\})^{-1}A \otimes_A B = (A \setminus \{0\})^{-1}B \to Q(B) $$ is injective (we used Lemma \ref{lemma-tensor-localization}). Via this map $A'$ maps into $B'$. This induces a map $$ A' \otimes_A B \longrightarrow B' $$ which is injective (by the above and the flatness of $A \to B$). Since $B'$ is a finite $B$-module and $B$ is Noetherian we see that $A' \otimes_A B$ is a finite $B$-module. Hence there exist finitely many elements $x_i \in A'$ such that the elements $x_i \otimes 1$ generate $A' \otimes_A B$ as a $B$-module. Finally, by faithful flatness of $A \to B$ we conclude that the $x_i$ also generated $A'$ as an $A$-module, and we win.
It is clear that (1) $\Rightarrow$ (2) $\Rightarrow$ (3) and (1) $\Rightarrow$ (4). \medskip\noindent If $k'/k$ is a finite purely inseparable extension, then there is an embedding $k' \to k^{perf}$ of $k$-extensions. The ring map $k' \otimes_k A \to k^{perf} \otimes_k A$ is faithfully flat, hence $k' \otimes_k A$ is normal if $k^{perf} \otimes_k A$ is normal by Lemma \ref{lemma-descent-normal}. In this way we see that (4) $\Rightarrow$ (3). \medskip\noindent Assume (2) and let $k \subset k'$ be any field extension. Then we can write $k' = \colim_i k_i$ as a directed colimit of finitely generated field extensions. Hence we see that $k' \otimes_k A = \colim_i k_i \otimes_k A$ is a directed colimit of normal rings. Thus we see that $k' \otimes_k A$ is a normal ring by Lemma \ref{lemma-colimit-normal-ring}. Hence (1) holds. \medskip\noindent Assume (3) and let $k \subset K$ be a finitely generated field extension. By Lemma \ref{lemma-make-separable} we can find a diagram $$ \xymatrix{ K \ar[r] & K' \\ k \ar[u] \ar[r] & k' \ar[u] } $$ where $k \subset k'$, $K \subset K'$ are finite purely inseparable field extensions such that $k' \subset K'$ is separable. By Lemma \ref{lemma-localization-smooth-separable} there exists a smooth $k'$-algebra $B$ such that $K'$ is the fraction field of $B$. Now we can argue as follows: Step 1: $k' \otimes_k A$ is a normal ring because we assumed (3). Step 2: $B \otimes_{k'} k' \otimes_k A$ is a normal ring as $k' \otimes_k A \to B \otimes_{k'} k' \otimes_k A$ is smooth (Lemma \ref{lemma-base-change-smooth}) and ascent of normality along smooth maps (Lemma \ref{lemma-normal-goes-up}). Step 3. $K' \otimes_{k'} k' \otimes_k A = K' \otimes_k A$ is a normal ring as it is a localization of a normal ring (Lemma \ref{lemma-localization-normal-ring}). Step 4. Finally $K \otimes_k A$ is a normal ring by descent of normality along the faithfully flat ring map $K \otimes_k A \to K' \otimes_k A$ (Lemma \ref{lemma-descent-normal}). This proves the lemma.
Let $\mathfrak r$ be a prime ideal of $A \otimes_k B$. Denote $\mathfrak p$, resp.\ $\mathfrak q$ the corresponding prime of $A$, resp.\ $B$. Then $(A \otimes_k B)_{\mathfrak r}$ is a localization of $A_{\mathfrak p} \otimes_k B_{\mathfrak q}$. Hence it suffices to prove the result for the ring $A_{\mathfrak p} \otimes_k B_{\mathfrak q}$, see Lemma \ref{lemma-localization-normal-ring} and Lemma \ref{lemma-localization-geometrically-normal-algebra}. Thus we may assume $A$ and $B$ are domains. \medskip\noindent Assume that $A$ and $B$ are domains with fractions fields $K$ and $L$. Note that $B$ is the filtered colimit of its finite type normal $k$-sub algebras (as $k$ is a Nagata ring, see Proposition \ref{proposition-ubiquity-nagata}, and hence the integral closure of a finite type $k$-sub algebra is still a finite type $k$-sub algebra by Proposition \ref{proposition-nagata-universally-japanese}). By Lemma \ref{lemma-colimit-normal-ring} we reduce to the case that $B$ is of finite type over $k$. \medskip\noindent Assume that $A$ and $B$ are domains with fractions fields $K$ and $L$ and $B$ of finite type over $k$. In this case the ring $K \otimes_k B$ is of finite type over $K$, hence Noetherian (Lemma \ref{lemma-Noetherian-permanence}). In particular $K \otimes_k B$ has finitely many minimal primes (Lemma \ref{lemma-Noetherian-irreducible-components}). Since $A \to A \otimes_k B$ is flat, this implies that $A \otimes_k B$ has finitely many minimal primes (by going down for flat ring maps -- Lemma \ref{lemma-flat-going-down} -- these primes all lie over $(0) \subset A$). Thus it suffices to prove that $A \otimes_k B$ is integrally closed in its total ring of fractions (Lemma \ref{lemma-characterize-reduced-ring-normal}). \medskip\noindent We claim that $K \otimes_k B$ and $A \otimes_k L$ are both normal rings. If this is true then any element $x$ of $Q(A \otimes_k B)$ which is integral over $A \otimes_k B$ is (by Lemma \ref{lemma-normal-ring-integrally-closed}) contained in $K \otimes_k B \cap A \otimes_k L = A \otimes_k B$ and we're done. Since $A \otimes_K L$ is a normal ring by assumption, it suffices to prove that $K \otimes_k B$ is normal. \medskip\noindent As $A$ is geometrically normal over $k$ we see $K$ is geometrically normal over $k$ (Lemma \ref{lemma-localization-geometrically-normal-algebra}) hence $K$ is geometrically reduced over $k$. Hence $K = \bigcup K_i$ is the union of finitely generated field extensions of $k$ which are geometrically reduced (Lemma \ref{lemma-subalgebra-separable}). Each $K_i$ is the localization of a smooth $k$-algebra (Lemma \ref{lemma-localization-smooth-separable}). So $K_i \otimes_k B$ is the localization of a smooth $B$-algebra hence normal (Lemma \ref{lemma-normal-goes-up}). Thus $K \otimes_k B$ is a normal ring (Lemma \ref{lemma-colimit-normal-ring}) and we win.
Let $k \subset L$ be a finite purely inseparable field extension. Then $L' = k' \otimes_k L$ is a field (see material in Fields, Section \ref{fields-section-algebraic}) and $A \otimes_k L = A \otimes_{k'} L'$. Hence if $A$ is geometrically normal over $k'$, then $A$ is geometrically normal over $k$. \medskip\noindent Assume $A$ is geometrically normal over $k$. Let $K/k'$ be a field extension. Then $$ K \otimes_{k'} A = (K \otimes_k A) \otimes_{(k' \otimes_k k')} k' $$ Since $k' \otimes_k k' \to k'$ is a localization by Lemma \ref{lemma-separable-algebraic-diagonal}, we see that $K \otimes_{k'} A$ is a localization of a normal ring, hence normal.
The lemma makes sense by the remarks preceding the lemma. It is clear that (1) $\Rightarrow$ (2). \medskip\noindent Assume (2) and let $k \subset K$ be a finitely generated field extension. By Lemma \ref{lemma-make-separable} we can find a diagram $$ \xymatrix{ K \ar[r] & K' \\ k \ar[u] \ar[r] & k' \ar[u] } $$ where $k \subset k'$, $K \subset K'$ are finite purely inseparable field extensions such that $k' \subset K'$ is separable. By Lemma \ref{lemma-localization-smooth-separable} there exists a smooth $k'$-algebra $B$ such that $K'$ is the fraction field of $B$. Now we can argue as follows: Step 1: $k' \otimes_k A$ is a regular ring because we assumed (2). Step 2: $B \otimes_{k'} k' \otimes_k A$ is a regular ring as $k' \otimes_k A \to B \otimes_{k'} k' \otimes_k A$ is smooth (Lemma \ref{lemma-base-change-smooth}) and ascent of regularity along smooth maps (Lemma \ref{lemma-regular-goes-up}). Step 3. $K' \otimes_{k'} k' \otimes_k A = K' \otimes_k A$ is a regular ring as it is a localization of a regular ring (immediate from the definition). Step 4. Finally $K \otimes_k A$ is a regular ring by descent of regularity along the faithfully flat ring map $K \otimes_k A \to K' \otimes_k A$ (Lemma \ref{lemma-descent-regular}). This proves the lemma.
Assume $B$ is geometrically regular over $k$. Let $k \subset k'$ be a finite, purely inseparable extension. Then $A \otimes_k k' \to B \otimes_k k'$ is faithfully flat as a base change of $A \to B$ (by Lemmas \ref{lemma-surjective-spec-radical-ideal} and \ref{lemma-flat-base-change}) and $B \otimes_k k'$ is regular by our assumption on $B$ over $k$. Then $A \otimes_k k'$ is regular by Lemma \ref{lemma-descent-regular}.
Let $k \subset k'$ be a finitely generated field extension. Then $A \otimes_k k' \to B \otimes_k k'$ is a smooth ring map (Lemma \ref{lemma-base-change-smooth}) and $A \otimes_k k'$ is regular. Hence $B \otimes_k k'$ is regular by Lemma \ref{lemma-regular-goes-up}.
Let $k \subset L$ be a finite purely inseparable field extension. Then $L' = k' \otimes_k L$ is a field (see material in Fields, Section \ref{fields-section-algebraic}) and $A \otimes_k L = A \otimes_{k'} L'$. Hence if $A$ is geometrically regular over $k'$, then $A$ is geometrically regular over $k$. \medskip\noindent Assume $A$ is geometrically regular over $k$. Since $k'$ is the filtered colimit of finite extensions of $k$ we may assume by Lemma \ref{lemma-geometrically-regular-over-subfields} that $k'/k$ is finite separable. Consider the ring maps $$ k' \to A \otimes_k k' \to A. $$ Note that $A \otimes_k k'$ is geometrically regular over $k'$ as a base change of $A$ to $k'$. Note that $A \otimes_k k' \to A$ is the base change of $k' \otimes_k k' \to k'$ by the map $k' \to A$. Since $k'/k$ is an \'etale extension of rings, we see that $k' \otimes_k k' \to k'$ is \'etale (Lemma \ref{lemma-etale}). Hence $A$ is geometrically regular over $k'$ by Lemma \ref{lemma-geometrically-regular-goes-up}.
The ring $K \otimes_k L$ is Noetherian by Lemma \ref{lemma-Noetherian-field-extension}. Say $K$ is a finite extension of the purely transcendental extension $k(t_1, \ldots, t_r)$. Then $k(t_1, \ldots, t_r) \otimes_k L \to K \otimes_k L$ is a finite free ring map. By Lemma \ref{lemma-finite-flat-over-regular-CM} it suffices to show that $k(t_1, \ldots, t_r) \otimes_k L$ is Cohen-Macaulay. This is clear because it is a localization of the polynomial ring $L[t_1, \ldots, t_r]$. (See for example Lemma \ref{lemma-CM-polynomial-algebra} for the fact that a polynomial ring is Cohen-Macaulay.)
By Lemma \ref{lemma-Noetherian-field-extension} the ring $S_K$ is Noetherian. Hence $S_{\mathfrak q} \to (S_K)_{\mathfrak q_K}$ is a flat local homomorphism of Noetherian local rings. Note that the fibre $$ (S_K)_{\mathfrak q_K} / \mathfrak q (S_K)_{\mathfrak q_K} \cong (\kappa(\mathfrak q) \otimes_k K)_{\mathfrak q'} $$ is the localization of the Cohen-Macaulay (Lemma \ref{lemma-tensor-fields-CM}) ring $\kappa(\mathfrak q) \otimes_k K$ at a suitable prime ideal $\mathfrak q'$. Hence the lemma follows from Lemma \ref{lemma-CM-goes-up}.
We first prove the lemma with $R$ replaced $\mathbf{Z}$. By Lemma \ref{lemma-flat-finite-presentation-limit-flat} there exists a diagram $$ \xymatrix{ A_0 \ar[r] & A \\ B_0 \ar[u] \ar[r] & B \ar[u] } $$ where $A_0$ is of finite type over $\mathbf{Z}$, $B_0$ is flat of finite presentation over $A_0$ such that $B = A \otimes_{A_0} B_0$. As $A_0 \to B_0$ is flat of finite presentation we see that the image of $\Spec(B_0) \to \Spec(A_0)$ is open, see Proposition \ref{proposition-fppf-open}. Hence the complement of the image is $V(I_0)$ for some ideal $I_0 \subset A_0$. As $A \to B$ is faithfully flat the map $\Spec(B) \to \Spec(A)$ is surjective, see Lemma \ref{lemma-ff-rings}. Now we use that the base change of the image is the image of the base change. Hence $I_0A = A$. Pick a relation $\sum f_i r_i = 1$, with $r_i \in A$, $f_i \in I_0$. Then after enlarging $A_0$ to contain the elements $r_i$ (and correspondingly enlarging $B_0$) we see that $A_0 \to B_0$ is surjective on spectra also, i.e., faithfully flat. \medskip\noindent Thus the lemma holds in case $R = \mathbf{Z}$. In the general case, take the solution $A_0' \to B_0'$ just obtained and set $A_0 = A_0' \otimes_{\mathbf{Z}} R$, $B_0 = B_0' \otimes_{\mathbf{Z}} R$.
Set $B_i = A_i \otimes_{A_0} B_0$, $C_i = A_i \otimes_{A_0} C_0$, $B = A \otimes_{A_0} B_0$, and $C = A \otimes_{A_0} C_0$. Let $x_1, \ldots, x_m$ be generators for $C_0$ over $B_0$. Then $\text{d}x_1, \ldots, \text{d}x_m$ generate $\Omega_{C_0/B_0}$ over $C_0$ and their images generate $\Omega_{C_i/B_i}$ over $C_i$ (Lemmas \ref{lemma-differentials-polynomial-ring} and \ref{lemma-differential-seq}). Observe that $0 = \Omega_{C/B} = \colim \Omega_{C_i/B_i}$ (Lemma \ref{lemma-colimit-differentials}). Thus there is an $i$ such that $\text{d}x_1, \ldots, \text{d}x_m$ map to zero and hence $\Omega_{C_i/B_i} = 0$ as desired.
By Lemma \ref{lemma-colimit-surjective} there exists an $i$ such that $A_i \otimes_{A_0} B_0 \to A_i \otimes_{A_0} C_0$ is surjective. Since the map is of finite presentation the kernel is a finitely generated ideal. Let $g_1, \ldots, g_r \in A_i \otimes_{A_0} B_0$ generate the kernel. Then we may pick $i' \geq i$ such that $g_j$ map to zero in $A_{i'} \otimes_{A_0} B_0$. Then $A_{i'} \otimes_{A_0} B_0 \to A_{i'} \otimes_{A_0} C_0$ is an isomorphism.
Assume $A \otimes_{A_0} B_0 \to A \otimes_{A_0} C_0$ is a relative global complete intersection. By Lemma \ref{lemma-relative-global-complete-intersection-Noetherian} there exists a finite type $\mathbf{Z}$-algebra $R$, a ring map $R \to A \otimes_{A_0} B_0$, a relative global complete intersection $R \to S$, and an isomorphism $$ (A \otimes_{A_0} B_0) \otimes_R S \longrightarrow A \otimes_{A_0} C_0 $$ Because $R$ is of finite type (and hence finite presentation) over $\mathbf{Z}$, there exists an $i$ and a map $R \to A_i \otimes_{A_0} B_0$ lifting the map $R \to A \otimes_{A_0} B_0$, see Lemma \ref{lemma-characterize-finite-presentation}. Using the same lemma, there exists an $i' \geq i$ such that $(A_i \otimes_{A_0} B_0) \otimes_R S \to A \otimes_{A_0} C_0$ comes from a map $(A_i \otimes_{A_0} B_0) \otimes_R S \to A_{i'} \otimes_{A_0} C_0$. Thus we may assume, after replacing $i$ by $i'$, that the displayed map comes from an $A_i \otimes_{A_0} B_0$-algebra map $$ (A_i \otimes_{A_0} B_0) \otimes_R S \longrightarrow A_i \otimes_{A_0} C_0 $$ By Lemma \ref{lemma-colimit-isomorphism} after increasing $i$ this map is an isomorphism. This finishes the proof in this case because the base change of a relative global complete intersection is a relative global complete intersection by Lemma \ref{lemma-base-change-relative-global-complete-intersection}. \medskip\noindent Assume $A \otimes_{A_0} B_0 \to A \otimes_{A_0} C_0$ is syntomic. Then there exist elements $g_1, \ldots, g_m$ in $A \otimes_{A_0} C_0$ generating the unit ideal such that $A \otimes_{A_0} B_0 \to (A \otimes_{A_0} C_0)_{g_j}$ is a relative global complete intersection, see Lemma \ref{lemma-syntomic}. We can find an $i$ and elements $g_{i, j} \in A_i \otimes_{A_0} C_0$ mapping to $g_j$. After increasing $i$ we may assume $g_{i, 1}, \ldots, g_{i, m}$ generate the unit ideal of $A_i \otimes_{A_0} C_0$. The result of the previous paragraph implies that, after increasing $i$, we may assume the maps $A_i \otimes_{A_0} B_0 \to (A_i \otimes_{A_0} C_0)_{g_{i, j}}$ are relative global complete intersections. Then $A_i \otimes_{A_0} B_0 \to A_i \otimes_{A_0} C_0$ is syntomic by Lemma \ref{lemma-local-syntomic} (and the already used Lemma \ref{lemma-syntomic}).
Let $\mathfrak m' \subset S$ be a maximal ideal and $R \cap \mathfrak m' = \mathfrak m$. Then $R/\mathfrak m \to S/\mathfrak m'$ satisfies the conditions of Lemma \ref{lemma-silly-jacobson} by Lemma \ref{lemma-Jacobson-mod-ideal}. Hence $R/\mathfrak m$ is a field and $\mathfrak m$ a maximal ideal and the induced residue field extension is finite. This proves (2) and (3).   \medskip\noindent If $S$ is not Jacobson, then by Lemma \ref{lemma-characterize-jacobson} there exists a non-maximal prime ideal $\mathfrak q$ of $S$ and an $g \in S$, $g \not\in \mathfrak q$ such that $(S/\mathfrak q)_g$ is a field. To arrive at a contradiction we show that $\mathfrak q$ is a maximal ideal. Let $\mathfrak p = \mathfrak q \cap R$. Then $R/\mathfrak p \to (S/\mathfrak q)_g$ satisfies the conditions of Lemma \ref{lemma-silly-jacobson} by Lemma \ref{lemma-Jacobson-mod-ideal}. Hence $R/\mathfrak p$ is a field and the field extension $\kappa(\mathfrak p) \to (S/\mathfrak q)_g = \kappa(\mathfrak q)$ is finite, thus algebraic. Then $\mathfrak q$ is a maximal ideal of $S$ by Lemma \ref{lemma-finite-residue-extension-closed}. Contradiction.
Let $\mathfrak p$, $\mathfrak p'$ and $\mathfrak q'$ be as in the statement. We have to show there is a prime $\mathfrak q$, with $\mathfrak q \subset \mathfrak q'$ and $R \cap \mathfrak q = \mathfrak p$. This is the same as finding a prime of $S_{\mathfrak q'}$ mapping to $\mathfrak p$. According to Lemma \ref{lemma-in-image} we have to show that $\mathfrak p S_{\mathfrak q'} \cap R = \mathfrak p$. Pick $z \in \mathfrak p S_{\mathfrak q'} \cap R$. We may write $z = y/g$ with $y \in \mathfrak pS$ and $g \in S$, $g \not\in \mathfrak q'$. Written differently we have $zg = y$. \medskip\noindent By Lemma \ref{lemma-integral-integral-over-ideal} there exists a monic polynomial $P = x^m + b_{m-1} x^{m-1} + \ldots + b_0$ with $b_i \in \mathfrak p$ such that $P(y) = 0$. \medskip\noindent By Lemma \ref{lemma-minimal-polynomial-normal-domain} the minimal polynomial of $g$ over $K$ has coefficients in $R$. Write it as $Q = x^n + a_{n-1} x^{n-1} + \ldots + a_0$. Note that not all $a_i$, $i = n-1, \ldots, 0$ are in $\mathfrak p$ since that would imply $g^n = \sum_{j < n} a_j g^j \in \mathfrak pS \subset \mathfrak p'S \subset \mathfrak q'$ which is a contradiction. \medskip\noindent Since $y = zg$ we see immediately from the above that $Q' = x^n + za_{n-1} x^{n-1} + \ldots + z^{n}a_0$ is the minimal polynomial for $y$. Hence $Q'$ divides $P$ and by Lemma \ref{lemma-polynomials-divide} we see that $z^ja_{n - j} \in \sqrt{(b_0, \ldots, b_{m-1})} \subset \mathfrak p$, $j =  1, \ldots, n$. Because not all $a_i$, $i = n-1, \ldots, 0$ are in $\mathfrak p$ we conclude $z \in \mathfrak p$ as desired.
Assume that $R \to S$ has finite presentation and satisfies going down. It suffices to prove that the image of a standard open $D(f)$ is open. Since $S \to S_f$ satisfies going down as well, we see that $R \to S_f$ satisfies going down. Thus after replacing $S$ by $S_f$ we see it suffices to prove the image is open. By Chevalley's theorem (Theorem \ref{theorem-chevalley}) the image is a constructible set $E$. And $E$ is stable under generalization because $R \to S$ satisfies going down, see Topology, Lemmas \ref{topology-lemma-open-closed-specialization} and \ref{topology-lemma-lift-specializations-images}. Hence $E$ is open by Lemma \ref{lemma-constructible-stable-specialization-closed}.
We prove this by induction on the minimal number of generators of $S_1$. If this number is $0$, then $M_n = 0$ for all $n \gg 0$ and the result holds. To prove the induction step, let $x\in S_1$ be one of a minimal set of generators, such that the induction hypothesis applies to the graded ring $S/(x)$. \medskip\noindent First we show the result holds if $x$ is nilpotent on $M$. This we do by induction on the minimal integer $r$ such that $x^r M  = 0$. If $r = 1$, then $M$ is a module over $S/xS$ and the result holds (by the other induction hypothesis). If $r > 1$, then we can find a short exact sequence $0 \to M' \to M \to M'' \to 0$ such that the integers $r', r''$ are strictly smaller than $r$. Thus we know the result for $M''$ and $M'$. Hence we get the result for $M$ because of the relation $ [M_d]  = [M'_d] + [M''_d] $ in $K'_0(S_0)$. \medskip\noindent If $x$ is not nilpotent on $M$, let $M' \subset M$ be the largest submodule on which $x$ is nilpotent. Consider the exact sequence $0 \to M' \to M \to M/M' \to 0$ we see again it suffices to prove the result for $M/M'$. In other words we may assume that multiplication by $x$ is injective. \medskip\noindent Let $\overline{M} = M/xM$. Note that the map $x : M \to M$ is {\it not} a map of graded $S$-modules, since it does not map $M_d$ into $M_d$. Namely, for each $d$ we have the following short exact sequence $$ 0 \to M_d \xrightarrow{x} M_{d + 1} \to \overline{M}_{d + 1} \to 0 $$ This proves that $[M_{d + 1}] - [M_d] = [\overline{M}_{d + 1}]$. Hence we win by Lemma \ref{lemma-numerical-polynomial}.