In the MIT linear algebra online lecture, when doing SVD, Gilbert Strang said that the eigenvalues of $AB$ and $BA$ are the same. I was trying to prove this as follows:
Let $A$ be $m \times n$ matrix and $B$ be $n \times m$ matrix. Then $AB$ is $m \times m$ and $BA$ is $n \times n$.
Let $$ABx=\lambda x$$ Then $$BA(Bx)=\lambda(Bx)$$ and $\lambda$ is an eigenvalue of $BA$ as well, and vice versa. Q.E.D.
However, after a second thought I think the above proof has a pitfall. Namely, if $x$ is in the null-space of $B$ then $BA$ needs not have eigenvalue $\lambda$.
So my questions is:
Is the statement that $AB$ and $BA$ have the same eigenvalues true for general $m \times n$ matrix $A$ and $n \times m$ matrix $B$? If yes, how to prove it?
If no, is it true for the special case when $B=A^\dagger$? And how to prove it?