From Local Continuity to Global Control
Continuity is defined locally: near each point of the domain, sufficiently close inputs have close outputs. On a compact domain, these local statements can be combined to give conclusions that hold across the whole set. In particular, a continuous real-valued function on a compact set is bounded, and if the set is nonempty, the function attains both its maximum and its minimum. Compactness also makes continuity uniform: one choice of input tolerance works at every point.
These results use different aspects of compactness. The boundedness and extreme-value conclusions follow by considering the image of the domain. Uniform continuity instead follows by selecting finitely many local neighborhoods that cover the domain. We will treat the empty set explicitly where needed: uniform continuity on it is vacuous, but a real-valued function on the empty set has no maximum or minimum because there are no values to attain.
Throughout, continuity on \(K\) means continuity relative to \(K\). We use the Heine–Borel Theorem: a subset of \(\mathbb{R}\) is compact if and only if it is closed and bounded. In particular, compact subsets of \(\mathbb{R}\) are closed and bounded. The empty set is compact, as every open cover of it has the empty finite subcover.
Compactness Passes Through Continuous Functions
A continuous function may change the shape of a set, but it preserves compactness of that set. The proof uses the open-cover definition directly: pull an open cover of the image back to a cover of the domain, choose a finite subcover there, and then return to the corresponding finitely many sets in the image cover.
Proof. Let \(\{V_\alpha\}_{\alpha\in A}\) be any open cover of \(f(K)\), with each \(V_\alpha\) open in \(\mathbb{R}\). For each \(\alpha\), continuity implies that $$ f^{-1}(V_\alpha)=\{x\in K:f(x)\in V_\alpha\} $$ is open relative to \(K\). These preimages cover \(K\): for every \(x\in K\), the value \(f(x)\) belongs to some \(V_\alpha\), so \(x\) belongs to the corresponding preimage. Compactness of \(K\) gives finitely many indices \(\alpha_1,\ldots,\alpha_m\) such that $$ K\subseteq \bigcup_{j=1}^{m} f^{-1}(V_{\alpha_j}). $$ For each \(x\in K\), this means \(f(x)\in V_{\alpha_j}\) for at least one of those indices. Hence $$ f(K)\subseteq \bigcup_{j=1}^{m}V_{\alpha_j}. $$ Thus every open cover of \(f(K)\) has a finite subcover, so \(f(K)\) is compact. If \(K=\varnothing\), then \(f(K)=\varnothing\), which is compact as well. \(\square\)
This theorem converts a fact about sets into a fact about function values. By the Heine–Borel Theorem, a compact subset of \(\mathbb{R}\) is bounded and closed. If \(K\) is nonempty, then \(f(K)\) is nonempty too. Its boundedness gives a finite supremum and infimum, and its closedness ensures those limiting values belong to the image.
Proof. By the Continuous Image of a Compact Set theorem, \(f(K)\) is compact. The Heine–Borel Theorem implies that \(f(K)\) is bounded and closed. Boundedness gives finite real numbers $$ m=\inf f(K),\qquad M=\sup f(K). $$ For each positive integer \(n\), the definition of supremum gives some \(u_n\in f(K)\) with \(M-1/n<u_n\leq M\). Therefore \(u_n\to M\). Since \(f(K)\) is closed, it contains the limit \(M\). Thus there is an \(x_{\max}\in K\) such that \(f(x_{\max})=M\). Likewise, for each \(n\) choose \(v_n\in f(K)\) with \(m\leq v_n<m+1/n\). Then \(v_n\to m\), and closedness gives \(m\in f(K)\). Hence there is an \(x_{\min}\in K\) with \(f(x_{\min})=m\). By the definitions of infimum and supremum, \(m\leq f(x)\leq M\) for all \(x\in K\). This proves boundedness and attainment of both extrema. \(\square\)
Nonemptiness matters in the extreme-value theorem. On the empty domain, boundedness is vacuous in the sense that any proposed finite bound works, but there is no point at which a maximum or minimum can be attained. The theorem is therefore stated for nonempty compact \(K\).
Uniform Continuity on Compact Sets
At each point \(a\in K\), continuity provides a neighborhood on which function values are close to \(f(a)\). These neighborhoods may have different radii. Compactness allows us to select finitely many of them, and the minimum of finitely many positive radii supplies one global tolerance.
Proof. If \(K=\varnothing\), then for any \(\varepsilon>0\) choose, for example, \(\delta=1\). There are no \(x,y\in K\) to check, so the implication in the definition of uniform continuity holds vacuously.
Now suppose \(K\neq\varnothing\), and let \(\varepsilon>0\). For each \(a\in K\), continuity at \(a\) gives a number \(r_a>0\) such that for every \(x\in K\), $$ |x-a|<r_a\quad\Longrightarrow\quad |f(x)-f(a)|<\frac{\varepsilon}{2}. $$ The relative open intervals $$ K\cap\left(a-\frac{r_a}{2},a+\frac{r_a}{2}\right),\qquad a\in K, $$ cover \(K\). Compactness gives a finite subcover, with centers \(a_1,\ldots,a_m\). Because \(K\) is nonempty, the subcover can be taken with \(m\geq1\). Set $$ \delta=\min_{1\leq i\leq m}\frac{r_{a_i}}{2}. $$ This is a positive number, since it is the minimum of finitely many positive numbers.
Take any \(x,y\in K\) with \(|x-y|<\delta\). Because the chosen intervals cover \(K\), there is an index \(i\) such that \(|x-a_i|<r_{a_i}/2\). Then $$ |y-a_i|\leq |y-x|+|x-a_i| <\delta+\frac{r_{a_i}}{2} \leq r_{a_i}. $$ Also \(|x-a_i|<r_{a_i}\). The continuity estimate at \(a_i\) therefore gives $$ |f(x)-f(a_i)|<\frac{\varepsilon}{2}, \qquad |f(y)-f(a_i)|<\frac{\varepsilon}{2}. $$ The triangle inequality yields $$ |f(x)-f(y)| \leq |f(x)-f(a_i)|+|f(a_i)-f(y)| <\varepsilon. $$ The choice of \(\delta\) depends on \(\varepsilon\) and the finite cover, not on \(x\) or \(y\). This proves uniform continuity. \(\square\)
The proof illustrates why compactness is the relevant hypothesis: it turns a potentially infinite collection of local continuity radii into a finite collection, whose minimum is still positive. The argument does not claim that every continuous function on every domain is uniformly continuous.
Worked Examples
Worked Example: Extrema and a Uniform Estimate on an Interval
Define \(f:[0,2]\to\mathbb{R}\) by \(f(x)=1/(2+x)\). The interval \([0,2]\) is compact, and the denominator is positive throughout it, so \(f\) is continuous. Its values satisfy $$ \frac14\leq \frac{1}{2+x}\leq\frac12 \qquad (0\leq x\leq2). $$ The upper equality holds at \(x=0\), and the lower equality holds at \(x=2\). Thus the maximum is \(1/2\), attained at \(0\), and the minimum is \(1/4\), attained at \(2\).
There is also a direct uniform estimate. For \(x,y\in[0,2]\), $$ |f(x)-f(y)| =\left|\frac{1}{2+x}-\frac{1}{2+y}\right| =\frac{|x-y|}{(2+x)(2+y)} \leq \frac{|x-y|}{4}, $$ because both factors in the denominator are at least \(2\). Given \(\varepsilon>0\), choosing \(\delta=4\varepsilon\) makes \(|x-y|<\delta\) imply \(|f(x)-f(y)|<\varepsilon\). This verifies uniform continuity directly as well.
Worked Example: Attained Extrema on a Compact Set with Isolated Points
Let $$ K=\{0\}\cup\left\{\frac1n:n\geq1\right\}. $$ This set is compact. To verify this from the open-cover definition, take any open cover of \(K\), and choose a member containing \(0\). It contains all real numbers in some interval \((-\eta,\eta)\) around \(0\), for some \(\eta>0\). Since \(1/n\to0\), this one cover member contains \(1/n\) for all sufficiently large \(n\). Only finitely many points of \(K\) remain, and each is contained in some member of the cover. Selecting one such member for each remaining point gives a finite subcover.
Define \(g:K\to\mathbb{R}\) by \(g(x)=x(1-x)\). This is the restriction of a polynomial, so it is continuous on \(K\). At \(x=0\) and \(x=1\), its value is \(0\). For \(x=1/n\) with \(n\geq2\), $$ g(1/n)=\frac1n\left(1-\frac1n\right). $$ For every real \(x\), the identity $$ x(1-x)=\frac14-\left(x-\frac12\right)^2 $$ shows that \(x(1-x)\leq1/4\), with equality exactly when \(x=1/2\). Since \(1/2\in K\), the maximum is \(1/4\), attained there. Also \(g(x)\geq0\) for every \(x\in K\), and \(g(0)=0\), so the minimum is \(0\), attained at both \(0\) and \(1\). This example shows that the extreme-value theorem applies even when the compact set is not an interval.
Worked Example: Compactness Cannot Be Dropped from the Boundedness Conclusion
Consider \(E=(0,1]\) and \(h:E\to\mathbb{R}\) given by \(h(x)=1/x\). The function is continuous at every point of its domain, but it is unbounded: for each positive integer \(n\), the point \(x=1/n\) belongs to \(E\) and \(h(1/n)=n\).
The domain is not compact. Indeed, the relatively open sets $$ U_n=E\cap(1/n,2),\qquad n\geq1, $$ cover \(E\). Given \(x\in E\), choose \(n\) large enough that \(1/n<x\); then \(x\in U_n\). But any finite selection of these sets has a largest index \(N\), and their union is \(U_N=(1/N,1]\). It misses \(1/(2N)\), which belongs to \(E\). Thus this cover has no finite subcover. The example shows why continuity alone does not imply boundedness when the domain is not compact.
Worked Example: Uniform Continuity Need Not Be a Lipschitz Estimate
Define \(q:[0,1]\to\mathbb{R}\) by \(q(x)=\sqrt{x}\). The Heine–Cantor theorem implies that \(q\) is uniformly continuous, since it is continuous on the compact interval \([0,1]\). In fact, if \(x\geq y\geq0\), then $$ (\sqrt{x}-\sqrt{y})^2 =x+y-2\sqrt{xy} \leq x-y, $$ because \(2y\leq2\sqrt{xy}\) when \(x\geq y\). Hence \(|\sqrt{x}-\sqrt{y}|\leq\sqrt{|x-y|}\), with the same conclusion after interchanging \(x\) and \(y\) if \(y\geq x\). Choosing \(\delta=\varepsilon^2\) proves uniform continuity.
This estimate is not a Lipschitz estimate with a fixed constant \(L\). If such an \(L\) existed, taking \(y=0\) would give \(\sqrt{x}\leq Lx\) for every \(x>0\), or \(1/\sqrt{x}\leq L\). The left side is unbounded as \(x\) approaches \(0\), a contradiction. Uniform continuity controls how small output changes become; it does not require those changes to be bounded by a constant times the input change.
What Compactness Gives—and What It Does Not
For a continuous function on a nonempty compact subset of \(\mathbb{R}\), the conclusions are global: its values remain bounded, the largest and smallest values occur at points of the domain, and one input tolerance controls output changes everywhere. The proofs use compactness in distinct ways. The image theorem transfers compactness to the set of function values, while the Heine–Cantor proof extracts a finite collection of neighborhoods from local continuity data.
These conclusions should not be confused with stronger properties. Uniform continuity need not be Lipschitz continuity, as the square-root example shows. Nor does compactness mean that the domain must be an interval: the set consisting of \(0\) and the reciprocals of positive integers is compact. Conversely, continuity on a noncompact domain does not by itself guarantee boundedness or uniform continuity. The domain hypothesis is essential to these global conclusions.
Check Your Understanding
Use the definitions and results in this tutorial to answer the following questions.
- How does taking preimages of an open cover prove that a continuous image of a compact set is compact?
- Where do closedness and boundedness of \(f(K)\) enter the proof of the Extreme-Value Theorem?
- Why does the Heine–Cantor proof use the minimum of finitely many radii rather than the minimum of all local radii?
- Why is uniform continuity on the empty set vacuous, while the Extreme-Value Theorem is stated only for nonempty compact sets?
- Give an example from this tutorial showing that uniform continuity does not imply a Lipschitz estimate.