Continuity on Compact Sets
Imagine students is standing on a hiking trail that never gets too steep all at once, and the trail is also contained in a fixed park boundary. If the trail keeps changing smoothly, then there should be no “surprise jumps” in height, and because the park is a closed, bounded area, the highest and lowest points should actually be found somewhere on the trail. This is the core idea behind continuity on compact sets. 🌄
In this lesson, students will learn:
- what a compact set is in real analysis,
- why continuous functions behave especially well on compact sets,
- how to use the Extreme Value Theorem and the Heine–Cantor theorem,
- and how continuity on compact sets connects to the broader study of continuity.
Compact sets and why they matter
To understand continuity on compact sets, we first need the meaning of compactness. In $\mathbb{R}^n$, the most important fact is the Heine–Borel theorem: a set is compact if and only if it is closed and bounded. For example, the interval $[0,1]$ is compact, but the interval $(0,1)$ is not, because it is not closed. The set $[0,\infty)$ is not compact either, because it is not bounded.
Why is compactness useful? Because it puts strong control on how functions behave. Continuity alone tells us that small changes in input produce small changes in output near each point. Compactness adds a global finiteness effect: instead of just local control, we can often get control that works everywhere at once. This is one of the most powerful ideas in real analysis.
Think of a continuous function as a road with no sudden cliffs. If the road sits entirely inside a compact region, then the road cannot keep sneaking toward infinity or oscillating wildly without settling into manageable behavior. 🧭
Continuous functions on compact sets are bounded and attain extrema
One of the first major results is the Extreme Value Theorem. It says: if $f$ is continuous on a compact set $K$, then $f$ is bounded on $K$ and there exist points $x_{\min}, x_{\max} \in K$ such that
$$
f(x_{$\min$}) \le f(x) \le f(x_{$\max$}) \quad \text{for all } x $\in$ K.
$$
This means the function does not merely approach a highest or lowest value; it actually reaches them.
For a simple example, consider $f(x)=x^2$ on $[0,2]$. The set $[0,2]$ is compact, and $f$ is continuous, so $f$ must have a maximum and minimum there. Indeed,
$$
$\min_{x\in[0,2]} f(x)=f(0)=0, \qquad \max_{x\in[0,2]} f(x)=f(2)=4.$
$$
Now compare this with $g(x)=x$ on $(0,1)$. The function is continuous, but the domain is not compact. There is no point in $(0,1)$ where the minimum value $0$ is attained, and no point where the maximum value $1$ is attained. The function gets arbitrarily close to both values, but never reaches them.
This example shows why compactness matters: continuity plus a compact domain gives global conclusions that fail on noncompact domains.
The sequential viewpoint: compactness and continuity together
Another major way to study continuity on compact sets is through sequences. Real analysis often translates difficult statements into sequential form because sequences are easier to control.
A set $K$ in $\mathbb{R}^n$ is compact exactly when every sequence in $K$ has a convergent subsequence whose limit lies in $K$. This is called sequential compactness.
Now suppose $f:K\to\mathbb{R}$ is continuous and $x_n\to x$ with each $x_n\in K$. Then continuity gives
$$
$f(x_n) \to f(x).$
$$
This simple fact becomes very powerful when combined with compactness. If students has a sequence of points where a continuous function seems to be reaching larger and larger values, compactness helps ensure that some subsequence converges inside the set, and continuity transfers the limiting behavior of the inputs to the outputs.
For example, suppose $f$ is continuous on a compact set $K$ and let $M=\sup\{f(x):x\in K\}$. By definition of supremum, there is a sequence $(x_n)$ in $K$ such that
$$
$f(x_n) \to M.$
$$
Because $K$ is compact, a subsequence $(x_{n_k})$ converges to some $x^*\in K$. By continuity,
$$
$f(x_{n_k}) \to f(x^*).$
$$
But a subsequence of a sequence converging to $M$ still converges to $M$, so
$$
$f(x^*)=M.$
$$
That proves the supremum is attained. A similar argument proves the infimum is attained.
This sequential proof is a good example of how continuity and compactness work together: compactness gives convergent subsequences, and continuity preserves limits. 🔁
Uniform continuity on compact sets
A deeper theorem says that continuous functions on compact sets are not just continuous; they are uniformly continuous. This is the Heine–Cantor theorem.
Recall the difference:
- Continuity at a point $a$ means: for every $\varepsilon>0$, there exists $\delta>0$ such that whenever $x$ is in the domain and
$$
$|x-a|<\delta,$
$$
then
$$
$|f(x)-f(a)|<\varepsilon.$
$$
- Uniform continuity means: for every $\varepsilon>0$, there exists one $\delta>0$ that works for all points in the domain at once.
So in uniform continuity, the same $\delta$ can be used everywhere. That is a much stronger statement.
The Heine–Cantor theorem says:
If $K$ is compact and $f:K\to\mathbb{R}$ is continuous, then $f$ is uniformly continuous on $K$.
This matters because on compact sets, continuity cannot become “wild” in different places. The function’s behavior is controlled globally.
For example, $f(x)=x^2$ is uniformly continuous on $[0,1]$, because $[0,1]$ is compact. But $f(x)=x^2$ is not uniformly continuous on $\mathbb{R}$. The reason is that for very large $x$, a small change in input can produce a huge change in output. Compactness prevents that problem by keeping the domain in a bounded region.
A proof idea uses contradiction. If $f$ were not uniformly continuous, then there would exist an $\varepsilon_0>0$ and pairs $x_n,y_n\in K$ such that
$$
$|x_n-y_n|\to 0$
$$
but
$$
$|f(x_n)-f(y_n)|\ge \varepsilon_0$
$$
for every $n$. Compactness gives subsequences $x_{n_k}\to x^$ and $y_{n_k}\to x^$ because the two sequences get close to each other. Then continuity would imply both $f(x_{n_k})\to f(x^)$ and $f(y_{n_k})\to f(x^)$, forcing
$$
$|f(x_{n_k})-f(y_{n_k})|\to 0,$
$$
which contradicts the lower bound $\varepsilon_0$. So uniform continuity must hold.
Why continuity on compact sets is so important
Continuity on compact sets is one of the main bridges between local and global analysis. Local continuity says a function behaves nicely near each point. Compactness turns that into global results: boundedness, existence of maximum and minimum values, and uniform continuity.
These results are not just abstract. They appear in applications all the time. For example:
- In optimization, if a cost function is continuous on a closed bounded region, then the best and worst values are guaranteed to occur.
- In numerical methods, uniform continuity helps justify approximations because errors can be controlled with one choice of $\delta$ across the whole domain.
- In theoretical analysis, compactness is often the tool that lets us turn sequences of approximate solutions into actual limits.
A good way to remember the idea is this: continuity tells us the function does not jump, and compactness tells us the domain does not escape to infinity or miss its boundary. Together they produce strong, reliable behavior. ✅
Conclusion
Continuity on compact sets is a central theme in real analysis because it combines two powerful ideas. Continuity gives local control of a function, while compactness gives global control of the domain. Together they imply that continuous functions are bounded, attain their maximum and minimum values, and are uniformly continuous.
For students, the key takeaway is that compact sets are the “safe zones” where continuous functions behave especially well. This is why compactness appears so often in real analysis: it turns pointwise information into strong global conclusions.
Study Notes
- A set in $\mathbb{R}^n$ is compact if and only if it is closed and bounded.
- If $f$ is continuous on a compact set $K$, then $f$ is bounded on $K$.
- If $f$ is continuous on a compact set $K$, then $f$ attains both a maximum and a minimum on $K$.
- This result is called the Extreme Value Theorem.
- Compactness can also be described by sequences: every sequence in a compact set has a convergent subsequence with limit in the set.
- If $x_n\to x$ and $f$ is continuous, then $f(x_n)\to f(x)$.
- On compact sets, continuity and sequential compactness combine to show that suprema and infima are attained.
- The Heine–Cantor theorem says every continuous function on a compact set is uniformly continuous.
- Uniform continuity means one $\delta$ works for every point in the domain.
- Continuity on compact sets is a key example of how compactness strengthens local properties into global ones.
