# Can distance between two closed sets be zero?

Is given metric space $(M, d)$. Let $A\cap B = \emptyset; \,\,\text{dist}(A,B):=\inf\{d(x,y):x\in A, y\in B\}$. $A, B$ are both closed sets. Is it possible that $\text{dist}(A,B)=0$?

The first thought comes into mind is that obviously $\text{dist}(A,B)>0$, but possibly there are some tricky $d$ and $A, B$ so that it's untrue.

-
Yes, thank you. Already edited. –  haemhweg Dec 3 '12 at 21:35
What about A={x|x^2>2, x non negative}, B={x|x^2<2, x non negative} on $\mathbb Q$? –  Tengu Dec 3 '12 at 21:56

HINT: In $\Bbb R^2$ consider the axes and the graph of $y=\frac1x$.

It’s just a little harder in $\Bbb R$, but it can be done. Let $\langle \epsilon_n:n\in\Bbb Z^+\rangle\to 0$, where each $\epsilon_n\in(0,1)$. Let $A=\Bbb Z^+$ and $B=\{n+\epsilon_n:n\in\Bbb Z^+\}$.

-
+1 Nice examples, Brian! –  amWhy Dec 3 '12 at 21:38
@amWhy: Thanks! –  Brian M. Scott Dec 3 '12 at 21:45
The idea is that $y=\frac{1}{x}$ converges in $\Bbb R$ but diverges in $\Bbb R^2$? –  haemhweg Dec 3 '12 at 21:56
@starovoitovs: Not really, though the example does depend on the fact that $\frac1x\to 0$ as $x\to\infty$. Look at the distance in $\Bbb R^2$ between $\langle n,0\rangle$ on the $x$-axis and $\left\langle n,\frac1n\right\rangle$ on the graph of $y=\frac1x$. –  Brian M. Scott Dec 3 '12 at 22:04
@starovoitovs: You’re welcome. Yes, you can show that way that $\{b_n:n\in\Bbb Z^+\}$ is closed. Or you can use the fact that the graph of any continuous function from one metric space to another is closed in the product of the spaces. –  Brian M. Scott Dec 3 '12 at 22:58

The OP has added additional information, specifying that the closed and disjoint sets.
the answer below no longer applies.

It could be that $A$ and $B$ intersect at one point $x$, in which case $d(x, x) = 0.$

For example: suppose we have the closed intervals $A \subset \mathbb{R}, B \subset \mathbb{R}$, with: $A = [0, 1],\;\; B = [1, 2]$.

Then $x = 1 \in A, y = 1 \in B$, and $d(x, y) = 0$.

-

Ok The answer has been given. But I would like to point out that the good assumption to ensure that the distance is strictly positive is that one of the set is compact, say :

Let $(M,d)$ be a metric space $A$ a compact subset and $B$ a closed subset. If $A\cap B=\emptyset$ then $d(A,B)>0$.

Hint :Proceed by contradiction if $d(A,B)=0$ then $d(x_n,y_n)\rightarrow 0$ Assume (up to the extraction of a subsequence) that $x_n\rightarrow x$ with $x\in A$. Then show (triangular inequality) that $d(x,B)=0$. Then it is easy to show since B is closed that $x\in B$.

-