Flatness of finitely presented algebras

Let $$R$$ be a commutative (noetherian, if needed) ring, let $$f_1，\ldots，f_r\in R[x_1，\ldots，x_n]$$ and $$A=R[x_1，…，x_n]/(f_1，\ldots，f_r)$$, when is $$A$$ flat over $$R$$?

I found a nice answer for the case $$n=r=1$$ here, but I don't know how to formulate a characterisation in general, or if it is solved. Any idea or reference is welcome.

There is a nice criterion that is usually applied in this situation.

A is flat over $$R$$ if the Krull dimension of the fiber ring $$A_{\mathfrak{P}}/\mathfrak{P}$$ for all prime ideals $$\mathfrak{P} \subset R$$ is $$n-r$$ (or the fiber is empty). In scheme theoretic language, the fibers either have the expected dimension (are complete intersections) or are empty. This is what is called a relative global complete intersection here https://stacks.math.columbia.edu/tag/00SK. Flatness follows from https://stacks.math.columbia.edu/tag/00SW.

This is a generalization of the criterion you cited when $$r=1$$. In that case the fibers of $$Spec(R[x_1, \ldots, x_n]) \to Spec(R)$$ are affine spaces over a field (so integral) and the condition ensures that the restriction of the polynomial $$f$$ to every fiber over some closed and open subset $$U \subset Spec(R)$$ is nonzero, so it must cut a closed subset of the fiber of dimension $$n-1$$ (or empty if it restricts to a constant). The idempotent comes from the fact that if $$Spec(R)$$ is not connected, then we can allow the preimage over the complement of this open and closed to be just isomorphic to the whole affine space $$\mathbb{A}^n_{Spec(R) \setminus U}$$, ($$f$$ is allowed to be identically $$0$$ on $$Spec(R) \setminus U$$).

• This is a great answer, thanks a lot! Nov 24, 2021 at 16:47
• Thinking more carefully I think fiber to be the whole affine $n$-space is allowed, so: every nonempty fibre of Spec(A)→Spec(R) has dimension n−r or n. Nov 24, 2021 at 17:06
• If you allow the dimension to be $n$ in some fibers, it should be over an open an closed subset as in the second paragraph above (i.e. if you allow two dimensions $n$ and $n-r$, you want fiber dimension to be locally constant on the base). You don't want things like $R = k[x]$ and $A = k[x][y]/(xy)$, where the fiber dimension is $n-1 =0$ away from $x=0$ and jumps to $1$ at $x=0$.
– afh
Nov 24, 2021 at 17:17
• I agree, we need fiber dimension to be locally constant on the base. And I want to have a criterion like the one I cited for any $n, r\geq 1$. Nov 24, 2021 at 17:24
• Ok, I am just providing a possible generalization. Probably the best way to think about this is that you can check flatness on each connected component: on some components you can apply the global complete intersection result above, and in other components you could have all $f_i$ be identically $0$, which is clearly yields a flat ring. I hope that clarifies what I was trying to convey in the answer. The answer applies to any $n$ and $r$.
– afh
Nov 24, 2021 at 17:28