The distance between two sets inside euclidean space Let $A,B \subseteq \mathbb{R}^d$ be non-empty sets. Define their distance to be
$$ d(A,B) = \inf \{ \|x-y\| : x \in A, \; \; y \in B \} $$
For any $A,B$, I want to prove that $d(A,B) = d( \overline{A}, \overline{B} )$.
My Attempt
Put $\alpha = d(A,B)$. Therefore, $\alpha = \|x_0 - y_0 \|$ for some $x_0 \in A$ and some $y_0 \in B$. But, notice $x_0 \in \overline{A}$ and $y_0 \in \overline{B}$ by definition. hence
$$ \| x_0 - y_0\| \geq \inf\{ \|x' - y'\| : x' \in \overline{A}, \; \; y' \in \overline{B} \} =  d( \overline{A}, \overline{B} )$$
$$\therefore d(A,B) \geq d( \overline{A}, \overline{B} )$$
I am stuck trying to show the other direction: $d(A,B) \leq d( \overline{A}, \overline{B} )$
Can someone help me? thanks a lot
 A: Note that the function $\Phi:\mathbb R^d\times \mathbb R^d\to\mathbb R^+$ defined by $\Phi(x,y)=\Vert x-y\Vert$ is continuous, and that $\overline A\times \overline B=\overline{A\times B}$. So, in order to prove what you want, it is enough to show that if $\Phi:X\to\mathbb R^+$ is a continuous function on a topological space $X$, then $\inf\, \Phi(M)=\inf\, \Phi (\overline M)$ for any (nonempty) set $M\subset X$. Now, you have $\Phi(M)\subset \Phi(\overline M)\subset \overline{\Phi(M)}$, the second inclusion being true because $\Phi$ is continuous. So $\inf\, \overline{\Phi(M)}\leq \inf\, \Phi(\overline M)\leq \inf\, \Phi(M)$. To conclude, it remains to observe that for any (nonempty) set $E\subset\mathbb R^+$ you have $\inf\, E\in \overline E$, so that $\inf \, E=\inf\overline E$. Aplying this with $E=\Phi(M)$, this gives $\inf\, \Phi(\overline M)=\inf \,\Phi(M)$ as required.
A: Apparently we need to show the following two inequalities:


*

*$d(A,B)\le d(\bar A,\bar B)$ and

*$d(A,B)\ge d(\bar A,\bar B)$.
The second inequality is straightforward: Clearly
$$
\big\{d(x,y): (x,y)\in A\times B\big\}\subset 
\big\{d(x,y): (x,y)\in \bar A\times \bar B\big\},
$$
and hence
$$
d(A,B)=\inf\big\{d(x,y): (x,y)\in A\times B\big\}\ge
\inf\big\{d(x,y): (x,y)\in \bar A\times \bar B\big\}=d(\bar A,\bar B).
$$
For the first inequality, assume that $\varrho=d(\bar A,\bar B)$. Then there exist
sequences $\{x_n\}\subset \bar A$ and $\{y_n\}\subset \bar B$, such that $d(x_n,y_n)=\varrho.$
But as $x_n\in\bar A$ and $y_n\in\bar B$, there exist $x_n'\in A$ and $y_n'\in B$, such that
$$
d(x_n,x_n')<\frac{1}{2n} \quad\text{and}\quad d(y_n,y_n')<\frac{1}{2n},
$$
since arbitrarily near to a point of $\bar E$ it is possible to find a point of $E$. Now
$$
d(A,B)\le d(x_n',y_n')\le d(x_n',x_n)+d(x_n,y_n)+d(y_n,y_n')<d(x_n,y_n)+\frac{1}{n},
$$
and letting $n\to\infty$, the right-hand side of the above tends to $\varrho$ and hence
$$
d(A,B)\le \varrho=d(\bar A,\bar B).
$$
This completes the proof of inequality 1.
A: Let's try a more detailed description, but similar to Hagen's answer (as it is the most straightforward approach).
$$
\mathrm{d}(\overline{A},\overline{B})=\inf\{\mathrm{d}(a,b):a\in\overline{A},b\in\overline{B}\}\tag{1}
$$
and
$$
\mathrm{d}(A,B)=\inf\{\mathrm{d}(a,b):a\in A,b\in B\}\tag{2}
$$
Since $A\subset\overline{A}$ and $B\subset\overline{B}$, $\mathrm{d}(\overline{A},\overline{B})$ is the infimum over a larger set than $\mathrm{d}(A,B)$. Therefore,
$$
\mathrm{d}(\overline{A},\overline{B})\le\mathrm{d}(A,B)\tag{3}
$$
Now, suppose that for $\epsilon\gt0$,
$$
\mathrm{d}(A,B)=\mathrm{d}(\overline{A},\overline{B})+\epsilon\tag{4}
$$
that is, the inequality in $(3)$ is strict.
Definition $(1)$ says that we can find an $\overline{a}\in\overline{A}$ and a $\overline{b}\in\overline{B}$ so that
$$
\mathrm{d}(\overline{a},\overline{b})\lt\mathrm{d}(\overline{A},\overline{B})+\frac\epsilon3\tag{5}
$$
By the definition of closure, we can find $a\in A$ so that
$$
\mathrm{d}(a,\overline{a})\lt\frac\epsilon3\tag{6}
$$
and $b\in B$ so that
$$
\mathrm{d}(b,\overline{b})\lt\frac\epsilon3\tag{7}
$$
By $(5)$, $(6)$, $(7)$, and the triangle inequality, we get
$$
\begin{align}
\mathrm{d}(a,b)
&\le\mathrm{d}(a,\overline{a})+\mathrm{d}(\overline{a},\overline{b})+\mathrm{d}(b,\overline{b})\\[3pt]
&\lt\frac\epsilon3+\mathrm{d}(\overline{A},\overline{B})+\frac\epsilon3+\frac\epsilon3\\
&=\mathrm{d}(\overline{A},\overline{B})+\epsilon\tag{8}
\end{align}
$$
But by $(2)$
$$
\begin{align}
\mathrm{d}(A,B)
&\le\mathrm{d}(a,b)\\
&\lt\mathrm{d}(\overline{A},\overline{B})+\epsilon
\end{align}\tag{9}
$$
which contradicts $(4)$. Therefore,
$$
\mathrm{d}(\overline{A},\overline{B})=\mathrm{d}(A,B)\tag{10}
$$
A: Note, why do you always have $d(A,B)\geq d(\bar{A},\bar{B})$?
if $d(\bar{A},\bar{B}) = d$ then $\exists x_1,x_2,...\in \bar{A}$ and $y_1,y_2,...\in \bar{B}$, for $\epsilon>0$, $\exists N$ such that $d(x_n,y_n)\leq d+\epsilon$ for $n>N$
now find a sequence $x_1',x_2',...\in A$ and $y_1',y_2',...\in B$ which also does the job, i.e.
for $\epsilon>0$, $\exists N$ such that $d(x_n',y_n')\leq d+\epsilon$ for $n>N$ (how? use definition of closure)
For a proper proof: Distance between two sets in a metric space is equal to the distance between their closures
A: The direction $d(A,B)\ge d(\bar A,\bar B)$ has nothing to do specifically with cloures. It follows simply from $A\subseteq \bar A$, $B\subseteq \bar B$ and that we take the infimium over a larger set of values.
Assume $\epsilon:=d(A,B)-d(\bar A,\bar B)>0$. Find points $a'\in \bar A$, $b'\in\bar B$ width $d(a',b')<d(\bar A,\bar B)+\frac\epsilon 3$ and $a\in A$, $b\in B$ with $d(a,a')<\frac\epsilon3$, $d(b,b')<\frac\epsilon3$.
