Distance from Subset of Real Numbers

Theorem
Let $S$ be a subset of the set of real numbers $\R$.

Let $x \in \R$ be a real number.

Let $\map d {x, S}$ be the distance between $x$ and $S$.

Then:

Distance from Subset of Real Numbers to Infimum

 * $(4): \quad$ If $I$ is a closed real interval, then $\map d {x, I} = 0 \implies x \in I$
 * $(5): \quad$ If $I$ is an open real interval apart from $\O$ or $\R$, then $\exists x \notin I: \map d {x, I} = 0$.

Proof
From the definition of distance:
 * $\forall x, y \in \R: \map d {x, y} = \size {x - y}$

Thus:
 * $\displaystyle \map d {x, S} = \map {\inf_{y \mathop \in S} } {\size {x - y} }$

If $I$ is a closed real interval, then $\map d {x, I} = 0 \implies x \in I$:

Since $I$ is an interval, if $x \notin I$ then $x$ is either an upper bound or a lower bound for $I$.

Suppose $x$ is an upper bound for $I$.

Let $B$ be the supremum of $I$.

Then because $I$ is closed, $B \in I$.

So:

Now from Infimum Plus Constant:
 * $\inf_{y \mathop \in S} \size {x - y} = x - B + \inf_{y \mathop \in S} \size {B - y}$

But we also have:
 * $x - B \ge 0$
 * $\map d {B, S} \ge 0$
 * $\map d {x, S} = 0$

So it follows that $x = B$ and so $x \in I$.

A similar argument applies if $x$ is a lower bound for $I$.

If $I$ is an open real interval apart from $\O$ or $\R$, then $\exists x \notin I: \map d {x, I} = 0$:

As $I \ne \O$ and $I \ne \R$ it follows that one of the following applies:


 * $\exists a, b \in \R: I = \openint a b$
 * $\exists a \in \R: I = \openint a \to$
 * $\exists b \in \R: I = \openint \gets b$

It follows by the definition of open real interval that $I$ has either an infimum $a$, or a supremum $b$, or both. Thus the required value of $x$, from what has been proved above, is either $a$ or $b$.