Skip to content
Tutorials Center
My learning

Topics

Lesson 21 of 36 Β· Compactness

Compact Sets and Continuous Maps

Continuous images of compact sets are compact. Learn the extreme value theorem, compact-to-Hausdorff homeomorphisms, and see them in code.

Compactness earns its reputation through what it does to continuous functions. If you start with a compact space and apply a continuous map, the image is again compact. This single fact gives the extreme value theorem from calculus, explains when a continuous bijection is automatically a homeomorphism, and makes many existence proofs in analysis work.

This lesson proves the main results and then lets you watch them operate numerically. You should be comfortable with open covers and with the definition of continuity (preimages of open sets are open).

The image of a compact set is compact

Theorem. If X is compact and f: X β†’ Y is continuous, then f(X) is compact.

Proof. Let be an open cover of f(X) by open sets of Y. Because f is continuous, each f⁻¹(V_i) is open in X, and these sets cover X (every x has f(x) in some V_i). By compactness, finitely many f⁻¹(V_{i_1}), ..., f⁻¹(V_{i_k}) cover X. Then V_{i_1}, ..., V_{i_k} cover f(X). ∎

The proof only pulls the cover back, picks a finite part, and pushes it forward. Notice that continuity is used exactly once, to know the preimages are open.

Compactness is preserved by continuous maps, so it is a topological property: if two spaces are homeomorphic and one is compact, the other is too.

The extreme value theorem

A continuous function f: X β†’ ℝ on a compact space attains a largest and a smallest value.

Why. The image f(X) is a compact subset of ℝ, so by Heine–Borel it is closed and bounded. A nonempty closed bounded set of reals contains its supremum and infimum. So there are points a, b ∈ X with f(a) = min and f(b) = max.

Both words in "continuous on a compact set" matter:

  • f(x) = 1/x on (0, 1] is continuous but unbounded; the domain is not compact.
  • f(x) = x on (0, 1) is continuous and bounded but never reaches 0 or 1.
  • A function on [0, 1] that jumps (not continuous) can fail to attain its supremum.
Python Finding the maximum of a continuous function on a compact interval

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Uniform continuity

A continuous function on a compact metric space is uniformly continuous: for every Ξ΅ > 0 there is one Ξ΄ > 0 that works at every point (not a Ξ΄ that depends on the point). The function f(x) = 1/x on (0, 1] is continuous but not uniformly continuous; Ξ΄ must shrink as x approaches 0. On [0.1, 1] it is uniformly continuous because that interval is compact.

Continuous bijections from compact spaces

A continuous bijection need not be a homeomorphism: its inverse might not be continuous. Here is the classic example. Wrap [0, 2Ο€) around the circle by t ↦ (cos t, sin t). This is a continuous bijection, but the inverse is not continuous at the point (1, 0): points just below it on the circle have parameter close to 2Ο€, while the point itself has parameter 0.

Compactness repairs this.

Theorem. Let f: X β†’ Y be a continuous bijection, X compact and Y Hausdorff. Then f is a homeomorphism.

Proof sketch. Show that f is a closed map. A closed subset C of X is compact, so f(C) is compact. A compact subset of a Hausdorff space is closed. So images of closed sets are closed, which is the same as saying f⁻¹ is continuous. ∎

Applying this to the closed interval [0, 2Ο€] fails because [0, 2Ο€] is not injective onto the circle (the end points both map to (1, 0)). But if we identify the two ends (a quotient, seen in a later chapter) we get exactly the circle. So the circle is "the interval with its ends glued".

Python The inverse of t β†’ (cos t, sin t) on [0, 2Ο€) jumps; compactness would prevent that

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Other consequences

  • A continuous real function on a compact space is bounded.
  • The image of a closed interval under a continuous real function is a closed interval (compact and connected; connectedness comes in the next chapter).
  • A continuous function from a compact space to a discrete space takes only finitely many values.
  • If K is compact and f: K β†’ ℝ is continuous and positive, then f is bounded below by some m > 0.

That last fact is the engine behind many "choose a uniform constant" arguments: a positive continuous function on a compact set cannot get arbitrarily close to 0 since its minimum is attained and is positive.

Check your understanding

Quick check Β· 4 questions

of 4 answered You scored / 4 Β· perfect!

  1. 1. If X is compact and f: X β†’ Y is continuous, what can you conclude?

    Continuous images of compact spaces are compact. Nothing forces f to be injective, and Y itself might be large or non-compact.
  2. 2. Which function on the given domain does NOT attain a maximum?

    On the open interval (0, 1) the values of x approach 1 but never reach it. The other domains are closed and bounded.
  3. 3. Which extra hypothesis makes a continuous bijection f: X β†’ Y a homeomorphism?

    Closed subsets of the compact X are compact, their images are compact, and compact subsets of the Hausdorff Y are closed. So f maps closed sets to closed sets.
  4. 4. Why is t β†’ (cos t, sin t) from [0, 2Ο€) onto the circle not a homeomorphism?

    The map is a continuous bijection, but nearby points on the circle on either side of (1, 0) have parameters near 0 and near 2Ο€, so the inverse jumps.

Summary

  • A continuous image of a compact space is compact; proof: pull back a cover, take a finite subcover, push forward.
  • A continuous real function on a compact space attains its maximum and minimum.
  • On compact metric spaces, continuous means uniformly continuous.
  • A continuous bijection from a compact space to a Hausdorff space is a homeomorphism.
  • Both hypotheses (compact domain, Hausdorff target) are needed, as the circle example shows.

Next: Sequential Compactness and Limit Points