48

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?

Quixotic
  • 22,817

5 Answers5

74

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

MAN-MADE
  • 5,601
  • 1
    +1 Thanks for posting this, it is a very pretty argument. – Erick Wong Jul 04 '17 at 07:10
  • @MANMAID Please explain a little more why $CBC=C\Rightarrow CB=I_{r\times r}$ ? $C$ is not invertible.. – Widawensen Jul 04 '17 at 09:17
  • 3
    @Widawensen $C$ is not invertable, but $C$ has right inverse. – MAN-MADE Jul 04 '17 at 09: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.. – Widawensen Jul 04 '17 at 09:40
  • 1
    @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. – MAN-MADE Jul 04 '17 at 09:53
  • @MANMAID O.k. Thank you for the link. I have found also https://en.wikipedia.org/wiki/Generalized_inverse#Types_of_generalized_inverses. I suppose it is also applicable to this case. Conclusion (+1) :) – Widawensen Jul 04 '17 at 09:58
36

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

  • 11
    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 03:49
  • 19
    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.) – David E Speyer Sep 12 '14 at 13:03
  • 1
    @DavidESpeyer I think that maybe it could be useful to repost (an expanded version of) your comment as an answer. – Martin Sleziak Mar 10 '22 at 12:40
  • @MartinSleziak I have hit the same need and written this down as an answer to a near-duplicate question, Relation between trace and rank for projection matrices. – Alex Shpilkin Oct 13 '22 at 09:48
19

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. – Prince Kumar Dec 03 '16 at 12:36
  • 2
    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. – Mariano Suárez-Álvarez Feb 25 '17 at 17:54
  • 5
    @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? – Pushpendre Feb 25 '17 at 22:53
  • 1
    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. – Mariano Suárez-Álvarez Feb 25 '17 at 22:56
  • 1
    Very well, fine by me. – Pushpendre Feb 25 '17 at 23:06
8

Hint: what are the eigenvalues of an idempotent matrix?

Gerry Myerson
  • 185,413
7

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.

sztal
  • 462