Compactness and extreme value theorems
Use finite subcovers to turn local information into global guarantees and prove that continuous objectives attain extrema.
On this page
The question for today
What you’ll understand
- State compactness through open covers and finite subcovers.
- Prove that continuous images of compact spaces are compact.
- Explain why an infimum may fail to be attained when compactness or continuity is absent.
Optimization asks for a point attaining the best value, not merely for values that approach a bound. Compactness is a powerful existence mechanism because it prevents a minimizing sequence from escaping the feasible space. Its open-cover definition also turns infinitely many local descriptions into finitely many sufficient ones. For metric spaces, this notion agrees with sequential compactness and with completeness plus total boundedness, giving several ways to choose the most useful proof.
An arbitrary open cover must have a finite witness
An open cover of K is a collection of ambient open sets whose union contains K. Compactness says that some finite subcollection still covers K. The original cover can be infinite, its members can overlap, and a finite subcover need not be unique or minimal. To prove a set is not compact, it is enough to give one open cover with no finite subcover. For (0,1), the relative open sets (1/n,1), with n at least two, cover the interval, but any finite selection misses sufficiently small positive points.
In metric spaces, compactness and sequential compactness are equivalent. One bridge is a Lebesgue number: an open cover of a compact metric space admits a positive radius such that every ball of that radius, relative to the space, fits inside some cover member. Combined with a finite net, this yields a finite subcover. The metric assumption matters when translating freely between sequences and covers; more general topological spaces need separate care. Here either formulation can be used, provided limits remain in K.
Continuous maps carry compactness forward
Let f map a compact space K continuously into a metric space Y. Pull an open cover of f(K) back through f. Continuity makes each inverse image open relative to K, and together these inverse images cover K. A finite subcover of K then supplies the corresponding finite collection covering f(K). This proof reveals why inverse images, rather than images, of open sets appear in the definition of continuity: inverse images preserve the local structure needed to transfer a cover argument.
A nonempty compact subset of the real line is bounded and contains its supremum and infimum. Therefore a continuous real-valued function on a nonempty compact domain attains both its minimum and its maximum. Alternatively, choose points whose values approach the infimum, extract a convergent subsequence in K, and use continuity to pass to the limiting value. This second proof distinguishes existence from computation: it certifies that a minimizer exists, without supplying an efficient way to find it or claiming that it is unique.
Know exactly what each hypothesis prevents
Removing compactness can lose attainment even when values stay bounded. On (0,1), the continuous function f(x)=x has infimum zero and supremum one but attains neither. Removing continuity can fail on a compact set: define f(0)=1 and f(x)=x for positive x in [0,1]. Its infimum is zero, but no point has value zero. These examples isolate separate failure mechanisms. A theorem's hypotheses are not decorative; they block specific counterexamples that can otherwise resemble well-behaved numerical problems.
In finite-dimensional Euclidean space, the Heine–Borel theorem says that closed bounded sets are compact. The finite-dimensional condition cannot be dropped. In general metric spaces use compactness itself, or completeness plus total boundedness, rather than closedness plus boundedness. A different existence strategy is coercivity: if a continuous real objective on Euclidean space tends to positive infinity when the input norm tends to infinity, a suitable compact sublevel set traps a minimizing sequence. That argument still uses compactness after constructing an appropriate bounded region.
Work it through
Locate an attained minimum on a compact interval
For f(x)=(x−2)²+1 on [0,3], justify existence of a minimum and maximum before computing them.
The interval [0,3] is nonempty, closed, and bounded in the real line, hence compact by Heine–Borel. The polynomial f is continuous, so the extreme value theorem guarantees both extrema.
The square term is nonnegative and is zero at x=2, which lies in the interval. Therefore the minimum value is 1 at x=2.
The farthest interval point from 2 is x=0, at distance 2; x=3 has distance 1. Thus the largest squared distance is 4, and the maximum value is 5 at x=0.
The minimum 1 and maximum 5 are both attained. Existence follows from the theorem, while the formula identifies where they occur.
The living notebook
Explore the model
Interactive lab · function
A quadratic on a displayed compact window
Choose positive coefficient a and move x across the lab's allowed finite interval. Predict the minimum of ax² on that interval from the location of zero and the endpoints. The displayed window is bounded; it should not be mistaken for the entire real domain or a generic constrained optimizer.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA bounded drawing supports an extrema argument only after the actual domain and its boundary are specified.
Pause & reason
Check your understanding
Your turn
Try it yourself
Give a continuous function on a bounded domain that has an infimum but no minimizer, and a discontinuous function on [0,1] with the same failure. Explain which hypothesis fails in each example.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
For the first, remove the endpoint where x would be smallest. For the second, change only the value at that endpoint.
Compare with the solution
On (0,1), f(x)=x has infimum zero, since positive inputs can be arbitrarily small, but no allowed input equals zero. The domain is bounded yet not compact. On [0,1], let g(0)=1 and g(x)=x for x>0. Again values approach zero without attaining it. This domain is compact, but g is discontinuous at zero because positive inputs approaching zero have images approaching zero rather than g(0)=1.
Keep the idea
Take it with you
- Compactness extracts a finite subcover from every open cover.
- Continuous images of compact spaces are compact, so real-valued continuous objectives attain extrema.
- An infimum is a bound; attaining it requires a point and cannot be inferred from numerical approach alone.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.