The set of self-adjoint maps $P$ with $P^2=P$ and rank $k$ is a submanifold 
Let $G_{k,m}$ be the set of the self-adjoint linear maps $P:\mathbb R^m \rightarrow \mathbb R^m$ of rank $k$ satisfying $P\circ P = P.$ Prove that $G_{k,m}$ is a $C^\infty$ submanifold of dimension $k(m-k)$ in $\mathbb R^{m^2}$.

Since $P$, being self-adjoint, has an orthonormal basis of eigenvectors and the condition $P^2=P$ ensures that all eigenvectors are equal to $0$ or $1$, then Rank$P$ = Trace $P$. Writing $Tr$ for the trace function, it seems that I should consider the pre-image $Tr^{-1}(k)$, but if I do so, I am going to obtain a   much bigger set containing $G_{k,m}$...
How to work from here?  Any clue, hint? Thank you.

Tip: $P^2 = P$ means that $P:\mathbb R^m$ is a subspace projection, and self adjointness corresponds to orthogonality of this projection.
Since for each subspace $W\subset \mathbb R^m$ there is a unique orthogonal projection $\mathbb R^m\to W$, you can identify $G_{k,m}$ with the $k$-th Grassmanian of $\mathbb R^m$, and proceed from there.
