Are submersions of differentiable manifolds flat morphisms? Let $\pi \colon M\to N$ be a smooth map between real smooth manifolds. Then $C^\infty(M)$ forms a module over $C^\infty(N)$ (via pullback). Is this module flat when $\pi$ is a submersion?
Recall that the usual definition of flatness is equivalent to the following equational condition: 
whenever $ h_1 \ldots h_k\in C^\infty(N) $ and $g_1 \ldots g_k\in C^\infty(M)$ are such that:
$$h_1 g_1 + \ldots + h_k g_k = 0$$ (as functions on $M$)
then there are functions $G_1 \ldots G_r\in C^\infty(M)$ and $a_{i,j}\in C^\infty(N)$ such that:
$$g_i= \sum_j  a_{i,j}G_j \; \forall i $$ 
and 
$$\sum_i h_i a_{i,j}= 0 \; \forall j$$
Some remarks:


*

*It's known that the inclusion of an open subset $U\subset N$ is a flat morphism since smooth functions on $U$ are obtained from smooth functions on $N$ by localizing w.r.t. functions vanishing nowhere on $U$.

*It's also known that smooth flat maps have to be open. Proofs of both of these facts can be found for example in the book: Gonzales, Salas, $C^\infty$-differentiable spaces, Lecture notes in Mathematics, Springer 2000.

*I've asked some of the experts including Malgrange and the above authors and it seems that the answer is not known.

*I gave the equational condition of flatness since it seems like the most reasonable thing to use here. But considering already the simplest situation here's what gets me stuck: suppose you want to check flatness of the standard projection $\mathbb{R}^2 \to \mathbb{R}, (x,y)\mapsto x$, and take the case of just one $h\in C^\infty(\mathbb{R})$ and one $g\in C^\infty(\mathbb{R}^2)$ with $hg=0$. If you pick $h(x)$ to be strictly positive for $x<0$ and $0$ for $x\geq 0$, then the flatness condition translates into: 
Any smooth function $g(x,y) \in C^\infty (\mathbb{R}^2)$ that vanishes on the half plane $x\leq 0 $ admits a "factorization":
$$g(x,y)= \sum_j a_j (x)G_j (x,y)$$
where the $a_j\in C^\infty(\mathbb{R})$ all vanish on $x\leq 0$ and the $G_j\in C^\infty(\mathbb{R}^2)$ are arbitrary.
Anyone has an idea how to prove this "simple" case, or sees a counter example?
(Edit: George Lowther beautifully proves this "simple" case, and also comes closer to the full result in his second answer. If you also think he deserves some credit consider up-voting his second answer since the first one turned community wiki.)
Motivation
My personal interest is that a positive answer would allow me to finish a certain proof, which trying to explain here would take this too far afield. But I may try to put the question into context as follows: the notion of flat morphism plays an important role in algebraic geometry where it is basically the right way to formalize the notion of parametrized families of varieties (fibers of such a morphism being these families). One may also say that it is the right "technical" notion allowing one to do all the things one expects to do with such parametrized families (correct me if I'm wrong). 
Now I've been taught that differential topology may also be seen as a part of commutative algebra (and that taking such a point of view might even be useful at times). For example: a manifold itself may be recovered completely from the algebra of smooth functions on it, and any smooth map between manifolds is completely encoded by the corresponding algebra morphism. Other examples: vector fields are just derivations of the algebra, vector bundles are just finitely generated projective modules over the algebra etc. Good places to learn this point of view are: Jet Nestruev, Smooth manifolds and observables, as well as the above mentioned book.
Now in differential topology there is a well know notion of smooth parametrized families of manifolds, namely smooth fiber bundles. Hence from this algebraic point of view it would be natural to expect that fiber bundles are flat morphisms.
 A: It is a consequence of  Malgrange's preparation theorem for differentiable
functions  that $C^{\infty}(M)$ is a faithfully flat  $C^{\omega}(M)$-module ($C^{\omega}(M)$ is the sheaf of
analytic functions on $M$). See Corollary 1.12, Chapter VI of
his book Ideals of differentiable functions.
On the other hand  $C^{\omega}(M)$ is a flat $C^{\omega}(N)$-module as the argument pointed out
by Greg Stevenson shows.
I believe, but don't know how,  these two facts can be put
 together to give a positive answer to
the question. 
A: In George Lowther's CW answer taking care of the "simple case" there are a Lemma 1, 2 and 3 concerning sets of function $U$ and $V$ about which it is stated "they could possibly be standard results, but I've never seen them before." I wanted to add that, by performing an inversion, those results become instead statements about rapidly decaying functions and Schwartz functions. In the latter form, they are easier to find in the literature. Really the present answer would be better as a comment, but I think there will not be space for that.
Use the map $x \mapsto 1/x$ to put functions on $(0,1]$ into bijection with functions on $[1,\infty)$. This correspondence puts the functions $f$ on $(0,1]$ with $\lim_{x \to 0^+} x^{-n} f(x) = 0$ for all $n$ into bijection with the functions $f$ on $[1,\infty)$ with $\lim_{x \to \infty} f(x) x^n = 0$ for all $n$, i.e. the functions of rapid decay. It also puts the functions $f$ on $(0,1]$ for which putting $f(x)=0$ for $x\leq 0$ yields a smooth extension into bijection with the Schwartz functions on $[1,\infty)$.
So George Lowther's Lemma 1 is equivalent to asking whether, for every function which decays rapidly at $\infty$, there exists a Schwartz function which decays more slowly. Lemmas 2 and 3 can be given similar restatements. Stated in this revised form, Lemma 1 is arguably easier to prove.

Claim: Suppose $f$ is a rapidly decaying function on $[1,\infty)$, then there exists a Schwartz function $g$ on $[1,\infty)$ with $g \geq |f|$.
Proof: Without loss of generality, $f$ is postive-valued and decreasing, or else replace it by $x \mapsto \sup_{y \geq x} f(y)$. Let $\varphi$ be a nonnegative $C^\infty$ bump function with support in $[0,1]$ and $\int_\mathbb{R} \varphi =1$. Then it is simple to check that the convolution $g= \varphi * f$ is a Schwartz function with $g \geq f$ (the main point is that rapidly decaying functions are closed under convolution, which implies the convolution of a Schwartz function and a rapidly decaying function is Schwartz).

The Schwartz VS rapid decay versions of the facts seem to be easier to find in the literature as well. See this expository note of Paul Garret: Schwartz-function envelopes for rapidly decreasing functions and note that the three bullet points of the theorem in Garrett's note correspond more or less to the three Lemmas in Lowther's answer. This post by Abdelmalek Abdesselam points to additional references in the literature.

*

*K. Miyazaki, Distinguished elements in a space of distributions, Lemma 1.

*H. Petzeltová; P. Vrbová Factorization in the algebra of rapidly decreasing functions on $R_n$.

*J. Voigt, Factorization in some Frechet algebras of differentiable functions.

A: I have an idea for the case of a submersion - maybe it is nonsense but maybe not.
In the algebraic case of nonsingular varieties X,Y over an algebraically closed field one can check smoothness (which implies flatness) of a morphism X -> Y in terms of the induced maps of the Zariski tangent spaces at closed points being surjective. So in particular, identifying the Zariski tangent spaces with the fibres of the tangent bundles the "algebraic version of submersion checked on closed points" implies flatness.
If we take the viewpoint of differentiable spaces and work with injectivity of the cotangent sheaf tensored with residue fields rather than surjectivity of the tangent bundle maybe it is possible to transfer the proof to the case you are interested in? All one really needs is to translate the statement that we have an injective morphism on the fibres of the cotangent bundle into one about regular sequences in the rings of germs and then hopefully one could use a version of the local criterion of flatness to conclude.
A: I can show that this is true for your "simple" case.

If g(x,y) ∈ C∞(ℝ2) vanishes on x ≤ 0 then it decomposes as g(x,y) = a(x)G(x,y) where a(x) ∈ C∞(ℝ) vanishes on x ≤ 0 and G(x,y) ∈ C∞(ℝ2).

This can be shown by proving the statements below. They could possibly be standard results, but I've never seen them before.
First, I'll refer to the following sets of functions.


*

*Let U be thet set of functions f(x) ∈ C∞(ℝ) which vanish on x ≤ 0 and are positive on x > 0.

*Let V be the set of functions f: ℝ+→ ℝ such that x-n f(x) → 0 as x → 0, for each positive integer n.


The statements I need to show the main result are as follows.
Lemma 1: For any f ∈ V, there is a g ∈ U such that f(x)/g(x) → 0 as x → 0.
Proof: Choose any smooth function r: ℝ+→ ℝ+ with r(0) = 1 and r(x) = 0 for x ≥ 1. For example, we can use r(x) = exp(1-1/(1-x)) for x < 1. Then, the idea is to choose a sequence of positive reals αk → 0 satisfying ∑k αk < ∞, and set
$$g(x) = x^{\theta(x)},\ \ \ \theta(x)=\sum_{k=1}^\infty r(x/\alpha_k)$$
for x > 0 and g(x) = 0 for x ≤ 0. Only finitely many terms in the summation will be nonzero outside any neighborhood of 0, so it is a well defined expression, and smooth on x > 0. Clearly, θ(x) → ∞ and, therefore, x-n g(x) → 0 as x → 0. It needs to be shown that all the derivatives of g vanish at 0 so that g ∈ U. As r and all its derivatives are bounded with compact support, r(n)(x) ≤ Knx-n-1 for some constants Kn. The nth derivative of θ is
$$\theta^{(n)}(x)=\sum_k\alpha_k^{-n}r^{(n)}(x/\alpha_k)\le K_nx^{-n-1}\sum_k\alpha_k$$
which has polynomially bounded growth in 1/x. The derivatives of log(g) satisfy
$$\frac{d^n}{dx^n}\log(g(x))=\frac{d^n}{dx^n}\left(\log(x)\theta(x)\right)$$
which also has polynomially bounded growth in 1/x. However, the derivative on the left hand side is g(n)(x)/g(x) plus a polynomial in g(i)(x)/g(x) for i < n. So, induction gives that g(n)(x)/g(x) has polynomially bounded growth in 1/x and, multiplying by g(x), g(n)(x) → 0 as x → 0.
By definition of f ∈ V, there is a decreasing sequence of positive reals εk such that f(x) ≤ xn for x ≤ εn. We just need to make sure that αk ≤ εn+1 for k ≥ n to ensure that g(x) ≥ xn-1 for εn+1 ≤ x ≤ min(εn,1). Then f(x)/g(x) goes to zero at rate x as x → 0.
█
Lemma 2: For any sequence f1,f2,... ∈ V there is a g ∈ U such that fk(x)/g(x) → 0 as x → 0 for all k.
Proof: The idea is to apply Lemma 1 to f(x) = Σk λk|fk(x)| for positive reals λk. This works as long as f ∈ V, which is the case if Σk λksupx≤kmin(x,1)-k|fk(x)| is finite, and this condition is easy to ensure.
█
Lemma 3: For any sequence f1,f2,... ∈ V there is a g ∈ U such that fk(x)/g(x)n → 0 as x → 0 for all positive integers k,n.
Proof: Apply Lemma 2 to the doubly indexed sequence fk,n = |fk|1/n.
The result follows from applying lemma 3 to the triply indexed sequence fi,j,k(x) = max{|(di+j/dxidyj)g(x,y)|: |y| ≤ k} ∈ V. Then, there is an a ∈ U such that fijk(x)/a(x)n → 0 as x → 0. Set G(x,y) = f(x,y)/a(x) for x > 0 and G(x,y) = 0 for x ≤ 0. On any bounded region for x > 0, the derivatives of G(x,y) to any order are bounded by a sum of terms, each of which is a product of fijk(x,y)/a(x)n with derivatives of a(x), so this vanishes as x → 0. Therefore, G ∈ C∞(ℝ2).
█
In fact, using a similar method, the simple case can be generalized to arbitrary submersions.

Let p: M →N be a submersion. If h ∈ C∞(N) and g ∈ C∞(M) satisfy hg = 0 then, g = aG for some G ∈ C∞(M) and a ∈ C∞(N) satisfying ha = 0.

Very Rough Sketch:
If S ⊂ N is the open set {h≠0} then g and all its derivatives vanish on p-1(S).
The idea is to choose a smooth parameter u:N-S →ℝ+ which vanishes linearly with the distance to S. This can be done locally and then extended to the whole of N (I'm assuming manifolds satisfy the second countability property). As all the derivatives of g vanish on p-1(S), u-ng tends to zero at the boundary of S. This uses the fact that p is a submersion, so that u also goes to zero linearly with the distance from p-1(S) in M.
Then, following a similar argument as above, a can be expressed a function of u so that g/a and all its derivatives tend to zero at the boundary of S. Finally, G=0 on the closure of p-1(S) and G=g/a elsewhere.
█
I suppose the next question is: does proving the special case above of a single g and h reduce the proof of flatness to algebraic manipulation?
A: I can get quite close to proving this. That doesn't mean that the result is true but it does at least seem to be very nearly true. We can also see what any counterexamples must look like if it does fail. Basically, if the details of my argument below go through as expected, the only problem can occur at points where h=(h1,h2,...) vanishes along with all its derivatives, but where the derivatives (to some order) of h/|h| explode.
I hope that this result is true, as it is a simple algebraic statement which would encode some rather deep properties of smooth functions. However, I am not yet convinced that this is the case.
Let me restrict to the simple case where $p\colon M\to N$ is the projection from $\mathbb{R}^2$ to $\mathbb{R}$, p(x,y)=x. Slightly reorganizing your definition of flatness, let n be a positive integer. Let $g\colon M\to\mathbb{R}^n,\ g=(g_1,\ldots,g_n)$ and $h\colon N\to\mathbb{R}^n,\ h=(h_1,\ldots,h_n)$ be smooth maps such that their inner product is zero, $\langle h,g\rangle=\sum_k h_k g_k=0$. Then, flatness of the projection p says that there is a finite set of smooth functions $a_k\colon N\to\mathbb{R}^n,\ a_k=(a_{k1},\ldots,a_{kn})$ and $G_k\in C^\infty(M)$ satisfying $\langle h,a_k\rangle=0$ and $g=\sum_k a_kG_k$. That is, g is spanned by ak as a module over $C^\infty(M)$.
The subset of N on which h is nonzero is easy to deal with, simply by projecting orthogonal to h. If $e_i\colon N\to\mathbb{R}^n,\ e_{ij}\equiv\delta_{ij}$ then $g=\sum_ig_ie_i$ and orthogonal projection gives
$$g=g-|h|^{-2}\langle h,g\rangle h=\sum_i(e_i-|h|^{-2}h_ih)g_i$$
so we can take $a_k=e_k-|h|^{-2}h_kh$ and $G_k=g_k$.
On the other hand, if h vanishes on an open set then it doesn't put any restriction on either g or ak and the problem is easy. The only issues occur on neighborhoods of the boundary of the set $\lbrace h=0\rbrace\subset N$.
Let me denote the space of smooth functions $a\colon N\to\mathbb{R}^n$ such that $\langle h,a\rangle=0$ by $V$, which is to be considered as a $C^\infty(N)$-module. Also, as I am restricting to $M=\mathbb{R}^2$, then $g_y\equiv g(\cdot,y)\in V$ can be considered as a smoothly parametrized family in V. If the flatness property is true then it says that $g_y$ is contained in a finitely generated submodule of V, generated by the ak. Conversely, if V is finitely generated, then a modified version of the standard proof of flatness for algebraic varieties should also work here (for varieties, the Noetherian property guarantees that V is finitely generated). More generally, it needs to be shown that the family $g_y\in V$ is contained in a finitely generated submodule of V, then flatness should follow.
Let's try to show that V is finitely generated in some neighborhood of a point $P\in N$. Suppose that there exists an $a\in V$ satisfying $a(P)\not=0$. Then, on the set $\lbrace a\not=0 \rbrace$, any $b\in V$ can be decomposed uniquely into a multiple of a and its component orthogonal to a. By projecting onto the subspace of $\mathbb{R}^n$ orthogonal to a at each point, this allows us to reduce the problem to $\mathbb{R}^{n-1}$. Continuing in this way, by induction, we can reduce to the case where every $a\in V$ has $a(P)=0$ (at which point, h(P) must also be zero).
So, now consider the case of a point $P\in N$ at which all $a\in V$ vanish. Let r be the smallest positive integer at which the rth-order derivatives of some $a\in V$ are nonzero (if it exists). Then, recalling that I am only considering the case of $N=\mathbb{R}$, we can define $b(x)= a(x)/(x-P)^r\in V$ which satisfies $b(P)=a^{(r)}(P)/r!\not=0$. This is a contradiction.
So, this reduces the problem to the points $P\in N$ on the boundary of the set $\lbrace h=0\rbrace$ at which both h and every $a\in V$ along with all their derivatives vanish. I will denote this (necessarily closed) set by S. We need to show that the smooth family $g_y\in V$ is contained in a finitely generated submodule of V, in some neighborhood of S.
The case for n=1 can be completed, as I did in my other response proving your "simple" case. Then, as I explained, there exists a $G\in V$ which is strictly positive outside of {h=0} and which goes to zero much slower than any of the gy at S, so that $g_y/G\in C^\infty(N)$ and $g_y = (g_y/G)G$ are all in the singly generated submodule of V generated by G.
We can attempt to solve the case n>1 similarly. First, let $a_i = e_i - |h|^{-2} h_i h$ be the projections of $e_{ij}=\delta_{ij}$ orthogonal to h, which is defined, bounded, and smooth on $\lbrace h\not= 0\rbrace$, and gy decomposes as $g_y=\sum_k a_{k}(g_{y})_k$, as I did above. The coordinates $(g_y)_k\in C^{\infty}(N)$ and all their derivatives vanish at S. Then, as in the n=1 case, there will be a smooth function G vanishing on S such that $(g_y)_k/G$ are all smooth, and we can decompose $g_y=\sum_k (G a_{k})((g_y)_k/G)$. If $G a_k$ are smooth at S then they generate a submodule of V containing $g_y$. The problem is that, even if G and all its derivatives go to zero faster than polynomially in the distance d from S, the same cannot be said for $G a_k$. It is possible that, even though ak is bounded, its derivatives can explode faster than polynomially in 1/d.
If any counterexample exists to disprove flatness, the problem must occur at a point P on the manifold where h and all its derivatives vanish, but the derivatives of $\hat h=h/|h|$ explode faster than exponentially in the reciprocal of the distance from S. That is, $\hat h=h/|h|$ moves around very wildly at P.
