# prove: difference of compact set and open set is compact

claim: Let $(M, d)$ be a metric space and $K \subset M$ compact, $O \subset M$ open. Show that $K - O$ is compact.

Proof: I think this should follow directly. If $K$ is a compact set, that means every open cover of $K$ contains a finite subcover.

let's define an arbitrary finite subcover of $K$ to be $\{A\} = A_1 \cup A_2 \cup \cdots \cup A_n$

Since $K - O$ is simply the set $K$ with the elements of $O$ taken out, that means our set we need to cover is smaller, and therefore surely covered by $\{A\}$.

Since $K - O$ is covered by $\{A\}$ and $\{A\}$ is a finite subcovering by construction, then $K - O$ is compact.

Does this work?

I didn't even use the fact that $O$ was an open set in $M$.

• If you did not use the fact that $O$ is open then something must be wrong. $[0,1]$ is compact, but $[0,1]\setminus\{1\}$ is not. I will come back later. – drhab Feb 26 '16 at 9:04

Wrong. You proved that an open cover of $K$ contains a finite subcover of $K\setminus O$. However, it must be proved that an open cover of $K\setminus O$ contains such a finite subcover.

Let $\mathcal V$ be an open cover of $K\setminus O$.

Then $\mathcal V\cup\{O\}$ is an open cover of the compact $K$ (here it is used that $O$ is open).

So there is an finite subcover $\mathcal W\subseteq\mathcal V\cup\{O\}$ that covers $K$.

Then $\mathcal W-\{O\}\subseteq\mathcal V$ is finite and covers $K\setminus O$ and this with $\mathcal W-\{O\}\subseteq\mathcal V$.

This proves that $K\setminus O$ is compact.

$K\setminus O = K \cap (X \setminus O)$ is a closed subset of the compact set $K$ hence compact as well.

• That is a reformulation. Not much more. You can do better. – drhab Feb 26 '16 at 9:11
• @drhab this might be a theorem in his text. Why reprove it? – Henno Brandsma Feb 26 '16 at 9:12
• It might, yes. But it might be the theorem itself. Never mind, though. With our answers the OP is provided for both cases. – drhab Feb 26 '16 at 9:14

Since K \ O is simply the set K with the elements of O taken out, that means our set we need to cover is smaller, and therefore surely covered by {A}.

Watch out, it's possible to have covering of $K$\ $O$ that doesn't cover $K$. What you proved there is, given a covering ${A_\alpha}$ of $K$, it's possible to find a finite number of $A_\alpha$ such that they cover $K$\ $O$