TITLE: Almost commuting matrices, one a projection, is there a nearby projection that commutes?
QUESTION [5 upvotes]: Suppose that $P, A, Q \in \mathbb{M}^{n \times n}(\mathbb{R})$ (I'm still interested if it must be done over $\mathbb{C}$), (EDIT:) suppose that $A$ is given, $P$ is an orthogonal projection, and $\lVert PA-AP \rVert < \delta$, is there some $Q$ an orthogonal projection such that $\Vert P-Q \rVert < \epsilon(\delta)$ (such that as $\delta \to 0$, so does $\epsilon$) and $QA = AQ$?  Obviously if there's a broader result than just the finite-dimensional case, then that's good too.
I've seen results vaguely like this, e.g. Lin's Theorem is a result about almost-commuting normal matrices.  However I haven't seen a result about projections of this kind.
It would be nice if this were true, I hope to learn more about this type of result, but if the good people here could point me to this result or a similar result from which I could jump off, I'd very much appreciate it.
EDIT:
A simple counterexample to my suggestion:
$$
A = \begin{bmatrix}1 & \delta \\ 0 & 1\end{bmatrix}
$$
$$
P = \begin{bmatrix}0 & 0 \\ 0 & 1\end{bmatrix}
$$
The only non-trivial invariant subspaces are $\mathbb{R}^2$ and the span of $\begin{bmatrix}1 & 0\end{bmatrix}$, but P is not near to the projection for either.  But $\lVert PA-AP \rVert = \delta$.
Another counterexample is given in the comments.

REPLY [3 votes]: EDIT: I realized that this does not work, because $PA$ has one nonzero too much, sorry. $A$ and $P$ can be simultaneously almost-triangularized, but they don't almost-commute. I'm leaving it up as an attempt, but it doesn't deserve acceptance / upvotes.
Suppose such $\delta<1$ and $\epsilon(\delta)$ exist. Take $A = J + \delta e_1 e_n^T$, $P = e_1 e_1^T$ where $J$ is a nilpotent Jordan block of size $n$, and $e_1,e_n$ are the first and last column of the identity matrix $I$. Since $\|P-Q\|<1$, and orthogonal projection matrices have integer trace equal to their rank, $Q$ must have rank 1. Then $\operatorname{Im} Q$ must be a real eigenvector of $A$, and the only one is $[1\, \delta^{1/n}\, \delta^{2/n}\, \dots \, \delta^{1-1/n}]^T$ (and its multiples). So $Q$ is at a distance $O(\delta^{1/n})$ from $P$. Hence $\epsilon(\delta) > C\delta^{1/n}$ for some $\delta$. This holds for all $n$, and thus $\epsilon(\delta) \geq 1$, contradicting $\epsilon(\delta) \to 0$.