Can distance between two closed sets be zero? [duplicate]

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^+\}$.


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$.


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$.