Real Analysis – Distance Between Sets in a Metric Space

metric-spacesreal-analysis

I was given this innocent looking homework question.

Given two nonempty sets $A,B \subseteq X$ where $(X,d)$ is a metric space.

  1. Show that $\mathrm{dist}(A,B) = \inf \{d(x,y) \mid x \in A, y \in B \}$ is well-defined.
  2. Suppose $A \cap B = \emptyset$. Suppose $A$ is closed and $B$ is compact. Show that $\mathrm{dist}(A, B) > 0$.

Aren't both (1) and (2) properties of the fact that $S = \{ d(x,y) \mid x \in A, y \in B \}$ is a subset of $P = \{ x \mid x \ge 0 \}$, which is bounded?

for (1): $S \subseteq P$ and $P$ bounded implies $S$ is bounded. Hence $\mathrm{inf} S$ exists. Since $\mathrm{inf} S$ is unique, we conclude that $\mathrm{dist}(A, B)$ is well defined.

for (2): Since $\mathrm{inf} P \ge 0$ and $S \subseteq P$, $\mathrm{dist}(A, B) \ge 0$. Since $A \cap B = \emptyset$, $x \ne y$ $\forall x \in A, y \in B$. Then $d(x,y) \ne 0$. Hence $\mathrm{dist}(A,B) > 0$.

Am I missing something very very obvious? Where does compactness come into play?

Best Answer

For 1, $S$ might be unbounded, contrary to your statement. But you have exactly the right idea: it is bounded below by 0, and that is all you need.

$\def\dist{\operatorname{dist}}$But for 2 your idea is no good. Let $A = (-1,0)$ and $B = (0, 1)$. Then $A\cap B = \phi$, and yet $\dist(A, B) = 0$. There are no two points $a\in A, b\in B$ with distance zero, as you said, but there are points $a,b$ at arbitrarily small distance, and that is all we need for the infimum of $S$ to be zero. So if we want to prove that $\dist(A,B)>0$, it is not enough to know that $A$ and $B$ are disjoint; we need some additional information about $A$ and $B$. That is where the compactness comes in.

In fact it's not even enough for the two sets to be closed; the usual example is that the hyperbola $H = \{ \langle x,y\rangle \mid xy = 1 \}$ is closed and the $x$-axis $L = \{ \langle x,y\rangle \mid y = 0 \}$ is closed, but $\dist(H, L) = 0$ because for any positive $s$ we can choose $0<t<s$ and then $h = \left\langle \frac1t, t\right\rangle, \ell = \left\langle \frac1t, 0\right\rangle$ are closer than $s$.

Related Question