Why Does the Difference between the Identity and Permutation Matrix Project Onto The Nullspace of A Transpose?

Suppose you are given a matrix $A$ whose columns are linearly independent and span some subspace of $\mathbb{R}^n$. The projection matrix $P$ is defined to be $$P=A(A^TA)^{-1}A^T$$ This matrix projects any $b\in\mathbb{R}^n$ onto the subspace spanned by the columns of $A$. Furthermore the matrix $I-P$ projects onto the nullspace of $A^T$, but I am unsure of why this is. Could someone explain or link a proof? Thank you.


Solution 1:

To check that $I-P$ is an orthogonal projection, verify that $(I-P)^2=I-P$ and that $I-P$ is symmetric.

Having established $I-P$ is a projection, it remains to find the range of $I-P$.

To show $\text{range}(I-P) \subseteq \text{nullspace}(A^\top)$, verify that for any $v$ we have $A^\top (I-P)v = 0$, so $(I-P)v \in \text{nullspace}(A^\top)$.

To show the reverse inclusion $\text{range}(I-P) \supseteq \text{nullspace}(A^\top)$, verify that if $A^\top u = 0$, then $u = (I-P)u$ so $u \in \text{range}(I-P)$.