Compactness in R^n

Suppose you are told a function is continuous on a set K⊂RnK \subset \mathbb{R}^n. You are asked to prove it attains a maximum value somewhere on KK. If KK is an open ball, this can fail spectacularly. The function might climb forever as you approach the missing boundary. If KK is unbounded, the function might climb forever as you walk off to infinity. Something about KK being closed and bounded simultaneously rescues the argument. Compactness is the precise name for that combination of virtues. Compactness is the property that makes finite reasoning apply to infinite settings. A compact set is one where every sequence of points has a subsequence. That subsequence converges to a point still inside the set. It is also one where every open cover — however wild and infinite — admits a finite subcover. These two descriptions sound unrelated. Yet in Rn\mathbb{R}^n they coincide exactly. Both also coincide exactly with "closed and bounded." This triple equivalence is the Heine–Borel theorem, one of the load-bearing walls of analysis. It underlies the Extreme Value Theorem and uniform continuity. It also underlies the existence of Riemann/Lebesgue integrals on rectangles. Countless compactness arguments in optimization and PDE theory depend on it too. The word "compact" evokes something small and tightly packed. That intuition is correct. A compact set cannot "run away" to infinity. It also cannot have any "holes" at its edge. Sequences cannot escape there without a limit. The Bolzano–Weierstrass theorem powers everything here: every bounded sequence in Rn\mathbb{R}^n has a convergent subsequence. It is where we begin. This article builds the full logical chain. It covers Bolzano–Weierstrass in Rn\mathbb{R}^n, sequential compactness, and the open-cover definition. It also proves that in Rn\mathbb{R}^n, all three characterizations of compactness are equivalent. These are sequential compactness, closed+bounded, and open-cover compactness. We assume familiarity with Open and Closed Sets in R^n. We prepare the ground for Limits and Continuity in Several Variables and Multiple Integrals over Rectangles.

Key takeaways
  • A set K⊂RnK \subset \mathbb{R}^n is sequentially compact if every sequence in KK has a subsequence converging to a point of KK.
  • Bolzano–Weierstrass in Rn\mathbb{R}^n: every bounded sequence in Rn\mathbb{R}^n has a convergent subsequence.
  • Heine–Borel theorem: K⊂RnK \subset \mathbb{R}^n is compact (in any of the equivalent senses below) iff KK is closed and bounded.
  • Compactness also has a topological (open-cover) formulation: every open cover of KK has a finite subcover.
  • In Rn\mathbb{R}^n, sequential compactness, the closed-and-bounded property, and the open-cover property are all logically equivalent.
  • Compactness is exactly the hypothesis needed for continuous functions to attain maxima/minima and to be uniformly continuous.
  • Key idea: in Rn\mathbb{R}^n, compactness is a purely metric fact — "closed and bounded" — but it is best understood through the equivalent lens of sequences having nowhere to escape.

Where this lives today

Compactness is the hidden hypothesis behind the Extreme Value Theorem: a continuous f:K→Rf: K \to \mathbb{R} on a compact K⊂RnK \subset \mathbb{R}^n attains a maximum and minimum, because the image f(K)f(K) is itself compact (a continuous image of a compact set is compact, proved via the sequential characterization), hence closed and bounded, hence contains its supremum and infimum. This single fact underwrites the Limits and Continuity in Several Variables toolkit, guarantees uniform continuity of continuous functions on compact domains (essential for building the Multiple Integrals over Rectangles via Riemann sums), and justifies why Lagrange multiplier problems on closed bounded constraint sets always have solutions to search for. Beyond calculus, compactness drives existence proofs throughout mathematics: in optimization, feasible regions are frequently compact so that minimizers provably exist (linear programming, convex optimization); in differential equations, compactness of trajectory sets underlies Peano's existence theorem and Arzelà–Ascoli-type arguments for PDEs; in numerical analysis, discretizing a compact domain into finitely many patches (exactly the open-cover intuition) underlies mesh-based methods and finite element analysis; in statistics and machine learning, compactness of parameter spaces is a standard regularity condition ensuring maximum-likelihood estimators exist; in cryptography and coding theory, compactness arguments on finite-dimensional lattices and compact groups (like circle groups used in Fourier-based constructions) support existence and approximation results; and in physics, compact phase-space regions (bounded energy surfaces) are what make statistical mechanics' partition-function sums well-behaved.

:::quiz[What goes wrong with sequential compactness for K=(0,1]⊂RK=(0,1]\subset\mathbb{R}?]

  • KK is unbounded, so sequences escape to infinity
  • KK is bounded but not closed; the sequence 1/k1/k has all subsequential limits equal to 0∉K0 \notin K ✓
  • KK has no sequences at all
  • Sequential compactness is undefined for non-closed sets

Ask the tutor: Can you show me why the closed unit ball in an infinite-dimensional space fails to be compact, using the same sequence-escaping idea?

DefinitionCompactness in Rn\mathbb{R}^n: three equivalent formulations

Let K⊂RnK \subset \mathbb{R}^n.

(Sequential compactness.) KK is sequentially compact if every sequence (xk)k=1∞(x_k)_{k=1}^{\infty} with xk∈Kx_k \in K for all kk has a subsequence (xkj)(x_{k_j}) that converges to a point x∗∈Kx^* \in K.

(Open-cover compactness.) A collection U={Uα}α∈A\mathcal{U} = \{U_\alpha\}_{\alpha \in A} of open subsets of Rn\mathbb{R}^n is an open cover of KK if K⊂⋃α∈AUαK \subset \bigcup_{\alpha \in A} U_\alpha. KK is compact if every open cover of KK admits a finite subcover: there exist finitely many indices α1,…,αm∈A\alpha_1, \dots, \alpha_m \in A with

K⊂Uα1∪Uα2∪⋯∪Uαm.K \subset U_{\alpha_1} \cup U_{\alpha_2} \cup \cdots \cup U_{\alpha_m}.

(Metric characterization.) KK is bounded if there exists M>0M > 0 such that ∥x∥≤M\|x\| \le M for all x∈Kx \in K, and KK is closed if Rn∖K\mathbb{R}^n \setminus K is open (equivalently, KK contains all its limit points). The Heine–Borel theorem (proved below) shows that for subsets of Rn\mathbb{R}^n, all three notions — sequential compactness, open-cover compactness, and "closed and bounded" — pick out exactly the same sets. We may therefore speak unambiguously of KK being compact.

Intuition

Picture a sequence of points wandering inside a set KK. If KK is bounded, the points cannot escape to infinity, so intuitively they must "pile up" somewhere — this piling-up is exactly what Bolzano–Weierstrass guarantees, one coordinate at a time. But piling up is not enough: the pile-up point might sit just outside KK, at a missing boundary point, the way 1/k→01/k \to 0 but 0∉(0,1]0 \notin (0,1]. Closedness patches this last hole by insisting that wherever a sequence accumulates, that point belongs to KK. Compactness is the conjunction: no escape to infinity, and no escape through a missing edge. The open-cover definition looks different in flavor — more like a statement about maps or blankets than about sequences — but it is capturing the same finiteness. Think of covering KK with countably many small open patches. If KK is compact, no matter how the patches are chosen, finitely many of them already do the job; there is no need for infinitely many patches to "chase" an escaping point toward a hole or off to infinity. When KK is not compact — say K=(0,1)K = (0,1) — the cover by intervals Uk=(1/k,1)U_k = (1/k, 1) for k=2,3,…k = 2, 3, \dots covers (0,1)(0,1), yet no finite subcollection does, because any finite subcollection has a largest 1/k1/k and misses points below it.

Figure
Escaping sequences and why closed+bounded prevents it
ℝ (0, 1] — sequence xₖ = 1/k escapes through the open end 0 (missing) 1 x₃ x₅ x₁₀ [0, 1] — same sequence, limit 0 now included: compact 0 1 limit point ∈ set ✓

Bolzano–Weierstrass, the metric characterization, and open covers

TheoremBolzano–Weierstrass theorem in Rn\mathbb{R}^n

Every bounded sequence (xk)k=1∞(x_k)_{k=1}^{\infty} in Rn\mathbb{R}^n has a subsequence that converges to some point of Rn\mathbb{R}^n.

Proof

We use the nested-interval bisection method, first for n=1n=1 and then by iterating across coordinates for general nn. Case n=1n = 1. Suppose (xk)(x_k) is a bounded sequence of real numbers, so xk∈[a0,b0]=:I0x_k \in [a_0, b_0] =: I_0 for all kk, for some a0<b0a_0 < b_0. Bisect I0I_0 into two closed halves of equal length. At least one half contains xkx_k for infinitely many indices kk (since the set of all indices is infinite and it splits into the union of the index sets of the two halves — if both were finite their union would be finite, a contradiction). Call that half I1=[a1,b1]I_1 = [a_1,b_1], and note b1−a1=(b0−a0)/2b_1 - a_1 = (b_0-a_0)/2. Repeat: bisect I1I_1, and choose a half I2I_2 containing xkx_k for infinitely many kk, again possible by the same finite-union argument. Inductively construct closed intervals

I0⊃I1⊃I2⊃⋯ ,length(Im)=b0−a02m,I_0 \supset I_1 \supset I_2 \supset \cdots, \qquad \text{length}(I_m) = \frac{b_0 - a_0}{2^m},

each containing xkx_k for infinitely many indices kk. Since the ImI_m are nested closed intervals with lengths tending to 00, the Nested Interval Property of R\mathbb{R} (a consequence of completeness) gives a unique point x∗∈⋂m=0∞Imx^* \in \bigcap_{m=0}^\infty I_m. Now build the subsequence: choose k1k_1 with xk1∈I1x_{k_1} \in I_1. Having chosen k1<k2<⋯<km−1k_1 < k_2 < \cdots < k_{m-1} with xkj∈Ijx_{k_j} \in I_j, use the fact that ImI_m contains xkx_k for infinitely many kk to choose km>km−1k_m > k_{m-1} with xkm∈Imx_{k_m} \in I_m. This is possible at every stage because "infinitely many kk" always leaves room to pick an index larger than the finitely many already used. Then for every mm, both xkmx_{k_m} and x∗x^* lie in ImI_m, so

∣xkm−x∗∣≤length(Im)=b0−a02m→0(m→∞).|x_{k_m} - x^*| \le \text{length}(I_m) = \frac{b_0-a_0}{2^m} \to 0 \quad (m \to \infty).

Hence xkm→x∗x_{k_m} \to x^*, proving the case n=1n=1. Case general nn. Write xk=(xk(1),…,xk(n))x_k = (x_k^{(1)}, \dots, x_k^{(n)}). Since (xk)(x_k) is bounded in Rn\mathbb{R}^n, each coordinate sequence (xk(i))k=1∞(x_k^{(i)})_{k=1}^\infty is a bounded sequence of real numbers (bounded by the same MM, since ∣xk(i)∣≤∥xk∥≤M|x_k^{(i)}| \le \|x_k\| \le M). Apply the n=1n=1 case to the first coordinate: extract a subsequence (xk(1))k∈S1(x_{k}^{(1)})_{k \in S_1} (indices restricted to an infinite subset S1⊂NS_1 \subset \mathbb{N}) converging to some x∗(1)∈Rx^{*(1)} \in \mathbb{R}. Now restrict attention to indices in S1S_1 and apply the n=1n=1 case to the second coordinate sequence (xk(2))k∈S1(x_k^{(2)})_{k \in S_1}, which is still bounded: extract a further infinite subset S2⊂S1S_2 \subset S_1 along which xk(2)→x∗(2)x_k^{(2)} \to x^{*(2)}. Crucially, along S2S_2 the first coordinate still converges to x∗(1)x^{*(1)}, because S2⊂S1S_2 \subset S_1 and every subsequence of a convergent sequence converges to the same limit. Iterate this for coordinates 3,4,…,n3, 4, \dots, n, producing nested infinite index sets

N⊃S1⊃S2⊃⋯⊃Sn,\mathbb{N} \supset S_1 \supset S_2 \supset \cdots \supset S_n,

such that along SnS_n, every coordinate i=1,…,ni = 1, \dots, n converges: xk(i)→x∗(i)x_k^{(i)} \to x^{*(i)} for k∈Snk \in S_n, k→∞k \to \infty. List the elements of SnS_n in increasing order as k1<k2<⋯k_1 < k_2 < \cdots; this defines the desired subsequence (xkj)(x_{k_j}). By definition of convergence in Rn\mathbb{R}^n (coordinatewise convergence, equivalent to convergence in the Euclidean norm since

∥x−x∗∥≤∑i=1n∣x(i)−x∗(i)∣and∣x(i)−x∗(i)∣≤∥x−x∗∥\|x - x^*\| \le \sum_{i=1}^n |x^{(i)} - x^{*(i)}| \quad \text{and} \quad |x^{(i)} - x^{*(i)}| \le \|x - x^*\|

for each ii), we conclude xkj→x∗=(x∗(1),…,x∗(n))x_{k_j} \to x^* = (x^{*(1)}, \dots, x^{*(n)}) as j→∞j \to \infty. ■\blacksquare

∎
TheoremHeine–Borel theorem in Rn\mathbb{R}^n

Let K⊂RnK \subset \mathbb{R}^n. The following are equivalent:

(a) KK is closed and bounded.

(b) KK is sequentially compact.

(c) KK is compact in the open-cover sense: every open cover of KK has a finite subcover.

Proof

We prove (a) ⇒\Rightarrow (b) ⇒\Rightarrow (c) ⇒\Rightarrow (a), closing the logical circle. The technique for (a)⇒\Rightarrow(b) is direct use of Bolzano–Weierstrass plus closedness; for (b)⇒\Rightarrow(c) we use a two-step argument (total boundedness plus a Lebesgue-number-style covering argument); for (c)⇒\Rightarrow(a) we exhibit explicit covers that fail to have finite subcovers when closedness or boundedness is dropped.

(a) ⇒\Rightarrow (b). Assume KK is closed and bounded. Let (xk)(x_k) be any sequence with xk∈Kx_k \in K for all kk. Since KK is bounded, (xk)(x_k) is a bounded sequence in Rn\mathbb{R}^n, so by Bolzano–Weierstrass theorem in Rn\mathbb{R}^n there is a subsequence xkj→x∗x_{k_j} \to x^* for some x∗∈Rnx^* \in \mathbb{R}^n. We must show x∗∈Kx^* \in K. Since KK is closed, Rn∖K\mathbb{R}^n \setminus K is open; if x∗x^* were in Rn∖K\mathbb{R}^n \setminus K, there would be an open ball B(x∗,ε)⊂Rn∖KB(x^*, \varepsilon) \subset \mathbb{R}^n \setminus K. But xkj→x∗x_{k_j} \to x^* means eventually xkj∈B(x∗,ε)x_{k_j} \in B(x^*,\varepsilon), and xkj∈Kx_{k_j} \in K for all jj — a contradiction, since B(x∗,ε)B(x^*,\varepsilon) is disjoint from KK. Hence x∗∈Kx^* \in K, proving sequential compactness.

(b) ⇒\Rightarrow (c). Assume KK is sequentially compact. We argue in two steps. Step 1 (total boundedness). We claim: for every ε>0\varepsilon > 0, KK can be covered by finitely many open balls of radius ε\varepsilon centered at points of KK. Suppose not, for some ε0>0\varepsilon_0 > 0. Then we may construct a sequence (xk)(x_k) in KK inductively as follows: pick x1∈Kx_1 \in K arbitrarily. Having chosen x1,…,xkx_1, \dots, x_k, since (by assumption) the balls B(x1,ε0),…,B(xk,ε0)B(x_1,\varepsilon_0), \dots, B(x_k,\varepsilon_0) do not cover KK, pick xk+1∈K∖⋃i=1kB(xi,ε0)x_{k+1} \in K \setminus \bigcup_{i=1}^k B(x_i, \varepsilon_0). By construction ∥xi−xj∥≥ε0\|x_i - x_j\| \ge \varepsilon_0 for all i≠ji \ne j. Such a sequence has no convergent subsequence, since any subsequence would have all pairwise distances ≥ε0\ge \varepsilon_0, so no subsequence is Cauchy, hence none converges. This contradicts sequential compactness of KK. Hence for every ε>0\varepsilon > 0, KK has a finite ε\varepsilon-net. Step 2 (finite subcover from any open cover). Let U={Uα}α∈A\mathcal{U} = \{U_\alpha\}_{\alpha \in A} be an open cover of KK. Suppose toward contradiction that no finite subcollection of U\mathcal{U} covers KK. By Step 1, for each m∈Nm \in \mathbb{N}, cover KK by finitely many balls of radius 1/m1/m centered at points of KK. If every one of these finitely many balls could be covered by finitely many UαU_\alpha's, then (taking the union of these finite subcollections over all the balls, still a finite union since there are finitely many balls) KK itself would be covered by finitely many UαU_\alpha's, contradicting our assumption. Hence for each mm, at least one ball B(xm,1/m)B(x_m, 1/m) (with xm∈Kx_m \in K) has the property that B(xm,1/m)∩KB(x_m,1/m) \cap K is not covered by any finite subcollection of U\mathcal{U}. This gives a sequence (xm)(x_m) in KK. By sequential compactness, some subsequence xmj→x∗∈Kx_{m_j} \to x^* \in K. Since U\mathcal{U} covers KK, x∗∈Uα0x^* \in U_{\alpha_0} for some α0∈A\alpha_0 \in A; since Uα0U_{\alpha_0} is open, there is ρ>0\rho > 0 with B(x∗,ρ)⊂Uα0B(x^*, \rho) \subset U_{\alpha_0}. Choose jj large enough that ∥xmj−x∗∥<ρ/2\|x_{m_j} - x^*\| < \rho/2 and 1/mj<ρ/21/m_j < \rho/2 simultaneously (possible since xmj→x∗x_{m_j}\to x^* and mj→∞m_j \to \infty along the subsequence). Then for any y∈B(xmj,1/mj)y \in B(x_{m_j}, 1/m_j),

∥y−x∗∥≤∥y−xmj∥+∥xmj−x∗∥<1mj+ρ2<ρ,\|y - x^*\| \le \|y - x_{m_j}\| + \|x_{m_j}-x^*\| < \frac{1}{m_j} + \frac{\rho}{2} < \rho,

so B(xmj,1/mj)⊂B(x∗,ρ)⊂Uα0B(x_{m_j}, 1/m_j) \subset B(x^*,\rho) \subset U_{\alpha_0}. Thus B(xmj,1/mj)∩KB(x_{m_j}, 1/m_j) \cap K is covered by the single set Uα0U_{\alpha_0} — a finite subcollection of U\mathcal{U} — contradicting the defining property of xmjx_{m_j} chosen above. This contradiction shows some finite subcollection of U\mathcal{U} must cover KK after all.

(c) ⇒\Rightarrow (a). Assume KK has the open-cover finite-subcover property. Boundedness. The balls Uk=B(0,k)U_k = B(0,k) for k=1,2,3,…k = 1, 2, 3, \dots form an open cover of Rn\mathbb{R}^n (every point has finite norm, hence lies in some B(0,k)B(0,k)), hence of KK. By hypothesis, finitely many of them cover KK: K⊂B(0,k1)∪⋯∪B(0,km)=B(0,max⁡iki)K \subset B(0,k_1) \cup \cdots \cup B(0,k_m) = B(0,\max_i k_i). Hence KK is bounded. Closedness. Suppose KK is not closed; then there is a limit point p∈Rn∖Kp \in \mathbb{R}^n \setminus K of KK. For each k∈Nk \in \mathbb{N}, let

Uk={x∈Rn:∥x−p∥>1k},U_k = \left\{ x \in \mathbb{R}^n : \|x - p\| > \frac{1}{k} \right\},

an open set (complement of a closed ball). Since p∉Kp \notin K, every x∈Kx \in K satisfies x≠px \ne p, so ∥x−p∥>0\|x-p\| > 0, so x∈Ukx \in U_k for kk large enough; hence {Uk}\{U_k\} is an open cover of KK. If finitely many Uk1,…,UkmU_{k_1}, \dots, U_{k_m} covered KK, then with k∗=max⁡ikik^* = \max_i k_i we'd have K⊂Uk∗={x:∥x−p∥>1/k∗}K \subset U_{k^*} = \{x : \|x-p\| > 1/k^*\}, meaning K∩B(p,1/k∗)=∅K \cap B(p, 1/k^*) = \emptyset. But pp is a limit point of KK, so every ball around pp meets KK at a point other than pp — contradiction. So no finite subcover exists, contradicting hypothesis (c). Hence KK must be closed. ■\blacksquare

∎
CorollaryClosed subsets of compact sets are compact

If K⊂RnK \subset \mathbb{R}^n is compact and F⊂KF \subset K is closed (in Rn\mathbb{R}^n), then FF is compact.

Proof

By the Heine–Borel theorem, KK is closed and bounded. Since F⊂KF \subset K, FF is bounded. Since FF is closed by hypothesis, FF is closed and bounded, hence compact by Heine–Borel. ■\blacksquare

∎

Worked examples

Example 1: A genuinely two-dimensional set, checked all three ways. Let

K={(x,y)∈R2:x2+4y2≤4, y≥x−1}.K = \{(x,y) \in \mathbb{R}^2 : x^2 + 4y^2 \le 4,\ y \ge x - 1\}.

This is the closed elliptical region x2/4+y2≤1x^2/4 + y^2 \le 1 intersected with the closed half-plane y≥x−1y \ge x-1. We verify compactness directly from the definitions, not by quoting Heine–Borel as a black box, to see the machinery work. Closed. The ellipse condition x2+4y2≤4x^2+4y^2 \le 4 describes the sublevel set {f≤4}\{f \le 4\} of the continuous function f(x,y)=x2+4y2f(x,y)=x^2+4y^2; sublevel sets of continuous functions at closed thresholds are closed (preimage of the closed set (−∞,4](-\infty,4] under a continuous map is closed — a fact from Open and Closed Sets in R^n applied via continuity, or directly: if (xk,yk)→(x,y)(x_k,y_k) \to (x,y) with xk2+4yk2≤4x_k^2+4y_k^2 \le 4, then by continuity of ff, x2+4y2=lim⁡f(xk,yk)≤4x^2+4y^2 = \lim f(x_k,y_k) \le 4). Similarly {y≥x−1}\{y \ge x-1\} is closed. An intersection of closed sets is closed (complement is a union of open sets, which is open). Hence KK is closed. Bounded. If (x,y)∈K(x,y) \in K then x2≤4x^2 \le 4 and 4y2≤44y^2 \le 4, so ∣x∣≤2,∣y∣≤1|x|\le 2, |y| \le 1, giving ∥(x,y)∥≤4+1=5\|(x,y)\| \le \sqrt{4+1}=\sqrt5. So KK is bounded, e.g. by M=5M=\sqrt5. By Heine–Borel, KK is compact. Let's also verify sequential compactness directly for a specific sequence to build confidence: take (xk,yk)=(2cos⁡θk, sin⁡θk)(x_k,y_k) = \left(2\cos\theta_k,\ \sin\theta_k\right) where θk\theta_k ranges over points on the boundary satisfying the linear constraint, say θk=π/2−1/k\theta_k = \pi/2 - 1/k for k≥2k \ge 2 (choosing angles that keep us on the boundary of the ellipse, and one checks numerically for these θk\theta_k that yk≥xk−1y_k \ge x_k - 1 holds, e.g. at k=2k=2: θ2=0\theta_2 = 0, point (2,0)(2,0), check 0≥2−1=10 \ge 2-1=1? No — so we must be careful and restrict to θk\theta_k actually inside the feasible arc). Take instead θk=π−1/k\theta_k = \pi - 1/k, so (xk,yk)=(2cos⁡(π−1/k),sin⁡(π−1/k))=(−2cos⁡(1/k),sin⁡(1/k))(x_k,y_k) = (2\cos(\pi - 1/k), \sin(\pi-1/k)) = (-2\cos(1/k), \sin(1/k)). As k→∞k\to\infty, θk→π\theta_k \to \pi, so (xk,yk)→(−2,0)(x_k,y_k) \to (-2, 0). Check (−2,0)∈K(-2,0) \in K: ellipse condition 4+0=4≤44+0=4\le 4 ✓; half-plane condition 0≥−2−1=−30 \ge -2-1=-3 ✓. So the limit is in KK, consistent with compactness. This subsequence (already convergent, so it is its own convergent subsequence) illustrates (b): every sequence drawn from KK has a subsequence converging into KK.

Example 2: A set that fails compactness in two different ways, diagnosed precisely. Let

S={(x,y)∈R2:xy=1, 0<x≤3}.S = \{(x,y) \in \mathbb{R}^2 : xy = 1,\ 0 < x \le 3\}.

This is a piece of the hyperbola y=1/xy = 1/x for x∈(0,3]x \in (0,3]. Is SS bounded? As x→0+x \to 0^+, y=1/x→∞y = 1/x \to \infty, so SS is unbounded — e.g. the points (1/k,k)(1/k, k) for k=1,2,3,…k = 1,2,3,\dots lie in SS (since x=1/k∈(0,3]x=1/k \in (0,3] for k≥1k\ge1) and ∥(1/k,k)∥→∞\|(1/k,k)\| \to \infty. Is SS closed? Consider the sequence zk=(3,1/3)z_k = (3, 1/3)... that's constant and unhelpful; instead probe the open end at x=0x=0: take wk=(1/k,k)w_k = (1/k, k) again — this sequence has no finite limit (it diverges to infinity), so it doesn't witness non-closedness by itself. To test closedness properly, note S={(x,y):xy=1}∩{(x,y):0<x≤3}S = \{(x,y): xy=1\} \cap \{(x,y): 0 < x \le 3\}. The set {0<x≤3}\{0 < x \le 3\} is not closed (it excludes x=0x=0, a limit point of the constraint region), so we must check directly: is there a sequence in SS converging to a point outside SS but still in R2\mathbb{R}^2? Take xk=3+1/k→3+x_k = 3 + 1/k \to 3^+... but 3+1/k≰33+1/k \not\le 3, so those points aren't in SS. Instead approach from inside: xk=3−1/kx_k = 3 - 1/k, giving points (3−1/k, 1/(3−1/k))∈S(3-1/k,\, 1/(3-1/k)) \in S for k≥1k \ge 1 (since 0<3−1/k≤30 < 3-1/k \le 3). As k→∞k \to \infty, this converges to (3,1/3)∈S(3, 1/3) \in S — no violation there. The real failure is at x→0+x \to 0^+: although the sequence (1/k,k)(1/k,k) diverges (doesn't converge in R2\mathbb{R}^2 at all, so it doesn't directly violate the closed-set limit point definition), boundedness fails outright, which alone already prevents compactness by Heine–Borel. To see sequential compactness fail concretely: the sequence xk=(1/k,k)∈Sx_k=(1/k,k) \in S has no convergent subsequence at all (any subsequence still has second coordinate →∞\to \infty, hence unbounded, hence no subsequence can converge in R2\mathbb{R}^2). This directly falsifies condition (b) of the Heine–Borel theorem, consistent with the failure of boundedness (a). Contrast: if we instead take S′={(x,y):xy=1, 1≤x≤3}S' = \{(x,y): xy=1,\ 1\le x \le 3\}, then S′S' is closed (continuous image constraint intersected with a closed interval condition) and bounded (1≤x≤3⇒1/3≤y≤11 \le x \le 3 \Rightarrow 1/3 \le y \le 1), hence compact — the same curve, truncated correctly at both ends, restores compactness. This pair of examples pins down exactly which end of the interval was doing the damage.

CounterexampleBoundedness cannot be dropped — sequential compactness fails

The Heine–Borel theorem requires both closedness and boundedness. Here we drop boundedness alone and keep closedness, to show sequential compactness genuinely fails — not just that Heine–Borel's proof stops working, but that the conclusion is false. Let K=RnK = \mathbb{R}^n itself (closed, since its complement ∅\emptyset is open, but manifestly unbounded), or more simply in R1\mathbb{R}^1 let K=[0,∞)K = [0, \infty). KK is closed: if xk∈[0,∞)x_k \in [0,\infty) and xk→xx_k \to x, then x≥0x \ge 0 (a strict inequality x<0x<0 would put xkx_k within ∣x∣|x| of a negative number for large kk, forcing xk<0x_k<0, contradiction), so x∈Kx \in K. KK is not bounded. Consider the sequence xk=kx_k = k for k=1,2,3,…k=1,2,3,\dots, entirely contained in KK. Any subsequence (xkj)(x_{k_j}) satisfies xkj=kj→∞x_{k_j} = k_j \to \infty as j→∞j \to \infty (since kj≥jk_j \ge j, being a strictly increasing sequence of positive integers). No subsequence converges to any real number: convergence would require the subsequence to be bounded, but kj→∞k_j \to \infty. Hence KK has a sequence with no convergent subsequence at all, so KK is not sequentially compact, even though KK is closed. This shows closedness alone is insufficient; boundedness is doing indispensable work, precisely by ruling out sequences that escape to infinity. Symmetrically, one can drop closedness and keep boundedness — e.g. K=(0,1)K=(0,1), where xk=1/kx_k=1/k has every subsequence converging only to 0∉K0 \notin K — showing boundedness alone is also insufficient. Both hypotheses are load-bearing.

Scope, edge cases & common traps

SituationCompact?Reason
Closed ball B‾(0,r)\overline{B}(0,r), any r>0r>0YesClosed and bounded
Open ball B(0,r)B(0,r)NoBounded but not closed
A single point {p}\{p\}YesTrivially closed and bounded
Finite union of compact setsYesBounded by max of the bounds; closed as finite union of closed sets
Zn⊂Rn\mathbb{Z}^n \subset \mathbb{R}^nNoClosed but unbounded
Qn∩[0,1]n\mathbb{Q}^n \cap [0,1]^nNoBounded but not closed (limit points like 2/2\sqrt2/2 escape)
Empty set ∅\emptysetYes (vacuously)Vacuously closed, bounded, and every cover has the empty finite subcover
Graph of continuous f:[a,b]→Rf:[a,b]\to\mathbb{R}YesContinuous image of a compact set is compact

The mathematician behind it

Origins · 1 minBernard Bolzano and how this was discovered
BB
Bernard Bolzano
1781–1848 · Bohemia, early rigorous analysis

Bolzano, a priest and philosopher-mathematician working in Prague, anticipated much of the rigor that later analysts (Cauchy, Weierstrass) are credited with. He gave an early proof of what we now call the intermediate value theorem and articulated versions of the accumulation-point principle behind Bolzano–Weierstrass decades before Weierstrass's own lectures popularized it, though his work circulated slowly and was not widely recognized in his lifetime.

History
- 1817 — Bolzano proves an early rigorous form of the Intermediate Value Theorem and studies accumulation points of bounded sets.
- 1860s — Karl Weierstrass, in his Berlin lectures, independently develops and popularizes the theorem on convergent subsequences of bounded sequences, cementing the "Bolzano–Weierstrass" name.
- 1872 — Eduard Heine uses covering arguments to study uniform continuity on closed bounded intervals, an early precursor of the covering formulation of compactness.
- 1895 — Émile Borel proves that a countable open cover of a closed bounded interval admits a finite subcover, in the context of measure theory.
- 1900s–1920s — Henri Lebesgue, Maurice Fréchet, and Felix Hausdorff generalize covering compactness to general metric and topological spaces, revealing the Heine–Borel property as one special (Euclidean) instance of a much broader phenomenon.
Why does "closed and bounded" only characterize compactness in Rn\mathbb{R}^n, and not in general metric spaces?

Heine–Borel is a special feature of finite-dimensional Euclidean space. The proof crucially uses Bolzano–Weierstrass, which itself rests on the completeness of R\mathbb{R} via nested intervals, iterated finitely many times across the nn coordinates. In infinite-dimensional normed spaces (like spaces of functions), closed and bounded sets can fail to be compact — the closed unit ball in an infinite-dimensional Hilbert or Banach space is never compact, because you can always construct a sequence of unit vectors with no convergent subsequence (e.g. an orthonormal sequence, all pairwise distances 2\sqrt2). So "closed and bounded implies compact" genuinely depends on finite dimension; in general metric spaces, one must instead work directly with sequential compactness or total boundedness plus completeness.

Is sequential compactness the same as the open-cover definition in every metric space, or only in Rn\mathbb{R}^n?

They coincide in every metric space, not just Rn\mathbb{R}^n — that equivalence (sequential compactness   ⟺  \iff open-cover compactness) is a general metric space theorem, proved by the same total-boundedness argument used in this article. What is special to Rn\mathbb{R}^n is the further equivalence with "closed and bounded," which fails in infinite-dimensional metric spaces, as the previous FAQ explains. So the article's three-way equivalence has two universal legs (sequential   ⟺  \iff open-cover) and one Euclidean-specific leg (either   ⟺  \iff closed and bounded).

Does compactness require the set to be connected, like an interval or disk?

No. Compactness has nothing to do with connectedness. A finite set of isolated points, such as {(0,0),(1,1),(5,−2)}\{(0,0), (1,1), (5,-2)\}, is compact (it's closed, since finite sets have no limit points to miss, and bounded), yet wildly disconnected. Conversely, connected sets can fail to be compact, like the open interval (0,1)(0,1), which is connected but not compact. Compactness and connectedness are independent topological properties that happen to both be preserved under continuous images, which is why they're often discussed together, but neither implies the other.

Why is the finite subcover property useful if every compact set already has the simpler closed-and-bounded description in Rn\mathbb{R}^n?

Because many important theorems are most naturally proved using the open-cover formulation, even in Rn\mathbb{R}^n, and this formulation generalizes to settings (topological spaces) where "bounded" doesn't even make sense. For instance, the proof that continuous images of compact sets are compact, or that continuous functions on compact sets are uniformly continuous, is often cleanest via covers: build an open cover from the continuity hypothesis at each point, then extract a finite subcover to get a single uniform bound or modulus of continuity. The closed-and-bounded description is a wonderful computational test, but the open-cover description is often the better proof engine.

How do I actually check compactness for a set defined by inequalities, in practice?

For a set given by inequalities involving continuous functions, like K={x∈Rn:g1(x)≤0,…,gm(x)≤0}K = \{x \in \mathbb{R}^n : g_1(x) \le 0, \dots, g_m(x) \le 0\} with each gig_i continuous, closedness is usually free: each {gi≤0}\{g_i \le 0\} is closed as a preimage of the closed set (−∞,0](-\infty,0] under a continuous function, and a finite intersection of closed sets is closed. The real work is checking boundedness, typically by finding an explicit bound (as in the worked ellipse example) or by showing the defining inequalities force each coordinate into a bounded range. If you can show K⊂[−M,M]nK \subset [-M,M]^n for some MM, boundedness is done, and Heine–Borel finishes the job.

What is a "Lebesgue number" and why did it appear implicitly in the proof?

A Lebesgue number for an open cover U\mathcal{U} of a sequentially compact set KK is a number δ>0\delta>0 such that every subset of KK with diameter less than δ\delta is entirely contained in some single Uα∈UU_\alpha \in \mathcal{U}. The proof of (b)⇒\Rightarrow(c) in this article essentially constructs such a δ\delta implicitly, via the contradiction argument with balls B(xm,1/m)B(x_m,1/m): it shows that if no finite subcover existed, we could find arbitrarily small balls escaping every single member of the cover, which is precisely the failure of a Lebesgue number to exist. The Lebesgue number lemma is often stated as a standalone tool because it is useful well beyond Heine–Borel, for instance in proving uniform continuity directly.

Does compactness in Rn\mathbb{R}^n depend on which norm we use — Euclidean, max-norm, or sum-norm?

No, and this is a special and useful fact about finite dimensions: all norms on Rn\mathbb{R}^n are equivalent, meaning for any two norms ∥⋅∥a,∥⋅∥b\|\cdot\|_a, \|\cdot\|_b there are constants 0<c≤C0<c\le C with c∥x∥a≤∥x∥b≤C∥x∥ac\|x\|_a \le \|x\|_b \le C\|x\|_a for all xx. Equivalent norms generate exactly the same open sets, the same convergent sequences, and hence the same bounded sets and the same compact sets. So whether you check boundedness using ∥x∥2=∑xi2\|x\|_2 = \sqrt{\sum x_i^2}, ∥x∥∞=max⁡i∣xi∣\|x\|_\infty = \max_i |x_i|, or ∥x∥1=∑∣xi∣\|x\|_1 = \sum|x_i|, you get the identical verdict on compactness — a convenience that fails in infinite dimensions, where inequivalent norms can disagree about which sets are compact.

Before this

Where this leads