Given a vector space $X$ with complementary subspaces $V$ and $W$, I need to find a projection matrix $P$ on $X$ which projects onto $V$ along $W$. If $\mathbf{V}$ and $\mathbf{W}$ are the matrices containing basis vectors for $V$ and $W$, the solution says that $P = [\mathbf{V} \text{ } \mathbf{0}] \text{ }\mathbf{M}^{-1}$ is a required projection, where $\mathbf{M} = [\mathbf{V} \text{ } \mathbf{W}]$.
In the proof it states that with above definition of $P$, it is idempotent (clear), it's null space is same as range of $W$ (clear) and it's range is same as range of $V$. I don't fully understand how is the third condition justified? I'm trying to break down $P$, so that I can write it as some linear combination of columns of $\mathbf{V}$, but it doesn't seem to turn out that way. Any idea what I'm doing wrong?
I think I got it.
$$R(P) = \{Px | x \in X\}$$
$$=[\mathbf{V} \text{ } \mathbf{0}] \mathbf{M}^{-1}x,\ \forall \ x \in X$$
Since $\mathbf{M}$ is square and spans $X$, then $\mathbf{M}^{-1}$ should also span $X$. Therefore,
$$R(P)=[\mathbf{V} \text{ } \mathbf{0}]y,\ \forall\ y \in X$$
$$=\text{span}([\mathbf{V} \text{ } \mathbf{0}])$$
$$=\text{span}(\mathbf{V})$$
$$=V$$