Originally Posted by
NonCommAlg we only need to prove that the null space of A and P are equal, because then by the rank-nullity theorem they must also have the same rank.
if $\displaystyle Ax=0,$ then $\displaystyle Px=0$ and hence $\displaystyle \text{null}(A) \subseteq \text{null}(P).$ conversely, if $\displaystyle x \in \text{null}(P),$ then $\displaystyle Px=A^TAx=0,$ i.e. $\displaystyle Ax \in \text{null}(A^T)=(\text{col}(A))^{\perp}.$ hence $\displaystyle Ax \in \text{col(A)} \cap (\text{col}(A))^{\perp}=(0). \ \Box$