How could we prove that the "The trace of an idempotent matrix equals the rank of the matrix"?
This is another property that is used in my module without any proof, could anybody tell me how to prove this one?
How could we prove that the "The trace of an idempotent matrix equals the rank of the matrix"?
This is another property that is used in my module without any proof, could anybody tell me how to prove this one?
Sorry to post solution to this such a old question, but "The trace of an idempotent matrix equals the rank of the matrix" is very basic problem and every answer here is using the solution using eigen values. But there is another way which should be highlighted.
Solution:
Let $A_{n\times n}$ is a idempotent matrix. Using Rank factorization, we can write $A=B_{n\times r}C_{r\times n}$ where $B$ is of full column rank and $C$ is of full row rank, then $B$ has left inverse and $C$ has right inverse.
Now, since $A^2=A$, we have $BCBC=BC$. Note that, $$BCBC=BC\Rightarrow CBC=C\Rightarrow CB=I_{r\times r}$$
Therefore $$\text{trace}(A)=\text{trace}(BC)=\text{trace}(CB)=\text{trace}(I_{r\times r})=r=\text{rank}(A)\space\space\space\blacksquare$$
An idempotent has two possible eigenvalues, zero and one, and the multiplicity of one as an eigenvalue is precisely the rank. Therefore the trace, being the sum of the eigenvalues, is the rank (assuming your field contains $\mathbb Q$...)
I came to this page by accident but just wanted to note that the statement above that
"the multiplicity of one as an eigenvalue is precisely the rank"
is non-trivial and is not true for general matrices. You still need to prove that algebraic multiplicity equals geometric multiplicity (in other words, that the number of linearly independent eigenvectors equals the multiplicity of one)
The fact that "since y = Px = P(Px) therefore members of an orthogonal basis of the range of P are also eigenvectors of P " is the missing piece. Because of this we can comfortably say that the rank is at least equal to the multiplicity. After that we need to state that none of the eigenvectors whose eigenvalue is zero could contribute to the range (though that one might omit because it's trivial.) @DavidSpeyer said similar things in his comment.
Hint: what are the eigenvalues of an idempotent matrix?
Just for the sake of completness I add a more explicit proof using the fact that eigenvalues of an idempotent matrix are always zeros and/or ones.
If $A$ is idempotent it is also square (i.e. $n$-by-$n$), so we can find its eigendecomposition:
$$A = Q\Lambda Q^{-1}$$
Now, we note that trace is invariant under cyclic permutations, so we have:
$$\text{tr}(A) = \text{tr}(Q\Lambda Q^{-1}) = \text{tr}(Q^{-1}Q\Lambda) = \text{tr}(\Lambda) = \sum_{i=1}^n \lambda_i = \text{rank}(A)$$
How do we know that the sum of eigenvalues is the rank? This follows from the rank-nullity theorem. If we have $k \leq n$ zero eigenvalues then they are associated with eigenvectors that form the base of the nullspace of $A$.
And from rank nullity theorem we know that $\text{rank}(A) = n - \text{dim}(\text{ker}(A))$ and this is equal to the number of non-zero eigenvalues which in our case is just the sum over all eigenvalues.