Suppose $U \subsetneq \mathbb{R}^d$ is open. How do I see that the distance function$$u(x) = \min\_{y \in \mathbb{R}^d \setminus U} |x - y|$$is the unique nonnegative continuous function on $\mathbb{R}^d$ that satisfies$$\begin{cases} \lim\_{r \to 0} {1\over r}((u(x) - \min\_{\partial B(x, r)} u) = 1 & \text{if }x \in U \\ u(x) = 0 & \text{if }x \in \mathbb{R}^d \setminus U?\end{cases}$$



Distance function is unique nonnegative continuous function on $\mathbb{R}^d$ satisfying following
Give yourself "an epsilon of room" and apply the continuity method.


It suffices to check it for $x\in U$.


For one direction, let $\epsilon>0$ and $y\notin U$ such that $d:=d(x,\mathbb{R}^n-U)=|y-x|$. Let


$A=\{t\in[0,1]:\forall s\in[0,t],u(x+s(y-x))\ge u(x)-(1+\epsilon)sd\}$.


Then $A$ is both open and closed in $[0,1]$, and contains 0, so $A=[0,1]$, and $u(x)\le(1+\epsilon)d$. Take $\epsilon\to0$ and you get $u(x)\le d$.


For the other direction, let $\epsilon>0$ and


$B=\{r\in[0,u(x)]:\exists z\in U$ such that $u(z)\le u(x)-r$ and $u(z)\le u(x)-(1-\epsilon)|z-x|\}$.


If $u(x)<(1-\epsilon)d$, then $B$ is both open and closed in $[0,u(x)]$ and contains 0, so $B=[0,u(x)]$, and there is $z\in U$ such that $u(z)=0$, which is a contradiction when you look at a neighborhood of $z$. Hence $u(x)\ge(1-\epsilon)d$. Take $\epsilon\to0$ and you get $u(x)\ge d$.


