# Local criterion for flatness

In algebra, the local criterion for flatness gives conditions one can check to show flatness of a module.

## Statement

Given a commutative ring A, an ideal I and an A-module M, suppose either
* A is a Noetherian ring and M is idealwise separated for I: for every ideal ${\mathfrak {a}}$, $\bigcap _{n\geq 1}I^{n}({\mathfrak {a}}\otimes M)=0$ (for example, this is the case when A is a Noetherian local ring, I its maximal ideal and M finitely generated),
or
* I is nilpotent.
Then the following are equivalent:
* M is a flat module.
* $M/I$ is flat over $A/I$ and $\operatorname {Tor} _{1}^{A}(A/I,M)=0$.
* For each $n\geq 0$, $M_{n}=M/I^{n+1}M$ is flat over $A_{n}=A/I^{n+1}$.
* In the notations of 3., $M_{0}$ is $A_{0}$-flat and the natural $\operatorname {gr} _{I}A$-module surjection is an isomorphism; i.e., each $I^{n}/I^{n+1}\otimes _{A_{0}}M_{0}\to I^{n}M/I^{n+1}M$ is an isomorphism.
    $\operatorname {gr} _{I}A\otimes _{A_{0}}M_{0}\to \operatorname {gr} _{I}M$
The assumption that “A is a Noetherian ring” is used to invoke the Artin–Rees lemma and can be weakened; see

## Proof

Following SGA 1, Exposé IV, we first prove a few lemmas, which are interesting themselves. (See also this blog post by Akhil Mathew for a proof of a special case.)
Lemma 1 — Given a ring homomorphism $A\to B$ and an $A$-module $M$, the following are equivalent.
* For every $B$-module $X$, $\operatorname {Tor} _{1}^{A}(X,M)=0.$
* $M\otimes _{A}B$ is $B$-flat and $\operatorname {Tor} _{1}^{A}(B,M)=0.$
Moreover, if $B=A/I$, the above two are equivalent to
* $\operatorname {Tor} _{1}^{A}(X,M)=0$ for every $A$-module $X$ killed by some power of $I$.
Proof: The equivalence of the first two can be seen by studying the Tor spectral sequence. Here is a direct proof: if 1. is valid and $N\hookrightarrow N'$ is an injection of $B$-modules with cokernel C, then, as A-modules,
    $\operatorname {Tor} _{1}^{A}(C,M)=0\to N\otimes _{A}M\to N'\otimes _{A}M$.
Since $N\otimes _{A}M\simeq N\otimes _{B}(B\otimes _{A}N)$ and the same for $N'$, this proves 2. Conversely, considering $0\to R\to F\to X\to 0$ where F is B-free, we get:
    $\operatorname {Tor} _{1}^{A}(F,M)=0\to \operatorname {Tor} _{1}^{A}(X,M)\to R\otimes _{A}M\to F\otimes _{A}M$.
Here, the last map is injective by flatness and that gives us 1. To see the "Moreover" part, if 1. is valid, then $\operatorname {Tor} _{1}^{A}(I^{n}X/I^{n+1}X,M)=0$ and so
    $\operatorname {Tor} _{1}^{A}(I^{n+1}X,M)\to \operatorname {Tor} _{1}^{A}(I^{n}X,M)\to 0.$
By descending induction, this implies 3. The converse is trivial. $\square$
Lemma 2 — Let $A$ be a ring and $M$ a module over it. If $\operatorname {Tor} _{1}^{A}(A/I^{n},M)=0$ for every $n>0$, then the natural grade-preserving surjection
    $\operatorname {gr} _{I}(A)\otimes _{A_{0}}M_{0}\to \operatorname {gr} _{I}M$
is an isomorphism. Moreover, when I is nilpotent,
    $M$ is flat if and only if $M_{0}$ is flat over $A_{0}$ and $\operatorname {gr} _{I}A\otimes _{A_{0}}M_{0}\to \operatorname {gr} _{I}M$ is an isomorphism.
Proof: The assumption implies that $I^{n}\otimes M=I^{n}M$ and so, since tensor product commutes with base extension,
    $\operatorname {gr} _{I}(A)\otimes _{A_{0}}M_{0}=\oplus _{0}^{\infty }(I^{n})_{0}\otimes _{A_{0}}M_{0}=\oplus _{0}^{\infty }(I^{n}\otimes _{A}M)_{0}=\oplus _{0}^{\infty }(I^{n}M)_{0}=\operatorname {gr} _{I}M$.
For the second part, let $\alpha _{i}$ denote the exact sequence $0\to \operatorname {Tor} _{1}^{A}(A/I^{i},M)\to I^{i}\otimes M\to I^{i}M\to 0$ and $\gamma _{i}:0\to 0\to I^{i}/I^{i+1}\otimes M{\overset {\simeq }{\to }}I^{i}M/I^{i+1}M\to 0$. Consider the exact sequence of complexes:
    $\alpha _{i+1}\to \alpha _{i}\to \gamma _{i}.$
Then $\operatorname {Tor} _{1}^{A}(A/I^{i},M)=0,i>0$ (it is so for large $i$ and then use descending induction). 3. of Lemma 1 then implies that $M$ is flat. $\square$
Proof of the main statement.
$2.\Rightarrow 1.$: If $I$ is nilpotent, then, by Lemma 1, $\operatorname {Tor} _{1}^{A}(-,M)=0$ and $M$ is flat over $A$. Thus, assume that the first assumption is valid. Let ${\mathfrak {a}}\subset A$ be an ideal and we shall show ${\mathfrak {a}}\otimes M\to M$ is injective. For an integer $k>0$, consider the exact sequence
    $0\to {\mathfrak {a}}/(I^{k}\cap {\mathfrak {a}})\to A/I^{k}\to A/({\mathfrak {a}}+I^{k})\to 0.$
Since $\operatorname {Tor} _{1}^{A}(A/({\mathfrak {a}}+I^{k}),M)=0$ by Lemma 1 (note $I^{k}$ kills $A/({\mathfrak {a}}+I^{k})$), tensoring the above with $M$, we get:
    $0\to {\mathfrak {a}}/(I^{k}\cap {\mathfrak {a}})\otimes M\to A/I^{k}\otimes M=M/I^{k}M$.
Tensoring $M$ with $0\to I^{k}\cap {\mathfrak {a}}\to {\mathfrak {a}}\to {\mathfrak {a}}/(I^{k}\cap {\mathfrak {a}})\to 0$, we also have:
    $(I^{k}\cap {\mathfrak {a}})\otimes M{\overset {f}{\to }}{\mathfrak {a}}\otimes M{\overset {g}{\to }}{\mathfrak {a}}/(I^{k}\cap {\mathfrak {a}})\otimes M\to 0.$
We combine the two to get the exact sequence:
    $(I^{k}\cap {\mathfrak {a}})\otimes M{\overset {f}{\to }}{\mathfrak {a}}\otimes M{\overset {g'}{\to }}M/I^{k}M.$
Now, if $x$ is in the kernel of ${\mathfrak {a}}\otimes M\to M$, then, a fortiori, $x$ is in $\operatorname {ker} (g')=\operatorname {im} (f)=(I^{k}\cap {\mathfrak {a}})\otimes M$. By the Artin–Rees lemma, given $n>0$, we can find $k>0$ such that $I^{k}\cap {\mathfrak {a}}\subset I^{n}{\mathfrak {a}}$. Since $\cap _{n\geq 1}I^{n}({\mathfrak {a}}\otimes M)=0$, we conclude $x=0$.
$1.\Rightarrow 4.$ follows from Lemma 2.
$4.\Rightarrow 3.$: Since $(A_{n})_{0}=A_{0}$, the condition 4. is still valid with $M,A$ replaced by $M_{n},A_{n}$. Then Lemma 2 says that $M_{n}$ is flat over $A_{n}$.
$3.\Rightarrow 2.$ Tensoring $0\to I\to A\to A/I\to 0$ with M, we see $\operatorname {Tor} _{1}^{A}(A/I,M)$ is the kernel of $I\otimes M\to M$. Thus, the implication is established by an argument similar to that of $2.\Rightarrow 1.$$\square$

## Application: characterization of an étale morphism

The local criterion can be used to prove the following:
Proposition — Given a morphism $f:X\to Y$ of finite type between Noetherian schemes, $f$ is étale (flat and unramified) if and only if for each x in X, f is an analytically local isomorphism near x; i.e., with $y=f(x)$, ${\widehat {f_{x}^{*}}}:{\widehat {{\mathcal {O}}_{y,Y}}}\to {\widehat {{\mathcal {O}}_{x,X}}}$ is an isomorphism.
Proof: Assume that ${\widehat {{\mathcal {O}}_{y,Y}}}\to {\widehat {{\mathcal {O}}_{x,X}}}$ is an isomorphism and we show f is étale. First, since ${\mathcal {O}}_{x}\to {\widehat {{\mathcal {O}}_{x}}}$ is faithfully flat (in particular is a pure subring), we have:
    ${\mathfrak {m}}_{y}{\mathcal {O}}_{x}={\mathfrak {m}}_{y}{\widehat {{\mathcal {O}}_{x}}}\cap {\mathcal {O}}_{x}={\widehat {{\mathfrak {m}}_{y}}}{\widehat {{\mathcal {O}}_{x}}}\cap {\mathcal {O}}_{x}={\widehat {{\mathfrak {m}}_{x}}}\cap {\mathcal {O}}_{x}={\mathfrak {m}}_{x}$.
Hence, $f$ is unramified (separability is trivial). Now, that ${\mathcal {O}}_{y}\to {\mathcal {O}}_{x}$ is flat follows from (1) the assumption that the induced map on completion is flat and (2) the fact that flatness descends under faithfully flat base change (it shouldn't be hard to make sense of (2)).
Next, we show the converse: by the local criterion, for each n, the natural map ${\mathfrak {m}}_{y}^{n}/{\mathfrak {m}}_{y}^{n+1}\to {\mathfrak {m}}_{x}^{n}/{\mathfrak {m}}_{x}^{n+1}$ is an isomorphism. By induction and the five lemma, this implies ${\mathcal {O}}_{y}/{\mathfrak {m}}_{y}^{n}\to {\mathcal {O}}_{x}/{\mathfrak {m}}_{x}^{n}$ is an isomorphism for each n. Passing to limit, we get the asserted isomorphism. $\square$
Mumford's Red Book gives an extrinsic proof of the above fact (Ch. III, § 5, Theorem 3).

## Miracle flatness theorem

B. Conrad calls the next theorem the miracle flatness theorem.
Theorem — Let $R\to S$ be a local ring homomorphism between local Noetherian rings. If S is flat over R, then
    $\dim S=\dim R+\dim S/{\mathfrak {m}}_{R}S$.
Conversely, if this dimension equality holds, if S is regular and if R is Cohen–Macaulay (e.g., regular), then R is flat over S.