# finite surjective l.c.i morphism is flat

Let $X,Y$ be locally Noetherian schemes. Let $f:X\to Y$ be a finite, surjective, and locally complete intersection morphism, i.e., locally it can be decomposed as regular immersion followed by a smooth morphism. Recall: an immersion $X\to Y$ is called a regular immersion at a point $x$ if $\mathcal{O}_{X,x}$ is isomorphic as $\mathcal{O}_{Y,y}$-module to $\mathcal{O}_{Y,y}$ modulo an ideal $I$ generated by a regular sequence of elements of $\mathcal{O}_{Y,y}$.

Question: prove that $f$ is flat. In particular, $f$ will be a simultaneously open and closed morphism.

-
Sorry, very late answer to your comment below: l.c.i implies finite flat dimension essentially because a quotient by a regular sequence has finite flat resolution (the Koszul complex) –  Hailong Dao Apr 30 '10 at 0:47
This is worded like a homework problem. –  Angelo Jan 15 '12 at 6:25

Work locally, assume that $f: R\to S$ is a local homomorphism. Let $\operatorname{cmd}(R) =\operatorname{dim} R-\operatorname{depth} R$ (this is the so-called Cohen-Macaulay defect of $R$). Claim: $\operatorname{cmd}$ is preserved by l.c.i maps (easy, essentially because both depth and dimension drop by one when you kill a regular element).
Now since the map $\phi: \operatorname{Spec}(S) \to \operatorname{Spec} (R)$ is finite and surjective, $\operatorname{dim} R= \operatorname{dim} S$, which combines with the last claim to show that $\operatorname{depth} R = \operatorname{depth} S$. But since l.c.i also implies finite flat dimension, we have $\operatorname{depth} R -\operatorname{depth} S = pd_RS$, so $S$ is flat over $R$.