# Why is orthogonal projection not always multiplication by a diagonal matrix?

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.

• You write everyting in terms of the same basis: input vector, matrix, output vector. – Hagen von Eitzen May 27 '19 at 14:19
• The fact that a projection is orthogonal is independent of basis. What the corresponding matrix looks like is not. – user856 May 28 '19 at 5:31