Compactness and the Heine-Borel Theorem

⚡ Key Takeaways

Compactness is a topological property that generalizes "closed and bounded." The Heine–Borel Theorem states that a subset of Rn\mathbb{R}^n is compact if and only if it is closed and bounded. Applies throughout real analysis, topology, and optimization wherever existence of maxima, uniform continuity, or convergent subsequences is needed. Named after Eduard Heine (who used the underlying idea c. 1872) and Émile Borel (who proved the covering form in 1895).

💡 The Core Insight

Compactness is finiteness in disguise. It says you can always replace "infinitely many open sets covering KK" with "finitely many of them." This single trick lets local information (defined patchwise on the cover) be glued into global, uniform information. Heine–Borel identifies exactly which subsets of Euclidean space enjoy this trick: precisely the closed and bounded ones.

Formal Statement

DefinitionOpen Cover and Subcover

Let KK be a subset of a topological space XX. A collection U={Uα}α∈A\mathcal{U} = \{U_\alpha\}_{\alpha \in A} of open sets is an open cover of KK if

1
K⊆⋃α∈AUα.\quad K \subseteq \bigcup_{\alpha \in A} U_\alpha.

Derivation hint: This is the defining inclusion — every point of KK lies in at least one UαU_\alpha. A finite subcover is a finite subcollection {Uα1,…,Uαn}⊆U\{U_{\alpha_1}, \dots, U_{\alpha_n}\} \subseteq \mathcal{U} that still covers:

2
K⊆⋃i=1nUαi.\quad K \subseteq \bigcup_{i=1}^{n} U_{\alpha_i}.

Derivation hint: Restrict the index set AA to a finite subset {α1,…,αn}\{\alpha_1,\dots,\alpha_n\} while preserving the covering inclusion. Here XX is the ambient space, KK the subset under study, AA an arbitrary (possibly uncountable) index set, and each UαU_\alpha an open set of XX.

DefinitionCompactness

A subset K⊆XK \subseteq X is compact if every open cover of KK has a finite subcover. Symbolically,

3
∀ U open cover of K, ∃ finite F⊆A:K⊆⋃α∈FUα.\quad \forall\, \mathcal{U}\ \text{open cover of } K,\ \exists\, \text{finite } F \subseteq A : K \subseteq \bigcup_{\alpha \in F} U_\alpha.

Derivation hint: Universally quantify over covers, existentially over finite subcollections — this is the literal reading of the definition.

DefinitionBoundedness and Total Boundedness

A set KK in a metric space (X,d)(X,d) is bounded if it lies inside some ball:

4
∃ x0∈X, R>0: K⊆B(x0,R)={x:d(x,x0)<R}.\quad \exists\, x_0 \in X,\ R > 0 :\ K \subseteq B(x_0, R) = \{x : d(x,x_0) < R\}.

Derivation hint: One reference point and one finite radius enclose the whole set. It is totally bounded if for every ε>0\varepsilon > 0 it can be covered by finitely many ε\varepsilon-balls:

5
∀ ε>0, ∃ x1,…,xm∈X: K⊆⋃i=1mB(xi,ε).\quad \forall\, \varepsilon > 0,\ \exists\, x_1,\dots,x_m \in X :\ K \subseteq \bigcup_{i=1}^{m} B(x_i, \varepsilon).

Derivation hint: Total boundedness strengthens boundedness by demanding finite covers at every scale ε\varepsilon, not just one large ball.

TheoremHeine–Borel

Let K⊆RnK \subseteq \mathbb{R}^n with the standard Euclidean metric. The following are equivalent: 1. KK is compact (every open cover has a finite subcover); 2. KK is sequentially compact (every sequence in KK has a subsequence converging to a point of KK); 3. KK is closed and bounded; 4. KK is complete and totally bounded.

6
K⊆Rn compact  ⟺  K closed and bounded.\quad K \subseteq \mathbb{R}^n \text{ compact} \iff K \text{ closed and bounded}.

Derivation hint: The headline equivalence (1) ⇔ (3) is the classical Heine–Borel statement; the other equivalences hold in any metric space and the dimensional finiteness of Rn\mathbb{R}^n is what links them to "closed and bounded."

⚠️ Common mistake

The equivalence (3) ⇔ compactness is special to Rn\mathbb{R}^n (and finite-dimensional normed spaces). In a general metric space, "closed and bounded" does not imply compact. The correct general equivalence is complete + totally bounded, statement (4).

Why It Holds

ProofClosed and Bounded ⟹ Compact in ℝⁿ

We prove the harder direction of [6] for Rn\mathbb{R}^n.

Step 1 — Reduce to a closed box. Since KK is bounded, K⊆Q0K \subseteq Q_0 for some closed cube

7
Q0=[−R,R]n,R>0.\quad Q_0 = [-R, R]^n, \qquad R > 0.

Derivation hint: Boundedness [4] places KK in a ball, which sits inside a cube of side 2R2R. It suffices to show Q0Q_0 is compact: a closed subset of a compact set is compact (a cover of KK together with the open set Rn∖K\mathbb{R}^n \setminus K covers Q0Q_0; extract a finite subcover and discard Rn∖K\mathbb{R}^n\setminus K).

Step 2 — Bisection / nested boxes. Suppose, for contradiction, that some open cover U\mathcal{U} of Q0Q_0 has no finite subcover. Bisect Q0Q_0 into 2n2^n congruent subcubes by halving each side. If all 2n2^n pieces admitted finite subcovers, their union Q0Q_0 would too. Hence at least one subcube Q1Q_1 has no finite subcover. Iterate to obtain nested cubes

8
Q0⊇Q1⊇Q2⊇⋯ ,diam⁡(Qk)=diam⁡(Q0)2k=2Rn2k.\quad Q_0 \supseteq Q_1 \supseteq Q_2 \supseteq \cdots,\qquad \operatorname{diam}(Q_k) = \frac{\operatorname{diam}(Q_0)}{2^k} = \frac{2R\sqrt{n}}{2^k}.

Derivation hint: Each bisection halves the side length, hence halves the diameter; the diameter tends to 00.

Step 3 — Nested interval / completeness. Each QkQ_k is a nonempty compact box, and the diameters shrink to 00. By completeness of Rn\mathbb{R}^n (Cantor's nested-set property),

9
⋂k=0∞Qk={p}for a unique point p∈Q0.\quad \bigcap_{k=0}^{\infty} Q_k = \{p\}\quad\text{for a unique point } p \in Q_0.

Derivation hint: A decreasing sequence of nonempty closed sets with diameter →0\to 0 in a complete space has a single common point.

Step 4 — Contradiction. Since U\mathcal{U} covers Q0Q_0, some U∈UU \in \mathcal{U} contains pp; as UU is open there is δ>0\delta>0 with B(p,δ)⊆UB(p,\delta) \subseteq U. Choose kk so large that diam⁡(Qk)<δ\operatorname{diam}(Q_k) < \delta. Then Qk⊆B(p,δ)⊆UQ_k \subseteq B(p,\delta) \subseteq U, so {U}\{U\} alone is a finite subcover of QkQ_k — contradicting that QkQ_k had no finite subcover. Hence Q0Q_0 (and therefore KK) is compact. ■\blacksquare

∎
ProofCompact ⟹ Closed and Bounded — in any metric space

Bounded. Fix x0∈Kx_0 \in K and cover KK by the expanding balls {B(x0,m)}m∈N\{B(x_0, m)\}_{m \in \mathbb{N}}. A finite subcover has a largest radius MM, so K⊆B(x0,M)K \subseteq B(x_0, M): KK is bounded, satisfying [4].

Closed. Let y∉Ky \notin K. For each x∈Kx \in K, set rx=12d(x,y)>0r_x = \tfrac{1}{2}d(x,y) > 0; the balls {B(x,rx)}x∈K\{B(x, r_x)\}_{x\in K} cover KK. Extract a finite subcover B(x1,rx1),…,B(xm,rxm)B(x_1,r_{x_1}),\dots,B(x_m,r_{x_m}), and let r=min⁡irxi>0r = \min_i r_{x_i} > 0. Then B(y,r)B(y, r) is disjoint from every B(xi,rxi)B(x_i, r_{x_i}), hence disjoint from KK. So Rn∖K\mathbb{R}^n \setminus K is open and KK is closed. ■\blacksquare

∎
mathematician · Émile Borel | 1871–1956

French mathematician who, in his 1894 thesis and 1895 paper, proved that a countable open cover of a closed bounded interval has a finite subcover — the first explicit "covering" statement. The result was later extended to arbitrary (uncountable) covers by Lebesgue, Schoenflies, and others. Borel went on to found modern measure theory (Borel sets, Borel measure) and made early contributions to probability and game theory. The "Heine" half of the name honors Eduard Heine, who in 1872 used the underlying compactness idea to prove that continuous functions on closed intervals are uniformly continuous.

Building Intuition

🧠 Intuition

Think of an open cover as a fleet of overlapping "spotlights," each illuminating an open region. Compactness says: no matter how you arrange infinitely many spotlights to light up KK, you can switch off all but finitely many and still keep KK fully lit. A set fails compactness when it can "escape to the boundary or to infinity" — either by leaking out through a missing endpoint (not closed) or stretching off forever (not bounded). The bisection proof is a "divide and conquer": if no finite team of spotlights works, keep cutting the region in half, always keeping a troublesome piece; these pieces zoom in on a single point pp, but the one spotlight covering pp floods a whole neighborhood — large enough to swallow a tiny piece. Contradiction.

Figure
Bisection argument: nested boxes shrinking to the limit point p inside a covering open set U
Q₀ Q₁ Q₂ U ∈ 𝒰 p diam(Qₖ) = 2R√n / 2ᵏ → 0, so eventually Qₖ ⊂ U

Worked Examples

ExampleTesting compactness of three subsets of ℝ

Given. Decide whether each set is compact: (a) A=[2,5]A = [2, 5], (b) B=(0,1]B = (0, 1], (c) C={0}∪{1/n:n∈N}C = \{0\} \cup \{1/n : n \in \mathbb{N}\}.

Steps.

  • (a) A=[2,5]A=[2,5] is closed (contains both endpoints) and bounded (lies in B(0,6)B(0,6)). By Heine–Borel [6], compact.
  • (b) B=(0,1]B=(0,1] is bounded but not closed — the point 00 is a limit point not in BB. Explicit escaping cover: U={(1/n, 2):n∈N}\mathcal{U} = \{(1/n,\,2) : n \in \mathbb{N}\}. Any finite subcollection has a largest n=Nn=N, covering only (1/N,2)(1/N,2), missing points near 00. No finite subcover ⟹ not compact.
  • (c) CC is bounded (in [0,1][0,1]) and closed (its only limit point 00 is included). Given any cover, one set U0U_0 contains 00, hence all but finitely many 1/n1/n; cover the remaining finitely many points with one set each. Finite subcover exists.

Answer.

A compact,B not compact,C compact.\boxed{A \text{ compact},\quad B \text{ not compact},\quad C \text{ compact.}}
ExampleExtreme Value: bounding a continuous function via compactness

Given. f(x,y)=x2+2y2−xf(x,y) = x^2 + 2y^2 - x on the closed disk K={(x,y):x2+y2≤1}K = \{(x,y): x^2+y^2 \le 1\}. Show ff attains a maximum and find it.

Steps.

  • KK is closed and bounded in R2\mathbb{R}^2, hence compact by [6]. Since ff is continuous, the Extreme Value Theorem guarantees a max and min are attained on KK.
  • Interior critical points: ∇f=(2x−1, 4y)=(0,0)⇒(x,y)=(12,0)\nabla f = (2x-1,\ 4y) = (0,0)\Rightarrow (x,y)=(\tfrac12,0), inside KK. There f=14−12=−14f=\tfrac14-\tfrac12=-\tfrac14.
  • Boundary x2+y2=1x^2+y^2=1: substitute y2=1−x2y^2 = 1-x^2, so f=x2+2(1−x2)−x=−x2−x+2f = x^2 + 2(1-x^2) - x = -x^2 - x + 2 for x∈[−1,1]x\in[-1,1]. Maximize g(x)=−x2−x+2g(x)=-x^2-x+2: g′(x)=−2x−1=0⇒x=−12g'(x)=-2x-1=0\Rightarrow x=-\tfrac12, giving g(−12)=−14+12+2=94g(-\tfrac12)= -\tfrac14+\tfrac12+2 = \tfrac{9}{4}. Check endpoints: g(1)=0, g(−1)=2g(1)=0,\ g(-1)=2.

Answer.

max⁡Kf=94 at (−12,±32);min⁡Kf=−14 at (12,0).\boxed{\max_K f = \tfrac{9}{4}\ \text{at } \left(-\tfrac12, \pm\tfrac{\sqrt3}{2}\right);\quad \min_K f = -\tfrac14 \text{ at } (\tfrac12,0).}

Compactness is exactly what licenses the assertion that these extrema exist before we compute them.

Common Misconceptions

⚠️ Common mistake

"Closed and bounded means compact, always." False outside finite-dimensional spaces. The correct general characterization is complete + totally bounded [5]. In Rn\mathbb{R}^n closed ⇒ complete and bounded ⇒ totally bounded, which is why the simpler criterion works there — but this implication "bounded ⇒ totally bounded" fails in infinite dimensions.

⚠️ Common mistake

"Compactness = bounded." Boundedness alone is never enough: (0,1)(0,1) is bounded but not compact. And closedness alone is never enough: [0,∞)[0,\infty) is closed but not compact. You need both in Rn\mathbb{R}^n.

CounterexampleThe closed unit ball in ℓ² is not compact

Let ℓ2\ell^2 be the space of square-summable real sequences with ∥x∥=(∑xi2)1/2\|x\| = (\sum x_i^2)^{1/2}, and let KK be its closed unit ball. Consider the standard basis vectors en=(0,…,0,1,0,… )e_n = (0,\dots,0,1,0,\dots) (the 11 in position nn). Each ∥en∥=1\|e_n\|=1, so en∈Ke_n \in K, and for m≠nm \ne n,

10
∥em−en∥=12+12=2.\quad \|e_m - e_n\| = \sqrt{1^2 + 1^2} = \sqrt 2.

Derivation hint: The two unit entries sit in different coordinates, so the difference has two nonzero components each equal to 11. No subsequence of (en)(e_n) is Cauchy (all pairwise distances are 2\sqrt 2), so none converges. Thus KK is closed and bounded yet not sequentially compact, hence not compact. This shows Heine–Borel genuinely uses finite dimension. (In fact, Riesz's theorem: a normed space has compact closed unit ball iff it is finite-dimensional.)

Connections

connection

Compactness threads through the whole of analysis. Via Sequential Compactness and the Bolzano–Weierstrass Theorem, it guarantees convergent subsequences. It underwrites the Extreme Value Theorem (continuous functions on compact sets attain extrema) and the Uniform Continuity Theorem (continuous on compact ⇒ uniformly continuous). The metric characterization "complete + totally bounded" links it to Completeness of Metric Spaces and Cauchy Sequences. Topologically it generalizes to Tychonoff's Theorem for products and interacts with Connectedness (continuous images of compact connected sets are compact and connected). The failure in infinite dimensions motivates Weak Topologies and Banach–Alaoglu Theorem, the right substitute in functional analysis.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1817 — Bernard Bolzano proves an early version of the least-upper-bound and intermediate-value properties, implicitly using boundedness arguments.
- 1872 — Eduard Heine, building on Dirichlet's lectures, uses the covering/uniform-continuity idea to show continuous functions on closed intervals are uniformly continuous; this is the conceptual seed of "Heine."
- 1872 — Karl Weierstrass and Heine rigorize the real numbers and the notion of limit points (Bolzano–Weierstrass property).
- 1894–1895 — Émile Borel proves, in his thesis and a published paper, that a countable open cover of [a,b][a,b] admits a finite subcover.
- 1900–1904 — Pierre Cousin, Arthur Schoenflies, and Henri Lebesgue extend the result to arbitrary (uncountable) covers; Lebesgue's lectures popularize the modern statement.
- 1906 — Maurice Fréchet introduces abstract metric spaces and the term compact (initially meaning sequentially compact), framing the property abstractly.
- 1914–1924 — Felix Hausdorff and the Polish school formalize topology; the open-cover definition becomes standard, and "compact" is fixed to mean the finite-subcover property.
- 1918 — Frigyes Riesz proves that the closed unit ball is compact iff the normed space is finite-dimensional, pinpointing where Heine–Borel must fail.
- 1930 — Andrey Tychonoff proves arbitrary products of compact spaces are compact, the deepest general compactness theorem.

Subtleties & Limits

open-problem

Compactness has subtle set-theoretic and infinite-dimensional dependencies that remain pedagogically and foundationally delicate:

  • Choice dependence. Tychonoff's theorem (arbitrary products of compacts are compact) is equivalent to the Axiom of Choice. Even the equivalence of "compact" and "sequentially compact" can fail in general topological spaces and depends on countable choice in some metric arguments. Determining the precise choice strength of various compactness statements is the domain of reverse mathematics; many such calibrations are ongoing research.
  • Infinite-dimensional substitutes. Since norm-compactness is too strong in function spaces, one replaces it with weak and weak-\* compactness (Banach–Alaoglu, Eberlein–Šmulian). Characterizing which sets are weakly compact, and how compactness interacts with reflexivity, drives modern functional analysis.
  • Quantitative compactness. Replacing the qualitative finite-subcover property with quantitative measures (entropy numbers, Kolmogorov widths, metric entropy of totally bounded sets) is central to approximation theory and statistical learning; sharp entropy estimates for many natural classes remain open.

See Also

Bolzano–Weierstrass Theorem · Sequential Compactness · Connectedness · Completeness of Metric Spaces · Total Boundedness · Tychonoff's Theorem · Extreme Value Theorem · Riesz's Lemma