Is $A(AA^T)^{-1}A^T$ a diagonal matrix? $A$ is a $n\times k$ matrix with rank $k<n$. I was wondering if $A(A^TA)^{-1}A^T$ a diagonal matrix where $k$ entries are one and other entries are zero.
I'm not sure if this is correct. If this is correct, how to prove it?

This is true up to a change of orthonormal basis. Let $A=USV^\top$ be a singular value decomposition. Then $P:=A(A^\top A)^{-1}A^\top=U\pmatrix{I_k\\ &0}U^\top$. Therefore, while $P$ is usually not a diagonal matrix due to the conjugation by $U$, the linear operator it represents in the standard basis does have a diagonal matrix representation $\pmatrix{I_k\\ &0}$ in the orthonormal basis defined by $U$.
