[Math] In a metric space, if a set is compact, then it is closed: improving proof

compactnessgeneral-topologymetric-spacesreal-analysis

Let $(M,d)$ be a metric space. If $K\subset M$ is compact, then it is closed (and bounded).

Proof Let's see that $M\setminus K$ is open. Let $x\in K$ $$\exists \varepsilon_1 (x), \varepsilon_2(x) \text{ so that } B(x, \varepsilon_1(x))\cap B(y,\varepsilon_2(x)) = \emptyset$$
then $K \subset \cup_{x\in K} B(x, \varepsilon_1(x))$ and, since $K$ is compact $\exists N \in \mathbb N \; \exists x_1,…,x_N \in K$ s.t.
$$ K\subset \bigcup_{i=1}^N B(x_i, \varepsilon_1(x_i)) $$
let $r = \min\{\varepsilon_2(x), i = 1,…,N \} > 0$, then
$$ B(y,r)\cap B(x_i, \varepsilon_1(x_i)) = \emptyset \quad\forall i = 1,…,N $$
therefore $B(y,r)\subset M\setminus K$ and $K$ is closed.

Question Why uses $\varepsilon_1(x)$ and $\varepsilon_2(x)$? If we consider, in $\mathbb R$ the interval $[0,1]$ it can't be covered using open balls without covering elements of $\mathbb{R}\setminus[0,1]$, so what happens when choosing $r$? Am I missing something?

Thanks in advance.

Best Answer

I think this proof might be a little clearer in its more general setting. That is if $X$ is a Hausdorff space and $Y \subset X$ is compact then $Y$ is closed. We call a space Hausdorff if for any two distinct points $x,y \in X$ there exists open neighborhoods $U,V \subset X$ so that $x \in U$ and $y \in V$ and $U \cap V =\emptyset$. It's clear that metric spaces are Hausdorff because you can separate two points taking balls around each half the distance between the two. Concretely we take $r=d(x,y)/2$ then have $U=B(x,r)$ and $V=B(y,r)$.

Now let $Y \subset X$ be compact. Pick $y \in X \setminus Y$. For each $x \in Y$ by the Hausdorff property we can find open sets $U_x$ and $V_x$ so that $x \in U_x$, $y \in V_x$ and $U_x \cap V_x=\emptyset$. Now it follows that

$$Y \subset \bigcup_{x \in Y} U_x,$$

since $Y$ is compact there exists some $x_1,\dots,x_n$ such that $U_{x_1},\dots,U_{x_n}$ covers $Y$. Then set $V=V_{x_1} \cap \cdots \cap V_{x_n}$ it follows that $V$ is open and contains $y$ but $U_{x_i} \cap V_{x_i}=\emptyset$. Since $Y$ is contained in the union of the $U_{x_i}$ we have that

$$Y \cap V = \emptyset.$$

Thereby around every point $y \in X \setminus Y$ we can find an open set contained in $X \setminus Y$. It follows that $Y$ is closed since $X \setminus Y$ is open.

Related Question