TITLE: Retracts are Submanifolds
QUESTION [9 upvotes]: Looking over some old qualifying exams, we found this:
Let $A\subseteq M$ be a connected subset of a manifold $M$.  If there exists a smooth retraction $r:M\longrightarrow A$, then $A$ is a submanifold.
Our thought to prove this statement was that since $r$ is smooth and the identity on $A$, then the inclusion $i:A\longrightarrow M$ is smooth.  Also, since $i\circ r=\operatorname{Id}_A$, then $i_*:TA\longrightarrow TM$ is injective.  Thus $i$ is a smooth immersion.  Therefore $A$ is a submanifold.  But, nowhere did we use that $A$ is connected.  What is wrong with the argument?  And, what is the correct proof?

REPLY [6 votes]: As pointed out in the comments, since you don't know $A$ is a manifold, you can't speak about smooth immersion of $A$ into $M$.
To prove the statement, you have to show there exists an open neighborhood $U$ of $A$ in $M$ such that the rank of $T_y r$ is constant for $y\in U$. Then applying the constant rank theorem, the result follows.
If $A$ was not connected, in general, the rank of $T_y r$ would have a different value in each connected component and $A$ would not be a pure manifold.
For the proof details you can look at P. W. Michor, Topics in Differential Geometry, section 1.15.