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 : it has a non-empty interior $\overset{\circ}{K}$, and the closure of $\overset{\circ}{K}$ is $K$; in particular $K$ has co-dimension $0$.
  • $K$ has a $C^{k+1}$ boundary.
  • $K$ is convex.


  • Question 1: Is there some exponent $k+1<p<\infty$ such that $d_K^p$ is also $k$ times continuously differentiable on $\mathbb{R}^n$? Note, this is known to be true locally, on some open neighbourhood of $K$ (see Lemma 14.16 for instance). But the result does not require convexity so maybe it is possible to get smoothness on all of $\mathbb{R}^n$ by incorporating this assumption.

  • 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$?

  • 1
    $\begingroup$ I remember that many years ago i read such type of results mentioned in springer.com/gp/book/9780817642648 but I do not remember the details. $\endgroup$ May 9, 2021 at 0:12
  • $\begingroup$ I mean, not literally: for example if $n = 1$, $r = 2$ and $K = (-2,-1] \cup [1,2)$ then $d_K(x) = (1 - \lvert x \rvert) \vee 0$. The $C^k$-differentiability you ask for should hold in a tubular neighbourhood, however - try geodesic normal coordinates. $\endgroup$
    – Leo Moos
    May 9, 2021 at 0:32
  • $\begingroup$ What if I assume convexity of $K$..so in particular it is simply connected and the example of LeoMoos does not apply. $\endgroup$
    – AIM_BLB
    May 9, 2021 at 1:13
  • 1
    $\begingroup$ @JochenWengenroth Note your examples does not apply if $R^2$ since $K$ is not a convex body (as I assumed that it $K$'s interior's closure is itself) $\endgroup$
    – AIM_BLB
    May 9, 2021 at 20:55
  • 5
    $\begingroup$ Near the boundary of $K$, your distance function is 0 inside and is approximately a linear function outside. So to get $C^k$ differentiability you need $p \geq k+1$ at minimum. $\endgroup$ May 10, 2021 at 15:55

1 Answer 1


If a domain $\Omega$ has boundary of class $C^k$, $k\geq 2$, then in fact the distance function $d$ to the boundary of $\Omega$ is of class $C^k$ in a neighborhood of the boundary. This is exactly what is proved in Lemma 14.16 in [1] mentioned by OP.

In the case of a convex set we have the following result. Note that we have a better regularity than the one claimed by OP since we do not need to assume that the boundary is of class $C^{k+1}$.

Theorem. Assume that $K\subset\mathbb{R}^n$ is convex with non-empty interior and that $\partial K\in C^k$, $k\geq 2$. Then for any $p>k$ we have $d_K^p\in C^k(\mathbb{R}^n)$.

Proof. Let $\nu:\partial K\to\mathbb{R}^n$ be the unit outer notrmal. If $\partial K$ is represented (locally) as a graph of $\varphi\in C^k$, then $\nu$ can be represented in terms of $D\varphi$ and hence $\nu\in C^{k-1}$.

Consider the function $$ \Phi:\partial K\times\mathbb{R}\to\mathbb{R}^n, \quad \Phi(x,t)=x+\nu(x)t. $$ Clearly $\Phi\in C^{k-1}$. It follows from the computation in Lemma 14.16 in [1] that the Jacobian $J_\Phi$ of $\Phi$ can be expressed in terms of the principal curvatures and in fact $$ J_\Phi(x,t)>0 \quad \text{for all} \quad (x,t)\in \partial K\times [0,\infty). $$ Hence $\Phi$ is a diffeomorphism in a neighborhood of $\partial K\times\{0\}$. However, the normal lines never intersect outside $K$, so it follows that $\Phi$ is actually a diffeomorphism in an open set $U$ that contains $\partial K\times [0,\infty)$. Clearly $V=\Phi(U)$ is an open subset of $\mathbb{R}^n$ that contains $\mathbb{R}^n\setminus\overset{\circ}{K}$.

Let $\hat{d}_K$ be the signed distance to $\partial K$ which is positive and equals $d_K$ in $\mathbb{R}^n\setminus K$ and is negative in $\overset{\circ}{K}$.

For $y\in V$, let $\pi(y)\in\partial K$ be the unique closest point so $$ y=\pi(y)+\nu(\pi(y))\hat{d}_K(y), \quad \text{i.e.,} \quad y=\Phi(\pi(y),\hat{d}_K(y)), $$ and hence $(\pi(y),\hat{d}_K(y))=\Phi^{-1}(y)$ which proves that $\hat{d}_K\in C^{k-1}(V)$. This is smaller regularity than we wanted, but a nice trick allows us to show that actually $\hat{d}_K\in C^{k}(V)$. Indeed, $\nabla \hat{d}_K$ points in directional in which the function growths fastest which is $\nu(\pi(y))$. Since the distance growths linearly in that direction, we have that $\nabla \hat{d}_K(y)=\nu(\pi(y))\in C^{k-1}$, and hence $\hat{d}_K\in C^k(V)$.

Now $$ d_K=\begin{cases} \hat{d}_K & \text{in } \mathbb{R}^n\setminus\overset{\circ}{K}\\ 0 & \text{in } K. \end{cases} $$ For that reason reason we lose regularity of the function at the boundary. However, the function $d_K^p$, where $p>k$ has all partial derivatives of order up to $k$ equal zero on the boundary of $K$ and it follows that $d_K^p\in C^k$.

[1] Gilbarg, D. Trudinger, N. S. Elliptic partial differential equations of second order. Reprint of the 1998 edition. Classics in Mathematics. Springer-Verlag, Berlin, 2001.

  • $\begingroup$ So, in particular, $d_K$ can never be $C^k$ on $\mathbb{R}^n$? $\endgroup$
    – AIM_BLB
    May 18, 2021 at 13:02
  • $\begingroup$ @James_T No. In the interior of $K$, $d_K=0$ and it growths linearly outside of $K$. If $K$ is the unit ball then $d_K(x)=0$ for $|x|\leq 1$ and $d_K=|x|-1$ if $|x|\geq 1$. The function is not differentiable on the boundary. However if you take the signed distance $\hat{d}_K$, then it is $C^k$ everywhere except the points inside the domain where the closest point to the boundary is not unique since at such points the distance function is not differentiable, see Lemma 12 in arxiv.org/pdf/2011.14508.pdf $\endgroup$ May 18, 2021 at 13:34
  • $\begingroup$ Right and $\hat{d}_K\in C^k(\mathbb{R}^n)$ may fail if $K$ is not convex right? $\endgroup$
    – AIM_BLB
    May 18, 2021 at 16:56
  • $\begingroup$ @James_T It almost all fails. Even if the set is convex, but not the half-space, it fails in the interior of the convex set. See my previous comment. $\endgroup$ May 18, 2021 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.