If $A$ and $B$ are similar, why does $\text{rank}(A) = \text{rank}(B)$? Suppose $A$ and $B$ are similar matrices over $\mathbb{C}^n$. Why do we have $\text{rank}(A) = \text{rank}(B)$?

If $A$ and $B$ are similar then $A = PBP^{-1}$ for some invertible matrix $P$. Because $P$ is invertible its null space is trivial, i.e. $nullity(P) = \{0\}$.
Now suppose that $Ax = PBP^{-1}x = 0$. Using the result above $PBP^{-1}x = 0$ if and only if $PBx = 0$; Again $PBx = 0$ if $Bx = 0$. The latter result means that $nullity(A) = nullity(B)$. Using rank-nullity-theorem we can conclude that $rank(A) = rank(B)$.
The proof is taken from here.
