Question: Let $(X, d)$ be a metric space. Let $A$ and $B$ be disjoint subsets of $X$ that are closed in the topology induced by $d$. Prove that there exist disjoint open sets $U$ and $V$ such that $A\subset U$ and $B\subset V$.

Is this proof correct? : By assumption, $A\cap B=\emptyset$, so there is no pair like $(x_A,x_B)$ (i.e., $x_A\in A$ and $x_B\in B$), such that $x_A=x_B$. Because every metric space is Hausdorff, so for every pair $(x_A,x_B)$ there are two disjoint open sets $U_A\ni x_A$ and $V_B\ni x_B$; and thus union of all $U_A$s (which is an open set containing A) are disjoint from union of all $V_B$s (which is an open set containing A).

Thanks a lot for any help.

PS In special case of standard metric topology on $\mathbb{R}$, if $[a,b]$ and $[c,d]$ are disjoint (say $c>b$), intuitively it is apparent that there is a 'space' between $c$ and $b$ so we can have two disjoint open sets, each of them containing $[a,b]$ or $[c,d]$.

  • 1
    $\begingroup$ I believe a good way to start this is to show that if $A$ consists of just one point $x$, and if $B$ is some closed set not containing $x$, then show the existence of open and disjoint $U$ and $V$, such that $x$ is an element of $U$, and $B$ is contained in $V$. $\endgroup$
    – Mankind
    Commented Feb 4, 2015 at 9:09
  • $\begingroup$ Then for general $A$ and $B$, you know that each point $x\in A$ together with $B$ has two open and disjoint sets $U_x$ and $V_x$, such that $x\in U_x$ and $B\subseteq V_x$. $\endgroup$
    – Mankind
    Commented Feb 4, 2015 at 9:13

1 Answer 1


In fact, you don't quite have to assume that $A$ and $B$ are disjoint closed sets, or even that they have disjoint closures; it's enough to assume that they are separated sets, i.e., each is disjoint from the closure of the other, a condition which is plainly necessary as well as sufficient.

Theorem. Let $A$ and $B$ be subsets of a metric space $(X,d)$. If $A\cap\overline B=\emptyset$ and $B\cap\overline A=\emptyset$, then there are disjoint open sets $U$ and $V$ such that $A\subseteq U$ and $B\subseteq V$.

Proof. If one of the sets is empty, it's easy; e.g., if $A=\emptyset$, we can take $U=\emptyset$ and $V=X$. So we may assume that $A$ and $B$ are nonempty sets. In that case the functions $$x\mapsto d(x,A)=\inf\{d(x,a):a\in A\}$$ and $$x\mapsto d(x,B)=\inf\{d(x,b):b\in B\}$$ are well-defined and continuous. It follows that the sets $$U=\{x:d(x,A)\lt d(x,B)\}$$ and $$V=\{x:d(x,B)\lt d(x,A)\}$$ are open sets, and of course they are disjoint. Finally, we have $A\subseteq U$ because $d(x,A)=0\lt d(x,B)$ for all $x\in A$, and $B\subseteq V$ because $d(x,B)=0\lt d(x,A)$ for all $x\in B$.

  • $\begingroup$ @bof: Thank you for your answer, but I don't understand anything ! I entirely edit my question; I highly appreciate it if you please let me know if my proof is correct. $\endgroup$
    – user210902
    Commented Feb 4, 2015 at 12:33
  • $\begingroup$ @LND Your proof is incorrect. Your sets called (in confusing notation) $U_A,V_B$ apparently depend only on the two points $x_A,x_B$. For instance, if $X=\mathbb R$, and if $x_A=5$ and $x_B=8$, you might choose $U_A=(4.9,5.1)$ and $V_B=(7.9,8.1)$. But what if I told you that $A=[4,5.02]$ and $B=[5.05,9]$? Now you've got $U_A\cap B\ne\emptyset$; that's not going to work, is it? $\endgroup$
    – bof
    Commented Feb 5, 2015 at 5:33

You must log in to answer this question.