# 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? Jan 23, 2012 at 2:53

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$$

• +1 Thanks for posting this, it is a very pretty argument. Jul 4, 2017 at 7:10
• @MANMAID Please explain a little more why $CBC=C\Rightarrow CB=I_{r\times r}$ ? $C$ is not invertible.. Jul 4, 2017 at 9:17
• @Widawensen $C$ is not invertable, but $C$ has right inverse. Jul 4, 2017 at 9:35
• @MANMAID And I suppose $B$ has left inverse...Is it some kind of theorem which says us about this right (left) inverse ? I would be grateful for extending my knowledge.. Jul 4, 2017 at 9:40
• @Widawensen In the book D.A. HARVILLE-Matrix Algebra from a Statistician's Perspective, chapter 8, you can find it elaborately. This chapter is only about inverses actually. Jul 4, 2017 at 9: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$. Jan 23, 2012 at 3:49
• Just for the record, you don't need minimal polynomials or eigenvectors. Let $A: V \to V$ be idempotent, let $V_0 = \mathrm{Ker}(A)$ and $V_1 = \mathrm{Im}(A)$. If $u \in V_0 \cap V_1$ then $u = Au = 0$, so $V_0 \cap V_1 = \{ 0 \}$. For any $v$, we have $v = Av + (v-Av)$, and $Av \in V_1$, $v-Av \in V_0$, so $V = V_0 + V_1$. So we have $V =V_0 \oplus V_1$. (Probably not the right route for most students, but I happen to be teaching a class at the moment where I want this fact and we haven't hit Jordan canonical form yet.) Sep 12, 2014 at 13:03
• @DavidESpeyer I think that maybe it could be useful to repost (an expanded version of) your comment as an answer. Mar 10 at 12:40

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.

• Thanks for the clarification. That statement caused confusion for a while. Dec 3, 2016 at 12:36
• In the same sentence as that statement is made I clearly stated that I was taking about idempotent matrices. Confusion could only arise if you read only half of what I wrote. Feb 25, 2017 at 17:54
• @MarianoSuárez-Álvarez A wumpus has two clubs and a club's multiplicity is precisely the rank. Is it really all that clear that this statement about a club's multiplicity only holds when the club is wielded by a wumpus? Feb 25, 2017 at 22:53
• To be honest, I have no idea what that has to do with the fact that the claim I made was made in a context which I was careful to make explicit. You are of course free to... hmm... I don't know what you are doing... but sincerely I could not care less. Feb 25, 2017 at 22:56
• Very well, fine by me. Feb 25, 2017 at 23:06

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.