% vim: tw=50
% 01/11/2022 11AM

\begin{theorem}
    Let $X$ be a metric space. Then the following
    are equivalent:
    \begin{enumerate}[(i)]
        \item $X$ is compact;
        \item $X$ is sequentially compact;
        \item $X$ is complete and totally bounded;
    \end{enumerate}
    and, if $X$ is a subspace of $\RR^n$ with the
    Euclidean metric
    \begin{enumerate}[(i)]
        \setcounter{enumi}{3}
        \item $X \subset \RR^n$ is closed and
            bounded.
    \end{enumerate}
\end{theorem}

\begin{hiddenflashcard}[compact-implies-sequentially-compact]
Proof that compact implies sequentially compact?
\\
\cloze{
Suppose $(x_n)$ is a sequence with no convergent
subsequence. Then for every $a \in X$ we can find
a neighbourhood of $a$ that contains $x_n$ for
only finitely many values of $a$ (otherwise we can
pick a convergent subsequence tending to $a$).
Call the neighbourhood $G_a$ \\
Let $\mathcal{C} = \{G_a\}$ and let $\mathcal{D}$
be a finite subset. Then $\bigcup_{G \in
\mathcal{D}} G$ contains $x_n$ for only finitely
many $n$, so $\mathcal{D}$ is not a subcover. So
$\mathcal{C}$ has no finite subcover, so $X$ not
compact. Contradiction.
}
\end{hiddenflashcard}

\begin{hiddenflashcard}[sequentially-compact-implies-compact]
Proof that sequentially compact implies compact?
\\
\cloze{
Suppose $X$ compact.
Let $\mathcal{C}$ be an open cover of $X$. Suppose
$\forall \delta > 0$ there exists $a \in X$ such
that $\forall G \in \mathcal{C}$, $B_\delta(a)
\subsetneq G$. Taking $\delta = \frac{1}{n}$, we
get a sequence $x_n$ in $X$ such that $\forall n,
\forall G \in \mathcal{C}$, $B_{1/n}(x_n)
\subsetneq G$. By sequential compactness, take
convergent subsequence $x_{n_j} \to a$. Pick $G
\in \mathcal{C}$ containing $a$. Since $G$ open,
pick $\eps > 0$ such that $B_\eps(a) \subset G$.
Pick $j$ sufficiently large such that $x_{n_j} \in
B_{\eps/2}(a)$ and $\frac{1}{n_j} < \eps/2$. Then
\[ B_{1/n_j}(x_{n_j}) \subset B_\eps(a) \subset G \]
contradiction. So there exists $\delta > 0$ such
that $\forall a \in X$, $\exists G \in
\mathcal{C}$ such that $B_\delta(a) \subset G$.

\myskip
Since $X$ sequentially compact, it's totally
bounded. Pick $A \subset X$ finite such that
$\bigcup_{a \in A} B_\delta(a) = X$ (by totally
boundedness). Then for each $a \in A$ pick $G_a$
containing $B_\delta(a)$ (by the above lemma). Then $\{G_a\}$ is a
finite subcover.
}
\end{hiddenflashcard}

\begin{proof}
    Done (ii) $\iff$ (iii) ($\iff$ (iv) if
    appropriate) in section 2.3. So only remains
    to show (i) $\iff$ (ii).
    \begin{enumerate}
        \item[$\Rightarrow$] Suppose $X$ is not
            sequentially compact. Then there is
            some sequence $(x_n)$ in $X$ with no
            convergent subsequence. Hence for
            every point $a \in X$ we can find a
            neighbourhood of $a$ and hence an open
            set $G_a$ containing $a$ but
            containing $x_n$ for only finitely
            many values of $n$. (If not, pick an
            $a$ for which this is not true; then
            take $n_1$ such that $x_{n_1} \in
            B_1(a)$, then $n_2 > n_1$ such that
            $x_{n_2} \in B_\half(a)$, and so on,
            then $x_{n_j} \to a$, contradiction).
            \myskip
            Now, let $\mathcal{C} = \{G_a \mid a \in X\}$.
            This is an open cover of $X$. But if
            $\mathcal{D} \subset \mathcal{C}$ is
            finite, then $\bigcup_{G \in
            \mathcal{D}} G$ contains $x_n$ for
            only finitely many $n$, so $\bigcup_{G
            \in \mathcal{D}} G \neq X$. So
            $\mathcal{C}$ has no finite subcover.
            Hence $X$ is not compact.
        \item[$\Leftarrow$] Suppose $X$ is
            sequentially compact. Let
            $\mathcal{C}$ be an open cover of $X$.
            Then we claim that there exists
            $\delta > 0$ such that for all $a \in
            X$, there exists $G \in \mathcal{C}$
            such that $B_\delta(a) \subset G$.
            \myskip
            Suppose not. Then $\forall \delta >
            0$, $\exists a \in X$, $\forall G \in
            \mathcal{C}$, $B_\delta(a) \not\subset
            G$. Taking $\delta = \frac{1}{n}$ for
            each $n \in \NN$ we obtain a sequence
            $(x_N)$ in $X$ such that for each $n$,
            $\forall G \in \mathcal{C}$,
            $B_{\frac{1}{n}} (x_n) \not\subset G$.
            By sequential compactness, we can find
            a convergent subsequence $x_{n_j} \to
            a \in X$, say. Pick $G \in
            \mathcal{C}$ such that $a \in G$. As
            $G$ open, can pick $\eps > 0$ such
            that $B_\eps(a) \subset G$. Pick $j$
            sufficiently large that $x_{n_j} \in
            B_{\frac{\eps}{2}}(a)$ and also
            $\frac{1}{n_j} < \frac{\eps}{2}$. Then
            \[ B_{\frac{1}{n_j}}(x_{n_j}) \subset
            B_\eps(a) \subset G \]
            contradiction. So such a $\delta$ does
            exist. \myskip
            Now, take $\delta$ as in the claim. As
            $X$ is sequentially compact, it is
            totally bounded so we can find a
            finite set $A \subset X$ such that for
            all $x \in X$ there exists $a \in A$
            such that $d(x, a) < \delta$. That is
            $\forall x \in X$, $\exists a \in A$
            such that $x \in B_\delta(a)$. That
            is, $X = \bigcup_{a \in A}
            B_\delta(a)$. By choice of $\delta$,
            for each $a \in A$ we can pick $G_a
            \in \mathcal{C}$ such that
            $B_\delta(a) \subset G_a$. So $\{G_a
            \mid a \in A\}$ is a finite subcover.
            So $X$ is compact. \qedhere
    \end{enumerate}
\end{proof}

\noindent
Finally, two important properties of open sets.
First: relationship between open / closed:

\begin{proposition}
    Let $X$ be a metric space and $G \subset X$.
    Then $G$ is open if and only if $F = X
    \setminus G$ is closed.
\end{proposition}

\begin{proof}
    \begin{enumerate}
        \item[$\Rightarrow$] Suppose $F$ not
            closed. Then there is a sequence
            $(x_n)$ in $F$ with $x_n \to x \in G$.
            Suppose $\mathcal{N}$ is a
            neighbourhood of $x$. Then there
            exists $N$ such that for all $n \ge
            N$, $x_n \in \mathcal{N}$. But for all
            $n$, $x_n \not\in G$. So $\mathcal{N}
            \neq G$. So $G$ is not a neighbourhood
            of $x$. So $G$ is not open.
        \item[$\Leftarrow$] Suppose $G$ is not
            open. Then there is some $x \in G$
            such that $\forall \eps > 0$,
            $B_\eps(x) \not\subset G$. That is,
            $B_\eps(x) \cap F \neq \emptyset$. So
            for $n = 1, 2, 3, \dots$ we can pick
            $x_n \in B_{\frac{1}{n}}(x) \cap F$.
            Then $(x_n)$ is a sequence in $F$ with
            $x_n \to x \in G$. So $F$ is not
            closed.
    \end{enumerate}
\end{proof}

\noindent
Secondly: if $X$ is a metric space, can we say
something about the structure of the collection of
all open subsets of $X$?

\begin{proposition}
    Let $X$ be a metric space and let $\tau = \{G
    \subset X \mid \text{$G$ open}\}$. Then:
    \begin{enumerate}[(i)]
        \item $\emptyset \in \tau$ and $X \in
            \tau$,
        \item if $\sigma \subset \tau$ then
            \[ \bigcup_{G \in \sigma} G \in \tau \]
            ``any union of open sets is open''
        \item if $G_1, G_2, \dots, G_n \in \tau$
            then
            \[ \bigcap_{i = 1}^n G_i \in \tau \]
            ``a finite intersection of open sets
            is open''.
    \end{enumerate}
\end{proposition}

\begin{remark*}
    Do need finiteness in (iii). For example for
    all $n \in \NN$, $\left( -\frac{1}{n},
    \frac{1}{n} \right)$ is open in $\RR$ with
    usual metric. But $\bigcap_{n = 1}^\infty
    \left( -\frac{1}{n}, \frac{1}{n} \right) =
    \{0\}$ is not.
\end{remark*}

\begin{proof}
    \begin{enumerate}[(i)]
        \item Obvious
        \item Suppose $\sigma \subset \tau$. Let
            $H = \bigcup_{g \in \sigma} G$.
            Suppose $a \in H$. Then $a \in G$ for
            some $G \in \sigma$. So $G$ is a
            neighbourhood of $a$ (as $G$ open) so
            $H$ is a neighbourhood of $a$ (as $G
            \subset H$). Hence $H$ is open, i.e.
            $H \in \tau$.
        \item Suppose $G_1, \dots, G_n \in \tau$
            and let $J = \bigcap_{i = 1}^n G_i$.
            Suppose $a \in J$. For each $i$, $a
            \in G_i$ and $G_i$ open so $\exists
            \delta_i > 0$ such that
            $B_{\delta_i}(a) \subset G_i$. Let
            $\delta = \min\{\delta_1, \dots,
            \delta_n\}$. Then $\delta > 0$ and
            $B_\delta(a) = \bigcap_{i = 1}^n
            B_{\delta_i}(a) \subset \bigcap_{i =
            1}^n G_i = J$. So $J$ is open, i.e. $J
            \in \tau$.
    \end{enumerate}
\end{proof}

\newpage
\section{Topological Spaces}

`Do continuity entirely in terms of open sets
without mentioning distance'. \myskip
Metric space: set with a distance. \\
Topological space: set with a collection of open
subsets.

\subsection{Definitions and Examples}

\begin{flashcard}[TopSpaceDefn]
\begin{definition*}
    A \emph{topological space} is a set $X$
    endowed with a \emph{topology} $\tau$, that is
    a subset $\tau \subset \mathcal{P}(X)$
    satisfying:
    \begin{enumerate}[(i)]
        \item \cloze{$\emptyset \in \tau$ and $X \in
            \tau$};
        \item \cloze{if $\sigma \subset \tau$ then
            \[ \bigcup_{G \in \sigma} G \in \tau
            \]}
        \item \cloze{if $G_1, \dots, Gn \in \tau$ then
            \[ \bigcap_{i = 1}^n G_i \in \tau \]}
    \end{enumerate}
\end{definition*}
\end{flashcard}

\begin{remark*}
    Could replace (iii) by $G, H \in \tau \implies
    G \cap H \in \tau$. Equivalent to (iii) by
    induction.
\end{remark*}

\begin{notation*}
    Sometimes write `$(X, \tau)$ is a topological
    space'. If obvious what the topology is, might
    just write `$X$ is a topological space'.
\end{notation*}

\begin{example*}
    Let $(X, d)$ be a metric space. Let $\tau =
    \{G \subset X \mid \text{$G$ open}\}$. Then by
    proposition 26, $\tau$ is a topology on $X$.
    We say $\tau$ is the topology induced by the
    metric $d$.
\end{example*}

\noindent
Want to define open / closed / continuous etc for
topological spaces. As metric spaces are
topological spaces we want to try to make sure
it's `backwards compatible', so to say new
definitions don't contradict old metric space
ones. So in making new definitions, we'll be
guided by section 2.4.
