# Confusion about compact subsets of metric spaces being closed

In Rudin's Analysis, we have

Theorem: Compact subsets of metric spaces are closed.

Can't I generate a counterexample?

$\mathbb R$ is a metric space. $(0,1)\in\mathbb R$ is a subset which is also compact since I can cover $(0,1)$ with the open set $(-1,2)$. $(0,1)$ is also not closed because $1$ is a limit point (all neighborhoods of $1$ contain a point which is in $(0,1)$) but not in the set.

So $(0,1)$ is a non-closed subset of $\mathbb R$ with a finite open covering, and thus compact.

This book is tough for me, I'd appreciate any help.

• Another good way to think about compact sets is that they are exactly those for which every sequence in the set has a convergent subsequence. This pretty clearly asserts that any sequence in the set (which is convergent in the space as a whole) is convergent in the set, which is a definition of closure. – G. H. Faust Apr 4 '14 at 3:53

I think you're confusing what compact means. We say that a space $X$ is compact if and only if for every open cover $\{U_\alpha\}_{\alpha\in A}$ there exists a finite subcover. So $(0,1)$ is not compact because we can form the open cover $\{(1/2,2)\}\cup \{(\frac{1}{n+1},\frac{1}{n}) \mid n\geq 2\}$. This certainly covers $(0,1)$, but has no finite subcover.
To drive the point even further home, if we accidentally took the definition "there exists a finite open cover", then we could trivially take $\{X\}$ as a clearly finite open cover. Then every space would be compact, and it wouldn't be a very useful definition.