## 10.128 More flatness criteria

The following lemma is often used in algebraic geometry to show that a finite morphism from a normal surface to a smooth surface is flat. It is a partial converse to Lemma 10.112.9 because an injective finite local ring map certainly satisfies condition (3).

Lemma 10.128.1. Let $R \to S$ be a local homomorphism of Noetherian local rings. Assume

1. $R$ is regular,

2. $S$ Cohen-Macaulay,

3. $\dim (S) = \dim (R) + \dim (S/\mathfrak m_ R S)$.

Then $R \to S$ is flat.

Proof. By induction on $\dim (R)$. The case $\dim (R) = 0$ is trivial, because then $R$ is a field. Assume $\dim (R) > 0$. By (3) this implies that $\dim (S) > 0$. Let $\mathfrak q_1, \ldots , \mathfrak q_ r$ be the minimal primes of $S$. Note that $\mathfrak q_ i \not\supset \mathfrak m_ R S$ since

$\dim (S/\mathfrak q_ i) = \dim (S) > \dim (S/\mathfrak m_ R S)$

the first equality by Lemma 10.104.3 and the inequality by (3). Thus $\mathfrak p_ i = R \cap \mathfrak q_ i$ is not equal to $\mathfrak m_ R$. Pick $x \in \mathfrak m$, $x \not\in \mathfrak m^2$, and $x \not\in \mathfrak p_ i$, see Lemma 10.15.2. Hence we see that $x$ is not contained in any of the minimal primes of $S$. Hence $x$ is a nonzerodivisor on $S$ by (2), see Lemma 10.104.2 and $S/xS$ is Cohen-Macaulay with $\dim (S/xS) = \dim (S) - 1$. By (1) and Lemma 10.106.3 the ring $R/xR$ is regular with $\dim (R/xR) = \dim (R) - 1$. By induction we see that $R/xR \to S/xS$ is flat. Hence we conclude by Lemma 10.99.10 and the remark following it. $\square$

Lemma 10.128.2. Let $R \to S$ be a homomorphism of Noetherian local rings. Assume that $R$ is a regular local ring and that a regular system of parameters maps to a regular sequence in $S$. Then $R \to S$ is flat.

Proof. Suppose that $x_1, \ldots , x_ d$ are a system of parameters of $R$ which map to a regular sequence in $S$. Note that $S/(x_1, \ldots , x_ d)S$ is flat over $R/(x_1, \ldots , x_ d)$ as the latter is a field. Then $x_ d$ is a nonzerodivisor in $S/(x_1, \ldots , x_{d - 1})S$ hence $S/(x_1, \ldots , x_{d - 1})S$ is flat over $R/(x_1, \ldots , x_{d - 1})$ by the local criterion of flatness (see Lemma 10.99.10 and remarks following). Then $x_{d - 1}$ is a nonzerodivisor in $S/(x_1, \ldots , x_{d - 2})S$ hence $S/(x_1, \ldots , x_{d - 2})S$ is flat over $R/(x_1, \ldots , x_{d - 2})$ by the local criterion of flatness (see Lemma 10.99.10 and remarks following). Continue till one reaches the conclusion that $S$ is flat over $R$. $\square$

The following lemma is the key to proving that results for finitely presented modules over finitely presented rings over a base ring follow from the corresponding results for finite modules in the Noetherian case.

Lemma 10.128.3. Let $R \to S$, $M$, $\Lambda$, $R_\lambda \to S_\lambda$, $M_\lambda$ be as in Lemma 10.127.13. Assume that $M$ is flat over $R$. Then for some $\lambda \in \Lambda$ the module $M_\lambda$ is flat over $R_\lambda$.

Proof. Pick some $\lambda \in \Lambda$ and consider

$\text{Tor}_1^{R_\lambda }(M_\lambda , R_\lambda /\mathfrak m_\lambda ) = \mathop{\mathrm{Ker}}(\mathfrak m_\lambda \otimes _{R_\lambda } M_\lambda \to M_\lambda ).$

See Remark 10.75.9. The right hand side shows that this is a finitely generated $S_\lambda$-module (because $S_\lambda$ is Noetherian and the modules in question are finite). Let $\xi _1, \ldots , \xi _ n$ be generators. Because $M$ is flat over $R$ we have that $0 = \mathop{\mathrm{Ker}}(\mathfrak m_\lambda R \otimes _ R M \to M)$. Since $\otimes$ commutes with colimits we see there exists a $\lambda ' \geq \lambda$ such that each $\xi _ i$ maps to zero in $\mathfrak m_{\lambda }R_{\lambda '} \otimes _{R_{\lambda '}} M_{\lambda '}$. Hence we see that

$\text{Tor}_1^{R_\lambda }(M_\lambda , R_\lambda /\mathfrak m_\lambda ) \longrightarrow \text{Tor}_1^{R_{\lambda '}}(M_{\lambda '}, R_{\lambda '}/\mathfrak m_{\lambda }R_{\lambda '})$

is zero. Note that $M_\lambda \otimes _{R_\lambda } R_\lambda /\mathfrak m_\lambda$ is flat over $R_\lambda /\mathfrak m_\lambda$ because this last ring is a field. Hence we may apply Lemma 10.99.14 to get that $M_{\lambda '}$ is flat over $R_{\lambda '}$. $\square$

Using the lemma above we can start to reprove the results of Section 10.99 in the non-Noetherian case.

Lemma 10.128.4. Suppose that $R \to S$ is a local homomorphism of local rings. Denote $\mathfrak m$ the maximal ideal of $R$. Let $u : M \to N$ be a map of $S$-modules. Assume

1. $S$ is essentially of finite presentation over $R$,

2. $M$, $N$ are finitely presented over $S$,

3. $N$ is flat over $R$, and

4. $\overline{u} : M/\mathfrak mM \to N/\mathfrak mN$ is injective.

Then $u$ is injective, and $N/u(M)$ is flat over $R$.

Proof. By Lemma 10.127.13 and its proof we can find a system $R_\lambda \to S_\lambda$ of local ring maps together with maps of $S_\lambda$-modules $u_\lambda : M_\lambda \to N_\lambda$ satisfying the conclusions (1) – (6) for both $N$ and $M$ of that lemma and such that the colimit of the maps $u_\lambda$ is $u$. By Lemma 10.128.3 we may assume that $N_\lambda$ is flat over $R_\lambda$ for all sufficiently large $\lambda$. Denote $\mathfrak m_\lambda \subset R_\lambda$ the maximal ideal and $\kappa _\lambda = R_\lambda / \mathfrak m_\lambda$, resp. $\kappa = R/\mathfrak m$ the residue fields.

Consider the map

$\Psi _\lambda : M_\lambda /\mathfrak m_\lambda M_\lambda \otimes _{\kappa _\lambda } \kappa \longrightarrow M/\mathfrak m M.$

Since $S_\lambda /\mathfrak m_\lambda S_\lambda$ is essentially of finite type over the field $\kappa _\lambda$ we see that the tensor product $S_\lambda /\mathfrak m_\lambda S_\lambda \otimes _{\kappa _\lambda } \kappa$ is essentially of finite type over $\kappa$. Hence it is a Noetherian ring and we conclude the kernel of $\Psi _\lambda$ is finitely generated. Since $M/\mathfrak m M$ is the colimit of the system $M_\lambda /\mathfrak m_\lambda M_\lambda$ and $\kappa$ is the colimit of the fields $\kappa _\lambda$ there exists a $\lambda ' > \lambda$ such that the kernel of $\Psi _\lambda$ is generated by the kernel of

$\Psi _{\lambda , \lambda '} : M_\lambda /\mathfrak m_\lambda M_\lambda \otimes _{\kappa _\lambda } \kappa _{\lambda '} \longrightarrow M_{\lambda '}/\mathfrak m_{\lambda '} M_{\lambda '}.$

By construction there exists a multiplicative subset $W \subset S_\lambda \otimes _{R_\lambda } R_{\lambda '}$ such that $S_{\lambda '} = W^{-1}(S_\lambda \otimes _{R_\lambda } R_{\lambda '})$ and

$W^{-1}(M_\lambda /\mathfrak m_\lambda M_\lambda \otimes _{\kappa _\lambda } \kappa _{\lambda '}) = M_{\lambda '}/\mathfrak m_{\lambda '} M_{\lambda '}.$

Now suppose that $x$ is an element of the kernel of

$\Psi _{\lambda '} : M_{\lambda '}/\mathfrak m_{\lambda '} M_{\lambda '} \otimes _{\kappa _{\lambda '}} \kappa \longrightarrow M/\mathfrak m M.$

Then for some $w \in W$ we have $wx \in M_\lambda /\mathfrak m_\lambda M_\lambda \otimes \kappa$. Hence $wx \in \mathop{\mathrm{Ker}}(\Psi _\lambda )$. Hence $wx$ is a linear combination of elements in the kernel of $\Psi _{\lambda , \lambda '}$. Hence $wx = 0$ in $M_{\lambda '}/\mathfrak m_{\lambda '} M_{\lambda '} \otimes _{\kappa _{\lambda '}} \kappa$, hence $x = 0$ because $w$ is invertible in $S_{\lambda '}$. We conclude that the kernel of $\Psi _{\lambda '}$ is zero for all sufficiently large $\lambda '$!

By the result of the preceding paragraph we may assume that the kernel of $\Psi _\lambda$ is zero for all $\lambda$ sufficiently large, which implies that the map $M_\lambda /\mathfrak m_\lambda M_\lambda \to M/\mathfrak m M$ is injective. Combined with $\overline{u}$ being injective this formally implies that also $\overline{u_\lambda } : M_\lambda /\mathfrak m_\lambda M_\lambda \to N_\lambda /\mathfrak m_\lambda N_\lambda$ is injective. By Lemma 10.99.1 we conclude that (for all sufficiently large $\lambda$) the map $u_\lambda$ is injective and that $N_\lambda /u_\lambda (M_\lambda )$ is flat over $R_\lambda$. The lemma follows. $\square$

Lemma 10.128.5. Suppose that $R \to S$ is a local ring homomorphism of local rings. Denote $\mathfrak m$ the maximal ideal of $R$. Suppose

1. $S$ is essentially of finite presentation over $R$,

2. $S$ is flat over $R$, and

3. $f \in S$ is a nonzerodivisor in $S/{\mathfrak m}S$.

Then $S/fS$ is flat over $R$, and $f$ is a nonzerodivisor in $S$.

Proof. Follows directly from Lemma 10.128.4. $\square$

Lemma 10.128.6. Suppose that $R \to S$ is a local ring homomorphism of local rings. Denote $\mathfrak m$ the maximal ideal of $R$. Suppose

1. $R \to S$ is essentially of finite presentation,

2. $R \to S$ is flat, and

3. $f_1, \ldots , f_ c$ is a sequence of elements of $S$ such that the images $\overline{f}_1, \ldots , \overline{f}_ c$ form a regular sequence in $S/{\mathfrak m}S$.

Then $f_1, \ldots , f_ c$ is a regular sequence in $S$ and each of the quotients $S/(f_1, \ldots , f_ i)$ is flat over $R$.

Proof. Induction and Lemma 10.128.5. $\square$

Here is the version of the local criterion of flatness for the case of local ring maps which are locally of finite presentation.

Lemma 10.128.7. Let $R \to S$ be a local homomorphism of local rings. Let $I \not= R$ be an ideal in $R$. Let $M$ be an $S$-module. Assume

1. $S$ is essentially of finite presentation over $R$,

2. $M$ is of finite presentation over $S$,

3. $\text{Tor}_1^ R(M, R/I) = 0$, and

4. $M/IM$ is flat over $R/I$.

Then $M$ is flat over $R$.

Proof. Let $\Lambda$, $R_\lambda \to S_\lambda$, $M_\lambda$ be as in Lemma 10.127.13. Denote $I_\lambda \subset R_\lambda$ the inverse image of $I$. In this case the system $R/I \to S/IS$, $M/IM$, $R_\lambda \to S_\lambda /I_\lambda S_\lambda$, and $M_\lambda /I_\lambda M_\lambda$ satisfies the conclusions of Lemma 10.127.13 as well. Hence by Lemma 10.128.3 we may assume (after shrinking the index set $\Lambda$) that $M_\lambda /I_\lambda M_\lambda$ is flat for all $\lambda$. Pick some $\lambda$ and consider

$\text{Tor}_1^{R_\lambda }(M_\lambda , R_\lambda /I_\lambda ) = \mathop{\mathrm{Ker}}(I_\lambda \otimes _{R_\lambda } M_\lambda \to M_\lambda ).$

See Remark 10.75.9. The right hand side shows that this is a finitely generated $S_\lambda$-module (because $S_\lambda$ is Noetherian and the modules in question are finite). Let $\xi _1, \ldots , \xi _ n$ be generators. Because $\text{Tor}_1^ R(M, R/I) = 0$ and since $\otimes$ commutes with colimits we see there exists a $\lambda ' \geq \lambda$ such that each $\xi _ i$ maps to zero in $\text{Tor}_1^{R_{\lambda '}}(M_{\lambda '}, R_{\lambda '}/I_{\lambda '})$. The composition of the maps

$\xymatrix{ R_{\lambda '} \otimes _{R_\lambda } \text{Tor}_1^{R_\lambda }(M_\lambda , R_\lambda /I_\lambda ) \ar[d]^{\text{surjective by Lemma 00MM}} \\ \text{Tor}_1^{R_\lambda }(M_\lambda , R_{\lambda '}/I_\lambda R_{\lambda '}) \ar[d]^{\text{surjective up to localization by Lemma 00MN}} \\ \text{Tor}_1^{R_{\lambda '}}(M_{\lambda '}, R_{\lambda '}/I_\lambda R_{\lambda '}) \ar[d]^{\text{surjective by Lemma 00MM}} \\ \text{Tor}_1^{R_{\lambda '}}(M_{\lambda '}, R_{\lambda '}/I_{\lambda '}). }$

is surjective up to a localization by the reasons indicated. The localization is necessary since $M_{\lambda '}$ is not equal to $M_\lambda \otimes _{R_\lambda } R_{\lambda '}$. Namely, it is equal to $M_\lambda \otimes _{S_\lambda } S_{\lambda '}$ and $S_{\lambda '}$ is the localization of $S_{\lambda } \otimes _{R_\lambda } R_{\lambda '}$ whence the statement up to a localization (or tensoring with $S_{\lambda '}$). Note that Lemma 10.99.12 applies to the first and third arrows because $M_\lambda /I_\lambda M_\lambda$ is flat over $R_\lambda /I_\lambda$ and because $M_{\lambda '}/I_\lambda M_{\lambda '}$ is flat over $R_{\lambda '}/I_\lambda R_{\lambda '}$ as it is a base change of the flat module $M_\lambda /I_\lambda M_\lambda$. The composition maps the generators $\xi _ i$ to zero as we explained above. We finally conclude that $\text{Tor}_1^{R_{\lambda '}}(M_{\lambda '}, R_{\lambda '}/I_{\lambda '})$ is zero. This implies that $M_{\lambda '}$ is flat over $R_{\lambda '}$ by Lemma 10.99.10. $\square$

Please compare the lemma below to Lemma 10.99.15 (the case of Noetherian local rings) and Lemma 10.101.8 (the case of a nilpotent ideal in the base).

Lemma 10.128.8 (Critère de platitude par fibres). Let $R$, $S$, $S'$ be local rings and let $R \to S \to S'$ be local ring homomorphisms. Let $M$ be an $S'$-module. Let $\mathfrak m \subset R$ be the maximal ideal. Assume

1. The ring maps $R \to S$ and $R \to S'$ are essentially of finite presentation.

2. The module $M$ is of finite presentation over $S'$.

3. The module $M$ is not zero.

4. The module $M/\mathfrak mM$ is a flat $S/\mathfrak mS$-module.

5. The module $M$ is a flat $R$-module.

Then $S$ is flat over $R$ and $M$ is a flat $S$-module.

Proof. As in the proof of Lemma 10.127.11 we may first write $R = \mathop{\mathrm{colim}}\nolimits R_\lambda$ as a directed colimit of local $\mathbf{Z}$-algebras which are essentially of finite type. Denote $\mathfrak p_\lambda$ the maximal ideal of $R_\lambda$. Next, we may assume that for some $\lambda _1 \in \Lambda$ there exist $f_{j, \lambda _1} \in R_{\lambda _1}[x_1, \ldots , x_ n]$ such that

$S = \mathop{\mathrm{colim}}\nolimits _{\lambda \geq \lambda _1} S_\lambda , \text{ with } S_\lambda = (R_\lambda [x_1, \ldots , x_ n]/ (f_{1, \lambda }, \ldots , f_{u, \lambda }))_{\mathfrak q_\lambda }$

For some $\lambda _2 \in \Lambda$, $\lambda _2 \geq \lambda _1$ there exist $g_{j, \lambda _2} \in R_{\lambda _2}[x_1, \ldots , x_ n, y_1, \ldots , y_ m]$ with images $\overline{g}_{j, \lambda _2} \in S_{\lambda _2}[y_1, \ldots , y_ m]$ such that

$S' = \mathop{\mathrm{colim}}\nolimits _{\lambda \geq \lambda _2} S'_\lambda , \text{ with } S'_\lambda = (S_\lambda [y_1, \ldots , y_ m]/ (\overline{g}_{1, \lambda }, \ldots , \overline{g}_{v, \lambda }))_{\overline{\mathfrak q}'_\lambda }$

Note that this also implies that

$S'_\lambda = (R_\lambda [x_1, \ldots , x_ n, y_1, \ldots , y_ m]/ (g_{1, \lambda }, \ldots , g_{v, \lambda }))_{\mathfrak q'_\lambda }$

Choose a presentation

$(S')^{\oplus s} \to (S')^{\oplus t} \to M \to 0$

of $M$ over $S'$. Let $A \in \text{Mat}(t \times s, S')$ be the matrix of the presentation. For some $\lambda _3 \in \Lambda$, $\lambda _3 \geq \lambda _2$ we can find a matrix $A_{\lambda _3} \in \text{Mat}(t \times s, S_{\lambda _3})$ which maps to $A$. For all $\lambda \geq \lambda _3$ we let $M_\lambda = \mathop{\mathrm{Coker}}((S'_\lambda )^{\oplus s} \xrightarrow {A_\lambda } (S'_\lambda )^{\oplus t})$.

With these choices, we have for each $\lambda _3 \leq \lambda \leq \mu$ that $S_\lambda \otimes _{R_{\lambda }} R_\mu \to S_\mu$ is a localization, $S'_\lambda \otimes _{S_{\lambda }} S_\mu \to S'_\mu$ is a localization, and the map $M_\lambda \otimes _{S'_\lambda } S'_\mu \to M_\mu$ is an isomorphism. This also implies that $S'_\lambda \otimes _{R_{\lambda }} R_\mu \to S'_\mu$ is a localization. Thus, since $M$ is flat over $R$ we see by Lemma 10.128.3 that for all $\lambda$ big enough the module $M_\lambda$ is flat over $R_\lambda$. Moreover, note that $\mathfrak m = \mathop{\mathrm{colim}}\nolimits \mathfrak p_\lambda$, $S/\mathfrak mS = \mathop{\mathrm{colim}}\nolimits S_\lambda /\mathfrak p_\lambda S_\lambda$, $S'/\mathfrak mS' = \mathop{\mathrm{colim}}\nolimits S'_\lambda /\mathfrak p_\lambda S'_\lambda$, and $M/\mathfrak mM = \mathop{\mathrm{colim}}\nolimits M_\lambda /\mathfrak p_\lambda M_\lambda$. Also, for each $\lambda _3 \leq \lambda \leq \mu$ we see (from the properties listed above) that

$S'_\lambda /\mathfrak p_\lambda S'_\lambda \otimes _{S_{\lambda }/\mathfrak p_\lambda S_\lambda } S_\mu /\mathfrak p_\mu S_\mu \longrightarrow S'_\mu /\mathfrak p_\mu S'_\mu$

is a localization, and the map

$M_\lambda / \mathfrak p_\lambda M_\lambda \otimes _{S'_\lambda /\mathfrak p_\lambda S'_\lambda } S'_\mu /\mathfrak p_\mu S'_\mu \longrightarrow M_\mu /\mathfrak p_\mu M_\mu$

is an isomorphism. Hence the system $(S_\lambda /\mathfrak p_\lambda S_\lambda \to S'_\lambda /\mathfrak p_\lambda S'_\lambda , M_\lambda /\mathfrak p_\lambda M_\lambda )$ is a system as in Lemma 10.127.13 as well. We may apply Lemma 10.128.3 again because $M/\mathfrak m M$ is assumed flat over $S/\mathfrak mS$ and we see that $M_\lambda /\mathfrak p_\lambda M_\lambda$ is flat over $S_\lambda /\mathfrak p_\lambda S_\lambda$ for all $\lambda$ big enough. Thus for $\lambda$ big enough the data $R_\lambda \to S_\lambda \to S'_\lambda , M_\lambda$ satisfies the hypotheses of Lemma 10.99.15. Pick such a $\lambda$. Then $S = S_\lambda \otimes _{R_\lambda } R$ is flat over $R$, and $M = M_\lambda \otimes _{S_\lambda } S$ is flat over $S$ (since the base change of a flat module is flat). $\square$

The following is an easy consequence of the “critère de platitude par fibres” Lemma 10.128.8. For more results of this kind see More on Flatness, Section 38.1.

Lemma 10.128.9. Let $R$, $S$, $S'$ be local rings and let $R \to S \to S'$ be local ring homomorphisms. Let $M$ be an $S'$-module. Let $\mathfrak m \subset R$ be the maximal ideal. Assume

1. $R \to S'$ is essentially of finite presentation,

2. $R \to S$ is essentially of finite type,

3. $M$ is of finite presentation over $S'$,

4. $M$ is not zero,

5. $M/\mathfrak mM$ is a flat $S/\mathfrak mS$-module, and

6. $M$ is a flat $R$-module.

Then $S$ is essentially of finite presentation and flat over $R$ and $M$ is a flat $S$-module.

Proof. As $S$ is essentially of finite presentation over $R$ we can write $S = C_{\overline{\mathfrak q}}$ for some finite type $R$-algebra $C$. Write $C = R[x_1, \ldots , x_ n]/I$. Denote $\mathfrak q \subset R[x_1, \ldots , x_ n]$ be the prime ideal corresponding to $\overline{\mathfrak q}$. Then we see that $S = B/J$ where $B = R[x_1, \ldots , x_ n]_{\mathfrak q}$ is essentially of finite presentation over $R$ and $J = IB$. We can find $f_1, \ldots , f_ k \in J$ such that the images $\overline{f}_ i \in B/\mathfrak mB$ generate the image $\overline{J}$ of $J$ in the Noetherian ring $B/\mathfrak mB$. Hence there exist finitely generated ideals $J' \subset J$ such that $B/J' \to B/J$ induces an isomorphism

$(B/J') \otimes _ R R/\mathfrak m \longrightarrow B/J \otimes _ R R/\mathfrak m = S/\mathfrak mS.$

For any $J'$ as above we see that Lemma 10.128.8 applies to the ring maps

$R \longrightarrow B/J' \longrightarrow S'$

and the module $M$. Hence we conclude that $B/J'$ is flat over $R$ for any choice $J'$ as above. Now, if $J' \subset J' \subset J$ are two finitely generated ideals as above, then we conclude that $B/J' \to B/J''$ is a surjective map between flat $R$-algebras which are essentially of finite presentation which is an isomorphism modulo $\mathfrak m$. Hence Lemma 10.128.4 implies that $B/J' = B/J''$, i.e., $J' = J''$. Clearly this means that $J$ is finitely generated, i.e., $S$ is essentially of finite presentation over $R$. Thus we may apply Lemma 10.128.8 to $R \to S \to S'$ and we win. $\square$

$\xymatrix{ S \ar[rr] & & S' \\ & R \ar[lu] \ar[ru] }$

be a commutative diagram in the category of rings. Let $I \subset R$ be a locally nilpotent ideal and $M$ an $S'$-module. Assume

1. $R \to S$ is of finite type,

2. $R \to S'$ is of finite presentation,

3. $M$ is a finitely presented $S'$-module,

4. $M/IM$ is flat as a $S/IS$-module, and

5. $M$ is flat as an $R$-module.

Then $M$ is a flat $S$-module and $S_\mathfrak q$ is flat and essentially of finite presentation over $R$ for every $\mathfrak q \subset S$ such that $M \otimes _ S \kappa (\mathfrak q)$ is nonzero.

Proof. If $M \otimes _ S \kappa (\mathfrak q)$ is nonzero, then $S' \otimes _ S \kappa (\mathfrak q)$ is nonzero and hence there exists a prime $\mathfrak q' \subset S'$ lying over $\mathfrak q$ (Lemma 10.17.9). Let $\mathfrak p \subset R$ be the image of $\mathfrak q$ in $\mathop{\mathrm{Spec}}(R)$. Then $I \subset \mathfrak p$ as $I$ is locally nilpotent hence $M/\mathfrak p M$ is flat over $S/\mathfrak pS$. Hence we may apply Lemma 10.128.9 to $R_\mathfrak p \to S_\mathfrak q \to S'_{\mathfrak q'}$ and $M_{\mathfrak q'}$. We conclude that $M_{\mathfrak q'}$ is flat over $S$ and $S_\mathfrak q$ is flat and essentially of finite presentation over $R$. Since $\mathfrak q'$ was an arbitrary prime of $S'$ we also see that $M$ is flat over $S$ (Lemma 10.39.18). $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).