TITLE: Smooth spectral decomposition of a matrix
QUESTION [5 upvotes]: Let $A : x \mapsto A(x)$ be a $C^\infty$ map from the half-plane $\left\{ (x_1,x_2,\cdots,x_n) \in \mathbb{R}^n,\ x_n>0\right\}$ to the space of symmetric matrices with real coefficients. Suppose that $\dim \ker A(x)$ is constant on the half-plane. Then for all $x$ we can find an orthogonal matrix $P(x)$ such that $^tP(x) A(x)P(x)$ is a diagonal matrix. 

Can we find a map $P$ such that $x\mapsto P(x)$ is regular ($C^\infty$ would be perfect but $C^1$ also good) ?
Are projections on the eigenspaces regular?
If $A(x)$ is definite positive for all $x$ in the half-plane, is the square-root of $A(x)$ regular?
If now, we suppose that $P$ is only invertible (but we still have $^tP(x) A(x)P(x)$ is a diagonal matrix), can $P$ be regular ?

If the answer is no for one of this question, do you have a counterexample? If this answer is yes but if we assume more regularity of $A$ (for example real analytic), please tell me. Any references would be appreciated.

REPLY [4 votes]: To add to Marcs answer: There is indeed a smooth (in fact real analytic) square root function on the space of symmetric positive definite matrices. One can use the power series expansion $\sqrt{1+z}=\sum_{k=0}^\infty \binom{1/2}{k} z^k$ which converges for $|z|<1$. This means that $A\mapsto\sum_{k=0}^\infty \binom{1/2}{k} A^k$ is a smooth function on $\lbrace A \mid \sigma(A)\subset(0,1)\rbrace$. Since the Frobenius norm $\|A\|_F:=\sqrt{\sum_{i,j} a_{ij}^2}$ is smooth as a function of $A$ and majorizes the spectral radius we can force the spectral radius to be less than one by looking at $\frac{1}{42\|A\|_F}A$ instead of $A$. Hence the global square root can be written as $A\mapsto \sqrt{42\|A\|_F} \sqrt{\frac{A}{42\|A\|_F}}$ which is now a smooth function of $A$.