MATH-447 · Lesson 3 of 12 · 25 min

Continuous maps and homeomorphisms

With topological spaces defined, the next step is to define the maps between them. Lesson 1 proved that a function between metric spaces is continuous exactly when preimages of open sets are open. That characterization becomes the definition in general. This lesson develops the equivalent forms of continuity, the main ways of building continuous functions, and the notion of homeomorphism, with the standard examples every topologist carries around: stereographic projection, the wrapping of an interval around a circle, and the space-filling curve.

The definition and its equivalent forms

Definition. A function \(f : X \to Y\) between topological spaces is continuous if \(f^{-1}(V)\) is open in \(X\) for every open set \(V\) of \(Y\).

Theorem. For a function \(f : X \to Y\) the following are equivalent. (1) \(f\) is continuous. (2) \(f^{-1}(C)\) is closed for every closed \(C \subseteq Y\). (3) \(f(\overline{A}) \subseteq \overline{f(A)}\) for every \(A \subseteq X\). (4) For each \(x \in X\) and each open \(V\) containing \(f(x)\), there is an open \(U\) containing \(x\) with \(f(U) \subseteq V\). (5) \(f^{-1}(B)\) is open for every \(B\) in some subbasis of \(Y\).

Proof. (1) and (2) are equivalent because \(f^{-1}(Y \setminus C) = X \setminus f^{-1}(C)\): preimages commute with complements. For (2) implies (3), the set \(f^{-1}(\overline{f(A)})\) is closed by (2) and contains \(A\), so it contains \(\overline{A}\), which says \(f(\overline{A}) \subseteq \overline{f(A)}\). For (3) implies (2), let \(C\) be closed and \(A = f^{-1}(C)\). Then \(f(\overline{A}) \subseteq \overline{f(A)} \subseteq \overline{C} = C\), so \(\overline{A} \subseteq f^{-1}(C) = A\), and \(A\) is closed. For (1) implies (4), take \(U = f^{-1}(V)\). For (4) implies (1), if \(V\) is open, each \(x \in f^{-1}(V)\) has an open \(U_x\) with \(f(U_x) \subseteq V\), so \(f^{-1}(V) = \bigcup_x U_x\) is open. Finally (1) implies (5) trivially, and (5) implies (1) because every open set of \(Y\) is a union of finite intersections of subbasis elements, and preimages commute with unions and intersections.

Form (4) is the local version: \(f\) is continuous at \(x\) if it satisfies (4) at that point, and continuous when it is continuous at every point. Form (3) has a pleasant reading: continuous maps send points that are close to a set, in the sense of lying in its closure, to points close to its image. Form (5) is the practical test. To check that a map into the real line is continuous, it suffices to check that the preimages of the rays \((-\infty, a)\) and \((b, \infty)\) are open, that is, that the sets \(\{f < a\}\) and \(\{f > b\}\) are open.

First examples

Constant maps are continuous, since the preimage of any set is \(\varnothing\) or \(X\). The identity \((X, \mathcal{T}') \to (X, \mathcal{T})\) is continuous exactly when \(\mathcal{T}'\) is finer than \(\mathcal{T}\). Every function out of a discrete space is continuous, and every function into an indiscrete space is continuous. The inclusion \(Y \hookrightarrow X\) of a subspace is continuous, since the preimage of \(U\) is \(U \cap Y\); in fact the subspace topology is the coarsest topology on \(Y\) that makes the inclusion continuous.

Continuity depends heavily on the topologies chosen. The identity map from the lower limit line \(\mathbb{R}_\ell\) to the standard line is continuous, but its inverse is not, since \([0, 1)\) is open in \(\mathbb{R}_\ell\) but its preimage under the inverse, \([0, 1)\) again, is not open in the standard line. A function \(f : \mathbb{R}_\ell \to \mathbb{R}\) is continuous exactly when it is continuous from the right at every point in the usual sense, so step functions such as the floor function are continuous on the lower limit line.

Building continuous maps

Theorem. (a) Compositions of continuous maps are continuous. (b) The restriction of a continuous map to a subspace is continuous. (c) If \(f : X \to Y\) is continuous and \(f(X) \subseteq Z \subseteq Y\), then \(f\) is continuous as a map into the subspace \(Z\); and conversely, enlarging the codomain to a space containing \(Y\) as a subspace preserves continuity.

Proof. (a) \((g \circ f)^{-1}(W) = f^{-1}(g^{-1}(W))\) is a preimage of an open set under \(f\). (b) The restriction is the composition with the inclusion. (c) An open set of \(Z\) has the form \(V \cap Z\), and \(f^{-1}(V \cap Z) = f^{-1}(V)\) because \(f\) takes values in \(Z\).

Theorem (the pasting lemma). Let \(X = A \cup B\) with \(A\) and \(B\) both closed in \(X\), or both open in \(X\). If \(f : A \to Y\) and \(g : B \to Y\) are continuous and agree on \(A \cap B\), then the function \(h : X \to Y\) equal to \(f\) on \(A\) and \(g\) on \(B\) is continuous.

Proof. Take the closed case. Let \(C\) be closed in \(Y\). Then \(h^{-1}(C) = f^{-1}(C) \cup g^{-1}(C)\). The set \(f^{-1}(C)\) is closed in \(A\), so equals \(D \cap A\) for some closed \(D\) of \(X\), which is closed in \(X\) because \(A\) is. Likewise \(g^{-1}(C)\) is closed in \(X\). A union of two closed sets is closed, so \(h^{-1}(C)\) is closed. The open case is identical with open sets, and there it extends to any number of pieces, since arbitrary unions of open sets are open.

The closed case fails for infinitely many pieces. The real line is the union of the closed one-point sets \(\{x\}\), and every function on a single point is continuous, but not every function on the line is continuous. The pasting lemma is used constantly in the second half of the course, where homotopies and paths are built piece by piece: first one path, then another, glued at the point where they meet.

Homeomorphisms

Definition. A homeomorphism is a bijection \(f : X \to Y\) such that \(f\) and \(f^{-1}\) are both continuous. Equivalently, \(f\) is a bijection and \(f(U)\) is open in \(Y\) exactly when \(U\) is open in \(X\). A homeomorphism therefore induces a bijection between the topologies of \(X\) and \(Y\), and any property defined purely in terms of open sets is shared by homeomorphic spaces. Such a property is called a topological property.

A map is open if it sends open sets to open sets, and closed if it sends closed sets to closed sets. A continuous bijection is a homeomorphism exactly when it is open, or equivalently when it is closed. An embedding is an injective continuous map \(f : X \to Y\) that is a homeomorphism onto its image \(f(X)\) with the subspace topology.

Example: a continuous bijection that is not a homeomorphism. Let \(S^1\) be the unit circle in the plane and define \(f : [0, 2\pi) \to S^1\) by \(f(t) = (\cos t, \sin t)\). It is continuous, injective since each point of the circle has exactly one angle in \([0, 2\pi)\), and surjective. But it is not a homeomorphism. The set \(U = [0, 1)\) is open in \([0, 2\pi)\), yet its image is an arc of the circle that contains its endpoint \((1, 0)\); every open set of \(S^1\) containing \((1, 0)\) contains points \(f(t)\) with \(t\) close to \(2\pi\), which are not in \(f(U)\). So \(f(U)\) is not open, and \(f^{-1}\) is not continuous. Intuitively, the inverse tears the circle at \((1, 0)\). Lesson 7 shows this cannot happen for a continuous bijection from a compact space to a Hausdorff space.

Stereographic projection

Let \(N = (0, 1)\) be the north pole of the unit circle. For each point \(p \ne N\) of the circle, the line through \(N\) and \(p\) meets the horizontal axis at a single point \(\sigma(p)\). This defines a map \(\sigma : S^1 \setminus \{N\} \to \mathbb{R}\). In coordinates, if \(p = (x, y)\) then \(\sigma(p) = x/(1 - y)\), and the inverse sends \(u\) to \(\big(2u/(u^2 + 1), (u^2 - 1)/(u^2 + 1)\big)\). Both formulas are continuous, being built from polynomials and division by nonzero quantities, and they are inverse to each other, as a short calculation confirms. So the circle with one point removed is homeomorphic to the real line.

A unit circle centred at the origin with its north pole marked N at the top. Three lines start at N, pass through points p1, p2 and p3 on the circle and continue to meet the horizontal axis at points labelled sigma of p1, sigma of p2 and sigma of p3. Points near N project to points far out on the axis, and the south pole projects to 0.
Stereographic projection from the north pole sends the circle minus one point homeomorphically onto the line

The same construction one dimension up is the stereographic projection of the sphere \(S^2 \subseteq \mathbb{R}^3\) from its north pole onto the plane: \((x, y, z) \mapsto \big(x/(1 - z), y/(1 - z)\big)\), with inverse \((u, v) \mapsto \big(2u, 2v, u^2 + v^2 - 1\big)/(u^2 + v^2 + 1)\). So the sphere minus a point is homeomorphic to the plane. Gerardus Mercator's maps of 1569 used a different projection, but stereographic projection was known to Hipparchus and Ptolemy and was used for astrolabes; its importance in mathematics comes from complex analysis, where it identifies the Riemann sphere with the complex plane plus a point at infinity, an idea lesson 8 generalizes as the one-point compactification.

More homeomorphisms, and some surprises

The open interval \((-1, 1)\) is homeomorphic to \(\mathbb{R}\) by \(x \mapsto x/(1 - |x|)\), with inverse \(y \mapsto y/(1 + |y|)\). The open unit disc is homeomorphic to the plane by the same formula applied to vectors: \(v \mapsto v/(1 - \|v\|)\). The boundary of a square is homeomorphic to a circle by radial projection \(v \mapsto v/\|v\|\), whose inverse is radial projection back onto the square. Any two closed intervals \([a, b]\) and \([c, d]\) with \(a < b\) and \(c < d\) are homeomorphic by an affine map.

Topology also has maps that are wilder than intuition suggests. In 1890 Giuseppe Peano constructed a continuous surjection from \([0, 1]\) onto the square \([0, 1]^2\), and David Hilbert gave a simpler geometric version in 1891 as a limit of the zigzag curves that bear his name. Such a space-filling curve cannot be a homeomorphism: removing a single interior point disconnects the interval but not the square, by the invariant of lesson 1. A deeper theorem of Brouwer from 1911 and 1912, the invariance of domain, shows that \(\mathbb{R}^m\) and \(\mathbb{R}^n\) are not homeomorphic when \(m \ne n\). The case \(m = 1\) follows from the point-removal argument; the case \(m = 2\) follows from the fundamental group in lesson 10; the general case needs homology theory and is beyond this course.

Topological properties

Examples of topological properties met so far include being discrete, being metrizable, being second countable and having a dense countable subset. Non-examples include being bounded, having a given diameter and being complete. Completeness is a metric notion: the real line is complete, but it is homeomorphic to the open interval \((0, 1)\), which with its usual metric is not complete, since the sequence \(1/n\) is Cauchy without a limit in the interval. This is one of the clearest illustrations of the difference between metric and topological properties.

For finite spaces everything can be counted. A map between finite spaces is continuous exactly when preimages of the open sets are open, which a program can test directly. The code below counts continuous maps between small spaces, finds the homeomorphisms of a four-point space onto itself, and checks numerically that the two stereographic formulas are inverse to each other.

Continuous maps between two-point spaces, self-homeomorphisms of a finite space, and stereographic projection
from itertools import product, permutations
import math, random

def continuous(f, TX, TY):
    return all(frozenset(x for x in range(len(f)) if f[x] in V) in TX for V in TY)

def topology(sets):
    return {frozenset(s) for s in sets}

sierpinski = topology([(), (1,), (0, 1)])
discrete2 = topology([(), (0,), (1,), (0, 1)])
indiscrete2 = topology([(), (0, 1)])
spaces = {'Sierpinski': sierpinski, 'discrete': discrete2, 'indiscrete': indiscrete2}
for a, TX in spaces.items():
    for b, TY in spaces.items():
        count = sum(continuous(f, TX, TY) for f in product(range(2), repeat=2))
        print(f"continuous maps {a:10s} -> {b:10s}: {count} of 4")

T4 = topology([(), (0,), (1,), (0, 1), (0, 1, 2), (0, 1, 3), (0, 1, 2, 3)])
homeos = [p for p in permutations(range(4)) if continuous(p, T4, T4) and
          continuous([p.index(y) for y in range(4)], T4, T4)]
print("self-homeomorphisms of the four-point space:", homeos)

random.seed(447)
worst = 0.0
for trial in range(1000):
    t = random.uniform(0.01, 2 * math.pi - 0.01)
    x, y = math.cos(t), math.sin(t)
    if abs(1 - y) < 1e-9:
        continue
    u = x / (1 - y)
    back = (2 * u / (u * u + 1), (u * u - 1) / (u * u + 1))
    worst = max(worst, math.hypot(back[0] - x, back[1] - y))
print("stereographic round trip, largest error on 1000 points:", f"{worst:.1e}")
for t in [3 * math.pi / 2, 0.0, math.pi / 2 - 0.01, math.pi / 2 + 0.01]:
    x, y = math.cos(t), math.sin(t)
    print(f"angle {t:6.3f}: point ({x:+.3f}, {y:+.3f}) projects to {x / (1 - y):+.2f}")
Output
continuous maps Sierpinski -> Sierpinski: 3 of 4
continuous maps Sierpinski -> discrete  : 2 of 4
continuous maps Sierpinski -> indiscrete: 4 of 4
continuous maps discrete   -> Sierpinski: 4 of 4
continuous maps discrete   -> discrete  : 4 of 4
continuous maps discrete   -> indiscrete: 4 of 4
continuous maps indiscrete -> Sierpinski: 2 of 4
continuous maps indiscrete -> discrete  : 2 of 4
continuous maps indiscrete -> indiscrete: 4 of 4
self-homeomorphisms of the four-point space: [(0, 1, 2, 3), (0, 1, 3, 2), (1, 0, 2, 3), (1, 0, 3, 2)]
stereographic round trip, largest error on 1000 points: 3.1e-14
angle  4.712: point (-0.000, -1.000) projects to -0.00
angle  0.000: point (+1.000, +0.000) projects to +1.00
angle  1.561: point (+0.010, +1.000) projects to +200.00
angle  1.581: point (-0.010, +1.000) projects to -200.00

Every map out of the discrete space and every map into the indiscrete space is continuous, as predicted. Of the four maps from the indiscrete two-point space to Sierpiński space, only the two constants are continuous, since the preimage of the open point must be \(\varnothing\) or everything. The four-point space has exactly four self-homeomorphisms: the identity, the swap of 0 and 1, the swap of 2 and 3, and both swaps together. The points 0 and 1 play symmetric roles, each open on its own, and so do 2 and 3, each lying in exactly one of the three-point open sets; no homeomorphism can exchange an open point with a non-open one. Points of the circle close to the north pole project far out along the line, in both directions, which is the reason the north pole itself has nowhere to go.

Worked problem

Proving a map is a homeomorphism

Show that \(h(x) = x/(1 - |x|)\) is a homeomorphism from \((-1, 1)\) onto \(\mathbb{R}\).

Show solution
  1. \(h\) is continuous on \((-1, 1)\) because \(1 - |x| > 0\) there and quotients of continuous functions with nonzero denominators are continuous.
  2. Define \(g(y) = y/(1 + |y|)\) on \(\mathbb{R}\). It is continuous, and \(|g(y)| < 1\), so \(g\) maps into \((-1, 1)\).
  3. For \(x \ge 0\): \(h(x) = x/(1 - x) \ge 0\) and \(g(h(x)) = \frac{x/(1 - x)}{1 + x/(1 - x)} = x\). The case \(x < 0\) is symmetric, since both maps are odd.
  4. For \(y \ge 0\): \(g(y) = y/(1 + y)\) and \(h(g(y)) = \frac{y/(1 + y)}{1 - y/(1 + y)} = y\). Again the negative case is symmetric.
  5. So \(g\) is a continuous inverse of \(h\), and \(h\) is a homeomorphism.

Answer: The open interval and the real line are homeomorphic, although one is bounded and the other is not.

Common mistakes

  • MistakeDefining continuity by images of open sets.

    InsteadUse preimages; the map \(x \mapsto x^2\) on the line sends the open set \((-1, 1)\) to \([0, 1)\), which is not open, yet it is continuous.

  • MistakeAssuming every continuous bijection is a homeomorphism.

    InsteadWrapping \([0, 2\pi)\) around the circle is a continuous bijection whose inverse tears the circle.

  • MistakeApplying the pasting lemma to sets that are neither both open nor both closed.

    InsteadOn \([0, 1)\) and \([1, 2]\), the function 0 on the first and 1 on the second is continuous on each piece but not on the union.

  • MistakeTreating completeness as a topological property.

    Instead\(\mathbb{R}\) is complete and homeomorphic to \((0, 1)\), which is not complete in its usual metric.

  • MistakeForgetting which topology is meant on the codomain.

    InsteadThe identity from \(\mathbb{R}_\ell\) to \(\mathbb{R}\) is continuous but its inverse is not; name the topologies at each end.

Summary and key terms

  • A function is continuous when preimages of open sets are open; equivalently preimages of closed sets are closed, or closures map into closures.
  • Continuity can be checked on a subbasis of the codomain, and locally at each point.
  • Compositions, restrictions and maps pasted along finitely many closed sets, or any number of open sets, are continuous.
  • A homeomorphism is a continuous bijection with continuous inverse; it preserves every topological property.
  • Stereographic projection shows that a sphere minus a point is homeomorphic to Euclidean space of one lower dimension.
  • Space-filling curves are continuous surjections that are not homeomorphisms; invariance of domain separates Euclidean spaces of different dimensions.
continuous map
A map under which the preimage of every open set is open.
open map
A map that sends open sets to open sets.
homeomorphism
A continuous bijection whose inverse is continuous.
embedding
An injective continuous map that is a homeomorphism onto its image.
pasting lemma
Maps continuous on finitely many closed pieces, agreeing on overlaps, combine into a continuous map.
stereographic projection
Projection from the north pole of a sphere to the plane through its equator.
topological property
A property preserved by homeomorphisms.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Show that \(f : \mathbb{R} \to \mathbb{R}\), \(f(x) = 0\) for \(x < 0\) and \(1\) for \(x \ge 0\), is not continuous using closures.

    Show answer

    With \(A = (-\infty, 0)\), \(0 \in \overline{A}\) but \(f(0) = 1\) is not in \(\overline{f(A)} = \{0\}\).

  2. Verify that \(\sigma(x, y) = x/(1 - y)\) and \(u \mapsto (2u, u^2 - 1)/(u^2 + 1)\) are inverse.

    Show answer

    Write \(D = u^2 + 1\). Then \(1 - y = 2/D\) and \(x/(1 - y) = (2u/D)(D/2) = u\). In the other direction, with \(u = x/(1 - y)\) and \(x^2 = 1 - y^2\), \(u^2 + 1 = 2/(1 - y)\), and substituting recovers \((x, y)\).

  3. Is the identity from the cofinite topology on the real line to the standard topology continuous? In the other direction?

    Show answer

    From cofinite to standard: no, since an open interval has infinite complement. From standard to cofinite: yes, since cofinite open sets are standard open.

  4. Prove that a continuous bijection from \(X\) to \(Y\) is a homeomorphism if it is a closed map.

    Show answer

    If \(f\) is closed then for closed \(C \subseteq X\), \((f^{-1})^{-1}(C) = f(C)\) is closed, so \(f^{-1}\) is continuous.

  5. Show that \(S^1\) minus two points is homeomorphic to two disjoint open intervals.

    Show answer

    Stereographic projection from one of the removed points sends the circle minus that point onto \(\mathbb{R}\), and the second removed point onto a single real number \(c\); the image is \(\mathbb{R} \setminus \{c\}\), two open rays, each homeomorphic to an open interval.

  6. How many continuous maps are there from Sierpiński space to itself?

    Show answer

    Three: the two constant maps and the identity; the swap is not continuous.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz