I'm trying to prove the above statement, and I had a look at this site.
This ends the proof with the following statement
the rank is the number of non-zero eigenvalues
But, this is what makes me confusing, because it's not all the case that rank of a matrix equals the number of non zero eigenvalues as far as I know. This shows a counter example of this.
Any comment about the rank of idempotent matrix would be grateful.