TITLE: Disjoint open sets in a metric subspace corresponds to disjoint open sets in the original metric space.
QUESTION [5 upvotes]: This is the claim to prove:
If the open sets $G_Y'$ and $G_Y''$ in $Y$ do not intersect, then the corresponding open sets $G_X'$ and $G_X''$ in $X$ can be choosen so that they also have no points in common.
The existence of two open sets $ G_X '$ and $ G_X' '$ containing $ G_Y' $ and $ G_Y '' $ respectively is trivial to prove: $ G_Y' $ open in $ (Y, d ') \Rightarrow $ for every point $ y' \in G_Y' $ there is a ball $ B_Y (y', r') \subset G_Y' \Rightarrow $ the set of the corresponding balls $ B_X (y', r') $ in $ (X, d) $ is a set that contains $ G_Y' $ and which is open since union of open.
Then, as regards the actual statement, I did so: given $ G_Y '$ and $ G_Y''$, we build the set $ G_X' $ as described above, with the foresight to choose each ball $ B_Y (y', r') $ so that it never contains points of $ G_Y '' $ (which is always possible since $ G_Y '$ open and $ G_Y' \cap G_Y '' = \emptyset $). Having done this, we continue with the construction of the set $ G_X '' $: for each point $ y '' \in G_Y '' $ we consider a ball $ B_Y (y '', r '') $ of sufficiently small radius so such that the corresponding ball in $ X $ does not contain points of $ G_X '$ (which is always possible, because otherwise it would be that every neighborhood of $ y' '$ in $ X $ would contain points of $ G_X' \Rightarrow $ there will be a ball $ B_X (y '', \widetilde{r} '') $ which will only contain points of $ G_X '\setminus G_Y' $ because otherwise every neighborhood of $ y '' $ in $ X $ would always contain points of $ G_Y '$ and therefore $ y' '$ would be a limit point for $ G_Y' $, which is absurd by hypothesis; removing the points $ \{x' \in G_X '| d (x', y' ') \leq \widetilde{r} '' /2 \} = \widetilde{B}_X (y '', \widetilde{r} '' / 2) \cap G_X '$ from $ G_X' $ you get a new $ \widetilde{G}_X '$ open which still contains $ G_Y' $). Therefore, by construction $ G_X '\cap G_X' '= \emptyset $.
I'm pretty sure it could have been done more elegantly. Is it true?

REPLY [2 votes]: Suppose $Y$ is a subspace of a metric space $X$, and $U_1,U_2$ are subsets of $Y$ which are open in $Y$. Assuming $U_1$ and $U_2$ are nonempty, the disjoint sets
$$V_1=\{x\in X:d(x,U_1)\lt d(x,U_2\}$$
and
$$V_2=\{x\in X:d(x,U_2)\lt d(x,U_1\}$$
are open because the functions $x\mapsto d(x,U_1)$ and $x\mapsto d(x,U_2)$ are continuous. Finally, $U_1\subseteq V_1$ because
$$x\in U_1\implies d(x,U_1)=0\lt d(x,Y\setminus U_1)\le d(x,U_2)\implies x\in V_1,$$
and similarly $U_2\subseteq V_2$.
That's assuming $U_1$ and $U_2$ are nonempty. Of course, if $U_i=\emptyset$, we can simply take $V_i=\emptyset$ and $V_{3-i}=X$.
P.S. We may as well let $Y=U_1\cup U_2$. That is, all we need to assume is that $U_1$ and $U_2$ are disjoint sets which are open in $U_1\cup U_2$, which is another way of saying that $U_1$ and $U_2$ are separated sets, disjoint sets such that neither contains a limit point of the other. We have shown that in a metric space, any two separated sets (for example, disjoint closed sets) are contained in disjoint open sets.