# Distance to the boundary equals supremum of the radius of open balls

I'm trying to prove what seems an elementary general topology exercise (I'm trying to prove it in order to use it in a basic complex analysis course) It's the following property:

Let $$(X,d)$$ be a metric space, let $$G\subset X$$ be an open but not closed subset of $$X$$ and $$x\in G$$. Denoting, for each $$r>0$$, the open ball $$B(x,r):=\{y\in X\mid d(x,y)<δ\}$$, we define

$$R=\sup\{r>0\mid B(x,r)\subset G\}\\ D= \operatorname{dist}(\{x\},\partial G) \quad \text{(Since G is not clopen, it's \partial G \ne \varnothing})\\ (\text{where for each }A, B\subset X \text{ we define } \operatorname{dist}(A,B):=\inf\{d(a,b)\mid a\in A, b \in B\}).$$

Then, $$R=D$$.

So far I've managed to prove that $$R\leq D$$:

Suppose $$D. Then it exists some $$δ>0$$ s.t. $$D<δ and therefore $$B(x,δ)\subset G$$. It's not difficult to see that, since $$D<δ$$, it's going to be $$B(x,δ)\cap \partial G\ne\varnothing$$. But this contradicts the fact that $$G\cap\partial G = \varnothing$$ for every open but no clopen set $$G$$. Therefore, $$R\le D$$.

But I'm having trouble trying to prove that $$D\leq R$$. I think the proof would have to do with examining what happens at the boundary of $$\overline{B}(x,R)$$, but I'm not sure even if the whole statement is false, since I'm starting to suspect that maybe we need more hypothesis in order to make it true (the statement feels very intuitive in $$\mathbb{R}^2$$, for example).

Any thoughts on the problem?

Edit: Since I've received an answer which provides a counterexample for the $$D\le R$$ part (the one by Snake707), the statement has been proven false and therefore the only thing we can assure in metric spaces is that $$R\le D$$. I guess the question now is: When is also $$D \le R$$ true and therefore $$D=R$$? Are there some sufficient or necessary conditions over the particular space which is $$X$$ in order to make the statement true? (maybe asking for connectivity or requiring that $$X$$ is Banach or some type of space where all balls are connected, since as I said in $$\mathbb{R}^2$$ is intuitive that is going to be true. I don't know now).

As soon as I end my exam period, I'll come back to this problem again to try if I can decide something over it. In the meantime, let's see if there's somebody who can give a satisfactory answer before that.

• From your definition I would deduce that $D=d(\{x\}, \partial G) =d(G, \partial G) =0$ sice I can pick points arbitrarily close together from the two sets. In your definition of $d(A, B)$ are you sure you want to minimise over both a and b, or should you be minimising over b and maximising over a? – Eddy Jan 8 at 20:52
• Oh, or maybe your considering R and D as functions of x? – Eddy Jan 8 at 21:02
• Define D(x,$\delta$). – William Elliot Jan 8 at 22:01
• Is it as straightforward as: Suppose $R < D$. Then there exists a point $b \in \partial G$ s.t. $b \in B(x,r)$ for some $r$. However, $B(x,r) \subset G$ meaning $G$ is not disjoint from its boundary $\rightarrow$ contradiction. ? – T. Fo Jan 8 at 22:08
• @Eddy $R$ and $D$ clearly depend on $x$, sure. But $x$ is fixed in the statement (even though at the end you can generalize, since $x$ is arbitrary, for any $x \in X$ you want). It's just written like that for clarity. – Elías Guisado Jan 9 at 16:09

Edited. I believe you need slightly more assumptions for your assertion. Consider a the space $$]-3, -1[ \cup ]1, 3[ = X$$ equipped with the metric from $$\mathbb{R}$$. Let $$x=-2$$ and $$G = ]-3, -1[ \cup ]2, 3[$$. Then $$\partial G = \{2\}$$.
Your value $$D$$ is $$4$$. Your value $$R$$ is $$3$$ thus $$R < D$$.
• Connectivity on $X$ is not sufficient, since in my example you could use $X = \mathbb{R}$. I think one should look at $X$ being a complete, normed vector space and $G$ being an open, bounded, (path-)connected subset. As William Elliot mentioned, my original proof required all balls to be connected. However, I do not believe that my attempt actually really got to the heart of the problem and requiring connectedness of all balls may be needlessly strong. – Snake707 Jan 9 at 18:11