\documentclass[12pt]{amsart}
\usepackage{amsmath,bbm}
\usepackage[margin=1in]{geometry}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem*{claim}{Claim}
\newtheorem{observation}[theorem]{Observation}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}

\theoremstyle{remark}
\newtheorem*{remark}{Remark}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{question}[theorem]{Question}
\newtheorem{fact}[theorem]{Fact}

\newcommand{\complexes}{\mathbb{C}}
\newcommand{\seq}[2]{\left({#1}\right)_{#2=0}^\infty}
\newcommand{\tail}[3]{\left({#1}\right)_{#2=#3}^\infty}
\newcommand{\eps}{\varepsilon}
\newcommand{\mcC}{\mathcal{C}}
\renewcommand{\Re}{\mathrm{Re}}
\renewcommand{\Im}{\mathrm{Im}}

\title{Some basic analysis theorems from a sequential viewpoint}
\author{David Milovich}
\date{Feb. 17, 2014}
\begin{document}
\maketitle

For this document, we fix an ambient metric space, 
the complex plane $\complexes$ with its standard metric $d(z,w)=|z-w|$. 
All points are assumed to in $\complexes$;
all sets of points are assumed to be subsets of $\complexes$.

\section{Sequences and convergence.}

\begin{definition}\
\begin{enumerate}
\item A \textbf{subsequence} of a sequence $\seq{z_n}{n}$ 
is a sequence of the form
$\seq{z_{n_k}}{k}$ where $n_0<n_1<n_2<\cdots$.
\item A \textbf{tail} of a sequence $\seq{z}{n}$ is a subsequence of the form
$\seq{z_{N+n}}{n}$ (which may also be denoted by $\tail{z_n}{n}{N}$).
\item A sequence $\seq{z_n}{n}$ is $\eps$-\textbf{stable} if 
$d(z_m,z_n)<\eps$ for all $m,n\geq 0$.
\item A sequence $\seq{z_n}{n}$ is $\eps$-\textbf{close} to a point $L$ if 
$d(z_n,L)<\eps$ for all $n\geq 0$.
\item A sequence $\seq{z_n}{n}$ is \textbf{Cauchy} if, for every $\eps>0$,
it has an $\eps$-stable tail.
\item A sequence $\seq{z_n}{n}$ \textbf{converges} to $L$,
which we often abbreviate as $z_n\rightarrow L$,
if for every $\eps>0$, $\seq{z_n}{n}$ has a tail that is $\eps$-close to $L$.
\end{enumerate}
\end{definition}

\begin{theorem}
A sequence is Cauchy if and only if it converges to some point.
\end{theorem}
\begin{proof}
If $z_n\rightarrow L$, then, for every $\eps>0$, 
$\seq{z_n}{n}$ has a tail that is $\frac{\eps}{2}$-close to $L$.
Such a tail is $\eps$-stable because $d(z_m,z_n)\leq d(z_m,L)+d(L,z_n)$
for all $m,n$. Thus, convergence implies the Cauchy property.

To prove the converse, suppose that $\seq{z_n}{n}$ is Cauchy.
Suppose we can prove that $\Re(z_n)\rightarrow A$ and $\Im(z_n)\rightarrow Bi$
for some reals $A$ and $B$.
Then, for every $\eps>0$, $\seq{\Re(z_n)}{n}$ and $\seq{\Im(z_n)}{n}$ will
have tails $\tail{\Re(z_k)}{k}{M}$ and $\tail{\Im(z_k)}{k}{N}$ that are
$\frac{\eps}{2}$-close to $A$ and $B$, respectively.
Since $|z-w|\leq|\Re(z-w)|+|\Im(z-w)|=|\Re(z)-\Re(w)|+|\Im(z)-\Im(w)|$
for all points $z$ and $w$, it follows that, 
taking $P$ to be larger of $M$ and $N$, 
the tail $\tail{z_k}{k}{P}$ is $\eps$-close to $A+Bi$.

Therefore, setting $x_n=\Re(z_n)$ and $y_n=\Im(z_n)$, it is sufficient to prove 
that the sequences $\seq{x_n}{n}$ and $\seq{y_n}{n}$ converge to reals.
Since $|\Re(z)-\Re(w)|=|\Re(z-w)|\leq|z-w|$ for all points $z$ and $w$
the sequence $\seq{x_n}{n}$ is Cauchy. Likwise, $\seq{y_n}{n}$ is Cauchy.
By symmetry, it is enough to prove that the Cauchy sequence of reals 
$\seq{x_n}{n}$ converges to a real.

For each of $k=0,1,2,3,\ldots$, let $x_{n,k}$ be $x_n$ rounded down
to the nearest integer multiple of $10^{-k}$. 
If $\seq{x_{n,k}}{n}$ is eventually constant, then let $u_k$
denote its final value. For each $k\geq 1$ for which $u_k$ is defined, 
let $d_k$ be the $k$th digit after the decimal place of $u_k$. 
First, suppose we are in the case where $u_k$ is defined for all $k$. 
Set $u=u_0.d_1d_2d_3\ldots$. Given $\eps>0$, choose
$k>0$ such that $10^{-k}<\eps$. Choose $N$ large enough that
we have $x_{n,j}=u_j$ for all $n\geq N$ and $j=0,1,\ldots,k$.
Therefore, $u_0.d_1d_2\ldots d_k\leq x_n < u_0.d_1d_2\ldots d_k+10^{-k}$
for all $n\geq N$, and 
$u_0.d_1d_2\ldots d_k\leq u\leq u_0.d_1d_2\ldots d_k+10^{-k}$. 
Hence, $|x_n-u|\leq 10^{-k}<\eps$ for all $n\geq N$.
Thus, for every $\eps>0$, $\seq{x_n}{n}$ is $\eps$-close to $u$ on a tail.
Thus, $x_n\rightarrow u$.

Now suppose we are in the other case, that $u_k$ is not defined for all $k$.
Let $k$ be least such that $u_k$ is undefined.
Suppose we are in the subcase where $k>0$.
Then $$u_0.d_1d_2d_2\ldots d_{k-1}\leq x_n<u_0.d_1d_2d_2\ldots d_{k-1}+10^{k-1}$$ 
is eventually always true, but there are at least two values 
$a$ in $\{0,\ldots 9\}$ such that 
$$u_0.d_1d_2d_2\ldots d_{k-1}a\leq x_n<u_0.d_1d_2d_2\ldots d_{k-1}a+10^{-k}$$
for infinitely many $n$. Let $v=u_0.d_1d_2d_2\ldots d_{k-1}c$ where $c$ 
is the larger of two values for $a$.
There are then infinitely many $n$ such that $x_n<v$ and
infinitely many $n$ such that $v\leq x_n$.
Given $\eps>0$, choose $m>0$ such that $m\geq k$ and $10^{-m}\leq\eps$. 
Choose $M$ large enough that  we have $x_{n,j}=u_j$ 
for all $n\geq M$ and $j=0,1,\ldots,k-1$, and such that 
$\tail{x_p}{p}{M}$ is $10^{-m}$-stable.
Choose $r,s\geq M$ such that $x_r<v\leq x_s$.
For any $n\geq M$, we have 
\begin{align*}
x_n=x_r+x_n-x_r\leq x_r+|x_n-x_r|<x_r+10^{-m}<v+10^{-m}<v+\eps;\\
x_n=x_s+x_n-x_s\geq x_s-|x_n-x_s|>x_s-10^{-m}\geq v-10^{-m}\geq v-\eps.
\end{align*}
Thus, $\tail{x_p}{p}{M}$ is $\eps$-close to $v$.
Thus, for any $\eps>0$, $\seq{x_n}{n}$ has a tail $\eps$-close to $v$.
Thus, $x_n\rightarrow v$.

The last subcase, where $k=0$, is handled like the previous subcase.
There are at least two adjacent integer values $a$ such that $x_n<a$ 
for infinitely many $n$ and $a\leq x_n<a+1$ for infinitely many $n$. 
Letting $q$ denote the greater of two such values, 
we have $x_n<q$ for infinitely many $n$ 
and $q\leq x_n$ for infinitely many $n$.
Given $\eps>0$, choose $m\geq 0$ such that $10^{-m}\leq\eps$
and $M$ large enough that $\tail{x_p}{p}{M}$ is $10^{-m}$-stable.
Arguing just as in the previous paragraph,
we find that $\tail{x_p}{p}{M}$ is $\eps$-close to $q$.
Thus, $x_n\rightarrow q$.
\end{proof}

\begin{theorem}[Limit Laws]\
\begin{enumerate}
\item If $a_n\rightarrow L$ and $b_n\rightarrow M$, then 
$a_n+b_n\rightarrow L+M$ and $a_nb_n\rightarrow LM$.
\item If $a_n\rightarrow L$ and $b_n\rightarrow M\not= 0$, 
then some tail of $\seq{a_n/b_n}{n}$ converges to $L/M$.
\end{enumerate}
\end{theorem}

\section{Sets of points and convergence.}

\begin{definition}\
\begin{enumerate}
\item A set (of points) $S$ is \textbf{closed} if, 
for every convergent sequence $z_n\rightarrow L$,
if every $z_n$ is in $S$, then $L$ is in $S$ too.
\item A set $S$ is \textbf{complete} if,
for every Cauchy sequence $\seq{z_n}{n}$,
if every $z_n$ is in $S$, then $\seq{z_n}{n}$ converges to some $L$ in $S$.
\item A set is \textbf{compact} if, for every sequence $\seq{z_n}{n}$,
if every $z_n$ is in $S$, then $\seq{z_n}{n}$ has a subsequence 
that converges to some $L$ in $S$.
\item A set is \textbf{bounded} if there exists some $R$ such that $d(p,q)\leq R$ 
for all $p,q$ in $S$.
\item A set $S$ is \textbf{open} if, for every sequence convergent sequence
$z_n\rightarrow L$, if $L$ is in $S$, then a tail of $\seq{z_n}{n}$
consists only of points in $S$.
%\item A point $p$ is an \textbf{interior point} of a set $S$ if
%there exists $\delta>0$ such that, for every point $q$,
%if $d(p,q)<\delta$, then $q\in S$. 
\end{enumerate}
\end{definition}

\begin{lemma}\
\begin{enumerate}
\item If $z_n\rightarrow P$ and $z_n\rightarrow Q$, then $P=Q$.
\item If $z_n\rightarrow P$ and $\seq{z_{n_k}}{k}$ is a subsequence of
$\seq{z_n}{n}$, then $z_{n_k}\rightarrow P$.
\item If $\seq{z_{n_k}}{k}$ is a subsequence of $\seq{z_n}{n}$,
then $n_k\geq k$ for all $k$.
\end{enumerate}
\end{lemma}

\begin{theorem}\
\begin{enumerate}
\item A set is complete if and only if it is closed.
\item A set is compact if and only if it is closed and bounded.
\item A set is closed if and only if its complement is open.
%\item A set is open if and only if all its points are interior points.
\end{enumerate}
\end{theorem}
\begin{proof}\
\begin{enumerate}
\item If $S$ is closed and $\seq{z_n}{n}$ is a Cauchy sequence of points 
in $S$, then $z_n\rightarrow L$ for some $L$; by definition of ``closed,''
that $L$ is in $S$. Thus, if $S$ is closed, then
every Cauchy sequence in $S$ converges to a point in $S$.
In other words, if $S$ is closed, then it is complete. Conversely, 
if $S$ is complete, $z_n$ is in $S$ for all $n$, and $z_n\rightarrow P$,
then, since $\seq{z_n}{n}$ is convergent, it is also Cauchy;
since $S$ is complete, $z_n\rightarrow Q$ for some $Q$ in $S$;
since also $z_n\rightarrow P$, we have $P=Q\in S$.
Thus, if $S$ is complete, then every convergent sequence of points in $S$
converges to a point in $S$.
Thus, if $S$ is complete, then $S$ is closed.

\item Suppose $S$ is compact. If $S$ were not bounded, then there
would be a sequence $\seq{z_n}{n}$ of points in $S$ such that $|z_n|\geq n$
for all $n$. But such a sequence has no $1$-stable tail $\tail{z_k}{k}{N}$
because, given $N$, $|z_{N+k}-Z_N|\geq|z_{N+k}|-|z_N|\geq N+k-|z_N|\geq 1$ 
if $k$ is chosen to be sufficiently large. Therefore, a sequence
$\seq{z_n}{n}$ as above has no Cauchy, and, hence, no convergent, subsequence.
Since $S$ is compact, there can be no such sequence. Hence $S$ is bounded.

Moreover, $S$ is closed because if $\seq{w_n}{n}$ is a sequence of points
in $S$ and $w_n\rightarrow P$, then $P$ is in $S$ because, 
letting $\seq{v_n}{n}$ be one of the subsequences of $\seq{w_n}{n}$ 
that converges to some $Q$ in $S$, then we have $w_n\rightarrow P=Q$.

Conversely, suppose $S$ is closed and bounded.
To show that $S$ is compact, we need to show that, given
a $z_n$ in $S$ for all $n$, there exist $L$ in $S$ and $n_0<n_1<n_2<n_3<\cdots$
such that $z_{n_k}\rightarrow L$. Assume $\seq{z_n}{n}$ is as above.
Since $S$ is closed and, therefore, complete, it suffices to find 
$n_0<n_1<n_2<n_3<\cdots$ such that $\seq{z_{n_k}}{k}$ is Cauchy.
For future notational uniformity, let $n_{0,k}=k$ for all $k$. 
Since $S$ is bounded, $S$ is contained in a closed (solid) square 
$T_0$ of some finite diameter $D$.
Divide this square into four congruent closed subsquares,
each necessarily with diamater $D/2$. 
Since every $z_{n_{0,k}}$ is in it at least one of the four subsquares
and four finite sets cannot have infinite union, we may choose $T_1$
from among the four subsquares such that 
infinitely many $k$ are such that $z_{n_{0,k}}\in T_1$.
Hence, $\seq{z_{n_{0,k}}}{k}$ has a subsequence $\seq{z_{n_{1,k}}}{k}$ 
consisting only of points in $T_1$.
More generally, given $m\geq 0$,
a closed square $T_m$ with diameter $D/2^m$,
and a sequence $\seq{z_{n_{m,k}}}{k}$ of points in $T_m$, we may choose
a closed subsquare $T_{m+1}$ of diamater $D/2^{m+1}$ and
a subsequence $\seq{z_{n_{m+1,k}}}{k}$ consisting only of points from $T_{m+1}$.
Finally, we define a ``diagonal'' sequence $\seq{z_{n_m}}{m}$ 
by $n_m=n_{m,m}$. This sequence is a subsequence of $\seq{z_n}{n}$
because, for all $m$, $n_{m+1}>n_m$ because $n_{m+1,m+1}>n_{m+1,m}\geq n_{m,m}$ 
because $\seq{z_{n_{m+1,k}}}{k}$ is a subsequence of $\seq{z_{n_{m,k}}}{k}$.
Moreover, for each $m$, $\tail{z_{n_k}}{k}{m}$ is $(D/2^m)$-stable
because it is a subsequence of $\seq{z_{n_{m,k}}}{k}$
Hence, for every $\eps$, there is an $m$ large enough that
$\tail{z_{n_k}}{k}{m}$ is an $\eps$-stable tail of $\seq{z_{n_j}}{j}$.
Thus, $\seq{z_n}{n}$ indeed has a Cauchy subsequence.

\item Suppose $S$ is closed. To show that its complement is open,
we need to show that, given a point $w$ not in $S$ and $z_n\rightarrow w$,
$\seq{z_n}{n}$ has a tail of points not in $S$. 
Given $\seq{z_n}{n}$ and $w$ as above, if there were no such tail,
then $z_n$ would be in $S$ for infinitely many $n$, in which case,
$\seq{z_n}{n}$ would have a subsequence $\seq{w_k}{k}$ of points in $S$;
such a subsequence would necessarily converge to $w$.
However, because $S$ is closed, no sequence of points in $S$ 
can converge a point not in $S$, such as $w$. 
Therefore, there is no such subsequence $\seq{w_k}{k}$. 
Therefore, $\seq{z_n}{n}$ must have a tail of points not in $S$, as desired.

Conversely, suppose $S$ is the complement of an open set $U$.
To show that $S$ is closed, we need to show that, given $z_n\rightarrow w$
and $z_n$ in $S$ for all $n$, we have $w$ in $S$. 
Given $\seq{z_n}{n}$ and $w$ as above, if $w$ were not in $S$,
then $w$ would be in $U$, so a tail of $\seq{z_n}{n}$ would be in $U$,
which is impossible because every $z_n$ is in $S$.
%
%\item Suppose every point in a set $S$ is an interior point of $S$.
%Let us show that $S$ is open. Given $z_n\rightarrow w\in S$, it
%is sufficient to show that a tail of $\seq{z_n}{n}$ is in $S$.
%Since $w$ is an interior point of $S$, there exists $\delta>0$
%such that, for every point $z$, if $d(z,w)<\delta$, then $z\in S$.
%But $\seq{z_n}{n}$ has a tail $\delta$-close to $w$, so that tail is in $S$.
%
%Now suppose that $S$ is a set, $p\in S$, and
%$p$ is not an interior point of $S$. Let us show that $S$ is not open.
%For each $n=0,1,2,\ldots$, we may choose $z_n\not\in S$ such that
%$d(z_n,p)<2^{-n}$. Hence, $z_n\rightarrow p\in S$ but every tail of
%$\seq{z_n}{n}$ is disjoint from $S$. Thus, $U$ is not open.
\end{enumerate}
\end{proof}

\begin{theorem}\
\begin{enumerate}
\item Every union of open sets is open.
\item Every intersection of closed sets is closed.
\item Every closed subset of a compact set is compact.
\item Every intersection of finitely many open sets is open.
\item Every union of finitely many closed sets is closed.
\item Every union of finitely many bounded sets is bounded.
\item Every union of finitely many compact sets is compact.
\item If $K_0\supseteq K_1\supseteq K_2\supseteq K_3\supseteq\cdots$
and every $K_n$ is compact and nonempty, then $\bigcap_{n=1}^\infty K_n$
is nonemtpy.
\end{enumerate}
\end{theorem}
\begin{proof}\
\begin{enumerate}
\item Suppose $z_n\rightarrow w\in U=\bigcup_{j\in J}U_j$ and each $U_j$ is open.
It is enough to show that $\seq{z_n}{n}$ has a tail in $U$.
Then $w\in U_k$ for some $k\in J$, so a tail of $\seq{z_n}{n}$ is in $U_k$,
so that tail is in $U$. Thus, $U$ is open.
\item Suppose $z_n\rightarrow w$, $z_n\in C=\bigcap_{j\in J}C_j$
for all $n$, and each $C_j$ is closed. 
It is sufficient to show that $w\in C$. 
For each $j\in J$, we have $z_n\in C_j$ for all $n$, so $w\in C_j$.
Since $w$ is in every $C_j$, $w$ is in $C$ as desired.
\item If $C\subseteq K$, $C$ is closed, and $K$ is compact, then
$K$ is bounded; hence, $C$ is also bounded; hence, $C$ is compact.
\item Suppose $z_n\rightarrow w\in U=U_0\cap U_1\cap\cdots\cap U_{m-1}$ 
and each $U_k$ is open. 
It is enough to show that $\seq{z_n}{n}$ has a tail in $U$.
For each $k<m$, since $w\in U_k$,
there exists $N_k$ such that $z_n\in U_k$ for all $n\geq N_k$; 
hence, taking $N=\max\{N_k:k<m\}$, we have 
$z_n\in U_0\cap U_1\cap\cdots\cap U_{m-1}$ for all $n\geq N$.
Thus, $U$ is open.
\item Suppose $z_n\rightarrow w$, $z_n\in C=C_0\cup C_1\cup\cdots\cup C_{m-1}$
for all $n$, and each $C_j$ is closed. 
It is sufficient to show that $w\in C$. 
Since $m$ finite sets cannot have infinite union, 
there must be some $j<m$ such that $z_n\in C_j$ for infinitely many $n$. 
Hence, $\seq{z_n}{n}$ has a subsequence $\seq{w_n}{n}$ of points in $C_j$. 
Since $w_n\rightarrow w$ and $C_j$ is closed, $w\in C_j$.
Hence, $w\in C$. Thus, $C$ is closed.
\item Suppose $B=B_0\cup B_1\cup\cdots\cup B_{n-1}$ and each $B_k$ is bounded.
For each $k$, choose $M_k$ such that $d(p,q)\leq M_k$ for all $p,q\in B_k$.
Let $M=\max\{M_k:k<n\}$. For each $k$, choose $z_k\in B_k$.
Set $N=\max\{d(z_a,z_b):a,b<n\}$.
Then, for $p,q\in B$, we have, for some $a,b<n$, $p\in B_a$ and $q\in B_b$,
which implies $d(p,q)\leq d(p,z_a)+d(z_a,z_b)+d(z_b,q)\leq M+N+M$.
Thus, $B$ is bounded.
\item This immediately follows from (5) and (6).
\item Let $z_n\in K_n$ for each $n$. By compactness of $K_0$, 
for some point $p$ and some subsequence $\seq{z_{n_k}}{k}$ of $\seq{z_n}{n}$,
we have $z_{n_k}\rightarrow p$. For each $m=0,1,2,3,\ldots$,
the tail $\tail{z_{n_k}}{k}{m}$ also converges to $p$ and lies entirely in $K_m$
because for all $k\geq m$ we have 
$z_{n_k}\in K_{n_k}\subseteq K_k\subseteq K_m$ 
because $n_k\geq k\geq m$. 
Since $K_m$ is closed, $p\in K_m$. Thus, $p\in\bigcap_{m=0}^\infty K_m$.
\end{enumerate}
\end{proof}

\section{Functions, continuity, and sequences of functions.}

In this section, ``a function on $S$'' is our abbreviation 
for ``a complex-valued function $f$ whose domain contains $S$.''

\begin{definition}\
\begin{enumerate}
\item A function is \textbf{continuous} on a set $S$ if, 
for every convergent sequence $z_n\rightarrow L$, 
if $L$ is in $S$ and every $z_n$ is in $S$, then $f(z_n)\rightarrow f(L)$.
\item A function is \textbf{uniformly continuous} on a set $S$ if, 
for every pair of sequences $\seq{z_n}{n}$, $\seq{w_n}{n}$ of points in $S$,
if $d(z_n,w_n)\rightarrow 0$, then $d(f(z_n),f(w_n))\rightarrow 0$.
\item A sequence of functions $\seq{f_n}{n}$ 
converges \textbf{pointwise} to a function $f$ on a set $S$ if, 
for every $z$ in $S$, $f_n(z)\rightarrow f(z)$.
\item A sequence of functions $\seq{f_n}{n}$
converges \textbf{uniformly} to a function $f$ on a set $S$ if, 
for every sequence $\seq{z_n}{n}$ of points in $S$,
$d(f_n(z_n),f(z_n))\rightarrow 0$.
\end{enumerate}
\end{definition}

\begin{lemma}[Subsubsequence Lemma]
Given a sequence $\seq{z_n}{n}$ and a point $L$,
if every subsequence $\seq{z_{n_k}}{k}$ has a subsequence
$\seq{z_{n_{k_m}}}{m}$ that converges to $L$, then $z_n\rightarrow L$.
\end{lemma}
\begin{proof}
We will prove the contrapositive, namely that if $z_n\not\rightarrow L$,
then there is a subsequence $\seq{z_{n_k}}{k}$ such that all of
its subsequences also $\seq{z_{n_{k_m}}}{m}$ fail to converge to $L$.
Assume $z_n\not\rightarrow L$. Then, for some $\eps>0$, there is
no tail of $\seq{z_n}{n}$ that is $\eps$-close to $L$. Choose such an $\eps$.
If only finitely many $n$ were such that $d(z_n,L)\geq\eps$, then
taking $N$ to be greater than all such $n$, we would have a
tail $\tail{z_k}{k}{N}$ that is $\eps$-close to $L$. 
Since there is no such tail, there must be an infinitely many $n$ as above.
Therefore, we may list them as a sequence 
$n_0<n_1<n_2<\cdots$ such that $d(z_{n_k},L)\geq\eps$ for all $k$.
Thus, there is subsequence $\seq{z_{n_k}}{k}$ of $\seq{z_n}{n}$ 
such that $d(z_{n_k},L)\geq\eps$ for all $k$. 
For any subsequence $\seq{z_{n_{k_m}}}{m}$ of $\seq{z_{n_k}}{k}$, 
we have $d(z_{n_{k_m}},L)\geq\eps$ for all $m$, 
which implies $z_{n_{k_m}}\not\rightarrow L$.
\end{proof}

\begin{lemma}\
\begin{enumerate}
\item If $z_n\rightarrow L$ and $d(z_n,w_n)\rightarrow 0$, 
then $w_n\rightarrow L$.
\item If $z_n\rightarrow L$ and $w_n\rightarrow L$, 
then $d(z_n,w_n)\rightarrow 0$.
\item If $d(a_n,b_n)\rightarrow 0$ and $d(b_n,c_n)\rightarrow 0$, 
then $d(a_n,c_n)\rightarrow 0$.
\end{enumerate}
\end{lemma}

\begin{theorem}\
\begin{enumerate}
\item If $S$ is compact and $f$ is continuous on $S$, 
then $f$ is uniformly continuous on $S$.
\item If $\seq{f_n}{n}$ converges uniformly to $f$ on $S$ and
every $f_n$ is continuous on $S$, then $f$ is continuous on $S$.
\end{enumerate}
\end{theorem}
\begin{proof}\
\begin{enumerate}
\item Let $S$ be compact and let $f$ be continuous on $S$.
To show uniformly continuity, we need to show that, given sequences
$\seq{z_n}{n}$, $\seq{w_n}{n}$ of points in $S$ such that
$d(z_n,w_n)\rightarrow 0$, we have $d(f(z_n),f(w_n))\rightarrow 0$.
Assume $\seq{z_n}{n}$ and $\seq{w_n}{n}$ are as above.
By the Subsubsequence Lemma, it suffices to show that, given 
$n_0<n_1<n_2<\cdots$, there exist $k_0<k_1<k_2<\cdots$ such that
$d(z_{n_{k_m}},w_{n_{k_m}})\rightarrow 0$. Let $n_0<n_1<n_2<\cdots$.
By compactness, we may choose $L$ in $S$ and a subsequence 
$\seq{z_{n_{k_m}}}{m}$ of $\seq{z_{n_k}}{k}$ such that $z_{n_{k_m}}\rightarrow L$.
Since $d(z_n,w_n)\rightarrow 0$, $d(z_{n_{k_m}},w_{n_{k_m}})\rightarrow 0$ too.
Hence, $w_{n_{k_m}}\rightarrow L$. By continuity, 
$f(z_{n_{k_m}})\rightarrow f(L)$ and $f(w_{n_{k_m}})\rightarrow f(L)$.
Hence, $d(z_{n_{k_m}},w_{n_{k_m}})\rightarrow 0$ as desired.

\item Assume $\seq{f_n}{n}$ converges uniformly to $f$ on $S$ and
every $f_n$ is continuous on $S$. To show that $f$ is also continuous on $S$,
we need to show that, given a sequence $\seq{z_n}{n}$ of points in $S$
that converges to a point $L$ in $S$, $f(z_n)\rightarrow f(L)$.
Let $\seq{z_n}{n}$ be as above and $n_0<n_1<n_2<\cdots$. 
By the Subsubsequence Lemma, it is enough to find $k_0<k_1<k_2<\cdots$ 
such that $f(z_{n_{k_m}})\rightarrow f(L)$. For each $m=0,1,2,\ldots$,
$f_m$ is continuous, so $f_m(z_{n_k})\rightarrow f_m(L)$,
so some tail $\tail{f_m(z_{n_k})}{k}{N_m}$ is $2^{-m}$-close to $f_m(L)$.
Recursively define a sequence $k_0<k_1<k_2<\cdots$ by
$k_0=N_0$ and $k_{m+1}=\max\{k_m+1,N_{m+1}\}$. 
Hence, $0\leq d(f_m(L),f_m(z_{n_{k_m}}))<2^{-m}$ for all $m$.
Hence, $d(f_m(L),f_m(z_{n_{k_m}}))\rightarrow 0$.
By uniform convergence, $d(f_m(z_{n_{k_m}}),f(z_{n_{k_m}}))\rightarrow 0$ also.
Hence, $d(f_m(L),f(z_{n_{k_m}}))\rightarrow 0$.
Again by uniform convergence, $d(f_m(L),f(L))\rightarrow 0$.
Hence, $d(f(L),f(z_{n_{k_m}}))\rightarrow 0$;
hence, $f(z_{n_{k_m}})\rightarrow f(L)$.
\end{enumerate}
\end{proof}

\begin{theorem}
If $S$ is compact and $f$ is continuous on $S$, then $f(S)$ is compact.
\end{theorem}
\begin{proof}
Let $z_n\in f(S)$ for all $n$. We need to show that
$\seq{z_n}{n}$ has a subsequence converging to some point in $f(S)$.
For each $n$, choose $w_n\in S$ such that $f(w_n)=z_n$.
By compactness of $S$, there is a point $w\in S$ and a subsequence
$w_{n_k}\rightarrow w$. By continuity, $z_{n_k}\rightarrow f(w)$
and $f(w)\in f(S)$, as desired.
\end{proof}

\begin{theorem}\
\begin{enumerate}
\item If $f$ is continuous on $S$ and $g$ is continuous on $f(S)$,
then $g\circ f$ is continuous on $S$.
\item If $f$ and $g$ are continuous on $S$, 
then $f+g$ and $fg$ are continuous on $S$.
\item If $f$ and $g$ are continuous on $S$ and $g\not=0$ on $S$,
then $f/g$ is continuous on $S$.
\end{enumerate}
\end{theorem}
\begin{proof}\
\begin{enumerate}
\item If $z_n\rightarrow w\in S$ and $z_n\in S$ for all $n$,
then $f(z_n)\rightarrow f(w)\in f(S)$ and $f(z_n)\in f(S)$ for all $n$,
which in turn implies that $g(f(z_n))\rightarrow g(f(w))$.
\item This is an immediate consequence of the Limit Laws.
\item This is an immediate consequence of the Limit Laws.
\end{enumerate}
\end{proof}

\end{document}
