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?



how to find/define eigenvectors as a continuous function of matrix?
The example given by Anthony Quas reveals a phenomenon discussed in Kato's book *Perturbation Theory for Linear Differential Operators*. The point is the following:


* If the symmetric matrix depends analytically upon **one** parameter, then you can follow analytically its eigenvalues and its eigenvectors. Notice that this requires sometimes that the eigenvalues cross. When this happens, the largest eigenvalues, as the maximum of smooth functions, is only Lipschitz.
* On the contrary, if the matrix depends upon two or more parameters, the eigenvalues are at most Lipschitz when crossing happens, and the eigenvectors cannot be chosen continuously. A typical example is
$$(s,t)\mapsto\begin{pmatrix} s & t \\\\ t & -s \end{pmatrix},$$
whose eigenvalues are $\pm\sqrt{s^2+t^2}$. Up to the shift by $I\_2$, Quas' example is just a piecewise $C^1$ section of this two-parameters example, and it inherits its lack of continuous selection of eigenvectors.
* Likewise, if analyticity is dropped, a $C^\infty$-example by Rellich shows that eigenvectors need not be continuous functions of a single parameter. Of course, Quas' example can be recast as a $C^\infty$ one, by flatening the parametrisation at $t=0$, say by replacing $t$ by $s$ such that $t={\rm sgn}(s)\cdot e^{-1/s^2}$.


Side remark: Kato's result is only *local*. If the domain is not simply connected, it could happen that a global continuous selection of eigenvectors is not possible. This is classical in the exemple above if you restrict to the unit circle $s^2+t^2=1$; then the eigenvalues $\pm1$ are global continuous functions, but when following an eigenvector, it experiences a flip $v\mapsto -v$ as one makes one turn.


