# Continuous Maps and Homeomorphisms: Continuity Recast through Preimages of Open Sets

> Continuity is defined by requiring preimages of open sets to be open; we prove this agrees with ε-δ continuity on metric spaces, and compute in full why R is homeomorphic to (0,1) but not to [0,1].
> https://rikai.mugen-giken.com/en/mathematics/topology/continuous-maps

## 0. Key points

- Continuity can be defined by a single requirement: that the **preimage** of every open set of the codomain be open in the domain. No distance, no $\varepsilon$, no $\delta$ is needed.
- For maps between metric spaces this definition agrees **exactly** with continuity in the $\varepsilon$-$\delta$ sense (<Ref to="thm-epsilon-delta" />). The order of the quantifiers in the $\varepsilon$-$\delta$ definition translates directly into the language of open sets.
- We use preimages rather than images because taking preimages commutes with unions, intersections and complements. A continuous map need not send open sets to open sets (<Ref to="ex-not-open-not-closed" />).
- A homeomorphism is a continuous bijection **whose inverse is also continuous**. This last condition is independent of the others: drop it and the notion collapses (<Ref to="ex-bijective-not-homeo" />).
- Two homeomorphic spaces share every property that can be stated using the topology alone. Conversely, one proves that two spaces are *not* homeomorphic by exhibiting a topological property possessed by only one of them.
- We have $\mathbb{R} \cong (0,1)$ but $\mathbb{R} \not\cong [0,1]$. The reason, however, is **not** boundedness: boundedness is not a topological property (<Ref to="ex-interval-not-homeo" /> and the Appendix).

## 1. Motivation: does continuity survive the loss of distance?

The definition of continuity one meets first in calculus goes back to Cauchy and Weierstrass and reads as follows. A function $f : \mathbb{R} \to \mathbb{R}$ is continuous at a point $a$ if

$$
\forall \varepsilon > 0,\ \exists \delta > 0,\ \forall x \in \mathbb{R},\quad |x - a| < \delta \implies |f(x) - f(a)| < \varepsilon .
$$

One may read this as a contract: if you want the error away from $f(a)$ to stay below $\varepsilon$, then keep the distance from $a$ below $\delta$.

But the definition depends entirely on the absolute value $|x - a|$ — that is, on a **distance**. Does this mean that continuity cannot be discussed where no distance is given in advance? In fact, situations with no distance, or with no canonical choice of one, occur throughout mathematics. The Zariski topology on the zero set of a family of polynomials, the quotient of a group by a subgroup, the topology of pointwise convergence on a set of functions — none of these is easy, or even possible, to define by a metric. Yet we speak freely of "continuous homomorphisms" and "continuous actions".

So let us ask the question again: which part of the $\varepsilon$-$\delta$ definition is genuinely needed? In the display above, the condition $|f(x) - f(a)| < \varepsilon$ says that $f(x)$ lies in the open ball $B(f(a), \varepsilon)$ centred at $f(a)$, and $|x - a| < \delta$ says that $x$ lies in the open ball $B(a,\delta)$. The definition therefore becomes

$$
\forall \varepsilon > 0,\ \exists \delta > 0,\quad f\bigl(B(a,\delta)\bigr) \subset B\bigl(f(a), \varepsilon\bigr) .
$$

Here the specific shape "ball of radius $\varepsilon$" is no longer used. What is used is only the relation **"given an open set containing $f(a)$, return an open set containing $a$"**. Discard the numerical datum of a radius and keep only the family of open sets, and this condition can still be written down. That is the definition of continuity on a topological space.

We can go one step further. The global condition "continuous at every point" collapses into a strikingly compact form that requires no point-by-point inspection: the preimage of every open set is open. Why preimages and not images, and why this one line suffices — the article begins by checking these two matters carefully.

Once continuous maps are available, we can define what it means for two topological spaces to be isomorphic. Isomorphisms of sets are bijections; isomorphisms of groups are bijective homomorphisms. Isomorphisms of topological spaces are **homeomorphisms**: continuous bijections whose inverses are continuous as well. The familiar slogan that a coffee cup and a doughnut are the same object says precisely that this notion of isomorphism cannot tell them apart. Turning the slogan into a theorem is the goal of this article.

## 2. Preliminaries: notation and the algebra of preimages

We use the definition of a topological space given in [Topological spaces: definitions and basic notions](/en/mathematics/topology/topological-spaces) (<Ref to="mathematics/topology/topological-spaces#def-topology" text="the definition of a topological space" />). Let us fix the notation.

A pair $(X, \mathcal{O}_X)$ consisting of a set $X$ and a family $\mathcal{O}_X \subset 2^{X}$ of subsets is a **topological space** if

- (O1) $\emptyset \in \mathcal{O}_X$ and $X \in \mathcal{O}_X$;
- (O2) the union of any number (possibly infinitely many) of members of $\mathcal{O}_X$ again belongs to $\mathcal{O}_X$;
- (O3) the intersection of finitely many members of $\mathcal{O}_X$ again belongs to $\mathcal{O}_X$.

The members of $\mathcal{O}_X$ are called **open sets**. A subset whose complement is open is called **closed**. The **closure** $\overline{A}$ of $A \subset X$ is the intersection of all closed sets containing $A$; it is the smallest closed set containing $A$. When no confusion can arise we suppress $\mathcal{O}_X$ and speak simply of "the topological space $X$".

A subset $A \subset X$ carries the **subspace topology** $\mathcal{O}_A = \{\, U \cap A : U \in \mathcal{O}_X \,\}$. Throughout, subsets of $\mathbb{R}$ (intervals, in particular) always carry the subspace topology inherited from the usual topology of $\mathbb{R}$.

For a map $f : X \to Y$ and $B \subset Y$ we define the **preimage**

$$
f^{-1}(B) := \{\, x \in X : f(x) \in B \,\} .
$$

Here $f^{-1}$ is a piece of notation; it does not presuppose that $f$ is invertible. The reason preimages are so convenient is contained in the following three identities. Let $\{B_\lambda\}_{\lambda \in \Lambda}$ be a family of subsets of $Y$ and $B \subset Y$. Then

$$
f^{-1}\Bigl(\bigcup_{\lambda} B_\lambda\Bigr) = \bigcup_{\lambda} f^{-1}(B_\lambda), \qquad
f^{-1}\Bigl(\bigcap_{\lambda} B_\lambda\Bigr) = \bigcap_{\lambda} f^{-1}(B_\lambda), \qquad
f^{-1}(Y \setminus B) = X \setminus f^{-1}(B) .
$$

Each is proved by unwinding the definitions. For the first, say: $x \in f^{-1}(\bigcup_\lambda B_\lambda)$ $\iff$ $f(x) \in \bigcup_\lambda B_\lambda$ $\iff$ $f(x) \in B_\lambda$ for some $\lambda$ $\iff$ $x \in f^{-1}(B_\lambda)$ for some $\lambda$ $\iff$ $x \in \bigcup_\lambda f^{-1}(B_\lambda)$. For the third: $x \in f^{-1}(Y \setminus B)$ $\iff$ $f(x) \notin B$ $\iff$ $x \notin f^{-1}(B)$.

**Images**, by contrast, have no such property. Take $f : \mathbb{R} \to \mathbb{R}$, $f(x) = x^{2}$, and $A = [-1, 0]$, $B = [0,1]$. Then $A \cap B = \{0\}$, so $f(A \cap B) = \{0\}$; but $f(A) = f(B) = [0,1]$, so $f(A) \cap f(B) = [0,1]$, and the two do not agree. In general one has only $f(A \cap B) \subset f(A) \cap f(B)$, and for complements not even an inclusion holds in either direction. Since the axioms (O2) and (O3) are conditions about unions and intersections, preimages — which commute with both — are the better fit.

<Aside type="tip">
Some people remember the rule as "a continuous map sends open sets to open sets". That is false; the correct statement is about preimages. The example in <Ref to="ex-not-open-not-closed" /> will cure the confusion for good.
</Aside>

Finally we recall the notion of a **base** (<Ref to="mathematics/topology/topological-spaces#def-base" text="base of a topology" />). A family $\mathcal{B} \subset \mathcal{O}_Y$ is a **base** of the topology $\mathcal{O}_Y$ if every open set $V \in \mathcal{O}_Y$ can be written as a union of members of $\mathcal{B}$. For instance the family of all open intervals $\{\, (a,b) : a < b \,\}$ is a base for the usual topology of $\mathbb{R}$, and in a metric space $(Y, d)$ the family of all open balls $\{\, B_d(y, r) : y \in Y,\ r > 0 \,\}$ is a base.

## 3. Continuous maps: definition and equivalent conditions

### 3.1. The definition

<Definition id="def-continuous" title="Continuous map">
Let $(X, \mathcal{O}_X)$ and $(Y, \mathcal{O}_Y)$ be topological spaces. A map $f : X \to Y$ is **continuous** if

$$
\forall V \in \mathcal{O}_Y,\quad f^{-1}(V) \in \mathcal{O}_X ,
$$

that is, if the preimage of every open subset of $Y$ is open in $X$.
</Definition>

Note that both topologies, that of $X$ and that of $Y$, occur in the definition. Continuity is not a property of the map $f$ alone but of the **triple** consisting of $f$ together with the topologies chosen on the domain and codomain. The same map of sets may be continuous for one choice and not for another (<Ref to="ex-extreme-topologies" />).

<Definition id="def-continuous-at-point" title="Continuity at a point">
Let $f : X \to Y$ be a map and $x \in X$. We say $f$ is **continuous at the point $x$** if for every open set $V \subset Y$ containing $f(x)$ there exists an open set $U \subset X$ containing $x$ with $f(U) \subset V$.
</Definition>

<Figure caption="Continuity says that each time an open set is specified in the codomain, an open set comes back in the domain. Note that the arrow f and the preimage arrow point in opposite directions">
<svg viewBox="0 0 640 320" width="100%" role="img" aria-label="Diagram showing that the preimage of an open set V under a continuous map is open">
  <rect x="20" y="30" width="250" height="200" rx="18" fill="none" stroke="currentColor" stroke-width="1.5" />
  <rect x="370" y="30" width="250" height="200" rx="18" fill="none" stroke="currentColor" stroke-width="1.5" />
  <text x="36" y="54" fill="currentColor" font-size="16">X</text>
  <text x="386" y="54" fill="currentColor" font-size="16">Y</text>
  <ellipse cx="130" cy="140" rx="66" ry="52" fill="var(--sl-color-accent)" fill-opacity="0.18" stroke="var(--sl-color-accent)" stroke-width="2" />
  <ellipse cx="480" cy="140" rx="66" ry="52" fill="var(--sl-color-accent)" fill-opacity="0.18" stroke="var(--sl-color-accent)" stroke-width="2" />
  <circle cx="118" cy="140" r="4" fill="currentColor" />
  <circle cx="468" cy="140" r="4" fill="currentColor" />
  <text x="100" y="132" fill="currentColor" font-size="14">x</text>
  <text x="436" y="130" fill="currentColor" font-size="14">f(x)</text>
  <text x="130" y="212" fill="currentColor" font-size="14" text-anchor="middle">f⁻¹(V) is open</text>
  <text x="480" y="212" fill="currentColor" font-size="14" text-anchor="middle">V is open</text>
  <line x1="285" y1="118" x2="348" y2="118" stroke="currentColor" stroke-width="1.5" />
  <polygon points="348,112 360,118 348,124" fill="currentColor" />
  <text x="316" y="106" fill="currentColor" font-size="15" text-anchor="middle">f</text>
  <line x1="470" y1="278" x2="152" y2="278" stroke="var(--sl-color-accent)" stroke-width="1.5" stroke-dasharray="6 5" />
  <polygon points="152,272 140,278 152,284" fill="var(--sl-color-accent)" />
  <text x="320" y="266" fill="var(--sl-color-accent)" font-size="14" text-anchor="middle">taking preimages (direction reverses)</text>
</svg>
</Figure>

### 3.2. Equivalent conditions

The next theorem is the foundation of the article. Thanks to it we may always pick whichever condition is most convenient. When open sets are awkward to handle — when we want to estimate a closure, say — condition (iv) serves; for arguments carried out point by point, condition (iii) does.

<Theorem id="thm-continuity-characterizations" title="Characterisations of continuity">
Let $X$ and $Y$ be topological spaces and $f : X \to Y$ a map. The following four conditions are equivalent.

- **(i)** For every open set $V \subset Y$, the set $f^{-1}(V)$ is open in $X$ (that is, $f$ is continuous).
- **(ii)** For every closed set $F \subset Y$, the set $f^{-1}(F)$ is closed in $X$.
- **(iii)** $f$ is continuous at every point of $X$ in the sense of <Ref to="def-continuous-at-point" />.
- **(iv)** For every subset $A \subset X$ we have $f(\overline{A}) \subset \overline{f(A)}$.
</Theorem>

<Proof of="thm-continuity-characterizations">
(i) $\Rightarrow$ (iii). Let $x \in X$ and let $V \subset Y$ be an open set containing $f(x)$. Put $U := f^{-1}(V)$; by (i) this is open in $X$. Since $f(x) \in V$ we have $x \in U$, and moreover $f(U) = f(f^{-1}(V)) \subset V$ (if $u \in f^{-1}(V)$ then $f(u) \in V$ by definition). Hence the condition of <Ref to="def-continuous-at-point" /> holds at $x$. As $x$ was arbitrary, (iii) follows.

(iii) $\Rightarrow$ (i). Let $V \subset Y$ be open. If $f^{-1}(V) = \emptyset$, it is open by (O1). Otherwise, for each $x \in f^{-1}(V)$ we have $f(x) \in V$, and $V$ is an open set containing $f(x)$; so by (iii) there is an open set $U_x \subset X$ containing $x$ with $f(U_x) \subset V$. The inclusion $f(U_x) \subset V$ is equivalent to $U_x \subset f^{-1}(V)$. Consequently

$$
f^{-1}(V) = \bigcup_{x \in f^{-1}(V)} \{x\} \subset \bigcup_{x \in f^{-1}(V)} U_x \subset f^{-1}(V) ,
$$

so $f^{-1}(V) = \bigcup_{x} U_x$. This is a union of open sets, hence open by (O2).

(i) $\Leftrightarrow$ (ii). Let $F \subset Y$ be closed, so that $Y \setminus F$ is open; by the complement rule for preimages from §2,

$$
f^{-1}(Y \setminus F) = X \setminus f^{-1}(F) .
$$

Assuming (i), the left-hand side is open, so $f^{-1}(F)$ is closed and (ii) follows. Conversely, assume (ii) and let $V \subset Y$ be open. Then $Y \setminus V$ is closed, so $f^{-1}(Y \setminus V) = X \setminus f^{-1}(V)$ is closed, whence $f^{-1}(V)$ is open and (i) follows. We used here that the correspondence "$F$ closed $\iff$ $Y \setminus F$ open" is a bijection between the closed sets and the open sets.

(ii) $\Rightarrow$ (iv). Let $A \subset X$ be arbitrary and put $C := \overline{f(A)}$. Since $C$ is closed in $Y$, (ii) gives that $f^{-1}(C)$ is closed in $X$. From $f(A) \subset C$ we get $A \subset f^{-1}(f(A)) \subset f^{-1}(C)$. Now $\overline{A}$ is the smallest closed set containing $A$, and $f^{-1}(C)$ is a closed set containing $A$, so $\overline{A} \subset f^{-1}(C)$, that is, $f(\overline{A}) \subset C = \overline{f(A)}$.

(iv) $\Rightarrow$ (ii). Let $F \subset Y$ be closed and put $A := f^{-1}(F)$. Then $f(A) = f(f^{-1}(F)) \subset F$, and since $F$ is closed, $\overline{f(A)} \subset \overline{F} = F$. By (iv),

$$
f(\overline{A}) \subset \overline{f(A)} \subset F ,
$$

and passing to preimages on both sides gives $\overline{A} \subset f^{-1}(F) = A$. As always $A \subset \overline{A}$, so $\overline{A} = A$: the set $A = f^{-1}(F)$ is closed.

We have proved (i) $\Leftrightarrow$ (iii), (i) $\Leftrightarrow$ (ii) and (ii) $\Leftrightarrow$ (iv), so all four conditions are equivalent.
</Proof>

Condition (iv) is the topological version of the intuition that $f$ does not destroy limits. It says that if $x$ is an adherent point of $A$ (a point of $\overline{A}$), then $f(x)$ is an adherent point of $f(A)$. Translated into the language of sequences it corresponds to "$x_n \to x$ implies $f(x_n) \to f(x)$"; but in a general topological space sequences alone do not characterise continuity, so the closure formulation is the correct generalisation.

### 3.3. Testing on a base, and composition

Inspecting all open sets is laborious. In practice it suffices to inspect a base.

<Lemma id="lem-base-criterion" title="Continuity tested on a base">
Let $X$ and $Y$ be topological spaces and let $\mathcal{B}$ be a base for the topology of $Y$. A map $f : X \to Y$ is continuous if and only if $f^{-1}(B)$ is open in $X$ for every $B \in \mathcal{B}$.
</Lemma>

<Proof of="lem-base-criterion">
Necessity is immediate: $\mathcal{B} \subset \mathcal{O}_Y$, so if $f$ is continuous we simply apply <Ref to="def-continuous" /> to $B \in \mathcal{B}$.

For sufficiency, let $V \subset Y$ be any open set. Since $\mathcal{B}$ is a base, there are an index set $\Lambda$ and members $B_\lambda \in \mathcal{B}$ $(\lambda \in \Lambda)$ with $V = \bigcup_{\lambda \in \Lambda} B_\lambda$. By the commutation of preimages with unions from §2,

$$
f^{-1}(V) = f^{-1}\Bigl(\bigcup_{\lambda} B_\lambda\Bigr) = \bigcup_{\lambda} f^{-1}(B_\lambda) .
$$

By hypothesis each $f^{-1}(B_\lambda)$ is open, so by (O2) their union is open. Hence $f$ is continuous.
</Proof>

<Proposition id="prop-composition" title="Continuity of the identity and of composites">
Let $X$, $Y$, $Z$ be topological spaces.

1. The identity map $\mathrm{id}_X : X \to X$ is continuous.
2. If $f : X \to Y$ and $g : Y \to Z$ are both continuous, then the composite $g \circ f : X \to Z$ is continuous.
</Proposition>

<Proof of="prop-composition">
(1) For every open set $U \subset X$ we have $\mathrm{id}_X^{-1}(U) = U$, which is open.

(2) First we verify the set identity $(g \circ f)^{-1}(W) = f^{-1}(g^{-1}(W))$: indeed $x \in (g\circ f)^{-1}(W)$ $\iff$ $g(f(x)) \in W$ $\iff$ $f(x) \in g^{-1}(W)$ $\iff$ $x \in f^{-1}(g^{-1}(W))$. Now let $W \subset Z$ be open. By continuity of $g$ (<Ref to="def-continuous" />) the set $g^{-1}(W)$ is open in $Y$, and then by continuity of $f$ the set $f^{-1}(g^{-1}(W))$ is open in $X$. By the identity above this equals $(g\circ f)^{-1}(W)$, so $g \circ f$ is continuous.
</Proof>

<Ref to="prop-composition" /> is exactly the statement that topological spaces as objects and continuous maps as morphisms form a category $\mathbf{Top}$. What its isomorphisms are is the subject of §5.

<Remark id="rem-subspace-criterion" title="Maps into and out of a subspace">
Let $Y$ be a topological space, give $A \subset Y$ the subspace topology, and let $\iota : A \to Y$ be the inclusion map. The following two facts will be used repeatedly in the examples below.

**(1) The inclusion is continuous.** If $V \subset Y$ is open then $\iota^{-1}(V) = V \cap A$, which is open in $A$ by the definition of the subspace topology.

**(2) The codomain may be replaced by a subspace.** Let $X$ be a topological space and $f : X \to A$ a map. Then $f$ is continuous if and only if $\iota \circ f : X \to Y$ is continuous. Indeed, the open sets of $A$ are those of the form $V \cap A$ with $V$ open in $Y$, and the values of $f$ always lie in $A$, so

$$
f^{-1}(V \cap A) = \{\, x \in X : f(x) \in V \ \text{and}\ f(x) \in A \,\} = \{\, x \in X : f(x) \in V \,\} = (\iota \circ f)^{-1}(V) .
$$

Hence the condition "the $f$-preimage of every open set of $A$ is open" and the condition "the $(\iota \circ f)$-preimage of every open set of $Y$ is open" are, literally, conditions about the same family of sets.

In short: "continuous maps into $\mathbb{R}$ whose values lie in $(0,1)$" and "continuous maps into $(0,1)$" are the same thing.
</Remark>

### 3.4. Examples

<Example id="ex-extreme-topologies" title="Continuity under extreme topologies">
Give a set $X$ the **discrete topology** $\mathcal{O}_X = 2^{X}$ (every subset is open). Then for any topological space $Y$ and any map $f : X \to Y$, the set $f^{-1}(V)$ is a subset of $X$ and hence automatically open. So $f$ is continuous.

Give a set $Y$ the **indiscrete topology** $\mathcal{O}_Y = \{\emptyset, Y\}$. Then for any map $f : X \to Y$ we have $f^{-1}(\emptyset) = \emptyset$ and $f^{-1}(Y) = X$, both open in $X$ by (O1). So $f$ is continuous.

A constant map $f \equiv y_0$ is always continuous. If $V \subset Y$ is open then $f^{-1}(V) = X$ when $y_0 \in V$ and $f^{-1}(V) = \emptyset$ when $y_0 \notin V$, and both are open by (O1).

On the other hand, put the usual topology on $X = \mathbb{R}$ and the discrete topology on $Y = \mathbb{R}$. Then the identity map $\mathrm{id} : X \to Y$ is not continuous: the set $\{0\}$ is open in $Y$, but $\mathrm{id}^{-1}(\{0\}) = \{0\}$ is not open in the usual topology of $\mathbb{R}$ (any open interval $(-\delta, \delta)$ containing $0$ also contains points other than $0$, so it is not contained in $\{0\}$). The same map of sets loses continuity once the topology is changed.
</Example>

<Example id="ex-not-open-not-closed" title="A continuous map that is neither open nor closed">
The map $f : \mathbb{R} \to \mathbb{R}$, $f(x) = x^{2}$, is continuous (this is checked in <Ref to="ex-square-preimage" />). But the image of the open set $(-1,1)$ is

$$
f\bigl((-1,1)\bigr) = \{\, x^{2} : |x| < 1 \,\} = [0, 1) .
$$

The point $0$ belongs to this image, yet for every $\delta > 0$ we have $-\delta/2 \in (-\delta, \delta)$ and $-\delta/2 \notin [0,1)$, so no neighbourhood of $0$ is contained in $[0,1)$. Hence $[0,1)$ is not open and $f$ is not an open map.

Next consider $g : \mathbb{R} \to \mathbb{R}$, $g(x) = 1/(1 + x^{2})$. The denominator never vanishes, since $1 + x^{2} \ge 1 > 0$, so this is a continuous rational function. The set $\mathbb{R}$ is closed in $\mathbb{R}$; but $x^{2}$ ranges over all of $[0,\infty)$, so $1 + x^{2}$ ranges over $[1,\infty)$ and therefore

$$
g(\mathbb{R}) = \Bigl\{\, \tfrac{1}{1+x^{2}} : x \in \mathbb{R} \,\Bigr\} = (0, 1] .
$$

Since $1/n \in (0,1]$ while $1/n \to 0 \notin (0,1]$, the set $(0,1]$ is not closed. Hence $g$ is not a closed map either.

These two examples show that continuity is not a condition about images.
</Example>

<Example id="ex-square-preimage" title="Checking continuity on a base">
Let us prove that $f : \mathbb{R} \to \mathbb{R}$, $f(x) = x^{2}$, is continuous without using $\varepsilon$ or $\delta$, by appealing to <Ref to="lem-base-criterion" />. Take the family of all open intervals as a base for the usual topology of $\mathbb{R}$ and compute $f^{-1}((a,b)) = \{\, x \in \mathbb{R} : a < x^{2} < b \,\}$ for $a < b$, distinguishing cases.

**Case $b \le 0$.** Since $x^{2} \ge 0 \ge b$, no $x$ satisfies $x^{2} < b$. Hence $f^{-1}((a,b)) = \emptyset$, which is open by (O1).

**Case $a < 0 < b$.** The inequality $a < x^{2}$ holds automatically because $x^{2} \ge 0 > a$, so the condition reduces to $x^{2} < b$. This is equivalent to $|x| < \sqrt{b}$, so $f^{-1}((a,b)) = (-\sqrt{b}, \sqrt{b})$, which is open.

**Case $0 \le a < b$.** The map $t \mapsto \sqrt{t}$ is strictly increasing on $[0,\infty)$, so $a < x^{2} < b$ is equivalent to $\sqrt{a} < |x| < \sqrt{b}$. Hence

$$
f^{-1}\bigl((a,b)\bigr) = (-\sqrt{b}, -\sqrt{a}) \cup (\sqrt{a}, \sqrt{b}) ,
$$

a union of two open intervals and therefore open by (O2). When $a = 0$ this becomes $(-\sqrt{b},0) \cup (0,\sqrt{b})$.

In every case the preimage of a basic open set is open, so $f$ is continuous by <Ref to="lem-base-criterion" />. Observe that we never had to write down a single $\varepsilon$ or $\delta$.
</Example>

## 4. Agreement with the ε-δ definition

We now prove that <Ref to="def-continuous" /> generalises the notion of continuity from calculus. First we recall the topology of a metric space.

In a metric space $(X, d)$, for $a \in X$ and $r > 0$ we define the **open ball** $B_d(a, r) := \{\, x \in X : d(a,x) < r \,\}$, and we call

$$
\mathcal{O}_d := \{\, U \subset X : \forall a \in U,\ \exists r > 0,\ B_d(a,r) \subset U \,\}
$$

the **metric topology** determined by $d$. That $\mathcal{O}_d$ satisfies the axioms of a topology (<Ref to="mathematics/topology/topological-spaces#thm-metric-open-axioms" text="properties of the family of open sets of a metric space" />), and that the family of all open balls is a base for $\mathcal{O}_d$, were verified in the previous article. Let us at least repeat the proof that open balls are open. Let $x \in B_d(a,r)$ and put $s := r - d(a,x) > 0$. For $y \in B_d(x,s)$ the triangle inequality gives

$$
d(a,y) \le d(a,x) + d(x,y) < d(a,x) + s = r ,
$$

so $B_d(x,s) \subset B_d(a,r)$. Hence $B_d(a,r) \in \mathcal{O}_d$.

<Theorem id="thm-epsilon-delta" title="Topological continuity agrees with ε-δ continuity">
Let $(X, d_X)$ and $(Y, d_Y)$ be metric spaces, each with its metric topology. For a map $f : X \to Y$ the following two conditions are equivalent.

- **(i)** $f$ is continuous in the sense of <Ref to="def-continuous" />; that is, $f^{-1}(V)$ is open in $X$ for every open set $V \subset Y$.
- **(ii)** For every $a \in X$ and every $\varepsilon > 0$ there exists $\delta > 0$ such that $d_Y(f(x), f(a)) < \varepsilon$ holds for all $x \in X$ with $d_X(x, a) < \delta$.
</Theorem>

<Proof of="thm-epsilon-delta">
(i) $\Rightarrow$ (ii). Let $a \in X$ and $\varepsilon > 0$ be arbitrary and put $V := B_{d_Y}(f(a), \varepsilon)$. As seen above, $V$ is open in $Y$, so $f^{-1}(V)$ is open in $X$ by (i). Since $d_Y(f(a), f(a)) = 0 < \varepsilon$ we have $f(a) \in V$, hence $a \in f^{-1}(V)$. Applying the definition of the metric topology $\mathcal{O}_{d_X}$ to $U = f^{-1}(V)$ and $a$, we obtain $\delta > 0$ with $B_{d_X}(a, \delta) \subset f^{-1}(V)$. This says precisely that $d_X(x,a) < \delta$ implies $f(x) \in V = B_{d_Y}(f(a), \varepsilon)$, that is, $d_Y(f(x), f(a)) < \varepsilon$.

(ii) $\Rightarrow$ (i). Let $V \subset Y$ be open and let $a \in f^{-1}(V)$ be arbitrary. From $f(a) \in V$ and the definition of the metric topology there is $\varepsilon > 0$ with $B_{d_Y}(f(a), \varepsilon) \subset V$. Applying (ii) to this $\varepsilon$ and to $a$ yields $\delta > 0$ such that $d_X(x,a) < \delta$ implies $d_Y(f(x), f(a)) < \varepsilon$, that is, $f(x) \in B_{d_Y}(f(a),\varepsilon) \subset V$. In other words $B_{d_X}(a, \delta) \subset f^{-1}(V)$. Since $a \in f^{-1}(V)$ was arbitrary, the definition of the metric topology shows that $f^{-1}(V)$ is open in $X$. Hence $f$ is continuous.
</Proof>

<Remark id="rem-quantifiers" title="Dictionary of quantifiers">
Reading the proof again makes it clear where each part of the $\varepsilon$-$\delta$ definition went.

| $\varepsilon$-$\delta$ language | Topological language |
|---|---|
| for every $\varepsilon > 0$ | for every open set $V$ containing $f(a)$ |
| there exists $\delta > 0$ | there exists an open set $U$ containing $a$ |
| $d_X(x,a) < \delta$ | $x \in U$ |
| $d_Y(f(x), f(a)) < \varepsilon$ | $f(x) \in V$ |

The order of quantifiers $\forall \varepsilon\, \exists \delta\, \forall x$ carries over verbatim to $\forall V\, \exists U\, \forall x \in U$. What the topology discards is only the numerical value $\varepsilon$; the logical structure — a target accuracy is prescribed first, and a tolerance is chosen afterwards — is preserved completely.

The condition that $\delta$ may be chosen independently of $a$ (uniform continuity) cannot be expressed by this translation. The set $U$ is chosen for each $a$ separately, and topology has no way of saying "a $U$ of the same size". See [Continuous functions and uniform continuity](/en/mathematics/real-analysis/uniform-continuity) and the Appendix of this article for details.
</Remark>

## 5. Homeomorphisms: what it means to be topologically the same

### 5.1. Definition and criteria

<Definition id="def-open-closed-map" title="Open maps and closed maps">
Let $f : X \to Y$ be a map between topological spaces. We call $f$ an **open map** if $f(U)$ is open in $Y$ for every open set $U \subset X$, and a **closed map** if $f(F)$ is closed in $Y$ for every closed set $F \subset X$.
</Definition>

As <Ref to="ex-not-open-not-closed" /> shows, being continuous, being an open map and being a closed map are mutually independent conditions. A homeomorphism requires continuity and (as a consequence) openness at the same time.

<Definition id="def-homeomorphism" title="Homeomorphism">
Let $X$ and $Y$ be topological spaces. A map $f : X \to Y$ is a **homeomorphism** if

1. $f$ is a bijection,
2. $f$ is continuous, and
3. the inverse map $f^{-1} : Y \to X$ is continuous as well.

If a homeomorphism $f : X \to Y$ exists we say that $X$ and $Y$ are **homeomorphic** and write $X \cong Y$.
</Definition>

That condition 3 cannot be dropped is verified in <Ref to="ex-bijective-not-homeo" />. For groups and vector spaces the inverse of a bijective homomorphism is automatically a homomorphism, so no analogue of condition 3 was needed there. That this fails for topological spaces is the first surprise.

<Proposition id="prop-homeo-criterion" title="When a continuous bijection is a homeomorphism">
Let $X$ and $Y$ be topological spaces and $f : X \to Y$ a continuous bijection. The following three conditions are equivalent.

- **(i)** $f$ is a homeomorphism.
- **(ii)** $f$ is an open map.
- **(iii)** $f$ is a closed map.
</Proposition>

<Proof of="prop-homeo-criterion">
Since $f$ is a bijection, the inverse map $g := f^{-1} : Y \to X$ is defined. We first prove the key identity

$$
g^{-1}(A) = f(A) \qquad (A \subset X \text{ arbitrary}) .
$$

If $y \in g^{-1}(A)$ then $g(y) \in A$ and $y = f(g(y)) \in f(A)$. Conversely, if $y \in f(A)$ then $y = f(a)$ for some $a \in A$, and $g(y) = g(f(a)) = a \in A$, so $y \in g^{-1}(A)$. This proves the identity.

(i) $\Leftrightarrow$ (ii). By <Ref to="def-continuous" />, continuity of $g$ means that $g^{-1}(U)$ is open in $Y$ for every open set $U \subset X$. Taking $A = U$ in the identity above gives $g^{-1}(U) = f(U)$, so this condition says that $f(U)$ is open for every open $U$, that is, that $f$ is an open map. Since $f$ is by hypothesis a continuous bijection, continuity of $g$ is equivalent to $f$ being a homeomorphism.

(ii) $\Leftrightarrow$ (iii). Since $f$ is a bijection, $f(X \setminus A) = Y \setminus f(A)$ holds for every $A \subset X$. Indeed, for $y \in Y$ bijectivity of $f$ gives a unique $x_0 \in X$ with $y = f(x_0)$, and $y \in f(X\setminus A) \iff x_0 \notin A \iff y \notin f(A)$ (the second equivalence again uses uniqueness of $x_0$). Now assume (ii) and let $F \subset X$ be closed. Then $X \setminus F$ is open, so $f(X\setminus F) = Y \setminus f(F)$ is open, hence $f(F)$ is closed and (iii) follows. Conversely, if $U \subset X$ is open then $X\setminus U$ is closed, so $f(X \setminus U) = Y \setminus f(U)$ is closed and therefore $f(U)$ is open.
</Proof>

<Proposition id="prop-homeo-equivalence" title="Being homeomorphic is an equivalence relation">
On any collection of topological spaces, the relation "$X \cong Y$" is reflexive, symmetric and transitive.
</Proposition>

<Proof of="prop-homeo-equivalence">
Reflexivity. The map $\mathrm{id}_X$ is a bijection, it is continuous by part (1) of <Ref to="prop-composition" />, and its inverse is again $\mathrm{id}_X$, hence continuous. So $\mathrm{id}_X$ is a homeomorphism and $X \cong X$.

Symmetry. Let $f : X \to Y$ be a homeomorphism. Then $g := f^{-1}$ is a bijection, continuous by condition 3 of <Ref to="def-homeomorphism" />, and $g^{-1} = f$ is continuous by condition 2. So $g$ is a homeomorphism and $Y \cong X$.

Transitivity. Let $f : X \to Y$ and $h : Y \to Z$ be homeomorphisms. Then $h \circ f$ is a composite of bijections, hence a bijection, and continuous by part (2) of <Ref to="prop-composition" />. Moreover $(h\circ f)^{-1} = f^{-1} \circ h^{-1}$, and both $h^{-1}$ and $f^{-1}$ are continuous, so part (2) of <Ref to="prop-composition" /> again shows that $(h\circ f)^{-1}$ is continuous. Hence $h \circ f$ is a homeomorphism and $X \cong Z$.
</Proof>

For equivalence relations in general see [Relations and equivalence relations: what does "the same" mean?](/mathematics/foundations/equivalence-relations). By <Ref to="prop-homeo-equivalence" />, the enterprise of classifying topological spaces up to homeomorphism is meaningful. A large part of topology is devoted to manufacturing tools that distinguish these equivalence classes.

<Definition id="def-topological-property" title="Topological property">
A property $P$ of topological spaces is a **topological property** (a topologically invariant property) if $X \cong Y$ and $X$ has $P$ together imply that $Y$ has $P$.
</Definition>

Any property defined using only the family of open sets is, by definition, a topological property. A homeomorphism $f$ induces via $U \mapsto f(U)$ a bijection between $\mathcal{O}_X$ and $\mathcal{O}_Y$ (by part (ii) of <Ref to="prop-homeo-criterion" /> and its converse direction), so a statement phrased in the language of open sets holds in $X$ if and only if it holds in $Y$. Compactness ([Compactness](/mathematics/topology/compactness)), connectedness ([Connectedness](/mathematics/topology/connectedness)) and the Hausdorff property ([Separation axioms and metrisability](/mathematics/topology/separation-axioms)) are all topological properties.

### 5.2. Examples

<Example id="ex-r-homeo-interval" title="R is homeomorphic to the open interval (0,1)">
Define $h : \mathbb{R} \to (0,1)$ by

$$
h(x) := \frac{1}{2} + \frac{x}{2(1 + |x|)} .
$$

First we check the range. From $|x|/(1+|x|) < 1$ we get $|x/(1+|x|)| < 1$, hence $h(x) \in (0,1)$.

Next we compute the inverse explicitly. Put $t = h(x)$ and $u := 2t - 1 = x/(1+|x|)$. If $x \ge 0$ then $u = x/(1+x) \ge 0$ and $|u| = u$, so from $u(1+x) = x$ we get $x = u/(1-u) = u/(1-|u|)$. If $x < 0$ then $|x| = -x$, so $u = x/(1-x) < 0$ and $|u| = -u$, and from $u(1-x) = x$ we get $x = u/(1+u) = u/(1-|u|)$. In both cases we obtain the same formula

$$
x = \frac{u}{1 - |u|}, \qquad u = 2t-1 .
$$

If $t \in (0,1)$ then $|2t-1| < 1$, so the denominator is positive and the formula makes sense.

Conversely, given $u \in (-1,1)$, put $x := u/(1-|u|)$. Then $|x| = |u|/(1-|u|)$, hence

$$
1 + |x| = \frac{(1-|u|) + |u|}{1-|u|} = \frac{1}{1-|u|}, \qquad
\frac{x}{1+|x|} = \frac{u}{1-|u|}\cdot (1-|u|) = u .
$$

Thus $u \mapsto u/(1-|u|)$ is a bijection $(-1,1) \to \mathbb{R}$ with inverse $x \mapsto x/(1+|x|)$. Consequently $h$ is a bijection and

$$
h^{-1}(t) = \frac{2t-1}{1 - |2t-1|} \qquad (0 < t < 1) .
$$

Now for continuity. The map $x \mapsto |x|$ is continuous, since $\bigl||x| - |y|\bigr| \le |x-y|$ (take $\delta = \varepsilon$), and $1 + |x| \ge 1 > 0$, so the quotient $x \mapsto x/(1+|x|)$ is continuous; composing with a continuous affine map shows that $h : \mathbb{R} \to \mathbb{R}$ is continuous (<Ref to="thm-epsilon-delta" /> and <Ref to="prop-composition" />). Since the values lie in $(0,1)$, part (2) of <Ref to="rem-subspace-criterion" /> shows that $h : \mathbb{R} \to (0,1)$ is continuous. Similarly $t \mapsto 2t-1$ is continuous, and $u \mapsto u/(1-|u|)$ is continuous on $(-1,1)$ because the denominator is positive there; combined with continuity of the inclusion $(0,1) \hookrightarrow \mathbb{R}$ (part (1) of <Ref to="rem-subspace-criterion" />) this gives that $h^{-1} : (0,1) \to \mathbb{R}$ is continuous.

Hence $h$ is a homeomorphism and $\mathbb{R} \cong (0,1)$. For $a < b$ the affine map $s \mapsto a + (b-a)s$ gives $(0,1) \cong (a,b)$, so by transitivity (<Ref to="prop-homeo-equivalence" />) every bounded open interval is homeomorphic to $\mathbb{R}$. One could reach the same conclusion using $\tan : (-\pi/2, \pi/2) \to \mathbb{R}$, but the rational formula above is more elementary in that it assumes nothing about trigonometric functions.
</Example>

<Example id="ex-bijective-not-homeo" title="A continuous bijection that is not a homeomorphism">
Give $S^{1} := \{\, (x,y) \in \mathbb{R}^{2} : x^{2}+y^{2} = 1 \,\}$ the subspace topology from $\mathbb{R}^{2}$ and consider

$$
f : [0, 2\pi) \to S^{1}, \qquad f(t) = (\cos t, \sin t)
$$

(where $[0,2\pi)$ carries the subspace topology from $\mathbb{R}$).

**$f$ is a bijection.** From $\cos^{2}t + \sin^{2}t = 1$ the values lie in $S^{1}$. For surjectivity, let $(x,y) \in S^{1}$; then $|x| \le 1$, and since $\cos$ is a strictly decreasing bijection from $[0,\pi]$ onto $[-1,1]$, the number $t_0 := \arccos x \in [0,\pi]$ is defined. We have $\sin t_0 \ge 0$ and $\sin^{2} t_0 = 1 - x^{2} = y^{2}$, so if $y \ge 0$ then $t := t_0$ works, and if $y < 0$ then $t := 2\pi - t_0 \in (\pi, 2\pi)$ works (because $\cos(2\pi - t_0) = \cos t_0 = x$ and $\sin(2\pi-t_0) = -\sin t_0 = y$). Injectivity follows from the addition formulas: if $f(s) = f(t)$ with $0 \le s \le t < 2\pi$, then

$$
\cos(t-s) = \cos t \cos s + \sin t \sin s = \cos^{2}s + \sin^{2}s = 1 ,
$$

and in the range $0 \le t - s < 2\pi$ the equation $\cos\theta = 1$ holds only for $\theta = 0$, so $s = t$.

**$f$ is continuous.** Since $\cos$ and $\sin$ are continuous on $\mathbb{R}$, the map $t \mapsto (\cos t, \sin t)$ is continuous as a map $\mathbb{R} \to \mathbb{R}^{2}$ (this can be shown directly by an $\varepsilon$-$\delta$ estimate componentwise); as the values lie in $S^{1}$, <Ref to="rem-subspace-criterion" /> shows it is continuous as a map into $S^{1}$, and so is its restriction to $[0,2\pi)$.

**The inverse is not continuous.** By <Ref to="prop-homeo-criterion" /> it suffices to show that $f$ is not an open map. Put $U := [0, \pi)$. Since $U = (-\pi, \pi) \cap [0,2\pi)$, the set $U$ is open in $[0,2\pi)$. Its image is

$$
f(U) = \{\, (\cos t, \sin t) : 0 \le t < \pi \,\} ,
$$

and for $0 \le t < \pi$ we have $\sin t \ge 0$, so $f(U)$ contains no point with negative second coordinate. On the other hand, any open subset of $S^{1}$ containing $p := (1,0) = f(0) \in f(U)$ contains, by the definition of the subspace topology, a set $B_{\mathbb{R}^{2}}(p, \varepsilon) \cap S^{1}$ for some $\varepsilon > 0$. Taking $\eta > 0$ small, the point

$$
q_\eta := (\cos(2\pi - \eta), \sin(2\pi-\eta)) = (\cos \eta, -\sin \eta) \in S^{1}
$$

converges to $p$ as $\eta \to 0^{+}$, so for $\eta$ small enough $q_\eta \in B_{\mathbb{R}^{2}}(p,\varepsilon) \cap S^{1}$. But the second coordinate of $q_\eta$ is $-\sin\eta < 0$, so $q_\eta \notin f(U)$. Hence no open set containing $p$ is contained in $f(U)$, and $f(U)$ is not open in $S^{1}$.

Therefore $f$ is not an open map, and by <Ref to="prop-homeo-criterion" /> it is not a homeomorphism. Intuitively, $f$ glues the two ends of an interval together to form a circle. The gluing can be done continuously, but the operation of cutting the circle open (the inverse map) is discontinuous at the cut.
</Example>

<Remark id="rem-compact-hausdorff" title="A theorem that automates this verification">
Checking by hand whether a continuous bijection is a homeomorphism is laborious. The theorem "a continuous bijection from a compact space to a Hausdorff space is a homeomorphism" (<Ref to="mathematics/topology/compactness#cor-compact-hausdorff-homeo" text="a continuous bijection from a compact space to a Hausdorff space is a homeomorphism" />), which we prove in a later article, removes the need for it. The reason we did not get a homeomorphism in <Ref to="ex-bijective-not-homeo" /> is that the domain $[0,2\pi)$ is not compact. See [Compactness](/mathematics/topology/compactness) and [Separation axioms and metrisability](/mathematics/topology/separation-axioms) for details.
</Remark>

## 6. How to prove that two spaces are not homeomorphic

To prove that two spaces *are* homeomorphic it is enough to construct a single map: an existence proof. To prove that they are *not*, one must establish the universal statement that no map whatsoever is a homeomorphism. An exhaustive search is out of the question, so we use <Ref to="def-topological-property" /> instead. Find one topological property $P$ that $X$ has and $Y$ lacks; then the assumption $X \cong Y$ would force $Y$ to have $P$ as well, a contradiction.

<Figure caption="Two directions for investigating homeomorphy. On the left one constructs a map (existence proof); on the right one separates the spaces by an invariant (non-existence proof)">
<Mermaid code={`flowchart TD
  Q["Are X and Y homeomorphic?"] --> A["Direction 1: construct an explicit bijection h"]
  Q --> B["Direction 2: look for a topological property P"]
  A --> A1["Check that h is continuous"]
  A1 --> A2["Check that the inverse of h is continuous"]
  A2 --> A3["Conclusion: X and Y are homeomorphic"]
  B --> B1["X has P and Y does not have P"]
  B1 --> B2["Conclusion: X and Y are not homeomorphic"]`} />
</Figure>

<Example id="ex-interval-not-homeo" title="R and [0,1], and [0,1] and [0,1), are not homeomorphic">
**(1) $\mathbb{R} \not\cong [0,1]$.** Suppose a homeomorphism $h : [0,1] \to \mathbb{R}$ existed. In particular $h$ is a continuous real-valued function on the closed interval $[0,1]$, so by the extreme value theorem of Weierstrass (<Ref to="mathematics/real-analysis/uniform-continuity#thm-extreme-value" text="the extreme value theorem" />) it attains a maximum: there is $c \in [0,1]$ with $h(s) \le h(c) =: M$ for all $s \in [0,1]$. Hence $h([0,1]) \subset (-\infty, M]$. But $h$ is surjective, so $h([0,1]) = \mathbb{R}$, while $M + 1 \in \mathbb{R}$ and $M + 1 > M$ give $M+1 \notin (-\infty, M]$ — a contradiction. Therefore $\mathbb{R} \not\cong [0,1]$.

**(2) $[0,1] \not\cong [0,1)$.** Suppose a homeomorphism $h : [0,1] \to [0,1)$ existed. As in (1), $h$ attains a maximum $M = h(c)$ on $[0,1]$, and by surjectivity $h([0,1]) = [0,1)$, so $M$ would have to be a greatest element of the set $[0,1)$. But $[0,1)$ has no greatest element: for any $t \in [0,1)$ put $t' := (t+1)/2$; then $t < t' < 1$, so $t' \in [0,1)$ and $t' > t$, and $t$ cannot be greatest. This contradiction gives $[0,1] \not\cong [0,1)$.
</Example>

<Aside type="caution">
The explanation "$\mathbb{R}$ is unbounded and $[0,1]$ is bounded, so they are not homeomorphic" is **wrong**. As <Ref to="ex-r-homeo-interval" /> shows, $\mathbb{R} \cong (0,1)$, and $(0,1)$ is bounded. Boundedness is a notion that depends on the metric and is not a topological property (see the Appendix). What is really doing the work in <Ref to="ex-interval-not-homeo" /> is the compactness of $[0,1]$: the extreme value theorem is the combination of "the continuous image of a compact space is compact" (<Ref to="mathematics/topology/compactness#thm-continuous-image" text="the continuous image of a compact set is compact" />) with "the compact subsets of $\mathbb{R}$ are the closed bounded sets" (<Ref to="mathematics/topology/compactness#thm-heine-borel" text="the Heine–Borel theorem" />).
</Aside>

Another powerful invariant is connectedness. A topological space $X$ is **connected** if there is no decomposition $X = V_1 \cup V_2$ with $V_1 \cap V_2 = \emptyset$, with $V_1$ and $V_2$ both open in $X$, and with $V_1 \ne \emptyset$ and $V_2 \ne \emptyset$. That continuous maps preserve this property follows at once from <Ref to="def-continuous" /> alone.

<Theorem id="thm-connected-image" title="Connectedness is preserved by continuous surjections">
Let $X$ and $Y$ be topological spaces and $f : X \to Y$ a continuous surjection. If $X$ is connected, then so is $Y$.
</Theorem>

<Proof of="thm-connected-image">
Suppose $Y$ were not connected, and take a decomposition $Y = V_1 \cup V_2$ with $V_1 \cap V_2 = \emptyset$ and with $V_1, V_2$ nonempty open subsets of $Y$.

By continuity of $f$ (<Ref to="def-continuous" />), both $f^{-1}(V_1)$ and $f^{-1}(V_2)$ are open in $X$. By the properties of preimages from §2,

$$
f^{-1}(V_1) \cup f^{-1}(V_2) = f^{-1}(V_1 \cup V_2) = f^{-1}(Y) = X, \qquad
f^{-1}(V_1) \cap f^{-1}(V_2) = f^{-1}(V_1 \cap V_2) = f^{-1}(\emptyset) = \emptyset .
$$

Moreover, since $V_i \ne \emptyset$ we may pick $y_i \in V_i$, and by surjectivity of $f$ there is $x_i \in X$ with $f(x_i) = y_i$. Then $x_i \in f^{-1}(V_i)$, so $f^{-1}(V_i) \ne \emptyset$.

Hence $X = f^{-1}(V_1) \cup f^{-1}(V_2)$ is a decomposition contradicting the connectedness of $X$. Therefore $Y$ is connected.
</Proof>

<Corollary id="cor-connected-invariant" title="Connectedness is a topological property">
Connectedness is a topological property: if $X \cong Y$ and $X$ is connected, then $Y$ is connected.
</Corollary>

<Proof of="cor-connected-invariant">
Let $f : X \to Y$ be a homeomorphism. By <Ref to="def-homeomorphism" />, $f$ is continuous and bijective, in particular a continuous surjection. So <Ref to="thm-connected-image" /> applies: if $X$ is connected, so is $Y$.
</Proof>

<Ref to="thm-connected-image" /> is a theorem of wide application. Combined with the fact that intervals of $\mathbb{R}$ are connected (proved in [Connectedness](/mathematics/topology/connectedness) as <Ref to="mathematics/topology/connectedness#thm-interval" text="the determination of the connected subsets of R" />), it gives that the image of a continuous function on an interval is connected, hence an interval — and the intermediate value theorem follows as a corollary. That a basic theorem of analysis drops out of the general theory of topology is, I think, one of the rewards of this abstraction. In <Ref to="exr-r-vs-r2" /> we use this invariant to distinguish $\mathbb{R}$ from $\mathbb{R}^{2}$.

## 7. Exercises

<Exercise id="exr-pasting-lemma" difficulty="Standard">
Let $X$ and $Y$ be topological spaces and let $A, B$ be closed subsets of $X$ with $X = A \cup B$. Let $f : X \to Y$ be a map. Show that if the restrictions $f|_A : A \to Y$ and $f|_B : B \to Y$ are both continuous (with $A$ and $B$ carrying the subspace topology), then $f$ is continuous (the pasting lemma).

<Solution>
First we record an auxiliary fact: if $A$ is closed in $X$ and $C \subset A$ is closed in the subspace $A$, then $C$ is closed in $X$. Indeed, by the definition of the subspace topology the open sets of $A$ have the form $U \cap A$ with $U$ open in $X$, so the closed sets of $A$ have the form $A \setminus (U \cap A) = A \cap (X \setminus U)$, that is, they are intersections of $A$ with closed subsets of $X$. Since $A$ is itself closed in $X$, such a set is the intersection of two closed subsets of $X$ and hence closed in $X$.

Now let $F \subset Y$ be an arbitrary closed set. If $x \in f^{-1}(F)$ then $x \in X = A \cup B$, so $x \in A$ or $x \in B$; in the first case $x \in (f|_A)^{-1}(F)$, in the second $x \in (f|_B)^{-1}(F)$. Conversely, if $x \in (f|_A)^{-1}(F)$ then $x \in A \subset X$ and $f(x) = f|_A(x) \in F$, so $x \in f^{-1}(F)$; the same argument applies to $(f|_B)^{-1}(F)$. Hence

$$
f^{-1}(F) = (f|_A)^{-1}(F) \cup (f|_B)^{-1}(F) .
$$

Since $f|_A$ is continuous, part (ii) of <Ref to="thm-continuity-characterizations" /> shows that $(f|_A)^{-1}(F)$ is closed in $A$, hence closed in $X$ by the auxiliary fact. Likewise $(f|_B)^{-1}(F)$ is closed in $X$. The union of two closed sets is closed (the dual of (O3), which says that the intersection of two open sets is open), so $f^{-1}(F)$ is closed in $X$. As $F$ was arbitrary, the implication (ii) $\Rightarrow$ (i) of <Ref to="thm-continuity-characterizations" /> shows that $f$ is continuous.

The hypothesis that both $A$ and $B$ are closed cannot be dropped. Take $X = [0,2]$, $A = [0,1]$ (closed in $X$) and $B = (1,2]$ (not closed in $X$), and define $f : X \to \mathbb{R}$ to be $0$ on $A$ and $1$ on $B$. The restrictions $f|_A$ and $f|_B$ are constant maps, hence continuous by <Ref to="ex-extreme-topologies" />. But $f$ itself is not continuous: the set $V := (-1/2, 1/2)$ is open in $\mathbb{R}$, while $f^{-1}(V) = [0,1]$ is not open in $X = [0,2]$ (any open subset of $X$ containing $1$ contains $(1-\delta, 1+\delta) \cap [0,2]$ for some $\delta > 0$, and this set necessarily contains points greater than $1$).
</Solution>
</Exercise>

<Exercise id="exr-sorgenfrey" difficulty="Standard">
Write $\mathbb{R}_\ell$ (the lower limit topology, or Sorgenfrey line) for the space $\mathbb{R}$ equipped with the topology having the family of half-open intervals $\mathcal{B} = \{\, [a,b) : a < b \,\}$ as a base. Show that, with $\mathbb{R}$ carrying its usual topology, the identity map $\mathrm{id} : \mathbb{R}_\ell \to \mathbb{R}$ is continuous, while $\mathrm{id} : \mathbb{R} \to \mathbb{R}_\ell$ is not.

<Solution>
**First part.** We use <Ref to="lem-base-criterion" />. The open intervals form a base for the usual topology of $\mathbb{R}$, so it suffices to show that $\mathrm{id}^{-1}((a,b)) = (a,b)$ is open in $\mathbb{R}_\ell$ for $a < b$. Here

$$
(a,b) = \bigcup_{a < c < b} [c, b) .
$$

Indeed, each $[c,b)$ on the right is contained in $(a,b)$ because $c > a$; conversely, if $x \in (a,b)$ we may take $c = x$, and then $x \in [x, b)$ with $a < x < b$. The right-hand side is a union of members of $\mathcal{B}$ and hence open in $\mathbb{R}_\ell$. So $\mathrm{id} : \mathbb{R}_\ell \to \mathbb{R}$ is continuous.

**Second part.** The set $[0,1) \in \mathcal{B}$ is open in $\mathbb{R}_\ell$, but $\mathrm{id}^{-1}([0,1)) = [0,1)$ is not open in the usual topology. Indeed, for $0 \in [0,1)$ and any $\delta > 0$ we have $-\delta/2 \in (-\delta, \delta)$ and $-\delta/2 \notin [0,1)$, so no open interval containing $0$ is contained in $[0,1)$. Hence $\mathrm{id} : \mathbb{R} \to \mathbb{R}_\ell$ is not continuous.

**How to read the conclusion.** The map $\mathrm{id} : \mathbb{R}_\ell \to \mathbb{R}$ is a continuous bijection, but its inverse $\mathrm{id} : \mathbb{R} \to \mathbb{R}_\ell$ is not continuous, so condition 3 of <Ref to="def-homeomorphism" /> fails and it is not a homeomorphism. Alongside <Ref to="ex-bijective-not-homeo" />, this is further evidence that condition 3 is independent.
</Solution>
</Exercise>

<Exercise id="exr-circle-minus-point" difficulty="Standard">
Show that the space $S^{1} \setminus \{N\}$, obtained from $S^{1} = \{\, (x,y) \in \mathbb{R}^{2} : x^{2}+y^{2}=1 \,\}$ by removing the north pole $N = (0,1)$, is homeomorphic to $\mathbb{R}$, using the stereographic projection $\pi(x,y) = x/(1-y)$.

<Solution>
For $(x,y) \in S^{1}\setminus\{N\}$ we have $y \ne 1$, so $\pi(x,y) = x/(1-y)$ is defined. As a candidate for the inverse take

$$
\sigma(t) := \left( \frac{2t}{t^{2}+1},\ \frac{t^{2}-1}{t^{2}+1} \right) \qquad (t \in \mathbb{R}) .
$$

**The values of $\sigma$ lie in $S^{1}\setminus\{N\}$.** Since $(2t)^{2} + (t^{2}-1)^{2} = 4t^{2} + t^{4} - 2t^{2} + 1 = t^{4}+2t^{2}+1 = (t^{2}+1)^{2}$, the sum of the squares of the two coordinates of $\sigma(t)$ equals $1$, so $\sigma(t) \in S^{1}$. Moreover the second coordinate equals $1$ only if $t^{2}-1 = t^{2}+1$, that is $-1 = 1$, which never happens. Hence $\sigma(t) \ne N$.

**$\pi \circ \sigma = \mathrm{id}_{\mathbb{R}}$.** Since $1 - \dfrac{t^{2}-1}{t^{2}+1} = \dfrac{(t^{2}+1)-(t^{2}-1)}{t^{2}+1} = \dfrac{2}{t^{2}+1}$, we get

$$
\pi(\sigma(t)) = \frac{2t/(t^{2}+1)}{2/(t^{2}+1)} = t .
$$

**$\sigma \circ \pi = \mathrm{id}$.** For $(x,y) \in S^{1}\setminus\{N\}$ put $t := x/(1-y)$. Using $x^{2} = 1-y^{2}$,

$$
t^{2}+1 = \frac{x^{2} + (1-y)^{2}}{(1-y)^{2}} = \frac{(1-y^{2}) + 1 - 2y + y^{2}}{(1-y)^{2}} = \frac{2(1-y)}{(1-y)^{2}} = \frac{2}{1-y} ,
$$

and hence $t^{2}-1 = \dfrac{2}{1-y} - 2 = \dfrac{2y}{1-y}$. Substituting these,

$$
\frac{2t}{t^{2}+1} = \frac{2x/(1-y)}{2/(1-y)} = x, \qquad
\frac{t^{2}-1}{t^{2}+1} = \frac{2y/(1-y)}{2/(1-y)} = y ,
$$

so $\sigma(\pi(x,y)) = (x,y)$. Therefore $\pi$ is a bijection with $\pi^{-1} = \sigma$.

**Continuity.** The map $\pi$ is a rational expression whose denominator does not vanish on the open subset $\{\, (x,y) : y \ne 1 \,\}$ of $\mathbb{R}^{2}$, hence continuous there, and so is its restriction to $S^{1}\setminus\{N\}$ (composition with the inclusion; <Ref to="rem-subspace-criterion" /> and <Ref to="prop-composition" />). The map $\sigma$ is continuous as a map $\mathbb{R} \to \mathbb{R}^{2}$ because $t^{2}+1 \ge 1 > 0$, and since its values lie in $S^{1}\setminus\{N\}$, part (2) of <Ref to="rem-subspace-criterion" /> shows that it is continuous as a map $\mathbb{R} \to S^{1}\setminus\{N\}$. Hence $\pi$ is a homeomorphism and $S^{1}\setminus\{N\} \cong \mathbb{R}$.

That removing a single point turns the circle into a line is exactly the "cutting open" of <Ref to="ex-bijective-not-homeo" />, made legitimate by deleting a point of the domain beforehand.
</Solution>
</Exercise>

<Exercise id="exr-r-vs-r2" difficulty="Hard">
Show that $\mathbb{R}$ and $\mathbb{R}^{2}$ are not homeomorphic. You may use, as results from [Connectedness](/mathematics/topology/connectedness), that every nonempty interval of $\mathbb{R}$ is connected and that $\mathbb{R}^{2}\setminus\{p\}$ is connected for every $p \in \mathbb{R}^{2}$.

<Solution>
**Auxiliary fact (restrictions are homeomorphisms).** If $h : X \to Y$ is a homeomorphism and $A \subset X$, then $h|_A : A \to h(A)$ is a homeomorphism. Indeed, $h$ is injective, so $h|_A$ is a bijection onto $h(A)$. For continuity: the open sets of $h(A)$ have the form $W \cap h(A)$ with $W$ open in $Y$, and

$$
(h|_A)^{-1}(W \cap h(A)) = A \cap h^{-1}(W) ,
$$

which is open in $A$ because $h^{-1}(W)$ is open in $X$ by continuity of $h$. Applying the same argument to $h^{-1} : Y \to X$ and $h(A) \subset Y$ gives continuity of $(h|_A)^{-1}$.

**Main argument.** Suppose $\mathbb{R} \cong \mathbb{R}^{2}$ and take a homeomorphism $h : \mathbb{R} \to \mathbb{R}^{2}$. Put $p := h(0)$. Since $h$ is a bijection, $h(\mathbb{R}\setminus\{0\}) = \mathbb{R}^{2}\setminus\{p\}$, and by the auxiliary fact

$$
h|_{\mathbb{R}\setminus\{0\}} : \mathbb{R}\setminus\{0\} \longrightarrow \mathbb{R}^{2}\setminus\{p\}
$$

is a homeomorphism.

But $\mathbb{R}\setminus\{0\} = (-\infty, 0) \cup (0, \infty)$, where $(-\infty,0)$ and $(0,\infty)$ are open in $\mathbb{R}$ and hence open in the subspace $\mathbb{R}\setminus\{0\}$; they are disjoint, and neither is empty (they contain $-1$ and $1$ respectively). So $\mathbb{R}\setminus\{0\}$ is not connected.

On the other hand, $\mathbb{R}^{2}\setminus\{p\}$ is connected by hypothesis. By <Ref to="cor-connected-invariant" /> connectedness is a topological property, so it is impossible for one of two homeomorphic spaces to be connected and the other not. This is a contradiction, and therefore $\mathbb{R} \not\cong \mathbb{R}^{2}$.

**Remark.** The same argument shows $\mathbb{R} \not\cong \mathbb{R}^{n}$ for $n \ge 2$. It cannot be used to show $\mathbb{R}^{2} \not\cong \mathbb{R}^{3}$, however, since removing a point does not destroy connectedness in either case. The general statement $\mathbb{R}^{m}\not\cong\mathbb{R}^{n}$ for $m \ne n$ (invariance of dimension) requires stronger topological invariants, such as homology groups.
</Solution>
</Exercise>

## References

- J. R. Munkres, *Topology*, 2nd edition, Prentice Hall, 2000 — Chapter 2, §18 "Continuous Functions", collects the equivalent conditions, the pasting lemma and homeomorphisms treated here.
- S. Willard, *General Topology*, Addison-Wesley, 1970 (reprinted by Dover, 2004) — a systematic treatment of the characterisations of continuous maps and homeomorphisms.
- Kazuo Matsuzaka, *Shugo, Iso Nyumon* (Introduction to Sets and Topology), Iwanami Shoten, 1968 (in Japanese) — explains the passage from metric spaces to topological spaces in graded steps, for beginners.
- Fuichi Uchida, *Shugo to Iso* (Sets and Topology), Shokabo, 1986 (in Japanese) — the chapters on continuous maps and homeomorphisms contain many examples along the same lines as this article.
- Teiji Takagi, *Kaiseki Gairon* (Introduction to Analysis), revised 3rd ed., Iwanami Shoten, 1961 (in Japanese) — contains the proof of the Weierstrass theorem that a continuous function on a closed interval attains a maximum, which we used in <Ref to="ex-interval-not-homeo" />.

## Appendix: what topology cannot see — boundedness, completeness, uniform continuity

**Topology forgets how close things are.** In <Ref to="ex-r-homeo-interval" /> we proved $\mathbb{R} \cong (0,1)$. From this single fact it follows immediately that several important metric notions are not topological properties.

**Boundedness is not a topological property.** The interval $(0,1)$ is bounded with respect to the usual metric (its diameter is $1$), whereas $\mathbb{R}$ is not bounded; yet the two are homeomorphic. So the argument "bounded, or unbounded, therefore not homeomorphic" is invalid. Boundedness depends on the metric $d$, and a different metric inducing the same topology can make a space bounded or unbounded at will. Indeed, $d'(x,y) := \min\{1, |x-y|\}$ is a metric on $\mathbb{R}$ that determines the same family of open sets as the usual metric, and $(\mathbb{R}, d')$ is bounded.

**Completeness is not a topological property either.** The space $\mathbb{R}$ is complete for the usual metric, while $(0,1)$ is not: the sequence $x_n = 1/(n+1)$ consists of points of $(0,1)$ and satisfies $|x_n - x_m| \to 0$, so it is a Cauchy sequence, but its limit $0$ does not belong to $(0,1)$. Nevertheless $\mathbb{R} \cong (0,1)$. For completeness see [Completeness of the real numbers and Cauchy sequences](/en/mathematics/real-analysis/completeness-and-cauchy).

**Uniform continuity is not a topological property.** Consider the inverse $h^{-1} : (0,1) \to \mathbb{R}$, $h^{-1}(t) = (2t-1)/(1-|2t-1|)$, of the homeomorphism of <Ref to="ex-r-homeo-interval" />. For $t \in [1/2, 1)$ we have $2t-1 \ge 0$, that is $|2t-1| = 2t-1$, so

$$
h^{-1}(t) = \frac{2t-1}{1-(2t-1)} = \frac{2t-1}{2(1-t)} .
$$

Put $t_n := 1 - 1/n$ and $s_n := 1 - 1/(2n)$ for $n \ge 2$. Since $1 - 1/n \ge 1/2$ and $1 - 1/(2n) \ge 3/4$, both lie in $[1/2,1)$, and

$$
h^{-1}(t_n) = \frac{2(1-1/n)-1}{2/n} = \frac{1 - 2/n}{2/n} = \frac{n}{2} - 1, \qquad
h^{-1}(s_n) = \frac{1 - 1/n}{2 \cdot 1/(2n)} = \frac{1-1/n}{1/n} = n - 1 .
$$

We have $|t_n - s_n| = 1/(2n) \to 0$, whereas

$$
\bigl| h^{-1}(t_n) - h^{-1}(s_n) \bigr| = \Bigl| \frac{n}{2} - 1 - (n-1) \Bigr| = \frac{n}{2} \longrightarrow \infty .
$$

So for $\varepsilon = 1$, no matter which $\delta > 0$ is chosen, any $n$ with $1/(2n) < \delta$ gives $|t_n - s_n| < \delta$ and $|h^{-1}(t_n) - h^{-1}(s_n)| \ge 1$. Hence $h^{-1}$ is not uniformly continuous, while the identity map on $\mathbb{R}$ is. Uniform continuity is not preserved under homeomorphism.

**To summarise**, what a topology remembers is only the qualitative information of which sets lie near a point; the quantitative information of how large the distances are has been discarded. To handle uniform continuity, completeness or boundedness one must pass to a category of maps preserving a finer structure than the topology — a metric, or a uniformity. Conversely, a theorem proved using topological properties alone is robust: it survives any change of metric. Keeping this dividing line in mind makes it visible exactly where distance enters the arguments of [Continuous functions and uniform continuity](/en/mathematics/real-analysis/uniform-continuity).
