# The rank of a symmetric matrix equals the number of nonzero eigenvalues.

I am wondering why

the rank of a symmetric matrix equals its number of nonzero eigenvalues.

I have tried showing it like this:

A symmetrix matrix A can be written:

$$A=PDP^T$$, where P is an orthogonal matrix.

It is not difficult to see that for a vector x: $$PDP^Tx=0 \leftrightarrow DP^Tx=0$$, since P is invertible.

So what we need to show is that dimension of the nullspace of $$DP^T$$ equals the number of eigenvalues with value zero.

Do you see how to do this?

The rank of $$A$$ is equal to the rank of $$D$$ and it is clear that the rank of $$D$$ equals the number of nonzero eigenvalues (which are the same eigenvalues as those of $$A$$).

• But how do we know that the rank of A is equal to the rank of D? Jul 21, 2019 at 17:37
• Because two similar matrices have the same rank. Jul 21, 2019 at 17:38
• @user394334 Because multiplying with an invertible matrix doesn't affect rank. You've already seen that that's true for multiplying with $P$ from the left. It's not very difficult to show that it also holds for multiplying with $P^T$ from the right. Jul 21, 2019 at 17:43

More precisely, I would say that the rank of a symmetric matrix is equal to the sum of the geometric multiplicities of its nonzero eigenvalues. For example, If $$A$$ has two nonzero eigenvalues, say $$2$$ and $$3$$, with geometric multiplicities $$1$$ and $$2$$ respectively, then the rank of $$A$$ is $$1+2 = 3$$.

In this example, $$2$$ and $$3$$ would appear once and twice in $$D$$ respectively. So the number of repetitions of nonzero eigenvalues in $$D$$ needs to be considered