TITLE: how to find/define eigenvectors as a continuous function of matrix?
QUESTION [26 upvotes]: I asked this (with background) here
https://stats.stackexchange.com/questions/38494/principal-component-analysis-bootstrap-and-probability-of-eigenvalue-collision
but did not really get any answers. See that post for the background.
Let $D$ be some open set in the plane, say.  Not really important where the set $D$ sits, but it shoud not be only a line/curve. Suppose we have defined a continuous function on $D$
$$
f \colon   D \mapsto \text{Sym}^n
$$
where $\text{sym}^n$ is the set of (real) symmetric $n \times n$  matrices. How can I define the eigenvectors of $f(x), x \in D$ as a continuous function on $D$? How can I calculate this?
And how can I deal with eigenvalue collisions? A simple example clarifying this point (and defined on a curve):  Let
$$
f(t) =\left( \begin{matrix} 1+t & 0
\cr
   0 &   1-t \end{matrix}\right)
$$
Then the largest eigenvalue is
$$ 
\lambda_1(t) = 1+ |t|
$$
but the eigenvector corresponding to the largest eigenvalue cannot be defined as a continuous function:
$$
   v_1(t) = \begin{cases} e_2 & t\le 0        \cr
                           e_1 & t > 0 \end{cases}
$$
So what I want is to look at the two eigenvalue functions $1+t, 1-t$ and follow the eigenvectors corresponding to each one, which obviously can be done in a continuos (constant!) manner.
ADDED after the answer by Anthony Quas:
Is it possible to give some further conditions, under which a solution is possible?
Differentiability? Or, if the matrices are realizations of some random field of matrices, can something be said about the probability some continuous selection is possible?

REPLY [2 votes]: I think this might salvage the situation: Assume that you do have a path parameterized by $t$ and that it is stationary for a while any time that the multiplicity of an eigenvalue increases. In the case $n=2$ the eigenvectors are (usually) perpendicular so we could represent them as four points on the unit circle separated by $\frac{\pi}{2}$ radians . Imagine time as an axis so the eigenvectors form  four black paths traveling up a cylinder. Any time the matrix becomes a scalar multiple of the identity matrix you suddenly have the solid unit circle. As long as this is a band of some width you can arrange to leave the band in the appropriate configuration.
With larger $n$ and even more general matrices I think it would be about the same. So one point is that it can not be a function of merely where you are, but also where you were and where you will be next.
A related problem is constructive versions of the Fundamental Theorem of Algebra ( cribbed from a paper by Fred Richman which I recommend.) Let $\mathbb{A} \subset \mathbb{C}$ be the field of algebraic numbers (roots of polynomials with rational coefficients) Consider degree $n+1$ monic polynomials  $x^{n+1}+\sum_0^na_iz^i$ They can be parameterized by their coefficient vectors $\mathbf{a}=(a_0,a_1,\cdots,a_n) \in \mathbb{A}^n$ and by their "list" of roots $\boldsymbol\alpha=(\alpha_0,\cdots,\alpha_n) \in \mathbb{A}^n$ ordered somehow. There is an obvious continuous map (uniformly bicontinuous on bounded sets) in one direction $\boldsymbol\alpha \to \prod(z-\alpha_i)$ i.e. extract the coefficients using elementary symmetric functions. Is there a continuous mapping in the other? Read the paper (which gets into Dedikind cuts, extension to all of $\mathbb{C}$ and other matters.) As I recall, the correct target in the space of roots should instead be multisets of algebraic numbers with an appropriate metric. A motivating example is $z^2-b$ with $b$ real. For $b$ close to $0$ we have a sudden shift from the two roots spanning a horizontal line to a vertical one.