Compactness — Heine-Borel and Bolzano-Weierstrass

⚡ Key Takeaways

Compactness is a topological property generalizing "closed and bounded." For subsets of Rn\mathbb{R}^n, the Heine–Borel theorem says compact = closed and bounded, while the Bolzano–Weierstrass theorem says every bounded sequence has a convergent subsequence. These results are the cornerstone of real analysis, guaranteeing maxima, uniform continuity, and the convergence machinery used throughout calculus, optimization, and differential equations. Named for Eduard Heine, Émile Borel, Bernard Bolzano, and Karl Weierstrass (1817–1895).

💡 The Core Insight

Compactness is finiteness in disguise. A compact set is one where any attempt to cover it with infinitely many open pieces always over-covers — finitely many already suffice. Equivalently, no sequence can "escape" — there is always a cluster point inside. This bridges the local (open sets, neighborhoods) and the global (the whole set), letting analysis trade unbounded processes for finite, manageable ones.

Formal Statement

DefinitionOpen Cover and Compactness

Let (X,d)(X,d) be a metric space (or any topological space) and K⊆XK \subseteq X. 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 cover element. A finite subcover is a finite subcollection Uα1,…,UαnU_{\alpha_1},\dots,U_{\alpha_n} with

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

Derivation hint: choose finitely many indices α1,…,αn∈A\alpha_1,\dots,\alpha_n \in A that still cover KK. KK is compact if every open cover of KK has a finite subcover. Here AA is an arbitrary (possibly uncountable) index set.

DefinitionBoundedness, Closedness, Sequential Compactness

K⊆RnK \subseteq \mathbb{R}^n is bounded if it fits inside some ball:

3
∃M>0:∥x∥≤M  for all x∈K.\quad \exists M > 0 : \quad \|x\| \le M \ \ \text{for all } x \in K.

Derivation hint: MM is any radius enclosing KK; equivalently diam⁡(K)<∞\operatorname{diam}(K) < \infty. KK is closed if it contains all its limit points: whenever xk∈Kx_k \in K and xk→xx_k \to x, then x∈Kx \in K. KK is sequentially compact if every sequence (xk)k≥1(x_k)_{k\ge1} in KK has a subsequence (xkj)(x_{k_j}) converging to some limit L∈KL \in K:

4
∀(xk)⊆K ∃ (xkj), L∈K:lim⁡j→∞xkj=L.\quad \forall (x_k)\subseteq K\ \exists\, (x_{k_j}),\ L\in K:\quad \lim_{j\to\infty} x_{k_j}=L.

Derivation hint: extract indices k1<k2<⋯k_1<k_2<\cdots so the resulting subsequence has a limit inside KK.

TheoremHeine–Borel

A subset K⊆RnK \subseteq \mathbb{R}^n is compact if and only if it is closed and bounded.

5
K compact  ⟺  K closed ∧ K bounded.\quad K \text{ compact} \iff K \text{ closed} \ \wedge\ K \text{ bounded}.

Derivation hint: the forward direction holds in any metric space; the converse uses the completeness and finite-dimensionality of Rn\mathbb{R}^n.

TheoremBolzano–Weierstrass

Every bounded sequence in Rn\mathbb{R}^n has a convergent subsequence. Consequently, a subset K⊆RnK\subseteq\mathbb{R}^n is compact iff it is sequentially compact. In a general metric space:

6
K compact  ⟺  K sequentially compact  ⟺  K complete and totally bounded.\quad K \text{ compact} \iff K \text{ sequentially compact} \iff K \text{ complete and totally bounded}.

Derivation hint: in metric spaces the three notions coincide; "totally bounded" replaces "bounded" once you leave Rn\mathbb{R}^n.

Why It Holds / Derivation

ProofBolzano–Weierstrass in R\mathbb{R} via bisection

We show every bounded real sequence (xk)(x_k) has a convergent subsequence.

Step 1. Since (xk)(x_k) is bounded, all terms lie in an interval I0=[a0,b0]I_0=[a_0,b_0] of length L=b0−a0L=b_0-a_0.

Step 2. Bisect I0I_0 into two halves. At least one half contains xkx_k for infinitely many indices kk; call it I1=[a1,b1]I_1=[a_1,b_1], of length L/2L/2.

Step 3. Repeat. Inductively obtain nested intervals

7
I0⊇I1⊇I2⊇⋯ ,∣In∣=L2n,\quad I_0 \supseteq I_1 \supseteq I_2 \supseteq \cdots,\qquad |I_n| = \frac{L}{2^n},

Derivation hint: each bisection halves the length and keeps the half containing infinitely many terms. each containing infinitely many terms of the sequence.

Step 4. By the Nested Interval Property (a form of completeness of R\mathbb{R}),

8
⋂n=0∞In={L∗}\quad \bigcap_{n=0}^{\infty} I_n = \{L^*\}

Derivation hint: lengths →0\to 0 and the intervals are nested, so the intersection is a single point L∗L^*. is a single point.

Step 5. Build the subsequence greedily: choose k1k_1 with xk1∈I1x_{k_1}\in I_1; having chosen kjk_j, pick kj+1>kjk_{j+1}>k_j with xkj+1∈Ij+1x_{k_{j+1}}\in I_{j+1} (possible because Ij+1I_{j+1} holds infinitely many terms). Then ∣xkj−L∗∣≤∣Ij∣=L/2j→0|x_{k_j}-L^*|\le |I_j| = L/2^j \to 0, so xkj→L∗x_{k_j}\to L^*. ■\blacksquare For Rn\mathbb{R}^n, apply the result coordinate-by-coordinate: extract a subsequence convergent in coordinate 1, then a further subsequence convergent in coordinate 2, and so on through coordinate nn.

∎
ProofHeine–Borel, both directions

(⇒) Compact ⟹ closed and bounded. Bounded: The balls {B(0,m)}m∈N\{B(0,m)\}_{m\in\mathbb{N}} form an open cover of KK. A finite subcover is contained in the largest ball B(0,M)B(0,M), so K⊆B(0,M)K\subseteq B(0,M) is bounded. Closed: Suppose x∉Kx\notin K. For each y∈Ky\in K let ry=12d(x,y)>0r_y=\tfrac12 d(x,y)>0. The balls {B(y,ry)}y∈K\{B(y,r_y)\}_{y\in K} cover KK; take a finite subcover B(y1,ry1),…,B(ym,rym)B(y_1,r_{y_1}),\dots,B(y_m,r_{y_m}). Set δ=min⁡iryi>0\delta=\min_i r_{y_i}>0. Then B(x,δ)B(x,\delta) misses all those balls, hence misses KK, so xx is not a limit point. Thus the complement of KK is open and KK is closed.

(⇐) Closed and bounded ⟹ compact (for Rn\mathbb{R}^n).

Step 1 — the box is compact. First show a closed box Q0=[a,b]nQ_0=[a,b]^n is compact, by contradiction. Suppose U\mathcal{U} is an open cover of Q0Q_0 with no finite subcover. Bisect each edge to split Q0Q_0 into 2n2^n sub-boxes. At least one sub-box Q1Q_1 has no finite subcover. Iterate to get nested boxes

9
Q0⊇Q1⊇⋯ ,diam⁡(Qk)=diam⁡(Q0)2k→0,\quad Q_0 \supseteq Q_1 \supseteq \cdots, \qquad \operatorname{diam}(Q_k)=\frac{\operatorname{diam}(Q_0)}{2^k}\to 0,

Derivation hint: each step halves the diameter; "no finite subcover" passes to at least one child by pigeonhole. none admitting a finite subcover.

Step 2. By completeness, ⋂kQk={p}\bigcap_k Q_k=\{p\} for a single point pp. Since U\mathcal{U} covers Q0Q_0, some U∈UU\in\mathcal{U} contains pp, and being open, U⊇B(p,ε)U\supseteq B(p,\varepsilon) for some ε>0\varepsilon>0.

Step 3. For kk large, diam⁡(Qk)<ε\operatorname{diam}(Q_k)<\varepsilon and p∈Qkp\in Q_k, so Qk⊆B(p,ε)⊆UQ_k\subseteq B(p,\varepsilon)\subseteq U. Then {U}\{U\} alone is a finite subcover of QkQ_k — contradicting its choice. Hence Q0Q_0 is compact.

Step 4 — closed subset of compact is compact. Let KK be closed and bounded; then K⊆Q0K\subseteq Q_0 for some box. Given an open cover U\mathcal{U} of KK, add the open set X∖KX\setminus K to get an open cover of Q0Q_0. Extract a finite subcover; discarding X∖KX\setminus K leaves finitely many elements of U\mathcal{U} covering KK. ■\blacksquare

∎
Figure
Bisection argument: nested boxes shrink onto a single point, trapped inside one cover element UU
Q0 Q1 Q2 p U ⊇ B(p,ε) Boxes shrink: diam(Qk) → 0, eventually Qk ⊂ U
KW
Karl Weierstrass
1815–1897

Weierstrass, the "father of modern analysis," made rigor the law of calculus. Working largely from lecture notes (he published little), he supplied the ε\varepsilon–δ\delta definitions that tamed limits, constructed the famous everywhere-continuous nowhere-differentiable function, and proved that a continuous function on a closed bounded interval attains its maximum and minimum — the Extreme Value Theorem, a direct child of compactness. The Bolzano–Weierstrass theorem bears his name because he rediscovered and disseminated, with full rigor, the cluster-point principle that Bolzano had stated decades earlier in relative obscurity.

Building Intuition

🧠 Intuition

Think of compactness as "no room to run and no place to leak."

  • Bounded stops a sequence from running to infinity.
  • Closed stops a sequence from leaking out through a missing boundary point.

Remove either and points can escape. The open interval (0,1)(0,1) is bounded but not closed: the sequence 1/k1/k tries to converge to 00, but 00 has leaked out. The set [0,∞)[0,\infty) is closed but not bounded: the sequence 1,2,3,…1,2,3,\dots runs away. Only when both walls are up does every sequence get cornered into a cluster point that stays inside. The open-cover view says the same thing dually: if you try to tile a compact set with infinitely many small open patches, you always waste effort — finitely many already overlap to cover it. Non-compact sets defeat this: cover (0,1)(0,1) by (1/n, 1)(1/n,\,1) for n=2,3,…n=2,3,\dots; no finite subfamily reaches the points near 00.

Worked Examples

ExampleThe closed unit ball in R3\mathbb{R}^3 is compact

Given: K={x∈R3:∥x∥≤1}K=\{x\in\mathbb{R}^3 : \|x\|\le 1\}.

Step 1 — bounded: Every x∈Kx\in K satisfies ∥x∥≤1\|x\|\le 1, so M=1M=1 works in equation [3]. ✔

Step 2 — closed: The map x↦∥x∥x\mapsto\|x\| is continuous, and K={x:∥x∥≤1}K=\{x : \|x\|\le 1\} is the preimage of the closed set [0,1][0,1], hence closed. If xk∈Kx_k\in K and xk→xx_k\to x, then ∥x∥=lim⁡∥xk∥≤1\|x\|=\lim\|x_k\|\le 1, so x∈Kx\in K. ✔

Step 3 — apply Heine–Borel [5]: Closed and bounded in R3⇒\mathbb{R}^3 \Rightarrow compact.

K=B‾(0,1)⊆R3 is compact.\boxed{K=\overline{B}(0,1)\subseteq\mathbb{R}^3 \text{ is compact.}}

(Contrast: the open ball ∥x∥<1\|x\|<1 is bounded but not closed, hence not compact — the sequence xk=(1−1/k,0,0)x_k=(1-1/k,0,0) converges to the boundary point (1,0,0)∉(1,0,0)\notin open ball.)

ExampleExtracting a convergent subsequence numerically

Given: the bounded sequence xk=sin⁡(k)x_k=\sin(k), k=1,2,3,…k=1,2,3,\dots, all lying in [−1,1][-1,1].

Goal: confirm Bolzano–Weierstrass produces a convergent subsequence and estimate a limit.

Step 1 — boundedness: ∣xk∣=∣sin⁡k∣≤1|x_k|=|\sin k|\le 1, so the sequence lives in the compact set [−1,1][-1,1]. By [6] a convergent subsequence exists.

Step 2 — bisection in action: Split [−1,1][-1,1] at 00. Computing terms: sin⁡1≈0.841, sin⁡2≈0.909, sin⁡3≈0.141, sin⁡6≈−0.279, sin⁡19≈0.150, sin⁡22≈−0.0089, sin⁡44≈0.0177\sin 1\approx0.841,\ \sin 2\approx0.909,\ \sin 3\approx0.141,\ \sin 6\approx-0.279,\ \sin 19\approx0.150,\ \sin 22\approx-0.0089,\ \sin 44\approx0.0177. Infinitely many terms accumulate near 00 (whenever kk is close to a multiple of π\pi).

Step 3 — identify a cluster point: Because k  πk \bmod \pi is equidistributed (Weyl), the values sin⁡k\sin k are dense in [−1,1][-1,1]; in particular some subsequence xkj→0x_{k_j}\to 0. Indices like k=3,22,333,355,…k=3,22,333,355,\dots (good rational approximations to multiples of π\pi) give sin⁡kj\sin k_j ever closer to 00.

A subsequence xkj=sin⁡(kj)→0; indeed every L∈[−1,1] is a subsequential limit.\boxed{\text{A subsequence } x_{k_j}=\sin(k_j)\to 0;\ \text{indeed every } L\in[-1,1]\text{ is a subsequential limit.}}

Common Misconceptions

⚠️ Common mistake

"Closed and bounded always means compact." This is only true in finite-dimensional normed spaces. In an infinite-dimensional space (e.g. ℓ2\ell^2 or C[0,1]C[0,1]) the closed unit ball is closed and bounded but not compact. The standard basis vectors en=(0,…,0,1,0,… )e_n=(0,\dots,0,1,0,\dots) satisfy ∥en∥=1\|e_n\|=1 and ∥en−em∥=2\|e_n-e_m\|=\sqrt2 for n≠mn\ne m, so no subsequence is Cauchy — sequential compactness fails. Heine–Borel is a privilege of Rn\mathbb{R}^n.

⚠️ Common mistake

"Compactness is a property of the set alone." Compactness depends on the subspace topology but is intrinsic: a set is compact or not regardless of ambient space. However, closed and bounded are not intrinsic in the same way — (0,1)(0,1) is closed in itself yet not compact. Always check compactness via covers or sequences, not via "closed" applied to the wrong ambient space.

CounterexampleTotal boundedness is essential, not mere boundedness

In a general metric space, bounded ≠ totally bounded. Take an infinite set XX with the discrete metric d(x,y)=1d(x,y)=1 for x≠yx\ne y. Then XX has diameter 11 (bounded) and is closed and complete. But the cover by singleton balls {B(x,12)}={{x}}\{B(x,\tfrac12)\}=\{\{x\}\} has no finite subcover when XX is infinite. So XX is bounded and complete yet not compact — it fails to be totally bounded. This shows why [6] upgrades "bounded" to "totally bounded" outside Rn\mathbb{R}^n.

Connections

connection

Compactness is the engine behind several pillars of analysis. Via Continuity, it gives the Extreme Value Theorem (continuous image of a compact set is compact, hence attains max/min) and Heine–Cantor uniform continuity. It underlies Uniform Convergence through Dini's theorem and the Arzelà–Ascoli criterion, which characterizes compact sets of functions via equicontinuity. In Metric Spaces it equals "complete + totally bounded"; in general Topological Spaces it is defined purely by open covers, splitting from sequential compactness. It feeds Connectedness (both are "global" topological invariants preserved by continuous maps) and supports Completeness of the Real Numbers, since the Nested Interval Property used in the proofs is itself a completeness axiom.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1817 — Bernard Bolzano states and proves a version of the intermediate value theorem, implicitly using the least-upper-bound property and the cluster-point principle now called Bolzano–Weierstrass.
- 1865–1880s — Karl Weierstrass, in Berlin lectures, rigorously establishes that bounded sequences have convergent subsequences and that continuous functions on closed intervals attain extrema, popularizing ε\varepsilon–δ\delta rigor.
- 1872 — Eduard Heine publishes results on uniform continuity, using the covering idea for closed bounded intervals (the seed of Heine–Borel).
- 1894–1895 — Émile Borel proves that a countable open cover of a closed bounded interval has a finite subcover, in his thesis on measure and function theory.
- 1900s — Henri Lebesgue and Pierre Cousin extend Borel's covering theorem to arbitrary (uncountable) covers; the result becomes the modern Heine–Borel theorem.
- 1906 — Maurice Fréchet introduces metric spaces and the general notion of compactness (compacité), framing sequential compactness abstractly.
- 1914 — Felix Hausdorff systematizes topological spaces; the open-cover definition of compactness gains its general home.
- 1923–1929 — Pavel Alexandrov and Pavel Urysohn develop bicompactness (today's "compactness") and prove key theorems (e.g. compactness via filters/nets later by Cartan, Bourbaki).
- 1930 — Andrey Tychonoff proves arbitrary products of compact spaces are compact (Tychonoff's theorem), the deepest general result, equivalent to the Axiom of Choice.

Subtleties & Limits

open-problem

Several boundaries of compactness reveal deep structure rather than unsolved problems, but they remain conceptually subtle:

  • Compactness vs. sequential compactness diverge in general topological spaces. There exist compact spaces (e.g. [0,1][0,1][0,1]^{[0,1]}, the product of continuum-many copies of [0,1][0,1]) that are not sequentially compact, and sequentially compact spaces that are not compact (e.g. the first uncountable ordinal [0,ω1)[0,\omega_1)). Only for metric spaces do the two coincide.
  • Tychonoff's theorem and the Axiom of Choice. The statement "every product of compact spaces is compact" is equivalent to the Axiom of Choice (Kelley, 1950). Restricting to Hausdorff factors weakens it to the (strictly weaker) Boolean Prime Ideal theorem. Thus the strength of compactness in infinite products is entangled with the foundations of set theory.
  • Characterizing compact sets in function spaces is delicate and ongoing in applications: the Arzelà–Ascoli (equicontinuity) and Kolmogorov–Riesz (in LpL^p) criteria solve special cases, but identifying compact subsets of more exotic spaces drives current functional analysis.

See Also

Metric Spaces · Completeness of the Real Numbers · Connectedness · Uniform Convergence · Extreme Value Theorem · Topological Spaces · Arzelà–Ascoli Theorem · Tychonoff's Theorem