Simultaneous coordinate representation of a submanifold and its sub-submanifold Suppose $Z\subset X\subset Y$ are manifolds and $z \in Z$. Prove that there exist an independent function $g_1,...g_l$ on a neighborhood $W$ of $z$ in $Y$ such that
$$Z \cap W =\{y\in W:g_1(y)=0,...g_l(y)=0\}$$
and $$X \cap W =\{y\in W:g_1(y)=0,...g_m(y)=0\}$$
where $l-m= \text{codim}\ Z= \dim X- \dim Z$
I know that $X$ is manifold, that make $Z$ is $X$'s sub-manifold and any sub-manifold of $X$ can be locally cut out by independent functions.
If I let $Z$ be a submanifold of codim $l-m$ then there will be $l-m$ independent functions $g_1,...g_{l-m}$ on a neighborhood $W$ of $z$ in $Y$ such that $Z \cap W$ is the common vanishing set of $g_i$
Same thing for $X$, let $X$ has codimension $m$ in $Y$ then  there will be $m$ independent functions $g_1,...g_{m}$ on a neighborhood $W$ of $z$ in $Y$ such that $X \cap W$ is the common vanishing set of $g_j$
I'm not sure where to go from here.
 A: HINT: One approach is to apply the Local Immersion Theorem in Guillemin/Pollack twice: first to $X$ and, then, working locally in the appropriate parametrization of $X$, to the inclusion $Z\hookrightarrow X$.
EDIT: So the Local Immersion Theorem tells us that we can choose local coordinates $(x_1,\dots,x_k)$ on $X$ and $Z$ so that the inclusion map $f\colon Z\hookrightarrow X$ is of the form $$f(x_1,\dots,x_{k-\ell}) = (x_1,\dots,x_{k-\ell},\underbrace{0,\dots,0}_{\ell \text{ zeroes}}).$$
(If you look at the proof of the theorem, once we've chosen parametrizations of $Z$ and $X$, we only change the parametrization of $X$ to accomplish this goal.)
Now apply the theorem to the inclusion $f'\colon X\hookrightarrow Y$, choosing  local coordinates $(y_1,\dots,y_{k+m})$ on  $Y$ so that
$$f'(x_1,\dots,x_k) = (x_1,\dots,x_k,\underbrace{0,\dots,0}_{m \text{ zeroes}}).$$
So, in these coordinates, we have functions $g_i(y_1,\dots,y_{k+m}) = y_i$, $i=k+1,\dots,m$, so that $X$ is defined by $g_{k+1}(y)=g_{k+2}(y)=\dots=g_{k+m}(y)=0$. And $Z$ is cut out by the $\ell$ additional equations $g_{k-\ell+1}(y) = \dots = g_k(y) = 0$.
