Compact Sets

This scene tests compactness with open covers. See whether finitely many covering pieces always suffice.

Compact means closed and bounded together. An open end needs endless pieces near the gap. An endless stretch fails the same way. With both conditions, any cover shrinks to finitely many pieces.

For example, cover a desk completely with 📚 books. A finite desk needs only a few books. An endless desk would defeat any pile, however large.

K compact   ⟺  K closed and boundedK \text{ compact } \iff K \text{ closed and bounded}
∀ U open cover of K  ∃ U1,…,Un∈U:K⊆⋃k=1nUk\forall\, \mathcal{U} \text{ open cover of } K\; \exists\, U_1,\dots,U_n \in \mathcal{U} : K \subseteq \bigcup_{k=1}^{n} U_k
(an)⊂K⇒∃ (ank)→x∈K(a_n) \subset K \Rightarrow \exists\, (a_{n_k}) \to x \in K

Part of these learning paths

Examples & Exercises

For a metric space (X,d)(X, d) and K⊆XK \subseteq X, prove that KK is compact if and only if every sequence in KK has a subsequence converging to a point of KK (sequentially compact). Prove both directions.

K compact  ⟺  ∀ (xn)⊂K ∃ (xnk)→x∈KK \text{ compact} \iff \forall\,(x_n) \subset K\ \exists\,(x_{n_k}) \to x \in K
(⇒) finite subcover of B(x,rx);(⇐) Lebesgue number δ+ finite δ-net(\Rightarrow)\ \text{finite subcover of } B(x, r_x); \qquad (\Leftarrow)\ \text{Lebesgue number } \delta + \text{ finite } \delta\text{-net}
k=6k = 6: the union [−0.18,1.18][-0.18, 1.18] of the first 6 open intervals covers [0,1][0,1] — the finite subcover extracted in the (⇒)(\Rightarrow) direction.
Show proof
  1. (⇒)(\Rightarrow) Suppose KK is compact, and (xn)(x_n) is a sequence in KK with no subsequence converging to a point of KK. Then for every x∈Kx \in K there is rx>0r_x > 0 such that the open ball B(x,rx)B(x, r_x) contains xnx_n for only finitely many nn: if instead some xx had B(x,r)B(x, r) containing xnx_n for infinitely many nn for every r>0r > 0, we could choose nkn_k increasing with d(xnk,x)<1/kd(x_{n_k}, x) < 1/k, and then (xnk)(x_{n_k}) would converge to xx.

  2. (⇒)(\Rightarrow) The balls {B(x,rx)}x∈K\{B(x, r_x)\}_{x \in K} cover KK, so compactness gives a finite subcover B(x1,rx1),…,B(xm,rxm)B(x_1, r_{x_1}), \dots, B(x_m, r_{x_m}). Each ball contains xnx_n for only finitely many nn, so their finite union contains only finitely many indices nn — a contradiction, since a sequence has infinitely many indices. Hence every sequence in KK has a subsequence converging to a point of KK.

  3. (⇐)(\Leftarrow) Suppose KK is sequentially compact (if KK is empty both sides are trivial, so assume KK is nonempty). Step 1 (Lebesgue number): for every open cover U\mathcal{U} of KK there is δ>0\delta > 0 such that every ball B(x,δ)B(x, \delta), x∈Kx \in K, lies inside some member of U\mathcal{U}. Prove it by contradiction: otherwise, for each nn pick xn∈Kx_n \in K with B(xn,1/n)B(x_n, 1/n) inside no member of U\mathcal{U}. By sequential compactness a subsequence (xnk)(x_{n_k}) converges to x∈Kx \in K. There is U0∈UU_0 \in \mathcal{U} with x∈U0x \in U_0, and U0U_0 open gives ρ>0\rho > 0 with B(x,ρ)⊆U0B(x, \rho) \subseteq U_0. For all large kk, d(xnk,x)<ρ/2d(x_{n_k}, x) < \rho/2 and 1/nk<ρ/21/n_k < \rho/2, so the triangle inequality chain below gives B(xnk,1/nk)⊆U0B(x_{n_k}, 1/n_k) \subseteq U_0 — contradicting the choice of xnkx_{n_k}.

    y∈B(xnk,1/nk)⇒d(y,x)≤d(y,xnk)+d(xnk,x)<1nk+ρ2<ρ⇒B(xnk,1/nk)⊆B(x,ρ)⊆U0y \in B(x_{n_k}, 1/n_k) \Rightarrow d(y, x) \le d(y, x_{n_k}) + d(x_{n_k}, x) < \frac{1}{n_k} + \frac{\rho}{2} < \rho \Rightarrow B(x_{n_k}, 1/n_k) \subseteq B(x, \rho) \subseteq U_0
  4. (⇐)(\Leftarrow) Step 2 (total boundedness): fix ε>0\varepsilon > 0. If no finite ε\varepsilon-net existed, we could pick a sequence inductively: pick x1∈Kx_1 \in K, and pick xn+1∈Kx_{n+1} \in K with d(xn+1,xj)≥εd(x_{n+1}, x_j) \ge \varepsilon for all j≤nj \le n — possible because the ε\varepsilon-balls around the finite set {x1,…,xn}\{x_1, \dots, x_n\} do not cover KK, so a point outside them can be chosen. The resulting sequence has d(xm,xn)≥εd(x_m, x_n) \ge \varepsilon for all m≠nm \ne n, so it has no Cauchy subsequence, hence no convergent subsequence — contradicting sequential compactness. Therefore finitely many ε\varepsilon-balls cover KK.

  5. (⇐)(\Leftarrow) Step 3: given an open cover U\mathcal{U}, take its Lebesgue number δ>0\delta > 0 from Step 1, and cover KK by finitely many δ\delta-balls using Step 2 with ε=δ\varepsilon = \delta. By Step 1 each δ\delta-ball lies inside some member of U\mathcal{U}, so those finitely many members cover KK. Hence U\mathcal{U} has a finite subcover, and since U\mathcal{U} was arbitrary, KK is compact.

Show that (0,1](0,1] is not compact: the sequence an=1/na_n = 1/n has no subsequence converging to a point of (0,1](0,1].

an=1n→0,0∉(0,1]a_n = \frac{1}{n} \to 0, \qquad 0 \notin (0,1]
⋃k=1N(1k,2)=(1N,2): the gap (0,1N] is never covered\bigcup_{k=1}^{N} \left(\tfrac{1}{k}, 2\right) = \left(\tfrac{1}{N}, 2\right): \text{ the gap } \left(0, \tfrac{1}{N}\right] \text{ is never covered}
k=8k = 8: even all 8 intervals leave (0,1/8](0, 1/8] uncovered — with 00 missing, no finite subcover exists.
Show proof
  1. Put an=1/na_n = 1/n. Then an∈(0,1]a_n \in (0,1] for every nn, and an→0a_n \to 0.

  2. A subsequence of a convergent sequence converges to the same limit, so every subsequence (ank)(a_{n_k}) of (an)(a_n) also converges to 00.

  3. But 0∉(0,1]0 \notin (0,1], so no subsequence converges to a point of (0,1](0,1]. Hence (0,1](0,1] is not sequentially compact, and not compact.

  4. The open-cover picture shows the same failure: however many intervals we take from the cover — the first NN of Uk=(1k,2)U_k = \left(\frac{1}{k}, 2\right) (k=1,…,8k = 1, \dots, 8) — their union is always of the form (1N,2)\left(\frac{1}{N}, 2\right), leaving the gap (0,1N]\left(0, \frac{1}{N}\right] — at k=8k = 8 that gap is (0,1/8](0, 1/8]. Closing the gap would require the point 00, which is not in the set.

Prove that if KK is compact and ff is continuous on KK, then the image f(K)f(K) is compact.

f−1(Vi) open in K,K⊆⋃j=1nf−1(Vij) ⟹ f(K)⊆⋃j=1nVijf^{-1}(V_i) \text{ open in } K,\quad K \subseteq \bigcup_{j=1}^{n} f^{-1}(V_{i_j}) \ \Longrightarrow\ f(K) \subseteq \bigcup_{j=1}^{n} V_{i_j}
K=[0,1] compact⇒f(K) compact ⇒max⁡f,min⁡f exist (EVT)K = [0,1] \text{ compact} \Rightarrow f(K) \text{ compact } \Rightarrow \max f, \min f \text{ exist (EVT)}
The engine of the Extreme Value Theorem: [0,1][0,1] is compact, so the continuous image f([0,1])f([0,1]) is compact — max and min exist.
Show proof
  1. Use the open-cover definition — this argument needs no assumption that KK is metric, so it works for a general compact KK. Let {Vi}i∈I\{V_i\}_{i \in I} be an arbitrary open cover of f(K)f(K).

  2. For each ii, Ui=f−1(Vi)U_i = f^{-1}(V_i) is open in KK by continuity of ff. And if x∈Kx \in K then f(x)∈f(K)f(x) \in f(K), so f(x)∈Vif(x) \in V_i for some ii, i.e. x∈Uix \in U_i — hence {Ui}\{U_i\} is an open cover of KK.

  3. Since KK is compact, there is a finite subcover: K⊆Ui1∪⋯∪UinK \subseteq U_{i_1} \cup \cdots \cup U_{i_n}. Then the corresponding Vi1,…,VinV_{i_1}, \dots, V_{i_n} cover f(K)f(K): if y=f(x)∈f(K)y = f(x) \in f(K), then x∈Uijx \in U_{i_j} for some jj, so y=f(x)∈Vijy = f(x) \in V_{i_j}.

  4. Hence every open cover of f(K)f(K) has a finite subcover, so f(K)f(K) is compact. This is the engine of the Extreme Value Theorem (the evt scene) — for continuous ff on [0,1][0,1], the set f([0,1])f([0,1]) is compact, hence closed and bounded in R\mathbb{R}, so its supremum and infimum are actually attained.

5. Topology