# A compact set, which is not closed.

I'm looking for a compact set, which is not closed.

I read somewhere that $Z^+$ are compact and not closed, but I don't understand why.

Are there any other examples of compact sets that are not closed and could you please explain?

I know that we can't look in the reals because every compact set in the reals is closed and bounded correct?

• Closed where? ${}$ – Mariano Suárez-Álvarez Dec 16 '14 at 5:25
• – JimmyK4542 Dec 16 '14 at 5:26
• Well, compact subsets of a Hausdorff space are closed… So the example you are looking for will come from a non-Hausdorff space. – Prism Dec 16 '14 at 5:26
• I'm in an analysis class and we haven't talked about Hausdorff spaces or in that link posted it talks about cofinite topology and I haven't learned that yet, either. – user201483 Dec 16 '14 at 5:28
• To clarify, are you asking for an example which is a metric space? – Strants Dec 16 '14 at 5:32

In any metric space, all compact sets are closed. To see this, let $(X,d)$ be a metric space, and $Y \subset X$ a non-closed set. Since $Y$ is not closed, it does not contain all of its limit points, so there exists a point $y \not\in Y$ which is an accumulation point of $Y$. Then, the collection $$\mathscr{U} = \{U_\varepsilon\}_{\varepsilon > 0},$$ where $U_\varepsilon = \{x \in X : d(x,y) > \varepsilon\}$, is an open cover of $Y$. However, any finite subset of $\mathscr{U}$, for example $$\mathscr{V} = \{U_{\varepsilon_1}, \cdots, U_{\varepsilon_n}\}$$ is not a cover of $Y$. To see this, let $\varepsilon = \min\limits_{i\in\{1, \cdots, n\}}\varepsilon_i$. Then, the ball around $y$ of radius $\varepsilon$ is disjoint from every set in $\mathscr{V}$ and contains a point of $Y$ (since $y$ was assumed to be a limit point of $Y$). It follows that $Y$ is not compact.

As Prism mentioned in the comments, we can show that any compact subset of a Hausdorff space (a class of topological spaces which includes metric spaces) must be closed. So we have to look for a non-Hausdorff (non-metric) counterexample. One such example is the set $X = \{x_1, x_2, x_3\}$ with the trivial topology $\tau = \{\emptyset, X\}$, where the set $Y = \{x_1\}$ is compact (since any open cover of $Y$ is finite), but $Y$ is not closed.

A typical example is $$X=\{a, b\}$$, with the topology $${\mathscr{T}}=\{ \varnothing, \{a\}, X \}$$. Then the subset $$\{a\}$$

• is compact: every open cover of $$\{a\}$$ admits a finite cover;

• is not closed, since its complement is not in the topology $${\mathscr{T}}$$.

• is actually open.

So a compact set can be open and not closed.