# Distance to a closed set

The distance between a point $a \in \mathbb{R}$ and a set $X \subset \mathbb{R}$ is defined as $d(a,X) := \inf\{|x-a|: x \in X\}$. How to prove if $X$ is closed, then there is a $b \in X$ such that $d(a,X) = |b-a|$?

I've constructed a decreasing sequence converging to $d$ as follows: Given $r > d(a,X)$, there is a $x \in X$ such that $|x-a| < r$. Repeating the process with $r_{n+1} := \frac{d+r_n}{2}$ we get the inequality:

$$d \leq |x_n-a| < r_n$$

It's easy to prove that $r_n \mapsto d$, and therefore $|x_n-a| \mapsto d$. If i could show the set $A := \{|x-a|: x\in X\}$ is closed, the result would be immediate. This is somehow my second question, is true that for every closed set $X$, the set $|X| := \{|x|: x\in X\}$ is closed?

Be free to contribute alternative proofs, i would appreciate.

-

Hint: Pick a $b \in X$. Then, it is enough to look only to the set $Y:= \{ x \in X | d(a, x) \leq d(a, b) \}$.

Then $Y= X \cap B_{ d(a, b)}(a)$, where the second set is the closed ball.. Now, $Y$ is closed and bounded thus compact...

Can you prove that there exists a $y \in Y$ so that $d(a,y)= d(a, Y)$? Keep in mind that now you have compactness instead of closure....

To complete the proof

Let $d =d(a, X)=d(a,Y)$. Then for each $n$ you can find some $x_n \in Y$ so that $d \leq d(a,x_n) \leq d+\frac{1}{n}$.

The sequence $x_n \subset Y$ must have a cluster point $y \in Y$, since $Y$ is compact.

Question: What is $d(a,y)$?

-
Interesting. I'll take a look in that limit point. –  juliohm Nov 18 '11 at 23:39
We can construct a decreasing chain of compact sets $Y_1 \supset Y_2 \supset \ldots$ by picking smaller closed balls, and we know the intersection is non empty. But how to get the distance $d(a,Y)$ in the proof? Thank you. –  juliohm Nov 19 '11 at 0:03
@juliohm Well, maybe the easiest way to go from here is to observe that $f(y)=d(a,y)$ is a continuous function on a compact set.... What do you know in this settings about the absolute max/min? ;) –  N. S. Nov 19 '11 at 2:06
Sorry, i don't know continuous functions yet, it's in the next chapter. I was trying to use some Borel-Lebesgue equivalences, but without success. Do you have another hint or maybe the proof itself? Thank you. –  juliohm Nov 19 '11 at 14:32
@juliohm You can construct your sequence $x_nn$ inside my $Y$, which is compact. What do you know about any sequence in a compact set? –  N. S. Nov 19 '11 at 17:28

Another way to look at this: Letting $r$ be sufficiently large, $d(a,X) = d(a, X \cap B(0,r))$, where $B(0,r)$ is the closed ball of radius $r$ centered at the origin. Use the triangle inequality to show that $|a - x|$ is a continuous function of $x$ for $x \in X \cap B(0,r)$. Since $X \cap B(0,r)$ is compact, it achieves its minimum value at some $b \in X \cap B(0,r)$, and this $b$ will minimize $|a - b|$ over all $b \in X$ as well since $d(a,X) = d(a, X \cap B(0,r))$.

Yet another way: Let $E_n = \{x \in X: |x - a| \leq d(a,X) + {1 \over n}\}$. The $E_n$'s are nested compact sets and thus have nonempty intersection i.e. you can choose $b \in \cap_n E_n$. Then since $d(a,X) \leq |a - b| \leq d(a,X) + {1 \over n}$ for all $n$, you must have $|a - b| = d(a,X)$.

-
"Sorry, i don't know continuous functions yet, it's in the next chapter. I was trying to use some Borel-Lebesgue equivalences, but without success. Do you have another hint or maybe the proof itself? Thank you. – juliohm " ;) –  N. S. Nov 19 '11 at 20:36
I added another way using compactness properties, if that helps. –  Zarrax Nov 19 '11 at 21:09
@Zarrax: Thank you for your second proof, it's exactly what i was trying to achieve. –  juliohm Nov 20 '11 at 13:47