[Math] What’s the relationship between the rank and eigenvalues of symmetric positive semidefinite matrix (real domain)

eigenvalues-eigenvectors

Could anyone tell me the relationship between the rank and eigenvalues of symmetric positive semidefinite matrix (real domain)? According to simple algebra theorem:
$$P^{T}AP=diagal(\lambda_{1},\cdot\cdot\cdot,\lambda_{n})$$

I infer to the following conclusion:
$$Rank(A)=number \space of \space nonzero \space eigenvalues$$
Can anyone give me a proof?

Best Answer

What's there to prove? You're correct.

Let $P$ be the (invertible!) matrix you describe. We have $$ \operatorname{rank}(A) = \operatorname{rank}(P^TAP) = \operatorname{rank}(\operatorname{diag}(\lambda_1,\dots,\lambda_n)) $$ the rank of $\operatorname{diag}(\lambda_1,\dots,\lambda_n)$ is the number of $\lambda_i$ such that $\lambda_i \neq 0$. Your conclusion follows.