# Distance function to $\Omega\subset\mathbb{R}^n$ differentiable at $y\notin\Omega$ implies $\exists$ unique closest point

I am trying to show the following two statements are true:

(1) For any nonempty set $\Omega\subset\mathbb{R}^n$, the set $B$ consisting of points $y\notin\Omega$ where there is not a unique closest point $x\in\partial\Omega$ for each $y$ has $\mathcal{H}^n$-measure 0.

(2) This implies that the number of points $a\in A\subset \mathbb{R}^2$ such that $\mathcal{H}^{1}(\vec{n}(a)\cap B)>0$ is countable, where $\vec{n}(a)$ is the normal to $a\in A$ and $A$ is $C^1$ (i.e. it is locally the graph of a $C^1$ function from $\mathbb{R}$ to $\mathbb{R}$. More specifically, $A$ is a $C^1$ closed embedded 1-d submanifold in $\mathbb{R}^2$).

For (1), I would like help proving only this related fact: if the distance function $f$ to $\Omega$ is differentiable at a point $y\notin\Omega$, then there exists a unique closest point $x\in\partial\Omega$ to $y$.

I thought that I could get at this by saying that the graph of $f$ has a sharp corner wherever there is more than one closest point (and hence is not differentiable there). But, I am told this is not always true.

For (2), I thought that, since we're in $\mathbb{R}^2$, if we have an uncountable number of segments with positive $\mathcal{H}^{1}$ measure, then $B$ would have to have positive $\mathcal{H}^{2}$ measure since $B$ contains these segments. I'm told this is not true either. Please assist.

• (2) is unclear. How is $A$ related to $\Omega$? You say it is the image of a function $f:\mathbb{R}\to\mathbb{R}$. The image is a segment in $\mathbb{R}$ which is, I guess, not what you want. Did you mean, a graph? Apr 30, 2018 at 14:00
• $A$ is a more specific set, whereas $\Omega$ is any set. Sorry, I did mean graph, not image. More specifically, $A$ is a $C^1$ closed embedded 1-d submanifold in $\mathbb{R}^2$.
– L P
May 1, 2018 at 2:14
• Please edit the question to clarify that $A$ is a $C^1$ submanifold. May 1, 2018 at 2:16
• Added. Thanks. Do you have a hint for showing (2)?
– L P
May 2, 2018 at 7:42
• I am thinking about it, but I expect that there is a counterexample, but until I have one, the question remains open. By the way: do you want $\Omega$ to be open, closed, compact, any? May 2, 2018 at 13:57

On the "differentiability implies uniqueness" issue: Yes, it is true. Indeed:

If the distance $f(y)$ from $\Omega$ to a point $y\notin \Omega$ is realized at $x\in \overline\Omega$ (a priori not unique), that is $f(y)=\|x-y\|$, then $x$ also realizes the distance from $\Omega$ to any point in the line segment $[x,y]$: for any $x'\in\overline \Omega$, $0\le t\le 1$ and $z:=y+t(x-y)$, by the triangle inequality,

$$\|z-x'\|\ge\|y-x'\|-\|y-z\|\ge f(y)-t\|x-y\|=\|z-x\|$$ so that $$f(z)=\|z-x\|=f(y)- {x-y\over\|x-y\|}\cdot(z-y).$$

If moreover the distance is differentiable at $y$, comparing the latter with $$f(z)=f(y)+\nabla f(y)\cdot (z-y) + o(\|z-y\|),\qquad (z\to y)$$ we have that the gradient at $y$ is $\nabla f(y)=-{x-y\over\|x-y\|}$. So $x$ can be recovered from the value at $y$ of the distance and of its gradient, $$x=y-f(y)\nabla f(y)$$ and it is therefore the unique point of minimum distance.

• You could explain why the gradient is equal to $\frac{x-y}{\Vert x-y\Vert}$ since for some readers it might be not obvious. I could add the explanation, but I do not want to alter your answer. Apr 30, 2018 at 15:01
• Thank you. I've added the details and fixed a typo Apr 30, 2018 at 17:14
• @Pietro Majer: Sorry for the late question, but it seems to me that you prove $\nabla f(y)=\cdots$ only after product with $z-y$, that is, in one particular direction. What am I missing?
– abx
Nov 24, 2020 at 9:23
• Just this: the differential of $f$ at $y$ is uniquely determined by the definition, i e. the first order expansion. Nov 24, 2020 at 12:04
• @Pietro Majer: What I was trying to say is that knowing the product of $\nabla f(y)$ with one vector (namely $z-y$) is not enough to determine it. You have to use that $\lVert \nabla f(y) \rVert\leq 1$ because $f$ is 1-lipschitzienne, and Cauchy-Schwarz.
– abx
Nov 25, 2020 at 20:33

For (2), I thought that, since we're in $\mathbb{R}^2$, if we have an uncountable number of segments with positive $\mathcal{H}^1$ measure, then $B$ would have to have positive $\mathcal{H}^2$ measure since B contains these segments. I'm told this is not true either. Please assist.

There are quite surprising counterexamples. Besicovitch constructed a planar set of measure zero that contains segments in every direction. Such sets are called Besicovitch or Kakeya sets.

Nikodym constructed a set $N\subset [0,1]\times [0,1]$ of measure $1$ such that for every $x\in N$ there is a line $\ell_x$ such that $\ell_x\cap N=\{ x\}$. That is this line intersects $N$ at one point only. Note that the complement of the set $N$ in $[0,1]\times [0,1]$ has measure zero so the union of segments $$[0,1]^2\cap \bigcup_{x\in N} \ell_x\setminus \{x\}$$ has measure zero.

(1) For any nonempty set $\Omega\subset\mathbb{R}^n$, the set $B$ consisting of points $y\not\in\Omega$ where there is not a unique closest point $x\in \partial\Omega$ for each $y$ has $\mathcal{H}^n$-measure $0$.

The distance function $d(x)={\rm dist}\, (x,\partial\Omega)$ is $1$-Lipschitz and hence differentiable a.e. (Rademacher theorem). As pointed by Pietro Majer in his answer, the set $B$ is contained in the set of points there $d$ is not differentiable. Hence $B$ has measure zero.

One can directly show that $B$ has no interior points.

For $p \in \mathbb{R}^n$ define $c(p):=\{q\in \overline{\Omega}: ||p-q||=dist(p,\overline{\Omega})\}$.

Then $B=\{q\in\mathbb{R}^n: \#c(p)>1\}$ has no interior point.

Proof: Assume $x$ is an interior point of $B$, then $R:=dist(x,\overline{\Omega})>0$ (otherwise $c(x)=\{x\}$). Now choose some point $p\in c(x)$ and a real $\epsilon>0$, such that the open ball $B_\epsilon(x)\subset B$.

Choose a point $y\in [xp]\cap B_\epsilon(x)$, where $[xp]$ is the straight line connecting $x$ and $p$, and define $r:=||x-y||$.

It follows that $p\in c(y)$ because $||y-p||=R-r$. Otherwise there would be a $z\in c(y)$ with $||y-z||<R-r$ which implies $||x-z||\leq ||x-y|| +||y-z||<R$, such that $z$ would be a point in $\overline{\Omega}$ that is closer to $x$ than the points in $c(x)$, which is a contradiction.

Because $\#c(y)>1$ (by definition $y\in B$), there is a point $w\in c(y)$ with $w\not= p$ such that $||y-w||=R-r$. One now sees that this point $w \in \overline{\Omega}$ is too close to $x$, because the vectors $x-y$ and $w-y$ have lengths $r$ and $R-r$ but are not collinear (because $w\not= p$), such that one has the strict triangle inequality $$||x-w|| < ||x-y|| +||y-w||=R.$$ This contradicts the assumption $dist(x,\overline{\Omega})=R$.