110

Claim: Let $X$ be a metric space. If $A,B\subset X$ are disjoint, $A$ is compact, and $B$ is closed, then there is $\delta>0$ so that $ |\alpha-\beta|\geq\delta\;\;\;\forall\alpha\in A,\beta\in B$.

Proof. Assume the contrary. Let $\alpha_n\in A,\beta_n\in B$ be chosen such that $|\alpha_n-\beta_n|\rightarrow0$ as $n\rightarrow \infty$.

Since $A$ is compact, there exists a convergent subsequence of $\alpha_n\;(n\in\mathbb{N})$, $\alpha_{n_m}\;(m\in\mathbb{N})$, which converges to $\alpha\in A$.

We have

$$|\alpha-\beta_{n_m}|\leq|\alpha-\alpha_{n_m}|+|\alpha_{n_m}-\beta_{n_m}|\rightarrow0 \;\;\;as\;\;m\rightarrow\infty.$$ Hence $\alpha$ is a limit point of $B$ and since $B$ is closed $\alpha\in B$, contradiction.

Is my proof correct? I feel as though I am missing something simple which would trivialize the proof.

FD_bfa
  • 3,989
Benji
  • 5,880
  • 17
    I think your proof is correct. – Joel Cohen Jun 30 '11 at 17:16
  • 1
    Looks right to me... – Arturo Magidin Jun 30 '11 at 17:23
  • 1
    It might make you more sure of the proof's leavel of detail to consider how it fails if we assume A closed but not compact, e.g. in the plane. – hardmath Jun 30 '11 at 17:27
  • The proof is okay. A partial converse you might like is the following: If $A$ and $B$ are two arbitrary sets in a metric space with positive distance between them, then their closures are disjoint. – Mark Jun 30 '11 at 17:37
  • @hardmath What if $A$ is finite and $B$ isn't? Does that change the proof at all? – M T Jan 22 '15 at 15:51
  • By "finite" do you mean $A$ is bounded, or that $A$ consists of a finite number of points? – hardmath Jan 22 '15 at 15:55
  • $A$ consists of a finite number of points (which implies that it's bounded). I think $A$ can still be compact that way but I'm not sure. It's easy to show this if both $A$ and $B$ have a finite number of points, and the proof in the question shows if they're both infinite, but I'm not sure about the third (mixed) case. – M T Jan 22 '15 at 15:58
  • Yes, a finite set is always compact (just pick one open set to cover each point, and you'll always get a finite subcover). The case where $A$ is finite and $B$ is closed is very easy. If they are disjoint, each point in $A$ has a positive distance to $B$ and you can use the minimum of those (finitely many) positive distances to separate $A$ from $B$. – hardmath Jan 22 '15 at 16:04
  • @hardmath That's what I did in the case where both $A$ and $B$ are finite, but if $A$ is finite and $B$ is infinite, can you still take the minimum of those distances? I didn't think you could take the minimum of an infinite set (and the set of distances between A and B would be infinite). – M T Jan 22 '15 at 16:09
  • If it's unclear, you might want to post a new question, although it fits the conditions here ($A$ compact and $B$ closed). What you might be overlooking is that you only need to take the minimum over the finite set $A$ (of distances from $x\in A$ to closed set $B$ in the metric space). – hardmath Jan 22 '15 at 16:11

2 Answers2

33

For the sake of having an answer addressing your question:

Yes, your proof is perfectly okay and I don't think you can get it any cheaper than you did it.


Let me expand a little on what you can do with these arguments (also providing details to gary's answer). I'm not saying my proof at the end is better than yours in any way, I'm just showing a slightly alternative way of looking at it.

Define the distance between two non-empty subsets $A,B \subset X$ to be $d(A,B) = \inf_{a \in A, b \in B} d(a,b)$ and write $d(x,B)$ if $A = \{x\}$.

  1. If $B \subset X$ is arbitrary and non-empty then $x \mapsto d(x,B)$ is $1$-Lipschitz continuous, that is $|d(x,B) - d(y,B)|\leq d(x,y)$ for all $x,y \in X$.
  2. We have $d(x,B) = 0$ if and only if $x \in \overline{B}$.
  3. If $d(\cdot,A) = d(\cdot,B)$ then $\overline{A} = \overline{B}$.
  1. Choose $b\in B$ such that $d(x,b) \leq d(x,B) + \varepsilon$. Then the triangle inequality yields $d(y,B) - d(x,B) \leq d(y,b) - d(x,b) + \varepsilon \leq d(y,x) + \varepsilon$. By symmetry we get $|d(x,B) - d(y,B)| \leq d(x,y) + \varepsilon$, and 1. follows because $\varepsilon$ was arbitrary. Update: In this closely related answer I show that $1$ is in fact the best Lipschitz constant as soon as $B$ isn't dense. Don't miss Didier's answer to the same thread which relies on a useful general fact which is as easy to prove and Zarrax's answer providing a cleaned-up argument of the one I'm giving here.

  2. Choose $b_n \in B$ with $d(x,b_n) \leq d(x,B) + \frac{1}{n} = \frac{1}{n}$. Then $d(x,b_n) \to 0$ and hence $x \in \overline{B}$. Conversely, if $b_n \to x$ then $d(x,b_n) \to 0$ hence $d(x,B) = 0$.

  3. Immediate from 2.


Let me combine these facts: assume $A$ is compact and $B$ is closed. As $d(\cdot, B): X \to [0,\infty)$ is continuous by 1. above, we conclude from compactness of $A$ that $d(\cdot,B)$ assumes its minimum when restricted to $A$ (if you think about how one usually proves this, you'll find your argument again!). Hence there is $a \in A$ with the property that $d(a',B) \geq d(a,B)$ for all $a' \in A$. But if $d(a,B) = 0$ then $a \in B$ by 2. above, since $B = \overline{B}$. So either $A$ and $B$ are not disjoint or $d(a',B) \geq d(a,B) \gt 0$. By choosing $\delta \in (0,d(a,B))$, we get the claim again.


Finally, if you don't assume that one among $A$ and $B$ is compact, then the result is false. There was the example $A = \mathbb{N}$ and $B = \{n + \frac{1}{n}\}_{n\in\mathbb{N}}$ given in the comments, or, a bit more geometrically appealing to me, let $A$ be the $x$-axis in $\mathbb{R}^2$ and $B$ the graph of the function $x \mapsto \frac{1}{x}$, $x \neq 0$.

Troy Woo
  • 3,579
t.b.
  • 78,116
2

EDIT: New and (hopefully)Improved!: As stated above, and as pointed out by Theo, a having both $A,B$ be closed but neither of them compact is not enough, a counterexample being that of S={(x,0)} and $S'=\{(x,1/x)\}$ in $\mathbb{R}^n$, as well as other counters given in the above comments. And the above assumption of $A,B$ both closed doesn't either allows us to conclude from $d(A,B)=0$, that there is an $a$ in $A$ with $d(a,B)=0$; for this last, we need to use the full hypothesis, i.e., we need $A$ to be compact. After showing that $A,B$ as given and $d(A,B)=0$ implies the existence of $a$ with $d(a,B)=0$, we use the fact that points at distance $0$ from a subset $S$ of a metric space are precisely the points in the closure of $S$, to lead to the contradiction that $A,B$ are not disjoint if we assume $d(A,B)=0$.

So we prove that $d(A,B)\neq0$ for $A$ compact, $B$ closed and $A,B$ disjoint. Without compactness, the best we can conclude from $d(A,B)=0$, is that there are sequences $\{a_n\}$ in A and $\{b_n\}$ in B, with $d(a_n,b_n) \lt 1/n$. But now we use compactness+ metric, to use that there is a convergent subsequence $\{a_{n_k}\}$ of $a_n$; say the limit is a. Then, given any positive integer n, we can select an index j in $\{a_{n_k}\}$ with $d(a_{n_k},b_{n_m})\lt 1/2n $ for $m\gt j$, and, by convergence of ${a_{n_k}}$ to a, it follows that $d(b_{n_k},a)$, and so (triangle ineq) a is in B, (since B is assumed closed, and a closed subset of a metric space contains all points at distance 0 from B; specifically, in a metric space, the closure of a subset contains all points at distance 0 from that subset), contradicting the assumption that A,B are disjoint.

Note that the choice of $S:=\{(x,0)\}$ and $S':=\{(x,1/x) : x \in \mathbb{R}\}$ is not a counterexample, since the sequence $\{1/x\}$ does not have a convergent subsequence. Then S is not compact.

gary
  • 4,027
  • 1
    That did not come out right: If d(A,B)=0, then there exists sequences ${a_n}$ in A and ${b_n}$ in B, with $d(a_n,b_n)$<1/n. By compactness of A, there is a subsequence $a_{n_k}\rightarrow->a$, with a in A , as compact (sub) spaces are complete metric spaces. Then there are $a_{n_j}$ and $a_{n_k}$ with $d(a,a_{n_j})< 1/2n_j$ and $d(a_{n_j},b_{n_j})$<1/2n_j, from which $d(a,b_{n_j})<1/n_j$ for indices >j , from which it follows that d(a,B)=0. – gary Jul 03 '11 at 00:24
  • @gary: your accounts have been merged. Please register to avoid login problems in the future. – Qiaochu Yuan Jul 03 '11 at 02:34
  • 1
    @Theo: I will consolidate soon, please give me a bit of time. – gary Jul 03 '11 at 06:39
  • 1
    @Qiaochu: problem is that I lost my login; the computer I usually use automatically seems to recognize me, even without my logging-in, but I don't know what my password is; is the alphanumeric code in "open ID" enough to log in? – gary Jul 03 '11 at 06:41
  • @gary: you haven't lost anything. Your accounts have been merged, so the account you're using now is the same as your other one. – Qiaochu Yuan Jul 03 '11 at 06:49
  • 1
    @Qiaochu: Please forgive my ignorance, but this computer automatically logs me in, but, if I were to use another computer, what would I do to log in? – gary Jul 03 '11 at 07:06
  • @gary: oh, I see; my mistake. I don't think I can recover OpenID passwords, but you can try making a new OpenID and associating it to your account, and then I can swap the new one with the old one. – Qiaochu Yuan Jul 03 '11 at 07:17
  • 1
    @Theo: I did my editing. Hope this one is better; sorry for the mess. – gary Jul 05 '11 at 17:24
  • @gary: Okay, I did my usual TeX-fix thing. Here are a few comments. The first sentence in the second paragraph should probably read "$d(A,B) \neq 0$" (use \neq for $\neq$). Then you can drop the part which follows "This forces...", as you just argued $d(a,b_{n_k}) \to 0$, so $a \in \overline{B} = B$; contradiction. I'd add "so $S$ is not compact" at the end of the last paragraph. – t.b. Jul 05 '11 at 17:38
  • 1
    @Theo: Done. Thanks again. – gary Jul 05 '11 at 18:57
  • @gary: please read your second paragraph again. Then read again what I'm saying in my comment (ignore typos). You could also think about deleting your other answer. – t.b. Jul 05 '11 at 19:10
  • 1
    @Theo: I hope this one nails it. Maybe I can compensate you for the hairs you must have pulled-out from my post and my (quasi- and superconfused)registration :). – gary Jul 07 '11 at 06:49
  • 1
    @Theo if this last editing does not work, I will just vote to delete my post; it may not be fair to take so much of your time for this. – gary Jul 07 '11 at 06:56
  • I still don't quite understand why you choose to make the detour to say $d(a,B) = 0$. You already have that $d(a_{n_j}, b_{n_{k}}) \to 0$ and $a_{n_j} \to a$, so $d(a,b_{n_k}) \to 0$, hence $a \in B$. – t.b. Jul 07 '11 at 07:51
  • If A and B are compact –  Dec 27 '21 at 15:38