In Eisenbud's Commutative Algebra, Exercise 18.18 is the following fact from a paper of Hartshorne's:


Suppose $(R,P)$ is a local ring containing a field $k$, and let $x\_1,...,x\_r\in P$ be a sequence of elements. If $x\_1,...,x\_r$ is a regular sequence, then $R$ is flat as a module over the polynomial ring $k[x\_1,...,x\_r]$.


My question is: Does this also hold for different situations, i.e. if $R$ is not assumed to be local? A comment in Exercise 6.7 of [Eisenbud] suggests that it does, but unfortunately no reference is provided. I would be particularly interested in the case where $R$ is itself a polynomial ring.


Any help would be appreciated!



Flatness and regular sequences
I think this does not hold in general. My example is based on the fact that a permutation of a regular sequence need not be regular in general: 


If $M$ is a flat $k[x\_1,x\_2, x\_3]$-module then any permutation of the sequence $x\_1, x\_2, x\_3$ will be regular on $M$, since it is regular on $k[x\_1, x\_2, x\_3]$. Now take $R= k[x,y,z]$ and make it into a $k[x\_1,x\_2, x\_3]$-module by mapping $x\_1, x\_2, x\_3$ to $x-1, xy, xz$,respectively, then $x\_1, x\_2, x\_3$ is $R$-regular, but $x\_2, x\_3, x\_1$ is not. Hence $R$ is not flat over $k[x\_1,x\_2,x\_3]$.


This is what I would try to do in your situation: Let $A$ be the polynomial ring and let $R$ be the other polynomial ring, so that you have a map $A\rightarrow R$, then you can test flatness by looking at localizations $A\_{\mathfrak p}\rightarrow R\_{\mathfrak q}$, see Lemma 10.38.19 parts (6) and (7) in <https://stacks.math.columbia.edu/tag/00H9>. Since $R$ and $A$ are regular, the localizations are regular and then you can test flatness by computing the dimension of the 
fibres (Matsumura Thm 23.1).


