Disjoint compact sets in a Hausdorff space can be separated

I want to show that any two disjoint compact sets in a Hausdorff space $X$ can be separated by disjoint open sets. Can you please let me know if the following is correct? Not for homework, just studying for a midterm. I'm trying to improve my writing too.

My work:

Let $C$,$D$ be disjoint compact sets in a Hausdorff space $X$. Now fix $y \in D$ and for each $x \in C$ we can find (using Hausdorffness) disjoint open sets $U_{x}(y)$ and $V_{x}(y)$ such that $x \in U_{x}(y)$ and $y \in V_{x}(y)$. Now the collection $\{U_{x}: x \in C\}$ covers $C$ so by compactness we can find some natural k such that

$C \subseteq \bigcup_{i=1}^{k} U_{x_{i}}(y)$

Now for simplicity let $U = \bigcup_{i=1}^{k} U_{x_{i}}(y)$, then $C \subseteq U$ and let $W(y) = \bigcap_{i=1}^{k} V_{x_{i}}(y)$. Then $W(y)$ is a neighborhood of $y$ and disjoint from $U$.

Now consider the collection $\{W(y): y \in D\}$, this covers D so by compactness we can find some natural q such that $D \subseteq \bigcup_{j=1}^{q} W_{y_{j}}$.

Finally set $V = \bigcup_{j=1}^{q} W_{y_{j}}$, then $U$ and $V$ are disjoint open sets containing $C$ and $D$ respectively.

What do you think?

-
+1 for showing your work. – Arturo Magidin Jan 19 '11 at 19:50
This looks good but there's a slight problem in that $U$ depends on $y$ but that's quite easily fixed. I'd like to suggest to do it in two steps: First show that given a compact set $C$ and a point $p \notin C$ you can find disjoint open sets $U_{p} \supset C$ and $V_{p} \ni p$. Now let $p$ run through $D$, and find $p_{1},\ldots,p_{n}$ by compactness and put $U = U_{p_{1}} \cap \cdots \cap U_{p_{n}}$ and $V = V_{p_{1}} \cup \cdots \cup V_{p_{n}}$. – t.b. Jan 19 '11 at 19:51
Can you prove that a compact set and a point can be separated? – Qiaochu Yuan Jan 19 '11 at 20:08
Great question and answers. This came up for me in passing so I googled it and this question came up. So it was indeed useful to someone else years later. :> – roo Jun 12 '13 at 20:15

This is a very good start, but there is a slight problem with your argument: as you change $y$, your $U$ changes as well (since $U$ is constructed in terms of $y$); you should really call it $U(y)$.

Your construction gives you an open neighborhood $W(y)$ of $y$ for each $y$; $W(y)$ is disjoint from $U(y)$. But for all you know, $W(y)$ may fail to be disjoint from $U(y')$ with $y'\neq y$.

So you really still have a bit more to go before you are done.

-
Thank you, yeah I see now. Can we fix the above construction taking as $U$ the set given by $U = \bigcap_{i=1}^{q} U(y_{i})$ ? – student Jan 19 '11 at 20:03
@student: Exactly; that is, you are using the same "trick" (procedure) for the open set containing $C$ as you used to find the open set $W(y)$ containing $y$. – Arturo Magidin Jan 19 '11 at 20:11
Thank you very much for your help. – student Jan 19 '11 at 21:46
@student: Don't forget to "accept" an answer before you finish. You can even post your own full solution as an answer, wait for final comments, and then accept it; or accept whichever answer you find most helpful (you can wait some time to see if you get other answers; but please accept one before you are done, so that the question will not be considered "unanswered" by the system). – Arturo Magidin Jan 19 '11 at 21:50
I accepted your useful answer, thanks again. Please let me know if I did something incorrect. – student Jan 19 '11 at 23:33

U=⋃ki=1Uxi(y) might meet V, so to avoid this problem use compactness of the second set. I think if your prove is completlly correct, we don't need to suppose compactness of the two. and we consider simply V=⋃w(y); y in D

-