TITLE: Can distance between two closed sets be zero?
QUESTION [10 upvotes]: 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.
Thanks in advance!

REPLY [7 votes]: 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$.