Continuity of eigenvectors of self-adjoint matrices What I have here is a matrix function $A(x,y)$, defined on $[0,1]\times [0,1]$, such that each $A(x,y)$ is a self-adjoint positive semi-definite $n\times n$-matrix (with possibly complex entries). Moreover, $(x,y)\mapsto A(x,y)$ is supposed to be continuous on $\mathbb R^2$ and it has constant rank, i.e., the multiplicity of the zero eigenvalue is constant and all the other eigenvalues remain in an interval $[a,b]$, where $a > 0$. Can I then find continuous matrix functions $U$ and $B$ such that
$$
A(x,y) = U(x,y)B(x,y)U(x,y)^*,
$$
$U(x,y)$ is unitary, and $B(x,y)$ is block diagonal of the form
$$
B = \begin{pmatrix}0&0\\0&B_2\end{pmatrix},
$$
where $B_2(x,y)$ is a square matrix function of the size equal to the rank of $A(x,y)$?
 A: No, you cannot (at least in the case where the matrix entries for $A$ and for $U$ and $B$ are all real).  
I'm going to construct for you an example where $n = 2$, i.e., for each point $(x, y)$ of the plane, I'll build a $2 \times 2$ matrix with the right properties, and it'll be clear that $U$ and $B$ cannot be defined continuously. 
First, $A(0,0) = I_2$, the identity. For all other $(x, y)$, $A(x, y)$ will not be the identity, and will have one eigenvalue that's greater than $1$, and another that's less than $1$ (in fact, their product will be $1$) and will be symmetric, so its two eigenvectors will be orthogonal. Thus to specify the matrix, I really only need to tell you (1) a unit dominant eigenvector $v$, and (2) the eigenvalue $s$ for $v$. Because then $A(x, y)$ will be 
$$
A(x, y) = \pmatrix{v & v^\perp} \pmatrix{s & 0 \\ 0 & 1/s}  \pmatrix {v^t \\ (v^t)^\perp}
$$
where if $v = \pmatrix{a \\ b}$, then $v^\perp = \pmatrix{-b \\ a}$. 
Let's start with the dominant eigenvalue. At location $(x, y)$, it'll be 
$$
s(x, y) = \frac{1 + 2(x^2 + y^2)}{1 + (x^2 + y^2)}.
$$ 
For $(x, y)$ near the origin, this'll be roughly $1$; for $(x, y)$ distance from the origin, it'll be roughly $2$. 
Finally, I need to tell you $v(x, y)$. Because $(x, y)$ is not the origin [I already told you that $A(0,0) = I_2$, right?], I'm going to say that $x, y$ has polar coordinates $(r, \theta)$, where $0 \le \theta < 2 \pi$ Now I'm going to define 
$$
v(x, y) = \pmatrix{\cos \frac{3 \theta}{2}  \\
\sin \frac{3 \theta}{2} }
$$
This is clearly a continuous function of $x, y$ away from the origin, except along the positive real axis. On the positive real axis, $v$ points to the right; just a tiny bit below the positive real axis, $v$ points (almost exactly) to the left. Despite this, as you can see in the formula I gave for $A$ above, changing the sign of $v$ doesn't influence $A$, so this "sign discontinuity" in $v$ still leads to a continuous definition of $A$. 
I leave it to you to really verify that this is a problem case, but looking at the values of $U$ and $B$ on the unit circle will help. $B$ -- the diagonal matrix of eigenvalues ---  has to be continuous, and one of the eigenvalues is $3/2$ and the other is $2/3$, so $B$ has to be a constant matrix. Let's put the larger eigenvalue in the $(1,1)$ location. 
Then $U(x,y)$ --- the orthogonal matrix of eigenvectors --  has a first column that has to be a unit eigenvector for $3/2$. For $(x, y) = (1,0)$, this is either $\pmatrix{1\\0}$ or $\pmatrix{-1\\0}$. Let's pick the first one. Then using that value to determine the value at nearby points of the unit circle (think "analytic continuation", more or less), we get the first column of $U$ turning $3/2$ times as we go around the unit circle. Clearly this cannot be made continuous on the positive real axis. 
