From Closed Intervals to Compact Domains
The Heine-Cantor Theorem for intervals established that a function continuous at every point of a closed bounded interval is uniformly continuous there. The key feature is not that the domain fills an interval. The same conclusion holds on any compact subset of the real line, including sets with gaps or isolated points.
Recall that a set is compact if every open cover of the set has a finite subcover. In \(\mathbb{R}\), the Heine-Borel Theorem says that a set is compact if and only if it is closed and bounded. Thus compact domains include closed intervals, finite unions of closed bounded intervals, and closed bounded sets that may have a more irregular shape.
The conclusion is stronger than pointwise continuity. At each point \(a\in E\), continuity gives a radius that may depend on \(a\). Uniform continuity requires one choice of radius for each \(\varepsilon\) that works for every pair of points in the domain. Compactness makes it possible to pass from local control to a single global choice. In a proof, a finite subcover reduces the local information to finitely many neighborhoods; an additional argument then ensures that sufficiently close points are controlled within one of them.
What the Theorem Allows
The theorem does not require the domain to be an interval, nor does it require the function to be given by one formula on an interval containing the domain. It requires continuity on the domain itself and compactness of that domain. Continuity on \(E\) is understood relative to \(E\): at \(a\in E\), only inputs \(x\in E\) need to be considered.
Worked Example: A Compact Domain with an Accumulation Point
Consider
and define \(f:E\to\mathbb{R}\) by \(f(0)=0\) and \(f(1/n)=(1/n)\sin(n)\). Equivalently, for nonzero \(x\in E\), \(f(x)=x\sin(1/x)\). The set \(E\) is bounded, and its only accumulation point is \(0\), which belongs to \(E\); hence \(E\) is closed and compact by the Heine-Borel Theorem.
At every point \(1/n\), that point is isolated in \(E\), so the restriction \(f:E\to\mathbb{R}\) is continuous there. At \(0\), for every nonzero \(x\in E\),
Since the right-hand side tends to zero as \(x\to0\) within \(E\), \(f\) is continuous at \(0\) as well. The Heine-Cantor Theorem therefore guarantees that \(f\) is uniformly continuous on \(E\). This conclusion follows even though the formula involves \(\sin(1/x)\), which oscillates rapidly near zero: the factor \(x\) makes the function continuous at the only non-isolated point, and compactness supplies uniform continuity on the whole set.
In this example the isolated points impose no continuity restriction beyond the values at those points: each has a neighborhood containing no other points of \(E\). The point \(0\), where the domain accumulates, is where continuity needs to be checked by a limit estimate. Once continuity holds everywhere on this compact domain, the theorem gives the global conclusion.
Worked Example: A Disconnected Compact Domain
Let \(E=[-2,-1]\cup[1,3]\), and define \(f(x)=1/x\) for \(x\in E\). The domain is closed and bounded, so it is compact. The function is continuous at every point of \(E\), since none of its points is zero and the reciprocal function is continuous away from zero. The Heine-Cantor Theorem implies that \(f\) is uniformly continuous on this disconnected set.
Here one can also verify uniform continuity directly. For \(x,y\in E\), both \(|x|\geq1\) and \(|y|\geq1\), and
Thus \(f\) is Lipschitz with constant \(1\) on \(E\), which implies uniform continuity. The theorem applies without needing this special estimate; the calculation simply gives a more explicit bound for this particular function.
A Useful Consequence: Continuous Functions on Compact Sets Are Bounded
The same finite-subcover idea gives a related result. It uses the local boundedness theorem from “Continuity at a Point”: a function continuous at \(a\) is bounded on some neighborhood of \(a\), relative to its domain.
Proof. If \(E=\varnothing\), it is bounded, for example with bound \(M=0\). Now suppose \(E\ne\varnothing\). For each \(a\in E\), continuity at \(a\) and the local boundedness theorem give a radius \(r_a>0\) and a finite bound \(M_a\geq0\) such that \(|f(x)|\leq M_a\) whenever \(x\in E\) and \(|x-a|<r_a\). The open intervals \((a-r_a,a+r_a)\), as \(a\) ranges over \(E\), cover \(E\). Compactness gives a finite subcover, say the intervals centered at \(a_1,\ldots,a_k\). Set \(M=\max\{M_{a_1},\ldots,M_{a_k}\}\). Every \(x\in E\) lies in at least one of these finitely many intervals, so \(|f(x)|\leq M_{a_j}\leq M\) for some \(j\). Therefore \(f\) is bounded on \(E\). \(\square\)
The finite subcover is essential to this argument: it reduces potentially many local bounds to a finite list, whose maximum is still finite. This boundedness conclusion and the Heine-Cantor Theorem are related consequences of compactness, but boundedness alone does not establish uniform continuity. For that, the proof must control the output difference between two nearby inputs, not just the size of the function values.
Worked Example: A Continuous Function on a Finite Domain
Let \(E=\{-3,0,2,7\}\), and let \(f:E\to\mathbb{R}\) be any function. Every finite subset of \(\mathbb{R}\) is compact, and every function on \(E\) is continuous at each point of \(E\), since every point is isolated. The Heine-Cantor Theorem therefore gives uniform continuity, regardless of the four values assigned by \(f\).
There is also a direct proof. The positive distances between distinct points of \(E\) are \(2,3,5,7,\) and \(10\), so their minimum is \(2\). For any \(\varepsilon>0\), choose \(\delta=2\). If \(x,y\in E\) and \(|x-y|<2\), then \(x=y\), because every pair of distinct points is at least \(2\) apart. Hence \(|f(x)-f(y)|=0<\varepsilon\). This single \(\delta\) works for every pair, whatever the values of \(f\).
Proof. If \(E\) is empty, the defining condition for uniform continuity holds vacuously. If \(E\) has one point, choose \(\delta=1\) for any \(\varepsilon>0\); every pair \(x,y\in E\) is equal, so \(|f(x)-f(y)|=0<\varepsilon\). Now suppose \(E\) contains at least two points. There are finitely many positive distances \(|x-y|\) with \(x,y\in E\) and \(x\ne y\), so their minimum \(d\) exists and is positive. For any \(\varepsilon>0\), choose \(\delta=d\). If \(x,y\in E\) satisfy \(|x-y|<\delta=d\), they cannot be distinct, because distinct points have distance at least \(d\). Thus \(x=y\), and \(|f(x)-f(y)|=0<\varepsilon\). This proves uniform continuity. \(\square\)
Why Boundedness Alone Is Not Enough
The Heine-Cantor Theorem depends on compactness, not merely boundedness. In \(\mathbb{R}\), boundedness without closedness does not guarantee compactness. A continuous function on a bounded, noncompact domain can fail to be uniformly continuous.
Worked Example: A Continuous Function That Is Not Uniformly Continuous
Define \(f(x)=1/x\) on the bounded set \((0,1)\). The function is continuous at every point of its domain, but it is not uniformly continuous there. For each integer \(n\geq2\), let \(x_n=1/n\) and \(y_n=1/(n+1)\). Both points belong to \((0,1)\), and
But the corresponding output difference is
for every \(n\geq2\). The Sequential Criterion for Uniform Continuity therefore shows that \(f\) is not uniformly continuous. The restriction \(n\geq2\) ensures that both inputs are in the stated domain; the sequence still has input distances tending to zero while its output distances stay equal to \(1\). The domain \((0,1)\) is bounded but not compact, since it is not closed in \(\mathbb{R}\).
This example identifies the role of compactness: continuity alone gives control near each fixed point, but near the missing endpoint \(0\), the reciprocal function changes rapidly. A compact domain cannot have such a missing accumulation point. More generally, the theorem guarantees that no location in a compact domain can require an arbitrarily smaller input tolerance than every other location.
How to Apply the Heine-Cantor Theorem
When using the theorem, check the hypotheses separately. First establish that the domain is compact; for subsets of \(\mathbb{R}\), it is enough to verify that the set is closed and bounded, by Heine-Borel. Then establish continuity at every point of that domain. Only after both conditions are verified can the theorem be applied.
For a real domain, show it is closed and bounded, or identify it as a familiar compact set such as a finite union of closed bounded intervals.
Verify continuity at each point, using the domain-relative definition when the set is disconnected or has isolated points.
Apply the Heine-Cantor Theorem to obtain a common input tolerance for each prescribed output tolerance.
The conclusion is an existence statement: for each \(\varepsilon>0\), some \(\delta>0\) works uniformly. The theorem may not give a convenient formula for \(\delta\). If a quantitative estimate is available, such as a Lipschitz bound, it can provide an explicit choice. Otherwise, compactness still guarantees that a suitable choice exists.
A common error is to argue that a continuous function must be uniformly continuous simply because it is continuous at every point. The example \(1/x\) on \((0,1)\) shows why this is false. Another is to assume that the domain must be an interval: compactness permits arbitrary closed bounded subsets of the real line, including finite sets and disconnected sets. The Heine-Cantor Theorem is precisely the principle that continuity becomes uniform when the domain has this compactness property.
Check Your Understanding
Use the theorem and the examples in this tutorial to answer the following questions.
- State the two hypotheses needed to apply the Heine-Cantor Theorem to a function \(f:E\to\mathbb{R}\).
- Why is \(E=\{0\}\cup\{1/n:n\geq1\}\) compact, even though it is not an interval?
- In the boundedness proof, where is compactness used, and why does a finite subcover give one bound for all of \(E\)?
- Why does choosing the minimum distance between distinct points prove uniform continuity for a finite domain?
- For \(f(x)=1/x\) on \((0,1)\), why must the counterexample sequence start with \(n\geq2\), and what do its input and output distances show?