TITLE: Why is uncomputability of the spectral decomposition not a problem?
QUESTION [33 upvotes]: Below, we compute with exact real numbers using a realistic / conservative model of computability like TTE.
Assume that there is an algorithm that, given a symmetric real matrix $M$, finds an eigenvector $v$ of $M$ of unit length.
Let
$$M(\epsilon) = \begin{cases}
\left[\begin{matrix}1 & \epsilon\\ \epsilon & 1\end{matrix}\right]
,& \epsilon \geq 0 \\
\left[\begin{matrix}1 - \epsilon & 0\\0 & 1 + \epsilon\end{matrix}\right]
,& \epsilon \leq 0
\end{cases}$$
and assume that it's possible to find an eigenvector $v$ of $M(\epsilon)$.

If $\epsilon > 0$ then $v$ must necessarily be $\pm \frac 1 {\sqrt 2}\left[\begin{matrix}1\\1\end{matrix}\right]$ or $\pm \frac 1 {\sqrt 2}\left[\begin{matrix}-1\\1\end{matrix}\right]$. Observe that in all four cases, the $L^1$ norm of $v$ is $\sqrt 2$.

If $\epsilon < 0$, then $v$ must necessarily be $\pm\left[\begin{matrix}1\\0\end{matrix}\right]$ or $\pm\left[\begin{matrix}0\\1\end{matrix}\right]$. Observe that in all four cases, the $L^1$ norm of $v$ is $1$.


It's easily determinable whether the $L^1$ norm of $v$ is less than $\sqrt 2$ or greater than $1$. Therefore we can decide whether $\epsilon \leq 0$ or $\epsilon \geq 0$, which is impossible!
In a way, this is strange, because many sources say that the Singular Value Decomposition (SVD) and Schur Decomposition (which are generalisations of the Spectral Decomposition) are numerically stable. They're also widely used in numerical applications. But I've just tested the examples above for small $\epsilon$ using SciPy and got incorrect results.
So my question is, how do numerical analysts get around this problem? Or why is this apparently not a problem?
I could venture some guesses: While finding eigenvectors of general matrices may be impossible, it is possible to find their eigenvalues. Also, it's possible to "shift" a problematic matrix by some small $\epsilon$ so that its eigendecomposition is computable.

REPLY [21 votes]: This is primarily an issue of backwards vs. forwards stability. Good SVD algorithms are backwards stable in the sense that the computed singular values and singular vectors are the true singular values and singular vectors of a slightly perturbed problem. You may see this by noting that while $P$ may change drastically as you change $\epsilon$, the product $PDP^T$ changes negligibly.
The SVD is not forwards stable when the singular values have small spectral gap, as your example demonstrates and other answers here discuss in more detail.
For more on backwards and forwards stability, see, e.g., this post and the links therein:
https://math.stackexchange.com/a/78907/3060
SCIPY uses LAPACK; some details on the stability of the algorithm are provided here:
https://www.netlib.org/lapack/lug/node97.html