$f:U\subset\Bbb{R}^{n}$ is $C^k$ and $f'(a)$ has rank $p$, exists an embedding Let $f:U\rightarrow \Bbb{R}^{m}$ be a function of class $C^{k\geq 1}$, where $U$ is an open  subset of $\Bbb{R}^n$. If $f'(a)$ has rank $p$ for some $a\in U$,  there exists an embedding (immersion that is homeomorphism into its image) $\phi:V\rightarrow U$ of class $C^\infty,$ where $V\subset\Bbb{R}^{p}$ such that $f\circ \phi:V\rightarrow\Bbb{R}^{m}$ is an embedding.
I have seen this question, and I did understand the intuition, but I'm having problems to write it down.
By a Lemma, since $\dim(\textrm{Im}(f'(a)))$, there exists a decomposition $\Bbb{R}^m=\Bbb{R}^p\bigoplus\Bbb{R}^{m-p}$ such that the projection $$\pi:\Bbb{R}^{m}\rightarrow\Bbb{R}^{p},(x,y)\mapsto x$$
applies $\textrm{Im}(f'(a))$ isomorphically.

Question: How do I construct the map $\phi$?

Maybe I can use this projection to define my $\phi$, but I don't know exactly how to do it.
 A: It is not needed anything much more substantial than what Llohann said in the post you link. 
Take a complement $E$ of $\ker f'(a)$. If $\iota: E \to \mathbb{R}^n $ is the inclusion, then $f \circ \iota$ is an immersion near $a$. (We've just killed the kernel of $f'(a)$.) Locally, it is then an embedding. Now you just pick any isomorphism $\Psi: \mathbb{R}^p \to E$ and let $\phi = \iota \circ \Psi$, of course restricted to the necessary neighbourhood.
A: By a proposition (LIMA, Curso de Análise, vol.2), since $f'(a)$ has rank $p$, there exists a neighbourhood $A$ where $f$ has constant rank $p$. Because $f'(a)$ has rank $p$, we also have that there is a subspace $E\subset \mathbb{R}^n$ $p$-dimensional such that $f'(a)\big|_E$ is injective and $\mathbb{R}^p\overset{\varphi}{\rightarrow} E$. If we define $V_1=\varphi^{-1}(A\cap E)$ and $\phi=(\varphi^{-1})\big|_{V_1}\rightarrow U$, we obtain an embedding of class $C^\infty$. As we consider $V_1\subset A$, where $f$ has rank $p$, it's possible to show that $f \circ \phi$ is an immersion and we can find an open subset $V\subset V_1$ such that $(f \circ \phi)\big|_V$ is an embedding of class $C^k$.
