TITLE: The relationship between the eigenvalues of matrices $XY$ and $YX$
QUESTION [13 upvotes]: If $X \in \mathbb{C}^{m \times n}$ and $Y \in \mathbb{C}^{n \times m}$ ($m \geq n$), how to prove the following?
$$\sigma (XY) = \sigma(YX) \cup \underbrace{\left \{ 0, ..., 0 \right \}}_{m-n}$$
Here, $\sigma$ denotes the set of eigenvalues/spectrum.

REPLY [2 votes]: You could modify the proof of Sylvester's determinant theorem to show that $$\text{det} \left( \lambda I_m - XY \right) = \text{det} \left( \lambda I_n - YX \right)$$ for all $\lambda \neq 0$. This shows equivalence for all nonzero eigenvalues. For the zero eigenvalues, an application of the fundamental theorem of algebra is sufficient. Note that the characteristic polynomial of $XY$ (or $YX$) must have $m$ (or $n$) roots. Since we have examined all roots $\lambda\neq0$, the remaining roots must be zero.
Edit: This proof does not work, see the comments.