Proof: If A is diagonalizable, then the rank(A) = number of nonzero eigenvalues of A?

1k Views Asked by At

I have tried to prove it as follows:

Suppose A is a $nxn$ matrix. It's eigenvalues are $\lambda_1,\lambda_2,...,\lambda_n$, with $\lambda_1,...,\lambda_r\ne0$, and $\lambda_{r+1}=...=\lambda_n=0$, so A has r nonzero eigenvalues.

Since A is diagonalizable, there exists a inverse matrix S such that $ S^{-1}AS=D=\begin{bmatrix}\lambda_1&0&0&0\\0&\lambda_2&0&0\\0&0&\ddots &0\\0&0&0&\lambda_n\end{bmatrix}$

I'm stuck here, so how could I go from here to prove: $rank(A) = rank(D) = r$?