Distance of a point to a set and to its boundary

general-topologymetric-spaces

Setup and Notation: Fix $p \in \mathbb{N}$ and let $(X,d)$ be a metric space such that $X$ is a closed subset of $\mathbb{R}^p$ with no isolated points and metric $d$ is the Euclidean distance. Note that $X$ is not necessarily convex set (e.g., $X = \{0,1\} \times [0,1]$). For arbitrary subset $C \subset X$, I denote by $C^c$, $\mathrm{int}(C)$, $\mathrm{cl}(C)$, and $\partial C$ the complement, interior, closure, and boundary of $C$, respectively. In addition, for arbitrary point $y \in X$, the set $B(y;r) := \{z \in X \mid d(y,z) < r\}$ is an open ball with center $y$ and radius $r$, and $d(y,C):= \inf_{z \in C} d(y,z)$ is the distance of point $y \in X$ to set $C$.

Question: Consider a arbitrary closed subset $F \subset X$ such that both $F$ and $F^c$ are not dense in $X$. For every point $x \in F^c$, do we have $$d(x,F) = d(x,\partial F)?$$ If it is not, what is a counterexample?

What I know: If $X$ is a convex subset of $\mathbb{R}^p$, I believe that the equation holds. This is because in this case $(X,d)$ is a path metric space, which implies the result (see When is distance to the boundary always less than that to the exterior?). In addition, I know that similar questions had been asked at Distance from a point to a set is attained on the boundary and Distance to the boundary. However, the proofs given there also rely on the convexity of the underlying metric space. I'm interested in whether the equation holds when $X$ is not convex.

My proof attempt: Since $d(x,F) \leq d(x,\partial F)$ is obvious by definition, it suffices to show that the other direction of inequality holds. Let $y \in X$ be a point such that $d(x,y) = d(x,F)$ and assume that $y \notin \partial F$ (i.e., $y \in \mathrm{int}(F)$). Then, there exists $\epsilon > 0$ with $B(y;\epsilon) \subset \mathrm{int}(F)$. The open ball contains points other than $y$ itself since $X$ has no isolated points. Thus, if we have
$$ B(x;d(x,y)) \cap B(y;\epsilon) \neq \emptyset,$$
there exists a point $y' \in \mathrm{int}(F)$ with $d(x,y') < d(x,y)$, which contradicts to the assumption that $d(x,y) = d(x,F)$. However, I cannot show that the two open balls intersect.

Any suggestions are welcome! Thank you in advance!

Best Answer

I came up with a counterexample. Let $X = [0,1] \times \{0,\frac{1}{2}\}$ equipped with Euclidean distance. Consider $F = \{(x_1,x_2) \in X \mid \frac{1}{2}x_1 - x_2 \geq 0\}$. By the definition of $X$, we have $F = \{(a,0) \mid a \in [0,1]\}\cup\{(1,\frac{1}{2})\}$. In addition, it holds that $\partial F = \{(1,\frac{1}{2})\}$. If we choose $x = (\frac{1}{4},\frac{1}{2})$, we obtain $d(x,\partial F) = d((\frac{1}{4},\frac{1}{2}),(1,\frac{1}{2})) = \frac{3}{4}$ and $d(x,F) = d((\frac{1}{4},\frac{1}{2}),(\frac{1}{4},0)) = \frac{1}{2}$.