% vim: tw=50
% 06/10/2022 11AM

\iffalse
Plan for the contents:

SECTION I: GENERALIZING CONTINUITY AND CONVERGENCE
    Chapter 1: Three Examples of Convergence
        (a) Convergence in \RR
        (b) Convergence in \RR^2
        (c) Convergence of functions (main part of
        chapter)
    Chapter 2: Metric Spaces
        Do convergence in a more general setting
    Chapter 3: Topological Spaces
        Even more general

SECTION II: GENERALIZING DIFFERENTIATION
    Only look at functions \RR^n \to \RR^m
\fi

\mychapter{Generalizing continuity and convergence}

\newpage
\section{Three Examples of Convergence}

\subsection{Convergence in $\RR$}

Recall from IA:

\begin{definition*}[Convergence in $\RR$]
    Let $(x_n)$ be a sequence in $\RR$ and $x \in
    \RR$. We say that $(x_n)$ converges to $x$ and
    write $x_n \to x$ if
    \[ \forall\,\, \eps > 0 \,\, \exists N \,\,
    \forall \,\, n \ge N \,\, |x_n - x| < \eps \]
\end{definition*}

\noindent
Useful fact: for all $a, b \in \RR$,
\[ |a + b| \le |a| + |b| \]
(triangle inequality) \myskip
Recall two key theorems:

\begin{theorem*}[Bolzano-Weierstrass]
    A bounded sequence in $\RR$ must have a
    convergent subsequence. (proof is by interval
    bisection).
\end{theorem*}

\noindent
Recall:

\begin{definition*}
    A sequence $(x_n)$ in $\RR$ is \emph{Cauchy}
    if
    \[ \forall \,\, \eps > 0 \,\, \exists \,\, N \,\,
    \forall m, n \ge N \quad |x_m - x_n| , \eps \]
\end{definition*}

\noindent
Easy exercise: prove that convergent implies
Cauchy. \\
General principle of convergence: Any Cauchy
sequence in $\RR$ converges. (outline proof: If
$(x_n)$ Cauchy then $(x_n)$ bounded so by
Bolzano-Weierstrass it has a convergent
subsequence, say $x_{n_j} \to x$. But since
Cauchy, $x_n \to x$.)

\subsection{Convergence in $\RR^2$}

\begin{remark*}
    This all works in $\RR^n$.
\end{remark*}

\noindent
Let $(z_n)$ be a sequence in $\RR^2$ and $z \in
\RR^2$. What should $z_n \to z$ mean? \myskip
In $\RR$: ``As $n$ gets large, $z_n$ gets
arbitrarily close to $z$''. \myskip
What does `close' mean in $\RR^2$? \myskip
In $\RR$: $a, b$ close if $|a - b|$ small. \\
In $\RR^2$: replace $| \bullet |$ by $\| \bullet
\|$. \myskip
Recall: If $z = (x, y)$ then $\|z\| = \sqrt{x^2 +
y^2}$. \myskip
Triangle inequality: If $a, b \in \RR^2$ then
\[ \|a + b\| \le \|a\| + \|b\| \]

\begin{definition*}
    Let $(z_n)$ be a sequence in $\RR^2$ and $z
    \in \RR^2$. We say $(z_n)$ converges to $z$
    and write $z_n \to z$ if
    \[ \forall \,\, \eps > 0 \,\, \exists \,\, N
    \,\, \forall \,\, n \ge N \quad \|z_n - z\| <
    \eps .\]
    Equivalently, $z_n \to z$ if and only if
    $\|z_n - z\| \to 0$.
\end{definition*}

\begin{example*}
    Let $(z_n), (w_n)$ be sequences in $\RR^2$
    with $z_n \to z$, $w_n \to w$. Then $z_n + w_n
    \to z + w$.
\end{example*}

\begin{proof}
    \[ \|(z_n + w_n) - (z + w)\| \le \|z_n - z\| +
    \|w_n - w\| \to 0 + 0 = 0 \]
    (by results from IA)
\end{proof}

\myskip
In fact, given convergence in $\RR$, convergence
in $\RR^2$ is easy:

\begin{proposition}
    Let $(z_n)$ be a sequence in $\RR^2$ and let
    $z \in \RR^2$. Write $z_n = (x_n, y_n)$ and $z
    = (x, y)$. Then $z_n \to z$ if and only if
    $x_n \to x$ and $y_n \to y$.
\end{proposition}

\begin{proof}
    \begin{enumerate}
        \item[$\Rightarrow$] $|x_n - x|, |y_n -
            y| \le \|z_n - z\|$. So if $\|z_n -
            z\| \to 0$, then $|x_n - x| \to 0$
            and $|y_n - y| \to 0$.
        \item[$\Leftarrow$] If $|x_n - x| \to 0$
            and $|y_n - y| \to 0$ then
            \[ \|z_n - z\| = \sqrt{(x_n - x)^2 +
            (y_n - y)^2} \to 0 \]
            by results in $\RR$.
    \end{enumerate}
\end{proof}

\begin{definition*}
    A sequence $(z_n)$ in $\RR^2$ is bounded if
    $\exists \,\, M \in \RR$ such that for all
    $n$, $\|z_n\| \le M$.
\end{definition*}

\begin{hiddenflashcard}[bolzano-weierstrass-in-Rn]
Proof of Bolzano Weierstrass in $\RR^n$? \\
\cloze{
Take subsequence which is convergent in first
coordinate, take subsequence of this which is
convergent in second coordinate etc\ldots
}
\end{hiddenflashcard}

\begin{theorem}[Bolzano Weierstrass in $\RR^2$]
    A bounded sequence in $\RR^2$ must have a
    convergent subsequence.
\end{theorem}

\begin{proof}
    Let $(z_n)$ be a bounded sequence in $\RR^2$.
    Write $z_n = (x_n, y_n)$. Now for all $n$,
    $|x_n| \le \|z_n\|$ so $(x_n)$ is a bounded
    sequence in $\RR$. So by Bolzano Weierstrass,
    it has a convergent subsequence, say $x_{n_j}
    \to x \in \RR$. Similarly, $(y_{n_j})$ is a
    bounded sequence in $\RR$ so has a convergent
    subsequence $y_{n_{j_k}} \to y$. Now also
    $x_{n_{j_k}} \to x$. Hence $z_{n_{j_k}} \to z
    = (x, y)$.
\end{proof}

\begin{definition*}
    A sequence $(z_n)$ in $\RR^2$ is \emph{Cauchy}
    if
    \[ \forall \,\, \eps > 0 \,\, \exists \,\, N
    \,\, \forall \,\, m, n \ge N \quad \|x_m -
    x_n\| < \eps \]
\end{definition*}

\noindent
Easy exercise: Convergent implies Cauchy.

\begin{theorem}[General Principle of Convergence
    for $\RR^2$]
    Any Cauchy sequence in $\RR^2$ converges.
\end{theorem}

\begin{proof}
    Let $(z_n)$ be a Cauchy sequence in $\RR^2$.
    Write $z_n = (x_n, y_n)$. For all $m, n$,
    $|x_m - x_n| \le \|z_m - z_n\|$ so $(x_n)$ is
    Cauchy sequence in $\RR$, so converges by
    General Principle of Convergence. Similarly
    for $(y_n)$. So by proposition 1, $(z_n)$
    converges.
\end{proof}
