hcju/stacksqa huggingface dataset:
The map $P^1_{S/R}(M) \to M$ is given above. Let $N$ be an $S$-module and let $D : M \to N$ be a differential operator of order $1$. For $m \in M$ the map $$ g \longmapsto D(gm) - gD(m) $$ is an $R$-derivation $S \to N$ by the axioms for differential operators of order $1$. Thus it corresponds to a linear map $D_m : \Omega_{S/R} \to N$ determined by the rule $a\text{d}b \mapsto aD(bm) - abD(m)$ (see Lemma \ref{lemma-universal-omega}). The map $$ \Omega_{S/R} \times M \longrightarrow N,\quad (\eta, m) \longmapsto D_m(\eta) $$ is $S$-bilinear (details omitted) and hence determines an $S$-linear map $$ \sigma_D : \Omega_{S/R} \otimes_S M \to N $$ In this way we obtain a map $\text{Diff}^1(M, N) \to \Hom_S(\Omega_{S/R} \otimes_S M, N)$, $D \mapsto \sigma_D$ functorial in $N$. By the Yoneda lemma this corresponds a map $\Omega_{S/R} \otimes_S M \to P^1_{S/R}(M)$. It is immediate from the construction that this map is functorial in $M$. The sequence $$ \Omega_{S/R} \otimes_S M \to P^1_{S/R}(M) \to M \to 0 $$ is exact because for every module $N$ the sequence $$ 0 \to \Hom_S(M, N) \to \text{Diff}^1(M, N) \to \Hom_S(\Omega_{S/R} \otimes_S M, N) $$ is exact by inspection. \medskip\noindent To see that $\Omega_{S/R} \otimes_S M \to P^1_{S/R}(M)$ is injective we argue as follows. Choose an exact sequence $$ 0 \to M' \to F \to M \to 0 $$ with $F$ a free $S$-module. This induces an exact sequence $$ 0 \to \text{Diff}^1(M, N) \to \text{Diff}^1(F, N) \to \text{Diff}^1(M', N) $$ for all $N$. This proves that in the commutative diagram $$ \xymatrix{ 0 \ar[r] & \Omega_{S/R} \otimes_S M' \ar[r] \ar[d] & P^1_{S/R}(M') \ar[r] \ar[d] & M' \ar[r] \ar[d] & 0 \\ 0 \ar[r] & \Omega_{S/R} \otimes_S F \ar[r] \ar[d] & P^1_{S/R}(F) \ar[r] \ar[d] & F \ar[r] \ar[d] & 0 \\ 0 \ar[r] & \Omega_{S/R} \otimes_S M \ar[r] \ar[d] & P^1_{S/R}(M) \ar[r] \ar[d] & M \ar[r] \ar[d] & 0 \\ & 0 & 0 & 0 } $$ the middle column is exact. The left column is exact by right exactness of $\Omega_{S/R} \otimes_S -$. By the snake lemma (see Section \ref{section-snake}) it suffices to prove exactness on the left for the free module $F$. Using that $P^1_{S/R}(-)$ commutes with direct sums we reduce to the case $M = S$. This case is a consequence of the discussion in Example \ref{example-derivations-and-differential-operators}.
Namely, we claim that the set of elements $g \in B$ such that $D \circ g - g \circ D$ is a differential operator of order $k - 1$ is an $A$-subalgebra of $B$. This follows from the relations $$ D \circ (g + g') - (g + g') \circ D = (D \circ g - g \circ D) + (D \circ g' - g' \circ D) $$ and $$ D \circ gg' - gg' \circ D = (D \circ g - g \circ D) \circ g' + g \circ (D \circ g' - g' \circ D) $$ Strictly speaking, to conclude for products we also use Lemma \ref{lemma-composition-differential-operators}.
By induction on $k$. If $k = 0$, then $D$ is $B$-linear and hence we get the extension by the functoriality of localization. Given $b \in B$ the operator $L_b : m \mapsto D(bm) - bD(m)$ has order $k - 1$. Hence it has a unique extension to a differential operator $E_b : S^{-1}M \to S^{-1}N$ of order $k - 1$ by induction. Moreover, a computation shows that $L_{b'b} = L_{b'} \circ b + b' \circ L_b$ hence by uniqueness we obtain $E_{b'b} = E_{b'} \circ b + b' \circ E_b$. Similarly, we obtain $E_{b'} \circ b - b \circ E_{b'} = E_b \circ b' - b' \circ E_b$. Now for $m \in M$ and $g \in S$ we set $$ E(m/g) = (1/g)(D(m) - E_g(m/g)) $$ To show that this is well defined it suffices to show that for $g' \in S$ if we use the representative $g'm/g'g$ we get the same result. We compute \begin{align*} (1/g'g)(D(g'm) - E_{g'g}(g'm/gg')) & = (1/gg')(g'D(m) + E_{g'}(m) - E_{g'g}(g'm/gg')) \\ & = (1/g'g)(g'D(m) - g' E_g(m/g)) \end{align*} which is the same as before. It is clear that $E$ is $R$-linear as $D$ and $E_g$ are $R$-linear. Taking $g = 1$ and using that $E_1 = 0$ we see that $E$ extends $D$. By Lemma \ref{lemma-check-differential-operators} it now suffices to show that $E \circ b - b \circ E$ for $b \in B$ and $E \circ 1/g' - 1/g' \circ E$ for $g' \in S$ are differential operators of order $k - 1$ in order to show that $E$ is a differential operator of order $k$. For the first, choose an element $m/g$ in $S^{-1}M$ and observe that \begin{align*} E(b m/g) - bE(m/g) & = (1/g)(D(bm) - bD(m) - E_g(bm/g) + bE_g(m/g)) \\ & = (1/g)(L_b(m) - E_b(m) + gE_b(m/g)) \\ & = E_b(m/g) \end{align*} which is a differential operator of order $k - 1$. Finally, we have \begin{align*} E(m/g'g) - (1/g')E(m/g) & = (1/g'g)(D(m) - E_{g'g}(m/g'g)) - (1/g'g)(D(m) - E_g(m/g)) \\ & = -(1/g')E_{g'}(m/g'g) \end{align*} which also is a differential operator of order $k - 1$ as the composition of linear maps (multiplication by $1/g'$ and signs) and $E_{g'}$. We omit the proof of uniqueness.
It is clear that $D' = D \otimes \text{id}_N$ is $B$-linear. By Lemma \ref{lemma-check-differential-operators} it suffices to show that $$ D' \circ a \otimes 1 -  a \otimes 1 \circ D' = (D \circ a - a \circ D) \otimes \text{id}_N $$ is a differential operator of order $k - 1$ which follows by induction on $k$.
The precise definition of the maps is omitted. The exactness of the top row follows as the $\text{d}x_s$, $\text{d}y_t$ form a basis for the middle module. The map $\gamma$ factors $$ A[x_s, y_t] \to B[y_t] \to C $$ with surjective first arrow and second arrow equal to $\beta$. Thus we see that $K \to J$ is surjective. Moreover, the kernel of the first displayed arrow is $IA[x_s, y_t]$. Hence $I/I^2 \otimes C$ surjects onto the kernel of $K/K^2 \to J/J^2$. Finally, we can use Lemma \ref{lemma-NL-homotopy} to identify the terms as homology groups of the naive cotangent complexes. The final assertion follows as the degree $0$ term of the complex $\NL_{B/A}$ is a free $B$-module.
Since $A \to S^{-1}A$ is flat we see that $\NL_{S^{-1}A/A} \otimes_A S^{-1}A \to \NL_{S^{-1}A/S^{-1}A}$ is a homotopy equivalence by flat base change (Lemma \ref{lemma-change-base-NL}). Since the source of the arrow is isomorphic to $\NL_{S^{-1}A/A}$ and the target of the arrow is zero (by Lemma \ref{lemma-NL-surjection}) we win.
Choose a presentation $\alpha : P \to B$ of $B$ over $A$. Then $\beta : S^{-1}P \to B$ is a presentation of $B$ over $S^{-1}A$. A direct computation shows that we have $\NL(\alpha) = \NL(\beta)$ which proves the lemma as the naive cotangent complex is well defined up to homotopy by Lemma \ref{lemma-NL-homotopy}.
Since $P[x]/(I, fx - 1) = B[x]/(gx - 1) = B_g$ we get the statement about $I$ and $fx - 1$ generating $J$. Consider the commutative diagram $$ \xymatrix{ 0 \ar[r] & \Omega_{P/A} \otimes B_g \ar[r] & \Omega_{P[x]/A} \otimes B_g \ar[r] & \Omega_{B[x]/B} \otimes B_g \ar[r] & 0 \\ & (I/I^2)_g \ar[r] \ar[u] & J/J^2 \ar[r] \ar[u] & (gx - 1)/(gx - 1)^2 \ar[r] \ar[u] & 0 } $$ with exact rows of Lemma \ref{lemma-exact-sequence-NL}. The $B_g$-module $\Omega_{B[x]/B} \otimes B_g$ is free of rank $1$ on $\text{d}x$. The element $\text{d}x$ in the $B_g$-module $\Omega_{P[x]/A} \otimes B_g$ provides a splitting for the top row. The element $gx - 1 \in (gx - 1)/(gx - 1)^2$ is mapped to $g\text{d}x$ in $\Omega_{B[x]/B} \otimes B_g$ and hence $(gx - 1)/(gx - 1)^2$ is free of rank $1$ over $B_g$. (This can also be seen by arguing that $gx - 1$ is a nonzerodivisor in $B[x]$ because it is a polynomial with invertible constant term and any nonzerodivisor gives a quasi-regular sequence of length $1$ by Lemma \ref{lemma-regular-quasi-regular}.) \medskip\noindent Let us prove $(I/I^2)_g \to J/J^2$ injective. Consider the $P$-algebra map $$ \pi : P[x] \to (P/I^2)_f = P_f/I_f^2 $$ sending $x$ to $1/f$. Since $J$ is generated by $I$ and $fx - 1$ we see that $\pi(J) \subset (I/I^2)_f = (I/I^2)_g$. Since this is an ideal of square zero we see that $\pi(J^2) = 0$. If $a \in I$ maps to an element of $J^2$ in $J$, then $\pi(a) = 0$, which implies that $a$ maps to zero in $I_f/I_f^2$. This proves the desired injectivity. \medskip\noindent Thus we have a short exact sequence of two term complexes $$ 0 \to \NL(\alpha) \otimes_B B_g \to \NL(\beta) \to (B_g \xrightarrow{g} B_g) \to 0 $$ Such a short exact sequence can always be split in the category of complexes. In our particular case we can take as splittings $$ J/J^2 = (I/I^2)_g \oplus B_g (fx - 1)\quad\text{and}\quad \Omega_{P[x]/A} \otimes B_g = \Omega_{P/A} \otimes B_g \oplus B_g (g^{-2}\text{d}f + \text{d}x) $$ This works because $\text{d}(fx - 1) = x\text{d}f + f \text{d}x = g(g^{-2}\text{d}f + \text{d}x)$ in $\Omega_{P[x]/A} \otimes B_g$.
We have $S^{-1}B = \colim_{g \in S} B_g$ where we think of $S$ as a directed set (ordering by divisibility), see Lemma \ref{lemma-localization-colimit}. By Lemma \ref{lemma-principal-localization-NL} each of the maps $\NL_{B/A} \otimes_B B_g \to \NL_{B_g/A}$ are quasi-isomorphisms. The lemma follows from Lemma \ref{lemma-colimits-NL}.
The second statement follows immediately from the first. Proof of the first statement. If $S_g$ is the zero ring, then it is true. Assume $S_g$ is nonzero. Write $S = k[x_1, \ldots, x_n]/(f_1, \ldots, f_c)$ with $n - c = \dim(S)$ as in Definition \ref{definition-lci-field}. By the remarks following the definition $S$ is equidimensional of dimension $n - c$, so $\dim(S_g) = n - c$ as well. Let $g' \in k[x_1, \ldots, x_n]$ be an element whose residue class corresponds to $g$. Then $S_g =  k[x_1, \ldots, x_n, x_{n + 1}]/(f_1, \ldots, f_c, x_{n + 1}g' - 1)$ as desired.
Choose a maximal prime $\mathfrak m$ of $S$. We have to show that $S_\mathfrak m$ is Cohen-Macaulay. By assumption we may assume $S = k[x_1, \ldots, x_n]/(f_1, \ldots, f_c)$ with $\dim(S) = n - c$. Let $\mathfrak m' \subset k[x_1, \ldots, x_n]$ be the maximal ideal corresponding to $\mathfrak m$. According to Proposition \ref{proposition-finite-gl-dim-polynomial-ring} the local ring $k[x_1, \ldots, x_n]_{\mathfrak m'}$ is regular local of dimension $n$. In particular it is Cohen-Macaulay by Lemma \ref{lemma-regular-ring-CM}. By Lemma \ref{lemma-one-equation} applied $c$ times the local ring $S_{\mathfrak m} = k[x_1, \ldots, x_n]_{\mathfrak m'}/(f_1, \ldots, f_c)$ has dimension $\geq n - c$. By assumption $\dim(S_{\mathfrak m}) \leq n - c$. Thus we get equality. This implies that $f_1, \ldots, f_c$ is a regular sequence in $k[x_1, \ldots, x_n]_{\mathfrak m'}$ and that $S_{\mathfrak m}$ is Cohen-Macaulay, see Proposition \ref{proposition-CM-module}.
Set $R = k[x_1, \ldots, x_n]_{\mathfrak q'}$. This is a Cohen-Macaulay local ring of dimension $\text{height}(\mathfrak q')$, see for example Lemma \ref{lemma-lci-CM}. Moreover, $\overline{R} = R/IR = R/I_{\mathfrak q'} = S_{\mathfrak q}$ is a quotient of dimension $\text{height}(\mathfrak q)$. Let $f_1, \ldots, f_c \in I_{\mathfrak q'}$ be elements which generate $(I/I^2)_{\mathfrak q}$. By Lemma \ref{lemma-NAK} we see that $f_1, \ldots, f_c$ generate $I_{\mathfrak q'}$. Since the dimensions work out, we conclude by Proposition \ref{proposition-CM-module} that $f_1, \ldots, f_c$ is a regular sequence in $R$. By Lemma \ref{lemma-regular-quasi-regular} we see that $(I/I^2)_{\mathfrak q}$ is free. These arguments show that (2), (3), (4) are equivalent and that they imply the last statement of the lemma, and therefore they imply (5). \medskip\noindent If (5) holds, say $I_{\mathfrak q'}$ is generated by a regular sequence of length $e$, then $\text{height}(\mathfrak q) = \dim(S_{\mathfrak q}) = \dim(k[x_1, \ldots, x_n]_{\mathfrak q'}) - e = \text{height}(\mathfrak q') - e$ by dimension theory, see Section \ref{section-dimension}. We conclude that $e = c$. Thus (5) implies (2). \medskip\noindent We continue with the notation introduced in the first paragraph. For each $f_i$ we may find $d_i \in k[x_1, \ldots, x_n]$, $d_i \not \in \mathfrak q'$ such that $f_i' = d_i f_i \in k[x_1, \ldots, x_n]$. Then it is still true that $I_{\mathfrak q'} = (f_1', \ldots, f_c')R$. Hence there exists a $g' \in k[x_1, \ldots, x_n]$, $g' \not \in \mathfrak q'$ such that $I_{g'} = (f_1', \ldots, f_c')$. Moreover, pick $g'' \in k[x_1, \ldots, x_n]$, $g'' \not \in \mathfrak q'$ such that $\dim(S_{g''}) = \dim_{\mathfrak q} \Spec(S)$. By Lemma \ref{lemma-codimension} this dimension is equal to $n - c$. Finally, set $g$ equal to the image of $g'g''$ in $S$. Then we see that $$ S_g \cong k[x_1, \ldots, x_n, x_{n + 1}] / (f_1', \ldots, f_c', x_{n + 1}g'g'' - 1) $$ and by our choice of $g''$ this ring has dimension $n - c$. Therefore it is a global complete intersection. Thus each of (2), (3), and (4) implies (1). \medskip\noindent Assume (1). Let $S_g \cong k[y_1, \ldots, y_m]/(f_1, \ldots, f_t)$ be a presentation of $S_g$ as a global complete intersection. Write $J = (f_1, \ldots, f_t)$. Let $\mathfrak q'' \subset k[y_1, \ldots, y_m]$ be the prime corresponding to $\mathfrak qS_g$. Note that $t = m - \dim(S_g) = \text{height}(\mathfrak q'') - \text{height}(\mathfrak q)$, see Lemma \ref{lemma-codimension} for the last equality. As seen in the proof of Lemma \ref{lemma-lci-CM} (and also above) the elements $f_1, \ldots, f_t$ form a regular sequence in the local ring $k[y_1, \ldots, y_m]_{\mathfrak q''}$. By Lemma \ref{lemma-regular-quasi-regular} we see that $(J/J^2)_{\mathfrak q}$ is free of rank $t$. By Lemma \ref{lemma-conormal-module-localize} we have $$ J/J^2 \oplus S_g^n \cong (I/I^2)_g \oplus S_g^m $$ Thus $(I/I^2)_{\mathfrak q}$ is free of rank $t + n - m = m - \dim(S_g) + n - m = n - \dim(S_g) = \text{height}(\mathfrak q') - \text{height}(\mathfrak q) = c$. Thus we obtain (4).
A regular local ring is Cohen-Macaulay, see Lemma \ref{lemma-regular-ring-CM}. Hence the equivalences (1) $\Leftrightarrow$ (2) and (3) $\Leftrightarrow$ (4), see Proposition \ref{proposition-CM-module}. By Lemma \ref{lemma-regular-quotient-regular} the ideal $\Ker(A \to B)$ can be generated by $\dim(A) - \dim(B)$ elements. Hence we see that (4) implies (2). \medskip\noindent It remains to show that (1) implies (4). We do this by induction on $\dim(A) - \dim(B)$. The case $\dim(A) - \dim(B) = 0$ is trivial. Assume $\dim(A) > \dim (B)$. Write $I = \Ker(A \to C)$ and $J = \Ker(A \to B)$. Note that $J \subset I$. Our assumption is that the minimal number of generators of $I$ is $\dim(A) - \dim(C)$. Let $\mathfrak m \subset A$ be the maximal ideal. Consider the maps $$ J/ \mathfrak m J \to  I / \mathfrak m I \to \mathfrak m /\mathfrak m^2 $$ By Lemma \ref{lemma-regular-quotient-regular} and its proof the composition is injective. Take any element $x \in J$ which is not zero in $J /\mathfrak mJ$. By the above and Nakayama's lemma $x$ is an element of a minimal set of generators of $I$. Hence we may replace $A$ by $A/xA$ and $I$ by $I/xA$ which decreases both $\dim(A)$ and the minimal number of generators of $I$ by $1$. Thus we win.
It is clear that (2) implies (1) and (1) implies (3). It is also clear that (4) implies (5). Let us show that (3) implies (4). Thus we assume there exists a surjection $R \to S$ with $R$ a regular local ring essentially of finite presentation over $k$ such that the ideal $\Ker(R \to S)$ can be generated by $\dim(R) - \dim(S)$ elements. We may write $R = (k[x_1, \ldots, x_n]/J)_{\mathfrak q}$ for some $J \subset k[x_1, \ldots, x_n]$ and some prime $\mathfrak q \subset k[x_1, \ldots, x_n]$ with $J \subset \mathfrak q$. Let $I \subset k[x_1, \ldots, x_n]$ be the kernel of the map $k[x_1, \ldots, x_n] \to S$ so that $S \cong (k[x_1, \ldots, x_n]/I)_{\mathfrak q}$. By assumption $(I/J)_{\mathfrak q}$ is generated by $\dim(R) - \dim(S)$ elements. We conclude that $I_{\mathfrak q}$ can be generated by $\dim(k[x_1, \ldots, x_n]_{\mathfrak q}) - \dim(S)$ elements by Lemma \ref{lemma-ci-well-defined}. From Lemma \ref{lemma-lci} we see that for some $g \in k[x_1, \ldots, x_n]$, $g \not \in \mathfrak q$ the algebra $(k[x_1, \ldots, x_n]/I)_g$ is a global complete intersection and $S$ is isomorphic to a local ring of it. \medskip\noindent To finish the proof of the lemma we have to show that (5) implies (2). Assume (5) and let $\pi : R \to S$ be a surjection with $R$ a regular local $k$-algebra essentially of finite type over $k$. By assumption we have $S = A_{\mathfrak a}$ for some local complete intersection $A$ over $k$. Choose a presentation $R = (k[y_1, \ldots, y_m]/J)_{\mathfrak q}$ with $J \subset \mathfrak q \subset k[y_1, \ldots, y_m]$. We may and do assume that $J$ is the kernel of the map $k[y_1, \ldots, y_m] \to R$. Let $I \subset k[y_1, \ldots, y_m]$ be the kernel of the map $k[y_1, \ldots, y_m] \to S = A_{\mathfrak a}$. Then $J \subset I$ and $(I/J)_{\mathfrak q}$ is the kernel of the surjection $\pi : R \to S$. So $S = (k[y_1, \ldots, y_m]/I)_{\mathfrak q}$. \medskip\noindent By Lemma \ref{lemma-isomorphic-local-rings} we see that there exist $g \in A$, $g \not \in \mathfrak a$ and $g' \in k[y_1, \ldots, y_m]$, $g' \not \in \mathfrak q$ such that $A_g \cong (k[y_1, \ldots, y_m]/I)_{g'}$. After replacing $A$ by $A_g$ and $k[y_1, \ldots, y_m]$ by $k[y_1, \ldots, y_{m + 1}]$ we may assume that $A \cong k[y_1, \ldots, y_m]/I$. Consider the surjective maps of local rings $$ k[y_1, \ldots, y_m]_{\mathfrak q} \to R \to S. $$ We have to show that the kernel of $R \to S$ is generated by a regular sequence. By Lemma \ref{lemma-lci} we know that $k[y_1, \ldots, y_m]_{\mathfrak q} \to A_{\mathfrak a} = S$ has this property (as $A$ is a local complete intersection over $k$). We win by Lemma \ref{lemma-ci-well-defined}.
Choose a presentation $S = k[x_1, \ldots, x_n]/I$. This gives a presentation $S_K = K[x_1, \ldots, x_n]/I_K$ where $I_K = K \otimes_k I$. Let $\mathfrak q_K' \subset K[x_1, \ldots, x_n]$, resp.\ $\mathfrak q' \subset k[x_1, \ldots, x_n]$ be the corresponding prime. We will show that the equivalent conditions of Lemma \ref{lemma-lci} hold for the pair $(S = k[x_1, \ldots, x_n]/I, \mathfrak q)$ if and only if they hold for the pair $(S_K = K[x_1, \ldots, x_n]/I_K, \mathfrak q_K)$. The lemma will follow from this (see Lemma \ref{lemma-lci-at-prime}). \medskip\noindent By Lemma \ref{lemma-dimension-at-a-point-preserved-field-extension} we have $\dim_{\mathfrak q} S = \dim_{\mathfrak q_K} S_K$. Hence the integer $c$ occurring in Lemma \ref{lemma-lci} is the same for the pair $(S = k[x_1, \ldots, x_n]/I, \mathfrak q)$ as for the pair $(S_K = K[x_1, \ldots, x_n]/I_K, \mathfrak q_K)$. On the other hand we have \begin{eqnarray*} I \otimes_{k[x_1, \ldots, x_n]} \kappa(\mathfrak q') \otimes_{\kappa(\mathfrak q')} \kappa(\mathfrak q_K') & = & I \otimes_{k[x_1, \ldots, x_n]} \kappa(\mathfrak q_K') \\ & = & I \otimes_{k[x_1, \ldots, x_n]} K[x_1, \ldots, x_n] \otimes_{K[x_1, \ldots, x_n]} \kappa(\mathfrak q_K') \\ & = & (K \otimes_k I) \otimes_{K[x_1, \ldots, x_n]} \kappa(\mathfrak q_K') \\ & = & I_K \otimes_{K[x_1, \ldots, x_n]} \kappa(\mathfrak q'_K). \end{eqnarray*} Therefore, $\dim_{\kappa(\mathfrak q')} I \otimes_{k[x_1, \ldots, x_n]} \kappa(\mathfrak q') = \dim_{\kappa(\mathfrak q'_K)} I_K \otimes_{K[x_1, \ldots, x_n]} \kappa(\mathfrak q_K')$. Thus it follows from Nakayama's Lemma \ref{lemma-NAK} that the minimal number of generators of $I_{\mathfrak q'}$ is the same as the minimal number of generators of $(I_K)_{\mathfrak q'_K}$. Thus the lemma follows from characterization (2) of Lemma \ref{lemma-lci}.
Set $\overline{B} = B/\mathfrak m_RB = B/\mathfrak m_AB$ so that $\overline{B} = \overline{S}/\overline{J}$. Let $f_1, \ldots, f_{\overline{c}} \in J$ be elements such that $\overline{f}_1, \ldots, \overline{f}_{\overline{c}} \in \overline{J}$ form a regular sequence generating $\overline{J}$. Note that $\overline{c} = \dim(\overline{S}) - \dim(\overline{B})$, see Lemma \ref{lemma-ci-well-defined}. By Lemma \ref{lemma-grothendieck-regular-sequence} the ring $S/(f_1, \ldots, f_{\overline{c}})$ is flat over $R$. Hence $S/(f_1, \ldots, f_{\overline{c}}) + IS$ is flat over $A$. The map $S/(f_1, \ldots, f_{\overline{c}}) + IS \to B$ is therefore a surjection of finite $S/IS$-modules flat over $A$ which is an isomorphism modulo $\mathfrak m_A$, and hence an isomorphism by Lemma \ref{lemma-mod-injective}. In other words, $J = (f_1, \ldots, f_{\overline{c}}) + IS$. \medskip\noindent By Lemma \ref{lemma-ci-well-defined} again the ideal $J$ is generated by a regular sequence of $c = \dim(S) - \dim(B)$ elements. Hence $J/\mathfrak m_SJ$ is a vector space of dimension $c$. By the description of $J$ above there exist $g_1, \ldots, g_{c - \overline{c}} \in I$ such that $J$ is generated by $f_1, \ldots, f_{\overline{c}}, g_1, \ldots, g_{c - \overline{c}}$ (use Nakayama's Lemma \ref{lemma-NAK}). Consider the ring $A' = R/(g_1, \ldots, g_{c - \overline{c}})$ and the surjection $A' \to A$. We see from the above that $B = S/(f_1, \ldots, f_{\overline{c}}, g_1, \ldots, g_{c - \overline{c}})$ is flat over $A'$ (as $S/(f_1, \ldots, f_{\overline{c}})$ is flat over $R$). Hence $A' \to B$ is injective (as it is faithfully flat, see Lemma \ref{lemma-local-flat-ff}). Since this map factors through $A$ we get $A' = A$. Note that $\dim(B) = \dim(A) + \dim(\overline{B})$, and $\dim(S) = \dim(R) + \dim(\overline{S})$, see Lemma \ref{lemma-dimension-base-fibre-equals-total}. Hence $c - \overline{c} = \dim(R) -\dim(A)$ by elementary algebra. Thus $I = (g_1, \ldots, g_{c - \overline{c}})$ is generated by a regular sequence according to Lemma \ref{lemma-ci-well-defined}.
By Lemma \ref{lemma-finite-presentation-descends} and Lemma \ref{lemma-flatness-descends} this holds for the property of being flat and for the property of being of finite presentation. The map $\Spec(R') \to \Spec(R)$ is surjective, see Lemma \ref{lemma-ff-rings}. Thus it suffices to show given primes $\mathfrak p' \subset R'$ lying over $\mathfrak p \subset R$ that $S \otimes_R \kappa(\mathfrak p)$ is a local complete intersection if and only if $S' \otimes_{R'} \kappa(\mathfrak p')$ is a local complete intersection. Note that $S' \otimes_{R'} \kappa(\mathfrak p') = S \otimes_R \kappa(\mathfrak p) \otimes_{\kappa(\mathfrak p)} \kappa(\mathfrak p')$. Thus Lemma \ref{lemma-lci-field-change} applies.
Note that $I$ is a finitely generated ideal by Lemma \ref{lemma-finite-presentation-independent}. Let $f_1, \ldots, f_c \in I$ be elements which map to a basis of $I/I^2$. By Nakayama's lemma (Lemma \ref{lemma-NAK}) there exists a $g \in 1 + I$ such that $$ g \cdot I \subset (f_1, \ldots, f_c) $$ and $I_g \cong (f_1, \ldots, f_c)_g$. Hence we see that $$ S \cong R[x_1, \ldots, x_n]/(f_1, \ldots, f_c)[1/g] \cong R[x_1, \ldots, x_n, x_{n + 1}]/(f_1, \ldots, f_c, gx_{n + 1} - 1) $$ as desired. It follows that $f_1, \ldots, f_c,gx_{n + 1} - 1$ form a basis for $(f_1, \ldots, f_c, gx_{n + 1} - 1)/(f_1, \ldots, f_c, gx_{n + 1} - 1)^2$ for example by applying Lemma \ref{lemma-principal-localization-NL}.
By Lemma \ref{lemma-dimension-preserved-field-extension} the fibres of a base change have the same dimension as the fibres of the original map. Moreover $R' \otimes_R R[x_1, \ldots, x_n]/(f_1, \ldots, f_c) = R'[x_1, \ldots, x_n]/(f_1, \ldots, f_c)$. Thus (1) follows. The proof of (2) is that the localization at one element can be described as $S_g \cong S[x_{n + 1}]/(gx_{n + 1} - 1)$. Assertion (3) follows from (1) since under the assumptions of (3) we have $R_f \otimes_R S \cong S$.
Ad (1). By Lemma \ref{lemma-dimension-fibres-bounded-open-upstairs} there exists an open subset $W \subset \Spec(S)$ containing $V(IS)$ such that all fibres of $W \to \Spec(R)$ have dimension $\leq n - c$. Say $W = \Spec(S) \setminus V(J)$. Then $V(J) \cap V(IS) = \emptyset$ hence we can find a $g \in J$ which maps to $1 \in S/IS$. Let $h \in R[x_1, \ldots, x_n]$ be any preimage of $g$. \medskip\noindent Ad (2). By Lemma \ref{lemma-dimension-fibres-bounded-open-upstairs} there exists an open subset $W \subset \Spec(S)$ containing $\Spec(S \otimes_R \kappa(\mathfrak p))$ such that all fibres of $W \to \Spec(R)$ have dimension $\leq n - c$. Say $W = \Spec(S) \setminus V(J)$. Then $V(J \cdot S \otimes_R \kappa(\mathfrak p)) = \emptyset$. Hence we can find a $g \in J$ which maps to a unit in $S \otimes_R \kappa(\mathfrak p)$ (details omitted). Let $h \in R[x_1, \ldots, x_n]$ be any preimage of $g$. \medskip\noindent Ad (3). By Lemma \ref{lemma-dimension-fibres-bounded-open-upstairs} there exists a $g \in S$, $g \not \in \mathfrak q$ such that all nonempty fibres of $R \to S_g$ have dimension $\leq n - c$. Let $h \in R[x_1, \ldots, x_n]$ be any element that maps to $g$.