Currently I am self-learning some manifold theory and just come across concept of functions transverse to submanifolds. It seems that this concept is used a lot for proving regularity of values, but I don't understand all underlying machinery. For example:
Let $M$ and $N$ be smooth manifolds
We say that point $p \in M$ is regular for a smooth map $f \in C^\infty( M , N) $ if $T_p f$ is a surjection between $T_p M$ and $T_{f(p)}N$.
We say that value $v$ is regular if every point $p \in f^{-1}(v)$ is regular.
We say that map $f$ is transverse to submanifold $S \subset N$ ($f \pitchfork S$) if $$ \forall p \in f^{-1}(S) \; . \; T_{f(p)}N = T_{f(p)}S + T_pf(T_pM)$$
There is a theorem which states the following: (with notation as above) if $f \pitchfork S$ and $f^{-1}(S) \neq \emptyset$, then $f^{-1}(S)$ is a submanifod of $M$ of the same codimension as $S$ and $$ \forall p \in f^{-1}(S) \; . \; T_pf^{-1}(S) = Tf^{-1}(T_{f(p)}S) $$
In my textbook the proof goes like this: we select a point $p \in f^{-1}(S)$ and put $q = f(p)$. Then there is a chart of $N$ centered in $q$ $(V,x)$ such that $x(S \cap V) = x(V) \cap (\mathbb{R}^{n-k} \times 0)$ where $k$ is codimension of $S$. We define $\pi : \mathbb{R}^{n-k} \times \mathbb{R}^k \to \mathbb{R}^k$ to be a projection $\pi(a,b) = b$. Then we let $U = f^{-1}(V)$ and textbook says that by transversality condition $0$ is regular value of $\pi \circ x \circ f_{\vert U} :U \to \mathbb{R}^k$. However, I don't understand how to infer this result.
I know that for every $p \in (\pi \circ x \circ f_{\vert U})^{-1}$(0) we have $T_p U = \mathbb{R}^m$ where $m = \dim M$ and $T_0 \mathbb{R}^k = \mathbb{R}^k$.
Also, it's evident that $\pi \circ x \circ f_{\vert U}$ is a zero map on $U \cap f^{-1}(S)$ and that $(\pi \circ x \circ f_{\vert U})^{-1}(0) = U \cap f^{-1}(S) $.
So if we could translate transverslity from $N$ to the codomain of composition we could write:
$$\mathbb{R}^k \cong T_0\mathbb{R}^k = T_0\{ 0 \} +T_p(\pi \circ x \circ f_{\vert U})T_pU = T_p(\pi \circ x \circ f_{\vert U})T_pU \Rightarrow \mathrm{rk} \, T_p(\pi \circ x \circ f_{\vert U}) = k $$ which will imply that $0$ is a regular value. However, I don't understand why such translation is correct.
It must be true that for certain $g$ we will have $f \pitchfork S \Rightarrow g \circ f \pitchfork gS $, but I don't know conditions for $g$. Is it enough for $g$ to be smooth and surjective?
Can you explain me how to use transversality to infer regularity of 0 in this proof?
Thank you.