Compact Spaces and Open Covers

Can a space be "small" even if it contains infinitely many points? These points may spread across an unbounded set of directions. Compactness is the topological answer to this question. It is arguably the single most useful finiteness condition in all of analysis and geometry. The idea generalizes an elementary fact. A closed bounded interval [0,1][0,1] behaves like a finite set for many purposes. Every sequence has a convergent subsequence. Every continuous function attains a maximum. Every open cover can be trimmed to finitely many pieces without losing coverage. This last property, phrased purely in terms of open sets, is the modern definition of compactness. It is the one that transports cleanly to arbitrary topological spaces. In such spaces, notions like "bounded" make no sense at all. The open-cover definition looks abstract at first. But it is exactly the right level of generality. It makes no reference to a metric, a norm, or even to sequences. Yet it recovers every classical theorem about closed bounded subsets of Rn\mathbb{R}^n as a special case. This recovery is the content of the Heine-Borel Theorem. It also behaves beautifully under the basic operations of topology. Continuous images, closed subspaces, finite unions, and (with real effort) arbitrary products all preserve compactness. This robustness is why compactness, rather than boundedness or finiteness, is the concept that survives. It survives the passage from Euclidean space to general topological and even non-metrizable spaces. The strategy of this article is to build the definition from first principles. We will prove the core closure properties carefully. These include subspaces of compact spaces, continuous images, and — crucially — compact subsets of Hausdorff spaces are closed. We show exactly where each hypothesis is load-bearing. We do this by breaking the theorems when a hypothesis is dropped. Along the way we will connect open covers to the more familiar picture of "closed and bounded." We also lay the groundwork for the deeper results that follow: sequential compactness, the finite intersection property, and the Tychonoff theorem on infinite products. By the end you should be able to state the open-cover definition of compactness precisely. You should be able to prove the basic permanence properties from scratch. You should also be able to explain — with a concrete counterexample — why each hypothesis (such as the Hausdorff condition) cannot simply be dropped.

Key takeaways
  • Compactness means: every open cover has a finite subcover — a purely topological finiteness condition.
  • It generalizes "closed and bounded," but is phrased with no reference to a metric or distance.
  • Continuous images of compact spaces are compact (compactness is a topological, not metric, invariant).
  • Closed subspaces of compact spaces are compact; the converse needs the Hausdorff axiom.
  • In a Hausdorff space, compact subsets are automatically closed — a genuinely deep fact, not a tautology.
  • Key idea: compactness lets you replace "infinitely many open sets" with "finitely many," turning infinite problems into finite ones.

Where this lives today

Compactness is the load-bearing finiteness hypothesis across mathematics and its applications. In real and functional analysis, it underlies the extraction of convergent subsequences (via Sequential Compactness) used in existence proofs for differential equations and in the calculus of variations. In differential geometry, compact manifolds have finite volume, finite fundamental groups in favorable cases, and support globally-defined extremal problems (geodesics realizing minimal distance, curvature bounds via Bonnet–Myers). In complex analysis, compactness of closed bounded regions underlies the maximum modulus principle's practical use and Montel's theorem on normal families. In algebraic topology and algebraic geometry, compact (or "proper") spaces allow intersection numbers and degrees to be well-defined finite quantities rather than divergent sums. In optimization and control theory, compactness of feasible regions is precisely the hypothesis that guarantees a continuous cost function attains a minimum — the abstract content of the corollary proved above. In computer science and logic, compactness of certain topological spaces of models (Stone spaces) underlies the model-theoretic compactness theorem for first-order logic, and finite-subcover arguments appear directly in proofs of correctness for covering-based algorithms. In physics, compact configuration or momentum spaces (such as compactified extra dimensions in string theory) rely on exactly the same open-cover finiteness to ensure well-posed path integrals and spectral decompositions.

Ask the tutor: Why does the Heine–Borel theorem fail for the closed unit ball in an infinite-dimensional normed space?

DefinitionCompact Space

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

X=⋃α∈AUα.X = \bigcup_{\alpha \in A} U_\alpha.

More generally, if Y⊆XY \subseteq X, an open cover of YY is a collection {Uα}α∈A\{U_\alpha\}_{\alpha \in A} of open subsets of XX with Y⊆⋃α∈AUαY \subseteq \bigcup_{\alpha \in A} U_\alpha. A subcover of an open cover U\mathcal{U} is a subcollection U′⊆U\mathcal{U}' \subseteq \mathcal{U} that is still an open cover. The space XX is compact if every open cover of XX admits a finite subcover: for every open cover {Uα}α∈A\{U_\alpha\}_{\alpha \in A} of XX, there exist finitely many indices α1,…,αn∈A\alpha_1, \dots, \alpha_n \in A such that

X=Uα1∪Uα2∪⋯∪Uαn.X = U_{\alpha_1} \cup U_{\alpha_2} \cup \cdots \cup U_{\alpha_n}.

A subset Y⊆XY \subseteq X is compact if YY is compact when given the Subspace Topology inherited from XX.

Intuition

Think of an open cover as a collection of "flashlights," each illuminating some open region of the space, with every point of the space lit by at least one flashlight. Compactness says you can always find a finite set of flashlights that still lights up the whole space, no matter how the cover was chosen. This is a strong, non-obvious constraint: it must hold for every open cover, including deliberately adversarial ones designed to need infinitely many pieces. The classic non-example is the open interval (0,1)(0,1). Cover it by the sets Un=(1/n,1)U_n = (1/n, 1) for n=2,3,4,…n = 2, 3, 4, \dots. Each point of (0,1)(0,1) lies in some UnU_n, so this is a genuine open cover, but no finite subcollection covers (0,1)(0,1): a finite union of these sets is just the largest one, UN=(1/N,1)U_N = (1/N, 1), which misses the points near 00. This single cover is the reason (0,1)(0,1) fails to be compact — it is "open at one end," and the open cover can chase that missing endpoint forever. Contrast this with [0,1][0,1]: no matter how you cover it by open sets, the compactness of [0,1][0,1] (proved via the Heine-Borel Theorem) guarantees a finite subcover always exists, precisely because [0,1][0,1] contains both of its endpoints and has no "missing point" for an open cover to approach without ever reaching.

Figure
The cover Un=(1/n,1)U_n=(1/n,1) of (0,1)(0,1) has no finite subcover: finitely many UnU_n still miss points near 00
0 1 U₂ U₄ U₈ as n → ∞, Uₙ = (1/n, 1) creeps toward 0 but no finite union U₂∪U₄∪⋯∪Uₙ reaches 0 gap left uncovered by any finite subcover
TheoremBasic Closure Properties of Compactness

Let X,YX, Y be topological spaces.

(a) Closed subspaces. If XX is compact and C⊆XC \subseteq X is closed, then CC is compact.

(b) Continuous images. If XX is compact and f:X→Yf : X \to Y is continuous, then f(X)f(X) is compact.

(c) Compact subsets of Hausdorff spaces are closed. If XX is Hausdorff and K⊆XK \subseteq X is compact, then KK is closed in XX.

(d) Finite unions. If K1,…,Kn⊆XK_1, \dots, K_n \subseteq X are each compact, then K1∪⋯∪KnK_1 \cup \cdots \cup K_n is compact.

LemmaCompactness in the subspace topology, via open sets of XX

Let XX be a topological space and Y⊆XY \subseteq X. Then YY (with the subspace topology) is compact if and only if every cover of YY by sets open in XX has a finite subcover (using the definition of "open cover of YY" given above).

Proof

This lemma is used repeatedly below, so we prove it first, by unwinding definitions on both sides. (⇒\Rightarrow) Suppose YY is compact in the subspace topology. Let {Uα}α∈A\{U_\alpha\}_{\alpha \in A} be a cover of YY by open subsets of XX, so Y⊆⋃αUαY \subseteq \bigcup_\alpha U_\alpha. By definition of the subspace topology, each Uα∩YU_\alpha \cap Y is open in YY. Since Y=⋃α(Uα∩Y)Y = \bigcup_\alpha (U_\alpha \cap Y), the collection {Uα∩Y}α∈A\{U_\alpha \cap Y\}_{\alpha \in A} is an open cover of the space YY. Because YY is compact, there are finitely many indices α1,…,αn\alpha_1, \dots, \alpha_n with

Y=(Uα1∩Y)∪⋯∪(Uαn∩Y)⊆Uα1∪⋯∪Uαn.Y = (U_{\alpha_1} \cap Y) \cup \cdots \cup (U_{\alpha_n} \cap Y) \subseteq U_{\alpha_1} \cup \cdots \cup U_{\alpha_n}.

So {Uα1,…,Uαn}\{U_{\alpha_1}, \dots, U_{\alpha_n}\} is a finite subcover of YY by open subsets of XX. (⇐\Leftarrow) Suppose every cover of YY by open subsets of XX has a finite subcover. Let {Vα}α∈A\{V_\alpha\}_{\alpha \in A} be an open cover of the topological space YY (each VαV_\alpha open in YY). By definition of the subspace topology, for each α\alpha there is a set UαU_\alpha open in XX with Vα=Uα∩YV_\alpha = U_\alpha \cap Y. Then {Uα}α∈A\{U_\alpha\}_{\alpha \in A} covers YY (since ⋃αUα⊇⋃αVα=Y\bigcup_\alpha U_\alpha \supseteq \bigcup_\alpha V_\alpha = Y), and each UαU_\alpha is open in XX. By hypothesis, finitely many Uα1,…,UαnU_{\alpha_1}, \dots, U_{\alpha_n} cover YY. Then Vα1,…,VαnV_{\alpha_1}, \dots, V_{\alpha_n} cover YY as well, since

Y=Y∩⋃i=1nUαi=⋃i=1n(Uαi∩Y)=⋃i=1nVαi.Y = Y \cap \bigcup_{i=1}^n U_{\alpha_i} = \bigcup_{i=1}^n (U_{\alpha_i} \cap Y) = \bigcup_{i=1}^n V_{\alpha_i}.

So {Vα1,…,Vαn}\{V_{\alpha_1}, \dots, V_{\alpha_n}\} is a finite subcover, proving YY is compact. ■\blacksquare

∎
Proof

We now prove the four parts of the theorem, using this lemma freely.

(a) Closed subspaces of compact spaces are compact. Technique: direct construction of a finite subcover, using closedness to patch the complement. Let XX be compact and C⊆XC \subseteq X closed. Let {Uα}α∈A\{U_\alpha\}_{\alpha \in A} be a cover of CC by sets open in XX; by Lemma: Compactness in the subspace topology it suffices to produce a finite subcover from this data. Since CC is closed, X∖CX \setminus C is open in XX. Adjoin it to the cover:

U′={Uα}α∈A∪{X∖C}.\mathcal{U}' = \{U_\alpha\}_{\alpha \in A} \cup \{X \setminus C\}.

Every point of XX is either in CC (hence in some UαU_\alpha) or in X∖CX \setminus C, so U′\mathcal{U}' is an open cover of the whole space XX. Since XX is compact, there is a finite subcover

X=Uα1∪⋯∪Uαn∪(X∖C)X = U_{\alpha_1} \cup \cdots \cup U_{\alpha_n} \cup (X \setminus C)

(the term X∖CX\setminus C may or may not actually be needed, but we may include it without loss of generality). Intersecting both sides with CC and using C∩(X∖C)=∅C \cap (X\setminus C) = \varnothing:

C=C∩X=(C∩Uα1)∪⋯∪(C∩Uαn)⊆Uα1∪⋯∪Uαn.C = C \cap X = \big(C \cap U_{\alpha_1}\big) \cup \cdots \cup \big(C \cap U_{\alpha_n}\big) \subseteq U_{\alpha_1} \cup \cdots \cup U_{\alpha_n}.

So C⊆Uα1∪⋯∪UαnC \subseteq U_{\alpha_1} \cup \cdots \cup U_{\alpha_n}, i.e. {Uα1,…,Uαn}\{U_{\alpha_1}, \dots, U_{\alpha_n}\} is a finite subcover of CC. By the lemma, CC is compact. ■\blacksquare

(b) Continuous images of compact spaces are compact. Technique: pull back the cover through ff, using continuity to guarantee preimages are open. Let XX be compact, f:X→Yf : X \to Y continuous, and let {Vα}α∈A\{V_\alpha\}_{\alpha \in A} be an open cover of f(X)f(X) by sets open in YY (by the lemma, this suffices). For each α\alpha, since ff is continuous and VαV_\alpha is open in YY, the preimage f−1(Vα)f^{-1}(V_\alpha) is open in XX. Moreover

X=f−1(f(X))⊆f−1(⋃αVα)=⋃αf−1(Vα),X = f^{-1}(f(X)) \subseteq f^{-1}\Big(\bigcup_\alpha V_\alpha\Big) = \bigcup_\alpha f^{-1}(V_\alpha),

so {f−1(Vα)}α∈A\{f^{-1}(V_\alpha)\}_{\alpha \in A} is an open cover of XX. Since XX is compact, finitely many of these, say f−1(Vα1),…,f−1(Vαn)f^{-1}(V_{\alpha_1}), \dots, f^{-1}(V_{\alpha_n}), cover XX:

X=f−1(Vα1)∪⋯∪f−1(Vαn).X = f^{-1}(V_{\alpha_1}) \cup \cdots \cup f^{-1}(V_{\alpha_n}).

Applying ff to both sides and using f(f−1(S))⊆Sf(f^{-1}(S)) \subseteq S for any S⊆YS \subseteq Y:

f(X)=f(⋃i=1nf−1(Vαi))=⋃i=1nf(f−1(Vαi))⊆⋃i=1nVαi.f(X) = f\Big(\bigcup_{i=1}^n f^{-1}(V_{\alpha_i})\Big) = \bigcup_{i=1}^n f\big(f^{-1}(V_{\alpha_i})\big) \subseteq \bigcup_{i=1}^n V_{\alpha_i}.

So {Vα1,…,Vαn}\{V_{\alpha_1}, \dots, V_{\alpha_n}\} is a finite subcover of f(X)f(X). By the lemma, f(X)f(X) is compact. ■\blacksquare

(c) Compact subsets of Hausdorff spaces are closed. Technique: for each point outside KK, separate it from all of KK using Hausdorff-ness and compactness together; this is the first theorem where Hausdorff-ness is essential, not cosmetic. Let XX be Hausdorff and K⊆XK \subseteq X compact. We show X∖KX \setminus K is open, which shows KK is closed. Fix x∈X∖Kx \in X \setminus K; we produce an open neighborhood of xx disjoint from KK. For each y∈Ky \in K, since x≠yx \neq y and XX is Hausdorff, there exist disjoint open sets Uy∋xU_y \ni x and Vy∋yV_y \ni y (this is precisely the definition of the Hausdorff separation axiom), with Uy∩Vy=∅U_y \cap V_y = \varnothing. The collection {Vy}y∈K\{V_y\}_{y \in K} is an open cover of KK (each y∈Ky \in K lies in its own VyV_y), so by compactness of KK there is a finite subcover: there exist y1,…,yn∈Ky_1, \dots, y_n \in K with

K⊆Vy1∪⋯∪Vyn.K \subseteq V_{y_1} \cup \cdots \cup V_{y_n}.

Let

U=Uy1∩Uy2∩⋯∩Uyn.U = U_{y_1} \cap U_{y_2} \cap \cdots \cap U_{y_n}.

This is a finite intersection of open sets, hence open, and it contains xx (since each Uyi∋xU_{y_i} \ni x). We claim U∩K=∅U \cap K = \varnothing. Indeed, suppose z∈U∩Kz \in U \cap K. Since z∈K⊆⋃iVyiz \in K \subseteq \bigcup_i V_{y_i}, we have z∈Vyiz \in V_{y_i} for some ii. But also z∈U⊆Uyiz \in U \subseteq U_{y_i}. So z∈Uyi∩Vyi=∅z \in U_{y_i} \cap V_{y_i} = \varnothing, a contradiction. Hence U∩K=∅U \cap K = \varnothing, so UU is an open neighborhood of xx entirely contained in X∖KX \setminus K. Since x∈X∖Kx \in X \setminus K was arbitrary, every point of X∖KX \setminus K has an open neighborhood inside X∖KX \setminus K; hence X∖KX \setminus K is open, i.e. KK is closed. ■\blacksquare

(d) Finite unions of compact sets are compact. Technique: split any cover of the union into covers of each piece, and combine the finitely many finite subcovers. Let K1,…,Kn⊆XK_1, \dots, K_n \subseteq X each be compact, and let {Uα}α∈A\{U_\alpha\}_{\alpha \in A} be an open cover (in XX) of K=K1∪⋯∪KnK = K_1 \cup \cdots \cup K_n. For each fixed i∈{1,…,n}i \in \{1, \dots, n\}, the collection {Uα}α∈A\{U_\alpha\}_{\alpha \in A} also covers KiK_i (since Ki⊆KK_i \subseteq K), so by compactness of KiK_i there is a finite subset Ai⊆AA_i \subseteq A with

Ki⊆⋃α∈AiUα.K_i \subseteq \bigcup_{\alpha \in A_i} U_\alpha.

Let A′=A1∪A2∪⋯∪AnA' = A_1 \cup A_2 \cup \cdots \cup A_n; this is a finite union of finite sets, hence finite. Then

K=⋃i=1nKi⊆⋃i=1n⋃α∈AiUα=⋃α∈A′Uα,K = \bigcup_{i=1}^n K_i \subseteq \bigcup_{i=1}^n \bigcup_{\alpha \in A_i} U_\alpha = \bigcup_{\alpha \in A'} U_\alpha,

so {Uα}α∈A′\{U_\alpha\}_{\alpha \in A'} is a finite subcover of KK. By the lemma, KK is compact. ■\blacksquare

∎
CorollaryContinuous real-valued functions on compact spaces attain their extrema

If XX is compact and nonempty and f:X→Rf : X \to \mathbb{R} is continuous, then ff attains a maximum and a minimum value on XX.

Proof

By part (b) of the theorem, f(X)⊆Rf(X) \subseteq \mathbb{R} is compact. By the Heine–Borel theorem (whose easy direction, "compact ⇒\Rightarrow closed and bounded in Rn\mathbb{R}^n," follows directly from part (c) above together with a short boundedness argument covering f(X)f(X) by intervals (−N,N)(-N,N)), f(X)f(X) is closed and bounded in R\mathbb{R}. A nonempty bounded set of reals has a supremum M=sup⁡f(X)M = \sup f(X) and infimum m=inf⁡f(X)m = \inf f(X), and both are limit points of f(X)f(X) (or equal to elements of f(X)f(X) directly); since f(X)f(X) is closed, M,m∈f(X)M, m \in f(X). Hence there exist p,q∈Xp, q \in X with f(p)=M≥f(x)f(p) = M \ge f(x) and f(q)=m≤f(x)f(q) = m \le f(x) for all x∈Xx \in X. ■\blacksquare

∎

Worked examples

Example 1: A compactness argument with an infinite, asymmetric open cover. Let X={0}∪{1/n:n∈Z≥1}⊂RX = \{0\} \cup \{1/n : n \in \mathbb{Z}_{\ge 1}\} \subset \mathbb{R} with the subspace topology from R\mathbb{R} (this space is often called a "convergent sequence with its limit"). We verify directly, from the open-cover definition, that XX is compact — without invoking Heine–Borel, to illustrate the definition in action. Let {Uα}α∈A\{U_\alpha\}_{\alpha \in A} be an arbitrary open cover of XX (open in R\mathbb{R}, or equivalently in XX; it does not matter by the Lemma). Since 0∈X0 \in X, some member of the cover contains 00; call it Uα0U_{\alpha_0}. Because Uα0U_{\alpha_0} is open in R\mathbb{R} and contains 00, there is ε>0\varepsilon > 0 with (−ε,ε)⊆Uα0(-\varepsilon, \varepsilon) \subseteq U_{\alpha_0}. Choose NN so large that 1/N<ε1/N < \varepsilon; then every point 1/n1/n with n≥Nn \ge N lies in (−ε,ε)⊆Uα0(-\varepsilon,\varepsilon) \subseteq U_{\alpha_0}. So Uα0U_{\alpha_0} alone already covers 00 and all but finitely many points of XX, namely it may miss only 1,1/2,…,1/(N−1)1, 1/2, \dots, 1/(N-1). For each of these finitely many remaining points 1/k1/k (k=1,…,N−1k = 1, \dots, N-1), choose some UαkU_{\alpha_k} from the original cover containing it (such a set exists because {Uα}\{U_\alpha\} covers all of XX). Then

X=Uα0∪Uα1∪⋯∪UαN−1X = U_{\alpha_0} \cup U_{\alpha_1} \cup \cdots \cup U_{\alpha_{N-1}}

is a finite subcover. Since {Uα}\{U_\alpha\} was an arbitrary open cover, XX is compact. Notice precisely where the limit point 0∈X0 \in X was used: it is exactly the presence of 00 in the space that let one open set Uα0U_{\alpha_0} absorb infinitely many of the 1/n1/n's at once. If we deleted 00 from XX, leaving Y={1/n:n≥1}Y = \{1/n : n \ge 1\}, the same cover-construction as in the intuition section (using intervals around each 1/n1/n that avoid all other points) would show YY is not compact — a discrete infinite set is never compact, since the cover by singletons {1/n}\{1/n\} (each open in the subspace topology on YY, since points of YY are isolated) has no finite subcover.

Example 2: Building a genuinely non-compact set and pinpointing the failing cover. Let Z=[0,1)∪{2}⊂RZ = [0,1) \cup \{2\} \subset \mathbb{R}, again with the subspace topology. We show ZZ is not compact by exhibiting one explicit open cover with no finite subcover — and we check carefully that the cover really is open in ZZ and really has no finite subcover, since sloppy verification here is the most common student error. Define, for n=2,3,4,…n = 2, 3, 4, \dots,

Un=(−12, 1−1n)∪(32, 52),U_n = \Big(-\tfrac12,\ 1 - \tfrac1n\Big) \cup \Big(\tfrac32,\ \tfrac52\Big),

each an open subset of R\mathbb{R} (a union of two open intervals), hence Un∩ZU_n \cap Z is open in ZZ. Note Un∩Z=[0,1−1n)∪{2}U_n \cap Z = [0, 1-\tfrac1n) \cup \{2\}. Cover verification. Given any x∈Zx \in Z: if x=2x = 2, then x∈Unx \in U_n for every nn. If x∈[0,1)x \in [0,1), then since x<1x < 1 we can choose nn large enough that 1−1/n>x1 - 1/n > x (possible because 1−1/n→11 - 1/n \to 1 as n→∞n \to \infty), so x∈Unx \in U_n. Hence {Un}n≥2\{U_n\}_{n \ge 2} covers ZZ. No finite subcover. Suppose, for contradiction, that finitely many sets Un1,…,UnkU_{n_1}, \dots, U_{n_k} (with n1<⋯<nkn_1 < \cdots < n_k) covered ZZ. Since the intervals [0,1−1/n)[0, 1-1/n) are nested increasing in nn, the union Un1∪⋯∪UnkU_{n_1} \cup \cdots \cup U_{n_k} equals UnkU_{n_k}, whose intersection with ZZ is [0,1−1/nk)∪{2}[0, 1 - 1/n_k) \cup \{2\}. But this misses every point x∈Zx \in Z with 1−1/nk≤x<11 - 1/n_k \le x < 1 — and such points exist, e.g. x=1−12nkx = 1 - \tfrac{1}{2n_k}, which satisfies 1−1/nk<x<11 - 1/n_k < x < 1 so x∈Zx \in Z but x∉Unk∩Zx \notin U_{n_k}\cap Z. This contradicts the assumption that Un1,…,UnkU_{n_1}, \dots, U_{n_k} cover ZZ. Hence no finite subcollection of {Un}\{U_n\} covers ZZ, so ZZ is not compact. Consistently with part (a) of the theorem: ZZ is not closed in R\mathbb{R} (it is missing the limit point 11), so this is not a counterexample to any theorem — it simply shows that "closed" really is doing work, matching the Heine–Borel picture that compact subsets of R\mathbb{R} must be closed.

CounterexampleHausdorff cannot be dropped from "compact subsets are closed"

Theorem (c) states: if XX is Hausdorff and K⊆XK \subseteq X is compact, then KK is closed in XX. We show this genuinely requires the Hausdorff hypothesis, by constructing a non-Hausdorff space with a compact subset that is not closed. Let X=RX = \mathbb{R}, but equip it with the cofinite topology: a set U⊆XU \subseteq X is declared open if either U=∅U = \varnothing or X∖UX \setminus U is finite. One checks this is a genuine topology (arbitrary unions of cofinite sets are cofinite or empty, finite intersections of cofinite sets are cofinite, and ∅,X\varnothing, X are included), but XX is not Hausdorff: any two nonempty open sets U,VU, V have complements that are finite, so X∖(U∩V)=(X∖U)∪(X∖V)X \setminus (U \cap V) = (X\setminus U) \cup (X \setminus V) is finite, forcing U∩V≠∅U \cap V \ne \varnothing (since XX is infinite). So no two nonempty open sets are disjoint, and in particular distinct points can never be separated by disjoint open sets. Now let K=Z≥0={0,1,2,3,… }⊂XK = \mathbb{Z}_{\ge 0} = \{0, 1, 2, 3, \dots\} \subset X, an infinite, non-closed subset (its complement X∖KX \setminus K is not cofinite, since X∖KX\setminus K itself is infinite and KK is infinite, so X∖KX\setminus K is not open; hence KK is not closed). Claim: KK is compact. Let {Uα}α∈A\{U_\alpha\}_{\alpha \in A} be any open cover of KK by nonempty sets open in XX. Pick any one member Uα0U_{\alpha_0} of the cover. Since Uα0U_{\alpha_0} is open and nonempty in the cofinite topology, X∖Uα0X \setminus U_{\alpha_0} is finite, so K∖Uα0⊆X∖Uα0K \setminus U_{\alpha_0} \subseteq X \setminus U_{\alpha_0} is also finite — say it equals {k1,…,km}\{k_1, \dots, k_m\}. For each kik_i, since the cover covers KK, choose some UαiU_{\alpha_i} containing kik_i. Then

K⊆Uα0∪Uα1∪⋯∪Uαm,K \subseteq U_{\alpha_0} \cup U_{\alpha_1} \cup \cdots \cup U_{\alpha_m},

a finite subcover. Hence KK is compact — yet KK is not closed in XX. This is exactly what theorem (c) would forbid if XX were Hausdorff; the construction shows the theorem's hypothesis is not decorative. The mechanism of the original proof breaks down precisely at the separation step: to build the disjoint neighborhoods Uy,VyU_y, V_y for x∉Kx \notin K and y∈Ky \in K, we invoked the Hausdorff axiom, and in the cofinite topology no such disjoint pair exists at all.

Scope, edge cases & common traps

SituationWhat holdsWhat can fail
XX compact, C⊆XC \subseteq X closedCC compact (always, no Hausdorff needed)—
XX Hausdorff, K⊆XK \subseteq X compactKK closed in XXFails without Hausdorff (cofinite topology example above)
f:X→Yf: X \to Y continuous, XX compactf(X)f(X) compactf(X)f(X) need not be closed if YY is not Hausdorff, and ff need not be a closed map on all of XX if domain isn't compact
Finite unions K1∪⋯∪KnK_1 \cup \cdots \cup K_ncompactInfinite unions of compact sets need not be compact (e.g. ⋃n[n,n+1]\bigcup_n [n, n+1] is closed unbounded, not compact)
Compact + HausdorffKK closed, and XX restricted to KK is "as good as" a closed bounded subset of Rn\mathbb{R}^n would beCompactness alone (no Hausdorff) can allow strange non-closed compact subsets
Subspace vs. ambient open setsLemma shows the two notions of "cover" coincideCommon error: checking only covers by sets open in YY while forgetting the equivalence needs subspace-topology unwinding

The mathematician behind it

Origins · 1 minHeinrich Heine and Émile Borel and how this was discovered
HH
Heinrich Heine and Émile Borel
Heine: 1821–1881, Borel: 1871–1956 · late 19th / early 20th century analysis in Germany and France

The open-cover formulation of compactness crystallized gradually. Eduard Heine's 1872 work on uniform continuity implicitly used finite subcovering arguments for continuous functions on closed intervals. Émile Borel, in his 1895 doctoral work on complex function theory, proved that a countable open cover of a closed bounded interval has a finite subcover — the germ of the theorem that now bears both names. The full general topological definition — arbitrary (not just countable) open covers, on arbitrary topological spaces — was formulated later, in the early 20th century, notably in the work of Pavel Alexandrov and Pavel Urysohn, and was absorbed into the modern axiomatic framework of general topology built by Felix Hausdorff.

History
- 1872 — Heine uses finite-subcover-type arguments to prove uniform continuity of continuous functions on closed intervals.
- 1895 — Borel proves that countable open covers of closed bounded intervals admit finite subcovers.
- 1903 — Lebesgue extends the covering theorem to uncountable covers, giving the modern Heine–Borel statement.
- 1914 — Hausdorff's Grundzüge der Mengenlehre systematizes point-set topology, including separation axioms.
- 1930s — Alexandrov, Urysohn, and Tychonoff generalize compactness to arbitrary topological spaces and prove the Tychonoff Theorem for infinite products.
Why require a finite subcover instead of, say, a countable one?

Finiteness is what makes compactness a genuinely strong, useful condition, and it is what lets compactness interact so cleanly with algebraic and analytic constructions (finite sums, finite intersections, finite products of neighborhoods, as seen in the proof that compact subsets of Hausdorff spaces are closed). A "countably compact" condition — every countable open cover has a finite subcover — is strictly weaker in general topological spaces and coincides with compactness only under extra hypotheses like second countability. Finite subcovers are also what make compactness behave like an actual generalization of finiteness: many theorems about finite sets (max/min exist, finite unions of closed sets are closed) extend verbatim to compact spaces precisely because the cover-reduction argument bottoms out at a finite stage.

Is every closed and bounded subset of a metric space compact?

No — this is true in Rn\mathbb{R}^n (Heine–Borel) but false in general metric spaces, especially infinite-dimensional ones. In an infinite-dimensional normed vector space, the closed unit ball is always closed and bounded but never compact; one can construct a sequence of unit vectors with no convergent subsequence (this follows from Riesz's lemma). The correct general statement is that compactness is equivalent to closed-and- bounded specifically in finite-dimensional normed spaces, which is one reason the open-cover definition, not "closed and bounded," is taken as the primary definition.

Does compactness depend on which ambient space XX we view YY inside?

No — this is one of compactness's most important structural features. Whether YY is compact depends only on the subspace topology on YY itself, not on any particular embedding into a larger space XX. The Lemma proved above shows the two ways of phrasing "open cover of YY" (covers by sets open in YY, versus covers by sets open in the ambient XX) always agree in the relevant sense, confirming compactness is an intrinsic, not relative, property. This is why one can unambiguously say "YY is compact" without specifying an ambient space.

Why does the proof that compact subsets of Hausdorff spaces are closed need a finite intersection of neighborhoods?

The proof separates a fixed exterior point xx from each point y∈Ky \in K individually, producing disjoint pairs (Uy,Vy)(U_y, V_y) for every y∈Ky \in K — potentially infinitely many pairs. Compactness of KK reduces the covering {Vy}\{V_y\} to finitely many Vy1,…,VynV_{y_1}, \dots, V_{y_n}, and only then can we intersect the finitely many corresponding UyiU_{y_i} to get a single open set around xx still disjoint from all of KK. An infinite intersection of open sets need not be open, so this step would fail without the finite subcover; compactness is precisely what converts an infinite family of neighborhoods into a finite, hence still-open, intersection.

Can an infinite union of compact sets fail to be compact, even if each piece is compact?

Yes. Theorem part (d) only guarantees compactness for finite unions. The sets [n,n+1][n, n+1] for n∈Zn \in \mathbb{Z} are each compact, but their union is all of R\mathbb{R}, which is unbounded and hence not compact (by Heine–Borel, or directly: the cover {(−n,n):n≥1}\{(-n,n) : n \ge 1\} has no finite subcover of R\mathbb{R}). This shows compactness is a genuinely finite-additivity property, unlike, say, closedness under arbitrary intersections.

How does compactness relate to sequential compactness?

Sequential compactness (every sequence has a convergent subsequence) is a related but logically distinct notion, covered in depth under Sequential Compactness. For metric spaces the two notions coincide, but in general topological spaces neither implies the other without extra hypotheses (e.g. second countability or metrizability). The open-cover definition given here is the one that generalizes correctly to all topological spaces, including those where sequences are too weak a tool to detect convergence (non-first-countable spaces), which is part of why it — rather than a sequence-based definition — is taken as primary.

Before this

Where this leads