Let $X$ and $Z$ be smooth manifolds and $\phi: X \to Z$ a smooth map so that the differential $D \phi$ is everywhere of rank $d$. Is there necessarily a $d$-fold $Y$ so that $\phi$ factors as a submersion $X \to Y$ followed by an immersion $Y \to Z$?


I have no real motivation, it just seemed like a natural question. Notice that we can't assume $Y \to Z$ is injective: Consider mapping $\mathbb{R}^2 \to \mathbb{R}^2$ by $(x,y) \mapsto ((x-1)^2 (x+1), (x-1)(x+1)^2)$, whose image is a nodal cubic.



Factoring constant rank maps into a submersion and an immersion
A smooth factorization does not exist in all cases.


Let $X$ be $\mathbb{R}^2$ minus the closed ray $R = \{ (x,0)\ |\ x\ge 0\}$, and define $\phi:X\to\mathbb{R}^2 = Z$ by the rule
$$
\phi(x,y) = \begin{cases}(x,0), & \text{when $x\le 0$,}\\ 
\bigl(x,\phantom{-}e^{-1/x^2}\bigr), & \text{when $x> 0$ and $y>0$.}\\
\bigl(x,-e^{-1/x^2}\bigr), & \text{when $x> 0$ and $y<0$.} \end{cases}
$$
Then $D\phi = \phi'$ has rank $1$ everywhere on $X$, but there is no smooth manifold $Y$ for which there is a smooth submersion $\sigma:X\to Y$ and a smooth immersion $\iota:Y\to Z$ such that $\phi = \iota\circ\sigma$. 


(Proof: Since $X$ is connected, one can assume that $Y$, if such existed, be connected. Now, considering the map $\pi:Z\to\mathbb{R}$ given by $\pi(x,y)=x$, one sees that $\pi\circ\phi:X\to\mathbb{R}$ is a surjective submersion. If the desired factorization existed, then since $\pi\circ\phi = (\pi\circ\iota)\circ\sigma$, the Chain Rule would imply that $\pi\circ\iota:Y\to\mathbb{R}$ be a (surjective) local diffeomorphism. Since $Y$ is connected and $1$-dimensional, it would follow that $\pi\circ\iota:Y\to\mathbb{R}$ be a diffeomorphism, which is impossible since $\pi\circ\iota$ cannot be one-to-one.)


