Book 2B

© 2026 Neckpinch · www.neckpinch.com · All rights reserved.

Course 2Book 2B: Spaces, Functions and ChangeChapter 3

Compactness

Compact sets, the contradiction–compactness method, and the three ways compactness is lost.

58 min read · Updated Nov 16, 2026

Read with Tao, Analysis II, chapter "Metric spaces", section "Compact metric spaces"; and chapter "Continuous functions on metric spaces", sections "Continuity and product spaces" and "Continuity and compactness".

In this chapter · 10 sections
  1. 3.1A soap film that snaps
  2. 3.2Compact means almost finite
  3. 3.3Sequential compactness
  4. 3.4Complete and totally bounded
  5. 3.5Open covers
  6. 3.6Continuous functions on compact spaces
  7. 3.6.1Minimisers need compactness
  8. 3.7The contradiction–compactness template, in full
  9. 3.8Three ways to lose compactness
  10. 3.8.1Getting compactness back
  11. 3.9History
  12. 3.10Exercises
  13. ↗Free resources

Completeness (2B.2 Completeness and Contraction) produces solutions as limits of sequences that we construct, step by step, to be Cauchy. Compactness produces solutions in a different way. It takes any sequence, possibly one that wanders without settling, and extracts from it a subsequence that converges. We don't need to know in advance where the limit is, or build the sequence carefully. We only need the sequence to live in a compact space.

On the real line, compactness was the Bolzano–Weierstrass theorem (2A.6 Sequences), and it gave the maximum principle and uniform continuity (2A.9 Continuous Functions). This chapter makes it a property of metric spaces, proves that three quite different definitions agree, and puts it to work. It then states in full the proof pattern that the guidebook follows all the way to Perelman, the contradiction–compactness template of 2A.5 Quantifiers and the Shape of a Proof, and works through it on a model case where every step is visible. Finally it lists the three ways in which compactness can fail. Those three failures, in increasingly sophisticated forms, are the ways a Ricci flow can develop a singularity.

By the end of this chapter you will be able to:

  • prove that a set is compact or not, using sequences, total boundedness or open covers, whichever is easiest;
  • use compactness to show that a maximum exists, that a continuous function is uniformly continuous, that a positive quantity has a positive lower bound, and that a nearest point exists;
  • prove that products of compact spaces are compact, and that nested nonempty compact sets have a common point;
  • run the contradiction–compactness template: negate, normalise, extract a limit, contradict;
  • prove that all norms on Rn\mathbb{R}^n are equivalent, and say why the proof fails in infinite dimensions;
  • recognise the three ways a sequence can fail to have a convergent subsequence.

A soap film that snaps

In the world Model The catenoid between two rings

Dip two equal wire rings, held parallel and coaxial, into soap solution and draw them apart slowly. A film forms between them, shaped like a cooling tower with a narrow waist. Surface tension pulls the film to the shape of least area among nearby shapes, and for coaxial rings that shape is a catenoid: the surface traced out by rotating the curve r=acosh⁡(z/a)r = a\cosh(z/a) about the axis, where aa is the radius of the waist.

As the rings separate, the waist narrows. Then, suddenly, at a separation of about 1.331.33 times the ring radius, the waist collapses to a point and the film snaps into two flat discs, one in each ring. Nothing gradual happens at the moment of snapping: a whole family of shapes simply stops existing.

The mathematics locates the snap exactly. With rings of radius 11 at heights ±h/2\pm h/2, a catenoid fits the rings when acosh⁡(h2a)=1a\cosh\big(\tfrac{h}{2a}\big) = 1, that is, when

h=H(a)=2a arccosh⁡(1/a),0<a≤1.h = H(a) = 2a\,\operatorname{arccosh}(1/a), \qquad 0 < a \leq 1.

So a film with waist aa exists exactly when the separation is a value of HH. The function HH is continuous on (0,1](0, 1], with H(1)=0H(1) = 0 and H(a)→0H(a) \to 0 as a→0a \to 0, so it extends to a continuous function on the compact interval [0,1][0, 1]. By the maximum principle it attains a maximum, which a computation puts at a≈0.5524a \approx 0.5524, with

Hmax⁡≈1.3255.H_{\max} \approx 1.3255.

Below this separation there are two catenoids (a fat stable one and a thin unstable one, Figure 3.1); at 1.32551.3255 they merge; beyond it there are none, and the film has no choice but to break. The existence of the critical separation is a compactness argument, and the snap is the first neckpinch in this guidebook: a waist shrinking to zero radius in finite time, separating one surface into two. Ricci flow does the same thing to necks in a 3-manifold (11B.5 Singularities), which is where this site's name comes from.

Figure 3.1. Left: the stable catenoid for ring separations h=0.6h = 0.6, 1.01.0 and 1.31.3 (ring radius 11). Right: the separation H(a)H(a) produced by a waist of radius aa. Each hh below the maximum 1.32551.3255 is attained twice: a fat (stable) and a thin (unstable) film. Beyond the maximum, no catenoid exists.

A finer point, which a real experiment shows: for separations between about 1.0551.055 and 1.32551.3255, two flat discs have less total area than the fat catenoid, yet the film stays a catenoid until 1.32551.3255. The catenoid there is a local minimum of area but not the global one. Which local minimum a physical system sits in depends on its history, a theme that returns with the calculus of variations (6A.11 Calculus of Variations and Gradient Flows) and with min–max methods (10A.11 Min–Max and Width).

Compact means almost finite

Before the definitions, it helps to know what compactness is for. A finite set has three properties that analysis would love to have everywhere.

  • Every real function on a finite set has a largest value.
  • Every sequence in a finite set takes some value infinitely often, so it has a constant, and in particular convergent, subsequence.
  • If each point of a finite set has a property with some margin (a positive distance to a wall, a bound valid nearby), then the smallest margin is still positive: a minimum of finitely many positive numbers is positive.

On an infinite set all three can fail. The function xx on (0,1)(0, 1) has no largest value; the sequence nn in N\mathbb{N} has no convergent subsequence; and on (0,1](0, 1] each point xx has a positive margin to 00, namely xx itself, while the margins have infimum 00. Compactness is the property of an infinite set that rescues all three. Each of the three definitions below captures one of them: sequential compactness the second; total boundedness the idea that the set looks finite at every resolution; and open covers the third, "finitely many local margins suffice". The theorems of this chapter say that, for metric spaces, the three rescues come together.

The idea

Compactness turns local or pointwise information into uniform information, by reducing an infinite set to finitely many pieces at every scale. Whenever a proof needs one constant that works at every point at once, look for a compact set.

Sequential compactness

Definition 3.1 Compact metric space

A metric space (X,d)(X, d) is compact if every sequence in XX has a subsequence that converges to a point of XX. A subset K⊆XK \subseteq X is compact if it is compact with the restricted metric, that is, if every sequence in KK has a subsequence converging to a point of KK.

Tao takes this sequential definition as primary, as we do. Its first consequences are quick.

Proposition 3.2 Compact sets are closed and bounded

Let KK be a compact subset of a metric space XX. Then KK is closed in XX and bounded (it lies inside some ball). A closed subset of a compact set is compact.

Proof. Closed. If xn∈Kx_n \in K and xn→x∈Xx_n \to x \in X, a subsequence converges to a point of KK; but every subsequence converges to xx, so x∈Kx \in K. Bounded. If not, fix x0x_0 and pick xn∈Kx_n \in K with d(xn,x0)>nd(x_n, x_0) > n. A convergent subsequence xnk→xx_{n_k} \to x would have d(xnk,x0)≤d(xnk,x)+d(x,x0)d(x_{n_k}, x_0) \leq d(x_{n_k}, x) + d(x, x_0) bounded, which is false. Closed subsets. If F⊆KF \subseteq K is closed and xn∈Fx_n \in F, a subsequence converges to some x∈Kx \in K, and x∈Fx \in F because FF is closed.

In Rn\mathbb{R}^n the converse holds.

Theorem 3.3 Heine–Borel

A subset of Rn\mathbb{R}^n is compact if and only if it is closed and bounded.

Proof. One direction is Proposition 3.2. For the other, let KK be closed and bounded and let (xk)(x_k) be a sequence in KK. Its first coordinates form a bounded sequence of reals, which has a convergent subsequence by Bolzano–Weierstrass (2A.6 Sequences). Along that subsequence, the second coordinates are bounded, so a further subsequence makes them converge too. After nn such steps we have a subsequence along which every coordinate converges, so the points converge in Rn\mathbb{R}^n. The limit lies in KK because KK is closed.

The proof of Heine–Borel used a pattern worth isolating: extract a subsequence for one coordinate, then a further subsequence for the next. The same pattern shows that compactness survives products.

Proposition 3.4 Products of compact spaces

If (X,dX)(X, d_X) and (Y,dY)(Y, d_Y) are compact, then X×YX \times Y is compact with the metric d((x,y),(x′,y′))=dX(x,x′)+dY(y,y′)d\big((x, y), (x', y')\big) = d_X(x, x') + d_Y(y, y').

Proof. Let (xn,yn)(x_n, y_n) be a sequence in X×YX \times Y. By compactness of XX, some subsequence xnkx_{n_k} converges to some x∈Xx \in X. The sequence (ynk)(y_{n_k}) lies in the compact space YY, so it has a further subsequence ynkj→yy_{n_{k_j}} \to y. Along this further subsequence, xnkj→xx_{n_{k_j}} \to x still (a subsequence of a convergent sequence), so d((xnkj,ynkj),(x,y))→0d\big((x_{n_{k_j}}, y_{n_{k_j}}), (x, y)\big) \to 0.

The same metric with max⁡\max instead of the sum, or with the square root of the sum of squares, gives the same convergent sequences, so the choice doesn't matter. By induction, a product of finitely many compact spaces is compact. This is what the rehearsal exercise Exercise 3.29 uses, for K×Sn−1K \times S^{n-1}.

Example 3.5 Proving compactness in practice

(a) The closed unit disc, the unit sphere, a closed box in Rn\mathbb{R}^n: closed (preimages of closed sets under continuous functions, 2B.1 Metric Spaces) and bounded, hence compact by Heine–Borel.

(b) The graph of a continuous function on [a,b][a, b]. G={(x,f(x)):x∈[a,b]}G = \{(x, f(x)) : x \in [a, b]\} is the image of the compact interval [a,b][a, b] under the continuous map x↦(x,f(x))x \mapsto (x, f(x)), so it is compact by Theorem 3.14 below. (Alternatively, it is closed and bounded in R2\mathbb{R}^2.)

(c) A convergent sequence with its limit. If xn→xx_n \to x in any metric space, then K={x}∪{xn:n≥1}K = \{x\} \cup \{x_n : n \geq 1\} is compact. Given a sequence in KK: either it takes some value infinitely often, giving a constant subsequence, or it visits infinitely many different xnx_n's, and then a subsequence runs through terms xnkx_{n_k} with nk→∞n_k \to \infty, which converge to x∈Kx \in K.

(d) Not compact: an open interval. (0,1)(0, 1) is bounded but not closed in R\mathbb{R}; the sequence 1n\frac1n has no subsequence converging in (0,1)(0, 1).

In general metric spaces "closed and bounded" is not enough.

Example 3.6 Closed and bounded but not compact

(a) An infinite set with the discrete metric is closed (in itself) and bounded (every distance is at most 11). But a sequence of distinct points has no convergent subsequence, since convergent sequences in the discrete metric are eventually constant.

(b) In C([0,1])C([0, 1]) with the sup metric, the closed unit ball {f:∣f∣≤1}\{f : |f| \leq 1\} is closed and bounded. Consider fn(x)=xnf_n(x) = x^n. Its pointwise limit is 00 on [0,1)[0, 1) and 11 at x=1x = 1, which is not continuous. Any uniformly convergent subsequence would converge to a continuous function equal to this pointwise limit (2B.5 Uniform Convergence and Arzelà–Ascoli), which is impossible. So (fn)(f_n) has no convergent subsequence, and the ball is not compact.

Example 3.7 Which groups of matrices are compact?

Identify n×nn \times n matrices with points of Rn2\mathbb{R}^{n^2}, so that Heine–Borel applies.

The orthogonal group O(n)={A:ATA=I}O(n) = \{A : A^{\mathsf T}A = I\} is compact. It is closed, because A↦ATAA \mapsto A^{\mathsf T}A is continuous (its entries are polynomials in the entries of AA) and O(n)O(n) is the preimage of the single point II. It is bounded, because the columns of an orthogonal matrix are unit vectors, so every entry has absolute value at most 11. The rotation group SO(n)SO(n), cut out of O(n)O(n) by the further closed condition det⁡A=1\det A = 1, is compact too.

The general linear group GL(n)GL(n) of invertible matrices is not compact. It is not bounded (it contains tItI for every t≠0t \neq 0), and it is not closed either: 1kI\frac1kI is invertible for every kk but converges to the zero matrix, which isn't. Both failures are on show at once.

The special linear group SL(n)={det⁡A=1}SL(n) = \{\det A = 1\}, for n≥2n \geq 2, is closed but not compact. It is the preimage of 11 under the continuous function det⁡\det, hence closed, but it contains diag⁡(t,1/t,1,…,1)\operatorname{diag}(t, 1/t, 1, \dots, 1) for every t>0t > 0, so it is unbounded. Its elements can stretch without limit in one direction as long as they shrink in another.

Compactness of O(n)O(n) is used throughout geometry. It is why a continuous function of a rotation always has a best rotation, why averaging over the rotation group makes sense (8A.5 Lie Groups and Group Actions), and why the isometries of a compact Riemannian manifold form a compact group.

In the world In use Superimposing two molecules

Two measurements of the same protein give two lists of atom positions a1,…,aNa_1, \dots, a_N and b1,…,bNb_1, \dots, b_N in R3\mathbb{R}^3, in different orientations. To compare the shapes, structural biologists move both centroids to the origin and find the rotation RR that brings the first list closest to the second, minimising

E(R)=∑i=1N∥Rai−bi∥2E(R) = \sum_{i=1}^N\|Ra_i - b_i\|^2

over R∈SO(3)R \in SO(3). They report the root-mean-square deviation E(R)/N\sqrt{E(R)/N} at the best RR. That a best rotation exists is the maximum principle: EE is a continuous function on the compact space SO(3)SO(3), so it attains its minimum. Computing it is linear algebra, solved in closed form through a singular value decomposition by Wolfgang Kabsch in 1976, and standard in protein-structure software since. Over a non-compact set of matrices the question could lose its answer, and over all of GL(3)GL(3), which can squash the molecule, it would no longer be a comparison of shapes anyway.

Both examples have something in common: points that stay a fixed distance apart, with no way of being grouped into finitely many small clusters. That observation is the content of the next characterisation.

Complete and totally bounded

Definition 3.8 Totally bounded, ε-net

A metric space XX is totally bounded if for every ε>0\varepsilon > 0 it can be covered by finitely many balls of radius ε\varepsilon. The centres of such a cover form an ε-net: every point of XX is within ε\varepsilon of one of them.

Totally bounded means "finite at every resolution". However fine a resolution ε\varepsilon you choose, finitely many probes suffice to see every point to within ε\varepsilon. In Rn\mathbb{R}^n, a bounded set is totally bounded: put it in a cube and use the points of a fine grid. In the discrete example, it fails at ε=12\varepsilon = \tfrac12, since each ball of radius 12\tfrac12 contains a single point.

In the world In use How many sensors cover a field?

To monitor a region KK with sensors that each detect anything within range ε\varepsilon, you need an ε\varepsilon-net of KK, and the smallest number of sensors is the least size of an ε\varepsilon-net, called the covering number N(ε)N(\varepsilon). For a bounded region of the plane, N(ε)N(\varepsilon) grows like ε−2\varepsilon^{-2} as ε→0\varepsilon \to 0: halve the range and you need about four times as many sensors (Figure 3.2). For a region in Rn\mathbb{R}^n it grows like ε−n\varepsilon^{-n}. This scaling is used in reverse to define dimension for irregular sets (the box-counting dimension of a coastline or a fractal). Covering numbers also appear in statistical learning theory, where the number of ε\varepsilon-distinguishable hypotheses controls how much data a learning method needs. Total boundedness is exactly the statement that N(ε)N(\varepsilon) is finite for every ε\varepsilon.

Figure 3.2. ε-nets of the unit disc at two resolutions. The centres of the small circles are within ε\varepsilon of every point of the disc. Halving ε\varepsilon roughly quadruples the number of circles needed, the signature of a two-dimensional set.
Theorem 3.9 Compact means complete and totally bounded

A metric space is compact if and only if it is complete and totally bounded.

Proof. Compact ⇒ complete. A Cauchy sequence has a convergent subsequence, so it converges (2B.2 Completeness and Contraction).

Compact ⇒ totally bounded. Suppose that for some ε>0\varepsilon > 0 no finite collection of ε\varepsilon-balls covers XX. Pick x1x_1; then pick x2x_2 outside B(x1,ε)B(x_1, \varepsilon); then x3x_3 outside B(x1,ε)∪B(x2,ε)B(x_1, \varepsilon) \cup B(x_2, \varepsilon); and so on, which never stops. The points satisfy d(xm,xn)≥εd(x_m, x_n) \geq \varepsilon for m≠nm \neq n, so no subsequence is Cauchy, and none converges.

Complete and totally bounded ⇒ compact. Let (xn)(x_n) be any sequence. Cover XX by finitely many balls of radius 11. One of them contains xnx_n for infinitely many nn; keep only those terms, a subsequence S1S_1. Cover XX by finitely many balls of radius 12\tfrac12; one of them contains infinitely many terms of S1S_1; keep those, a subsequence S2⊆S1S_2 \subseteq S_1. Continue with radii 14,18,…\tfrac14, \tfrac18, \dots. Now take the diagonal: the first term of S1S_1, the second term of S2S_2, the third of S3S_3, and so on (each later one chosen further along than the previous). From the kk-th term on, the diagonal sequence lies in SkS_k, inside one ball of radius 21−k2^{1-k}, so any two of those terms are within 22−k2^{2-k}. The diagonal sequence is Cauchy, and by completeness it converges.

The diagonal argument in the last step, "refine infinitely often, then take the diagonal", is a technique to remember. It reappears in the proof of the Arzelà–Ascoli theorem (2B.5 Uniform Convergence and Arzelà–Ascoli) and in every compactness theorem built on it.

Open covers

There is a third characterisation, which looks nothing like the other two. It is the one that generalises to spaces without a metric (7A.2 Compactness and Compactification), and it is often the most convenient for proofs that patch local information together.

Definition 3.10 Open cover

An open cover of a metric space XX is a collection of open sets whose union is XX. A finite subcover is a finite subcollection that still covers XX.

Theorem 3.11 Compactness by open covers

A metric space is compact if and only if every open cover has a finite subcover.

The proof uses a lemma that is worth knowing on its own.

Lemma 3.12 Lebesgue number

If XX is compact and {Uα}\{U_\alpha\} is an open cover of XX, there is a δ>0\delta > 0 (a Lebesgue number) such that every ball of radius δ\delta lies inside a single UαU_\alpha.

Proof. Suppose not. Then for each nn there is a ball B(xn,1n)B(x_n, \tfrac1n) lying in no single UαU_\alpha. A subsequence xnkx_{n_k} converges to some xx. This xx lies in some UαU_\alpha, which contains a ball B(x,r)B(x, r). For kk large, d(xnk,x)<r/2d(x_{n_k}, x) < r/2 and 1nk<r/2\tfrac1{n_k} < r/2, so B(xnk,1nk)⊆B(x,r)⊆UαB(x_{n_k}, \tfrac1{n_k}) \subseteq B(x, r) \subseteq U_\alpha, a contradiction.

Proof. Sequentially compact ⇒ finite subcovers. Let δ\delta be a Lebesgue number for the cover, and take a finite δ\delta-net {y1,…,ym}\{y_1, \dots, y_m\}, by total boundedness. Each ball B(yi,δ)B(y_i, \delta) lies in some UαiU_{\alpha_i}, and the balls cover XX, so Uα1,…,UαmU_{\alpha_1}, \dots, U_{\alpha_m} cover XX.

Finite subcovers ⇒ sequentially compact. Suppose (xn)(x_n) has no convergent subsequence. Then each point y∈Xy \in X has a ball B(y,ry)B(y, r_y) containing xnx_n for only finitely many nn (otherwise we could extract a subsequence converging to yy, taking radii 1k\tfrac1k). These balls cover XX. A finite subcover would contain xnx_n for only finitely many nn in total, but it covers every xnx_n. Contradiction.

Figure 3.3. Top: an open cover of [0,1][0, 1], with a finite subcover highlighted. Bottom: the open intervals (1n,2)(\tfrac1n, 2) cover (0,1](0, 1], but any finitely many of them miss the points near 00. The missing point 00 is what (0,1](0, 1] lacks.

From local to global. The open-cover form is the natural tool when information is local: true near each point, with a neighbourhood that varies from point to point. Here is the simplest instance. Suppose a function f:X→Rf : X \to \mathbb{R} on a compact space is locally bounded: every point xx has an open ball BxB_x on which ∣f∣≤Mx|f| \leq M_x. The balls BxB_x cover XX, so finitely many of them, Bx1,…,BxmB_{x_1}, \dots, B_{x_m}, already do, and then ∣f∣≤max⁡(Mx1,…,Mxm)|f| \leq \max(M_{x_1}, \dots, M_{x_m}) everywhere. A maximum of finitely many bounds is a bound. On (0,1](0, 1] the function 1/x1/x is locally bounded and not bounded, because the balls on which it is bounded have no finite subcover near 00.

The proof has the same shape every time: get a local statement with a local constant, cover, take a finite subcover, take the worst of finitely many constants. Partitions of unity (8A.2 Partitions of Unity) push the idea further, gluing local constructions rather than local bounds, and on a compact manifold they need only finitely many charts for exactly this reason.

A Lebesgue number, computed. Cover [0,1][0, 1] by U1=(−1,23)U_1 = (-1, \frac23) and U2=(13,2)U_2 = (\frac13, 2). A ball of radius δ\delta about x∈[0,1]x \in [0, 1] is the interval (x−δ,x+δ)(x - \delta, x + \delta). Points near the ends have plenty of room, and the hardest point is the middle of the overlap, x=12x = \frac12, whose ball fits in U1U_1 only if 12+δ≤23\frac12 + \delta \leq \frac23 and in U2U_2 only if 12−δ≥13\frac12 - \delta \geq \frac13. So the largest Lebesgue number is 16\frac16, half the width of the overlap. The general lesson is visible here: the Lebesgue number measures how generously the sets of the cover overlap, and compactness says that the generosity cannot shrink to zero.

Which form to use. The sequential form suits proofs by contradiction, where a sequence of worse and worse counterexamples is extracted and passed to a limit; the template below is of this kind. The cover form suits direct proofs that patch local facts together. Total boundedness suits counting and approximation: it is what one checks to prove that a set of functions is compact in 2B.5 Uniform Convergence and Arzelà–Ascoli, and what one estimates to measure the size of a set. Since the three are equivalent for metric spaces, a good analyst moves between them freely, choosing whichever makes the current proof shortest.

One more consequence of compactness is used so often that it deserves a name. It is the abstract form of the nested intervals in the proof of Bolzano–Weierstrass (2A.6 Sequences).

Theorem 3.13 Cantor's intersection theorem

Let K1⊇K2⊇K3⊇⋯K_1 \supseteq K_2 \supseteq K_3 \supseteq \cdots be nonempty compact subsets of a metric space. Then ⋂nKn\bigcap_n K_n is nonempty. If moreover the diameters sup⁡{d(x,y):x,y∈Kn}\sup\{d(x, y) : x, y \in K_n\} tend to 00, the intersection is a single point.

Proof. Choose xn∈Knx_n \in K_n. All xnx_n lie in the compact set K1K_1, so a subsequence xnkx_{n_k} converges to some x∈K1x \in K_1. For each fixed mm, the terms with nk≥mn_k \geq m lie in Knk⊆KmK_{n_k} \subseteq K_m, and KmK_m is closed, so the limit xx lies in KmK_m. Hence x∈⋂mKmx \in \bigcap_m K_m. If the diameters tend to 00, two points x,yx, y of the intersection satisfy d(x,y)≤diam⁡Kmd(x, y) \leq \operatorname{diam} K_m for every mm, so d(x,y)=0d(x, y) = 0.

Compactness is needed: the nested closed sets [n,∞)[n, \infty) in R\mathbb{R} have empty intersection (escape to infinity), and so do the nested sets (0,1n](0, \frac1n] in the space (0,1](0, 1] (a missing point).

Continuous functions on compact spaces

Continuity between metric spaces was defined in 2B.1 Metric Spaces, together with its equivalent forms: by ε\varepsilon and δ\delta, by sequences (xn→xx_n \to x implies f(xn)→f(x)f(x_n) \to f(x)), and by preimages of open or closed sets. The sequential form is the one that combines most easily with compactness.

Theorem 3.14 Continuous functions on compact spaces

Let XX be compact and f:X→Yf : X \to Y continuous. Then:

  1. f(X)f(X) is compact.
  2. If Y=RY = \mathbb{R}, then ff attains a maximum and a minimum (the maximum principle).
  3. ff is uniformly continuous: for every ε>0\varepsilon > 0 there is a single δ>0\delta > 0 with dY(f(x),f(x′))<εd_Y(f(x), f(x')) < \varepsilon whenever dX(x,x′)<δd_X(x, x') < \delta.

Proof. (1) A sequence in f(X)f(X) has the form f(xn)f(x_n). A subsequence xnkx_{n_k} converges to some xx, and by continuity f(xnk)→f(x)∈f(X)f(x_{n_k}) \to f(x) \in f(X).

(2) f(X)f(X) is a compact subset of R\mathbb{R}, so it is closed and bounded and contains its supremum and infimum.

(3) Suppose not. Then for some ε>0\varepsilon > 0 and every nn there are xn,xn′x_n, x'_n with d(xn,xn′)<1nd(x_n, x'_n) < \tfrac1n but d(f(xn),f(xn′))≥εd(f(x_n), f(x'_n)) \geq \varepsilon. Pass to a subsequence along which xnk→xx_{n_k} \to x; then xnk′→xx'_{n_k} \to x too. By continuity both f(xnk)f(x_{n_k}) and f(xnk′)f(x'_{n_k}) tend to f(x)f(x), so their distance tends to 00, contradicting ≥ε\geq \varepsilon.

Part 3 is Heine–Cantor (2A.9 Continuous Functions) in general, with the same proof. Part 2 is the maximum principle of 2A.9 Continuous Functions, now valid for continuous functions on any compact space: on a closed square, on a sphere, on the space of positions of a mechanical linkage, or on a compact manifold, which is the setting of Hamilton's maximum principle (11A.7 Maximum Principles under Ricci Flow).

Corollary 3.15 Nearest points and positive gaps

Let KK be a nonempty compact subset of a metric space XX.

  1. For every x∈Xx \in X there is a point k0∈Kk_0 \in K nearest to xx: d(x,k0)=inf⁡k∈Kd(x,k)d(x, k_0) = \inf_{k \in K} d(x, k).
  2. If F⊆XF \subseteq X is closed and disjoint from KK, then there is δ>0\delta > 0 with d(k,y)≥δd(k, y) \geq \delta for all k∈Kk \in K and y∈Fy \in F.

Proof. (1) The function k↦d(x,k)k \mapsto d(x, k) is continuous on KK (it is 11-Lipschitz), so it attains its minimum by the maximum principle. (2) The function k↦d(k,F)=inf⁡y∈Fd(k,y)k \mapsto d(k, F) = \inf_{y \in F} d(k, y) is continuous (2B.1 Metric Spaces) and positive on KK: it is zero only at points of F‾=F\overline{F} = F, and FF misses KK. A positive continuous function on a compact set has a positive minimum δ\delta.

Both parts fail without compactness. In R2\mathbb{R}^2, the closed sets {y=0}\{y = 0\} and {y=1/x,x>0}\{y = 1/x, x > 0\} are disjoint, but the gap between them shrinks to 00 as x→∞x \to \infty. And in the space (0,1](0, 1] there is no point nearest to −1-1. Part 2 is used constantly to keep a definite distance between a compact set and the boundary of a region containing it, for instance to fit a whole ball of fixed radius around every point of a compact set (Exercise 3.28).

Minimisers need compactness

The maximum principle is the simplest existence theorem for minimisers: a continuous function on a compact space attains its minimum. Physics and geometry are full of minimisation problems (least area, least energy, shortest path), and the nineteenth century often took for granted that each has a solution. That assumption was wrong, and the reason it was wrong is compactness.

Example 3.16 A minimum that does not exist

Among continuously differentiable functions ff on [−1,1][-1, 1] with f(−1)=−1f(-1) = -1 and f(1)=1f(1) = 1, minimise

E(f)=∫−11x2f′(x)2 dx.E(f) = \int_{-1}^1 x^2 f'(x)^2\,dx.

Certainly E(f)≥0E(f) \geq 0. Try the functions fε(x)=arctan⁡(x/ε)/arctan⁡(1/ε)f_\varepsilon(x) = \arctan(x/\varepsilon)/\arctan(1/\varepsilon), which rise steeply near 00 and are nearly flat elsewhere. Writing cε=arctan⁡(1/ε)c_\varepsilon = \arctan(1/\varepsilon), which tends to π2\frac\pi2 as ε→0\varepsilon \to 0,

E(fε)=1cε2∫−11x2ε2(x2+ε2)2 dx≤1cε2∫−11ε2x2+ε2 dx,E(f_\varepsilon) = \frac{1}{c_\varepsilon^2}\int_{-1}^1\frac{x^2\varepsilon^2}{(x^2 + \varepsilon^2)^2}\,dx \leq \frac{1}{c_\varepsilon^2}\int_{-1}^1\frac{\varepsilon^2}{x^2 + \varepsilon^2}\,dx,

and the last integral is 2εarctan⁡(1/ε)=2εcε2\varepsilon\arctan(1/\varepsilon) = 2\varepsilon c_\varepsilon, so E(fε)≤2εcεE(f_\varepsilon) \leq \frac{2\varepsilon}{c_\varepsilon}, using x2x2+ε2≤1\frac{x^2}{x^2 + \varepsilon^2} \leq 1. So E(fε)→0E(f_\varepsilon) \to 0, and the infimum of EE is 00. But no admissible ff has E(f)=0E(f) = 0: that would force x2f′(x)2=0x^2f'(x)^2 = 0, so f′=0f' = 0 away from x=0x = 0, and then everywhere by continuity of f′f', so ff would be constant, contradicting f(−1)≠f(1)f(-1) \neq f(1).

Read the example through the three ways of losing compactness listed at the end of this chapter. The minimising sequence fεf_\varepsilon is trying to converge to the step function that jumps from −1-1 to 11 at 00, where the weight x2x^2 makes steepness free. That limit is not in the space: a minimising sequence approaching a missing point.

Karl Weierstrass gave an example of this kind in 1870, against the Dirichlet principle, the assumption, used by Riemann among others, that a natural energy always has a minimiser. Repairing the principle took decades. The modern repair, the direct method of the calculus of variations (6A.11 Calculus of Variations and Gradient Flows), is the maximum principle with each hypothesis rebuilt: enlarge the space (to Sobolev spaces, 4A.10 Sobolev Spaces) until minimising sequences have convergent subsequences in a weaker sense (4A.7 Weak Convergence and the Direct Method), and prove that the energy cannot jump up in the limit, so that the limit is no worse than the sequence. Compactness is the heart of it, and it is the reason those later books spend so long on compactness.

A fourth consequence is that a continuous bijection from a compact space has a continuous inverse (Exercise 3.23). This is the reason compact manifolds can be recognised by building a continuous bijection, without checking the inverse separately.

The contradiction–compactness template, in full

In 2A.5 Quantifiers and the Shape of a Proof the contradiction–compactness template was stated in words, and 2A.9 Continuous Functions used it once, to show that a continuous positive function on [a,b][a, b] has a positive lower bound. Here is the full template, and a case with all its steps, including the one that the earlier example did not need: normalisation.

To prove a uniform estimate:

  1. Suppose it fails. Negate the quantifiers to get, for each nn, a counterexample that is "nn times worse".
  2. Normalise. Rescale each counterexample so that it lies in a fixed compact set, without changing the failure.
  3. Extract a limit. By compactness, a subsequence converges.
  4. Pass to the limit. Use continuity to find what the limit satisfies.
  5. Contradict. Show that no such limit can exist.

A norm on Rn\mathbb{R}^n is a function N:Rn→[0,∞)N : \mathbb{R}^n \to [0, \infty) with N(x)=0N(x) = 0 only for x=0x = 0, N(λx)=∣λ∣ N(x)N(\lambda x) = |\lambda|\,N(x), and N(x+y)≤N(x)+N(y)N(x + y) \leq N(x) + N(y). Each norm gives a metric, d(x,y)=N(x−y)d(x, y) = N(x - y), and the three metrics of 2B.1 Metric Spaces come from the norms ∥x∥1\|x\|_1, ∥x∥2\|x\|_2 and ∥x∥∞\|x\|_\infty. We saw there that those three are uniformly equivalent. In fact all norms are.

Theorem 3.17 All norms on Rn\mathbb{R}^n are equivalent

For every norm NN on Rn\mathbb{R}^n there are constants 0<c≤C0 < c \leq C with

c ∥x∥2≤N(x)≤C ∥x∥2for all x∈Rn.c\,\|x\|_2 \leq N(x) \leq C\,\|x\|_2 \quad \text{for all } x \in \mathbb{R}^n.

Proof. The upper bound is direct. Write x=∑xieix = \sum x_i e_i in the standard basis. Then N(x)≤∑∣xi∣ N(ei)≤(max⁡iN(ei))∥x∥1≤n (max⁡iN(ei))∥x∥2N(x) \leq \sum |x_i|\,N(e_i) \leq \big(\max_i N(e_i)\big)\|x\|_1 \leq \sqrt n\,\big(\max_i N(e_i)\big)\|x\|_2. Call the constant CC. In particular ∣N(x)−N(y)∣≤N(x−y)≤C∥x−y∥2|N(x) - N(y)| \leq N(x - y) \leq C\|x - y\|_2, so NN is continuous on Rn\mathbb{R}^n with its usual metric.

The lower bound, by the template.

  1. Suppose it fails. Then no c>0c > 0 works, so for each kk (taking c=1kc = \tfrac1k) there is xkx_k with N(xk)<1k∥xk∥2N(x_k) < \tfrac1k\|x_k\|_2. Necessarily xk≠0x_k \neq 0.
  2. Normalise. Both sides scale the same way under x↦λxx \mapsto \lambda x. So replace xkx_k by uk=xk/∥xk∥2u_k = x_k / \|x_k\|_2: then ∥uk∥2=1\|u_k\|_2 = 1 and N(uk)<1kN(u_k) < \tfrac1k. The uku_k lie on the unit sphere Sn−1S^{n-1}, which is closed and bounded, hence compact by Heine–Borel.
  3. Extract a limit. A subsequence ukju_{k_j} converges to some uu with ∥u∥2=1\|u\|_2 = 1 (the sphere is closed).
  4. Pass to the limit. NN is continuous, so N(u)=lim⁡N(ukj)=0N(u) = \lim N(u_{k_j}) = 0.
  5. Contradict. A norm vanishes only at 00, but ∥u∥2=1\|u\|_2 = 1.

Every step was needed. Without normalisation, the xkx_k could run off to infinity or shrink to 00, and no compactness theorem would apply. Without compactness of the sphere, there would be no limit. Without continuity, the limit wouldn't inherit the smallness of N(uk)N(u_k). The pattern of the proof is drawn in Figure 3.4.

The theorem pays off immediately on any finite-dimensional space, not only on Rn\mathbb{R}^n itself, because a choice of basis turns such a space into Rn\mathbb{R}^n.

Example 3.18 Polynomials of bounded degree

Let Pd\mathcal P_d be the space of real polynomials of degree at most dd, a vector space of dimension d+1d + 1 with the coefficients as coordinates. Two natural norms on it are

∥p∥∞=max⁡[−1,1]∣p∣,∥p∥′=∣p(0)∣+max⁡[−1,1]∣p′∣.\|p\|_\infty = \max_{[-1, 1]}|p|, \qquad \|p\|' = |p(0)| + \max_{[-1, 1]}|p'|.

Each is a norm. The only subtle axiom is positivity, and if ∥p∥′=0\|p\|' = 0 then p′=0p' = 0 on [−1,1][-1, 1] and p(0)=0p(0) = 0, so p=0p = 0. By Theorem 3.17, applied through the coordinates, there is a constant CdC_d with

max⁡[−1,1]∣p′∣≤Cdmax⁡[−1,1]∣p∣for every p∈Pd.\max_{[-1, 1]}|p'| \leq C_d\max_{[-1, 1]}|p| \qquad \text{for every } p \in \mathcal P_d.

A polynomial of bounded degree cannot wiggle quickly without also being large. For general smooth functions nothing of the kind is true: sin⁡(kx)\sin(kx) has maximum 11 and derivative as large as kk. The restriction to degree dd is a restriction to finitely many dimensions, and that is what the compactness argument used.

The template proves that CdC_d exists, and says nothing about its size. The best constant was found by A. A. Markov in 1889: Cd=d2C_d = d^2, attained by the Chebyshev polynomial defined by Td(cos⁡θ)=cos⁡dθT_d(\cos\theta) = \cos d\theta, whose derivative at x=1x = 1 is d2d^2. Finding it took a separate and much more delicate argument.

Careful

Compactness arguments are non-constructive. They prove that a constant exists by showing that its non-existence leads to a contradiction, and they give no way of computing it. A reader who meets "there is a constant CC depending only on nn" after a compactness argument should not expect to find its value anywhere, and in geometric analysis often nobody knows it. When an explicit constant matters, a different proof is needed, and finding one is frequently a research problem of its own.

Figure 3.4. The contradiction–compactness template of 2A.5 Quantifiers and the Shape of a Proof, filled in for Theorem 3.17. Normalisation (step 2) puts the counterexamples on the compact unit sphere; continuity (step 4) carries the failure to the limit. In 12B.5 The Canonical Neighbourhood Theorem the same five boxes are filled in with Ricci flows, rescaling by curvature, and Hamilton's compactness theorem.

Why it fails in infinite dimensions. On C([0,1])C([0, 1]), the sup norm ∥f∥∞\|f\|_\infty and the area norm ∥f∥1=∫01∣f∣\|f\|_1 = \int_0^1|f| are both norms, and they are not equivalent (2B.1 Metric Spaces). Run the template and see where it breaks. Counterexamples are the tents fnf_n, with ∥fn∥1=1n\|f_n\|_1 = \tfrac1n and ∥fn∥∞=1\|f_n\|_\infty = 1, already normalised. Step 3 needs a convergent subsequence on the unit sphere {∥f∥∞=1}\{\|f\|_\infty = 1\}, and there isn't one: the sup-norm unit sphere of C([0,1])C([0, 1]) is not compact. That is the whole difference between finite and infinite dimensions. A large part of functional analysis, from weak compactness to the Rellich theorem (4A.7 Weak Convergence and the Direct Method, 4A.11 Sobolev Embeddings and Critical Exponents), is about finding substitutes for step 3 when the unit sphere is not compact.

The failure is not special to C([0,1])C([0, 1]). It happens in every infinite-dimensional normed space, and the proof uses nothing beyond this chapter.

Theorem 3.19 Riesz's theorem

The closed unit ball of a normed vector space is compact if and only if the space is finite-dimensional.

Proof. Finite dimensions. A basis identifies the space with Rn\mathbb{R}^n, and by Theorem 3.17 the norm is equivalent to the Euclidean one, so the closed unit ball is closed and bounded in Rn\mathbb{R}^n, hence compact by Heine–Borel.

Infinite dimensions. The key step is Riesz's lemma: if YY is a finite-dimensional subspace of a normed space XX and Y≠XY \neq X, there is a unit vector xx with ∥x−y∥≥12\|x - y\| \geq \frac12 for every y∈Yy \in Y. To prove it, note first that YY is closed in XX: by the equivalence of norms it is complete, and complete subsets are closed (2B.2 Completeness and Contraction). Pick z∉Yz \notin Y. Since YY is closed, δ=inf⁡y∈Y∥z−y∥>0\delta = \inf_{y \in Y}\|z - y\| > 0. Choose y0∈Yy_0 \in Y with ∥z−y0∥≤2δ\|z - y_0\| \leq 2\delta and set x=z−y0∥z−y0∥x = \frac{z - y_0}{\|z - y_0\|}. For any y∈Yy \in Y, the vector y0+∥z−y0∥ yy_0 + \|z - y_0\|\,y lies in YY, so

∥x−y∥=∥z−(y0+∥z−y0∥ y)∥∥z−y0∥≥δ2δ=12.\|x - y\| = \frac{\big\|z - (y_0 + \|z - y_0\|\,y)\big\|}{\|z - y_0\|} \geq \frac{\delta}{2\delta} = \frac12.

Now build a sequence. Start with any unit vector x1x_1. Given x1,…,xkx_1, \dots, x_k, their span YkY_k is finite-dimensional and, since the space is infinite-dimensional, not everything. Riesz's lemma gives a unit vector xk+1x_{k+1} at distance at least 12\frac12 from YkY_k, and in particular from each of x1,…,xkx_1, \dots, x_k. The unit vectors xkx_k are pairwise at least 12\frac12 apart, so no subsequence is Cauchy, and the unit ball is not compact.

Read the proof as the third way of losing compactness, oscillation in infinitely many directions, made systematic: in infinitely many dimensions there is always a new direction, at a definite distance from all the old ones, to escape into. Frigyes Riesz proved the theorem in 1918. It says that the compactness theorems of later books, such as Arzelà–Ascoli (2B.5 Uniform Convergence and Arzelà–Ascoli) and Rellich (4A.11 Sobolev Embeddings and Critical Exponents), can never apply to a whole ball. They apply to sets cut down by extra conditions, typically bounds on derivatives, which forbid the endless supply of new directions.

Where this goes The template's later versions

The equivalence of norms is used constantly and silently: it is why convergence in Rn\mathbb{R}^n doesn't depend on the norm, and it is the first step in showing that every finite-dimensional normed space behaves like Rn\mathbb{R}^n (4A.1 Banach Spaces and Bounded Operators). The template itself returns in heavier armour. In 4A.11 Sobolev Embeddings and Critical Exponents it proves Poincaré's inequality, with Rellich's theorem doing step 3. In 9B.4 Convergence of Manifolds it gives uniform geometric estimates on families of manifolds, with Cheeger–Gromov compactness doing step 3. In 12B.5 The Canonical Neighbourhood Theorem it proves Perelman's canonical neighbourhood theorem, where step 2 is parabolic rescaling by the curvature, step 3 is Hamilton's compactness theorem for Ricci flows, and step 5 uses the classification of κ-solutions.

Three ways to lose compactness

When a sequence has no convergent subsequence, it is worth asking how it escapes. In practice there are three ways, and it pays to recognise each on sight.

  1. Escape to infinity. In R\mathbb{R}, the sequence xn=nx_n = n leaves every bounded set. The space is complete, but not bounded.
  2. Approaching a missing point. In (0,1](0, 1], the sequence 1n\tfrac1n is Cauchy and heads for 00, which isn't there. The space is bounded, but not complete.
  3. Oscillation in infinitely many directions. In C([0,1])C([0, 1]), take bumps gng_n of height 11 with disjoint supports, say gng_n supported on [2−n,21−n][2^{-n}, 2^{1-n}]. Then d∞(gm,gn)=1d_\infty(g_m, g_n) = 1 for m≠nm \neq n: the sequence is bounded and lives in a complete space, but its terms point in infinitely many independent directions, and no two are close. The space is complete and bounded, but not totally bounded.
Figure 3.5. The three ways to lose compactness. Escape: the sequence leaves every bounded set. Boundary: it converges to a point missing from the space. Oscillation: it stays bounded in a complete space, but spreads over infinitely many independent directions. These panels return in 3A.3 The Lebesgue Integral, 4A.11 Sobolev Embeddings and Critical Exponents and 9B.3 Collapsing and Noncollapsing.

The three modes match the three conditions of Theorem 3.9 (bounded, complete, totally bounded), and in later books they reappear in disguise:

  • In 2A.11 The Riemann Integral and 3A.3 The Lebesgue Integral, area under a sequence of functions escapes by moving to infinity, by concentrating at a point, or by spreading thin. Concentration is a "missing point" phenomenon in a function space.
  • In Sobolev spaces (4A.11 Sobolev Embeddings and Critical Exponents), compactness of embeddings fails exactly through translation (escape) and through concentration under rescaling.
  • In Riemannian geometry (9B.3 Collapsing and Noncollapsing), a sequence of manifolds with bounded curvature can fail to converge because points run off to infinity, because the curvature blows up somewhere (a singularity), or because the manifolds collapse: they become thinner and thinner in some direction, like a cylinder whose circumference shrinks to zero. Perelman's κ-noncollapsing theorem (12A.4 κ-Noncollapsing) rules out the third mode for Ricci flow, and it is the step that makes his compactness arguments work.

Getting compactness back

Each failure suggests its own repair, and the later books use all three.

  • Against escape: follow the sequence. If xn=nx_n = n runs off to infinity, look at the sequence from where it is. Instead of asking whether the points converge, translate each configuration so that a chosen point sits at the origin, and ask whether the translated configurations converge. For a single point this is trivial, but for a sequence of functions or of spaces it is the key idea: a bump that slides off to infinity converges perfectly well once we slide along with it. The limits of Ricci flows in 11B.3 Compactness of Ricci Flows are taken this way, as pointed limits, each flow centred at a chosen point.
  • Against a missing point: add it, or stay away from it. One can enlarge the space so that the missing limit exists: the completion of 2B.2 Completeness and Contraction, or the compactifications of 7A.2 Compactness and Compactification, which add points at infinity. Or one can prove an estimate that keeps the sequence a definite distance from the hole, as κ-noncollapsing keeps a Ricci flow away from collapse (12A.4 κ-Noncollapsing).
  • Against oscillation: pay with derivatives. Bounds on derivatives forbid the wild new directions that Riesz's theorem supplies. This is the content of Arzelà–Ascoli (2B.5 Uniform Convergence and Arzelà–Ascoli), and of Hamilton's compactness theorem for Ricci flows, which turns bounds on the curvature and all its derivatives into convergent subsequences (11B.3 Compactness of Ricci Flows).

There is also a fourth move, used when a problem has symmetry: divide by the symmetry. A sequence of shapes that are all congruent to one another need not converge, since they can be moved about, but the sequence of their congruence classes is constant. In Riemannian geometry the symmetries are all diffeomorphisms, and convergence of manifolds is always meant up to diffeomorphism (9B.4 Convergence of Manifolds). Concentration and rescaling are the analogue for problems with a scaling symmetry: when a sequence concentrates at a point, blowing up by the right factor turns the concentrating piece into a fixed-size picture that can converge. That is exactly what a blow-up at a singularity of Ricci flow is (11B.5 Singularities).

History

Bernard Bolzano (1817) and Karl Weierstrass (in lectures from the 1860s) used the principle that bounded sequences of reals have convergent subsequences. Eduard Heine's 1872 proof of uniform continuity contained the covering idea implicitly; Émile Borel proved in 1895 that a countable cover of a closed bounded interval by open intervals has a finite subcover, and Henri Lebesgue extended it to arbitrary covers. The word "compact" is Maurice Fréchet's, from his 1906 thesis, the same work that introduced metric spaces (2B.1 Metric Spaces). Weierstrass's 1870 criticism of the Dirichlet principle showed that minimisation problems need compactness, and David Hilbert's rehabilitation of the principle around 1900 began the long programme that became the direct method. Riesz's theorem of 1918 explained why compactness is scarce in infinite dimensions. The contradiction–compactness method has no single inventor. It is the standard way analysts turn qualitative compactness into quantitative estimates, and it runs through geometric analysis from Gromov's work in the 1980s to Perelman's in the 2000s.

Recall Where we stand

A metric space is compact if every sequence has a convergent subsequence; equivalently, if it is complete and totally bounded; equivalently, if every open cover has a finite subcover. In Rn\mathbb{R}^n, compact means closed and bounded, but in function spaces it means much more. Continuous functions on compact spaces have compact images, attain their extremes, and are uniformly continuous. The contradiction–compactness template (negate, normalise, extract, pass to the limit, contradict) turns compactness into uniform estimates, as in the equivalence of norms on Rn\mathbb{R}^n. Compactness fails by escape, by approach to a missing point, or by oscillation in infinitely many directions. 2B.4 Connectedness turns to a different topological property, connectedness, and 2B.5 Uniform Convergence and Arzelà–Ascoli returns to compactness in the space where the guidebook needs it most, C(K)C(K).

Exercises

Exercise 3.20 Compact or not?

Which of these are compact? (a) {(x,y)∈R2:x2+y4≤1}\{(x, y) \in \mathbb{R}^2 : x^2 + y^4 \leq 1\}; (b) {0}∪{1n:n≥1}\{0\} \cup \{\tfrac1n : n \geq 1\}; (c) {1n:n≥1}\{\tfrac1n : n \geq 1\}; (d) Q∩[0,1]\mathbb{Q} \cap [0, 1]; (e) the unit sphere of R3\mathbb{R}^3 with the great-circle metric; (f) {f∈C([0,1]):∣f∣≤1}\{f \in C([0, 1]) : |f| \leq 1\} with the sup metric.

Solution

(a) Yes: closed (a preimage of (−∞,1](-\infty, 1] under a continuous function) and bounded (∣x∣,∣y∣≤1|x|, |y| \leq 1). (b) Yes: every sequence either takes some value infinitely often or has terms 1nk\tfrac1{n_k} with nk→∞n_k \to \infty, converging to 00. (c) No: 1n→0\tfrac1n \to 0, which is missing. (d) No: not closed in R\mathbb{R} (a sequence of rationals can converge to 1/21/\sqrt2). (e) Yes: the great-circle metric is equivalent to the chordal metric from R3\mathbb{R}^3 (Exercise 3.21), and the sphere is closed and bounded in R3\mathbb{R}^3. (f) No: Example 3.6.

Exercise 3.21 Two metrics on the sphere

Show that for unit vectors, the chord length ∥x−y∥2\|x - y\|_2 and the angle θ=arccos⁡(x⋅y)\theta = \arccos(x\cdot y) satisfy ∥x−y∥2=2sin⁡(θ/2)\|x - y\|_2 = 2\sin(\theta/2), and deduce 2πθ≤∥x−y∥2≤θ\frac{2}{\pi}\theta \leq \|x - y\|_2 \leq \theta. So the great-circle metric is uniformly equivalent to the chordal metric.

Solution

∥x−y∥2=2−2x⋅y=2−2cos⁡θ=4sin⁡2(θ/2)\|x - y\|^2 = 2 - 2x\cdot y = 2 - 2\cos\theta = 4\sin^2(\theta/2). For 0≤s≤π/20 \leq s \leq \pi/2, 2πs≤sin⁡s≤s\frac{2}{\pi}s \leq \sin s \leq s (the sine is concave there), and apply with s=θ/2s = \theta/2.

Exercise 3.22 Continuity by open sets

Show that f:X→Yf : X \to Y is continuous if and only if f−1(V)f^{-1}(V) is open in XX for every open V⊆YV \subseteq Y.

Solution

This is the equivalence of forms 1 and 3 in the theorem on continuity in 2B.1 Metric Spaces. In brief: if ff is continuous and f(x)∈Vf(x) \in V, a ball B(f(x),ε)⊆VB(f(x), \varepsilon) \subseteq V pulls back to a ball B(x,δ)⊆f−1(V)B(x, \delta) \subseteq f^{-1}(V); conversely, if preimages of open sets are open, the preimage of B(f(x),ε)B(f(x), \varepsilon) is an open set containing xx, so it contains a ball B(x,δ)B(x, \delta), which is the ε\varepsilon–δ\delta condition.

Exercise 3.23 Continuous bijections from compact spaces

Let XX be compact and f:X→Yf : X \to Y a continuous bijection. Show that f−1f^{-1} is continuous. (Show that ff maps closed sets to closed sets, using Proposition 3.2 and Theorem 3.14.) Then show that t↦(cos⁡t,sin⁡t)t \mapsto (\cos t, \sin t) is a continuous bijection from [0,2π)[0, 2\pi) onto the circle whose inverse is not continuous. Which hypothesis fails?

Solution

A closed F⊆XF \subseteq X is compact; f(F)f(F) is compact, hence closed in YY. So (f−1)−1(F)=f(F)(f^{-1})^{-1}(F) = f(F) is closed for every closed FF, which (taking complements) is continuity of f−1f^{-1} by Exercise 3.22. For the circle: points (cos⁡t,sin⁡t)(\cos t, \sin t) with tt slightly less than 2π2\pi are close to (1,0)(1, 0), but their preimages are near 2π2\pi, far from 0=f−1(1,0)0 = f^{-1}(1, 0). Here [0,2π)[0, 2\pi) is not compact.

Exercise 3.24 A uniform gap

Let KK be compact and f,g:K→Rf, g : K \to \mathbb{R} continuous with f(x)<g(x)f(x) < g(x) for every x∈Kx \in K. Prove, by the contradiction–compactness template, that there is ε>0\varepsilon > 0 with f(x)+ε≤g(x)f(x) + \varepsilon \leq g(x) for all x∈Kx \in K. Give an example on a non-compact set where no such ε\varepsilon exists.

Solution

If not, there are xnx_n with g(xn)−f(xn)<1ng(x_n) - f(x_n) < \tfrac1n. A subsequence converges to some x∈Kx \in K, and by continuity g(x)−f(x)≤0g(x) - f(x) \leq 0, a contradiction. (No normalisation is needed here.) Counterexample: f(x)=0f(x) = 0 and g(x)=xg(x) = x on (0,1](0, 1].

Exercise 3.25 Dini's theorem

Let KK be compact, and let fn:K→Rf_n : K \to \mathbb{R} be continuous functions that decrease pointwise to 00: f1(x)≥f2(x)≥⋯f_1(x) \geq f_2(x) \geq \cdots and fn(x)→0f_n(x) \to 0 for every xx. Prove that fn→0f_n \to 0 uniformly, by the template: suppose fn(xn)≥εf_n(x_n) \geq \varepsilon for infinitely many nn, extract xnk→xx_{n_k} \to x, and use monotonicity to show fm(x)≥εf_m(x) \geq \varepsilon for every mm. Show that fn(x)=xnf_n(x) = x^n on [0,1)[0, 1) is a counterexample when KK is not compact.

Solution

For fixed mm and nk≥mn_k \geq m, fm(xnk)≥fnk(xnk)≥εf_m(x_{n_k}) \geq f_{n_k}(x_{n_k}) \geq \varepsilon. Let k→∞k \to \infty: by continuity of fmf_m, fm(x)≥εf_m(x) \geq \varepsilon. This holds for all mm, contradicting fm(x)→0f_m(x) \to 0. On [0,1)[0, 1), xnx^n decreases to 00 pointwise but sup⁡[0,1)xn=1\sup_{[0,1)} x^n = 1 for every nn.

Exercise 3.26 Counting a net

Show that the unit square [0,1]2[0, 1]^2 (Euclidean metric) has an ε\varepsilon-net with at most (⌈1ε2⌉)2\big(\lceil \tfrac{1}{\varepsilon\sqrt2}\rceil\big)^2 points, and that any ε\varepsilon-net has at least 1πε2\frac{1}{\pi\varepsilon^2} points. Conclude that the covering number satisfies log⁡N(ε)/log⁡(1/ε)→2\log N(\varepsilon)/\log(1/\varepsilon) \to 2.

Hint

Upper bound: a square of side ε2\varepsilon\sqrt2 lies in the ball of radius ε\varepsilon around its centre. Lower bound: compare areas.

Solution

Upper bound. Let m=⌈1ε2⌉m = \lceil \frac{1}{\varepsilon\sqrt 2}\rceil, and cut [0,1]2[0, 1]^2 into m2m^2 small squares of side 1m≤ε2\frac1m \leq \varepsilon\sqrt2. A square of side ss has half-diagonal s2\frac{s}{\sqrt2}, so each small square lies within ε\varepsilon of its centre: the m2m^2 centres form an ε\varepsilon-net. Lower bound. If NN discs of radius ε\varepsilon cover the square, their total area is at least the area of the square: Nπε2≥1N\pi\varepsilon^2 \geq 1. Limit. So 1πε2≤N(ε)≤(1ε2+1)2\frac{1}{\pi\varepsilon^2} \leq N(\varepsilon) \leq \big(\frac{1}{\varepsilon\sqrt2} + 1\big)^2. Taking logarithms and dividing by log⁡(1/ε)\log(1/\varepsilon), both bounds tend to 22 as ε→0\varepsilon \to 0.

Exercise 3.27 Unions and intersections

Show that a union of finitely many compact subsets of a metric space is compact, and that an intersection of any number of compact subsets is compact. Give an example of a countable union of compact sets that is not compact.

Solution

Union of K1,…,KmK_1, \dots, K_m: a sequence in the union has infinitely many terms in some KiK_i (pigeonhole), and those terms have a subsequence converging in KiK_i. Intersection: it is a closed subset of any one of the compact sets (compact sets are closed, and an intersection of closed sets is closed), so it is compact by Proposition 3.2. Countable union: ⋃n[−n,n]=R\bigcup_n [-n, n] = \mathbb{R}, or ⋃n{n}=N\bigcup_n \{n\} = \mathbb{N}.

Exercise 3.28 A fixed-size neighbourhood of a compact set

Let KK be a compact subset of an open set U⊆RnU \subseteq \mathbb{R}^n. Show that there is r>0r > 0 such that the closed ball of radius rr around every point of KK lies in UU. Show by an example that this fails for a closed but non-compact KK.

Solution

If U=RnU = \mathbb{R}^n any rr works. Otherwise F=Rn∖UF = \mathbb{R}^n \setminus U is closed, nonempty and disjoint from KK, so by Corollary 3.15 there is δ>0\delta > 0 with d(k,y)≥δd(k, y) \geq \delta for all k∈Kk \in K, y∈Fy \in F. Take r=δ/2r = \delta/2: a point within rr of some k∈Kk \in K is not in FF, so it is in UU. Counterexample: U={(x,y):y>0}U = \{(x, y) : y > 0\} and K={(x,1/x):x≥1}K = \{(x, 1/x) : x \geq 1\}, closed in R2\mathbb{R}^2; as x→∞x \to \infty the points of KK approach the boundary of UU, so no single radius works.

Exercise 3.29 Rehearsal: uniform positivity of a family of matrices

Let KK be compact, and let x↦A(x)x \mapsto A(x) be a continuous map from KK to the symmetric n×nn \times n matrices such that each A(x)A(x) is positive definite: vTA(x)v>0v^{\mathsf T}A(x)v > 0 for v≠0v \neq 0. Prove that there is λ>0\lambda > 0 with

vTA(x) v≥λ ∥v∥2for all x∈K, v∈Rn.v^{\mathsf T}A(x)\,v \geq \lambda\,\|v\|^2 \quad \text{for all } x \in K,\ v \in \mathbb{R}^n.

(Normalise vv to the unit sphere, and apply the template on the compact set K×Sn−1K \times S^{n-1}.) This is uniform ellipticity. A second-order operator ∑aij(x)∂i∂j\sum a_{ij}(x)\partial_i\partial_j with (aij)(a_{ij}) positive definite at each point of a compact manifold is automatically uniformly elliptic, and uniform ellipticity is the hypothesis behind every estimate for the heat equation in Course 6 and for the DeTurck–Ricci flow in 11A.4 Short-Time Existence and Uniqueness.

Solution

If not, there are xk∈Kx_k \in K and vk≠0v_k \neq 0 with vkTA(xk)vk<1k∥vk∥2v_k^{\mathsf T}A(x_k)v_k < \tfrac1k\|v_k\|^2. Normalise uk=vk/∥vk∥u_k = v_k/\|v_k\|: ukTA(xk)uk<1ku_k^{\mathsf T}A(x_k)u_k < \tfrac1k. The product K×Sn−1K \times S^{n-1} is compact (a sequence has a subsequence converging in the first coordinate, and a further subsequence converging in the second), so (xkj,ukj)→(x,u)(x_{k_j}, u_{k_j}) \to (x, u) with ∥u∥=1\|u\| = 1. The function (x,u)↦uTA(x)u(x, u) \mapsto u^{\mathsf T}A(x)u is continuous, so uTA(x)u≤0u^{\mathsf T}A(x)u \leq 0, contradicting positive definiteness of A(x)A(x).

Free resources for this chapter

Chosen for what this chapter covers, and all free to read or watch. Where a lecture covers more than this chapter, the minutes to watch are given, and the link starts there when it can. Links checked Nov 6, 2026.

Read

Watch 4 lectures and talks

© 2026 Neckpinch (www.neckpinch.com). All content in the guidebook (text, mathematics, figures and exercises) is protected by copyright. All rights reserved. No part may be copied, republished or redistributed without written permission.