The Heine–Borel Theorem
In the plane, or on the line, some sets are wonderfully well-behaved: a continuous function on them
cannot run off to infinity, cannot sneak up on a supremum without attaining it, and any sequence
living inside them has a subsequence that settles down to a limit still inside. The abstract name
for this good behaviour is compactness
— every open cover has a finite subcover. But that definition, stated with covers, is notoriously
slippery to check by hand. Which concrete subsets of
\mathbb{R}^n actually are compact?
The Heine–Borel theorem answers this with a slogan you can apply at a glance. In
\mathbb{R}^n — and this is the whole point, only in
\mathbb{R}^n — compactness is nothing more exotic than two elementary,
eyeball-able conditions: the set must be closed (it contains all its limit points)
and bounded (it fits inside some ball of finite radius). No covers, no subsequences,
no \varepsilon. Just: does it have holes at the edge, and does it fit in a
box.
Let K \subseteq \mathbb{R}^n (with the Euclidean metric). Then the
following are equivalent:
- K is compact (every open cover has a finite subcover);
- K is closed and bounded.
Equivalently (by the Bolzano–Weierstrass property), K is compact iff
every sequence in K has a subsequence converging to a point of
K.
The archetype is the closed interval [a, b]: closed (endpoints included),
bounded (length b - a), and therefore compact. Drop an endpoint to get
(a, b] and you lose compactness; stretch to [a, \infty)
and you lose it too. The theorem tells you exactly which small change did the damage.
The easy direction: compact ⟹ closed and bounded
This half is true in any metric space, and both parts fall straight out of the
finite-subcover definition. Let K be compact.
Bounded. Cover K by the open balls
B(p, 1) of radius 1 centred at every point
p \in K — certainly an open cover, since each point sits in its own ball.
Compactness hands us a finite subcover
B(p_1, 1), \dots, B(p_m, 1). A finite union of balls of radius
1 is bounded (it fits inside one big ball around
p_1 of radius 1 + \max_i d(p_1, p_i)), so
K is bounded.
Closed. We show the complement \mathbb{R}^n \setminus K is
open. Fix a point x \notin K. For each
y \in K the points x and
y are distinct, so we can slip two disjoint open balls between them: let
r_y = \tfrac{1}{2} d(x, y) > 0 and take
B(y, r_y) around y and
B(x, r_y) around x. The balls
\{ B(y, r_y) : y \in K \} cover K; extract a
finite subcover B(y_1, r_{y_1}), \dots, B(y_k, r_{y_k}). Now let
r = \min_i r_{y_i} > 0 (a min of finitely many positive numbers —
this is exactly where finiteness is spent). The ball B(x, r) misses every
B(y_i, r_{y_i}), hence misses K, so
x has a whole neighbourhood outside K. Thus the
complement is open and K is closed.
Note how mild this direction is: it never used
\mathbb{R}^n at all. Compact always implies closed and bounded.
It is the converse that is delicate — and false outside \mathbb{R}^n.
The deep direction: closed and bounded ⟹ compact
This is the substantial half, and it is where \mathbb{R}^n earns its
keep through the completeness of the reals — the
supremum / least-upper-bound property.
The engine is a bisection (nested-interval) argument. Watch it on the closed square
[0,1]^2; the same proof runs on any closed box, and any closed bounded set
is a closed subset of such a box.
Setup (proof by contradiction). Let
Q_0 = [0,1]^2 and suppose, for contradiction, that some open cover
\mathcal{U} of Q_0 admits no finite
subcover.
Bisect. Cut Q_0 into four congruent closed sub-squares.
If each of the four could be covered by finitely many sets of
\mathcal{U}, then their union Q_0 could too — a
finite union of finite collections is finite. So at least one sub-square, call it
Q_1, still has no finite subcover. Repeat: bisect
Q_1, keep a bad quarter Q_2, and so on, forever.
Q_0 \supset Q_1 \supset Q_2 \supset \cdots, \qquad \operatorname{diam}(Q_k) = \frac{\sqrt{2}}{2^k} \to 0,
a nested sequence of non-empty closed boxes whose diameters shrink to zero, each still refusing a
finite subcover.
Completeness closes the trap. Here is the one and only place we use that we are in
\mathbb{R}^n. Take the lower-left corners of the boxes: their
x-coordinates form a bounded monotone sequence, which converges by the
completeness of \mathbb{R} (a bounded increasing sequence has a supremum,
and converges to it); likewise the y-coordinates. The
nested interval property — itself a face of completeness — gives a single point
p lying in every box:
\bigcap_{k=0}^{\infty} Q_k = \{ p \}.
The contradiction. Since \mathcal{U} covers
Q_0, some single open set U \in \mathcal{U}
contains p. Because U is open, it contains a
whole ball B(p, \varepsilon). But the boxes shrink to
p: once \operatorname{diam}(Q_k) < \varepsilon,
the entire box Q_k sits inside B(p, \varepsilon) \subseteq U.
So Q_k is covered by the single set
U — a finite subcover of one — contradicting that
Q_k had no finite subcover. The assumption was absurd, so every open cover
of [0,1]^2 has a finite subcover: it is compact.
For a general closed bounded K \subseteq \mathbb{R}^n: boundedness puts
K inside some big closed box Q (compact by the
above), and a closed subset of a compact set is compact. Done.
The whole proof is elementary set-chasing except for one step: the nested boxes must
actually meet in a point. That is precisely the no-holes property of
\mathbb{R}. Try the identical bisection on
K = [0,1] \cap \mathbb{Q}, the rationals in the unit interval. It is
bounded and — within the metric space \mathbb{Q} — closed. Yet
the nested intervals can zero in on p = 1/\sqrt{2}, which is
not rational: the intersection is empty in \mathbb{Q}, the trap
never closes, and indeed [0,1] \cap \mathbb{Q} is not
compact. Completeness is not decoration; it is the load-bearing wall. This is the same crack that,
in infinite dimensions, brings the whole theorem down.
Why we care: the Extreme Value Theorem falls right out
Heine–Borel is the quiet workhorse behind the theorems of first-year calculus that "obviously" ought
to be true. Two headline payoffs, both flowing from the fact that the continuous image of a compact
set is compact.
If f : [a,b] \to \mathbb{R} is continuous, then
f:
- is bounded — it does not run off to \pm\infty;
- attains its supremum and infimum — there exist
c, d \in [a,b] with
f(c) = \max f and f(d) = \min f.
Proof, in one breath. The interval [a,b] is compact
(Heine–Borel). A continuous map sends compact sets to compact sets, so the image
f([a,b]) is a compact subset of \mathbb{R} —
hence, by Heine–Borel again, closed and bounded. Bounded gives a finite supremum
M = \sup f([a,b]); closed means that supremum, being a limit point of the
image, actually lies in the image — so M = f(c) for some
c. The maximum is attained. Same for the minimum. That is the entire
argument, and every step is Heine–Borel.
This is also why f(x) = 1/x on the open interval
(0, 1] attains no maximum: the domain is bounded but not closed, not
compact, and the guarantee evaporates. The "closed" in "closed and bounded" is doing real work.
A continuous function on a compact set is automatically uniformly continuous — a
single \delta works for every point at once, no matter where you are.
The proof is pure Heine–Borel: at each point pick a \delta_x from
continuity, cover the compact domain by the balls B(x, \delta_x / 2),
take a finite subcover, and let \delta be the smallest of the finitely
many radii. This is Heine's theorem (the "Heine" of Heine–Borel): why
\sin x is uniformly continuous on [0, 2\pi]
but 1/x is not uniformly continuous on the non-compact
(0, 1].
Deciding compactness at a glance: worked examples
The whole value of Heine–Borel is that in \mathbb{R}^n you check two
boxes. Ask: does it contain all its boundary? (closed) and does it fit in a ball?
(bounded). Both yes ⟹ compact; either no ⟹ not compact.
-
\{ x \in \mathbb{R}^n : |x| \le r \}, the closed ball.
Closed (the \le keeps the boundary sphere) and bounded (radius
r). Compact.
-
\{ x : |x| < r \}, the open ball. Bounded, but
not closed — the boundary sphere is missing, and points of it are limit points not in the
set. Not compact.
-
The unit sphere S^{n-1} = \{ x : |x| = 1 \}. Closed (the level set of a
continuous function) and bounded. Compact.
-
\mathbb{Z} \subseteq \mathbb{R}, the integers. Closed (no limit points at
all to miss), but unbounded. Not compact.
-
A closed box [a_1, b_1] \times \cdots \times [a_n, b_n]. Closed and
bounded. Compact — the base case of the theorem.
-
\{ 0 \} \cup \{ 1/n : n \in \mathbb{N} \}. Bounded, and closed
because the one limit point 0 was thrown in.
Compact. Delete the 0 and it is no longer closed — and
no longer compact (the sequence 1/n has no limit inside).
-
[0, \infty). Closed but unbounded. Not compact.
The pattern to internalise: bounded fails by running to infinity;
closed fails by having a limit point sitting just outside the set. Compactness needs
neither leak.
The catch: Heine–Borel is a privilege of \mathbb{R}^n
Here is the crucial twist, and the reason this page exists. "Closed and bounded ⟹ compact" is
not a general fact about metric spaces. It is a special gift of finite-dimensional
Euclidean space, and the moment you leave it, closed and bounded sets can fail spectacularly to be
compact. Two clean counterexamples.
Counterexample 1 — the closed unit ball in infinite dimensions. Work in
\ell^2, the space of square-summable sequences
x = (x_1, x_2, \dots) with
\|x\| = \big(\sum_i x_i^2\big)^{1/2} (a complete normed space, i.e. a
Banach space; C[0,1] with the sup norm works just as well). The closed
unit ball \overline{B} = \{ x : \|x\| \le 1 \} is closed and bounded by
definition. Is it compact? Consider the standard unit vectors
e_1 = (1, 0, 0, \dots), \quad e_2 = (0, 1, 0, \dots), \quad e_3 = (0, 0, 1, \dots), \quad \dots
each with \|e_n\| = 1, so all inside \overline{B}.
But any two of them are pulled apart by a fixed gap:
\|e_m - e_n\| = \sqrt{1^2 + 1^2} = \sqrt{2} \qquad (m \ne n).
The points e_n are all at distance \sqrt{2}
from one another — an infinite "discrete cloud" — so no subsequence can be Cauchy, let
alone convergent. A sequence in \overline{B} with no convergent
subsequence means \overline{B} is not compact, even
though it is closed and bounded. In fact this is a theorem of Riesz: the closed unit ball of a
normed space is compact if and only if the space is finite-dimensional. Infinite dimensions
have "too much room" — you can always find another orthogonal direction to escape into.
Counterexample 2 — the discrete metric. Take any infinite set
X with the discrete metric,
d(x,y) = 1 for x \ne y. The whole space is
bounded (every distance is \le 1) and closed (it is the
whole space). But the open cover by singletons
\{ \{x\} : x \in X \} — each singleton is open here — has no finite
subcover, since finitely many singletons cannot exhaust an infinite set. Closed and bounded, not
compact. Boundedness in a general metric space is simply too weak to control anything.
The single most common error with this theorem is to forget it is a theorem at all
and to treat "closed and bounded" as if it were the definition of compactness. It is not.
Compactness is defined by the open-cover (or subsequence) property, and Heine–Borel is a
non-trivial equivalence that only holds in \mathbb{R}^n.
The damage this does is real and specific:
-
In a function space like C[0,1] or a sequence space like
\ell^2, "this set is closed and bounded" tells you
nothing about compactness — as the unit ball above shows. To get compactness in
C[0,1] you need the genuinely stronger
Arzelà–Ascoli theorem (closed + bounded + equicontinuous).
-
Even in \mathbb{R}^n, "closed" and "bounded" must both hold —
students routinely check boundedness, forget closedness (or vice versa), and wrongly declare
(0,1) or [0,\infty) compact.
-
The habit "compact = closed + bounded" quietly assumes completeness. Over
\mathbb{Q}, [0,1] \cap \mathbb{Q} is closed
(in \mathbb{Q}) and bounded but not compact.
The safe mental model: compact is defined by covers; in \mathbb{R}^n
only, Heine–Borel lets you shortcut to "closed and bounded". Take that shortcut anywhere else
and it will betray you.