# Proving: “The trace of an idempotent matrix equals the rank of the matrix”

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?

-
What is your module? –  Mariano Suárez-Alvarez Jan 23 '12 at 2:53
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$...)
Just in case it isn't clear, the reason the eigenvalues are $0$ and $1$ is because all the eigenvalues are roots of the minimal polynomial, which is $x^2-x$. Because the minimal polynomial has no repeated roots, it is diagonalizable, and thus has a basis of eigenvectors. Writing the vector space as $V_0\oplus V_1$, the transformation is projection onto $V_1$, and so the rank is the dimension of $V_1$. –  Aaron Jan 23 '12 at 3:49