hcju/stacksqa huggingface dataset:
Apply Lemma \ref{lemma-isolated-point-fibre} to find a $g \in S$, $g \not \in \mathfrak q$ such that $\mathfrak q$ is the only prime of $S_g$ lying over $\mathfrak p$. We may and do replace $S$ by $S_g$. Then $S \otimes_R \kappa(\mathfrak p)$ has a unique prime, hence is a local ring, hence is equal to $S_{\mathfrak q}/\mathfrak pS_{\mathfrak q} \cong \kappa(\mathfrak q)$. By Lemma \ref{lemma-flat-fibre-smooth} there exists a $g \in S$, $g \not \in \mathfrak q$ such that $R \to S_g$ is smooth. Replace $S$ by $S_g$ again we may assume that $R \to S$ is smooth. By Lemma \ref{lemma-smooth-syntomic} we may even assume that $R \to S$ is standard smooth, say $S = R[x_1, \ldots, x_n]/(f_1, \ldots, f_c)$. Since $S \otimes_R \kappa(\mathfrak p) = \kappa(\mathfrak q)$ has dimension $0$ we conclude that $n = c$, i.e., $R \to S$ is \'etale.
First of all we note that $S' \to S$ is of finite presentation by Lemma \ref{lemma-compose-finite-type}. Let $\mathfrak q \subset S$ be a prime ideal lying over the primes $\mathfrak q' \subset S'$ and $\mathfrak p \subset R$. By Lemma \ref{lemma-etale-at-prime} the ring map $S'_{\mathfrak q'}/\mathfrak p S'_{\mathfrak q'} \to S_{\mathfrak q}/\mathfrak p S_{\mathfrak q}$ is a map finite separable extensions of $\kappa(\mathfrak p)$. In particular it is flat. Hence by Lemma \ref{lemma-criterion-flatness-fibre} we see that $S'_{\mathfrak q'} \to S_{\mathfrak q}$ is flat. Thus $S' \to S$ is flat. Moreover, the above also shows that $\mathfrak q'S_{\mathfrak q}$ is the maximal ideal of $S_{\mathfrak q}$ and that the residue field extension of $S'_{\mathfrak q'} \to S_{\mathfrak q}$ is finite separable. Hence from Lemma \ref{lemma-characterize-etale} we conclude that $S' \to S$ is \'etale at $\mathfrak q$. Since being \'etale is local (see Lemma \ref{lemma-etale}) we win.
[First proof] Let $I$ be the kernel of $\varphi$. We have that $I$ is finitely generated by Lemma \ref{lemma-finite-presentation-independent} since $\varphi$ is of finite presentation. Moreover, since $S$ is flat over $R$, tensoring the exact sequence $0 \to I \to R \to S \to 0$ over $R$ with $S$ gives $I/I^2 = 0$. Now we conclude by Lemma \ref{lemma-ideal-is-squared-union-connected}.
By Lemma \ref{lemma-etale-standard-smooth} we can write $\overline{S} = (R/I)[x_1, \ldots, x_n]/(\overline{f}_1, \ldots, \overline{f}_n)$ as in Definition \ref{definition-standard-smooth} with $\overline{\Delta} = \det(\frac{\partial \overline{f}_i}{\partial x_j})_{i, j = 1, \ldots, n}$ invertible in $\overline{S}$. Just take some lifts $f_i$ and set $S = R[x_1, \ldots, x_n, x_{n+1}]/(f_1, \ldots, f_n, x_{n + 1}\Delta - 1)$ where $\Delta = \det(\frac{\partial f_i}{\partial x_j})_{i, j = 1, \ldots, n}$ as in Example \ref{example-make-standard-smooth}. This proves the lemma.
By Lemma \ref{lemma-lift-etale} there exists an \'etale ring map $A' \to C$ such that $C/IC = B$. Then $A' \to C$ is formally smooth (by Proposition \ref{proposition-smooth-formally-smooth}) hence we get an $A'$-algebra map $\varphi : C \to B'$. Since $A' \to C$ is flat we have $I \otimes_A B = I \otimes_A C/IC = IC$. Hence the assumption that $J = I \otimes_A B$ implies that $\varphi$ induces an isomorphism $IC \to J$ and an isomorphism $C/IC \to B'/IB'$, whence $\varphi$ is an isomorphism.
Let $S = R[x]_g/(f)$ be a presentation of $S$ as in Definition \ref{definition-standard-etale}. Write $f = x^n + a_1 x^{n - 1} + \ldots + a_n$ with $a_i \in R$. By Lemma \ref{lemma-adjoin-roots} there exists a finite locally free and faithfully flat ring map $R \to S'$ such that $f = \prod (x - \alpha_i)$ for certain $\alpha_i \in S'$. Hence $R \to S'$ satisfies conditions (1), (2). Let $\mathfrak q \subset R[x]/(f)$ be a prime ideal with $g \not \in \mathfrak q$ (i.e., it corresponds to a prime of $S$). Let $\mathfrak p = R \cap \mathfrak q$ and let $\mathfrak q' \subset S'$ be a prime lying over $\mathfrak p$. Note that there are $n$ maps of $R$-algebras \begin{eqnarray*} \varphi_i : R[x]/(f) & \longrightarrow & S' \\ x & \longmapsto & \alpha_i \end{eqnarray*} To finish the proof we have to show that for some $i$ we have (a) the image of $\varphi_i(g)$ in $\kappa(\mathfrak q')$ is not zero, and (b) $\varphi_i^{-1}(\mathfrak q') = \mathfrak q$. Because then we can just take $g' = \varphi_i(g)$, and $\varphi = \varphi_i$ for that $i$. \medskip\noindent Let $\overline{f}$ denote the image of $f$ in $\kappa(\mathfrak p)[x]$. Note that as a point of $\Spec(\kappa(\mathfrak p)[x]/(\overline{f}))$ the prime $\mathfrak q$ corresponds to an irreducible factor $f_1$ of $\overline{f}$. Moreover, $g \not \in \mathfrak q$ means that $f_1$ does not divide the image $\overline{g}$ of $g$ in $\kappa(\mathfrak p)[x]$. Denote $\overline{\alpha}_1, \ldots, \overline{\alpha}_n$ the images of $\alpha_1, \ldots, \alpha_n$ in $\kappa(\mathfrak q')$. Note that the polynomial $\overline{f}$ splits completely in $\kappa(\mathfrak q')[x]$, namely $$ \overline{f} = \prod\nolimits_i (x - \overline{\alpha}_i) $$ Moreover $\varphi_i(g)$ reduces to $\overline{g}(\overline{\alpha}_i)$. It follows we may pick $i$ such that $f_1(\overline{\alpha}_i) = 0$ and $\overline{g}(\overline{\alpha}_i) \not = 0$. For this $i$ properties (a) and (b) hold. Some details omitted.
By Proposition \ref{proposition-etale-locally-standard} and the quasi-compactness of $\Spec(S)$ (see Lemma \ref{lemma-quasi-compact}) we can find $g_1, \ldots, g_n \in S$ generating the unit ideal of $S$ such that each $R \to S_{g_i}$ is standard \'etale. If we prove the lemma for the ring map $R \to \prod_{i = 1, \ldots, n} S_{g_i}$ then the lemma follows for the ring map $R \to S$. Hence we may assume that $S = \prod_{i = 1, \ldots, n} S_i$ is a finite product of standard \'etale morphisms. \medskip\noindent For each $i$ choose a ring map $R \to S_i'$ as in Lemma \ref{lemma-standard-etale-finite-flat-Zariski} adapted to the standard \'etale morphism $R \to S_i$. Set $S' = S_1' \otimes_R \ldots \otimes_R S_n'$; we will use the $R$-algebra maps $S_i' \to S'$ without further mention below. We claim this works. Properties (1) and (2) are immediate. For property (3) suppose that $\mathfrak q' \subset S'$ is a prime. Denote $\mathfrak p$ its image in $\Spec(R)$. Choose $i \in \{1, \ldots, n\}$ such that $\mathfrak p$ is in the image of $\Spec(S_i) \to \Spec(R)$; this is possible by assumption. Set $\mathfrak q_i' \subset S_i'$ the image of $\mathfrak q'$ in the spectrum of $S_i'$. By construction of $S'_i$ there exists a $g'_i \in S_i'$ such that $R \to (S_i')_{g_i'}$ factors as $R \to S_i \to (S_i')_{g_i'}$. Hence also $R \to S'_{g_i'}$ factors as $$ R \to S_i \to (S_i')_{g_i'} \to S'_{g_i'} $$ as desired.
By assumption the image $T$ of $V(g) \subset \Spec(S')$ under the morphism $\Spec(S') \to \Spec(R)$ does not contain $\mathfrak p$. By Section \ref{section-going-up} especially, Lemma \ref{lemma-going-up-closed} we see $T$ is closed. Pick $f \in R$, $f \not \in \mathfrak p$ such that $T \cap D(f) = \emptyset$. Then we see that $g$ becomes invertible in $S'_f$. Hence $S'_f \cong S_f$. Thus $S_f$ is both of finite type and integral over $R_f$, hence finite.
Denote $F = S \otimes_R \kappa(\mathfrak p)$ the fibre ring of $S/R$ at the prime $\mathfrak p$. As $F$ is of finite type over $\kappa(\mathfrak p)$ it is Noetherian and hence $\Spec(F)$ has finitely many isolated closed points. If there are no isolated closed points, i.e., no primes $\mathfrak q$ of $S$ over $\mathfrak p$ such that $S/R$ is quasi-finite at $\mathfrak q$, then the lemma holds. If there exists at least one such prime $\mathfrak q$, then we may apply Lemma \ref{lemma-etale-makes-quasi-finite-finite-one-prime}. This gives a diagram $$ \xymatrix{ S \ar[r] & R'\otimes_R S \ar@{=}[r] & A_1 \times B' \\ R \ar[r] \ar[u] & R' \ar[u] \ar[ru] } $$ as in said lemma. Since the residue fields at $\mathfrak p$ and $\mathfrak p'$ are the same, the fibre rings of $S/R$ and $(A_1 \times B')/R'$ are the same. Hence, by induction on the number of isolated closed points of the fibre we may assume that the lemma holds for $R' \to B'$ and $\mathfrak p'$. Thus we get an \'etale ring map $R' \to R''$, a prime $\mathfrak p'' \subset R''$ and a decomposition $$ R'' \otimes_{R'} B' = A_2 \times \ldots \times A_n \times B $$ We omit the verification that the ring map $R \to R''$, the prime $\mathfrak p''$ and the resulting decomposition $$ R'' \otimes_R S = (R'' \otimes_{R'} A_1) \times A_2 \times \ldots \times A_n \times B $$ is a solution to the problem posed in the lemma.
The strategy of the proof is to make two \'etale ring extensions: first we control the residue fields, then we apply Lemma \ref{lemma-etale-makes-quasi-finite-finite}. \medskip\noindent Denote $F = S \otimes_R \kappa(\mathfrak p)$ the fibre ring of $S/R$ at the prime $\mathfrak p$. As in the proof of Lemma \ref{lemma-etale-makes-quasi-finite-finite} there are finitely may primes, say $\mathfrak q_1, \ldots, \mathfrak q_n$ of $S$ lying over $R$ at which the ring map $R \to S$ is quasi-finite. Let $\kappa(\mathfrak p) \subset L_i \subset \kappa(\mathfrak q_i)$ be the subfield such that $\kappa(\mathfrak p) \subset L_i$ is separable, and the field extension $L_i \subset \kappa(\mathfrak q_i)$ is purely inseparable. Let $\kappa(\mathfrak p) \subset L$ be a finite Galois extension into which $L_i$ embeds for $i = 1, \ldots, n$. By Lemma \ref{lemma-make-etale-map-prescribed-residue-field} we can find an \'etale ring extension $R \to R'$ together with a prime $\mathfrak p'$ lying over $\mathfrak p$ such that the field extension $\kappa(\mathfrak p) \subset \kappa(\mathfrak p')$ is isomorphic to $\kappa(\mathfrak p) \subset L$. Thus the fibre ring of $R' \otimes_R S$ at $\mathfrak p'$ is isomorphic to $F \otimes_{\kappa(\mathfrak p)} L$. The primes lying over $\mathfrak q_i$ correspond to primes of $\kappa(\mathfrak q_i) \otimes_{\kappa(\mathfrak p)} L$ which is a product of fields purely inseparable over $L$ by our choice of $L$ and elementary field theory. These are also the only primes over $\mathfrak p'$ at which $R' \to R' \otimes_R S$ is quasi-finite, by Lemma \ref{lemma-quasi-finite-base-change}. Hence after replacing $R$ by $R'$, $\mathfrak p$ by $\mathfrak p'$, and $S$ by $R' \otimes_R S$ we may assume that for all primes $\mathfrak q$ lying over $\mathfrak p$ for which $S/R$ is quasi-finite the field extensions $\kappa(\mathfrak p) \subset \kappa(\mathfrak q)$ are purely inseparable. \medskip\noindent Next apply Lemma \ref{lemma-etale-makes-quasi-finite-finite}. The result is what we want since the field extensions do not change under this \'etale ring extension.
Write $S = T_{\mathfrak q}$ for some \'etale $R$-algebra $T$. By Proposition \ref{proposition-etale-locally-standard} we may assume $T$ is standard \'etale. Apply Lemma \ref{lemma-standard-etale-finite-flat-Zariski} to the ring map $R \to T$ to get $R \to S'$. Then in particular for every maximal ideal $\mathfrak m'$ of $S'$ we get a factorization $\varphi : T \to S'_{g'}$ for some $g' \not \in \mathfrak m'$ such that $\mathfrak q = \varphi^{-1}(\mathfrak m'S'_{g'})$. Thus $\varphi$ induces the desired local ring map $S \to S'_{\mathfrak m'}$.
Say $h^e + r_1 h^{e - 1} + \ldots + r_e = 0$ in the ring $B[x]/(f)$ with $r_i \in R$. There exists a finite free ring extension $B \subset B'$ such that $f = (x - \alpha_1) \ldots (x - \alpha_d)$ for some $\alpha_i \in B'$, see Lemma \ref{lemma-adjoin-roots}. Note that each $\alpha_i$ is integral over $R$. We may represent $h = h_0 + h_1 x + \ldots + h_{d - 1} x^{d - 1}$ with $h_i \in B$. Then it is a universal fact that $$ f' h \equiv \sum\nolimits_{i = 1, \ldots, d} h(\alpha_i) (x - \alpha_1) \ldots \widehat{(x - \alpha_i)} \ldots (x - \alpha_d) $$ as elements of $B[x]/(f)$. You prove this by evaluating both sides at the points $\alpha_i$ over the ring $B_{univ} = \mathbf{Z}[\alpha_i, h_j]$ (some details omitted). By our assumption that $h$ satisfies $h^e + r_1 h^{e - 1} + \ldots + r_e = 0$ in the ring $B[x]/(f)$ we see that $$ h(\alpha_i)^e + r_1 h(\alpha_i)^{e - 1} + \ldots + r_e = 0 $$ in $B'$. Hence $h(\alpha_i)$ is integral over $R$. Using the formula above we see that $f'h \equiv \sum_{j = 0, \ldots, d - 1} b'_j x^j$ in $B'[x]/(f)$ with $b'_j \in B'$ integral over $R$. However, since $f' h \in B[x]/(f)$ and since $1, x, \ldots, x^{d - 1}$ is a $B'$-basis for $B'[x]/(f)$ we see that $b'_j \in B$ as desired.
The map $S \otimes_R A \to A'$ is injective because $A \subset B$ and $R \to S$ is flat. We are going to use repeatedly that taking integral closure commutes with localization, see Lemma \ref{lemma-integral-closure-localize}. Hence we may localize on $S$, by Lemma \ref{lemma-cover} (the criterion for checking whether an $S$-module map is an isomorphism). Thus we may assume that $S = R[x]_g/(f) = (R[x]/(f))_g$ is standard \'etale over $R$, see Proposition \ref{proposition-etale-locally-standard}. Applying localization one more time we see that $A'$ is $(A'')_g$ where $A''$ is the integral closure of $R[x]/(f)$ in $B[x]/(f)$. Suppose that $a \in A''$. It suffices to show that $a$ is in $S \otimes_R A$. By Lemma \ref{lemma-trick} we see that $f' a = \sum a_i x^i$ with $a_i \in A$. Since $f'$ is invertible in $B[x]_g/(f)$ (by definition of a standard \'etale ring map) we conclude that $a \in S \otimes_R A$ as desired.
Arguing as in the proof of Lemma \ref{lemma-integral-closure-commutes-etale} we may localize on $S$. Hence we may assume that $R \to S$ is a standard smooth ring map, see Lemma \ref{lemma-smooth-syntomic}. By definition of a standard smooth ring map we see that $S$ is \'etale over a polynomial ring $R[x_1, \ldots, x_n]$. Since we have seen the result in the case of an \'etale ring extension (Lemma \ref{lemma-integral-closure-commutes-etale}) this reduces us to the case where $S = R[x]$. Thus we have to show $$ f = \sum b_i x^i \text{ integral over }R[x] \Leftrightarrow \text{each }b_i\text{ integral over }R. $$ The implication from right to left holds because the set of elements in $B[x]$ integral over $R[x]$ is a ring (Lemma \ref{lemma-integral-closure-is-ring}) and contains $x$. \medskip\noindent Suppose that $f \in B[x]$ is integral over $R[x]$, and assume that $f = \sum_{i < d} b_i x^i$ has degree $< d$. Since integral closure and localization commute, it suffices to show there exist distinct primes $p, q$ such that each $b_i$ is integral both over $R[1/p]$ and over $R[1/q]$. Hence, we can find a finite free ring extension $R \subset R'$ such that $R'$ contains $\alpha_1, \ldots, \alpha_d$ with the property that $\prod_{i < j} (\alpha_i - \alpha_j)$ is a unit in $R'$, see Example \ref{example-fourier}. In this case we have the universal equality $$ f = \sum_i f(\alpha_i) \frac{(x - \alpha_1) \ldots \widehat{(x - \alpha_i)} \ldots (x - \alpha_d)} {(\alpha_i - \alpha_1) \ldots \widehat{(\alpha_i - \alpha_i)} \ldots (\alpha_i - \alpha_d)}. $$ OK, and the elements $f(\alpha_i)$ are integral over $R'$ since $(R' \otimes_R B)[x] \to R' \otimes_R B$, $h \mapsto h(\alpha_i)$ is a ring map. Hence we see that the coefficients of $f$ in $(R' \otimes_R B)[x]$ are integral over $R'$. Since $R'$ is finite over $R$ (hence integral over $R$) we see that they are integral over $R$ also, as desired.
Let $J = \Ker(S \otimes_R S \to S)$ be the kernel of the multiplication map. Let $A_{univ} = S \otimes_R S/J^2$. Recall that $I_{univ} = J/J^2$ is isomorphic to $\Omega_{S/R}$, see Lemma \ref{lemma-differentials-diagonal}. Moreover, the two $R$-algebra maps $\sigma_1, \sigma_2 : S \to A_{univ}$, $\sigma_1(s) = s \otimes 1 \bmod J^2$, and $\sigma_2(s) = 1 \otimes s \bmod J^2$ differ by the universal derivation $\text{d} : S \to \Omega_{S/R} = I_{univ}$. \medskip\noindent Assume $R \to S$ formally unramified. Then we see that $\sigma_1 = \sigma_2$. Hence $\text{d}(s) = 0$ for all $s \in S$. Hence $\Omega_{S/R} = 0$. \medskip\noindent Assume that $\Omega_{S/R} = 0$. Let $A, I, R \to A, S \to A/I$ be a solid diagram as in Definition \ref{definition-formally-unramified}. Let $\tau_1, \tau_2 : S \to A$ be two dotted arrows making the diagram commute. Consider the $R$-algebra map $A_{univ} \to A$ defined by the rule $s_1 \otimes s_2 \mapsto \tau_1(s_1)\tau_2(s_2)$. We omit the verification that this is well defined. Since $A_{univ} \cong S$ as $I_{univ} = \Omega_{S/R} = 0$ we conclude that $\tau_1 = \tau_2$.
We have seen in Lemma \ref{lemma-characterize-formally-unramified} that (1) is equivalent to $\Omega_{S/R} = 0$. Similarly, by Lemma \ref{lemma-differentials-localize} we see that (2) and (3) are equivalent to $(\Omega_{S/R})_{\mathfrak q} = 0$ for all $\mathfrak q$. Hence the equivalence follows from Lemma \ref{lemma-characterize-zero-local}.
Choose a set of generators $z_i \in S$, $i \in I$ for $S$ as an $R$-algebra. Let $P = R[\{x_i\}_{i \in I}]$ denote the polynomial ring on generators $x_i$, $i \in I$. Consider the $R$-algebra map $P \to S$ which maps $x_i$ to $z_i$. Let $J = \Ker(P \to S)$. Consider the map $$ \text{d} : J/J^2 \longrightarrow \Omega_{P/R} \otimes_P S $$ see Lemma \ref{lemma-differential-seq}. This is surjective since $\Omega_{S/R} = 0$ by assumption, see Lemma \ref{lemma-characterize-formally-unramified}. Note that $\Omega_{P/R}$ is free on $\text{d}x_i$, and hence the module $\Omega_{P/R} \otimes_P S$ is free over $S$. Thus we may choose a splitting of the surjection above and write $$ J/J^2 = K \oplus \Omega_{P/R} \otimes_P S $$ Let $J^2 \subset J' \subset J$ be the ideal of $P$ such that $J'/J^2$ is the second summand in the decomposition above. Set $S' = P/J'$. We obtain a short exact sequence $$ 0 \to J/J' \to S' \to S \to 0 $$ and we see that $J/J' \cong K$ is a square zero ideal in $S'$. Hence $$ \xymatrix{ S \ar[r]_1 & S \\ R \ar[r] \ar[u] & S' \ar[u] } $$ is a diagram as above. In fact we claim that this is an initial object in the category of diagrams. Namely, let $(I \subset A, a, b)$ be an arbitrary diagram. We may choose an $R$-algebra map $\beta : P \to A$ such that $$ \xymatrix{ S \ar[r]_1 & S \ar[r]_a & A/I \\ R \ar[r] \ar@/_/[rr]_b \ar[u] & P \ar[u] \ar[r]^\beta & A \ar[u] } $$ is commutative. Now it may not be the case that $\beta(J') = 0$, in other words it may not be true that $\beta$ factors through $S' = P/J'$. But what is clear is that $\beta(J') \subset I$ and since $\beta(J) \subset I$ and $I^2 = 0$ we have $\beta(J^2) = 0$. Thus the ``obstruction'' to finding a morphism from $(J/J' \subset S', 1, R \to S')$ to $(I \subset A, a, b)$ is the corresponding $S$-linear map $\overline{\beta} : J'/J^2 \to I$. The choice in picking $\beta$ lies in the choice of $\beta(x_i)$. A different choice of $\beta$, say $\beta'$, is gotten by taking $\beta'(x_i) = \beta(x_i) + \delta_i$ with $\delta_i \in I$. In this case, for $g \in J'$, we obtain $$ \beta'(g) = \beta(g) + \sum\nolimits_i \delta_i \frac{\partial g}{\partial x_i}. $$ Since the map $\text{d}|_{J'/J^2} : J'/J^2 \to \Omega_{P/R} \otimes_P S$ given by $g \mapsto \frac{\partial g}{\partial x_i}\text{d}x_i$ is an isomorphism by construction, we see that there is a unique choice of $\delta_i \in I$ such that $\beta'(g) = 0$ for all $g \in J'$. (Namely, $\delta_i$ is $-\overline{\beta}(g)$ where $g \in J'/J^2$ is the unique element with $\frac{\partial g}{\partial x_j} = 1$ if $i = j$ and $0$ else.) The uniqueness of the solution implies the uniqueness required in the lemma.
We are going to use the construction of $B'$ from the proof of Lemma \ref{lemma-universal-thickening} although in principle it should be possible to deduce these results formally from the definition. Namely, we choose a presentation $B = P/J$, where $P = A[x_i]$ is a polynomial ring over $A$. Next, we choose elements $f_i \in J$ such that $\text{d}f_i = \text{d}x_i \otimes 1$ in $\Omega_{P/A} \otimes_P B$. Having made these choices we have $B' = P/J'$ with $J' = (f_i) + J^2$, see proof of Lemma \ref{lemma-universal-thickening}. \medskip\noindent Consider the canonical exact sequence $$ J'/(J')^2 \to \Omega_{P/A} \otimes_P B' \to \Omega_{B'/A} \to 0 $$ see Lemma \ref{lemma-differential-seq}. By construction the classes of the $f_i \in J'$ map to elements of the module $\Omega_{P/A} \otimes_P B'$ which generate it modulo $J'/J^2$ by construction. Since $J'/J^2$ is a nilpotent ideal, we see that these elements generate the module altogether (by Nakayama's Lemma \ref{lemma-NAK}). This proves that $\Omega_{B'/A} = 0$ and hence that $B'$ is formally unramified over $A$, see Lemma \ref{lemma-characterize-formally-unramified}. \medskip\noindent Since $P$ is a polynomial ring over $A$ we have $\Omega_{P/R} = \Omega_{A/R} \otimes_A P \oplus \bigoplus P\text{d}x_i$. We are going to use this decomposition. Consider the following exact sequence $$ J'/(J')^2 \to \Omega_{P/R} \otimes_P B' \to \Omega_{B'/R} \to 0 $$ see Lemma \ref{lemma-differential-seq}. We may tensor this with $B$ and obtain the exact sequence $$ J'/(J')^2 \otimes_{B'} B \to \Omega_{P/R} \otimes_P B \to \Omega_{B'/R} \otimes_{B'} B \to 0 $$ If we remember that $J' = (f_i) + J^2$ then we see that the first arrow annihilates the submodule $J^2/(J')^2$. In terms of the direct sum decomposition $\Omega_{P/R} \otimes_P B = \Omega_{A/R} \otimes_A B \oplus \bigoplus B\text{d}x_i $ given we see that the submodule $(f_i)/(J')^2 \otimes_{B'} B$ maps isomorphically onto the summand $\bigoplus B\text{d}x_i$. Hence what is left of this exact sequence is an isomorphism $\Omega_{A/R} \otimes_A B \to \Omega_{B'/R} \otimes_{B'} B$ as desired.
Assume that $R \to S$ is formally \'etale. Then $R \to S$ is smooth by Proposition \ref{proposition-smooth-formally-smooth}. By Lemma \ref{lemma-characterize-formally-unramified} we have $\Omega_{S/R} = 0$. Hence $R \to S$ is \'etale by definition. \medskip\noindent Assume that $R \to S$ is \'etale. Then $R \to S$ is formally smooth by Proposition \ref{proposition-smooth-formally-smooth}. By Lemma \ref{lemma-characterize-formally-unramified} it is formally unramified. Hence $R \to S$ is formally \'etale.