Let $(X,d)$ be a metric space give an example of two closed (nonempty) sets $A$ and $B$ with $A \cap B=\emptyset$ and such that $d(A,B)=0$

Let $(X,d)$ be a metric space. Define the distance between two nonempty subsets $A$ and $B$ of $X$ by $$d(A,B)=\inf\{d(x,y):x\in A\quad and \quad y\in B\}$$ (a) Give an example of two closed sets $A$ and $B$ with $A \cap B=\emptyset$ and such that $d(A,B)=0.$

(b) If $A \cap B = \emptyset,A$ is clossed and $B$ is closed and bounded (both nonempty) then show that $d(A,B)>0.$

So for the first part I thought if I chose the metric space $\mathbb{R}$ and let $A=\{0\}$ and $B=\{y\in \mathbb{R}:1\le y\le10\}$

These are two subsets of $\mathbb{R}$ and the are closed and their intersection is empty.And if I understand the distance formula correctly it is the glb of any interval $d(x,y)$ and in my case any interval $d(0,y)$

But then if this is true I do not really understand what I am supposed to be accomplishing in part (b)

I would appreciate a nudge in the right direction, and confirmation at my attempt of part (a)

• For (a), you could choose, in $\mathbb{R}^2$, $A:=\mathbb{R}\times\{0\}$ and $B$ to be the graph of $x\mapsto e^x$. – Guest Dec 2 '16 at 3:44
• Your attempt for (a) is incorrect. You get $d(A,B)=d(0,1)=1$. – Guest Dec 2 '16 at 3:46
• @B ry You should think of $d(A,B)$ as the distance between the nearest points of $A$ and $B$. But since these could be infinite sets, there may not be a single pair of points that achieves a minimum, so it's defined as an infimum instead. In your example it's obvious from graphing the two sets that the distance is $1$, not $0$. – Erick Wong Dec 2 '16 at 3:49
• @Eric Wong See i wasn't sure if I could assume the distance d(x,y) was the actual distance between the points of A and the points of B i thought it was just creating and interval of numbers that we then determine its greatest lower bound. That why i chose the singleton {0} cause any set would have the GLB of 0. Which is essentially what the inf would be on these bounded subsets. – B ry Dec 2 '16 at 3:53
• @B ry The distance from $0$ to any point in $B$ is always $\ge 1$. Sure, $0$ is a lower bound for the distance but $1$ is a greater lower bound. – Erick Wong Dec 2 '16 at 3:57

The graph of $1/x$ and the $x$-axis are both closed subsets of $\mathbb R^2$, and they are disjoint, but their distance is still $0$: no matter how tiny $\epsilon >0$ is you can still find two points, one from each set, that are closer than $\epsilon$.
Take $X=R$, $A=N-\{0\}$, $B=\{n+1/n, n>0, n\in N\}$
• @B ry This example is a discrete set, hence closed. Every pair of points is at least $1/2$ apart. – Erick Wong Dec 2 '16 at 3:58
• because as $n\to \infty$ wouldn't the endpoints be $[2,\infty)$ and therefore not contain its limit points or at each value of n could we close it with brackets and thus conclude that it contains its endpoints? – B ry Dec 2 '16 at 3:59
• @B ry There are no endpoints in $B$. It is a collection of isolated points. Please read the notation carefully. – Erick Wong Dec 2 '16 at 4:54