Compactness Gives Global Control
Uniform continuity asks for one input radius that controls the change in a function throughout its domain. Compactness is one important way to obtain that global control from ordinary continuity. The Heine-Cantor Theorem, established earlier in this course, says that a continuous real-valued function on a compact subset of \(\mathbb{R}\) is uniformly continuous. We will use that theorem here rather than repeat its proof.
Compactness has another consequence: continuous functions on compact sets have compact ranges. That fact leads to more than uniform continuity. It guarantees that a continuous function on a nonempty compact set is bounded and actually takes its largest and smallest values. These conclusions concern the range of the function, while uniform continuity concerns how its values change between nearby inputs.
The two roles of compactness are related but distinct. Uniform continuity controls pairs of input points; compactness of the image controls which output values occur. We will prove the compact-image result and the resulting extreme-value theorem, then use examples to clarify what compactness does—and does not—guarantee.
Continuous Images of Compact Sets
Recall that a set is compact if every open cover of it has a finite subcover. Continuity allows us to transfer an open cover of a function’s range back to an open cover of its domain. Compactness then gives a finite selection of sets on the domain, which corresponds to a finite selection covering the range.
Proof. If \(K\) is empty, then \(f(K)\) is empty and hence compact. Suppose \(K\) is nonempty, and let \(\{U_\alpha:\alpha\in A\}\) be an open cover of \(f(K)\). For each \(\alpha\), continuity makes \(f^{-1}(U_\alpha)\) open relative to \(K\). These preimages cover \(K\): for every \(x\in K\), the value \(f(x)\) belongs to some \(U_\alpha\), so \(x\in f^{-1}(U_\alpha)\).
Since \(K\) is compact, finitely many of the preimages cover it. Thus there are indices \(\alpha_1,\ldots,\alpha_n\) such that
For any \(y\in f(K)\), there is an \(x\in K\) with \(y=f(x)\). The displayed cover places \(x\) in some \(f^{-1}(U_{\alpha_j})\), and therefore \(y=f(x)\in U_{\alpha_j}\). Hence \(U_{\alpha_1},\ldots,U_{\alpha_n}\) cover \(f(K)\). Every open cover of \(f(K)\) has a finite subcover, so \(f(K)\) is compact. \(\square\)
This proof uses continuity through preimages of open sets, and compactness through the finite-subcover property. It does not require \(K\) to be an interval. In particular, gaps or isolated points in the domain cause no problem.
Worked Example: A Compact Range on a Disconnected Domain
Let \(K=[-2,-1]\cup[1,3]\), and define \(f:K\to\mathbb{R}\) by \(f(x)=x^2\). The set \(K\) is closed and bounded, so it is compact by the Heine-Borel Theorem. The function \(f\) is continuous, so the continuous-image theorem shows that \(f(K)\) is compact.
We can identify the range directly. On \([-2,-1]\), the squares run from \(1\) to \(4\); on \([1,3]\), they run from \(1\) to \(9\). Consequently,
The range is compact even though the domain has a gap between \(-1\) and \(1\). Its minimum \(1\) occurs at \(x=-1\) and \(x=1\), and its maximum \(9\) occurs at \(x=3\). The example illustrates both that compactness need not mean “an interval” and that the range can be simpler than the domain.
Continuous Functions on Compact Sets Attain Their Extrema
A compact subset of \(\mathbb{R}\) is bounded, and a nonempty compact subset of \(\mathbb{R}\) is closed. Therefore the compact-image theorem implies that the range of a continuous function on a compact domain is bounded and closed. A nonempty closed bounded subset of \(\mathbb{R}\) contains its supremum and infimum. The next result makes the attainment conclusion explicit.
Proof. The Boundedness on a Compact Domain theorem from earlier in this course says that \(f\) is bounded on \(K\). Thus the real numbers
exist. For each positive integer \(n\), the definition of supremum gives an \(x_n\in K\) with \(M-1/n<f(x_n)\leq M\). By sequential compactness in \(\mathbb{R}\), the sequence \((x_n)\) has a subsequence \((x_{n_j})\) converging to some \(x_{\max}\in K\). Continuity at \(x_{\max}\) gives \(f(x_{n_j})\to f(x_{\max})\). Also,
so \(f(x_{n_j})\to M\). Limits are unique, and hence \(f(x_{\max})=M\). Thus the supremum is attained.
For the infimum, for each positive integer \(n\) choose \(z_n\in K\) such that \(m\leq f(z_n)<m+1/n\). Sequential compactness gives a subsequence \((z_{n_j})\) converging to a point \(x_{\min}\in K\). Continuity gives \(f(z_{n_j})\to f(x_{\min})\), while
Therefore \(f(x_{\min})=m\). Since \(m\) and \(M\) are respectively the infimum and supremum of the range, every \(x\in K\) satisfies \(f(x_{\min})\leq f(x)\leq f(x_{\max})\). Both extrema are attained. \(\square\)
The nonempty-domain hypothesis matters: a function on the empty set has no point at which to attain a maximum or minimum. Compactness alone also does not make an arbitrary function attain extrema; continuity is essential to the theorem.
Worked Example: Finding the Extreme Values on a Compact Interval
Define \(f:[-1,3]\to\mathbb{R}\) by \(f(x)=x^2-2x\). The interval \([-1,3]\) is compact, and \(f\) is continuous, so the Extreme Value Theorem guarantees that both extreme values occur on the interval.
To locate them, complete the square:
Since \((x-1)^2\geq0\), we have \(f(x)\geq-1\), with equality at \(x=1\), which belongs to \([-1,3]\). Thus the minimum is \(-1\). For the maximum, \(x\in[-1,3]\) implies \(|x-1|\leq2\), so \((x-1)^2\leq4\) and \(f(x)\leq3\). Equality occurs at \(x=-1\) and \(x=3\). Direct substitution verifies both endpoint values:
Therefore the range is \([-1,3]\), with minimum \(-1\) and maximum \(3\). The theorem guarantees existence; the algebra identifies where the values occur.
Where Uniform Continuity Fits
The Heine-Cantor Theorem and the results just proved answer different questions. Heine-Cantor turns pointwise continuity into a single radius that works throughout a compact domain. The continuous-image and extreme-value results say that the range is compact and that its endpoints are achieved. All three conclusions use compactness, but none should be substituted for another.
For a subset of \(\mathbb{R}\), the Heine-Borel Theorem identifies compactness with being closed and bounded.
Continuity on a compact domain gives uniform continuity by the Heine-Cantor Theorem and a compact image by the continuous-image theorem.
Use uniform continuity for a common input radius; use compactness of the image to conclude boundedness or attainment of extrema.
Worked Example: Uniform Continuity Without Compactness
Define \(g:(0,1)\to\mathbb{R}\) by \(g(x)=x\). The domain \((0,1)\) is not compact: it is not closed in \(\mathbb{R}\). Nevertheless, \(g\) is uniformly continuous, since for all \(x,y\in(0,1)\),
Given any \(\varepsilon>0\), choosing \(\delta=\varepsilon\) makes \(|x-y|<\delta\) imply \(|g(x)-g(y)|<\varepsilon\). Thus compactness is sufficient for continuous functions to be uniformly continuous, but it is not necessary.
The range is \(g((0,1))=(0,1)\). It is bounded, but it has neither a maximum nor a minimum: for every \(x\in(0,1)\), the point \((x+1)/2\) is in \((0,1)\) and is larger than \(x\), while \(x/2\) is in \((0,1)\) and is smaller than \(x\). This contrasts with the Extreme Value Theorem, whose compact-domain hypothesis ensures attainment.
A Common Pitfall: Continuity and Uniform Continuity Are Not the Same Conclusion
A frequent error is to use continuity on a noncompact domain as if it automatically supplied one radius for all points. The Heine-Cantor Theorem requires a compact domain. Without that hypothesis, continuity alone does not generally imply uniform continuity; the earlier counterexamples on unbounded or open domains illustrate the failure.
The reverse overstatement is also incorrect: uniform continuity does not require a compact domain. The identity function on \((0,1)\) is one example. The correct lesson is that compactness is a powerful sufficient condition. When the domain is compact, continuity yields uniform continuity and, for a nonempty domain, attained extrema. When the domain is not compact, either conclusion must be checked by another argument.
Finally, distinguish “bounded range” from “attained maximum and minimum.” A range can be bounded without containing its supremum or infimum, as \((0,1)\) demonstrates. Compactness of the domain together with continuity prevents this omission by making the image compact. That is why compactness is useful not only for controlling changes in function values but also for ensuring that limiting output values are actually present.
Check Your Understanding
Use the compact-image theorem, the Extreme Value Theorem, and the distinction between sufficient and necessary conditions.
- In the proof that continuous images of compact sets are compact, why do the preimages of an open cover of \(f(K)\) cover \(K\)?
- Where does sequential compactness enter the proof that a continuous function on a compact domain attains its supremum?
- Why must the domain be nonempty in the Extreme Value Theorem as stated?
- What does the Heine-Cantor Theorem guarantee that the compact-image theorem does not directly state?
- Why does the identity function on \((0,1)\) show that compactness is not necessary for uniform continuity?