Show $PQ$ and $QP$ have the same eigenvalues with density of $GL_n$ There is a wonderful series of lectures on YouTube of Dr. Tadashi Tokieda on Geometry and Topology. In the fourth video in this playlist Tadashi sketches an argument for why if $P$ and $Q$ are $n$ by $n$ matrices then $PQ$ and $QP$ have the same eigenvalues using the density of invertible matrices in $M_n$, the space of $n$ by $n$ matrices.
The argument goes as thus:
(1) Let $(*)$ denote the statement "$PQ$ and $QP$ have the same eigenvalues."
(2) Note that $GL_n$ is an open dense subset of $M_n$. If $Q$ is not invertible, then let $Q_n$ be a sequence of invertible matrices converging to $Q$ (with whatever norm you like).
(3) Let $(*)_n$ denote the statement "$PQ_n$ and $Q_nP$ have the same eigenvalues." Since $Q_n$ is invertible, the statement $(*)_n$ is true for every $n$. (Tadashi has already shown the claim is true in the case that $Q$ is invertible.)
(4) Now, Tadashi claims that the statement $(*)_n$ depends continuously on $n$. Therefore, as $Q_n\to Q$, and the statement $(*)_n$is true for every $n$, the statement $(*)$ is also true.
Can someone flesh out this step (4)? How exactly does $(*)_n$ depend continuously on $n$? Many thanks.
 A: The roots of a complex polynomial are continuous in its coefficients. Hence, if $A_n$ is a sequence of matrices converging to $A$, then the eigenvalues of $A_n$ converge to those of $A$.
A: Here's a more rigorous version of Tokieda's proof which employs the same strategy that Peter Lax used to show that the determinant function is multiplicative. (See page 38 of Linear Algebra, John Wiley and Sons, 1997 edition.) The strategy is insightful, and could be useful for the reader's own problems. One benefit of this proof is that the reader does not have to be explicitly familiar with the concept of dense subsets. After the proof, I also show why appealing to the Implicit Function Theorem fails.
Lemma. If $P$ is invertible or $Q$ is invertible, then (*) is true.
Proof of Lemma: Without loss of generality, let $Q$ be invertible. Then $Q(PQ)Q^{-1} = QP$. In other words, $PQ$ and $QP$ are similar matrices, which implies that they have the same eigenvalues. $$\tag*{$\blacksquare$}$$
Proof of (*): Let $m$ be the number of rows of $Q$, and let $M$ be the set of all $m\times m$ matrices with entries in $\mathbb{R}$. It is best to think of $M$ as a subset of $\mathbb{R}^{m^2}$ in this proof, which is valid since $m^2$-tuples are in 1-1 correspondence with square $m\times m$ matrices. Let $I$ be the subset of $M$ of invertible matrices, and consider the matrix $P$ as being fixed. Define $f, g: M \to \mathbb{C}^m$ by $f(X) = (\lambda_1, \lambda_2, \dots, \lambda_m)$ and $g(X) = (\mu_1, \mu_2, \dots, \mu_m)$ where $\{\lambda_i\}_{i=1}^m$ is the set of eigenvalues of $PX$ and $\{\mu_i\}_{i=1}^m$ is the set of eigenvalues of $XP$. Note that the eigenvalues could be complex, and that is okay. It suffices to show that $(f - g)(Q) = (0,0,\dots,0) = \vec{0}$, because that would mean that $PQ$ and $QP$ have the same eigenvalues.
By the lemma, we can assume that $Q$ is singular ($Q \in M\setminus I$). Choose a matrix $T\in \mathcal{I}$, and let $q(t) = (1-t)Q + tT$ where $t\in \mathbb{R}$. (This is Lax's strategy. One can view $q$ as a linear interpolation between the singular matrix $Q$ and the invertible matrix $T$.)  Define $h: \mathbb{R} \to \mathbb{R}$ by $h(t) = \text{det}\,q(t)$. Now both $q$ and det are continuous functions, since they involve only addition and multiplication of their inputs. Thus, $h$ is a continuous function as well. In fact, $h$ is a finite-degree polynomial in $t$. Moreover, since $h(1) = \text{det}\,(q(1)) = \text{det}\,T \neq0$, we see that $h$ is not identically zero. Therefore, being a nonzero polynomial of one variable, $h$ has only a finite number of roots. Let $t_0$ be a nonzero root of $h$ that minimizes the distance $|Q - q(t)|$. Then there is no singular matrix closer to $Q$ than $q(t_0)$. Hence, on the open interval $(-|t_0|, |t_0|)$, we have $q(t) \in \mathcal{I}$, except at $t=0$.

By the Lemma, if $t \in (-|t_0|, |t_0|)\setminus\{0\}$, then $q(t)\in \mathcal{I}$, and $(f-g)(q(t)) = \vec{0}$. Hence,
$$\lim_{t \to 0}(f-g)(q(t)) = \vec{0}.$$
Therefore, if  $(f-g)\circ q$ were continuous at $0$, then we could conclude "by substitution" that
$$\vec{0} = \lim_{t \to 0}(f-g)(q(t)) = (f-g)(Q).$$
Since $q$ is continuous at $0$, it remains to show that $f$ and $g$ are both continuous at $q(0) = Q$. We show this for $f$; the argument for $g$ is identical. Let $A \in M$. Note that the component functions of $f$ are each roots of the polynomial $p(\lambda) = \text{det}\,(\lambda I - PA)$. Observe that the coefficients of $p$ arise from sums and products of the entries of $PA$. It can also be shown that the roots of $p$ depend continuously on its coefficients. (For example, see \url{https://www.ams.org/journals/proc/1987-100-02/S0002-9939-1987-0884486-8/S0002-9939-1987-0884486-8.pdf}.) Therefore, $f$ depends continuously on $PA$. Finally, the definition of matrix multiplication (where defined) is:
$$(CD)_{ij} = \sum_{k=1}\,C_{ik}D_{kj}.$$
This shows that $PA$ depends continuously on $A$; hence, $f$ depends continuously on $A$. Since $A$ was an arbitrary element of $M$, $f$ is continuous at $Q$. $$\tag*{$\blacksquare$}$$
Note: This is a corrected version of my original attempt, and is equivalent to appealing to dense subsets, but does not explicitly do so. In the first attempt, I tried to avoiding the concept of dense subsets altogether by appealing to the Implicit Function Theorem to construct an open interval around Q free of singular matrices. However, I was in error in applying it. In brief, I tried describing the manifold defined by det,$X = 0$ for $X \in \mathcal{M}$ using only $m^2 - 1$ of the coordinates. However, I could find no way to show that at least one partial derivative of the determinant function did not vanish at $Q$, which is a requirement for the Implicit Function Theorem to apply.  Although one can get around this if $Q$ is the zero matrix, since in that case (*) holds trivially, it was not clear that how to proceed for a general singular matrix $Q$.
A: Yeah, that's sloppy. Try taking characteristic polynomials instead:
$$
\chi (PQ_n , t) - \chi (Q_n P , t)
$$
as a function from matrices $Q_n$ to $Pol(n)$. Is this continuous function of all the entries of $Q_n$? You have already shown it is $0$ for a dense subset. Can you get it to be $0$ everywhere?
A: I finally found an answer to this that is satisfying for me and simple enough. Let's say we are working over $\Bbb C$. The determinant $\det\colon M_n(\Bbb C)\to \Bbb C$ is a continuous function when we give $M_n(\Bbb C)$ the topology of a finite dimensional vector space.
Let $\{Q_n\}$ be a sequence of invertible matrices with $Q_n\to Q$. Since $PQ_n$ and $Q_nP$ have the same eigenvalues, they have the same characteristic polynomial for every $n$. Since $\lim (PQ_n-\lambda)= PQ-\lambda$ and $\lim (Q_nP-\lambda)= QP-\lambda$, then by continuity,
$$
\det(PQ-\lambda) =\lim \det(PQ_n-\lambda)=\lim\det(Q_nP-\lambda)=\det(QP-\lambda).
$$
This last equation says that the characteristic polynomials $\det(PQ-\lambda),\det(QP-\lambda)$ are equal, so in particular they must have the same roots. But then they must have the same eigenvalues, as claimed.
A: There is a much simpler, classical argument for Step (4), once you got Step (3).
Fix an arbitrary $\lambda$. Define
$$
R(x):= \det( (P-xI)Q - \lambda I)- \det( Q(P-xI) - \lambda I)
$$
Then, $R(x)$ is a polynomial in $x$, which by Step (3) is zero whenever when $x$ is NOT an eigenvalue of $P$. Since $P$ only has finitely many eigenvalues, the polynomial $R(x)$ has infinitely many roots and hence $R \equiv 0$.
In particular $R(0)=0$.
Note If you really want to use continuity, you can change the above proof the following way:
$R(x)$ is a polynomial and hence a continuous function in $x$. Now, pick a sequence $x_n \to 0$ with the property that for all $n$,  $x_n$ is not an eigenvalue of $P$. Then, by Step (3) we have
$$
\det(PQ-\lambda I) - \det(QP-\lambda I))= R(0) = \lim_n R(x_n)= \lim_n 0 =0 
$$
