© 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.
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".
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, and that a positive quantity has a positive lower bound;
- run the contradiction–compactness template: negate, normalise, extract a limit, contradict;
- prove that all norms on 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
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 about the axis, where is the radius of the waist.
As the rings separate, the waist narrows. Then, suddenly, at a separation of about 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 at heights , a catenoid fits the rings when , that is, when
So a film with waist exists exactly when the separation is a value of . The function is continuous on , with and as , so it extends to a continuous function on the compact interval . By the maximum principle it attains a maximum, which a computation puts at , with
Below this separation there are two catenoids (a fat stable one and a thin unstable one, Figure 3.1); at 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.4 Singularities), which is where this site's name comes from.
A finer point, which a real experiment shows: for separations between about and , two flat discs have less total area than the fat catenoid, yet the film stays a catenoid until . 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.9 Calculus of Variations and Gradient Flows) and with min–max methods (10A.8 Min–Max and Width).
Sequential compactness
A metric space is compact if every sequence in has a subsequence that converges to a point of . A subset is compact if it is compact with the restricted metric, that is, if every sequence in has a subsequence converging to a point of .
Tao takes this sequential definition as primary, as we do. Its first consequences are quick.
Let be a compact subset of a metric space . Then is closed in and bounded (it lies inside some ball). A closed subset of a compact set is compact.
Proof. Closed. If and , a subsequence converges to a point of ; but every subsequence converges to , so . Bounded. If not, fix and pick with . A convergent subsequence would have bounded, which is false. Closed subsets. If is closed and , a subsequence converges to some , and because is closed.
In the converse holds.
A subset of is compact if and only if it is closed and bounded.
Proof. One direction is Proposition 3.2. For the other, let be closed and bounded and let be a sequence in . 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 such steps we have a subsequence along which every coordinate converges, so the points converge in . The limit lies in because is closed.
In general metric spaces "closed and bounded" is not enough.
(a) An infinite set with the discrete metric is closed (in itself) and bounded (every distance is at most ). But a sequence of distinct points has no convergent subsequence, since convergent sequences in the discrete metric are eventually constant.
(b) In with the sup metric, the closed unit ball is closed and bounded. Consider . Its pointwise limit is on and at , 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 has no convergent subsequence, and the ball is not compact.
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
A metric space is totally bounded if for every it can be covered by finitely many balls of radius . The centres of such a cover form an ε-net: every point of is within of one of them.
Totally bounded means "finite at every resolution". However fine a resolution you choose, finitely many probes suffice to see every point to within . In , 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 , since each ball of radius contains a single point.
To monitor a region with sensors that each detect anything within range , you need an -net of , and the smallest number of sensors is the least size of an -net, called the covering number . For a bounded region of the plane, grows like as : halve the range and you need about four times as many sensors (Figure 3.2). For a region in it grows like . 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 -distinguishable hypotheses controls how much data a learning method needs. Total boundedness is exactly the statement that is finite for every .
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 no finite collection of -balls covers . Pick ; then pick outside ; then outside ; and so on, which never stops. The points satisfy for , so no subsequence is Cauchy, and none converges.
Complete and totally bounded ⇒ compact. Let be any sequence. Cover by finitely many balls of radius . One of them contains for infinitely many ; keep only those terms, a subsequence . Cover by finitely many balls of radius ; one of them contains infinitely many terms of ; keep those, a subsequence . Continue with radii . Now take the diagonal: the first term of , the second term of , the third of , and so on (each later one chosen further along than the previous). From the -th term on, the diagonal sequence lies in , inside one ball of radius , so any two of those terms are within . 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.
An open cover of a metric space is a collection of open sets whose union is . A finite subcover is a finite subcollection that still 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.
If is compact and is an open cover of , there is a (a Lebesgue number) such that every ball of radius lies inside a single .
Proof. Suppose not. Then for each there is a ball lying in no single . A subsequence converges to some . This lies in some , which contains a ball . For large, and , so , a contradiction.
Proof. Sequentially compact ⇒ finite subcovers. Let be a Lebesgue number for the cover, and take a finite -net , by total boundedness. Each ball lies in some , and the balls cover , so cover .
Finite subcovers ⇒ sequentially compact. Suppose has no convergent subsequence. Then each point has a ball containing for only finitely many (otherwise we could extract a subsequence converging to , taking radii ). These balls cover . A finite subcover would contain for only finitely many in total, but it covers every . Contradiction.
Continuous functions on compact spaces
Continuity between metric spaces is defined as on : is continuous if implies , or equivalently if for every and there is with whenever . Equivalently again, preimages of open sets are open (Exercise 3.14).
Let be compact and continuous. Then:
- is compact.
- If , then attains a maximum and a minimum (the maximum principle).
- is uniformly continuous: for every there is a single with whenever .
Proof. (1) A sequence in has the form . A subsequence converges to some , and by continuity .
(2) is a compact subset of , so it is closed and bounded and contains its supremum and infimum.
(3) Suppose not. Then for some and every there are with but . Pass to a subsequence along which ; then too. By continuity both and tend to , so their distance tends to , contradicting .
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.4 Maximum Principles under Ricci Flow).
A fourth consequence is that a continuous bijection from a compact space has a continuous inverse (Exercise 3.15). 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 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:
- Suppose it fails. Negate the quantifiers to get, for each , a counterexample that is " times worse".
- Normalise. Rescale each counterexample so that it lies in a fixed compact set, without changing the failure.
- Extract a limit. By compactness, a subsequence converges.
- Pass to the limit. Use continuity to find what the limit satisfies.
- Contradict. Show that no such limit can exist.
A norm on is a function with only for , , and . Each norm gives a metric, , and the three metrics of 2B.1 Metric Spaces come from the norms , and . We saw there that those three are uniformly equivalent. In fact all norms are.
For every norm on there are constants with
Proof. The upper bound is direct. Write in the standard basis. Then . Call the constant . In particular , so is continuous on with its usual metric.
The lower bound, by the template.
- Suppose it fails. Then no works, so for each (taking ) there is with . Necessarily .
- Normalise. Both sides scale the same way under . So replace by : then and . The lie on the unit sphere , which is closed and bounded, hence compact by Heine–Borel.
- Extract a limit. A subsequence converges to some with (the sphere is closed).
- Pass to the limit. is continuous, so .
- Contradict. A norm vanishes only at , but .
Every step was needed. Without normalisation, the could run off to infinity or shrink to , 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 . The pattern of the proof is drawn in Figure 3.4.
Why it fails in infinite dimensions. On , the sup norm and the area norm are both norms, and they are not equivalent (2B.1 Metric Spaces). Run the template and see where it breaks. Counterexamples are the tents , with and , already normalised. Step 3 needs a convergent subsequence on the unit sphere , and there isn't one: the sup-norm unit sphere of 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.6 Weak Convergence and the Direct Method, 4A.10 Sobolev Embeddings and Critical Exponents), is about finding substitutes for step 3 when the unit sphere is not compact.
The equivalence of norms is used constantly and silently: it is why convergence in doesn't depend on the norm, and it is the first step in showing that every finite-dimensional normed space behaves like (4A.1 Banach Spaces and Bounded Operators). The template itself returns in heavier armour. In 4A.10 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.3 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.
- Escape to infinity. In , the sequence leaves every bounded set. The space is complete, but not bounded.
- Approaching a missing point. In , the sequence is Cauchy and heads for , which isn't there. The space is bounded, but not complete.
- Oscillation in infinitely many directions. In , take bumps of height with disjoint supports, say supported on . Then for : 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.
The three modes match the three conditions of Theorem 3.6 (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.10 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.
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). 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.
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 , 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 . 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, .
Exercises
Which of these are compact? (a) ; (b) ; (c) ; (d) ; (e) the unit sphere of with the great-circle metric; (f) with the sup metric.
Solution
(a) Yes: closed (a preimage of under a continuous function) and bounded (). (b) Yes: every sequence either takes some value infinitely often or has terms with , converging to . (c) No: , which is missing. (d) No: not closed in (a sequence of rationals can converge to ). (e) Yes: the great-circle metric is equivalent to the chordal metric from (Exercise 3.13), and the sphere is closed and bounded in . (f) No: Example 3.4.
Show that for unit vectors, the chord length and the angle satisfy , and deduce . So the great-circle metric is uniformly equivalent to the chordal metric.
Solution
. For , (the sine is concave there), and apply with .
Show that is continuous if and only if is open in for every open .
Let be compact and a continuous bijection. Show that is continuous. (Show that maps closed sets to closed sets, using Proposition 3.2 and Theorem 3.10.) Then show that is a continuous bijection from onto the circle whose inverse is not continuous. Which hypothesis fails?
Solution
A closed is compact; is compact, hence closed in . So is closed for every closed , which (taking complements) is continuity of by Exercise 3.14. For the circle: points with slightly less than are close to , but their preimages are near , far from . Here is not compact.
Let be compact and continuous with for every . Prove, by the contradiction–compactness template, that there is with for all . Give an example on a non-compact set where no such exists.
Solution
If not, there are with . A subsequence converges to some , and by continuity , a contradiction. (No normalisation is needed here.) Counterexample: and on .
Let be compact, and let be continuous functions that decrease pointwise to : and for every . Prove that uniformly, by the template: suppose for infinitely many , extract , and use monotonicity to show for every . Show that on is a counterexample when is not compact.
Solution
For fixed and , . Let : by continuity of , . This holds for all , contradicting . On , decreases to pointwise but for every .
Show that the unit square (Euclidean metric) has an -net with at most points, and that any -net has at least points. Conclude that the covering number satisfies .
Hint
Upper bound: a square of side lies in the ball of radius around its centre. Lower bound: compare areas.
Let be compact, and let be a continuous map from to the symmetric matrices such that each is positive definite: for . Prove that there is with
(Normalise to the unit sphere, and apply the template on the compact set .) This is uniform ellipticity. A second-order operator with 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.3 Short-Time Existence and Uniqueness.
Solution
If not, there are and with . Normalise : . The product is compact (a sequence has a subsequence converging in the first coordinate, and a further subsequence converging in the second), so with . The function is continuous, so , contradicting positive definiteness of .
© 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.