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?
-
Definition. A space X is compact if
every open cover of X has a finite subcover.
-
Spelled out: for every family of open sets \{U_\alpha\} with
X = \bigcup_\alpha U_\alpha, there exist finitely many indices
\alpha_1, \dots, \alpha_n with
X = U_{\alpha_1} \cup \dots \cup U_{\alpha_n}.
-
A subset K \subseteq X is compact if it is compact in the subspace
topology — equivalently, every family of open sets of X whose union
contains K has a finite sub-family still containing
K.
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.
-
Continuous images stay compact. If f : X \to Y is
continuous and X is compact, then the image
f(X) is compact. (Proof in one line: pull an open cover of
f(X) back through f to an open cover of
X, take a finite subcover upstairs, push it forward.)
-
Closed inside compact is compact. A closed subset
C of a compact space X is compact: cover
C, adjoin the open set X \setminus C to get
a cover of all of X, take a finite subcover, discard the extra piece.
-
Compact inside Hausdorff is closed. In a
T_2 (Hausdorff) space, every compact subset
K is closed — you can separate any outside point from
K by disjoint open sets, so the complement is open.
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:
-
A continuous function f : K \to \mathbb{R} on a non-empty
compact set K attains its maximum
and minimum: there exist p, q \in K with
f(p) \le f(x) \le f(q) for all x \in K.
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:
-
Extreme Value Theorem (above) — the image in
\mathbb{R} is closed and bounded, so the sup and inf are attained.
-
A continuous bijection from a compact space to a Hausdorff space is a homeomorphism.
Its inverse is automatically continuous, because it maps closed (hence compact, hence closed)
sets to closed sets — no separate \varepsilon-\delta
argument for the inverse is needed.
-
Uniform continuity for free (the Heine–Cantor theorem): a continuous map on a
compact metric space is automatically uniformly continuous. The single
\delta that a proof usually sweats to produce falls out of a finite
subcover.
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:
-
A space X is sequentially compact if every sequence
(x_n) in X has a subsequence
(x_{n_k}) that converges to a point of X.
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:
-
In a metric space, X is compact (open-cover sense)
\iff X is sequentially compact.
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:
-
Every bounded sequence in \mathbb{R}^n has a convergent subsequence.
-
This is exactly the statement that closed, bounded boxes in
\mathbb{R}^n are sequentially compact — the
\mathbb{R}^n heart of the whole story.
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:
-
Take \mathbb{R} with the discrete metric
(d(x, y) = 1 for x \ne y). The whole space
is closed and bounded (every distance is \le 1), yet it is not
compact — the cover by singleton balls B(x, \tfrac12) = \{x\} has no
finite subcover.
-
In an infinite-dimensional normed space the closed unit ball is closed and bounded but
never compact (Riesz's lemma) — the sequence of orthonormal vectors
e_1, e_2, \dots stays distance \sqrt{2}
apart and has no convergent subsequence. This is why analysis on function spaces is so much
subtler than on \mathbb{R}^n.
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.