Tutorials › Real Analysis › Compact Functions Are Bounded

Compactness · Tutorial 291 of 1000

Compact Functions Are Bounded

Learn how compactness combines pointwise bounds from continuity into a single bound for an entire domain.

Intermediate 8 min read

What You'll Learn

  • Define what it means for a real-valued function to be bounded on its domain
  • Prove that local boundedness on a compact set gives a global bound
  • Use continuity to obtain a bound near each point
  • Prove that every continuous real-valued function on a compact set is bounded
  • Identify why compactness and continuity are each necessary
  • Apply the result to explicit functions and domains

From Local Bounds to One Global Bound

A continuous function may behave differently at different points of its domain. Continuity controls the function near each individual point, but that local control initially gives a different neighborhood and potentially a different bound at every point. Compactness provides a way to select finitely many of these neighborhoods. Taking the largest of their finitely many bounds then gives a bound for the whole domain.

This is the basic reason continuous real-valued functions on compact sets are bounded. The result also follows from the Continuous Images of Compact Sets Theorem in the previous tutorial, together with the earlier theorem that every compact subset of \(\mathbb{R}\) is bounded. Here we develop the local-to-global argument directly, so that the role of compactness in combining local information is explicit.

Definition: A function \(f:K\to\mathbb{R}\) is bounded on \(K\) if there is a real number \(M\geq0\) such that \(|f(x)|\leq M\) for every \(x\in K\). It is locally bounded on \(K\) if, for every \(x\in K\), there are a set \(V_x\) open relative to \(K\) and a number \(M_x\geq0\) such that \(x\in V_x\) and \(|f(y)|\leq M_x\) for every \(y\in V_x\).

Recall that a set \(V\subseteq K\) is open relative to \(K\) if \(V=K\cap G\) for some open set \(G\subseteq\mathbb{R}\). Thus a relative neighborhood contains domain points close to its center, even if it is not itself open in the whole real line. The local bound \(M_x\) need not be the same for different points \(x\).

Theorem (Local Boundedness on a Compact Set Gives a Global Bound): Let \(K\subseteq\mathbb{R}\) be compact, and let \(f:K\to\mathbb{R}\) be locally bounded on \(K\). Then \(f\) is bounded on \(K\).

Proof. If \(K=\varnothing\), then \(f\) is bounded on \(K\), since the defining inequality holds for every \(x\in K\) vacuously; for example, take \(M=0\). Now suppose \(K\neq\varnothing\). For each \(x\in K\), local boundedness supplies a relative open set \(V_x\) containing \(x\) and a number \(M_x\geq0\) such that \(|f(y)|\leq M_x\) for all \(y\in V_x\). The family \(\{V_x:x\in K\}\) covers \(K\).

For each \(x\), choose an open set \(G_x\subseteq\mathbb{R}\) with \(V_x=K\cap G_x\). The family \(\{G_x:x\in K\}\) also covers \(K\): if \(y\in K\), then \(y\in V_y\), so \(y\in G_y\). By compactness, finitely many of these ambient open sets cover \(K\), say \(G_{x_1},\ldots,G_{x_m}\). Consequently, \(V_{x_1},\ldots,V_{x_m}\) cover \(K\) as well. Set

$$ M=\max\{M_{x_1},\ldots,M_{x_m}\}. $$

This maximum exists because it is taken over a nonempty finite collection of real numbers. Given any \(y\in K\), choose an index \(i\) such that \(y\in V_{x_i}\). The local bound on that set gives \(|f(y)|\leq M_{x_i}\leq M\). Since this holds for every \(y\in K\), \(f\) is bounded on \(K\). \(\square\)

Continuity Supplies the Local Bounds

To apply the theorem, we need only check that continuity gives local boundedness. Fix \(x\in K\). Continuity of \(f\) at \(x\), with tolerance \(1\), gives a \(\delta_x>0\) such that for every \(y\in K\),

$$ |y-x|<\delta_x \quad\Longrightarrow\quad |f(y)-f(x)|<1. $$

The triangle inequality then gives \(|f(y)|\leq |f(x)|+|f(y)-f(x)|<|f(x)|+1\). Thus \(f\) is bounded, for example by \(|f(x)|+1\), on the relative neighborhood \(K\cap(x-\delta_x,x+\delta_x)\). This argument works at every \(x\in K\), though the neighborhood and its bound may depend on \(x\).

Theorem (Compact Functions Are Bounded): If \(K\subseteq\mathbb{R}\) is compact and \(f:K\to\mathbb{R}\) is continuous, then \(f\) is bounded on \(K\).

Proof. If \(K\) is empty, the conclusion holds vacuously. Otherwise, fix \(x\in K\). By continuity at \(x\), there is a \(\delta_x>0\) such that \(y\in K\) and \(|y-x|<\delta_x\) imply \(|f(y)-f(x)|<1\). The triangle inequality yields

$$ |f(y)|\leq |f(x)|+|f(y)-f(x)|<|f(x)|+1. $$

Hence \(f\) is bounded on the relative neighborhood \(V_x=K\cap(x-\delta_x,x+\delta_x)\), with local bound \(M_x=|f(x)|+1\). This proves that \(f\) is locally bounded on \(K\). The Local Boundedness on a Compact Set Gives a Global Bound Theorem now implies that \(f\) is bounded on \(K\). \(\square\)

There is also a short route using results established earlier. The Continuous Images of Compact Sets Theorem says that \(f(K)\) is compact. Every compact subset of \(\mathbb{R}\) is bounded, so there is an \(M\geq0\) such that \(|z|\leq M\) for every \(z\in f(K)\). Since \(f(x)\in f(K)\) for every \(x\in K\), it follows that \(|f(x)|\leq M\) throughout the domain. The local-to-global proof explains how compactness can produce a bound without first describing the image as a set.

Worked Examples

Worked Example: An Affine Function on a Compact Interval

Let \(K=[-1,4]\) and define \(f(x)=2x+1\). The interval is compact by the Heine–Borel Theorem, and \(f\) is continuous. For every \(x\in K\), the inequalities \(-1\leq x\leq4\) give

$$ -2\leq 2x\leq 8 \qquad\Longrightarrow\qquad -1\leq 2x+1\leq9. $$

Therefore \(|f(x)|\leq9\) for every \(x\in K\), so \(M=9\) is a bound. In fact, \(f(-1)=-1\) and \(f(4)=9\), so the image is \([-1,9]\) and this bound is attained. The theorem ensures that some finite bound exists even when it is not as immediate to calculate as it is for an affine function.

Worked Example: A Reciprocal Expression Away from Its Singularity

Let \(K=[-2,2]\) and set \(g(x)=1/(1+x^2)\). The denominator is positive for every real \(x\), so \(g\) is continuous on \(K\). For \(x\in[-2,2]\), we have \(0\leq x^2\leq4\), and hence \(1\leq1+x^2\leq5\). Taking reciprocals of these positive quantities reverses the inequalities:

$$ \frac{1}{5}\leq\frac{1}{1+x^2}\leq1. $$

Thus \(g\) is bounded, for instance by \(M=1\). The inequalities are sharp: \(g(0)=1\), while \(g(-2)=g(2)=1/5\). The calculation identifies a particular bound, whereas the theorem would establish existence of a bound from compactness and continuity alone.

Worked Example: A Continuous Function on a Finite Domain

Take \(K=\{-3,1,4\}\) and \(h(x)=x^2-2x\). The set \(K\) is finite and therefore compact. A polynomial is continuous, and direct substitution gives

$$ h(-3)=(-3)^2-2(-3)=9+6=15,\qquad h(1)=1^2-2(1)=1-2=-1,\qquad h(4)=4^2-2(4)=16-8=8. $$

Consequently, \(h(K)=\{-1,8,15\}\), and \(|h(x)|\leq15\) for every \(x\in K\). Here the local-to-global mechanism reduces to a finite selection of neighborhoods; the explicit calculation also shows the exact bound. The general theorem is valuable because a compact domain can have infinitely many points, so evaluating the function at each point is not an option.

Why Both Hypotheses Matter

Compactness and continuity play separate roles. Continuity gives local bounds, while compactness turns a cover by local neighborhoods into a finite cover. If the domain is not compact, continuity need not prevent the function from growing without bound. For example, \(f(x)=x\) is continuous on \(\mathbb{R}\), but it is unbounded there: for every \(M\geq0\), the point \(x=M+1\) satisfies \(|f(x)|=M+1>M\). The theorem does not apply because \(\mathbb{R}\) is not compact.

Continuity also cannot be dropped, even when the domain is compact. Define \(q:[0,1]\to\mathbb{R}\) by

$$ q(0)=0, \qquad q(x)=\frac{1}{x}\quad\text{for }0<x\leq1. $$

The domain \([0,1]\) is compact, but \(q\) is not bounded: for each \(M\geq0\), choose \(x=1/(M+1)\). Then \(0<x\leq1\) and \(q(x)=M+1>M\). The function is not continuous at \(0\), since \(q(1/n)=n\) for every positive integer \(n\), and these values do not converge to \(q(0)=0\). Thus compactness alone does not ensure bounded function values.

A common pitfall is to treat “continuous at every point” as if it supplied one common \(\delta\) and one common bound for the entire domain. Continuity is pointwise: the neighborhood and the local estimate can vary with the center. The proof does not assume otherwise. It first builds a neighborhood and a bound at each point, then uses compactness to retain finitely many neighborhoods and takes the maximum of their bounds.

The argument gives a useful general pattern: prove a property locally, cover the compact set by neighborhoods on which the property has a controlled estimate, and use a finite subcover to combine those estimates. For boundedness, the final combination is especially simple—the maximum of finitely many local bounds. In the next tutorial, this same compactness principle will help establish not only that a continuous function has finite bounds, but that it actually attains its largest and smallest values.

Check Your Understanding

Use the local-to-global proof and the examples to answer these questions.

  1. What is the difference between a function being locally bounded on \(K\) and being bounded on \(K\)?
  2. Why can the relative neighborhoods where a function is bounded be used with compactness, even if they are not open in all of \(\mathbb{R}\)?
  3. In the local-to-global theorem, why does the maximum of the finitely many selected local bounds control \(|f(y)|\) for every \(y\in K\)?
  4. How does continuity at a point \(x\) give a bound on a relative neighborhood of \(x\)?
  5. Which hypothesis fails in the example \(f(x)=x\) on \(\mathbb{R}\), and which fails in the example \(q\) on \([0,1]\)?