Let $M,N$ be real smooth manifolds and $p\colon M\to N$ a smooth map. Then smooth functions on $M$ form a module over the ring of smooth functions on $N$ (via pullback). Is it know whether this module is flat when $p$ is a submersion?

Recall that flatness is equivalent to the following: 
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:

- This condition of flatness is equivalent to the usual one (see the comments below).

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

- It is also known that a smooth flat map has 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.

- The equational condition of flatness given above seems to be the most reasonable thing to use trying to come up with a proof. 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?

**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.