Proving that $D(A,B) =\inf\{d(a, b) : a \in A \text{ and } b\in B\}$ is not a metric on all subsets of a given metric space We define $D(A,B) =\inf\{d(a, b) : a \in A \text{ and } b\in B\}$. I know $D$ is not metric. Take $A=\{1\}$ and $B=(0, 1)$ then $D(A, B) = 0 $ as $1$ is in closure of $B$ but $A\neq B$.
But I take particular example $A=\{\frac{1}{2n} + n : n \in \mathbb{N}\}$ and $B=\mathbb{N}$ then my intuition says $D(A, B) =0$ but I am unable to prove this. Can anyone prove this analytically?  
Thanks 
 A: Let $\epsilon > 0$. Then there exists a sufficiently large natural number $N$ in which $\epsilon > \frac{1}{2n}$ for every $n \geq N$. So, pick any $n \geq N$ and it follows that $n + \frac{1}{2n} \in A$, $n \in B$ and $$|n+ \frac{1}{2n} - n| = \frac{1}{2n} < \epsilon.$$ Since $\epsilon$ was an arbitrary positive real number, it follows that $D(A, B) = 0.$
A: For any $\frac 1{2n} + n \in A$ we will have $n \in B$ and $d(\frac 1{2n}+n, n)=\frac 1{2n}$.  So $\{\frac 1{2n}|n\in \mathbb Z\} \subset \{d(a,b)|a\in A, b\in B\}$ and... remember.  If $K \subset M$ then $\inf M \le \inf K$ (remember why?).
So $0\le D(A,B) =\inf \{d(a,b)|a\in A, b\in B\}\le \inf \{\frac 1{2n}|n\in \mathbb Z\}= 0$.
That wasn't the most efficient way or direct way, but it was the must intuitive and easiest (IMO).
Doing it directly is pretty easy too.
1) $0$ is a lower bound of $\{d(a,b)|a \in A, b\in B\}$
Pf: If $\frac 1{2n} + n \in A$ and $m\in B$ then $d(a,b) = |\frac 1{2n} + (m-n)|$.  As $0< \frac 1{2n} < 1$ we know $\frac 1{2n} \not \in \mathbb Z$  and $m-n \in \mathbb Z$ so $d(a,b) =|\frac 1{2n} - (m-n)| \not \in \mathbb Z$ so $d(a,b) \ne 0$ so $d(a,b) > 0$.
2) If $k > 0$ then $k$ is not a lower bound.
Pf: There exists an $n \in \mathbb  N$ so that $n > \frac 1{2k}$ so $\frac 1{2n} < k$ and $\frac 1{2n} + n \in A$ and $n \in B$ so $\frac 1{2n} = d(\frac 1{2n},n)\in \{d(a,b)|a\in A, b\in B\}$
And thus $\inf \{d(a,b)|a\in A, b\in B\} = 0$.
A: Let's do a proof by contradiction. Here's $A$ and $B$, as you defined them (50) and (51).
$$ A = \left\{ n + \frac{1}{2n} \mathop{:} n \in \mathbb{Z}_{> 0} \right\} \tag{50} $$
$$ B = \mathbb{Z}_{> 0} \tag{51} $$
Suppose $D(A, B) = c $ where $c > 0$ . $c$ is an arbitrary constant. The only thing we know about it is that it's a positive real number.
Let's introduce a new constant $c'$ so we know $c'$ is strictly closer to $0$ than it is to $1$ (101 and 102). The choices of $10$ and $4$ are somewhat arbitrary, but I think it makes the proof easier to visualize.
$$ c' = \min\left(\frac{1}{10},\; c\right) \tag{101} $$
$$ m = 4 \times \left\lceil{\frac{1}{c'}}\right\rceil \tag{102} $$
Note that $m$ is an integer by inspection and at least $10$, therefore it is a positive integer and hence (103).
$$ m + \frac{1}{2m} \in A \tag{103} $$
The distance between $m$, which is in $B$ and $m + \frac{1}{2m}$, which is in $A$, is $\frac{1}{2m}$.
$\frac{1}{2m} < c' \le c \tag{104}$
However, by hypothesis $c = D(A,B)$, which is defined to be the infimum of the distances between each item in $A$ and each item in $B$ .
Contradiction.
Therefore $D(A, B) \le 0$ . However, $D$ is the infimum of a set of non-negative reals, therefore $D(A, B) \ge 0$.
Thus, (105) as desired.
$$ D(A, B) = 0 \tag{105} $$
