# Proof about set theory and distance function. Compact set and closed set.

$$A$$ : closed set in $$\mathbb{R}^n$$

$$B$$ : compact set in $$\mathbb{R}^n$$

$$A \cap B=\phi.$$

$$d$$ : distance function

Then, prove that $$$$\text{For all } x \in B, \text{ there exists } a_x \in A \text{ such that } d(x, A)=d(x, a_x).$$$$

$$\bigg(d(x,A)=\inf\{d(x,y) | y \in A\} \bigg)$$

I think that I should use the continuity of distance function.

For all $$x\in B$$, define $$f(x):=d(x,A) \ (x\in B).$$

Because $$B$$ is compact and $$f$$ is continuous, $$f(B)$$ is also compact. Thus there exists maximum value and minimum value of $$f(B)$$.

But this idea didn't work.

I would like you to give me some ideas.

• It doesn't matter that $B$ is compact since the statement to prove concerns only one (arbitrary) element of $B$. Think of $x$ as fixed and $d(x,y)$ as a function $f(y)$ defined on $A$. – Karl Apr 20 at 5:23
• – Martin Sleziak Apr 21 at 8:06

Compactness of $$B$$ is not needed!
$$d(x,A)$$ can be written as $$\lim d(x,a_n)$$ for some squence $$(a_n) \subset A$$. Now boundedness of $$d(x,a_n)$$ implies boundedness of $$(a_n)$$. Hence there is a subsequence converging to some $$a_x$$. Since $$A$$ is closed we see that $$a_x \in A$$. Can you see that $$d(x,A)=d(x,a_x)$$?