Compactness

A closed interval like [0, 1] is, in a precise sense, a "small" space: whatever you try to do to it, it refuses to leak away. A continuous temperature reading along a wire of length one attains a hottest point; an infinite sequence of measurements inside it must pile up somewhere; and no matter how you try to smother it in tiny open patches, you only ever need finitely many. The open interval (0, 1) — the very same length, missing only its two endpoints — fails all three. Something about being closed and not running off to infinity makes the first interval tame and the second wild.

That tameness has a single, astonishingly portable name: compactness. It is the topological distillation of "finite" — a way to enjoy the good behaviour of a finite set even when the space has uncountably many points. The definition looks strange the first time you meet it, so let us motivate it before stating it: compactness is what you have left of finiteness once you are only allowed to speak the language of open sets.

Open covers and finite subcovers

Fix a topological space X. An open cover of X is a family \mathcal{U} = \{ U_\alpha \}_{\alpha \in A} of open sets whose union is everything:

X = \bigcup_{\alpha \in A} U_\alpha.

Think of the U_\alpha as patches of blanket thrown over X; "cover" means every point lies under at least one patch. A subcover is a sub-family that still covers X — you throw some of the patches away and the blanket still has no holes. A subcover is finite when only finitely many patches remain.

The definition then asks a single question of the space: can you always get away with finitely many patches?

The quantifiers are the whole game. It is not enough for some clever cover to reduce to finitely many pieces — you must survive every cover an adversary can dream up, including maliciously tiny patches. And "has a finite subcover" is an existence claim about the cover you were handed, not a demand that the cover itself be finite. Getting those two backwards is the classic beginner's slip (more on that below).

How non-compactness is proved: exhibit one bad cover

To show a space is compact you must argue about all covers at once — usually hard. To show it is not compact you need only one villain: a single open cover for which no finite sub-family suffices. Here is the canonical example.

(0, 1) is not compact. For each integer n \ge 2 let U_n = \left( \tfrac{1}{n},\, 1 \right). These do cover (0, 1): any x \in (0, 1) is positive, so once \tfrac{1}{n} < x we have x \in U_n. But a finite sub-family U_{n_1}, \dots, U_{n_k} has a largest index N = \max(n_i), and since the U_n are nested (U_2 \subset U_3 \subset \dots) their union is just the single widest one, U_N = \left( \tfrac{1}{N}, 1 \right). That misses every point of \left( 0, \tfrac{1}{N} \right] — an entire sliver near 0 escapes. No finite subcover, so (0,1) is not compact. Reveal the figure step by step to watch the hole survive.

The moral of the picture: (0, 1) fails to be compact at the missing endpoint 0. The sequence \tfrac{1}{n} wants to converge to 0, but 0 is not in the space, and the cover exploits exactly that hole. Add the endpoints back — work in [0, 1] — and the same cover no longer covers 0 at all, so it is disqualified. Closing the gap is precisely what restores compactness.

\mathbb{R} is not compact either, for the mirror-image reason: it runs off to infinity. Cover it by the growing intervals V_n = (-n, n), n = 1, 2, 3, \dots Every real number lies in some V_n, so this is an open cover. Yet any finite sub-family has a largest N and unites to the bounded interval (-N, N), which misses N, N+1, and everything beyond. The point that escapes is not a missing boundary this time — it is infinity. Compactness forbids both kinds of escape at once.

Why anyone cares: compactness is a theorem-factory

A definition this fussy earns its keep by what it proves. Three results do most of the work, and the first one alone repays the whole investment.

The first workhorse is secretly one of the most useful theorems in all of analysis. Recall from real analysis that a compact subset of \mathbb{R} is closed and bounded (by the two boxed facts above, applied in the Hausdorff space \mathbb{R}). So if f : K \to \mathbb{R} is continuous on a compact K, its image f(K) is a compact — hence closed and bounded — subset of \mathbb{R}. A closed, bounded, non-empty set of reals contains its supremum and infimum. Therefore:

This is why "continuous on a closed interval [a, b]" was drummed into you in first-year calculus: the compactness of [a, b] is exactly what guarantees a highest and lowest point. Drop compactness and the theorem dies: f(x) = x on the non-compact (0, 1) attains neither bound, and f(x) = \tfrac{1}{x} on (0, 1) is not even bounded above. The escape route the interval left open is precisely the one the function exploits.

"Continuous image of compact is compact" quietly powers results that look unrelated:

The sequence picture: sequential compactness

The open-cover definition is the "right" one topologically, but it is not the one your intuition was raised on. There is a second, older notion that speaks the language of convergent sequences:

This is the "no escaping" idea in sequence form: a sequence cannot wander off forever without some infinite part of it settling down onto a genuine point of the space. On (0, 1) it fails — the sequence \tfrac{1}{n} and all its subsequences head for the missing point 0. On \mathbb{R} it fails — the sequence x_n = n has no convergent subsequence, everything runs to infinity. Same two failures as before.

In general topological spaces the two notions of compactness can come apart, but in the world you care about most they coincide exactly:

So on the real line, in \mathbb{R}^n, in any space of functions with a metric — you may freely use whichever face of compactness is handier, covers or subsequences. The subsequence face is the one behind an old friend:

Which raises the obvious question: in \mathbb{R}^n, exactly which sets are compact? The answer is clean and famous — closed and bounded, no more and no less — and it is important enough to earn its own page. That is the Heine–Borel theorem, coming up next; here we have built the machinery it rests on.

The single most common compactness error is to memorise compact = closed and bounded as if it were the definition. It is not — it is the Heine–Borel theorem, and it is a theorem specifically about \mathbb{R}^n (finite dimensions, with the usual metric). In a general metric space it can fail hard:

The safe rule: compactness is defined by finite subcovers (or, in a metric space, by convergent subsequences). "Closed and bounded" is merely how compactness happens to look in the special case \mathbb{R}^n.

A second slip worth naming: compact does not mean "some open cover is finite" — every space has finite covers (cover X by the single open set X itself!). Compactness demands that whatever infinite cover you are given, you can throw away all but finitely many of its members and still cover. The finiteness is extracted from an arbitrary cover, not assumed about a convenient one. That quantifier order — "for all covers, there exists a finite subcover" — is the entire content of the definition, and it is what makes an uncountable space behave like a finite one.