# About the smoothness of a map

I am currently doing an exercise and I want to show my solution so far and ask for an hint about the last part.

Exercise: Let $$M$$ and $$N$$ be smooth manifolds and let $$S \subset M \times N$$ be a submanifold. Denote by $$\pi_M : M \times N \rightarrow M$$ a projection and similar for $$\pi_N : M \times N \rightarrow N$$. Show that the following are equivalent:

(a) $$S$$ is the graph of a smooth map $$\phi : M \rightarrow N$$;

(b) $$\pi_M\mid_S$$ is a diffeomorphism from $$S$$ onto $$M$$;

(c) For each $$p \in M$$, the submanifolds $$S$$ and $$\{p\} \times N = \pi_M^{-1}(p)$$ intersects transversely and the intersection consists of a single point.

Attempt:

$$(a) \implies (b)$$. Since the projection is a smooth map and the restriction of smooth maps to submanifolds is smooth, $$\pi_M\mid_S$$ is the restriction of the smooth map $$\pi_M$$ to the submanifold $$S$$. Hence smooth. The inverse is given by $$p \mapsto (p,\phi(p))$$ which is smooth by (a).

$$(b) \implies (c)$$. The fact that $$\pi_M\mid_S$$ is diffeomorphic to $$M$$, gives us the fact that $$d_{(p,q)}\pi_M\mid_S : T_{(p,q)}S \rightarrow T_pM$$ is a diffeomorphism. This means that $$\dim(T_{(p,q)}S) = \dim(T_pM) = m$$. Furthermore, $$\{p\} \times N$$ is also diffeomorphic with $$N$$ via projection, so that $$\dim(T_{(p,q)}\{p\}\times N) = \dim(T_qN) = n$$. Therefore $$\dim(T_{(p,q)}S) + \dim(T_{(p,q)}\{p\}\times N) = m + n = \dim(T_{(p,q)}(M \times N)),$$hence they intersect transversely. The fact that the intersection is in a single point is due to the fact that $$S \cap \{p\} \times N = \{\pi_M\mid_S^{-1}(p)\}$$.

$$(c) \implies (a)$$. We define $$S = \{(p,q) : q = \pi_M\mid_S^{-1}(p)\}$$ which is well defined because the intersection is in a single point. Now it remains to show that $$\pi_M\mid_S^{-1}$$ is in fact smooth.

Question: I wonder if my reasoning is correct and what is the missing piece in order to show that $$S$$ is the graph of a smooth function.