is signed distance function real analytic for real analytic domains If $\Omega$ is a real analytic domain in $\mathbb R^n$, is the signed distance function, $f$, defined by
\begin{equation}
f(x)=\begin{cases}d(x,\partial \Omega )&{\mbox{ if }}x\in \Omega \\-d(x,\partial \Omega )&{\mbox{ if }}x\in \Omega ^{c}\end{cases}
\end{equation}
is real analytic? where
\begin{equation} d(x,\partial \Omega ):=\inf _{y\in \partial \Omega }d(x,y)\end{equation}
where inf denotes the infimum.
Thanks in advance!
 A: The answer is yes, that is $f(x)$ is real analytic in a neighborhood of any point on $\partial\Omega$. 
First recall that if $f$ and $g$ are real analytic functions (of several variables), then $f+g$, $f\cdot g$, $f/g$ (when $g\neq 0$), $f\circ g$, and the inverse map $f^{-1}$, if $f$ is a diffeomorphism, are all real analytic. You can find proofs in the book [1]. 
If $\partial\Omega$ is locally the image of a real analytic embedding $\Phi:\mathbb{R}^{n-1}\supset U\to\mathbb{R}^n$, then $N(x)$, the unit normal vector orthogonal to the image of $D\Phi(x)$ in the interior direction of $\Omega$ is also real analytic. Indeed, $D\Phi$ is real analytic and we find a normal vector by solving linear equations involving $D\Phi(x)$ so there is a real analytic normal vector $M(x)$. Possibly $M$ is not unit, but $N(x)=M(x)/|M(x)|$ is real analytic, because it is obtained from $M$ by applying to $N$ operations (listed above) that preserve analyticity.
The mapping $\Psi:U\times(-\varepsilon,\varepsilon)\to\mathbb{R}^n$,
$\Psi(x,t)=\Phi(x)+tN(x)$ is a real analytic diffeomorphism (if $U$ and $\varepsilon$ are small enough) so the inverse mapping $\Psi^{-1}:W\to
U\times(-\varepsilon,\varepsilon)$, defined in a neighborhood of a point on $\partial\Omega$ is also real analytic. If $\pi:U\times(-\varepsilon,\varepsilon)\to(-\varepsilon,\varepsilon)$ is the projection on the $t$ component, then $\pi\circ\Psi^{-1}$ is real analytic and it remains to observe that the signed distance satisfies
$$
f(x)=\pi\circ\Psi^{-1}
\quad
\text{in} 
\quad
W
$$
if $W$ is small. That follows immediately from the fact that the distance to the boundary is measured (near the boundary) along the normal line.
[1] Krantz, S. G.; Parks, H. R. A primer of real analytic functions. Basler Lehrbücher [Basel Textbooks], 4. Birkhäuser Verlag, Basel, 1992. 
