hcju/stacksqa huggingface dataset:
Since $K/k$ is a finitely generated field extension, there exists a finitely generated $k$-algebra $B \subset K$ such that $K$ is the fraction field of $B$. In other words, $K = S^{-1}B$ with $S = B \setminus \{0\}$. Then $K \otimes_k R = S^{-1}(B \otimes_k R)$. Then $B \otimes_k R$ is Noetherian by Lemma \ref{lemma-Noetherian-base-change-finite-type}. Finally, $K \otimes_k R = S^{-1}(B \otimes_k R)$ is Noetherian by Lemma \ref{lemma-Noetherian-permanence}.
If $R$ is a domain, then $R \subset R_\mathfrak p$, hence $f = 1$ works. If $R$ is Noetherian, then the kernel $I$ of $R \to R_\mathfrak p$ is a finitely generated ideal and we can find $f \in R$, $f \not \in \mathfrak p$ such that $IR_f = 0$. For this $f$ the map $R_f \to R_\mathfrak p$ is injective and $f$ works. If $R$ is reduced with finitely many minimal primes $\mathfrak p_1, \ldots, \mathfrak p_n$, then we can choose $f \in \bigcap_{\mathfrak p_i \not \subset \mathfrak p} \mathfrak p_i$, $f \not \in \mathfrak p$. Indeed, if $\mathfrak{p}_i\not\subset \mathfrak{p}$ then there exist $f_i \in \mathfrak{p}_i$, $f_i \not\in \mathfrak{p}$ and $f = \prod f_i$ works. For this $f$ we have $R_f \subset R_\mathfrak p$ because the minimal primes of $R_f$ correspond to minimal primes of $R_\mathfrak p$ and we can apply Lemma \ref{lemma-reduced-ring-sub-product-fields} (some details omitted).
Let $a \in R$ be a unit whose image in $R/I$ is the same as the image of $b^n$ with $b \in R$. Then $b$ is a unit (Lemma \ref{lemma-locally-nilpotent-unit}) and $ab^{-n} = 1 + x$ for some $x \in I$. Hence $ab^{-n} = c^n$ by part (1). Thus (2) follows from (1). \medskip\noindent Proof of (1). This is true because there is an inverse to the map $1 + x \mapsto (1 + x)^n$. Namely, we can consider the map which sends $1 + x$ to \begin{align*} (1 + x)^{1/n} & = 1 + {1/n \choose 1}x + {1/n \choose 2}x^2 + {1/n \choose 3}x^3 + \ldots \\ & = 1 + \frac{1}{n} x + \frac{1 - n}{2n^2}x^2 + \frac{(1 - n)(1 - 2n)}{6n^3}x^3 + \ldots \end{align*} as in elementary calculus. This makes sense because the series is finite as $x^k = 0$ for all $k \gg 0$ and each coefficient ${1/n \choose k} \in \mathbf{Z}[1/n]$ (details omitted; observe that $n$ is invertible in $R$ by Lemma \ref{lemma-locally-nilpotent-unit}).
Let $I = \Ker(R \to S^{-1}R)$ so that $V(I)$ contains the image. Say the image is the closed subset $V(I') \subset \Spec(R)$ for some ideal $I' \subset R$. So $V(I') \subset V(I)$. For $f \in I'$ we see that $f/1 \in S^{-1}R$ is contained in every prime ideal. Hence $f^n$ maps to zero in $S^{-1}R$ for some $n \geq 1$ (Lemma \ref{lemma-Zariski-topology}). Hence $V(I') = V(I)$. Then this implies every $g \in S$ is invertible mod $I$. Hence we get ring maps $R/I \to S^{-1}R$ and $S^{-1}R \to R/I$. The first map is injective by choice of $I$. The second is the map $S^{-1}R \to S^{-1}(R/I) = R/I$ which has kernel $S^{-1}I$ because localization is exact. Since $S^{-1}I = 0$ we see also the second map is injective. Hence $S^{-1}R \cong R/I$.
By Lemma \ref{lemma-invert-closed-quotient} we have $S^{-1}R \cong R/I$ for some ideal $I \subset R$. By Lemma \ref{lemma-disjoint-implies-product} it suffices to show that $V(I)$ is open. If $R$ is Noetherian then $\Spec(R)$ is a Noetherian topological space, see Lemma \ref{lemma-Noetherian-topology}. If $\Spec(R)$ is a Noetherian topological space, then the complement $\Spec(R) \setminus V(I)$ is quasi-compact, see Topology, Lemma \ref{topology-lemma-Noetherian-quasi-compact}. Hence there exist finitely many $f_1, \ldots, f_n \in I$ such that $V(I) = V(f_1, \ldots, f_n)$. Since each $f_i$ maps to zero in $S^{-1}R$ there exists a $g \in S$ such that $gf_i = 0$ for $i = 1, \ldots, n$. Hence $D(g) = V(I)$ as desired. In case $S$ is finitely generated as a monoid, say $S$ is generated by $g_1, \ldots, g_m$, then $S^{-1}R \cong R_{g_1 \ldots g_m}$ and we conclude that $V(I) = D(g_1 \ldots g_m)$.
By Lemma \ref{lemma-characterize-image-finite-type} there exist a nonempty open $U \subset \Spec(R)$ contained in the image $\{(0)\}$ of $\Spec(K) \to \Spec(R)$. Choose $f \in R$, $f \not = 0$ such that $D(f) \subset U$, i.e., $D(f) = \{(0)\}$. Then $R_f$ is a domain whose spectrum has exactly one point and $R_f$ is a field. Then $K$ is a finitely generated algebra over the field $R_f$ and hence a finite field extension of $R_f$ by the Hilbert Nullstellensatz (Theorem \ref{theorem-nullstellensatz}).
Suppose $R$ is Jacobson. Let $Z \subset \Spec(R)$ be a closed subset. We have to show that the set of closed points in $Z$ is dense in $Z$. Let $U \subset \Spec(R)$ be an open such that $U \cap Z$ is nonempty. We have to show $Z \cap U$ contains a closed point of $\Spec(R)$. We may assume $U = D(f)$ as standard opens form a basis for the topology on $\Spec(R)$. According to Lemma \ref{lemma-Zariski-topology} we may assume that $Z = V(I)$, where $I$ is a radical ideal. We see also that $f \not \in I$. By assumption, there exists a maximal ideal $\mathfrak m \subset R$ such that $I \subset \mathfrak m$ but $f \not\in \mathfrak m$. Hence $\mathfrak m \in D(f) \cap V(I) = U \cap Z$ as desired. \medskip\noindent Conversely, suppose that $\Spec(R)$ is Jacobson. Let $I \subset R$ be a radical ideal. Let $J = \cap_{I \subset \mathfrak m} \mathfrak m$ be the intersection of the maximal ideals containing $I$. Clearly $J$ is a radical ideal, $V(J) \subset V(I)$, and $V(J)$ is the smallest closed subset of $V(I)$ containing all the closed points of $V(I)$. By assumption we see that $V(J) = V(I)$. But Lemma \ref{lemma-Zariski-topology} shows there is a bijection between Zariski closed sets and radical ideals, hence $I = J$ as desired.
Assume $R$ is not Jacobson. By Lemma \ref{lemma-jacobson} this means there exists an closed subset $T \subset \Spec(R)$ whose set $T_0 \subset T$ of closed points is not dense in $T$. Choose an $f \in R$ such that $T_0 \subset V(f)$ but $T \not \subset V(f)$. Note that $T \cap D(f)$ is homeomorphic to $\Spec((R/I)_f)$ if $T = V(I)$, see Lemmas \ref{lemma-spec-closed} and \ref{lemma-standard-open}. As any ring has a maximal ideal (Lemma \ref{lemma-Zariski-topology}) we can choose a closed point $t$ of space $T \cap D(f)$. Then $t$ corresponds to a prime ideal $\mathfrak p \subset R$ which is not maximal (as $t \not \in T_0$). Thus (1) holds. By construction $f \not \in \mathfrak p$, hence (2). As $t$ is a closed point of $T \cap D(f)$ we see that $V(\mathfrak p) \cap D(f) = \{\mathfrak p\}$, i.e., (3) holds. Hence we conclude that $(R/\mathfrak p)_f$ is a domain whose spectrum has one point, hence (4) holds (for example combine Lemmas \ref{lemma-characterize-local-ring} and \ref{lemma-minimal-prime-reduced-ring}). \medskip\noindent Conversely, suppose that $R$ is Jacobson and $(\mathfrak p, f)$ satisfy (1) and (2). If $V(\mathfrak p) \cap D(f) = \{\mathfrak p, \mathfrak q_1, \ldots, \mathfrak q_t\}$ then $\mathfrak p \not = \mathfrak q_i$ implies there exists an element $g \in R$ such that $g \not \in \mathfrak p$ but $g \in \mathfrak q_i$ for all $i$. Hence $V(\mathfrak p) \cap D(fg) = \{\mathfrak p\}$ which is impossible since each locally closed subset of $\Spec(R)$ contains at least one closed point as $\Spec(R)$ is a Jacobson topological space.
Let $R$ satisfy (1), (2), (3) and (4). The statement means that $(0) = \bigcap_{\mathfrak m \subset R} \mathfrak m$. Since $R$ has infinitely many maximal ideals it suffices to show that any nonzero $x \in R$ is contained in at most finitely many maximal ideals, in other words that $V(x)$ is finite. By Lemma \ref{lemma-spec-closed} we see that $V(x)$ is homeomorphic to $\Spec(R/xR)$. By assumption (3) every prime of $R/xR$ is minimal and hence corresponds to an irreducible component of $\Spec(R)$ (Lemma \ref{lemma-irreducible}). As $R/xR$ is Noetherian, the topological space $\Spec(R/xR)$ is Noetherian (Lemma \ref{lemma-Noetherian-topology}) and has finitely many irreducible components (Topology, Lemma \ref{topology-lemma-Noetherian}). Thus $V(x)$ is finite as desired.
Consider the diagram $$ \xymatrix{ S \ar[r] & S/\mathfrak q \ar[r] & \kappa(\mathfrak q) \\ R \ar[r] \ar[u] & R/\mathfrak m \ar[u] } $$ We see that $\kappa(\mathfrak m) \subset S/\mathfrak q \subset \kappa(\mathfrak q)$. Because the field extension $\kappa(\mathfrak m) \subset \kappa(\mathfrak q)$ is algebraic, any ring between $\kappa(\mathfrak m)$ and $\kappa(\mathfrak q)$ is a field (Fields, Lemma \ref{fields-lemma-subalgebra-algebraic-extension-field}). Thus $S/\mathfrak q$ is a field, and a posteriori equal to $\kappa(\mathfrak q)$.
By Topology, Lemma \ref{topology-lemma-jacobson-inherited} we see that $D(f) = \Spec(R_f)$ is Jacobson and that closed points of $D(f)$ correspond to closed points in $\Spec(R)$ which happen to lie in $D(f)$. Thus $R_f$ is Jacobson by Lemma \ref{lemma-jacobson}.
First note that $R$ is a domain. By Lemma \ref{lemma-field-finite-type-over-domain} we see that $R_f$ is a field and $K/R_f$ is a finite field extension for some nonzero $f \in R$. Hence $(0)$ is a maximal ideal of $R_f$ and by Lemma \ref{lemma-Jacobson-invert-element} we conclude $(0)$ is a maximal ideal of $R$.
We have a commutative diagram of continuous maps $$ \xymatrix{ E \ar[r] \ar[d] & Y \ar[d] \\ f(E) \ar[r] & X } $$ Suppose $x \in f(E)$ is closed in $f(E)$. Then $f^{-1}(\{x\})\cap E$ is nonempty and closed in $E$. Applying Topology, Lemma \ref{topology-lemma-jacobson-inherited} to both inclusions $$ f^{-1}(\{x\}) \cap E \subset E \subset Y $$ we find there exists a point $y \in f^{-1}(\{x\}) \cap E$ which is closed in $Y$. In other words, there exists $y \in Y_0$ and $y \in E_0$ mapping to $x$. Hence $x \in f(E_0)$. This proves that $f(E)_0 \subset f(E_0)$. Proposition \ref{proposition-Jacobson-permanence} implies that $f(E_0) \subset X_0 \cap f(E)$. The inclusion $X_0 \cap f(E) \subset f(E)_0$ is trivial. This proves the first assertion. \medskip\noindent Suppose that $\xi \in f(E)$. According to Lemma \ref{lemma-characterize-image-finite-type} the set $f(E) \cap \overline{\{\xi\}}$ contains a dense open subset of $\overline{\{\xi\}}$. Since $X$ is Jacobson we conclude that $f(E) \cap \overline{\{\xi\}}$ contains a dense set of closed points, see Topology, Lemma \ref{topology-lemma-jacobson-inherited}. We conclude by part (1) of the lemma. \medskip\noindent On the other hand, suppose that $\overline{\{\xi\}} \cap f(E_0)$ is dense in $\overline{\{\xi\}}$. By Lemma \ref{lemma-constructible-is-image} there exists a ring map $S \to S'$ of finite presentation such that $E$ is the image of $Y' := \Spec(S') \to Y$. Then $E_0$ is the image of $Y'_0$ by the first part of the lemma applied to the ring map $S \to S'$. Thus we may assume that $E = Y$ by replacing $S$ by $S'$. Suppose $\xi$ corresponds to $\mathfrak p \subset R$. Consider the diagram $$ \xymatrix{ S \ar[r] & S/\mathfrak p S \\ R \ar[r] \ar[u] & R/\mathfrak p \ar[u] } $$ This diagram and the density of $f(Y_0) \cap V(\mathfrak p)$ in $V(\mathfrak p)$ shows that the morphism $R/\mathfrak p \to S/\mathfrak p S$ satisfies condition (2) of Lemma \ref{lemma-domain-image-dense-set-points-generic-point}. Hence we conclude there exists a prime $\overline{\mathfrak q} \subset S/\mathfrak pS$ mapping to $(0)$. In other words the inverse image $\mathfrak q$ of $\overline{\mathfrak q}$ in $S$ maps to $\mathfrak p$ as desired.
Since $R \to S$ is of finite type, it is of finite presentation, see Lemma \ref{lemma-Noetherian-finite-type-is-finite-presentation}. Thus the image of a constructible set in $X$ is constructible in $Y$ by Chevalley's theorem (Theorem \ref{theorem-chevalley}). Combined with Lemma \ref{lemma-image-finite-type-map-Jacobson-rings} the lemma follows.
Let $x_1 = 1 \in M$ and $x_i \in M$, $i = 2, \ldots, n$ be a finite set of elements generating $M$ as an $R$-module. Write $yx_i = \sum \varphi(a_{ij}) x_j$ for some $a_{ij} \in R$. Let $P(T) \in R[T]$ be the characteristic polynomial of the $n \times n$ matrix $A = (a_{ij})$. By Lemma \ref{lemma-charpoly} we see $P(A) = 0$. By construction the map $\pi : R^n \to M$, $(a_1, \ldots, a_n) \mapsto \sum \varphi(a_i) x_i$ commutes with $A : R^n \to R^n$ and multiplication by $y$. In a formula $\pi(Av) = y\pi(v)$. Thus $P(y) = P(y) \cdot 1 = P(y) \cdot x_1 = P(y) \cdot \pi((1, 0, \ldots, 0)) = \pi(P(A)(1, 0, \ldots, 0)) = 0$.
If each $s_i$ is integral, then the subalgebra generated by $\varphi(R)$ and the $s_i$ is finite over $R$. Namely, if $s_i$ satisfies a monic equation of degree $d_i$ over $R$, then this subalgebra is generated as an $R$-module by the elements $s_1^{e_1} \ldots s_n^{e_n}$ with $0 \leq e_i \leq d_i - 1$. Conversely, suppose given a finite $R$-subalgebra $S'$ containing all the $s_i$. Then all of the $s_i$ are integral by Lemma \ref{lemma-finite-is-integral}.
Let $t \in T$. Let $P(x) \in S[x]$ be a monic polynomial such that $P(t) = 0$. Apply Lemma \ref{lemma-characterize-integral} to the finite set of coefficients of $P$. Hence $t$ is integral over some subalgebra $S' \subset S$ finite over $R$. Apply Lemma \ref{lemma-characterize-integral} again to find a subalgebra $T' \subset T$ finite over $S'$ and containing $t$. Lemma \ref{lemma-finite-transitive} applied to $R \to S' \to T'$ shows that $T'$ is finite over $R$. The integrality of $t$ over $R$ now follows from Lemma \ref{lemma-finite-is-integral}.
It is clear that (1) implies (2). Assume (2). Consider the $R$-algebra $S' \subset S$ generated by $\varphi(R)$ and $x$. Let $\mathfrak p$ be a prime ideal of $R$. Then we know that $x^d + \sum_{i = 1, \ldots, d} \varphi(a_i) x^{d - i} = 0$ in $S_{\mathfrak p}$ for some $a_i \in R_{\mathfrak p}$. Hence we see, by looking at which denominators occur, that for some $f \in R$, $f \not \in \mathfrak p$ we have $a_i \in R_f$ and $x^d + \sum_{i = 1, \ldots, d} \varphi(a_i) x^{d - i} = 0$ in $S_f$. This implies that $S'_f$ is finite over $R_f$. Since $\mathfrak p$ was arbitrary and $\Spec(R)$ is quasi-compact (Lemma \ref{lemma-quasi-compact}) we can find finitely many elements $f_1, \ldots, f_n \in R$ which generate the unit ideal of $R$ such that $S'_{f_i}$ is finite over $R_{f_i}$. Hence we conclude from Lemma \ref{lemma-cover} that $S'$ is finite over $R$. Hence $x$ is integral over $R$ by Lemma \ref{lemma-characterize-integral}.
Let $\mathfrak p \subset R$ be a prime ideal. We have to show $\mathfrak pS_{\mathfrak p} \not = S_{\mathfrak p}$, see Lemma \ref{lemma-in-image}. The localization $R_{\mathfrak p} \to S_{\mathfrak p}$ is injective (as localization is exact) and integral by Lemma \ref{lemma-integral-closure-localize} or \ref{lemma-base-change-integral}. Hence we may replace $R$, $S$ by $R_{\mathfrak p}$, $S_{\mathfrak p}$ and we may assume $R$ is local with maximal ideal $\mathfrak m$ and it suffices to show that $\mathfrak mS \not = S$. Suppose $1 = \sum f_i s_i$ with $f_i \in \mathfrak m$ and $s_i \in S$ in order to get a contradiction. Let $R \subset S' \subset S$ be such that $R \to S'$ is finite and $s_i \in S'$, see Lemma \ref{lemma-characterize-integral}. The equation $1 = \sum f_i s_i$ implies that the finite $R$-module $S'$ satisfies $S' = \mathfrak m S'$. Hence by Nakayama's Lemma \ref{lemma-NAK} we see $S' = 0$. Contradiction.
The statement on primes follows from the statement ``integral $+$ domain $\Rightarrow$ field''. Let $S$ integral over $k$ and assume $S$ is a domain, Take $s \in S$. By Lemma \ref{lemma-characterize-integral} we may find a finite dimensional $k$-subalgebra $k \subset S' \subset S$ containing $s$. Hence $S$ is a field if we can prove the first statement. Assume $S$ finite dimensional over $k$ and a domain. Pick $s\in S$. Since $S$ is a domain the multiplication map $s : S \to S$ is surjective by dimension reasons. Hence there exists an element $s_1 \in S$ such that $ss_1 = 1$. So $S$ is a field.
By the discussion in Remark \ref{remark-fundamental-diagram} the fibres are the spectra of the rings $S \otimes_R \kappa(\mathfrak p)$. As $R \to S$ is finite, these fibre rings are finite over $\kappa(\mathfrak p)$ hence Noetherian by Lemma \ref{lemma-Noetherian-permanence}. By Lemma \ref{lemma-integral-no-inclusion} every prime of $S \otimes_R \kappa(\mathfrak p)$ is a minimal prime. Hence by Lemma \ref{lemma-Noetherian-irreducible-components} there are at most finitely many.
One of the implications follows from Lemma \ref{lemma-finitely-presented-over-subring}. To see the other assume that $M$ is finitely presented as an $S$-module. Pick a presentation $$ S^{\oplus m} \longrightarrow S^{\oplus n} \longrightarrow M \longrightarrow 0 $$ As $S$ is finite as an $R$-module, the kernel of $S^{\oplus n} \to M$ is a finite $R$-module. Thus from Lemma \ref{lemma-extension} we see that it suffices to prove that $S$ is finitely presented as an $R$-module. \medskip\noindent Pick $y_1, \ldots, y_n \in S$ such that $y_1, \ldots, y_n$ generate $S$ as an $R$-module. By Lemma \ref{lemma-characterize-integral-element} each $y_i$ is integral over $R$. Choose monic polynomials $P_i(x) \in R[x]$ with $P_i(y_i) = 0$. Consider the ring $$ S' = R[x_1, \ldots, x_n]/(P_1(x_1), \ldots, P_n(x_n)) $$ Then we see that $S$ is of finite presentation as an $S'$-algebra by Lemma \ref{lemma-compose-finite-type}. Since $S' \to S$ is surjective, the kernel $J = \Ker(S' \to S)$ is finitely generated as an ideal by Lemma \ref{lemma-finite-presentation-independent}. Hence $J$ is a finite $S'$-module (immediate from the definitions). Thus $S = \Coker(J \to S')$ is  of finite presentation as an $S'$-module by Lemma \ref{lemma-extension}. Hence, arguing as in the first paragraph, it suffices to show that $S'$ is of finite presentation as an $R$-module. Actually, $S'$ is free as an $R$-module with basis the monomials $x_1^{e_1} \ldots x_n^{e_n}$ for $0 \leq e_i < \deg(P_i)$. Namely, write $R \to S'$ as the composition $$ R \to R[x_1]/(P_1(x_1)) \to R[x_1, x_2]/(P_1(x_1), P_2(x_2)) \to \ldots \to S' $$ This shows that the $i$th ring in this sequence is free as a module over the $(i - 1)$st one with basis $1, x_i, \ldots, x_i^{\deg(P_i) - 1}$. The result follows easily from this by induction. Some details omitted.
Since $x/y \cdot y/x = 1$ it is clear that the map $R[x/y] \oplus R[y/x] \to R[x/y, y/x]$ is surjective. Let $\alpha \in R[x/y] \cap R[y/x]$. To show exactness in the middle we have to prove that $\alpha \in R$. By assumption we may write $$ \alpha = a_0 + a_1 x/y + \ldots + a_n (x/y)^n = b_0 + b_1 y/x + \ldots + b_m(y/x)^m $$ for some $n, m \geq 0$ and $a_i, b_j \in R$. Pick some $N > \max(n, m)$. Consider the finite $R$-submodule $M$ of $R_{xy}$ generated by the elements $$ (x/y)^N, (x/y)^{N - 1}, \ldots, x/y, 1, y/x, \ldots, (y/x)^{N - 1}, (y/x)^N $$ We claim that $\alpha M \subset M$. Namely, it is clear that $(x/y)^i (b_0 + b_1 y/x + \ldots + b_m(y/x)^m) \in M$ for $0 \leq i \leq N$ and that $(y/x)^i (a_0 + a_1 x/y + \ldots + a_n(x/y)^n) \in M$ for $0 \leq i \leq N$. Hence $\alpha$ is integral over $R$ by Lemma \ref{lemma-characterize-integral-element}. Note that $\alpha \in R_x$, so if $R$ is integrally closed in $R_x$ then $\alpha \in R$ as desired.
If $ru^n \in R$ for all $n \geq 0$ and $v^nr' \in R$ for all $n \geq 0$, then $(uv)^nrr'$ and $(u + v)^nrr'$ are in $R$ for all $n \geq 0$. Hence the first assertion. Suppose $g \in K$ is integral over $R$. In this case there exists an $d > 0$ such that the ring $R[g]$ is generated by $1, g, \ldots, g^d$ as an $R$-module. Let $r \in R$ be a common denominator of the elements $1, g, \ldots, g^d \in K$. It is follows that $rR[g] \subset R$, and hence $g$ is almost integral over $R$. \medskip\noindent Suppose $R$ is Noetherian and $g \in K$ is almost integral over $R$. Let $r \in R$, $r\not = 0$ be as in the definition. Then $R[g] \subset \frac{1}{r}R$ as an $R$-module. Since $R$ is Noetherian this implies that $R[g]$ is finite over $R$. Hence $g$ is integral over $R$, see Lemma \ref{lemma-finite-is-integral}.
We first prove the second statement. Write $f = \alpha_0 + \alpha_1 x + \ldots + \alpha_r x^r$ with $\alpha_r \not = 0$. By assumption there exists $h = b_0 + b_1 x + \ldots + b_s x^s \in R[x]$, $b_s \not = 0$ such that $f^n h \in R[x]$ for all $n \geq 0$. This implies that $b_s \alpha_r^n \in R$ for all $n \geq 0$. Hence $\alpha_r$ is almost integral over $R$. Since the set of almost integral elements form a subring (Lemma \ref{lemma-almost-integral}) we deduce that $f - \alpha_r x^r = \alpha_0 + \alpha_1 x + \ldots + \alpha_{r - 1} x^{r - 1}$ is almost integral over $R[x]$. By induction on $r$ we win. \medskip\noindent In order to prove the first statement we will use absolute Noetherian reduction. Namely, write $\alpha_i = a_i / b_i$ and let $P(t) = t^d + \sum_{j < d} f_j t^j$ be a polynomial with coefficients $f_j \in R[x]$ such that $P(f) = 0$. Let $f_j = \sum f_{ji}x^i$. Consider the subring $R_0 \subset R$ generated by the finite list of elements $a_i, b_i, f_{ji}$ of $R$. It is a domain; let $K_0$ be its field of fractions. Since $R_0$ is a finite type $\mathbf{Z}$-algebra it is Noetherian, see Lemma \ref{lemma-obvious-Noetherian}. It is still the case that $f \in K_0[x]$ is integral over $R_0[x]$, because all the identities in $R$ among the elements $a_i, b_i, f_{ji}$ also hold in $R_0$. By Lemma \ref{lemma-almost-integral} the element $f$ is almost integral over $R_0[x]$. By the second statement of the lemma, the elements $\alpha_i$ are almost integral over $R_0$. And since $R_0$ is Noetherian, they are integral over $R_0$, see Lemma \ref{lemma-almost-integral}. Of course, then they are integral over $R$.
The result is true if $R$ is a field $K$ because $K[x]$ is a euclidean domain and hence a principal ideal domain and hence normal by Lemma \ref{lemma-PID-normal}. Let $g$ be an element of the fraction field of $R[x]$ which is integral over $R[x]$. Because $g$ is integral over $K[x]$ where $K$ is the fraction field of $R$ we may write $g = \alpha_d x^d + \alpha_{d-1}x^{d-1} + \ldots + \alpha_0$ with $\alpha_i \in K$. By Lemma \ref{lemma-prepare-polynomial-ring-normal} the elements $\alpha_i$ are integral over $R$ and hence are in $R$.
The power series ring is Noetherian by Lemma \ref{lemma-Noetherian-power-series}. Let $f, g \in R[[x]]$ be nonzero elements such that $w = f/g$ is integral over $R[[x]]$. Let $K$ be the fraction field of $R$. Since the ring of Laurent series $K((x)) = K[[x]][1/x]$ is a field, we can write $w = a_n x^n + a_{n + 1} x^{n + 1} + \ldots)$ for some $n \in \mathbf{Z}$, $a_i \in K$, and $a_n \not = 0$. By Lemma \ref{lemma-almost-integral} we see there exists a nonzero element $h = b_m x^m + b_{m + 1} x^{m + 1} + \ldots$ in $R[[x]]$ with $b_m \not = 0$ such that $w^e h \in R[[x]]$ for all $e \geq 1$. We conclude that $n \geq 0$ and that $b_m a_n^e \in R$ for all $e \geq 1$. Since $R$ is Noetherian this implies that $a_n \in R$ by the same lemma. Now, if $a_n, a_{n + 1}, \ldots, a_{N - 1} \in R$, then we can apply the same argument to $w - a_n x^n - \ldots - a_{N - 1} x^{N - 1} = a_N x^N + \ldots$. In this way we see that all $a_i \in R$ and the lemma is proved.
Let $\mathfrak q$ be a prime of $R[x]$. Set $\mathfrak p = R \cap \mathfrak q$. Then we see that $R_{\mathfrak p}[x]$ is a normal domain by Lemma \ref{lemma-polynomial-domain-normal}. Hence $(R[x])_{\mathfrak q}$ is a normal domain by Lemma \ref{lemma-localize-normal-domain}.
It suffices to show that the product of two normal rings, say $R$ and $S$, is normal. By Lemma \ref{lemma-disjoint-decomposition} the prime ideals of $R\times S$ are of the form $\mathfrak{p}\times S$ and $R\times \mathfrak{q}$, where $\mathfrak{p}$ and $\mathfrak{q}$ are primes of $R$ and $S$ respectively. Localization yields  $(R\times S)_{\mathfrak{p}\times S}=R_{\mathfrak{p}}$ which is a normal domain by assumption. Similarly for $S$.