Why is orthogonal projection not always multiplication by a diagonal matrix

geometrylinear algebralinear-transformationsprojectionprojection-matrices

Suppose I have a vector $v$ which I want to orthogonally project onto a subspace $S.$ The subspace is defined as the space spanned by the columns of a matrix $A.$ I could do this by constructing a projection matrix $P$ via the common formula $P = A(A^TA)^{-1}A^T,$ and then computing the projection via $Px.$

However, we know that there exists some basis for the subspace $S$ such that the projection operator is diagonal, having diagonal elements equal to zero or one. We also know that orthogonal projection is independent of basis. So I should also be able to compute the projection via $Px,$ where $P$ is diagonal.

This seems strange to me – note that I didn't have to cast $x$ in any new basis, only $P.$ It would imply that projecting a vector onto a subspace can always be reduced to multiplication by a simple diagonal matrix.

I am guessing that my error is in asserting that $x$ need not be written in terms of the basis which diagonalizes $P.$ But I don't see why.

Best Answer

By this reasoning a change-of-basis matrix should always just be an appropriately-sized identity matrix, since it represents the identity map. Just as a vector exists independently of a choice of basis, but its representation as a coordinate tuple is certainly basis-dependent, the linear map that is this projection exists independently of choice of basis, but its representation as a matrix is basis-dependent.