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?