Tutorials › Real Analysis › Continuous Images of Compact Sets

Compactness · Tutorial 289 of 1000

Continuous Images of Compact Sets

See how continuity carries compact sets into compact images, and build intuition for the theorem through examples and a proved finite-approximation result.

Intermediate 9 min read

What You'll Learn

  • Define the image of a compact set under a continuous function
  • State the continuous-image theorem for compact subsets of the real line
  • Prove that continuous functions map compact sets to totally bounded sets
  • Use compactness to bound the image of a continuous function
  • Compute images of intervals and compact sets with isolated limit points
  • Recognize why continuity and compactness are both needed

From a Compact Domain to Its Image

The previous tutorial characterized compactness in \(\mathbb{R}\) using sequences: every sequence in a compact set has a subsequence converging to a point of that set. A continuous function respects this kind of convergence. If \(x_n\) approaches \(x\), continuity ensures that \(f(x_n)\) approaches \(f(x)\). This makes it natural to ask whether applying a continuous function to a compact set preserves compactness.

For a function \(f:K\to\mathbb{R}\), its image of \(K\) is the set of all output values \(f(x)\) as \(x\) ranges over \(K\). The compactness theorem says that if the domain \(K\) is compact and \(f\) is continuous, then this image is compact. The result is powerful because the image need not look like the original set: it may be an interval, a union of separated intervals, or a set with isolated points.

Definition (Image of a Set): If \(f:K\to\mathbb{R}\) and \(A\subseteq K\), the image of \(A\) under \(f\) is \(f(A)=\{f(x):x\in A\}\). In particular, \(f(K)\) is the set of all values taken by \(f\) on its domain.

Continuity here is understood relative to the domain \(K\). At each \(c\in K\), for every \(\varepsilon>0\), there must be a \(\delta>0\) such that \(x\in K\) and \(|x-c|<\delta\) imply \(|f(x)-f(c)|<\varepsilon\). If \(f\) is defined and continuous on all of \(\mathbb{R}\), its restriction to \(K\) is continuous in this sense.

Theorem (Continuous Images of Compact Sets): If \(K\subseteq\mathbb{R}\) is compact and \(f:K\to\mathbb{R}\) is continuous, then \(f(K)\) is compact in \(\mathbb{R}\).

The theorem includes the case \(K=\varnothing\): its image is empty, and the empty set is compact. For nonempty domains, both hypotheses matter. Compactness controls where points of the domain can go, while continuity prevents nearby domain points from being sent to output values that are far apart. We will establish a useful finite-approximation consequence of these ideas before using the theorem in examples.

Continuity Carries Convergent Sequences to Convergent Sequences

Lemma (Sequential Preservation of Continuity): Let \(f:K\to\mathbb{R}\) be continuous at \(x\in K\). If \((x_n)\) is a sequence in \(K\) and \(x_n\to x\), then \(f(x_n)\to f(x)\).

Proof. Let \(\varepsilon>0\). By continuity of \(f\) at \(x\), there is a \(\delta>0\) such that whenever \(y\in K\) and \(|y-x|<\delta\), we have \(|f(y)-f(x)|<\varepsilon\). Since \(x_n\to x\), there is an integer \(N\) such that \(n\geq N\) implies \(|x_n-x|<\delta\). Each \(x_n\) lies in \(K\), so for every \(n\geq N\), \[ |f(x_n)-f(x)|<\varepsilon. \] This is exactly the definition of \(f(x_n)\to f(x)\). \(\square\)

This lemma explains how a convergent subsequence in the domain produces a convergent subsequence of output values. If \(x_{n_j}\to x\in K\), then \(f(x_{n_j})\to f(x)\), and \(f(x)\) belongs to \(f(K)\). It is a useful sequential picture of the compact-image theorem. The lemma by itself does not assert that \(f(K)\) is compact: one must also know that a suitable convergent subsequence can be found for every sequence in the image.

A Finite-Approximation Consequence

A set \(E\subseteq\mathbb{R}\) is called totally bounded if for every \(\varepsilon>0\), there are finitely many points \(c_1,\ldots,c_m\in\mathbb{R}\) such that every point of \(E\) lies within distance \(\varepsilon\) of at least one of them. Equivalently, finitely many open intervals of radius \(\varepsilon\), centered at those points, cover \(E\). The centers need not themselves belong to \(E\).

Theorem (Continuous Images of Compact Sets Are Totally Bounded): If \(K\subseteq\mathbb{R}\) is compact and \(f:K\to\mathbb{R}\) is continuous, then \(f(K)\) is totally bounded.

Proof. If \(K=\varnothing\), then \(f(K)=\varnothing\), which is totally bounded: for any \(\varepsilon>0\), the empty collection of intervals covers it. Now suppose \(K\neq\varnothing\), and fix \(\varepsilon>0\). For each \(x\in K\), continuity at \(x\) gives a number \(\delta_x>0\) such that \[ y\in K\ \text{and}\ |y-x|<\delta_x \quad\Longrightarrow\quad |f(y)-f(x)|<\varepsilon. \] The intervals \((x-\delta_x,x+\delta_x)\), as \(x\) ranges over \(K\), form an open cover of \(K\). Since \(K\) is compact, finitely many cover it. Write these intervals as \((x_i-\delta_{x_i},x_i+\delta_{x_i})\) for \(i=1,\ldots,m\), with each \(x_i\in K\).

Take any \(z\in f(K)\). By definition of the image, \(z=f(y)\) for some \(y\in K\). The finite cover contains \(y\) in one of its intervals, say the interval centered at \(x_i\). Thus \(|y-x_i|<\delta_{x_i}\), and the choice of \(\delta_{x_i}\) gives \[ |z-f(x_i)|=|f(y)-f(x_i)|<\varepsilon. \] Therefore the finitely many centers \(f(x_1),\ldots,f(x_m)\) are an \(\varepsilon\)-net for \(f(K)\). Since \(\varepsilon>0\) was arbitrary, \(f(K)\) is totally bounded. \(\square\)

In particular, every continuous image of a compact set is bounded. For a nonempty image, apply the theorem with \(\varepsilon=1\). Every point of \(f(K)\) is then within \(1\) of one of finitely many centers \(f(x_i)\), so \[ |z|\leq |f(x_i)|+|z-f(x_i)|<|f(x_i)|+1 \] for some \(i\). The finitely many numbers \(|f(x_i)|+1\) have a maximum, giving a bound for the whole image. This is one concrete consequence of compactness and continuity, although boundedness alone is not enough to conclude that a set is compact.

Worked Examples of Compact Images

Worked Example: Squaring a Closed Interval

Let \(K=[-2,1]\) and \(f(x)=x^2\). The interval \(K\) is compact by the Heine–Borel Theorem, and \(f\) is continuous. Its image is \[ f(K)=[0,4]. \] Indeed, \(x^2\geq0\) for every \(x\in K\), and \(x^2\leq4\) because \(|x|\leq2\). Conversely, if \(y\in[0,4]\), then \(x=-\sqrt{y}\) satisfies \(-2\leq x\leq0\), so \(x\in K\) and \(f(x)=x^2=y\). Thus every value in \([0,4]\) occurs, and there are no other values. The theorem guarantees that \(f(K)\) is compact, in agreement with the fact that \([0,4]\) is closed and bounded.

Worked Example: A Compact Image That Is Not an Interval

Let \(K=[-3,-2]\cup[1,2]\), and define \(f(x)=x\). Each closed interval is compact, so their finite union \(K\) is compact. The identity function is continuous, and \[ f(K)=K=[-3,-2]\cup[1,2]. \] This image is not an interval: for example, \(0\) lies between \(-2\) and \(1\), but \(0\notin f(K)\). It is nevertheless compact, either by the continuous-image theorem or because it is closed and bounded. The theorem does not say that the image must be an interval; it says that the image retains compactness.

Worked Example: Mapping a Compact Sequence Set

Consider the compact set \(K=\{0\}\cup\{1/n:n\geq1\}\) and the continuous function \(f(x)=1/(1+x)\), defined for \(x\in K\). The denominator is positive on \(K\), and the function is continuous there. At \(x=0\), \(f(0)=1\). For \(x=1/n\), \[ f(1/n)=\frac{1}{1+1/n}=\frac{n}{n+1}. \] Therefore \[ f(K)=\left\{1\right\}\cup\left\{\frac{n}{n+1}:n\geq1\right\}. \] For every \(n\geq1\), \(1/2\leq n/(n+1)<1\), and \[ 1-\frac{n}{n+1}=\frac{1}{n+1}\longrightarrow0. \] The image values approach \(1\), which is included in the image. The continuous-image theorem guarantees that this entire set is compact, even though its elements have a different form from those in the domain.

Worked Example: Continuity Without a Compact Domain

Compactness of the domain cannot simply be dropped. Define \(f:(0,\infty)\to\mathbb{R}\) by \(f(x)=x/(1+x)\). This function is continuous, and its image is \((0,1)\). For \(x>0\), the inequalities \(0<x/(1+x)<1\) hold. Conversely, if \(0<y<1\), then \(x=y/(1-y)>0\) and \[ f(x)=\frac{y/(1-y)}{1+y/(1-y)}=y. \] Thus every \(y\in(0,1)\) occurs, but neither endpoint does. The image is not compact, since it is not closed in \(\mathbb{R}\). This does not contradict the theorem: the domain \((0,\infty)\) is not compact.

What the Theorem Does—and Does Not—Guarantee

The compact-image theorem is useful whenever a problem asks about the range of a continuous function on a compact domain. Instead of analyzing every value of the function individually, one can use compactness as a structural guarantee about the whole range. For example, the Heine–Borel Theorem then implies that \(f(K)\) is closed and bounded. In particular, a nonempty image has a maximum and a minimum, because every nonempty compact subset of \(\mathbb{R}\) has both, as established earlier in this course.

A common pitfall is to focus only on boundedness. A continuous function on a compact set does have bounded image, as the finite-approximation argument shows, but bounded sets need not be compact. The stronger theorem also ensures that the image is closed. Another pitfall is to assume that every continuous function has compact image. The domain hypothesis is essential, as the example on \((0,\infty)\) demonstrates.

The sequential viewpoint supplies a helpful guide to the proof: start with a sequence of values in \(f(K)\), choose a corresponding sequence of points in \(K\), and use compactness to find a convergent subsequence in the domain. Sequential preservation of continuity then identifies a limit value in \(f(K)\). The theorem makes this intuition precise; the finite-approximation result gives a separate consequence directly from the open-cover definition of compactness.

Check Your Understanding

Use the definitions, examples, and results in this tutorial to answer the following questions.

  1. What are the two hypotheses of the continuous-image theorem, and what conclusion does it give?
  2. In the proof that \(f(K)\) is totally bounded, why do the finitely many intervals centered at points of \(K\) yield centers in the image?
  3. Why does total boundedness imply boundedness in the argument given here?
  4. What is the image of \([-2,1]\) under \(f(x)=x^2\), and why does every value in that image occur?
  5. Why does the example \(f(x)=x/(1+x)\) on \((0,\infty)\) not contradict the compact-image theorem?