Generalizing miracle flatness (Matsumura 23.1) via finite Tor-dimension Let $(A,m_A)$ and $(B,m_B)$ be noetherian local rings and $f:A\rightarrow B$ a local homomorphism.  Let $F = B/m_AB$ be the fiber ring and assume that
$$\mathrm{dim}(B) = \mathrm{dim}(A) + \mathrm{dim}(F).$$
The following Theorem (23.1 in Matsumura's CRT) is really quite a miracle:
Theorem: If $A$ is regular and $B$ is Cohen-Macaulay then $f$ is flat.
I am wondering to what extent this theorem can be generalized.  What I have in mind is a statement of the type:
"Theorem":  If $A$ is $X$ and $B$ is $Y$ then $f$ is of finite Tor-dimension
(i.e. $\mathrm{Tor}^i_A(B,A)=0$ for all $i$ sufficiently large).
Here, $X$ and $Y$ are ring-theoretic conditions which should be strictly weaker than 
"regular" and "CM" respectively.  Is the "Theorem" above true just requiring $A$ and $B$ to be normal?
How about both CM? Or maybe CM plus finitely many $(R_i)$?  
Any thoughts/ counterexamples? 
 A: The "Theorem" isn't true with both rings just normal, or just CM, or even normal and CM.  Let $A = k[[x,y,z]]/(xz-y^2) \cong k[[a^2,ab,b^2]]$ and let $B = k[[a,b]]$, with $f$ the natural inclusion.  The dimensions add up as they must, since $f$ is module-finite.  In this case finite flat dimension is the same as finite projective dimension, but $B$ does not have finite projective dimension over $A$. 
I don't expect that any addition of assumptions $(R_i)$ would help.
A: Hi Bryden,
I agree with Graham that it would be hard to have a generalization in the sense you want. 
As Graham pointed out you already have finite Tor-dimension if $A$ is regular. In general, finite Tor dimension are much more miraculous. If $A$ is even an hypersurface of isolated singularity of any dimensions, then one can still cook up CM extensions with infinite Tor-dimensions. 
However, if you want something like: "Assume $f:A\to B$ has finite Tor-dimension, and assume $A$ is $X$ and $B$ is $Y$, then $f$ is flat", then there is much better chance. For example, one can get results with $X,Y=normal$ plus some low codimension conditions:
http://www.ams.org/proc/1999-127-01/S0002-9939-99-04501-3/home.html
Also, these papers  may be worth a look, but you probably already knew them:
Kollar, "Flatness criteria", J. Algebra 175, 712-727.
Cutkosky, "Purity of branch locus and Lefschetz theorems", Compositio Math. 96, (1995) 173-195. 
A: If you are willing to impose instead a condition on the closed fiber, namely, that it be regular, then you only need to assume something like $A$ being an excellent normal domain with perfect residue field to get flatness (this is Theorem 3.3.27 in my "Ultraproducts" book).
A: If $A$ is still regular and $B$ is anything at all, then $B$ has finite flat dimension over $A$.   So this is strictly weaker on one ring, though not on both.
A: I post this answer to give some intuition about what is really happening behind the scene in the theorem mentioned. If $f:A\rightarrow B$ is flat, then obviously the image of any $A$-regular sequence under $f$ is a $B$-regular sequence. This can be seen by tensoring the $A$-Koszul complex on an $A$-regular sequence, by $B$.
Now let's ask this question: Suppose a map $f:A\rightarrow B$ has the property that it maps any $A$-regular sequence to a $B$-regular sequence. Is $f$ flat then? The answer is no. As an example, you can consider the Frobenius endomorphism $F:A\rightarrow A$ of a local ring of characteristic $p>0$. Obviously it maps every regular sequence to a regular sequence, but $F$ is not flat, unless $A$ is regular, by a theorem of Kunz. Another example is any endomorphism $f$ of a local Cohen-Macaulay ring $(A,\mathfrak{m}_A)$ for which $f(\mathfrak{m}_A)A$ is $\mathfrak{m}_A$-primary. One can see quickly that the image of any regular sequence is a regular sequence, but in general $f$ need not be flat.
The reason for this failure is existence of modules of infinite projective dimension. The condition that $f$ sends any regular sequence to a regular sequence only guarantees that finite free resolutions of $A$-modules stay exact after tensoring by $B$. This quickly follows from Buhsbaum-Eisenbud exactness criterion. (cf. p. 37, Corollary 6.6 in Topics in the homological theory of modules over commutative rings, M. Hochster.)
When $A$ is regular, however, every finite $A$-module has finite projective dimension. That's why in this case the condition that every $A$-regular sequence will be mapped to a $B$ regular sequence by $f$ is equivalent to flatness! (keep in mind that flatness only needs to be checked on finite modules.) The conditions $B$ Cohen-Macaulay and  $\dim B=\dim A+\dim F$ are just meant to guarantee that any $A$-regular sequence is mapped to a $B$-regular sequence, as you can check quickly. To check this, take an $A$-regular sequence $x_1,\ldots,x_t$, extend it to a maximal regular sequence $\underline{x}:=(x_1,\ldots,x_d)$ in $A$, then use the dimension assumption and the fact that $B$ is Cohen-Macaulat to show that $f(\underline{x}):=(f(x_1),\ldots,f(x_d))$ is a regular sequence in $B$. 
(Note that on one hand, the inclusion $f(\underline{x})B\subseteq\mathfrak{m}_AB$ gives $\dim B/f(\underline{x})B\geq\dim B/\mathfrak{m}_AB$. On the other hand the map $A/\underline{x}\rightarrow B/f(\underline{x})B$ gives $\dim B/f(\underline{x})B\leq \dim A/\underline{x}+\dim B/\mathfrak{m}_AB=0+\dim B/\mathfrak{m}_AB$. Hence $\dim B/f(\underline{x})B=\dim B-\dim A$.)
