hcju/stacksqa huggingface dataset:
Suppose that $R$ is reduced. Then $R_{\mathfrak p}$ is a field for every minimal prime $\mathfrak p$ of $R$, according to Lemma \ref{lemma-minimal-prime-reduced-ring}. Hence we have $(R_0)$. Let $\mathfrak p$ be a prime of height $\geq 1$. Then $A = R_{\mathfrak p}$ is a reduced local ring of dimension $\geq 1$. Hence its maximal ideal $\mathfrak m$ is not an associated prime since this would mean there exists a $x \in \mathfrak m$ with annihilator $\mathfrak m$ so $x^2 = 0$. Hence the depth of $A = R_{\mathfrak p}$ is at least one, by Lemma \ref{lemma-ass-zero-divisors}. This shows that $(S_1)$ holds. \medskip\noindent Conversely, assume that $R$ satisfies $(R_0)$ and $(S_1)$. If $\mathfrak p$ is a minimal prime of $R$, then $R_{\mathfrak p}$ is a field by $(R_0)$, and hence is reduced. If $\mathfrak p$ is not minimal, then we see that $R_{\mathfrak p}$ has depth $\geq 1$ by $(S_1)$ and we conclude there exists an element $t \in \mathfrak pR_{\mathfrak p}$ such that $R_{\mathfrak p} \to R_{\mathfrak p}[1/t]$ is injective. This implies that $R_{\mathfrak p}$ is a subring of localizations of $R$ at primes of smaller height. Thus by induction on the height we conclude that $R$ is reduced.
Proof of (1) $\Rightarrow$ (2). Assume $R$ is normal, i.e., all localizations $R_{\mathfrak p}$ at primes are normal domains. In particular we see that $R$ has $(R_0)$ and $(S_1)$ by Lemma \ref{lemma-criterion-reduced}. Hence it suffices to show that a local Noetherian normal domain $R$ of dimension $d$ has depth $\geq \min(2, d)$ and is regular if $d = 1$. The assertion if $d = 1$ follows from Lemma \ref{lemma-characterize-dvr}. \medskip\noindent Let $R$ be a local Noetherian normal domain with maximal ideal $\mathfrak m$ and dimension $d \geq 2$. Apply Lemma \ref{lemma-hart-serre-loc-thm} to $R$. It is clear that $R$ does not fall into cases (1) or (2) of the lemma. Let $R \to R'$ as in (4) of the lemma. Since $R$ is a domain we have $R \subset R'$. Since $\mathfrak m$ is not an associated prime of $R'$ there exists an $x \in \mathfrak m$ which is a nonzerodivisor on $R'$. Then $R_x = R'_x$ so $R$ and $R'$ are domains with the same fraction field. But finiteness of $R \subset R'$ implies every element of $R'$ is integral over $R$ (Lemma \ref{lemma-finite-is-integral}) and we conclude that $R = R'$ as $R$ is normal. This means (4) does not happen. Thus we get the remaining possibility (3), i.e., $\text{depth}(R) \geq 2$ as desired. \medskip\noindent Proof of (2) $\Rightarrow$ (1). Assume $R$ satisfies $(R_1)$ and $(S_2)$. By Lemma \ref{lemma-criterion-reduced} we conclude that $R$ is reduced. Hence it suffices to show that if $R$ is a reduced local Noetherian ring of dimension $d$ satisfying $(S_2)$ and $(R_1)$ then $R$ is a normal domain. If $d = 0$, the result is clear. If $d = 1$, then the result follows from Lemma \ref{lemma-characterize-dvr}. \medskip\noindent Let $R$ be a reduced local Noetherian ring with maximal ideal $\mathfrak m$ and dimension $d \geq 2$ which satisfies $(R_1)$ and $(S_2)$. By Lemma \ref{lemma-characterize-reduced-ring-normal} it suffices to show that $R$ is integrally closed in its total ring of fractions $Q(R)$. Pick $x \in Q(R)$ which is integral over $R$. Then $R' = R[x]$ is a finite ring extension of $R$ (Lemma \ref{lemma-characterize-finite-in-terms-of-integral}). Because $\dim(R_\mathfrak p) < d$ for every nonmaximal prime $\mathfrak p \subset R$ we have $R_\mathfrak p = R'_\mathfrak p$ by induction. Hence the support of $R'/R$ is $\{\mathfrak m\}$. It follows that $R'/R$ is annihilated by a power of $\mathfrak m$ (Lemma \ref{lemma-Noetherian-power-ideal-kills-module}). By Lemma \ref{lemma-hart-serre-loc-thm} this contradicts the assumption that the depth of $R$ is $\geq 2 = \min(2, d)$ and the proof is complete.
Let $R$ be a regular ring. By Lemma \ref{lemma-criterion-normal} it suffices to prove that $R$ is $(R_1)$ and $(S_2)$. As a regular local ring is Cohen-Macaulay, see Lemma \ref{lemma-regular-ring-CM}, it is clear that $R$ is $(S_2)$. Property $(R_1)$ is immediate.
By Lemma \ref{lemma-criterion-normal} we see that $R$ has $(S_2)$. Hence for any nonzero element $a \in R$ we see that $R/aR$ has $(S_1)$ (use Lemma \ref{lemma-depth-in-ses} for example) Hence $R/aR$ has no embedded primes (Lemma \ref{lemma-criterion-no-embedded-primes}). We conclude the associated primes of $R/aR$ are exactly the minimal primes $\mathfrak p$ over $(a)$, which have height $1$ as $a$ is not zero (Lemma \ref{lemma-minimal-over-1}). This proves (1). \medskip\noindent Thus, given $b \in R$ we have $b \in aR$ if and only if $b \in aR_{\mathfrak p}$ for every minimal prime $\mathfrak p$ over $(a)$ (see Lemma \ref{lemma-zero-at-ass-zero}). These primes all have height $1$ as seen above so $b/a \in R$ if and only if $b/a \in R_{\mathfrak p}$ for all height 1 primes. Hence (2) holds. \medskip\noindent For (3) write $x = a/b$. Let $\mathfrak p_1, \ldots, \mathfrak p_r$ be the minimal primes over $(ab)$. These all have height 1 by the above. Then we see that $R \cap xR = \bigcap_{i = 1, \ldots, r} (R \cap xR_{\mathfrak p_i})$ by part (2) of the lemma. Hence $R/(R \cap xR)$ is a submodule of $\bigoplus R/(R \cap xR_{\mathfrak p_i})$. As $R_{\mathfrak p_i}$ is a discrete valuation ring (by property $(R_1)$ for the Noetherian normal domain $R$, see Lemma \ref{lemma-criterion-normal}) we have $xR_{\mathfrak p_i} = \mathfrak p_i^{e_i}R_{\mathfrak p_i}$ for some $e_i \in \mathbf{Z}$. Hence the direct sum is equal to $\bigoplus_{e_i > 0} R/\mathfrak p_i^{(e_i)}$, see Definition \ref{definition-symbolic-power}. By Lemma \ref{lemma-symbolic-power-associated} the only associated prime of the module $R/\mathfrak p^{(n)}$ is $\mathfrak p$. Hence the set of associate primes of $R/(R \cap xR)$ is a subset of $\{\mathfrak p_i\}$ and there are no inclusion relations among them. This proves (3).
The equivalence of (2) and (3) is Lemma \ref{lemma-characterize-formally-unramified}. By Lemma \ref{lemma-etale-over-field} we see that (1) is equivalent to (6). Property (6) implies (5) and (4) which both in turn imply (3) (Lemmas \ref{lemma-formally-etale-etale}, \ref{lemma-unramified}, and \ref{lemma-formally-unramified-unramified}). Thus it suffices to show that (2) implies (1). Choose a finitely generated $k$-subalgebra $A \subset K$ such that $K$ is the fraction field of the domain $A$. Set $S = A \setminus \{0\}$. Since $0 = \Omega_{K/k} = S^{-1}\Omega_{A/k}$ (Lemma \ref{lemma-differentials-localize}) and since $\Omega_{A/k}$ is finitely generated (Lemma \ref{lemma-differentials-finitely-generated}), we can replace $A$ by a localization $A_f$ to reduce to the case that $\Omega_{A/k} = 0$ (details omitted). Then $A$ is unramified over $k$, hence $K/k$ is finite separable for example by Lemma \ref{lemma-unramified-at-prime} applied with $\mathfrak q = (0)$.
By Lemma \ref{lemma-colimit-differentials} we see that there exists a subfield $k \subset L \subset K$ such that $k \subset L$ is a finitely generated field extension and such that $\text{d}a$ is zero in $\Omega_{L/k}$. Hence we may assume that $K$ is a finitely generated field extension of $k$. \medskip\noindent Choose a transcendence basis $x_1, \ldots, x_r \in K$ such that $K$ is finite separable over $k(x_1, \ldots, x_r)$. This is possible by the definitions, see Definitions \ref{definition-perfect} and \ref{definition-separable-field-extension}. We remark that the result holds for the purely transcendental subfield $k(x_1, \ldots, x_r) \subset K$. Namely, $$ \Omega_{k(x_1, \ldots, x_r)/k} = \bigoplus\nolimits_{i = 1}^r k(x_1, \ldots, x_r) \text{d}x_i $$ and any rational function all of whose partial derivatives are zero is a $p$th power. Moreover, we also have $$ \Omega_{K/k} = \bigoplus\nolimits_{i = 1}^r K\text{d}x_i $$ since $k(x_1, \ldots, x_r) \subset K$ is finite separable (computation omitted). Suppose $a \in K$ is an element such that $\text{d}a = 0$ in the module of differentials. By our choice of $x_i$ we see that the minimal polynomial $P(T) \in k(x_1, \ldots, x_r)[T]$ of $a$ is separable. Write $$ P(T) = T^d + \sum\nolimits_{i = 1}^d a_i T^{d - i} $$ and hence $$ 0 = \text{d}P(a) = \sum\nolimits_{i = 1}^d a^{d - i}\text{d}a_i $$ in $\Omega_{K/k}$. By the description of $\Omega_{K/k}$ above and the fact that $P$ was the minimal polynomial of $a$, we see that this implies $\text{d}a_i = 0$. Hence $a_i = b_i^p$ for each $i$. Therefore by Fields, Lemma \ref{fields-lemma-pth-root} we see that $a$ is a $p$th power.
By induction on $n$. If $n = 1$ the result is Lemma \ref{lemma-derivative-zero-pth-power}. For the induction step, suppose that $k(a_1^{1/p}, \ldots, a_{n - 1}^{1/p})$ has degree $p^{n - 1}$ over $k$. We have to show that $a_n$ does not map to a $p$th power in $k(a_1^{1/p}, \ldots, a_{n - 1}^{1/p})$. If it does then we can write \begin{align*} a_n & = \left(\sum\nolimits_{I = (i_1, \ldots, i_{n - 1}),\ 0 \leq i_j \leq p - 1} \lambda_I a_1^{i_1/p} \ldots a_{n - 1}^{i_{n - 1}/p}\right)^p \\ & = \sum\nolimits_{I = (i_1, \ldots, i_{n - 1}),\ 0 \leq i_j \leq p - 1} \lambda_I^p a_1^{i_1} \ldots a_{n - 1}^{i_{n - 1}} \end{align*} Applying $\text{d}$ we see that $\text{d}a_n$ is linearly dependent on $\text{d}a_i$, $i < n$. This is a contradiction.
For (1) write $K = k(x_j; j \in J)$. Suppose that $A$ is a $k$-algebra, and $I \subset A$ is an ideal of square zero. Let $\varphi : K \to A/I$ be a $k$-algebra map. Let $a_j \in A$ be an element such that $a_j \mod I = \varphi(x_j)$. Then it is easy to see that there is a unique $k$-algebra map $K \to A$ which maps $x_j$ to $a_j$ and which reduces to $\varphi$ mod $I$. Hence $k \subset K$ is formally smooth. \medskip\noindent In case (2) we see that $k \subset K$ is a colimit of \'etale ring extensions. An \'etale ring map is formally \'etale (Lemma \ref{lemma-formally-etale-etale}). Hence this case follows from Lemma \ref{lemma-colimit-formally-etale} and the trivial observation that a formally \'etale ring map is formally smooth. \medskip\noindent In case (3), write $K = \colim K_i$ as the filtered colimit of its finitely generated sub $k$-extensions. By Definition \ref{definition-separable-field-extension} each $K_i$ is separable algebraic over a purely transcendental extension of $k$. Hence $K_i/k$ is formally smooth by cases (1) and (2) and Lemma \ref{lemma-compose-formally-smooth}. Thus $H_1(L_{K_i/k}) = 0$ by Lemma \ref{lemma-characterize-formally-smooth-field-extension}. Hence $H_1(L_{K/k}) = 0$ by Lemma \ref{lemma-colimits-NL}. Hence $K/k$ is formally smooth by Lemma \ref{lemma-characterize-formally-smooth-field-extension} again.
Suppose that $E \subset K$ is a finite subset. It suffices to show that there exists a $k$ subalgebra $A \subset K$ which contains $E$ and which is a global complete intersection (resp.\ smooth) over $k$. The separable/smooth case follows from Lemma \ref{lemma-localization-smooth-separable}. In general let $L \subset K$ be the subfield generated by $E$. Pick a transcendence basis $x_1, \ldots, x_d \in L$ over $k$. The extension $k(x_1, \ldots, x_d) \subset L$ is finite. Say $L = k(x_1, \ldots, x_d)[y_1, \ldots, y_r]$. Pick inductively polynomials $P_i \in k(x_1, \ldots, x_d)[Y_1, \ldots, Y_r]$ such that $P_i = P_i(Y_1, \ldots, Y_i)$ is monic in $Y_i$ over $k(x_1, \ldots, x_d)[Y_1, \ldots, Y_{i - 1}]$ and maps to the minimum polynomial of $y_i$ in $k(x_1, \ldots, x_d)[y_1, \ldots, y_{i - 1}][Y_i]$. Then it is clear that $P_1, \ldots, P_r$ is a regular sequence in $k(x_1, \ldots, x_r)[Y_1, \ldots, Y_r]$ and that $L = k(x_1, \ldots, x_r)[Y_1, \ldots, Y_r]/(P_1, \ldots, P_r)$. If $h \in k[x_1, \ldots, x_d]$ is a polynomial such that $P_i \in k[x_1, \ldots, x_d, 1/h, Y_1, \ldots, Y_r]$, then we see that $P_1, \ldots, P_r$ is a regular sequence in $k[x_1, \ldots, x_d, 1/h, Y_1, \ldots, Y_r]$ and $A = k[x_1, \ldots, x_d, 1/h, Y_1, \ldots, Y_r]/(P_1, \ldots, P_r)$ is a global complete intersection. After adjusting our choice of $h$ we may assume $E \subset A$ and we win.
Let $R \subset R'$ be the extension constructed in the proof of Lemma \ref{lemma-flat-local-given-residue-field}. By construction $R' = \colim_{\alpha \in A} R_\alpha$ where $A$ is a well-ordered set and the transition maps $R_\alpha \to R_{\alpha + 1}$ are finite \'etale and $R_\alpha = \colim_{\beta < \alpha} R_\beta$ if $\alpha$ is not a successor. We will prove the result by transfinite induction. \medskip\noindent Suppose the result holds for $R_\alpha$, i.e., $R_\alpha = \colim R_i$ with $R_i$ finite \'etale over $R$. Since $R_\alpha \to R_{\alpha + 1}$ is finite \'etale there exists an $i$ and a finite \'etale extension $R_i \to R_{i, 1}$ such that $R_{\alpha + 1} = R_\alpha \otimes_{R_i} R_{i, 1}$. Thus $R_{\alpha + 1} = \colim_{i' \geq i} R_{i'} \otimes_{R_i} R_{i, 1}$ and the result holds for $\alpha + 1$. Suppose $\alpha$ is not a successor and the result holds for $R_\beta$ for all $\beta < \alpha$. Since every finite subset $E \subset R_\alpha$ is contained in $R_\beta$ for some $\beta < \alpha$ and we see that $E$ is contained in a finite \'etale subextension by assumption. Thus the result holds for $R_\alpha$.
First note that the $p$-adic integers $\mathbf{Z}_p$ form a Cohen ring for $\mathbf{F}_p$. Let $k$ be an arbitrary field of characteristic $p$. Let $\mathbf{Z}_p \to R$ be a flat local ring map such that $\mathfrak m_R = pR$ and $R/pR = k$, see Lemma \ref{lemma-flat-local-given-residue-field}. Then clearly $R$ is a discrete valuation ring. Hence its completion is a Cohen ring for $k$.
If $n = 1$, this follows from Proposition \ref{proposition-characterize-separable-field-extensions}. For general $n$ we argue by induction on $n$. Namely, if $\mathbf{Z}/p^n\mathbf{Z} \to \Lambda/p^n\Lambda$ is formally smooth, then we can apply Lemma \ref{lemma-lift-formal-smoothness} to the ring map $\mathbf{Z}/p^{n + 1}\mathbf{Z} \to \Lambda/p^{n + 1}\Lambda$ and the ideal $I = (p^n) \subset \mathbf{Z}/p^{n + 1}\mathbf{Z}$.
In case (1), by the Cohen structure theorem (Theorem \ref{theorem-cohen-structure-theorem}) there exists a coefficient ring which must be a field mapping isomorphically to the residue field. Thus it suffices to prove (2). In case (2) we pick $f_1, \ldots, f_d \in \mathfrak m$ which map to a basis of $\mathfrak m/\mathfrak m^2$ and we consider the continuous $k$-algebra map $k[[x_1, \ldots, x_d]] \to R$ sending $x_i$ to $f_i$. As both source and target are $(x_1, \ldots, x_d)$-adically complete, this map is surjective by Lemma \ref{lemma-completion-generalities}. On the other hand, it has to be injective because otherwise the dimension of $R$ would be $< d$ by Lemma \ref{lemma-one-equation}.
Let $\Lambda$ be a coefficient ring of $R$. Since $R$ is a domain we see that either $\Lambda$ is a field or $\Lambda$ is a Cohen ring. \medskip\noindent Case I: $\Lambda = k$ is a field. Let $d = \dim(R)$. Choose $x_1, \ldots, x_d \in \mathfrak m$ which generate an ideal of definition $I \subset R$. (See Section \ref{section-dimension}.) By Lemma \ref{lemma-change-ideal-completion} we see that $R$ is $I$-adically complete as well. Consider the map $R_0 = k[[X_1, \ldots, X_d]] \to R$ which maps $X_i$ to $x_i$. Note that $R_0$ is complete with respect to the ideal $I_0 = (X_1, \ldots, X_d)$, and that $R/I_0R \cong R/IR$ is finite over $k = R_0/I_0$ (because $\dim(R/I) = 0$, see Section \ref{section-dimension}.) Hence we conclude that $R_0 \to R$ is finite by Lemma \ref{lemma-finite-over-complete-ring}. Since $\dim(R) = \dim(R_0)$ this implies that $R_0 \to R$ is injective (see Lemma \ref{lemma-integral-dim-up}), and the lemma is proved. \medskip\noindent Case II: $\Lambda$ is a Cohen ring. Let $d + 1 = \dim(R)$. Let $p > 0$ be the characteristic of the residue field $k$. As $R$ is a domain we see that $p$ is a nonzerodivisor in $R$. Hence $\dim(R/pR) = d$, see Lemma \ref{lemma-one-equation}. Choose $x_1, \ldots, x_d \in R$ which generate an ideal of definition in $R/pR$. Then $I = (p, x_1, \ldots, x_d)$ is an ideal of definition of $R$. By Lemma \ref{lemma-change-ideal-completion} we see that $R$ is $I$-adically complete as well. Consider the map $R_0 = \Lambda[[X_1, \ldots, X_d]] \to R$ which maps $X_i$ to $x_i$. Note that $R_0$ is complete with respect to the ideal $I_0 = (p, X_1, \ldots, X_d)$, and that $R/I_0R \cong R/IR$ is finite over $k = R_0/I_0$ (because $\dim(R/I) = 0$, see Section \ref{section-dimension}.) Hence we conclude that $R_0 \to R$ is finite by Lemma \ref{lemma-finite-over-complete-ring}. Since $\dim(R) = \dim(R_0)$ this implies that $R_0 \to R$ is injective (see Lemma \ref{lemma-integral-dim-up}), and the lemma is proved.
Assume $R_{f_i}$ is N-2 (or N-1). Let $L$ be a finite extension of the fraction field of $R$ (equal to the fraction field in the N-1 case). Let $S$ be the integral closure of $R$ in $L$. By Lemma \ref{lemma-integral-closure-localize} we see that $S_{f_i}$ is the integral closure of $R_{f_i}$ in $L$. Hence $S_{f_i}$ is finite over $R_{f_i}$ by assumption. Thus $S$ is finite over $R$ by Lemma \ref{lemma-cover}.
Let $L/K$ be the induced extension of fraction fields. Note that this is a finite field extension (for example by Lemma \ref{lemma-isolated-point-fibre} (2) applied to the fibre $S \otimes_R K$, and the definition of a quasi-finite ring map). Let $S'$ be the integral closure of $R$ in $S$. Then $S'$ is contained in the integral closure of $R$ in $L$ which is finite over $R$ by assumption. As $R$ is Noetherian this implies $S'$ is finite over $R$. By Lemma \ref{lemma-quasi-finite-open-integral-closure} there exist elements $g_1, \ldots, g_n \in S'$ such that $S'_{g_i} \cong S_{g_i}$ and such that $g_1, \ldots, g_n$ generate the unit ideal in $S$. Hence it suffices to show that $S'$ is N-2 by Lemmas \ref{lemma-localize-N} and \ref{lemma-Japanese-local}. Thus we have reduced to the case where $S$ is finite over $R$. \medskip\noindent Assume $R \subset S$ with hypotheses as in the lemma and moreover that $S$ is finite over $R$. Let $M$ be a finite field extension of the fraction field of $S$. Then $M$ is also a finite field extension of $K$ and we conclude that the integral closure $T$ of $R$ in $M$ is finite over $R$. By Lemma \ref{lemma-integral-closure-transitive} we see that $T$ is also the integral closure of $S$ in $M$ and we win by Lemma \ref{lemma-integral-permanence}.
Consider the trace pairing (Fields, Definition \ref{fields-definition-trace-pairing}) $$ L \times L \longrightarrow K, \quad (x, y) \longmapsto \langle x, y\rangle := \text{Trace}_{L/K}(xy). $$ Since $L/K$ is separable this is nondegenerate (Fields, Lemma \ref{fields-lemma-separable-trace-pairing}). Moreover, if $x \in L$ is integral over $R$, then $\text{Trace}_{L/K}(x)$ is in $R$. This is true because the minimal polynomial of $x$ over $K$ has coefficients in $R$ (Lemma \ref{lemma-minimal-polynomial-normal-domain}) and because $\text{Trace}_{L/K}(x)$ is an integer multiple of one of these coefficients (Fields, Lemma \ref{fields-lemma-trace-and-norm-from-minimal-polynomial}). Pick $x_1, \ldots, x_n \in L$ which are integral over $R$ and which form a $K$-basis of $L$. Then the integral closure $S \subset L$ is contained in the $R$-module $$ M = \{y \in L \mid \langle x_i, y\rangle \in R, \ i = 1, \ldots, n\} $$ By linear algebra we see that $M \cong R^{\oplus n}$ as an $R$-module. Hence $S \subset R^{\oplus n}$ is a finitely generated $R$-module as $R$ is Noetherian.
Assume the integral closure of $R$ in every finite purely inseparable field extension of $K$ is finite. Let $K \subset L$ be any finite extension. We have to show the integral closure of $R$ in $L$ is finite over $R$. Choose a finite normal field extension $K \subset M$ containing $L$. As $R$ is Noetherian it suffices to show that the integral closure of $R$ in $M$ is finite over $R$. By Fields, Lemma \ref{fields-lemma-normal-case} there exists a subextension $K \subset M_{insep} \subset M$ such that $M_{insep}/K$ is purely inseparable, and $M/M_{insep}$ is separable. By assumption the integral closure $R'$ of $R$ in $M_{insep}$ is finite over $R$. By Lemma \ref{lemma-Noetherian-normal-domain-finite-separable-extension} the integral closure $R''$ of $R'$ in $M$ is finite over $R'$. Then $R''$ is finite over $R$ by Lemma \ref{lemma-finite-transitive}. Since $R''$ is also the integral closure of $R$ in $M$ (see Lemma \ref{lemma-integral-closure-transitive}) we win.
Assume $R$ is N-1. Let $R'$ be the integral closure of $R$ which is finite over $R$. Hence also $R'[x]$ is finite over $R[x]$. The ring $R'[x]$ is normal (see Lemma \ref{lemma-polynomial-domain-normal}), hence N-1. This proves the first assertion. \medskip\noindent For the second assertion, by Lemma \ref{lemma-finite-extension-N-2} it suffices to show that $R'[x]$ is N-2. In other words we may and do assume that $R$ is a normal N-2 domain. In characteristic zero we are done by Lemma \ref{lemma-domain-char-zero-N-1-2}. In characteristic $p > 0$ we have to show that the integral closure of $R[x]$ is finite in any finite purely inseparable extension of $L/K(x)$ where $K$ is the fraction field of $R$. There exists a finite purely inseparable field extension $L'/K$ and $q = p^e$ such that $L \subset L'(x^{1/q})$; some details omitted. As $R[x]$ is Noetherian it suffices to show that the integral closure of $R[x]$ in $L'(x^{1/q})$ is finite over $R[x]$. And this integral closure is equal to $R'[x^{1/q}]$ with $R \subset R' \subset L'$ the integral closure of $R$ in $L'$. Since $R$ is N-2 we see that $R'$ is finite over $R$ and hence $R'[x^{1/q}]$ is finite over $R[x]$.
It is clear that the standard open $D(f)$ is contained in $U$. By Serre's criterion Lemma \ref{lemma-criterion-normal} we see that $\mathfrak p \not \in U$ implies that for some $\mathfrak q \subset \mathfrak p$ we have either \begin{enumerate} \item Case I: $\text{depth}(R_{\mathfrak q}) < 2$ and $\dim(R_{\mathfrak q}) \geq 2$, and \item Case II: $R_{\mathfrak q}$ is not regular and $\dim(R_{\mathfrak q}) = 1$. \end{enumerate} This in particular also means that $R_{\mathfrak q}$ is not normal, and hence $f \in \mathfrak q$. In case I we see that $\text{depth}(R_{\mathfrak q}) = \text{depth}(R_{\mathfrak q}/fR_{\mathfrak q}) + 1$. Hence such a prime $\mathfrak q$ is the same thing as an embedded associated prime of $R/fR$. In case II $\mathfrak q$ is an associated prime of $R/fR$ of height 1. Thus there is a finite set $E$ of such primes $\mathfrak q$ (see Lemma \ref{lemma-finite-ass}) and $$ \Spec(R) \setminus U = \bigcup\nolimits_{\mathfrak q \in E} V(\mathfrak q) $$ as desired.