Smoothness of Squared distance function Fix a non-empty compact subset $K\subseteq \mathbb{R}^n$ and let $d_K(x):=\min_{z \in K} \,\|z-x\|$ be the map sending any $x\in \mathbb{R}^n$ to its distance from $K$.
Suppose that:

*

*$K$ is regular; i.e. it has a non-empty interior $\overset{\circ}{K}$ and the closure of $\overset{\circ}{K}$ is $K$.

*$K$ $C^{k+1}$ boundary,

*$K$ is convex (actually a convex body by the above).

Then:

*

*Question 1: Is there some $0<p<\infty$ such that: $d_K^p$ also $k$-times continuously differentiable?


*(Backup) Question 2: Are there reasonable "geometric" conditions on $K$ which will guarantee that $d_K^p$ is $C^k$ on $\mathbb{R}^n$; for some $0<p<\infty$?
Note: I recall seeing something if $K$ is a convex body (i.e.: convex with codimension $0$ but I can't remember if I'm thinking of them correctly).
 A: The $k=0$ case follows from the triangle inequality. The $k>0$ case is more interesting:
Let $\partial K$ denote the boundary of $K$, and let $N:\partial K\to\mathbb{R}^n$ denote the outward pointing unit normal vector field, which is $C^k$. Define a map $F:\partial K\times (0,\infty)\to\mathbb{R}^n\setminus K$ by $F(x,t)=x+tN(x)$. One can show that $F$ is a $C^k$ diffeomorphism, and that $d_k(F(x,t))=t$. It follows from this that $d_K^p$ is $C^k$ on $\mathbb{R}^n\setminus K$ for all $p$.
To show that $F$ is a diffeomorphism requires a few steps. One can apply the following facts:

*

*Given $x\in\mathbb{R}^n\setminus K$, the distance from $x$ to $K$ is minimized by the unique point $y\in\partial K$ for which $x-y=cN(y)$ for some $c>0$ (this implies $F$ is injective and surjective).

*The shape operator $S$ of $\partial K$ is $C^{k-1}$ and positive semidefinte due to convexity.

*Identifying $T_{(x,t)}(\partial K\times(0,\infty))$ with $T_x\partial K\times \mathbb{R}$, we have $d_{(x,t)}F(u,r)=u+tS(x)u+rN(x)$, which is invertible and $C^{k-1}$, thus $F$ is a $C^k$ diffeomorphism.

