Continuous Image of Compact is Compact

lean4-prooftopologyvisualization
f:XY continuous,  K compactf(K) compactf : X \to Y \text{ continuous},\; K \text{ compact} \Rightarrow f(K) \text{ compact}

Statement

If f:XYf : X \to Y is a continuous function between topological spaces and KXK \subseteq X is compact, then the image f(K)Yf(K) \subseteq Y is compact:

K compact,  f continuousf(K) compact.K \text{ compact},\; f \text{ continuous} \Rightarrow f(K) \text{ compact.}

Visualization

Concrete example: f:[1,1]Rf : [-1, 1] \to \mathbb{R}, f(x)=x2f(x) = x^2.

Domain [-1, 1]:                     Image f([-1,1]) = [0, 1]:

  -1    -0.5    0    0.5    1          0         0.5        1
   |─────────────────────────|    →    |────────────────────|
   compact (closed, bounded)          compact (closed, bounded)

  f(-1) = 1 ────────────────────────────────────────→ 1
  f(-0.5) = 0.25 ──────────────────────────→ 0.25
  f(0)  = 0 ──────────────────────────→ 0
  f(0.5) = 0.25 ───────────────────────→ 0.25
  f(1)  = 1 ──────────────────────────────────────────→ 1

Why compactness is preserved:

PropertyDomain [1,1][-1,1]Image [0,1][0,1]
ClosedYesYes
BoundedYes (fits in [1,1][-1,1])Yes (fits in [0,1][0,1])
Compact (Heine–Borel)YesYes
Any open cover has finite subcoverYesYes

Proof idea via open covers: Suppose {Vα}\{V_\alpha\} is an open cover of f(K)f(K). Then {f1(Vα)}\{f^{-1}(V_\alpha)\} is an open cover of KK (by continuity, each f1(Vα)f^{-1}(V_\alpha) is open; since ff maps KK into Vα\bigcup V_\alpha, these preimages cover KK). Compact KK admits a finite subcover {f1(Vα1),,f1(Vαn)}\{f^{-1}(V_{\alpha_1}), \ldots, f^{-1}(V_{\alpha_n})\}. Then {Vα1,,Vαn}\{V_{\alpha_1}, \ldots, V_{\alpha_n}\} covers f(K)f(K).

Proof Sketch

  1. Let {Vα}αA\{V_\alpha\}_{\alpha \in A} be an open cover of f(K)f(K): f(K)αVαf(K) \subseteq \bigcup_\alpha V_\alpha.

  2. Since ff is continuous, each f1(Vα)f^{-1}(V_\alpha) is open in XX.

  3. We have Kf1(f(K))f1 ⁣(αVα)=αf1(Vα)K \subseteq f^{-1}(f(K)) \subseteq f^{-1}\!\left(\bigcup_\alpha V_\alpha\right) = \bigcup_\alpha f^{-1}(V_\alpha).

  4. So {f1(Vα)}\{f^{-1}(V_\alpha)\} is an open cover of KK. By compactness of KK, there is a finite subcover: Kf1(Vα1)f1(Vαn)K \subseteq f^{-1}(V_{\alpha_1}) \cup \cdots \cup f^{-1}(V_{\alpha_n}).

  5. Applying ff: f(K)Vα1Vαnf(K) \subseteq V_{\alpha_1} \cup \cdots \cup V_{\alpha_n}.

  6. Therefore f(K)f(K) is compact.

Connections

  • Heine–Borel TheoremHeine–Borel TheoremKRn  compact    K  closed and boundedK \subseteq \mathbb{R}^n \;\text{compact} \iff K \;\text{closed and bounded}In ℝⁿ, a subset is compact if and only if it is closed and boundedRead more → — in Rn\mathbb{R}^n, compactness equals closed and bounded; the theorem above combined with Heine–Borel shows that continuous images of closed bounded sets are closed and bounded — in particular, continuous functions on compact sets attain their extreme values.
  • Intermediate Value TheoremIntermediate Value Theoremf(a)yf(b)c[a,b]:  f(c)=yf(a) \le y \le f(b) \Rightarrow \exists\, c \in [a,b]:\; f(c) = yA continuous function on a closed interval hits every value between its endpointsRead more → — the IVT is an immediate corollary: [a,b][a,b] is compact and connected; continuous images of connected sets are connected; connected subsets of R\mathbb{R} are intervals; so f([a,b])f([a,b]) is an interval containing f(a)f(a) and f(b)f(b).
  • Compact Subset of Hausdorff is ClosedCompact Subset of Hausdorff is ClosedX Hausdorff,  K compactK closedX \text{ Hausdorff},\; K \text{ compact} \Rightarrow K \text{ closed}In a Hausdorff space every compact subset is closed, generalising the Heine–Borel direction compact implies closedRead more → — the image f(K)f(K) is compact; if YY is Hausdorff, then f(K)f(K) is also closed. Together these give: continuous maps from compact spaces to Hausdorff spaces are closed maps.
  • Tychonoff's TheoremTychonoff's TheoremiIXi compact    i,  Xi compact\prod_{i \in I} X_i \text{ compact} \iff \forall i,\; X_i \text{ compact}An arbitrary product of compact spaces is compact in the product topologyRead more → — the product of compact spaces is compact; combined with continuous images being compact, any continuous map from the product into another space preserves compactness on products.

Lean4 Proof

import Mathlib.Topology.Compactness.Compact

/-- The continuous image of a compact set is compact. -/
theorem continuous_image_of_compact
    {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    {f : X  Y} {s : Set X} (hs : IsCompact s) (hf : Continuous f) :
    IsCompact (f '' s) :=
  hs.image hf