Claim: For any matrix, the number of non-zero eigenvalues – including algebraic multiplicity – seems to always be equal to the rank of the matrix. Here is a non-counterexample:
\begin{bmatrix} 3 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 3 \end{bmatrix}
The above matrix has an eigenvalue of 3 with an algebraic multiplicity of 3. The rank is also three. I have read about this topic: What is the relation between rank of a matrix, its eigenvalues and eigenvectors
However, I see a few people use this counterexample:
\begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}
They claim: (1) the rank is 1, and (2) the eigenvalue is 0 with an algebraic multiplicity of 2. I dispute the latter.
Why not just switch row 1 and row 2?
Is there something illegal about that? Then the rank would still be 1 and the eigenvalues would be 1 and 0. Thus, the claim that the number of non-zero eigenvalues is the rank of a matrix holds true.
Is there a better counterexample matrix that disproves my original claim?