Definition. A topology ${\mathcal T}$ is a collection of sets closed under finite intersections and arbitrary unions.

We often write ${\mathcal T} = {\mathcal T}_X$ to emphasize that $X = \bigcup {\mathcal T}$ is the overall space.


Neighborhoods

It is helpful to think of the $U \in {\mathcal T}$ as being those sets which “contain the nearby space around all their points”. Specifically, suppose that $N: X \times P(X) \to \{0, 1\}$ is a “neighborhood criterion” which for $x, S$ defines whether “the very-nearby space around $x$ is fully contained in $S$”, i.e., satisfies the following axioms:

  1. $N(x, S) \implies x \in S$
  2. $N(x, S_1), S_1 \subset S_2 \implies N(x, S_2)$
  3. $N(x, S_1), N(x, S_2) \implies N(x, S_1 \cap S_2)$
  4. $N(x, S_1) \implies (\exists S_2 \subset S_1): N(x, S_2), (\forall y \in S_2): N(y, S_1)$

Note that if we define $N(S_2, S_1) := 1\{(\forall x \in S_2): N(x, S_1)\}$, then the last axiom becomes $N(x, S_1) \implies (\exists S_2 \subset S_1): N(x, S_2), N(S_2, S_1)$.

For example, given a metric space $(X, d)$, $N(x, S) = 1\{(\exists \delta > 0): B_\delta(x) \subset S\}$ is a valid neighborhood mapping.

Then the first three axioms imply that ${\mathcal T}_N := \{U \subset X \mid (\forall x \in U): N(x, U)\}$ is a topology. And likewise, from any topology, we can recover a neighborhood criterion via $N_{{\mathcal T}}(x, S) := 1\{(\exists U \in {\mathcal T}): x \in U \subset S\}$, such that ${\mathcal T}_{N_{\mathcal T}} = {\mathcal T}$. To prove that $N_{{\mathcal T}_N} = N$, we need the fourth axiom. Therefore, with all four axioms, there is a one to one correspondence between neighborhood criteria and topologies.

Without the fourth axiom, one could define crazy things like $N(0, S) = 1\{\{0, 1\} \subset S\}$ and $x \neq 0 \implies N(x, S) = 1\{(\exists \delta > 0): (x-\delta, x+\delta) \subset S\}$, which is topologically problematic because it says “0 can be unglued from everything but 1, but 1 must stay glued to nearby space”.


Product, quotient, and subspace topology

Definition. Given two topologies ${\mathcal T}_X$ and ${\mathcal T}_Y$, their product topology is defined as the topology generated by products of their open sets.

$${\mathcal T}_{X \times Y} := \{\bigcup {\mathcal U} \mid {\mathcal U} \subset \{U \times V \mid U \in {\mathcal T}_X, V \in {\mathcal T}_Y\} \}$$

Definition. Given an equivalence relation $\sim$ on $X$, the quotient topology is defined as

$${\mathcal T}_{X/\sim} := \{U \subset (X/\sim) \mid (\bigcup U) \in {\mathcal T}_X\}$$

Definition. ${\mathcal T}_A := \{U \cap A \mid U \in {\mathcal T}_X\}$ is the subspace topology for $A \subset X$.


Continuity

Definition. We call a map $f: X \to Y$ continuous if $V \in {\mathcal T}_Y \implies f^{-1}(V) \in {\mathcal T}_X$.

Proposition. $f$ is continuous if and only if $f(\overline{S}) \subset \overline{f(S)}$ for every $S \subset X$, where $\overline{S} = (\bigcup {\mathcal T}_X) \setminus \left(\bigcup\{U \in {\mathcal T}_X \mid S \cap U = \varnothing\}\right)$ is the topological closure operation.

Proof. Assume continuous and let $x \in \overline{S}$. If $f(x) \not\in \overline{f(S)}$ then let $V \in {\mathcal T}_Y$ be such that $f(x) \in V$ and $V \cap f(S) = \varnothing$. But then $f^{-1}(V) \cap S = \varnothing$, a contradiction, since then $f^{-1}(V)$ would a be a neighborhood of $x$ disjoint from $S$, so it wouldn’t be in the closure. Therefore continuity implies $f(\overline{S}) \subset \overline{f(S)}$. Now assume that $f$ is not continuous, so there exists an $x$ and neighborhood $V$ of $f(x)$ such that $x$ is not on the interior of $f^{-1}(V)$, hence $x \in \overline{X \setminus f^{-1}(V)}$. Then $f(x) \in f(\overline{X \setminus f^{-1}(V)}) = \overline{Y \setminus V}$, so that $f(\overline{X \setminus f^{-1}(V)}) \not\subset \overline{f(X \setminus f^{-1}(V))}$. $\square$

Remark: This proposition says that if $x \in X$ is glued to $S \subset X$, that is $x \in \overline{S}$, then $f(x) \in \overline{f(S)}$ will also be glued to $f(S)$. We are therefore justified in saying that continuous maps “add more glue”. On the other hand, a discontinuous map is one which makes some point become unglued from some set.


Definition. A topology ${\mathcal T}_1 \subset {\mathcal T}_2$ is a subtopology.

Proposition. $f: X \to Y$ is continuous if and only if $f^{-1}({\mathcal T}_Y)$ is a subtopology of ${\mathcal T}_X$.

Proposition. ${\mathcal T}_{f(X)} \cong f^{-1}({\mathcal T}_Y)$


Compactness

Definition. We call a topology ${\mathcal T}_X$ compact when every collection of open sets ${\mathcal U}$ which is closed under finite union and satisfies $\bigcup {\mathcal U} = X$ contains $X$.

$$(\textstyle\bigcup {\mathcal U} = X) \wedge \big(U_1, U_2 \in {\mathcal U} \implies (U_1 \cup U_2) \in {\mathcal U}\big) \implies X \in {\mathcal U}$$

Proposition. Subtopologies inherent compactness.

Proposition. For continuous $f$, ${\mathcal T}_{f(X)}$ is compact if and only if $f^{-1}({\mathcal T}_Y)$ is compact.

We call a subset $A$ compact if the subspace topology ${\mathcal T}_A$ is compact.

Proposition. Closed subsets of compact spaces are compact.


Metric topology

Definition. If $(X, d)$ is a metric space then its metric space topology consists of arbitrary unions of open balls of the form

$$B_r(x) := \{y \in {\mathbb R}^d \mid d(y, x) < r\}$$

Theorem. The closure of a set under metric topology contains its limit points.

$$\overline{A} \supset \{\lim x_n \mid x : {\mathbb N} \to A\}$$

Proof. If $x^* = \lim x_n$ where $x_n \in A$, then $x_n$ eventually intersects any ball around $x^*$, therefore $x^*$ cannot be contained by an open set which is disjoint from $A$, therefore $x^*$ is in $\overline{A}$. $\square$

Theorem. If $f: X \to Y$ where both $X$ and $Y$ have a metric topology, and $f$ is continuous, then $f$ commutes with limits.

Proof. Assume that $f$ is continuous. Let $(x_n) \in \mathrm{Cauchy}(X, d)$ have limit $\lim x_n = x^* \in X$. Define $y_n := f(x_n)$ and $y^* := f(x^*)$. Let $\delta > 0$ be arbitrary. Then the continuity of $f$ implies that $f^{-1}(B_\delta(y^*))$ is an open set containing $x^*$, so in particular, it contains some open ball neighborhood $B_\varepsilon(x^*)$. By $\lim x_n = x^*$ we know that $x_n \not\in B_\varepsilon(x^*)$ only finitely often, which implies that $y_n \not\in B_\delta(y^*)$ only finitely often. Since $\delta > 0$ was arbitrary this implies that $\lim y_n = y^*$, so we are done. $\square$.

Remark: To get the converse of these theorems in general, we need the axiom of choice. Which informally means: If you can construct $f$, and show that $f$ is sequentially continuous, then $f$ is continuous. But there might exist a nonconstructible discontinuous $f$ which is continuous with respect to every constructible sequence, but discontinuous wrt a nonconstructible sequence.

Definition. We call a set $S \subset X$ bounded if $S \subset B_n(x)$ for some ball.

Definition. We define the distance between subsets to be

$$d(A, B) := \inf\{d(x, y) \mid x \in A, y \in B\}$$

Remark: This is not a distance metric.

Proposition. The mapping $x \mapsto d(\{x\}, B)$ is continuous with

$$|d(\{x_1\}, B) - d(\{x_2\}, B)| \leq d(x_1, x_2).$$

Proof. Let $x_1, x_2 \in X$ be arbitrary. Let $\delta > 0$ be arbitrary. Let $y \in B$ be such that $d(x_2, y) \leq d(\{x_2\}, B) + \delta$. Then we have

\begin{align*} d(x_1, x_2) &\geq d(x_1, y) - d(x_2, y) \\ &\geq d(\{x_1\}, B) - (d(\{x_2\}, B) + \delta) \\ &= d(\{x_1\}, B) - d(\{x_2\}, B) - \delta \\ \end{align*}

where $\delta > 0$ was arbitrary, so by symmetry we have $|d(\{x_1\}, B) - d(\{x_2\}, B)| \leq d(x_1, x_2).$ $\square$

Corollary. $d_B(x, y) := |d(\{x\}, B) - d(\{y\}, B)|$ is a distance metric.

Proposition. The closure of every set satisfies

$$\overline{A} = \{x \in X \mid d(\{x\}, A) = 0\}$$

Topology of the reals

Definition. The canonical real topology ${\mathcal T}_{{\mathbb R}^n}$ is that generated by the open balls $B_r(x) := \{y \in {\mathbb R}^n \mid \|x - y\| < r\}$. We call a set $S \subset X$ bounded if $S \subset B_n(x)$ for some ball.

Proposition. ${\mathcal T}_{[a_1, b_1] \times \dots [a_n, b_n]} \cong {\mathcal T}_{[0, 1]^n}$.

Proposition. Closed and bounded subsets of ${\mathbb R}$ contain their extrema.

Proof. Let $A \subset {\mathbb R}$ be closed and bounded. Then the supremum $x := \sup A$ exists. But suppose that $x \not\in A$. Then the openness of $A^c$ implies that there exists $\varepsilon$ such that $(x-\varepsilon, x+\varepsilon) \subset A^c$. But this implies that $\sup A \leq x - \varepsilon$, a contradiction. $\square$

Proposition. If $A \subset {\mathbb R}$ is compact, then it is closed and bounded.

Proof. Suppose $A$ is unbounded. Define ${\mathcal U} := \{B_n(0) \cap A \mid n \in {\mathbb N}\}$ to be the intersections of increasing natural-radius open balls with $A$. Then ${\mathcal U}$ is closed under finite unions and $\bigcup {\mathcal U} = A$. But by the unboundedness of $A$, there does not exist any single $B_n(0) \in {\mathcal U}$ such that $A \subset B_n(0)$. Therefore $A$ is not compact, a contradiction.

Now suppose that $A$ is not closed, that is, $A^c$ is not open. Then there exists a point $x \in A^c$ such that $(\varepsilon - x, \varepsilon + x) \not\subset A^c$ for all $\varepsilon > 0$. That is, $(x - \varepsilon, x + \varepsilon) \cap A \neq \varnothing$. Define ${\mathcal U} := \{(-\infty, x-1/n) \cup (x+1/n, +\infty) \mid n \geq 1\}$. Then $\bigcup {\mathcal U} = (-\infty, x) \cup (x, +\infty)$ which is a superset of $A$ since $x \not\in A$. But there does not exist any $U \in {\mathcal U}$ such that $A \subset U$. Therefore $A$ is not compact, a contradiction. $\square$

Corollary. If $f: X \to {\mathbb R}$ is continuous and $A \subset X$ is compact, then $f(A)$ has a minimum and a maximum.

Proof. ${\mathcal T}_{f(A)}$ is compact, so closed and bounded, so has a minimum. $\square$

Theorem. $[0, 1]^n$ is compact for every $n \geq 1$.

Inductively assume that $[0, 1]^n$ is compact. The base case of $[0, 1]^0 = \{0\}$ is trivial. To show that $[0, 1]^{n+1}$ is compact, let ${\mathcal U} \subset {\mathcal T}_{[0, 1]^{n+1}}$ be any collection of open sets which is closed under finite union and satisfies $\bigcup {\mathcal U} = [0, 1]^{n+1}$. We must show that $[0, 1]^{n+1} \in {\mathcal U}$.

Define $J := \{x \in [0, 1] \mid \exists U \in {\mathcal U} : ([0, x] \times [0, 1]^n) \subset U\}$ to be the points in $[0, 1]$ for which the rectangle $[0, x] \times [0, 1]^n$ is covered by some $U \in {\mathcal U}$. Let $t := \sup J$. We will show that $1 \in J$.

Define $C := \{t\} \times [0, 1]^n$. Inductively, the subspace topology ${\mathcal T}_C$ is compact, and $\{U \cap C \mid U \in {\mathcal U}\}$ forms a cover of $C$ closed under finite union, so there exists some $U_1 \in {\mathcal U}$ such that $U_1 \cap C = C$, that is, such that $C \subset U_1$. We will show that this implies either $1 \in J$ or $\sup J > t$, the latter being a contradiction.

Define $f: C \to {\mathbb R}$ via $f(x) := d(\{x\}, V_1)$, where $V_1 := [0, 1]^{n+1} \setminus U_1$. This is a continous function on a compact domain, so it must take a minimum. So we can let $x^* \in C$ be such that $f(x^*) = \delta = \min \{f(x) \mid x \in C\}$.

If $\delta = 0$, then the closedness of $V_1$ implies that $x^* \in V_1$, which is a contradiction since $V_1 \cap C = \varnothing$. Therefore $\delta > 0$. Let $t_1 \in [t-\delta/2, t+\delta/2] \cap [0, 1]$ and $x \in [0, 1]^n$ be arbitrary. Then we have

$$|d(\{(t_1, x)\}, V_1) - d(\{(t, x)\}, V_1)| \leq \|(t_1, x) - (t, x)\| = |t_1 - t| \leq \delta/2$$

so in particular, $d(\{(t_1, x)\}, V_1) \geq \delta/2 > 0$, and therefore $(t_1, x) \in U_1$. We chose $t_1$ and $x$ arbitrarily, so we have shown that $([t-\delta/2, t+\delta/2] \cap [0, 1]) \times [0, 1]^n \subset U_1$.

We defined $t := \sup J$, so there must exist some $t_2 \in [t-\delta/2, t) \cap J$. Let $U_2 \in {\mathcal U}$ be such that $[0, t_2] \times [0, 1]^n$ is covered by $U_2$, so in particular, $[0, t-\delta/2] \times [0, 1]^n$ is covered. Then $U_1 \cup U_2 \in {\mathcal U}$ covers $([0, t+\delta/2] \cap [0, 1]) \times [0, 1]^n$.

If $t < 1$, this implies that $\sup J > t$, a contradiction. Otherwise, if $t = 1$, then this implies that $1 \in J$. Therefore, we have shown that $J = [0, 1]$. $\square$

Corollary. A subset of ${\mathbb R}^n$ is compact if and only if it is closed and bounded.

Corollary. Any continuous function $f: A \to {\mathbb R}$ where $A \subset {\mathbb R}^n$ is closed and bounded has a minimum and a maximum.

Corollary. If $A \subset {\mathbb R}^n$ is closed and bounded then $d(\{x\}, B)$ has a minimizer within $A$.

We call a minimizer $x^* \in A$ of $d(\{x\}, B)$ in $A$ a projection of $B$ onto $A$. The set $B$ may be a singleton.


Remark: We have not used the axiom of choice anywhere.