Compactness in Metric Spaces — Teaching Notes
Purpose, Intuition & Outcomes
Compactness distills the idea that a set is small enough to be controlled by finitely many local pieces. In metric spaces, compact sets behave like closed intervals: they are closed, bounded, every sequence admits a convergent subsequence, and continuous functions attain maxima and minima.
Definition: Cover, Open Cover, Subcover
Let $(X,d)$ be a metric space and $S\subseteq X$. A family $\{E_i:i\in I\}$ is a cover of $S$ if $\displaystyle S\subseteq\bigcup_{i\in I}E_i$. It is an open cover if each $E_i$ is open (in the subspace topology on $X$). A subcover is a subfamily that still covers $S$; if the index set is finite, it is a finite subcover.
Definition: Compact Subset
$K\subseteq X$ is compact if every open cover of $K$ admits a finite subcover.
Examples: Two Natural Non‑Compact Sets
(a) $(0,4]$ in $\mathbb R$. For $n\in\mathbb N$, set $E_n=(\tfrac1n,5)$. Then $(0,4]\subseteq\bigcup_n E_n$, but any finite subfamily is $(\tfrac1N,5)$ for some $N$, missing points near $0$.
(b) $B_1(0)$ in $\mathbb R^2$. For $n\ge 2$, set $E_n=B_{1-1/n}(0)$. Then $B_1(0)=\bigcup_{n\ge2}E_n$, but any finite subfamily misses a thin annulus near the boundary.
Proposition: In Any Metric Space, Compact $\Rightarrow$ Closed and Bounded
Strategy. For boundedness, cover by concentric balls $\{B_r(x)\}_{r\in\mathbb N}$ and shrink to finitely many. For closedness, fix $y\notin K$; for each $z\in K$ separate $z$ and $y$ by disjoint open sets $(U_z,V_z)$ and then intersect finitely many $V_z$’s.
Boundedness. Fix $x\in X$. The family $\{B_r(x): r\in\mathbb N, r\ge 1\}$ covers $K$. By compactness, choose a finite subcover $\{B_{r_i}(x)\}_{i=1}^m$. With $R=\max_i r_i$ we have $K\subseteq B_R(x)$.
Closedness. Let $y\in X\setminus K$. For each $z\in K$, the Hausdorff property provides disjoint open sets $U_z\ni z$ and $V_z\ni y$. The family $\{U_z\}$ covers $K$. By compactness, pick $z_1,\dots,z_N$ with $K\subseteq\bigcup_{i=1}^N U_{z_i}$. Then $V=\bigcap_{i=1}^N V_{z_i}$ is open, contains $y$, and is disjoint from $K$. Hence $K$ is closed.
Heine–Borel (Euclidean Spaces)
In $\mathbb R^n$ (equivalently $\mathbb C^n$ with its Euclidean metric), a set is compact iff it is closed and bounded.
Proof Sketch: Closed & Bounded $\Rightarrow$ Compact
Strategy. Prove $H=[-r,r]^n$ is compact by contradiction: assume an open cover with no finite subcover; recursively choose a nested sequence of closed subcubes with no finite subcover; use $\operatorname{diam}(H_m)\to 0$ and the Cantor intersection property to obtain a point $x$; openness then covers a whole small cube $H_m$, a contradiction.
Assume $H$ has an open cover $\mathcal C$ with no finite subcover. Bisect each side to partition $H$ into $2^n$ congruent closed subcubes; pick one, $H_1$, that is not finitely coverable by $\mathcal C$. Iterate to obtain nested closed cubes $H\supset H_1\supset H_2\supset\cdots$ with $\operatorname{diam}(H_m)\to 0$. Then $\bigcap_m H_m=\{x\}\ne\varnothing$. Pick $U\in\mathcal C$ with $x\in U$. There exists $r>0$ such that $B_r(x)\subset U$. For $m$ large, $H_m\subset B_r(x)\subset U$, contradicting the choice of $H_m$.
Core Consequences in Metric Spaces
Sequential compactness. In metric spaces, $K$ is compact iff every sequence in $K$ has a convergent subsequence with limit in $K$.
Continuity & images. If $f:X\to Y$ is continuous and $K\subset X$ is compact, then $f(K)$ is compact. Consequently, continuous $f:K\to\mathbb R$ with $K$ compact are bounded and attain their extrema (Extreme Value Theorem).
Completeness & total boundedness. In metric spaces: $K$ is compact $\iff$ $K$ is complete and totally bounded.
Further Examples
Compact sets. Finite sets; $[a,b]$; closed rectangles in $\mathbb R^n$; the unit sphere $S^{n-1}$ (closed and bounded $\Rightarrow$ compact via Heine–Borel).
Non-compact sets. $(0,1)$, $\mathbb R$, the open unit ball in $\mathbb R^n$, graphs of polynomials in $\mathbb R^2$ (unbounded).
Common Pitfalls & How to Avoid Them
Confusing $X$ and $S$. A cover of a subset $S$ requires $S\subseteq\cup E_i$ (not $X$).
“Closed and bounded” everywhere. Only valid in Euclidean spaces with the Euclidean metric.
Forgetting subspace openness. In a metric subspace, a set is open if it is the intersection of an open set of the ambient space with the subspace.
Practice: Proof‑Guided Exercises
Guided proof. Show that if $K$ is compact and $F\subseteq K$ is closed, then $F$ is compact. Hint: Intersect an arbitrary open cover of $F$ with $K$ and use compactness of $K$.
Counterexample builder. Produce an open cover of $\mathbb R$ with no finite subcover. Why does this show $\mathbb R$ is not compact?
Sequential compactness. Let $(x_n)$ lie in a compact $K$. Explain how to extract a convergent subsequence using total boundedness (finite $\varepsilon$-nets) and completeness.