%%latex file
%\documentstyle[12pt,amssymb]{amsart}
\documentclass[12pt]{amsart} \usepackage{amssymb} \usepackage{mathabx} \usepackage{bm} \usepackage{wasysym} \usepackage{graphicx} \usepackage{stmaryrd}
\usepackage{imakeidx}
\usepackage{color,hyperref}
\hypersetup{colorlinks,breaklinks,
             linkcolor=blue,urlcolor=blue,
           anchorcolor=blue,citecolor=blue}
\newenvironment{pf}{\proof[\proofname]}{\endproof}

\makeindex[name=terms,title=Index of terms, columns=2]

\renewcommand\baselinestretch{1.1}
\renewcommand\theequation{\arabic{section}.\arabic{equation}}

\newcommand{\wrlab}[1]{\label{#1}}
\renewcommand{\arraystretch}{1}

\newtheorem{thm}{THEOREM}[section]
\numberwithin{thm}{subsection}
\newtheorem{axiom}[thm]{AXIOM}
\newtheorem{defn}[thm]{DEFINITION}

\newcommand{\secref}[1]{\S\ref{#1}}

\newcommand{\tref}[1]{Theorem~\ref{#1}}
\newcommand{\aref}[1]{Axiom~\ref{#1}}
\newcommand{\dref}[1]{Definition~\ref{#1}}

% BLACK BOARD BOLD

\def\Bbb{\mathbb}  %needed in Nancy

\def\A{{\mathbb A}} \def\B{{\mathbb B}} \def\C{{\mathbb C}} \def\D{{\mathbb D}}
\def\N{{\mathbb N}} \def\I{{\mathbb I}} \def\Q{{\mathbb Q}} \def\R{{\mathbb R}}
\def\Z{{\mathbb Z}} 

\def\T{{\mathbb T}}

\def\P{{\mathbb P}} 

% BOLD
\def\bfzero{{\bf 0}}
\def\bfP{{\bf P}}
\def\bfQ{{\bf Q}}
\def\bfS{{\bf S}}
\def\bfT{{\bf T}}

% CAL 
\def\Cal{\mathcal} \def\scra{{\mathcal A}} \def\scrb{{\mathcal B}}
\def\scrd{{\mathcal D}} \def\scrf{{\mathcal F}} \def\scrg{{\mathcal G}}
\def\scri{{\mathcal I}} \def\scrk{{\mathcal K}} \def\scrl{{\mathcal L}}
\def\scrm{{\mathcal M}} \def\scrp{{\mathcal P}} \def\scrq{{\mathcal Q}}
\def\scrr{{\mathcal R}} \def\scrs{{\mathcal S}} \def\scrt{{\mathcal T}}
\def\scru{{\mathcal U}} \def\scrv{{\mathcal V}} \def\scrw{{\mathcal W}}
\def\scre{{\mathcal E}} \def\scrx{{\mathcal X}} \def\scry{{\mathcal Y}}
\def\scrz{{\mathcal Z}} \def\scrh{{\mathcal H}} \def\scrc{{\mathcal C}}
\def\scrn{{\mathcal N}} \def\scro{{\mathcal O}}
\def\scrpf{{\scrp\scrf}}

% HATTED ROMAN
\def\hatd{{\widehat{d}}}
\def\hatX{{\widehat{X}}}

% HATTEDCAL
\def\hatscrp{{\widehat{\scrp}}}
\def\hatscrp{{\widehat{\scrp}}}
\def\hatpi{{\widehat{\pi}}}

% HATTED BB BOLD
\def\hatbbR{{\widehat{\R}}}

\newcommand\scrlito{
  \mathchoice
    {{\scriptstyle\mathcal{O}}}% \displaystyle
    {{\scriptstyle\mathcal{O}}}% \textstyle
    {{\scriptscriptstyle\mathcal{O}}}% \scriptstyle
    {\scalebox{.7}{$\scriptscriptstyle\mathcal{O}$}}%\scriptscriptstyle
  }

\def\scrbigo{{\widehat{\scro}}}

% LIE ALGEBRAS

\font\tenolde=eufm10 at 10pt
\font\sevenolde=eufm7
\font\fiveolde=eufm5
\newfam\oldefam
\textfont\oldefam=\tenolde
\scriptfont\oldefam=\sevenolde
\scriptscriptfont\oldefam=\fiveolde
\def\fraktwo{\fam\oldefam\tenolde}

\newfam\cyrfam
\font\tencyr=wncyr10
\def\cyr{\fam\cyrfam\tencyr}

\newcommand\sbullet[1][.75]{\mathbin{\vcenter{\hbox{\scalebox{#1}{$\bullet$}}}}}

\def\aff{{\mathfrak{aff}(\R)}} \def\La{{\mathfrak a}}
\def\Lb{{\mathfrak b}} \def\Lc{{\mathfrak c}} \def\Lg{{\mathfrak g}}
\def\Lh{{\mathfrak h}} \def\Lk{{\mathfrak k}} \def\Ll{{\mathfrak l}}
\def\Lm{{\mathfrak m}} \def\Ln{{\mathfrak n}} \def\Lr{{\mathfrak r}}
\def\Ls{{\mathfrak s}} \def\Lt{{\mathfrak t}} \def\Lw{{\mathfrak w}}
\def\Lq{{\mathfrak q}} \def\Lu{{\mathfrak u}} \def\Lv{{\mathfrak v}}
\def\Lz{{\mathfrak z}} \def\Lsl{\mathfrak{sl}} \def\Lgl{\mathfrak{gl}}
\def\Lp{{\mathfrak p}} \def\Lf{{\mathfrak f}} \def\Lx{{\mathfrak x}}
\def\Lpsl{\mathfrak{psl}}
\def\Lso{{\mathfrak{so}}} 
\def\Lsu{{\mathfrak{su}}} 
\def\Lsp{{\mathfrak{sp}}} 
\def\orthog{{\mathfrak{o}}} 
\def\tilso{{\mathfrak{so}}}
\def\tilco{{\mathfrak{co}}} 
\def\co{\mathfrak{co}}

% OVERLINE
\def\barscru{{\overline{\scru}}}
\def\barPsi{{\overline{\Psi}}}
\def\barA{{\overline{A}}}
\def\barB{{\overline{B}}}
\def\barC{{\overline{C}}}
\def\barD{{\overline{D}}}
\def\barE{{\overline{E}}}
\def\barF{{\overline{F}}}
\def\barbarF{{\overline{\overline{F}}}}
\def\barG{{\overline{G}}}
\def\barH{{\overline{H}}}
\def\barI{{\overline{I}}}
\def\barJ{{\overline{J}}}
\def\barK{{\overline{K}}}
\def\barL{{\overline{L}}}
\def\barM{{\overline{M}}}
\def\barN{{\overline{N}}}
\def\barP{{\overline{P}}}
\def\barbarP{{\overline{\overline{P}}}}
\def\barQ{{\overline{Q}}}
\def\barR{{\overline{R}}}
\def\barS{{\overline{S}}}
\def\barT{{\overline{T}}}
\def\barU{{\overline{U}}}
\def\barV{{\overline{V}}}
\def\barW{{\overline{W}}}
\def\barbarW{{\overline{\overline{W}}}}
\def\barX{{\overline{X}}}
\def\barY{{\overline{Y}}}
\def\barZ{{\overline{Z}}}
\def\barLr{{\overline{\Lr}}}
\def\barLg{{\overline{\Lg}}}
\def\barLh{{\overline{\Lh}}}
\def\barLp{{\overline{\Lp}}}
\def\barLn{{\overline{\Ln}}}
\def\barLm{{\overline{\Lm}}}
\def\barLl{{\overline{\Ll}}}
\def\bara{{\overline{a}}}
\def\bare{{\overline{e}}}
\def\barf{{\overline{f}}}
\def\barg{{\overline{g}}}
\def\bark{{\overline{k}}}
\def\baru{{\overline{u}}}
\def\barv{{\overline{v}}}
\def\barw{{\overline{w}}}
\def\barz{{\overline{z}}}
\def\barbeta{{\overline{\beta}}}
\def\bargamma{{\overline{\gamma}}}
\def\barI{{\overline{I}}}

% TILDE
\def\tilvec{\widetilde{\vec}}

% HAT
\def\hatA{{\widehat{A}}}
\def\hatC{{\widehat{C}}}
\def\hatH{{\widehat{H}}}
\def\hatI{{\widehat{I}}}
\def\hatN{{\widehat{N}}}
\def\hatQ{{\widehat{Q}}}
\def\hatR{{\widehat{R}}}
\def\hatS{{\widehat{S}}}
\def\hatV{{\widehat{V}}}
\def\hatt{{\widehat{t}}}
\def\hatu{{\widehat{u}}}
\def\hatv{{\widehat{v}}}
\def\hatw{{\widehat{w}}}
\def\hatx{{\widehat{x}}}
\def\haty{{\widehat{y}}}
\def\hatz{{\widehat{z}}}
\def\hatalpha{{\widehat{\alpha}}}
\def\hatrho{{\widehat{\rho}}}
\def\hatkappa{{\widehat{\kappa}}}
\def\hatlambda{{\widehat{\lambda}}}
\def\hatsigma{{\widehat{\sigma}}}
\def\hatmu{{\widehat{\mu}}}
\def\hatnu{{\widehat{\nu}}}
\def\hattau{{\widehat{\tau}}}

% CHECK
\def\ckt{{\widecheck{t}}}
\def\ckw{{\widecheck{w}}}
\def\ckx{{\widecheck{x}}}
\def\cky{{\widecheck{y}}}
\def\ckz{{\widecheck{z}}}
\def\cksigma{{\widecheck{\sigma}}}
\def\cktau{{\widecheck{\tau}}}
\def\ckH{{\widecheck{H}}}
\def\ckN{{\widecheck{N}}}
\def\ckS{{\widecheck{S}}}

\def\ds{\displaystyle}
\def\bfindex[#1]{{\bf#1}\index[terms]{#1}}

\def\timestimes{{\times\!\!\times}}

%operators
\def\PF{{\rm PF}}
\def\set{{\rm set}}
\def\bi{{\rm bi}}
\def\fn{{\rm fn}}
\def\ss{{\rm setset}}
\def\sf{{\rm setfn}}
\def\fs{{\rm fnset}}
\def\seq{{\rm seq}}
\def\EUCL{{\rm EUCL}}
\def\TNSR{{\rm TNSR}}
\def\starstar{{**}}
\def\fincap{{\hbox{{\rm fin}}\,\cap}}
\def\fincup{{\hbox{{\rm fin}}\,\cup}}
\def\ctblcap{{\hbox{{\rm ctbl}}\,\cap}}
\def\ctblcup{{\hbox{{\rm ctbl}}\,\cup}}
\def\finamalg{{\hbox{{\rm fin}}\,\amalg}}
\def\two{{\rm two}}
\def\three{{\rm three}}
\def\ten{{\rm ten}}
\def\Lin{{\rm Lin}}
\def\Bilin{{\rm Bilin}}
\def\Trilin{{\rm Trilin}}
\def\PS{{\rm PS}}
\def\UE{{\rm UE}}
\def\FV{{\rm FV}}
\def\CH{{\rm CH}}
\def\DQ{{\rm DQ}}
\def\SS{{\rm SS}}
\def\SUMS{{\rm SUMS}}
\def\res{{\rm res}}
\def\add{{\rm add\,}}
\def\FS{{\rm FS}}
\def\LIMS{{\rm LIMS}}
\def\NOT{{\rm NOT}}
\def\ORB{{\rm ORB}}
\def\dlin{{\rm dlin}}
\def\LINS{{\rm LINS}}
\def\opLIMS{\mathop{\LIMS}}
\def\IDS{{\rm IDS}}
\def\UL{{\rm UL}}
\def\UB{{\rm UB}}
\def\LB{{\rm LB}}
\def\LP{{\rm LP}}
\def\LPD{{\rm LPD}}
\def\Isol{{\rm Isol}}
\def\Cl{{\rm Cl}}
\def\sCl{{\rm sCl}}
\def\id{{\rm id}}
\def\dim{{\rm dim\,}}
\def\DIMS{{\rm DIMS\,}}
\def\Bas{{\rm Bas\,}}
\def\Int{{\rm Int}}
\def\IntD{{\rm IntD}}
\def\det{{\rm det\,}}
\def\exp{{\rm exp}}
\def\End{{\rm End}}
\def\SO{{\rm SO}}
\def\CO{{\rm CO}}
\def\O{{\rm O}}
\def\Stab{{\rm Stab}}
\def\Fix{{\rm Fix}}
\def\GL{{\rm GL}}
\def\Ad{{\rm Ad}}
\def\Aut{{\rm Aut}}
\def\der{{\rm der}}
\def\ad{{\rm ad}}
\def\diag{{\rm diag}}
\def\Mink{{\rm Mink}}
\def\Tay{{\rm Tay}}
\def\lin{{\rm lin}}
\def\switch{{\rm switch}}
\def\SOtwortwo{{\SO(2)\ltimes\R^2}}
\def\O{{\rm O}}
\def\OB{{\rm OB}}
\def\SO{{\rm SO}}
\def\SL{{\rm SL}}
\def\PSL{{\rm PSL}}
\def\SBF{{\rm SBF}}
\def\STF{{\rm STF}}
\def\SM{{\rm SM}}
\def\QF{{\rm QF}}
\def\Id{{\rm Id}}
\def\dom{{\rm dom}}
\def\im{{\rm im}}
\def\dd{{\rm dd}}
\def\dct{{\rm dct}}
\def\sym{{\rm sym}}
\def\Sym{{\rm Sym}}
\def\as{{\rm as}}
\def\mm{{\rm mm}}
\def\cof{{\rm cof}}
\def\adj{{\rm adj}}
\def\det{{\rm det}}
\def\DET{{\rm DET}}
\def\ADJ{{\rm ADJ}}
\def\DNZ{{\hbox{\rm DNZ}}}
\def\CVZ{{\hbox{\rm CVZ}}}
\def\BNZ{{\hbox{\rm BNZ}}}
\def\ev{{\rm ev}}
\def\sl{{\rm s\ell}}
\def\VL{{\rm VL}}
\def\con{{\rm con}}
\def\sgn{{\rm sgn}}

%misc
\def\US{{\rm US}}
\def\LS{{\rm LS}}
\def\USI{{\rm USI}}
\def\LSI{{\rm LSI}}
\def\JU{{\rm JU}}
\def\JL{{\rm JL}}
\def\LOC{{\rm LOC}}
\def\JOC{{\rm JOC}}
\def\fin{{\rm fin}}
\def\TL{{\rm TL}}
\def\TLOC{{\rm TLOC}}
\def\TJOC{{\rm TJOC}}
\def\L{{\rm L}}
\def\LO{{\rm LO}}
\def\JO{{\rm JO}}
\def\JI{{\rm JI}}
\def\LI{{\rm LI}}
\def\SI{{\rm SI}}
\def\supp{{\rm supp}}
\def\scroi{{\scro\scri}}
\def\vep{{\varepsilon}}
\def\bksl{{\backslash}}
\def\sigmaalg{{\rm s.alg}}
\def\drta{\dashrightarrow}
\def\ltlt{{<\!\!<}}
\def\phx{\phantom{x}}

\def\Xint#1{\mathchoice
{\XXint\displaystyle\textstyle{#1}}%
{\XXint\textstyle\scriptstyle{#1}}%
{\XXint\scriptstyle\scriptscriptstyle{#1}}%
{\XXint\scriptscriptstyle\scriptscriptstyle{#1}}%
\!\int}
\def\XXint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$ }
\vcenter{\hbox{$#2#3$ }}\kern-.6\wd0}}
\def\ddashint{\Xint=}
\def\dashint{\Xint-}

\begin{document}
\bibliographystyle{alpha}

%TITLE: 

\title[Class Notes]
{Class Notes}

\author{Scot Adams}

\date{Printout date: \today}

\maketitle

\tableofcontents

\vfil\eject
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Preliminaries}

\subsection{What is math?}
\quad
\vskip.1in\noindent

Math is truth.

\subsection{Bound and unbound variables}
\quad
\vskip.1in\noindent
First, a word about the English language:\\
The past participle of ``to bound'' is ``bounded''.\\
So, if you bound something, it becomes bounded.\\
There is a completely different verb, ``to bind'',\\
\phx\qquad and its past participle is, confusingly, ``bound''.\\
So, if you bind something, it becomes bound, NOT bounded.

At any point in any definition, theorem or proof, every variable
is either \bfindex[bound] or \bfindex[unbound].
To see how binding and unbinding works exactly, read the beginning of the exposition handout,
up to the text ``General rules of argument'' that appears in the middle of Page 3.
Note: A \bfindex[free] variable is exactly the same thing as an unbound variable.

In class (Lec 01, Slide 18), we went through several examples of binding and freeing of variables.
The most common mistake students make on early homework is not being careful about binding of variables.
A free variable cannot be used, except in a binding statement.
If you use a free variable, it is sometimes a small problem, but often much larger, and can result in no credit
being given at all.
So: Understanding the ``scope'' of each variable (where it becomes bound, and where, later, it becomes free) is crucial.

Also, some variables are integers, some variables are sets, some are real numbers, {\it etc.}
Understanding the ``type'' of each variable is also crucial.

If you have questions about these topics, it's important to come and talk to me.
It is hard to explain these topics in written form; typically a conversation is needed.

\subsection{The object $\frownie$}\wrlab{sec-frownie}
\quad
\vskip.1in\noindent

\begin{axiom}\wrlab{ax-frownie-not-in-set}
\quad $\forall$set $S$, $\frownie\notin S$.
\end{axiom}

\begin{axiom}
\quad $\forall x$, \quad $x/0=\frownie$.
\end{axiom}

\begin{thm}
\quad $1/0=\frownie$.
\end{thm}

\noindent
We wish to set things up so that $\frownie$ is ``infective'', meaning:\\
\phx\quad If some expression contains a subexpression is equal to $\frownie$,\\
\phx\quad then the entire expression equal to $\frownie$.\\
Toward that end, we make the following axioms:

\begin{axiom}\phx\\
\phx\quad $\forall x$, $x+\frownie=\frownie+x=\frownie$.\\
\phx\quad $\forall x$, $x-\frownie=\frownie-x=\frownie$.\\
\phx\quad $\forall x$, $x\cdot\frownie=\frownie\cdot x=\frownie$.\\
\phx\quad $\forall x$, $x/\frownie=\frownie/x=\frownie$.
\end{axiom}

\noindent
Also, using $<$ or $>$, $\frownie$ cannot be compared to any object.

\begin{axiom}\phx\\
\phx\quad $\forall x$, $\neg(\frownie<x)$.\\
\phx\quad $\forall x$, $\neg(\frownie>x)$.\\
\phx\quad $\forall x$, $\neg(x<\frownie)$.\\
\phx\quad $\forall x$, $\neg(x>\frownie)$.
\end{axiom}

\noindent
Let $a$ and $b$ be strings of characters.\\
The notation $\boxed{a\,\,\,\,=^*\,\,b}$ is short for $(b=\frownie)\vee(a=b)$.\\
The notation $\boxed{a\,\,\,\,{}^*\!\!=\,\,\,\,b}$ is short for $(a=\frownie)\vee(a=b)$.\\
\\
Note that $0/0=\frownie$, and so $\neg(\forall x\in\R,\,\,x/x=1)$.\\
That is, it is NOT correct to say that, for all $x\in\R$, we have $x/x=1$,\\
\phx\qquad because it doesn't work for $x=0$.\\
We could say $\forall x\in\R^\times_0,\,\,x/x=1$.\\
\\
The following theorems illustrate the notation described above:

\begin{thm}
\qquad $\forall x\in\R$, \qquad $x/x\,\,\,{}^*\!\!=\,\,\,\,1$.
\end{thm}

\begin{thm}
\qquad $\forall x\in\R$, \qquad $x^2\,\,\,=^*\,\,x^7/x^5$.
\end{thm}

\begin{thm}
\qquad $\forall x\in\R$, \qquad $x^5/x^3=x^4/x^2$.
\end{thm}

\subsection{Some logic and set theory}
\quad
\vskip.1in\noindent
We use ``$\forall$'' for ``for every''.\\
We use ``$\exists$'' for ``there exists''.\\
We use ``$\&$'' for ``and''.\\
We use ``$\vee$'' for ``or''.\\
We use ``$\neg$'' for ``not''.\\
We use ``$\therefore$'' for ``therefore''.\\
We use ``$\Rightarrow$'' for ``implies''.\\

Let $A$ and $B$ be statements.
Then ``$A\Leftrightarrow B$'' is a statement,
and means ``$(A\Rightarrow B)\&(B\Rightarrow A)$'';
here, the parentheses are crucial.

An \bfindex[extended real number] or, more succinctly, an \bfindex[extended real], is any of the following:\\
\phx\quad a real number \quad or\quad the symbol $\infty$\quad or\quad the two symbol string $-\infty$.\\
Sometimes ``$+\infty$'' is used to mean ``$\infty$''.

\begin{defn}
$\boxed{\R^*}:=\{-\infty\}\bigcup\R\bigcup\{\infty\}$.
\end{defn}

\noindent
It is our convention that no extended real is considered to be a set:

\begin{axiom}\wrlab{axiom-extended-reals-not-sets}\phx\\
\phx\quad $\forall$set $A$, $\forall x\in\R^*$, $x\ne A$.
\end{axiom}

\noindent
We will use $\frownie$ to mean ``does not exist''.\\
So, for example, $1/0=\frownie$.
See \secref{sec-frownie} for more information about $\frownie$.

\noindent
An \bfindex[object] is any of the following:\\
\phx\qquad an extended real number \qquad or\qquad a set \qquad or \qquad $\frownie$.\\
The notation ``$\forall x,$''  means ``for any object $x$''.\\
The notation ``$\exists x$ s.t.'' means ``there exists an object $x$ s.t.''.\\
\\
We use $\vep$ for the Greek letter epsilon.\\
We use $\in$ as an abbreviation for ``is an element of''.\\
We use $\phi$ for the Greek letter phi.\\
We use $\emptyset$ to mean the empty set. \quad
Then $\emptyset=\{\ \}$.\\
Note that: $\forall x$, $\,\,$ $x\notin\emptyset$.\\
Also, $\forall x\in\emptyset$, $\,\,$ $x=2$, because:\\
\phx\quad there is no element of $\emptyset$ that is NOT equal to $2$.\\
Also, $\forall x\in\emptyset$, $\,\,$ $x\ne2$, because:\\
\phx\quad there is no element of $\emptyset$ that is equal to $2$.\\
Also, $\forall x\in\emptyset$, $\,\,$ $(x=2)\,\&\,(x\ne2)$, because:\\
\phx\quad there is no element of $\emptyset$ that fails to be\\
\phx\qquad\qquad both \quad equal to $2$ \quad and \quad not equal to $2$ \quad at the same time.\\
\\
According to some formal systems for writing mathematics\\
\phx\qquad $\forall x\in\emptyset$, $\,\,$ $x=2$\\
is not a properly formed statement,
because: ``$\forall$'' should always be followed by a variable, then a comma, then ``$($'',
and, moreover, the corresponding ``$)$'' should appear at the end of the $\forall$ statement.
If we believe in such a formatting rule, then\\
\phx\qquad $\forall x\in\emptyset$, $\,\,$ $x=2$\\
is bad, and would be better written as\\
\phx\qquad $\forall x$, $\,\,$ $((x\in\emptyset)\Rightarrow(x=2))$.\\
Note that, no matter which object $x$ is, it is NOT true that $x\in\emptyset$,\\
and so it IS true that $((x\in\emptyset)\Rightarrow(x=2))$,\\
because any false assertion DOES imply any other assertion,\\
and it doesn't matter whether the second assertion is true or false.\\
\\
An implication that is true because\\
\phx\qquad the assertion on the left of the symbol ``$\Rightarrow$'' is false\\
is said to be ``null true''.
So\\
\phx\qquad $\forall x$, $((x\in\emptyset)\Rightarrow(x=2))$.\\
is an example of a null true statement.\\
More precisely, we should probably say that, for every object $x$,\\
\phx\qquad\qquad $\,(x\in\emptyset)\Rightarrow(x=2)$\\
is null true, but we'll allow a certain level of sloppiness here.\\
Using our more informal way of writing, we would say that\\
\phx\qquad $\forall x\in\emptyset$, $\,\,$ $x=2$\\
is null true.
Following ``$\forall x\in\emptyset$,'', we could put any assertion about $x$,
and the resulting statement would be true, and, in fact, null true.\\
\\
By $\boxed{\R}$, we mean the set of all real numbers.\\
By $\boxed{\Q}$, we mean the set of all rational numbers.\\
By $\boxed{\Z}$, we mean the set of all integers.\\
By $\boxed{\N_0}$, we mean the set of all semi-positive ({\it i.e.} nonnegative integers.\\
By $\boxed{\N}$, we mean the set of all positive integers.\\
\\
Then \quad $\Z=\{\ldots,-3,-2,-1,0,1,2,3,\ldots\}$ \qquad and\\
\phx\qquad\qquad $\N_0=\{0,1,2,3,\ldots\}$ \qquad and \qquad $\N=\{1,2,3,\ldots\}$.\\
Note that $0\in\N_0$.
On the other hand, $0\notin\N$, or, equivalently, $\neg(0\in\N)$.

\begin{defn}
Let $A$ and $B$ be sets.\\
Then $\boxed{A\subseteq B}$ means: \quad $\forall x\in A$, $\,\,$ $x\in B$.\\
Also, $\boxed{B\supseteq A}$ means the same thing: \quad $\forall x\in A$, $\,\,$ $x\in B$.
\end{defn}

\begin{thm}
$\N\subseteq\N_0\subseteq\Z\subseteq\Q\subseteq\R$.
\end{thm}

\begin{thm}
$\{1,2,3\}\subseteq\{1,2,3,7\}\supseteq\{2,3,7\}\supseteq\emptyset$.
\end{thm}

Note that $\{2,3,7\}\supseteq\emptyset$ is {\it null} true. That is, because there is
NO element of $\emptyset$ that is NOT an element of $\{2,3,7\}$,
we conclude that every element of $\emptyset$ is an element of $\{2,3,7\}$, and so $\{2,3,7\}\supseteq\emptyset$.
In fact, the same logic shows that $\emptyset$ is a subset of every set:

\begin{thm}
$\forall$set $X$, $\,\,$ $\emptyset\subseteq X$.
\end{thm}

The following is called the \bfindex[Axiom of Extensionality]:

\begin{axiom}\wrlab{axiom-ext}
Let $A$ and $B$ be sets.
Then:\\
\phx\qquad\qquad $(A=B)\Leftrightarrow((A\subseteq B)\&(B\subseteq A))$.
\end{axiom}

\begin{defn}
Let $A$ and $B$ be sets. Then:\\
\phx\qquad $\boxed{A\bigcup B}\quad:=\quad\{x\,|\,(x\in A)\,\vee\,(x\in B)\}$ \qquad and\\
\phx\qquad $\boxed{A\bigcap B}\quad:=\quad\{x\,|\,(x\in A)\,\,\&\,\,(x\in B)\}$ \qquad and\\
\phx\qquad $\,\,\boxed{A\bksl B}\,\,\,\quad:=\quad\{x\,|\,(x\in A)\,\,\&\,\,(x\notin B)\}$.
\end{defn}

\begin{thm}
Let $A:=\{1,2,3\}$ and $B:=\{3,4,5\}$. Then:\\
\phx\qquad $A\bigcup B\quad=\quad\{1,2,3,4,5\}$ \qquad and\\
\phx\qquad $A\bigcap B\quad=\quad\{3\}$ \qquad and\\
\phx\qquad $\,\,A\bksl B\,\,\,\quad=\quad\{1,2\}$.
\end{thm}

\subsection{Intervals}

\begin{defn}\phx\\
$\forall a,b\in\R^*$, \quad $\,\,\,\,\boxed{(a;b)}:=\{x\in\R^*\,|\,a<x<b\}$ \quad and\\
\phx\qquad\qquad\qquad $\boxed{[a;b)}:=\{x\in\R^*\,|\,a\le x<b\}$ \quad and\\
\phx\qquad\qquad\qquad $\boxed{(a;b]}:=\{x\in\R^*\,|\,a<x\le b\}$ \quad and\\
\phx\qquad\qquad\qquad $\boxed{[a;b]}:=\{x\in\R^*\,|\,a\le x\le b\}$.
\end{defn}

Note that $-\infty\notin(-\infty;\infty]$ and that
$-7.5,0,10^{100},\infty\in(-\infty;\infty]$.

Note that $\R=(-\infty;\infty)$.    

\begin{defn}
$\Z^*:=\{-\infty\}\bigcup\Z\bigcup\{\infty\}$. Also:\\
$\forall a,b\in\R^*$, \quad $\,\,\,\boxed{(a..b)}:=\{x\in\Z^*\,|\,a<x<b\}$ \quad and\\
\phx\qquad\qquad\qquad $\boxed{[a..b)}:=\{x\in\Z^*\,|\,a\le x<b\}$ \quad and\\
\phx\qquad\qquad\qquad $\boxed{(a..b]}:=\{x\in\Z^*\,|\,a<x\le b\}$ \quad and\\
\phx\qquad\qquad\qquad $\boxed{[a..b]}:=\{x\in\Z^*\,|\,a\le x\le b\}$.
\end{defn}

\begin{thm}
$[1..7]=\{1,2,3,4,5,6,7\}$ \qquad and\\
\phx\qquad\qquad $[2..1]=\emptyset$ \qquad and\\
\phx\qquad\qquad $[-\infty..4)=\{-\infty\}\bigcup\{\ldots,-2,-1,0,1,2,3\}$ \qquad and\\
\phx\qquad\qquad $[-\infty..4]=\{-\infty\}\bigcup\{\ldots,-2,-1,0,1,2,3,4\}$.
\end{thm}

\begin{defn}
Let $A$ be a set and let $z$ be an object. Then:\\
\phx\qquad $\boxed{A_z^+}:=A\bigcup\{z\}$ \qquad and \qquad $\boxed{A_z^\times}:=A\bksl\{z\}$.
\end{defn}

In class, we graphed $[1;2)_3^+$ and $(1;3]_2^\times$ on number lines.

\subsection{Manipulation of inequalities}

\begin{thm}
Let $a,b,A,B\in\R$.\\
\phx\qquad Assume $(\,a<A\,)\,\&\,(\,b<B\,)$.
\qquad\quad Then $a+b<A+B$.
\end{thm}

\begin{thm}
Let $a,b,A,B\in\R$.\\
\phx\qquad Assume $(\,0\le a<A\,)\,\&\,(\,0\le b<B\,)$.
\qquad\quad Then $ab<AB$.
\end{thm}

\begin{thm}
Let $a,b,A,B\in\R$.\\
\phx\qquad Assume $(\,a\le A\,)\,\&\,(\,b\le B\,)$.
\qquad\quad Then $a+b\le A+B$.
\end{thm}

\begin{thm}
Let $a,b,A,B\in\R$.\\
\phx\qquad Assume $(\,0\le a\le A\,)\,\&\,(\,0\le b\le B\,)$.
\qquad\quad Then $ab\le AB$.
\end{thm}

If we have mixed inequalities (strict and semi), then we get strict for addition:

\begin{thm}
Let $a,b,A,B\in\R$.\\
\phx\qquad Assume $(\,a<A\,)\,\&\,(\,b\le B\,)$.
\qquad\quad Then $a+b<A+B$.
\end{thm}

For positive numbers, the product of a the product
of a strict inequality with a semi-inequality
is a strict inequality:

\begin{thm}
Let $a,b,A,B\in\R$.\\
\phx\qquad Assume $(\,0<a<A\,)\,\&\,(\,0<b\le B\,)$.
\qquad\quad Then $ab<AB$.
\end{thm}

It is a common mistake to think that, for nonnegative numbers,
the product of a strict inequality with a semi-inequality
should give a strict inequality.
In fact, if we have mixed inequalities (strict and semi), then we get semi for multiplication:

\begin{thm}
Let $a,b,A,B\in\R$.\\
\phx\qquad Assume $(\,0<a<A\,)\,\&\,(\,0\le b\le B\,)$.
\qquad\quad Then $ab\le AB$.
\end{thm}

Note that, in the conclusion of the preceding theorem, we cannot write $ab<AB$
because of the possibility that $0=b=B$.

\subsection{Basic algebraic facts}
\quad
\vskip.1in\noindent
The following is called the \bfindex[Naive Product Rule]:

\begin{thm}\wrlab{thm-NPR}
Let $a,b,A,B\in\R$. \quad Then:\\
\phx\qquad $A\cdot B-a\cdot b\,\,=\,\,(A-a)\cdot b\,\,+\,\,a\cdot(B-b)\,\,+\,\,(A-a)\cdot(B-b)$.
\end{thm}

\subsection{The Axiom of Choice}
\quad
\vskip.1in\noindent
We imagine that at the beginning of time,\\
the Grand Oracle has chosen,\\
\phx\qquad from every nonempty set $A$, an element denoted $\CH_A$.\\
This is embodied in the \bfindex[Axiom of Choice]:

\begin{axiom}
$\forall$nonempty set $S$, \quad $\CH_S\in S$.
\end{axiom}

\noindent
We also make the convention that $\CH_\emptyset=\frownie$.\\
\\
Alternate notation for $\boxed{\CH_S}$: $\boxed{\CH(S)}$ or $\boxed{\CH\,S}$.\\
\\
Then: $\forall$set $S$, we have: $\CH_S\,\,\,{}^*\!\!\in\,\,S$.

\begin{thm}
$\CH\{4\}=4$ \quad and $\CH\,\{\,\{1,2,3\,\}\,\}\,=\,\{1,2,3\}$.
\end{thm}

For sets with more than one element,
we do not know which is chosen, but we do know that one of them is:

\begin{thm}
$(\,\CH\{2,3\}=2\,)\,\vee\,(\,\CH\{2,3\}=3\,)$.
\end{thm}

\begin{thm}\phx\\
\phx\qquad$(\,\CH\{2,3,5\}=2\,)\,\vee\,(\,\CH\{2,3,5\}=3\,)\,\vee\,(\,\CH\{2,3,5\}=5\,)$.
\end{thm}

\subsection{Unique element of a set}
\quad
\vskip.1in\noindent

\begin{defn}
Let $A$ be an object.\\
By $A$ is a \bfindex[singleton] or \bfindex[singleton set],
we mean:\\
\phx\qquad $A$ is a nonempty set \quad and \quad $\forall x,y\in A$, $x=y$.
\end{defn}

\begin{thm}\phx\\
\phx\qquad $(\,\{3\}\hbox{ is a singleton}\,)$ and\\
\phx\qquad $(\,\{\,\,\{1,2,3\}\,\,\}\hbox{ is a singleton}\,)$ and\\
\phx\qquad $(\,\neg(\{1,2,3\}\hbox{ is a singleton})\,)$ and\\
\phx\qquad $(\,\neg(\emptyset\hbox{ is a singleton})\,)$.
\end{thm}

\begin{defn}\phx\\
\phx\quad For set $A$, \qquad
$\boxed{\UE_A}:=\begin{cases}\CH_A,&\hbox{if }A\hbox{ is a singleton}\\
\frownie,&\hbox{if }A\hbox{ is not a singleton.}\end{cases}$
\end{defn}

Alternative notations: $\boxed{\UE\,A}$ and $\boxed{\UE(A)}$.

\begin{thm}\phx\\
\phx\quad $\UE\{3\}=3$ and\\
\phx\quad $\UE\{\,\,\{1,2,3\}\,\,\}=\{1,2,3\}$ and\\
\phx\quad $\UE\{1,2\}=\frownie$ and \\
\phx\quad $\UE\{1,2,3\}=\frownie$ and\\
\phx\quad $\UE\,\emptyset=\frownie$.
\end{thm}

\noindent
For any objects $a$ and $B$, the notation $\boxed{a\,\,\,{}^*\!\!\in\,\,B}$ means:\\
\phx\qquad\qquad\qquad\qquad $(a=\frownie)\vee(a\in B)$.

\begin{thm}\phx\\
\phx\qquad$\UE\{1\}\,\,\,{}^*\!\!\in\,\,\{1\}$ and\\
\phx\qquad$\UE\{\,\,\{1,2,3\}\,\,\}\,\,\,{}^*\!\!\in\,\,\{\,\,\{1,2,3\}\,\,\}$ and\\
\phx\qquad$\UE\{1,2,3\}\,\,\,{}^*\!\!\in\,\,\{1,2,3\}$ and\\
\phx\qquad$\UE\,\emptyset\,\,\,{}^*\!\!\in\,\,\emptyset$.
\end{thm}

\begin{thm}
\quad $\forall A$, \quad $UE_A\,\,\,{}^*\!\!\in\,\,A$.
\end{thm}

\subsection{Well-ordering and completeness axioms}
\quad
\vskip.1in\noindent

\begin{defn}
Let $S\subseteq\R^*$, $a\in\R^*$.\\
Then $\boxed{S>a}$ means: $\forall x\in S$, $x>a$.\\
Also, $\boxed{S\ge a}$ means: $\forall x\in S$, $x\ge a$.\\
Also, $\boxed{S<a}$ means: $\forall x\in S$, $x<a$.\\
Also, $\boxed{S\le a}$ means: $\forall x\in S$, $xle a$.\\
Also, $\boxed{a<S}$ means: $\forall x\in S$, $a<x$.\\
Also, $\boxed{a\le S}$ means: $\forall x\in S$, $a\le x$.\\
Also, $\boxed{a>S}$ means: $\forall x\in S$, $a>x$.\\
Also, $\boxed{a\ge S}$ means: $\forall x\in S$, $a\ge x$.
\end{defn}

\begin{thm}\phx\\
\phx\quad $(\N>0)\,\&\,(N_0\ge0)\,\&\,(1\le\N)\,\&\,(-3<\N_0)\,\&\,(\neg(0<\N_0))$.
\end{thm}

\begin{thm}
$\forall x\in\emptyset$, $5\le x$.
\end{thm}

\begin{thm}
$5\le\emptyset$.
\end{thm}

\begin{thm}
$(7\le\emptyset)\,\&\,(-\infty\le\emptyset)\,\&\,(\infty\le\emptyset)$.
\end{thm}

\begin{thm}\wrlab{thm-le-emptyset}
$\forall x\in\R^*$, $x\le\emptyset$.
\end{thm}

\begin{thm}
$\forall x\in\R^*$, $x<\emptyset$.
\end{thm}

\begin{thm}\wrlab{thm-ge-emptyset}
$\forall x\in\R^*$, $x\ge\emptyset$.
\end{thm}

\begin{thm}
$\forall x\in\R^*$, $x>\emptyset$.
\end{thm}

\noindent
In the next definition, $\LB$ stands for ``Lower Bounds'',\\
\phx\quad and $\UB$ stand for ``Upper Bounds''.

\begin{defn}
Let $S\subseteq\R^*$. Then:\\
\phx\quad $\boxed{\LB_S}:=\{x\in\R^*\,|\,x\le S\}$ \quad and\\
\phx\quad $\boxed{\UB_S}:=\{x\in\R^*\,|\,x\ge S\}$.
\end{defn}

\noindent
Alternate notations for $\LB_S$ are: $\boxed{\LB(S)}$ and $\boxed{\LB\,S}$.\\
Alternate notations for $\UB_S$ are: $\boxed{\UB(S)}$ and $\boxed{\UB\,S}$.

\begin{thm}
$\LB\{3,4,5\}=[-\infty;3]$ and $\LB\{3,4,5\}=[5;\infty]$.
\end{thm}

By \tref{thm-le-emptyset} and \tref{thm-ge-emptyset} above, we get:

\begin{thm}
$(\LB_\emptyset=\R^*)\,\&\,(\UB_\emptyset=\R^*)$.
\end{thm}

\begin{defn}
Let $S\subseteq\R^*$. Then:\\
\phx\qquad $\boxed{\min\!{}_S}:=\UE(S\cap\LB_S)$ \quad and \quad $\boxed{\max\!{}_S}:=\UE(S\cap\UB_S)$.
\end{defn}

\noindent
Alternate notations for $\min_S$ are: $\boxed{\min(S)}$ and $\boxed{\min\,S}$.\\
Alternate notations for $\max_S$ are: $\boxed{\max(S)}$ and $\boxed{\max\,S}$.\\
\\
We have $\LB[1;2)=[-\infty;1]$ and $\UB[1;2)=[2;\infty]$. Then:

\begin{thm}\phx\\
\phx\qquad $\min[1;2)=\UE([1;2)\bigcap[-\infty;1])=1$ \quad and\\
\phx\qquad $\max[1;2)=\UE([1;2)\bigcap[2;\infty])=\frownie$.
\end{thm}

We have $\LB_\emptyset=\R^*$ and $\UB\emptyset=\R^*$. Then:

\begin{thm}\phx\\
\phx\qquad $\min_\emptyset=\UE(\emptyset\bigcap\R^*)=\frownie$ and\\
\phx\qquad $\max_\emptyset=\UE(\emptyset\bigcap\R^*)=\frownie$.
\end{thm}

\begin{thm}
Let $S\subseteq\R^*$. Then:\\
\phx\qquad $(\,\min S\,\,\,{}^*\!\!\in\,\,S\,)\,\&\,(\,\max S\,\,\,{}^*\!\!\in\,\,S\,)$.
\end{thm}

\begin{proof}
We have $\min S=\UE(S\cap\LB_S)\,\,\,{}^*\!\!\in\,\,S\cap\LB_S\subseteq S$,\\
\phx\qquad\qquad\qquad so $\,\min S\,\,\,{}^*\!\!\in\,\,S$.\\
{\bf It remains to show:} $\max S\,\,\,{}^*\!\!\in\,\,S$.\\
We have $\max S=\UE(S\cap\UB_S)\,\,\,{}^*\!\!\in\,\,S\cap\UB_S\subseteq S$,\\
\phx\qquad\qquad\qquad so $\,\max S\,\,\,{}^*\!\!\in\,\,S$.
\end{proof}

\begin{thm}
Let $S\subseteq\R^*$, $x,y\in S\cap\LB_S$. Then $x=y$.
\end{thm}

\begin{proof}
Since $x,y\in\LB_S$, we get: $(\,x\le S\,)\,\&\,(\,y\le S\,)$.\\
Since $x\in S\ge y$, we get $x\ge y$. \quad Since $y\in S\ge x$, we get $y\ge x$.\\
Since $x\ge y$ and $y\ge x$, we get $x=y$.
\end{proof}

\noindent
The preceding theorem says that $S\cap\LB_S$ cannot have two unequal elements; equivalently, that set is empty or singleton:

\begin{thm}\wrlab{thm-ScapLBS-empty-or-singleton}
Let $S\subseteq\R^*$.\\
\phx\qquad\qquad\qquad Then $(\,S\cap\LB_S=\emptyset\,)\,\vee\,(\,S\cap\LB_S\hbox{ is a singleton}\,)$.
\end{thm}

\begin{thm}\wrlab{thm-min-means-in-S-and-le-S}
Let $S\subseteq\R^*$, $a\in\R^*$. Then:\\
\phx\qquad $(\,a=\min S\,)\quad\Leftrightarrow\quad(\,(\,a\in S\,)\,\&\,(\,a\le S\,)\,)$.  
\end{thm}

Notes on proof:
We leave $\Rightarrow$ as an exercise; it follows from the definitions.
For $\Leftarrow$, from $(\,a\in S\,)\,\&\,(\,a\le S\,)$, we get $a\in S\cap\LB_S$,
which shows that $S\cap\LB_S\ne\emptyset$.
Then, by \tref{thm-ScapLBS-empty-or-singleton}, $S\cap\LB_S$ is a singleton.
So, since $a\in S\cap\LB_S$, we get $S\cap\LB_S=\{a\}$.
Then $\min S=\UE(S\cap\LB_S)=\UE\{a\}=a$, so $a=\min S$.

Similar reasoning gives:

\begin{thm}\wrlab{thm-max-means-in-S-and-ge-S}
Let $S\subseteq\R^*$, $a\in\R^*$. Then:\\
\phx\qquad $(\,a=\max S\,)\quad\Leftrightarrow\quad(\,(\,a\in S\,)\,\&\,(\,a\ge S\,)\,)$.  
\end{thm}

\noindent
By $\boxed{a\,\,\,{}^*\!\!\le\,\,\,b}$, we mean: \qquad
\phx\quad $(\,a=\frownie\,)\,\vee\,(\,a\le b\,)$,\\
\phx\qquad\quad or, equivalently, \qquad
\phx\quad $(\,a\ne\frownie\,)\,\Rightarrow\,(\,a\le b\,)$.

\noindent
By $\boxed{a\,\,\le^*\,\,b}$, we mean: \qquad
\phx\quad $(\,b=\frownie\,)\,\vee\,(\,a\le b\,)$,\\
\phx\qquad\quad or, equivalently, \qquad
\phx\quad $(\,b\ne\frownie\,)\,\Rightarrow\,(\,a\le b\,)$.

\noindent
By $\boxed{a\,\,\,{}^*\!\!\ge\,\,\,b}$, we mean: \qquad
\phx\quad $(\,a=\frownie\,)\,\vee\,(\,a\ge b\,)$,\\
\phx\qquad\quad or, equivalently, \qquad
\phx\quad $(\,a\ne\frownie\,)\,\Rightarrow\,(\,a\ge b\,)$.

\noindent
By $\boxed{a\,\,\ge^*\,\,b}$, we mean: \qquad
\phx\quad $(\,b=\frownie\,)\,\vee\,(\,a\ge b\,)$,\\
\phx\qquad\quad or, equivalently, \qquad
\phx\quad $(\,b\ne\frownie\,)\,\Rightarrow\,(\,a\ge b\,)$.

\begin{thm}
Let $S\subseteq\R^*$. Then $\min S\,\,\,{}^*\!\!\le\,\,S$.
\end{thm}

\begin{proof}
We wish to show: $(\,\min S\ne\frownie\,)\,\Rightarrow\,(\,\min S\le S\,)$.\\
Assume $\min S\ne\frownie$. \qquad {\bf Want:} $\min S\le S$.\\
We have $\min S\,\,=\,\,\UE(S\cap\LB_S)\,\,\,{}^*\!\!\in\,\,S\cap\LB_S\,\,\subseteq\LB_S$,\\
\phx\qquad so, contracting, we get $\min S\in\LB_S$.\\
Then, by definition of $\LB_S$, we conclude: $\min S\le S$.
\end{proof}

A similar proof yields:

\begin{thm}
Let $S\subseteq\R^*$. Then $S\,\,\,\le^*\,\,\max S$.
\end{thm}

\begin{defn}
Let $S\subseteq\R^*$. Then:\\
\phx\qquad $\boxed{\inf\!{}_S}:=\max(\LB_S)$ \quad and \quad $\boxed{\sup\!{}_S}:=\min(\UB_S)$.
\end{defn}

Alternate notations for $\inf_S$ are: $\boxed{\inf(S)}$ and $\boxed{\inf\,S}$.\\
Alternate notations for $\sup_S$ are: $\boxed{\sup(S)}$ and $\boxed{\sup\,S}$.\\
\\
The $\inf$ is sometimes called the ``greatest lower bound''.\\
The $\sup$ is sometimes called the ``least upper bound''.\\

\begin{thm}\phx\\
\phx\qquad $\inf[1;2)=\max[-\infty;1]=1$ \quad and \quad $\sup[1;2)=\min[2,\infty]=2$.
\end{thm}

\begin{thm}\phx\\
\phx\qquad $\inf\emptyset=\max\R^*=\infty$ \quad and \quad $\sup\emptyset=\min\R^*=-\infty$.
\end{thm}

The following is the \bfindex[Well-Ordering Axiom].

\begin{axiom}\wrlab{axiom-well-ordering}
$\forall$nonempty $S\subseteq\N_0$, $\min S\ne\frownie$.
\end{axiom}

The following is the \bfindex[Completeness Axiom].

\begin{axiom}\wrlab{axiom-completeness}
$\forall S\subseteq\R^*$, \quad $\inf_S\ne\frownie\ne\sup_S$.
\end{axiom}

\begin{thm}
Let $S\subseteq\R^*$.\\
\phx\qquad\qquad\qquad Then $\inf_S\ge\LB_S$ and $\sup_S\le\UB_S$.
\end{thm}

\begin{proof}
By \aref{axiom-completeness}, $\inf_S\ne\frownie\ne\sup_S$/\\
We have $\inf_S=\max(\LB_S)\,\,\,{}^*\!\!\ge\,\,\,\LB_S$.\\
So, since $\inf_S\ne\frownie$, we get: $\inf_S\ge\LB_S$.\\
{\bf It remains to prove:} $\sup_S\le\UB_S$.\\
We have $\sup_S=\min(\UB_S)\,\,\,{}^*\!\!\le\,\,\,\UB_S$.\\
So, since $\sup_S\ne\frownie$, we get: $\sup_S\le\UB_S$.
\end{proof}

\begin{thm}
Let $S\subseteq\R^*$. Then $S\ge\inf_S$ and $S\le\sup_S$.
\end{thm}

\begin{proof}
By \aref{axiom-completeness}, $\inf_S\ne\frownie\ne\sup_S$.\\
We have $\inf_S=\max(\LB_S)\,\,\,{}^*\!\!\in\,\,\LB_S$.\\
So, since $\inf_S\ne\frownie$, we get: $\inf_S\in\LB_S$.\\
Then, by definition of $\LB_S$, we get: $\inf_S\le S$. \quad Then $S\ge\inf_S$.\\
{\bf It remains to prove:} $S\le\sup_S$.\\
We have $\sup_S=\min(\UB_S)\,\,\,{}^*\!\!\in\,\,\UB_S$.\\
So, since $\sup_S\ne\frownie$, we get: $\sup_S\in\UB_S$.\\
Then, by definition of $\UB_S$, we get: $\sup_S\ge S$. \quad Then $S\le\sup_S$.
\end{proof}

\begin{thm}
Let $A\subseteq\R^*$, $z\in\R^*$.\\
\phx\quad Assume $A\le z$. \quad Then $\sup_A\le z$.
\end{thm}

\begin{proof}
Since $z\ge A$, we get: $z\in\UB_A$.\\
Then $z\in\UB_A\ge\sup_A$, so $z\ge\sup_A$, so $\sup_A\le z$.
\end{proof}

\begin{thm}
Let $A\subseteq\R^*$, $z\in\R^*$.\\
\phx\quad Assume $A\ge z$. \quad Then $\inf_A\ge z$.
\end{thm}

\begin{proof}
Since $z\le A$, we get: $z\in\LB_A$.\\
Then $z\in\LB_A\le\inf_A$, so $z\le\inf_A$, so $\inf_A\ge z$.
\end{proof}

\begin{thm}
Let $S\subseteq\R^*$. Then $\inf_S\,\,\,\,=^*\,\,\min_S$.
\end{thm}

\begin{proof}
Know: $\min_S=\UE(S\bigcap\LB_S)$.\\
{\bf Want:} $(\,\min_S\ne\frownie\,)\,\Rightarrow\,(\,\inf_S=\min_S\,)$.\\
Assume $\min_S\ne\frownie$. \quad {\bf Want:} $\inf_S=\min_S$.\\
Since $\min_S\ne\frownie$ and $\min_S=\UE(S\bigcap\LB_S)$,\\
\phx\qquad\quad we conclude: $\,\,\,\,\min_S\,\,=\,\,\UE(S\bigcap\LB_S)$.\\
Since $\min_S\,\,=\,\,\UE(S\bigcap\LB_S)\,\,\,{}^*\!\!\in\,\,S\bigcap\LB_S$,\\
we get $\min_S\,\,\in\,\,S\bigcap\LB_S$, and so $\min_S\in S$ and $\min_S\in\LB_S$.\\
We have $\min_S\in S\ge\inf_S$ and $\min_S\in\LB_S\le\inf_S$,\\
so $\min_S\ge\inf_S$ and $\min_S\le\inf_S$, and so $\inf_S=\min_S$.
\end{proof}

\begin{thm}\wrlab{thm-below-lb-is-lb}
Let $S\subseteq\R^*$, $z\in\LB_S$, $a\in[-\infty;z]$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $a\in\LB_S$.
\end{thm}

\begin{proof}
Since $a\le z\le S$, we get $a\le S$.
Then $a\in\LB_S$.
\end{proof}

\subsection{Mathematical induction}
\quad
\vskip.1in\noindent
The following theorem is called the \bfindex[Principle of Mathematical Induction] or \bfindex[PMI]:

\begin{thm}\wrlab{thm-princ-math-ind}
\quad Let $S\subseteq\N$. \quad Assume $1\in S$.\\
Assume: $\forall k\in S$, $k+1\in S$. \qquad
Then: $S=\N$.
\end{thm}

The intuitive idea that $S$ is closed under ``successor'',
meaning that whenever a positive integer $k$ is in $S$,
then its successor $k+1$ is also in $S$.
So, since $1\in S$, we see that $2\in S$.
Then, since $2\in S$, we see that $3\in S$.
Then, since $3\in S$, we see that $4\in S$.
And so on. For any integer, we can eventually show that that integer is in $S$.
Then $\N\subseteq S$.
So since $S\subseteq\N$, we conclude,
from the Axiom of Extensionality, that $S=\N$.

We omit a formal proof for \tref{thm-princ-math-ind}, but it would involve the
Well-Ordering Axiom, described earlier.
We focus instead on how to use \tref{thm-princ-math-ind},
using the \bfindex[PMI template], see EH (20).

\begin{thm}
\quad $\forall k\in\N$, \quad $\ds{1+2+3+\cdots+k=\frac{k(k+1)}{2}}$.
\end{thm}

\begin{proof}
Let $\ds{S:=\left\{k\in\N\,\bigg|\,1+2+3+\cdots+k=\frac{k(k+1)}{2}\right\}}$.\\
\\
{\bf Want:} $S=\N$. Since $\ds{1=\frac{1\cdot(1+1)}{2}}$, we see that $1\in S$.\\
By the PMI, {\bf it suffices to prove:} $\forall k\in S$, $k+1\in S$.\\
Given $k\in S$. {\bf Want:} $k+1\in S$.\\
\\
Know: $\ds{1+2+3+\cdots+k=\frac{k(k+1)}{2}}$.\\
\\
{\bf Want:} $\ds{1+2+3+\cdots+k+(k+1)=\frac{(k+1)((k+1)+1)}{2}}$.\\
\\
We have: $\ds{1+2+3+\cdots+k+(k+1)\,\,\,=\,\,\,\frac{k(k+1)}{2}\,\,\,+\,\,\,(k+1)}$\\
\\
\phx\qquad\qquad\quad $\ds{\,\,\,=\,\,\,\frac{k}{2}\cdot(k+1)\,\,\,+\,\,\,1\cdot(k+1)\,\,\,=\,\,\,\left(\frac{k}{2}+1\right)\cdot(k+1)}$\\
\\
\phx\qquad\qquad\quad $\ds{\,\,\,=\,\,\,\left(\frac{k+2}{2}\right)\cdot(k+1)
\,\,\,=\,\,\,\frac{(k+2)(k+1)}{2}}$\\
\\
\phx\qquad\qquad\quad $\ds{\,\,\,=\,\,\,\frac{(k+1)(k+2)}{2}\,\,\,=\,\,\,\frac{(k+1)((k+1)+1)}{2}}$.
\end{proof}

The following theorem is called the \bfindex[$0$-PMI]:

\begin{thm}\wrlab{thm-0-PMI}
\quad Let $S\subseteq\N_0$. \quad Assume $0\in S$.\\
Assume: $\forall k\in S$, $k+1\in S$. \qquad
Then: $S=\N_0$.
\end{thm}

Idea of proof: The set $S$ is closed under succesor.
So, since $0\in S$, it follows that $1\in S$,
and then that $2\in S$ and then that $3\in S$, {\it etc.}

Here is an example of how to use the $0$-PMI:

\begin{thm}
\quad $\forall k\in\N_0$, \quad $2^k\ge k+1$.
\end{thm}

\begin{proof}
Let $S:=\{k\in\N_0\,|\,2^k\ge k+1\}$. \quad {\bf Want:} $S=\N_0$.\\
Since $2^0=1\ge0+1$, we see that $0\in S$.\\
By the $0$-PMI, {\bf it suffices to show:} $\forall k\in S$, $k+1\in S$.\\
Given $k\in S$. \quad {\bf Want:} $k+1\in S$.\\
Know: $2^k\ge k+1$. \quad Want $2^{k+1}\ge(k+1)+1$.\\
Since $k\in S\subseteq\N_0\ge0$, we get $k\ge0$, so $(k+1)+(k+1)\ge(k+1)+(0+1)$.\\
Then $2^{k+1}\,\,=\,\,2^k\cdot 2\,\,=\,\,2^k\cdot(1+1)=2^k\cdot1+2^k\cdot1=2^k+2^k$\\
\phx\qquad\qquad $\,\,\,\,\ge(k+1)+(k+1)\ge(k+1)+(0+1)=(k+1)+1$.
\end{proof}

\subsection{The Archimedean Principle}
\quad
\vskip.1in\noindent

The following is {\bf The} \bfindex[Archimedean Axiom]:

\begin{axiom}\wrlab{axiom-arch-ax}
$\sup\,\N=\infty$.
\end{axiom}

The following is {\bf The} \bfindex[Archimedean Principle] or \bfindex[AP]:

\begin{thm}\wrlab{thm-arch-princ}
$\forall x\in\R$, $\exists j\in\N$ s.t.~$j>x$.
\end{thm}

\begin{proof}
Given $x\in\R$. \quad
{\bf Want:} $\exists j\in\N$ s.t.~$j>x$.\\
Assume $\neg(\,\exists j\in\N~\hbox{s.t.}~j>x\,)$. \quad
{\bf Want:} Contradiction.\\
Then $\forall j\in\N$, $j\le x$, \quad so $\N\le x$.\\
Then $\sup\N\le x$.\\
Since $\sup\N\le x\in\R<\infty$, we get $\sup\N<\infty$, so $\sup\N\ne\infty$.\\
However, by \aref{axiom-arch-ax}, we have: $\sup\N=\infty$. \quad Contradiction.
\end{proof}

It is a theorem in propositional logic that, for any mathematical statements $P$ and $Q$,\\
\phx\quad $(\,P\vee Q\,)\,\Leftrightarrow\,(\,(\,\neg P\,)\,\Rightarrow\,Q\,)$.\\
It follows, for any two objects $a$ and $b$, that\\
\phx\qquad $(\,a\,\,\,\,=^*\,\,b\,)\,\Leftrightarrow(\,(\,b\ne\frownie\,)\,\Rightarrow\,(\,a=b\,)\,)$.\\

Next is \bfindex[The Reciprocal Archimedean Principle] or \bfindex[RAP]:

\begin{thm}
$\forall\vep>0$, $\exists j\in\N$ s.t.~$1/j<\vep$.
\end{thm}

\begin{proof}
Given $\vep>0$. {\bf Want:} $\exists j\in\N$ s.t.~$1/j<\vep$.\\
Since $\vep>0$, we see that $(\,1/\vep\in\R\,)\,\&\,(\,1/\vep>0\,)\,\&\,(\,1/(1/\vep)=\vep\,)$.\\
By the AP, choose $j\in\N$ s.t.~$j>1/\vep$.  Then $j\in\N$. {\bf Want:} $1/j<\vep$.\\
Since $j>1/\vep>0$, we get $1/j<1/(1/\vep)$.
Then $1/j<1/(1/\vep)=\vep$.
\end{proof}

We can restate the preceding theorem as:\\
\phx\qquad\qquad $\forall\vep>0$, $\neg(\,\forall j\in\N,\,\,1/j<\vep\,)$.\\
Equivalently,\\
\phx\qquad\qquad $\forall\vep>0$, $\neg(\,\{1,1/2,1/3,\ldots\}\ge\vep\,)$.\\
Equivalently,\\
\phx\qquad\qquad $\forall\vep>0$, $\neg(\,\vep\in\LB\{1,1/2,1/3,\ldots\}\,)$.\\
The following expresses the same thing:

\begin{thm}\wrlab{thm-lb-exclusion-1}
$\forall\vep>0$, $\vep\notin\LB\{1,1/2,1/3,\ldots\}$.
\end{thm}

In the preceding theorem, $\vep$ is a real variable, by convention.
However the theorem would even be true if we use $\infty$ for $\vep$:

\begin{thm}\wrlab{thm-lb-exclusion-2}
$\infty\notin\LB\{1,1/2,1/3,\ldots\}$.
\end{thm}

\begin{thm}\wrlab{thm-lb-set-calc}
$\LB\{1,1/2,1/3,\ldots\}=[-\infty;0]$.
\end{thm}

\begin{proof}
We have $0\le\{1,1/2,1/3,\ldots\}$, so $0\in\LB\{1,1/2,1/3,\ldots\}$.\\
Then, by \tref{thm-below-lb-is-lb}, $[-\infty;0]\subseteq\LB\{1,1/2,1/3,\ldots\}$.\\
{\bf It remains to show:} $\LB\{1,1/2,1/3,\ldots\}\subseteq[-\infty;0]$.\\
{\bf Want:} $\forall\vep\in\LB\{1,1/2,1/3,\ldots\},\quad\vep\in[-\infty;0]$.\\
Given $\vep\in\LB\{1,1/2,1/3,\ldots\}$. {\bf Want:} $\vep\in[-\infty;0]$.\\
By \tref{thm-lb-exclusion-1} and \tref{thm-lb-exclusion-2}, $\vep\notin[0;\infty]$,
so $\vep\in\R^*\bksl[0;\infty]$.\\
Then $\vep\in\R^*\bksl[0;\infty]=[-\infty;0]$.
\end{proof}

\noindent
Unassigned HW: Show that $\LB[-\infty;0]=[0;\infty]$.\\
We use that unassigned HW in the following proof.

\begin{thm}\phx\\
\phx\qquad\quad $\min\{1,1/2,1/3,\ldots\}=\frownie$ \quad and \quad $\inf\{1,1/2,1/3,\ldots\}=0$.
\end{thm}

\begin{proof}
By \tref{thm-lb-set-calc}, $\LB\{1,1/2,1/3,\ldots\}=[-\infty;0]$.\\
Then \quad $\min\{1,1/2,1/3,\ldots\}\,=\,\UE(\,\{1,1/2,1/3,\ldots\}\,\bigcap\,[-\infty;0]\,)$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\,=\,\UE(\,\emptyset\,)$,\\
\phx\qquad so, since $\UE(\emptyset)=\frownie$, we get $\min\{1,1/2,1/3,\ldots\}=\frownie$.\\
{\bf It remains to show:} $\inf\{1,1/2,1/3,\ldots\}=0$.\\
We have \quad $\max[-\infty;0]\,=\,\UE(\,[-\infty;0]\,\bigcap\,[0;\infty]\,)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,=\,\UE(\,\{0\}\,)\,\,\,=\,\,\,0$,\\
\phx\qquad so \quad $\,\max[-\infty;0]\,\,\,\,\,=\,\,\,\,\,0$.\\
We have $\inf\{1,1/2,1/3,\ldots\}\,\,\,=\,\,\,\max\,(\,\LB\{1,1/2,1/3,\ldots\}\,)$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\,\,=\,\,\,\max[-\infty;0]\,\,\,=\,\,\,0$.
\end{proof}

\noindent
The preceding theorems show the process by which we can prove computations of\\
\phx\qquad $\LB$, $\UB$, $\min$, $\max$, $\inf$, $\sup$.\\
As you can see, these proofs can be laborious, and, generally, we will omit them.
If you understand the definitions, then they become straightforward, even if they can be,
at first, somewhat intimidating.
In any case, they belong in a course on the foundations of the real number system,
a prerequisite to real analysis.

\subsection{Translating and reflecting sets of real numbers}

\begin{defn}
Let $S\subseteq\R$. Then:\\
\phx\qquad\qquad $\boxed{-S}:=\{-y\,|\,y\in S\}$.
\end{defn}

\begin{thm}
$-\{2,5,9\}=\{-2,-5,-9\}$.
\end{thm}

\begin{defn}
Let $S\subseteq\R$, $x\in\R$. Then:\\
\phx\qquad\qquad $\boxed{x+S}:=\{x+y\,|\,y\in S\}$ and $\boxed{S+x}:=\{y+x\,|\,y\in S\}$.
\end{defn}

\begin{thm}
$4+\{1,2,5\}=\{5,6,9\}=\{1,2,5\}+4$.
\end{thm}

\begin{thm}
$\forall S\subseteq\R$, $\forall x\in\R$, \quad $x+S=S+x$.
\end{thm}

\begin{defn}
Let $S\subseteq\R$, $x\in\R$. Then:\\
\phx\qquad\qquad $\boxed{x-S}:=\{x-y\,|\,y\in S\}$ and $\boxed{S-x}:=\{y-x\,|\,y\in S\}$.
\end{defn}

\begin{thm}\phx\\
\phx\qquad $8-\{2,9\}\,\,=\,\,\{6,-1\}\,\,=\,\,-\{-6,1\}\,\,=\,\,-(\{2,9\}-8)$.
\end{thm}

\begin{thm}
$\forall S\subseteq\R$, $\forall x\in\R$, \quad $x-S=-(S-x)$.
\end{thm}

\begin{defn}
Let $S\subseteq\R$, $x\in\R$. Then:\\
\phx\qquad\qquad $\boxed{x\cdot S}:=\{x\cdot y\,|\,y\in S\}$ and $\boxed{S\cdot x}:=\{y\cdot x\,|\,y\in S\}$.
\end{defn}

Note that, by general sloppiness, $\cdot$ is often omitted in multiplication, and we might write:
$\forall S\subseteq\R$, $\forall x\in\R$,\\
\phx\qquad\qquad $xS:=\{xy\,|\,y\in S\}$ and $Sx:=\{yx\,|\,y\in S\}$.

\begin{thm}
$2\cdot\{1,3,4\}=\{2,6,8\}=\{1,3,4\}\cdot2$.
\end{thm}

\begin{thm}
$\forall S\subseteq\R$, $\forall x\in\R$, \quad $x\cdot S=S\cdot x$.
\end{thm}

\begin{defn}
Let $S\subseteq\R$, $x\in\R_0^\times$. Then:\\
\phx\qquad\qquad $\boxed{S/x}:=\{y\cdot x\,|\,y\in S\}$.
\end{defn}

\begin{defn}
Let $S\subseteq\R_0^\times$, $x\in\R$. Then:\\
\phx\qquad\qquad $\boxed{x/S}:=\{x/y\,|\,y\in S\}$.
\end{defn}

\begin{thm}
Let $S\subseteq\R_0^\times$, $x\in\R_0^\times$. Then:\\
\phx\qquad\qquad $x/S=1/(S/x)$ \quad and \quad $S/x=1/(x/S)$.
\end{thm}

\begin{thm}
$2\N:=\{2,4,6,8,\ldots\}$ and $2\N-1=\{1,3,5,7,\ldots\}$.
\end{thm}

\subsection{Roots and powers of real numbers}
\quad
\vskip.1in\noindent
It is our convention that $0^0=1$. In fact:

\begin{thm}
$\forall x\in\R$, $\,\,$ $x^0=1$.\\
\phx\quad Also, \quad $\forall x\in\R$, $\forall j\in\N_0$, $\,\,$ $x^{j+1}=x^j\cdot x$.
\end{thm}

\begin{defn}
Let $x\in\R$. Then $\boxed{\sqrt{x}}:=\max\{w\in\R\,|\,w^2=x\}$.
\end{defn}

\begin{thm}
$\sqrt{25}=\max[-5;5]=5$.
\end{thm}

\begin{thm}
$\sqrt{2}\notin\Q$.
\end{thm}

We have $\{w\in\R\,|\,w^2\le-1\}=\emptyset$, so $\sqrt{-1}=\max\emptyset$.\\
So, since $\max\emptyset=\frownie$, we get:

\begin{thm}
$\sqrt{-1}=\frownie$.
\end{thm}

\begin{thm}
$\forall x\ge0$, \quad $\sqrt{x}\ne\frownie$.
\end{thm}

\begin{thm}
$\forall x<0$, \quad $\sqrt{x}=\frownie$.
\end{thm}

\begin{thm}
$\forall x\ge0$, \quad $(\sqrt{x})^2=x=\sqrt{x^2}$.
\end{thm}

\begin{defn}
$\forall x\in\R$, \quad $\boxed{|x|}:=\sqrt{x^2}$.
\end{defn}

\begin{thm}
$|-5|=\sqrt{(-5)^2}=\sqrt{25}=5$.
\end{thm}

\begin{defn}
Let $k\in\N$, $x\in\R$. Then:\\
\phx\qquad $\boxed{\sqrt[k]{x}}:=\max\{w\in\R\,|\,w^k\le x\}$.
\end{defn}

\begin{thm}
$\forall k\in2\N$, $\forall x\ge0$, \quad $\sqrt[k]{x}\ne\frownie$.
\end{thm}

\begin{thm}
$\forall k\in2\N-1$, $\forall x\in\R$, \quad $\sqrt[k]{x}\ne\frownie$.
\end{thm}

\begin{thm}
$\forall k\in2\N$, $\forall x<0$, \quad $\sqrt[k]{x}=\frownie$.
\end{thm}

\begin{thm}
$\forall k\in2\N$, $\forall x\ge0$, \quad $(\sqrt[k]{x})^k=x=\sqrt[k]{x^k}$.
\end{thm}

\begin{thm}
$\forall k\in2\N-1$, $\forall x\in\R$, \quad $(\sqrt[k]{x})^k=x=\sqrt[k]{x^k}$.
\end{thm}

\begin{thm}
$\forall x\in\R$, \quad $\sqrt[1]{x}=x$.
\end{thm}

\begin{thm}
$\forall x\ge0$, \quad $\sqrt[2]{x}=\sqrt{x}$.
\end{thm}

\begin{thm}
$\forall x\in\R$, \quad $\sqrt[2]{x}=\sqrt{x}$.
\end{thm}

\begin{thm}
$\forall x\in\R$, \quad $\sqrt[3]{x}=\max\{w\in\R\,|\,w^3\le x\}$.
\end{thm}

We have $\{w\in\R\,|\,w^3\le8\}=(-\infty;2]$. Then:

\begin{thm}
$\sqrt[3]{-8}=\max(-\infty;2]=2$.
\end{thm}

\begin{thm}
$\forall x\in\R$, \quad $(\sqrt[3]{x})^3=x=\sqrt[3]{x^3}$.
\end{thm}

\subsection{Properties of absolute value}

\begin{thm}
$\forall a,b\in\R$, $\,$ $|a-b|=|b-a|$.
\end{thm}

\noindent
It is crucial to us to take a statement like\\
\phx\quad When $x$ is close to $2$, $x^2$ is close to $4$\\
and give it a rigorous meaning.\\
This requires us to find a rigorous way of talking about ``closeness''.\\
To say\\
\phx\quad $a$ is close to $b$\\
is to say\\
\phx\quad the distance from $a$ to $b$ is close to zero.\\
Making this rigorous requires us to rigorize both\\
\phx\quad distance \quad and \quad close to zero.\\
\\
We do not formally define distance in this course,\\
but we have an intuitive sense of distance, and:\\
\phx\quad the distance from $2$ to $5$ is $5-2$.\\
Also,\\
\phx\quad the distance from $9$ to $1$ is $9-1$.\\
The general rule is: $\forall a,b\in\R$,\\
\phx\quad the distance from $a$ to $b$ is $|b-a|$.\\
(NOTE: $\forall a,b\in\R$, $|a-b|=|b-a|$.)\\
So, when you see an expression of the form $|b-a|$,\\
you can interpret it, geometrically as a statement about\\
\phx\quad the distance from $a$ to $b$.\\
This geometric intuition is indispensable.\\
Since absolute value plays such a big role,\\
we record a number of its properties, like:

\begin{thm}
$\forall a,b\in\R$, we have: \qquad\quad $|a\cdot b|=|a|\cdot|b|$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad and \qquad $|a+b|\le|a|+|b|$.
\end{thm}

The next theorem is called the \bfindex[Triangle Inequality].

\begin{thm}
Let $a,b,c\in\R$. Then: $|a-c|\le|a-b|+|b-c|$.
\end{thm}

\begin{proof}
\quad $|a-c|=|(a-b)+(b-c)|\le|a-b|+|b-c|$.
\end{proof}

\begin{thm}
$\forall a,b,c\in\R$, \quad $|abc|=|a|\cdot|b|\cdot|c|$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $|a+b+c|\le|a|+|b|+|c|$.
\end{thm}

\noindent
In the conclusion of the following theorem, we cannot write\\
\phx\quad $|x-2|\cdot|x^3-8x^2+7x|\,<\,\delta\cdot(|x|^3+8\cdot|x|^2+7\cdot|x|)$\\
because of the possibility that $x=0$.

\begin{thm}
Let $x\in\R$, $\delta>0$. \quad Assume $|x-2|<\delta$.\\
\phx\qquad Then $|x-2|\cdot|x^3-8x^2+7x|\,\le\,\delta\cdot(|x|^3+8\cdot|x|^2+7\cdot|x|)$.
\end{thm}

\begin{proof}
We have:\\
\phx\qquad $\,|x^3-8x^2+7x|=|x^3+(-8x^2)+7x|$\\
\phx\qquad\qquad\qquad\qquad\quad $\le|x^3|+|-8x^2|+|7x|$\\
\phx\qquad\qquad\qquad\qquad\quad $=|x|^3+|-8|\cdot|x|^2+|7|\cdot|x|$\\
\phx\qquad\qquad\qquad\qquad\quad $=|x|^3+8\cdot|x|^2+7\cdot|x|$.\\
So, since $0\le|x-2|\le\delta$, we get:\\
\phx\qquad $|x-2|\cdot|x^3-8x^2+7x|\le\delta\cdot(|x|^3+8\cdot|x|^2+7\cdot|x|)$.
\end{proof}

\begin{thm}
Let $a,b\in\R$, $\vep>0$. Then:\\
\phx\qquad $(\,|b-a|<\vep\,)\,\Leftrightarrow\,(\,a-\vep<b<a+\vep\,)$ \qquad and\\
\phx\qquad $(\,|b-a|<\vep\,)\,\Leftrightarrow\,(\,b-\vep<a<b+\vep\,)$ \qquad and\\
\phx\qquad $(\,|b-a|\le\vep\,)\,\Leftrightarrow\,(\,a-\vep\le b\le a+\vep\,)$ \qquad and\\
\phx\qquad $(\,|b-a|\le\vep\,)\,\Leftrightarrow\,(\,b-\vep\le a\le b+\vep\,)$.
\end{thm}

\subsection{A doubly quantified theorem}
\quad
\vskip.1in\noindent
In this course, there are exactly two symbols that are called \bfindex[quantifier]s.
The first is ``$\forall$'', the second ``$\exists$''.
They both appear in the following theorem.

\begin{thm}\wrlab{thm-dbly-quant}
$\forall\vep>0$, $\exists\delta>0$ s.t.~$\delta^6+5\delta^4+\delta\le\vep$.
\end{thm}

The stream of characters above is an example of a ``mathematical statement''.
We will often just say ``statement'' to mean ``mathematical statement''.
This has a technical definition which we will not go into here, but the intuition is that
a statement is a stream of characters that has a mathematical meaning.

A character stream that is not a statement, like\\
\phx\qquad\qquad\qquad\qquad gyre and gimbel in the wabe\\
cannot be analyzed mathematically, and so will be ignored in this course.
While you are not expected to know the technical definition of a statement,
there are some rules you should know for how to build complex statements out of simpler ones.
For example, for any two statements $A$ and $B$, the character stream ``$(A)\Rightarrow(B)$'' is also a statement,
though, in practice, we are often sloppy and leave off those parenthesis and simply write ``$A\Rightarrow B$''.
So, not only will we not give any technical definition of a statement,
we will not even be purists about following that technical definition exactly.

Incidentally, similar remarks hold for ``$A\& B$'' and ``$A\vee B$''.

Let $A$ and $B$ be statements.
Then the character stream ``$A\Rightarrow B$'' is a statement,
and is considered equivalent to saying ``if $A$, then $B$''.
There is a difference of usage between ``$A\therefore B$'' and ``$A\Rightarrow B$'':
The statement ``$A\Rightarrow B$'' means, intuitively, ``I am unsure of whether $A$ is true, but,
if it is, then $B$ is also true''.
The statement ``$A\therefore B$'' means, intuitively, ``I am completely sure that $A$ is true, and
it follows that $B$ is true as well''.

As mentioned above, \tref{thm-dbly-quant} above involves two quantifiers.
First is the \bfindex[universal quantifier] ``$\forall$'', which means ``for all'' or, sometimes, ``for any''.
Second is the \bfindex[existential quantifier] ``$\exists$'' which means ``there exists''.

Because it has two quantifiers, \tref{thm-dbly-quant} is ``doubly quantified''.

We turned \tref{thm-dbly-quant} into a game: You give me $\vep>0$.
I give you $\delta>0$. We check to see if $\delta^6+5\delta^4+\delta\le\vep$ is true.
If it is, then I win. If not, then you win.

We played the game, and it was clear that I would win every time.

We developed a strategy: Once you give me $\vep>0$, I could find $\delta>0$ such that
all three of the following hold:\\
\phx\qquad\qquad $\delta^6\le\vep/3$ and $5\delta^4\le\vep/3$ and $\delta\le\vep/3$.\\
This suggests setting\\
\phx\qquad\qquad $\delta:=\min\{\,\,\sqrt[6]{\vep/3}\,\,,\,\,\sqrt[4]{\vep/15}\,\,,\,\,\vep/3\,\,\}$.\\
\\
We can structure the proof of \tref{thm-dbly-quant}:

\begin{proof}
Given $\vep>0$.\\
{\bf Want:} $\exists\delta>0$ s.t.~$\delta^6+5\delta^4+\delta\le\vep$.\\
\\
\\
{\bf Want:} $\delta^6+5\delta^4+\delta\le\vep$.\\
\\
\\
\end{proof}

It remains to fill in the $\delta$-strategy and finish:

\begin{proof}
Given $\vep>0$.\\
{\bf Want:} $\exists\delta>0$ s.t.~$\delta^6+5\delta^4+\delta\le\vep$.\\
Let $\delta:=\min\{\,\,\sqrt[6]{\vep/3}\,\,,\,\,\sqrt[4]{\vep/15}\,\,,\,\,\vep/3\,\,\}$.\\
Then $\delta>0$.\\
{\bf Want:} $\delta^6+5\delta^4+\delta\le\vep$.\\
We know $0\le\delta\le\sqrt[6]{\vep/3}$, so $\delta^6\le\vep/3$.\\
We also know $0\le\delta\le\sqrt[4]{\vep/15}$, so $\delta^4\le\vep/15$, so $5\delta^4\le\vep/3$.\\
Finally, we know $\delta\le\vep/3$.\\
Since $\delta^6\le\vep/3$ and $5\delta^4\le\vep/3$ and $\delta\le\vep/3$,\\
\phx\qquad we conclude: $\delta^6+5\delta^4+\delta\le(\vep/3)+(\vep/3)+(\vep/3)$.\\
Then $\delta^6+5\delta^4+\delta\le\vep$.
\end{proof}

We can state \tref{thm-dbly-quant} in a slightly different format,
and the change makes the proof a little simpler because $\vep$ is bound
within the statement of the theorem in a way that keeps the binding valid until the end of the proof:

\begin{thm}\wrlab{thm-dbly-quant-version2}
Let $\vep>0$. Then $\exists\delta>0$ s.t.~$\delta^6+5\delta^4+\delta\le\vep$.
\end{thm}

\begin{proof}
Let $\delta:=\min\{\,\,\sqrt[6]{\vep/3}\,\,,\,\,\sqrt[4]{\vep/15}\,\,,\,\,\vep/3\,\,\}$.\\
Then $\delta>0$.\\
{\bf Want:} $\delta^6+5\delta^4+\delta\le\vep$.\\
We know $0\le\delta\le\sqrt[6]{\vep/3}$, so $\delta^6\le\vep/3$.\\
We also know $0\le\delta\le\sqrt[4]{\vep/15}$, so $\delta^4\le\vep/15$. Then $5\delta^4\le\vep/3$.\\
Finally, we know $\delta\le\vep/3$.\\
Since $\delta^6\le\vep/3$ and $5\delta^4\le\vep/3$ and $\delta\le\vep/3$,\\
\phx\qquad we conclude: $\delta^6+5\delta^4+\delta\le(\vep/3)+(\vep/3)+(\vep/3)$.\\
Then $\delta^6+5\delta^4+\delta\le\vep$.
\end{proof}

Another similar theorem, and similar proof:

\begin{thm}\wrlab{thm-dbly-quant-variant}
$\forall\vep>0$, $\exists\delta>0$ s.t.~$4\delta^8+7\delta^2+5\delta\le9\vep$.
\end{thm}

\begin{proof}
Given $\vep>0$.\\
{\bf Want:} $\exists\delta>0$ s.t.~$4\delta^8+7\delta^2+5\delta\le9\vep$.\\
Let $\delta:=\min\{\,\,\sqrt[8]{3\vep/4}\,\,,\,\,\sqrt{3\vep/7}\,\,,\,\,3\vep/5\,\,\}$.\\
Then $\delta>0$.\\
{\bf Want:} $4\delta^8+7\delta^2+5\delta\le9\vep$.\\
We know $0\le\delta\le\sqrt[8]{3\vep/4}$, so $\delta^8\le3\vep/4$. Then $4\delta^8\le3\vep$.\\
We also know $0\le\delta\le\sqrt{3\vep/7}$, so $\delta^2\le3\vep/7$. Then $7\delta^2\le3\vep$.\\
Finally, we know $\delta\le3\vep/5$. Then $5\delta\le3\vep$.\\
Since $4\delta^8\le3\vep$ and $7\delta^2\le3\vep$ and $5\delta\le3\vep$,\\
\phx\qquad we conclude: $4\delta^8+7\delta^2+5\delta\le3\vep/3+3\vep+3\vep$.\\
Then $4\delta^8+7\delta^2+5\delta\le9\vep$.
\end{proof}

\subsection{Triply quantified theorems with implication}
\quad
\vskip.1in\noindent

\begin{thm}\phx\\
\phx\qquad$\forall M\in\R$, $\exists\delta>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad $(\,0<x<\delta\,)\,\Rightarrow\,(\,1/x>M\,)$.
\end{thm}  

\begin{proof}
Given $M\in\R$.\\
{\bf Want:} $\exists\delta>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad $(\,0<x<\delta\,)\,\Rightarrow\,(\,1/x>M\,)$.\\
Let $\delta:=1/(\max\{M,1\})$. \qquad Then $\delta>0$.\\
{\bf Want:} $\forall x\in\R$, $(\,0<x<\delta\,)\,\Rightarrow\,(\,1/x>M\,)$.\\
Given $x\in\R$. Assume $0<x<\delta$. {\bf Want:} $1/x>M$.\\
Since $0<x<\delta$, it follows that $1/x>1/\delta$.\\
Then $1/x>1/\delta=\max\{M,1\}\ge M$.
\end{proof}

\begin{thm}
$\forall\vep>0$, $\exists\delta>0$ s.t.~$\forall x\in\R$,\\
\phx\qquad\qquad $(\,\,|x-2|<\delta\,\,)\,\,\Rightarrow\,\,(\,\,|x^4-5x^2+2x|<\vep\,\,)$.
\end{thm}

\begin{proof}
Given $\vep>0$.\\
{\bf Want:} $\exists\delta>0$ s.t.~$\forall x\in\R$,\\
\phx\qquad\qquad $(\,\,|x-2|<\delta\,\,)\,\,\Rightarrow\,\,(\,\,|x^4-5x^2+2x|<\vep\,\,)$.\\
Let $\delta:=\min\{1,\vep/49\}$. \qquad Then $\delta<1$ and $\delta<\vep/49$ and $\delta>0$.\\
{\bf Want:} $\forall x\in\R$, \quad $(\,\,|x-2|<\delta\,\,)\,\,\Rightarrow\,\,(\,\,|x^4-5x^2+2x|<\vep\,\,)$.\\
Given $x\in\R$. Assume $|x-2|<\delta$. {\bf Want:} $|x^4-5x^2+2x|<\vep$.\\
We have $|x|\le|(x-2)+2|\le|x-2|+|2|=|x-2|+2<\delta+2$,\\
\phx\quad so, since $\delta<1$, we conclude that $|x|<3$.\\
Since $48/49<1$ and $\vep>0$, we get $48\cdot\vep/49<\vep$.\\
Since $x^4-5x^2+2x=(x-2)\cdot(x^3+2x^2-x)$,\\
\phx\qquad we get $|x^4-5x^2+2x|=|x-2|\cdot|x^3+2x^2-x|$.\\
Then $|x^4-5x^2+2x|=|x-2|\cdot|x^3+2x^2-x|\le\delta\cdot(|x|^3+2\cdot|x|^2+|x|)$.\\
So, since $|x|<3$, this gives $|x^4-5x^2+2x|\le\delta\cdot(3^3+2\cdot3^2+3)$.\\
So, since $3^3+2\cdot3^2+3=48$, this gives $|x^4-5x^2+2x|\le48\cdot\delta$.\\
So, since $\delta<\vep/49$, this gives $|x^4-5x^2+2x|\le48\cdot\vep/49$.\\
Then $|x^4-5x^2+2x|\le48\cdot\vep/49<\vep$.
\end{proof}

\subsection{Primitive ordered pairs}

\begin{thm}
$\{1,2\}=\{2,1\}=\{1,1,2,2,2\}$.
\end{thm}

\begin{thm}
$\{5,5\}=\{5\}$ \quad and \quad $\{\,\,\{5\}\,\,,\,\,\{5\}\,\,\}=\{\,\,\{5\}\,\,\}$.
\end{thm}

\begin{thm}
$\{\,\,\{5\}\,\,,\,\,\{5,5\}\,\,\}=\{\,\,\{5\}\,\,\}$.
\end{thm}

\begin{defn}\wrlab{defn-prim-ord-pr}
$\forall x,y$, $\boxed{\langle\langle x,y\rangle\rangle}:=\begin{cases}\{\,\,\{x\}\,\,,\,\,\{x,y\}\,\,\},&\hbox{if }x\ne\frownie\ne y\\\frownie,&\hbox{if }((x=\frownie)\vee(y=\frownie)).\end{cases}$
\end{defn}

\noindent
The notation $\langle\langle x,y\rangle\rangle$ is read ``the \bfindex[primitive ordered pair] $x$, $y$''.

\begin{thm}
$\langle\langle1,2\rangle\rangle=\{\,\,\{1\}\,\,,\,\,\{1,2\}\,\,\}$ \quad and\\
\phx\qquad\qquad\qquad\qquad $\langle\langle6,\{7,8\}\rangle\rangle=\{\,\,\{6\}\,\,,\,\,\{6,\{7,8\}\}\,\,\}$ \quad and\\
\phx\qquad\qquad\qquad\qquad $\langle\langle5,5\rangle\rangle=\{\,\,\{5\}\,\,,\,\,\{5,5\}\,\,\}=\{\,\,\{5\}\,\,\}$ \quad and\\
\phx\qquad\qquad\qquad\qquad $\langle\langle\frownie,5\rangle\rangle=\langle\langle\frownie,\frownie\rangle\rangle=\langle\langle\{2,1\},\frownie\rangle\rangle=\frownie$.
\end{thm}

\begin{thm}
$\langle\langle1,2\rangle\rangle=\{\,\,\{1\}\,\,,\,\,\{1,2\}\,\,\}$ \quad and\\
\phx\qquad\qquad\quad\qquad\qquad $\,\,\langle\langle2,1\rangle\rangle=\{\,\,\{2\}\,\,,\,\,\{2,1\}\,\,\}$.
\end{thm}

\begin{thm}
$\langle\langle1,2\rangle\rangle\ne\langle\langle2,1\rangle\rangle$.
\end{thm}

\begin{thm}
$\forall\hbox{non-}\frownie\,\,a,b,x,y$,\\
\phx\qquad\qquad $(\,\,\langle\langle a,b\rangle\rangle=\langle\langle x,y\rangle\rangle\,\,)\,\,\Leftrightarrow\,\,(\,\,(a=x)\,\,\&\,\,(b=y)\,\,)$.
\end{thm}

\subsection{Relations}

\begin{defn}
Let $R$ be a set.
Then $R$ is a \bfindex[relation] means:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\forall z\in R$, $\exists x,y$ s.t.~$z=\langle\langle x,y\rangle\rangle$.
\end{defn}

\noindent
In other words, a relation is a set of primitive ordered pairs.\\

\noindent
Since $\frownie=\langle\langle\frownie,\frownie\rangle\rangle$,
we see that, technically, $\frownie$ is a primitive ordered pair.
However, $\frownie$ is never an element of any set, and so it cannot be an element of a relation.
So, even if it's somewhat redundant, it's possibly clearer to say that a relation is a set of
non-$\frownie$ primitive ordered pairs.\\

\noindent
More generally, any set is a set of non-$\frownie$ objects.

\begin{thm}
$\{\,\,\langle\langle1,2\rangle\rangle\,\,,\,\,\langle\langle1,3\rangle\rangle\,\,,\,\,\langle\langle4,5\rangle\rangle\,\,\}$ is a relation.
\end{thm}

\begin{thm}\phx\\
\phx\quad $\{\,\,\langle\langle1,\{2,3\}\rangle\rangle\,\,,\,\,\langle\langle1,9\rangle\rangle\,\,,\,\,\langle\langle7,6\rangle\rangle\,\,\}$
is a relation.
\end{thm}

\noindent
Since \qquad\qquad $\forall x,y$, \quad $\langle\langle x,y\rangle\rangle\ne\{1,2,3\}$, \qquad\qquad we conclude:

\begin{thm}\phx\\
\phx\quad $\{\,\,\{1,2,3\}\,\,,\,\,\langle\langle1,9\rangle\rangle\,\,,\,\,\langle\langle7,6\rangle\rangle\,\,\}$ is NOT a relation.
\end{thm}

\noindent
The following is null true:

\begin{thm}
$\emptyset$ is a relation.
\end{thm}

\begin{defn}
Let $R$ be a relation. Then:\\
\phx\qquad $\boxed{\D_R}\quad:=\quad\{\,\,x\,\,|\,\,\exists y~\hbox{s.t.}~\langle\langle x,y\rangle\rangle\in R\,\,\}$ \quad and\\
\phx\qquad $\boxed{\I_R}\quad:=\quad\{\,\,y\,\,|\,\,\exists x~\hbox{s.t.}~\langle\langle x,y\rangle\rangle\in R\,\,\}$.
\end{defn}

\noindent
We call $\D_R$ the \bfindex[domain] of $R$.\\
We call $\I_R$ the \bfindex[image] of $R$.

\noindent
Unassigned HW: Show that $\D_\emptyset=\emptyset$ and $\R_\emptyset=\emptyset$.

\begin{defn}
Let $R$ be a relation, $x$ an object. Then:\\
\phx\qquad\qquad $\boxed{\VL_x^R}\quad:=\quad\{\,\,y\,\,|\,\,\langle\langle x,y\rangle\rangle\in R\,\,\}$.
\end{defn}

\noindent
We call $\VL_x^R$ the \bfindex[vertical line] through $x$ in $R$.\\
\\
We justified the following theorem by graphing $R$.

\begin{thm}
Let $R\,:=\,\{\,\langle\langle1,2\rangle\rangle\,,\,\langle\langle1,3\rangle\rangle\,,\,\langle\langle4,5\rangle\rangle\,\}$.\\
\phx\qquad Then $\D_R=\{1,4\}$ and $\I_R=\{2,3,5\}$ and\\
\phx\qquad\qquad $\VL_1^R=\{2,3\}$ and $\VL_4^R=\{5\}$ and $\VL_3^R=\emptyset$.
\end{thm}

\noindent
We justified the following two theorems by looking at the graph of the relation of the preceding theorem.

\begin{thm}
Let $R$ be a relation and let $x$ be an object.\\
\phx\qquad\qquad Then: \qquad $(\,x\in\D_R\,)\,\Leftrightarrow\,(\,\VL_x^R\ne\emptyset\,)$.
\end{thm}

\begin{thm}
Let $R$ be a relation and let $y$ be an object.\\
\phx\qquad\qquad Then: \qquad $(\,y\in I_R\,)\,\Leftrightarrow\,(\,\exists x\in\D_R~\hbox{s.t.}~\langle\langle x,y\rangle\rangle\in R\,)$.
\end{thm}

\noindent
Some relations cannot be graphed, and yet we can still study domain, range and vertical lines for them. For example:

\begin{thm}
Let $R\,:=\,\{\,\langle\langle1,\{2,3\}\rangle\rangle\,,\,\langle\langle1,9\rangle\rangle\,,\,\langle\langle6,7\rangle\rangle\,\}$.\\
\phx\qquad Then $\D_R=\{1,6\}$ and $I_R=\{\,\{2,3\}\,,\,7\,,\,9\,\}$ and\\
\phx\qquad\qquad $\VL_1^R=\{\,\{2,3\}\,,\,9\}$ and $\VL_6^R=\{7\}$ and $\VL_3^R=\emptyset$.
\end{thm}

\begin{thm}\wrlab{thm-VL-sub-frownie-is-empty}
Let $R$ be a relation.
Then $\VL_{\frownie}^R=\emptyset$.
\end{thm}

\begin{proof}
Assume $\VL_{\frownie}^R\ne\emptyset$. {\bf Want:} Contradiction.\\
Choose $y\in\VL_{\frownie}^R$. \quad Then $\langle\langle\frownie,y\rangle\rangle\in R$.\\
By \dref{defn-prim-ord-pr}, we have: $\langle\langle\frownie,y\rangle\rangle=\frownie$.\\
Since $\frownie=\langle\langle\frownie,y\rangle\rangle\in R$, we get: $\frownie\in R$.\\
Since $R$ is a set, by \aref{ax-frownie-not-in-set}, we have: $\frownie\notin R$.\\
Contradiction.
\end{proof}

\subsection{Functions}

\begin{defn}
For any object $f$, by $f$ is a \bfindex[function] we mean:
\qquad $(\,f\hbox{ is a relation}\,)\,\,\&\,\,(\,\,\forall x\in\D_f,\,\,\VL_x^f\hbox{ is a singleton}\,\,)$.
\end{defn}

In other words, a function is a relation for which each of its vertical lines, through points in its domain, is a singleton.

\begin{thm}
$\{\,\langle\langle1,2\rangle\rangle\,,\,\langle\langle1,3\rangle\rangle\,,\,\langle\langle4,5\rangle\rangle\,\}$ is NOT a function.
\end{thm}

\begin{thm}
$\{\,\langle\langle3,7\rangle\rangle\,,\,\langle\langle2,7\rangle\rangle\,,\,\langle\langle1,8\rangle\rangle\,\}$ IS a function.
\end{thm}

The function $\{\,\langle\langle3,7\rangle\rangle\,,\,\langle\langle2,7\rangle\rangle\,,\,\langle\langle1,8\rangle\rangle\,\}$
will typically be written:\\
\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{\left(\begin{tabular}{c}$3\mapsto7$\\$2\mapsto7$\\$1\mapsto 8$\end{tabular}\right)}$.\\
\\
Generally, for any $n\in\N$, for any objects $x_1,\ldots,x_n$, for any objects $y_1,\ldots,y_n$, we define\\
\\
\phx\qquad\qquad $\ds{\left(\begin{tabular}{c}$x_1\mapsto y_1$\\$\vdots$\\$x_n\mapsto y_n$\end{tabular}\right)\quad:=\quad
\{\,\,\langle\langle x_1,y_1\rangle\rangle\,\,,\,\,\ldots\,\,,\,\,\langle\langle x_n,y_n\rangle\rangle\,\,\}}$.\\
\\
We are eventually going to cease use of $\langle\langle\bullet,\bullet\rangle\rangle$ in favor of higher-level notation, and this is an
example.

\begin{thm}\phx\\
\\
\phx\qquad\qquad\qquad $\ds{\left(\begin{tabular}{c}$2\mapsto\{3,5\}$\\$8\mapsto9$\\$6\mapsto-1$\\$4\mapsto\{6\}$\end{tabular}\right)=
\left(\begin{tabular}{c}$2\mapsto\{3,5\}$\\$4\mapsto\{6\}$\\$6\mapsto-1$\\$8\mapsto9$\end{tabular}\right)}$.
\end{thm}

\begin{thm}
Let $f$ be a relation. Then:\\
\phx $(\,f\hbox{ is a function}\,)\,\Leftrightarrow\,(\,\forall x,y,z,\,(\,\langle\langle x,y\rangle\rangle,\langle\langle x,z\rangle\rangle\in f\,)\,\Rightarrow\,(\,y=z\,)\,)$.
\end{thm}

\begin{thm}
$\emptyset$ is a function.
\end{thm}

\begin{thm}
$(\,\,\D_\emptyset=\emptyset=\I_\emptyset\,\,)\,\,\&\,\,(\,\,\forall x,\,\,\VL_x^\emptyset=\emptyset\,\,)$.
\end{thm}

\begin{defn}
Let $f$ be a function and let $x$ be an object. Then we define:\\
\phx\qquad $\boxed{f_x}\,:=\,\UE(\VL_x^f)$.
\end{defn}

Alternate notation for $f_x$ is $\boxed{f(x)}$.

\begin{thm}\phx\\
\\
\phx Let $\ds{f:=\left(\begin{tabular}{c}$2\mapsto3$\\$5\mapsto8$\\$7\mapsto6$\end{tabular}\right)}$.
Then: $(\,f(5)=8\,)\,\&\,(\,f(2)=3\,)\,\&\,(\,f(9)=\frownie\,)$.
\end{thm}

\begin{thm}\phx\\
\\
\phx Let $\ds{f:=\left(\begin{tabular}{c}$2\mapsto\{3,5\}$\\$4\mapsto\{6\}$\\$6\mapsto-1$\\$8\mapsto9$\end{tabular}\right)}$.
Then: $(f_6=-1)\&(f_2=\{3,5\})\&(f_3=\frownie)$.
\end{thm}

\begin{thm}
$\forall x$, \quad $\emptyset_x=\frownie$.
\end{thm}

\begin{thm}
Let $f$ be a function and let $x$ be an object.\\
\phx Then: \quad $(\,\,x\in\D_f\,\,)\,\,\Leftrightarrow\,\,(\,\,\VL_x^f\hbox{ is a singleton}\,\,)\Leftrightarrow\,\,(\,\,f_x\ne\frownie\,\,)$.
\end{thm}

\begin{thm}
Let $f$ be a function and let $x,y$ be objects.\\
\phx Then: \quad $(\,\,\langle\langle x,y\rangle\rangle\in f\,\,)\,\,\Leftrightarrow\,\,(\,\,y\in\VL_x^f\,\,)\Leftrightarrow\,\,(\,\,f_x=y\,\,)$.
\end{thm}

\noindent
The next axiom is part of the general philosophy that\\
\phx\quad ``$\frownie$ is infective.''

\begin{axiom}
For all $q$, $\frownie_q=\frownie$ and $q_{\frownie}=\frownie$.
\end{axiom}

\begin{thm}
Let $\ds{S\,\,:=\,\,\left\{\,\,\left(\begin{array}{c}1\mapsto1\\2\mapsto2\end{array}\right)\,\,\right\}}$.\\
Let $f:=\UE_S$. \qquad Then: $\,$ $f_1=1$ $\,$ and $\,$ $f_2=2$ and $f_3=\frownie$ and $f_{\frownie}=\frownie$.
\end{thm}

\begin{thm}
Let $\ds{S\,\,:=\,\,\left\{\,\,\left(\begin{array}{c}1\mapsto1\\2\mapsto2\end{array}\right)\,\,,\,\,\left(\begin{array}{c}1\mapsto2\\2\mapsto1\end{array}\right)\,\,\right\}}$.\\
Let $f:=\UE_S$. \qquad Then: $\,$ $f_1=\frownie$ $\,$ and $\,$ $f_2=\frownie$.
\end{thm}

\begin{defn}
Let $A$ and $B$ be sets. \quad Then:\\
\phx $\boxed{f:A\drta B}\,$ means $(\,f\hbox{ is a function}\,)\,\&\,(\,\D_f\subseteq A\,)\,\&\,(\,\I_f\subseteq B\,)$ and\\
\phx $\boxed{f:A\,\,\to\,\,B}$ means $(\,f\hbox{ is a function}\,)\,\&\,(\,\D_f=A\,)\,\&\,(\,\I_f\subseteq B\,)$ and\\
\phx $\boxed{f:A\to>B}$ means $(\,f\hbox{ is a function}\,)\,\&\,(\,\D_f=A\,)\,\&\,(\,\I_f=B\,)$.
\end{defn}

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$2\mapsto3$\\$5\mapsto8$\\$7\mapsto6$\end{tabular}\right)$. Then:\\
\\ 
\phx\qquad\qquad $f:\{2,5,7\}\to\{3,4,6,8\}$ \qquad and\\
\phx\qquad\qquad $f:\{2,5,7\}\to\{1,3,4,6,8,9\}$ \qquad and\\
\phx\qquad\qquad $f:\{2,4,5,7\}\drta\{3,4,6,8\}$ \qquad and\\
\phx\qquad\qquad $f:\{1,2,4,5,7\}\drta\{1,3,4,6,8\}$ \qquad and\\
\phx\qquad\qquad $f:\{2,5,7\}\to>\{3,6,8\}$.
\end{thm}

\begin{defn}
Let $f$ be a function. Then:\\
\phx\qquad by $f$ is \bfindex[one-to-one] or \bfindex[1-1], we mean:\\
\phx\qquad\qquad\qquad $\forall w,x\in\D_f$, \quad $(\,f_w=f_x\,)\,\Rightarrow\,(\,w=x\,)$.
\end{defn}

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$2\mapsto3$\\$5\mapsto8$\\$7\mapsto6$\end{tabular}\right)$. Then $f$ is 1-1.
\end{thm}

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$2\mapsto5$\\$5\mapsto8$\\$7\mapsto5$\end{tabular}\right)$. Then $f$ is NOT 1-1.
\end{thm}

\noindent
We graphed the function $f$ from the next theorem.\\
It was the graph of $y=x^3$.

\begin{thm}
Let $f:=\{\,\langle\langle x,y\rangle\rangle\,|\,(\,x,y\in\R\,)\,\&\,(\,y=x^3\,)\,\}$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $f$ is 1-1.
\end{thm}

\noindent
We graphed the function $f$ from the next theorem.\\
It was the parabola given by $y=x^2$.

\begin{thm}
Let $f:=\{\,\langle\langle x,y\rangle\rangle\,|\,(\,x,y\in\R\,)\,\&\,(\,y=x^2\,)\,\}$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $f$ is NOT 1-1.
\end{thm}

\begin{defn}
Let $A$ and $B$ be sets. \quad Then:\\
\phx\qquad $\boxed{f:A\,\,\hookrightarrow\,\,B}\,$ means $(\,f:A\,\,\to\,\,B\,)\,\&\,(\,f\hbox{ is 1-1}\,)$ \quad and\\
\phx\qquad $\boxed{f:A\hookrightarrow>B}\,$ means $(\,f:A\to>B\,)\,\&\,(\,f\hbox{ is 1-1}\,)$.
\end{defn}

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$2\mapsto3$\\$5\mapsto8$\\$7\mapsto6$\end{tabular}\right)$. Then:\\
\\ 
\phx\qquad\qquad $f:\{2,5,7\}\hookrightarrow\{3,4,6,8\}$ \qquad and\\
\phx\qquad\qquad $f:\{2,5,7\}\hookrightarrow\{1,3,4,6,8,9\}$ \qquad and\\
\phx\qquad\qquad $f:\{2,5,7\}\hookrightarrow>\{3,6,8\}$.
\end{thm}

\noindent
We have now introduced enough notation that, going forward,\\
\phx\qquad\qquad we can avoid writing $\langle\langle\bullet,\bullet\rangle\rangle$.\\
For example, instead of writing $\langle\langle x,y\rangle\rangle\in f$,\\
\phx\qquad\qquad we will write $f_x=y$ or $f(x)=y$.\\
\\
Instead of, for example, writing\\
\phx\qquad$\,$Let $f\,\,:=\,\,\{\,\langle\langle x,y\rangle\rangle\,|\,x,y\in\R\,,\,y=x^3\,\}$,\\
please write\\
\phx\qquad$\,$Let $f:\R\to\R$ be defined by: $\forall x\in\R$, $f(x)=x^3$\\
or
\phx\quad Define $f:\R\to\R$ by: $\forall x\in\R$, $f(x)=x^3$.\\
One of the advantages of this is that,\\
\phx\quad because $f(x)$ is given by a formula,\\
\phx\quad it is clear that $f$ is a function.\\
That is, each $x$ corresponds to exactly one $y$, namely $x^3$.\\
We will see this, in the proof of (a) in the next theorem.\\
\\
We graphed the function $f$ from the next theorem.\\
It was the parabola given by $y=x^2$.

\begin{thm}
Define $f:\R\to\R$ by: $\forall x\in\R$, $f_x=x^2$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $f:\R\to>[0;\infty)$.
\end{thm}

\noindent
We graphed the function $f$ from the next theorem.\\
It was the graph of $y=x^3$.

\begin{thm}
Define $f:\R\to\R$ by: $\forall x\in\R$, $f_x=x^3$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $f:\R\hookrightarrow>\R$.
\end{thm}

\begin{proof}
{\bf Want:}\quad ($\alpha$) $f:\R\to\R$ \quad and \quad ($\beta$) $f$ is 1-1.\\
\\
{\it Proof of ($\alpha$):}\\
{\bf Want:}\quad (a) $f\hbox{ is a function}$ \quad and \quad (b) $\D_f=\R$ \quad and \quad (c) $\I_f=\R$.\\
\\
{\it Proof of (a):}\\
{\bf Want:}$\forall x,y,z$, $\,\,$ $(\,(f_x=y)\,\&\,(f_x=z)\,)\,\Rightarrow\,(\,y=z\,)$.\\
Given $x,y,z$. Assume: $(f_x=y)\,\&\,(f_x=z)$. {\bf Want:} $y=z$.\\
We have $y=f_x=z$.\\
{\it End of proof of (a).}\\
\\
{\it Proof of (b):}\\
Since $f:\R\to\R$, we get $\D_f=\R$.\\
{\it End of proof of (b).}\\
\\
{\it Proof of (c):}\\
Since $f:\R\to\R$, we get $\I_f\subseteq\R$.\\
{\bf It remains to show} that $\R\subseteq\I_f$.\\
{\bf Want:}\quad $\forall y\in\R$, $\,$ $y\in\I_f$.\\
Given $y\in\R$. \quad {\bf Want:} $y\in\I_f$.\\
{\bf Want:}$\exists x\in\D_f$ s.t.~$y=f_x$.\\
Since $f:\R\to\R$, we get $\D_f=\R$.\\
Let $x:=\sqrt[3]{y}$. Then $x\in\R=\D_f$. {\bf Want:} $y=f_x$.\\
We have $y=(\sqrt[3]{y})^3=x^3=f_x$.\\
{\it End of proof of (c).}\\
\\
{\it End of proof of ($\alpha$).}\\
\\
{\it Proof of ($\beta$):}\\
{\bf Want:}$\forall w,x\in\D_f$, $\,$ $(\,f_w=f_x\,)\,\Rightarrow\,(\,w=x\,)$.\\
Given $w,x\in\D_f$. Assume $f_w=f_x$. {\bf Want:} $w=x$.\\
We have $w=\sqrt[3]{w^3}=\sqrt[3]{f_w}=\sqrt[3]{f_x}=\sqrt[3]{x^3}=x$.\\
{\it End of proof of ($\beta$).}
\end{proof}

\noindent
The next two theorems are quantified equivalences for equality of functions.
In the first, we assume we have a common domain.
In the second, we only assume we have a common superdomain.

\begin{thm}
Let $A$ be a set. Let $\phi$ and $\psi$ be functions.\\
\phx\qquad Assume $\D_\phi=A$ and $\D_\psi=A$.\\
\phx\qquad Then $(\,\,\phi=\psi\,\,)\,\,\Leftrightarrow\,\,(\,\,\forall x\in A,\,\,\,\,\phi_x\,=\,\psi_x\,\,)$.
\end{thm}

\begin{thm}
Let $S$ be a set. Let $\phi$ and $\psi$ be functions.\\
\phx\qquad Assume $\D_\phi\subseteq S$ and $\D_\psi\subseteq S$.\\
\phx\qquad Then $(\,\,\phi=\psi\,\,)\,\,\Leftrightarrow\,\,(\,\,\forall x\in S,\,\,\,\,\phi_x\,\,=\!\!\!\!\!{}^*\,\,\,\,\psi_x\,\,)$.
\end{thm}

\noindent
It a basic property of the real numbers that:\\
\phx\qquad $\forall x\in\R$, \qquad $x^2/x\,=\,x^3/x^2$.\\
This property is used in the proof of the following theorem:

\begin{thm}
Define $f,g:\R\drta\R$ by:\\
\phx\qquad $\forall x\in\R$, \qquad $f(x)\,=\,x^2/x$ \quad and \quad $g(x)\,=\,x^3/x^2$.\\
Then $f=g$.
\end{thm}

\begin{proof}
Since $f,g:\R\drta\R$, we get $\D_f\subseteq\R$ and $\D_g\subseteq\R$.\\
{\bf Want:}\qquad $\forall x\in\R$, \quad $f_x\,=\,g_x$.\\
Given $x\in\R$. \qquad {\bf Want:} $f_x\,=\,g_x$.\\
We have $f_x\,=\,x^2/x\,=\,x^3/x^2\,=\,g_x$.
\end{proof}

\noindent
We talked about various ways of picturing functions.

\begin{defn}
Let $f$ be a function, $A$ a set. Then:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\boxed{f_*A}:=\{f_x\,|\,x\in A\cap\D_f\}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\boxed{f^*A}:=\{x\in\D_f\,|\,f_x\in A\}$.
\end{defn}

\noindent
Alternate notation: $\boxed{f_*(A)}$ and $\boxed{f^*(A)}$.\\
We do NOT use $f(A)$ and $f^{-1}(A)$.\\
\\
We discussed how to picture $f_*A$ and $f^*A$.\\
The set $f_*A$ is called the $f$-\bfindex[forward-image of $A$].\\
The set $f^*A$ is called the $f$-\bfindex[pre-image of $A$]
\\

\begin{thm}
\phx\qquad Let $f:=\left(\begin{tabular}{c}$1\mapsto4$\\$2\mapsto6$\\$3\mapsto8$\\$9\mapsto8$\end{tabular}\right)$.\\
\\
Then \quad $f_*\{0,1,2\}=\{4,6\}$ \quad and \quad $f^*\{6,7,8\}=\{2,3,9\}$.
\end{thm}

\begin{defn}
$\forall a,b$, $\,$ by $\boxed{a\equiv b}$, we mean: $a=b\ne\frownie$.
\end{defn}

\begin{thm}
$\forall a,b$, $\,$ $(\,a\equiv b\,)\Rightarrow(\,a\ne\frownie\ne b\,)$.
\end{thm}

\noindent
We have quantified equivalences for $y\in f_*S$:

\begin{thm}
Let $f$ be a function, $S$ a set, $y$ an object. Then:\\
\phx\qquad $(\,y\in f_*S\,)\,\Leftrightarrow\,(\,\exists x\in S\cap\D_f~\hbox{s.t.}~f_x=y\,)\,\Leftrightarrow\,(\,\exists x\in S~\hbox{s.t.}~f_x\equiv y\,)$.
\end{thm}

\noindent
We have an equivalence for $y\in f^*S$:

\begin{thm}
Let $f$ be a function, $S$ a set, $x$ an object. Then:\\
\phx\qquad $(\,x\in f^*S\,)\,\Leftrightarrow\,(\,f_x\in S\,)$.
\end{thm}

We omitted formal proofs of the preceding two theorems, but used pictures to motivate them.

In the following, the set $f^*\{y\}$ is called the $f$-\bfindex[fiber over $y$].\\
We justified that terminology with a picture.

\begin{thm}
Let $f$ be a function, $x,y$ objects. Then:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,x\in f^*\{y\}\,)\,\Leftrightarrow\,(\,f_x=y\,)$.
\end{thm}

\begin{proof}
We have $(\,x\in f^*\{y\}\,)\,\Leftrightarrow\,(\,f_x\in\{y\}\,)\,\Leftrightarrow\,(\,f_x=y\,)$.
\end{proof}

\noindent
We define \bfindex[agreement, on a set, of two functions]:

\begin{defn}
Let $f$ and $g$ be functions and let $S$ be a set.\\
By {\bf on $S$, $f=g$}, we mean: $\forall x\in S$, $f_x=g_x$.
\end{defn}

\noindent
Note that, for any two functions $f$ and $g$, for any set $S$,\\
\phx\qquad if \qquad on $S$, $f=g$, \qquad then \qquad $S\subseteq\D_f\cap\D_g$.

\begin{thm}
Let $f$ be a function. Then $f_{\frownie}=\frownie$.
\end{thm}

\begin{proof}
By definition, we have $f_{\frownie}=\UE(\VL_{\frownie}^f)$.\\
By \tref{thm-VL-sub-frownie-is-empty}, $\VL_{\frownie}^f=\emptyset$. \quad
Then $f_{\frownie}=\UE(\emptyset)=\frownie$.
\end{proof}

\subsection{Restriction of functions}
\quad
\vskip.1in\noindent
We next define the \bfindex[restriction of $f$ to a subset of $\D_f$]:

\begin{defn}
Let $f$ be a function, $S\subseteq\D_f$.\\
\phx\qquad Then $\boxed{f|S}:S\to\I_f$ is defined by: $\forall x\in S$, $(f|S)_x=f_x$.
\end{defn}

\noindent
We defined $f:\R\to\R$ by $\forall x\in\R$, $f_x=x^2$.\\
We graphed $f$ and noted that $f$ is NOT 1-1.\\
We graphed $f|[0;\infty)$ and noted that $f|[0;\infty)$ IS 1-1.

\noindent
We next define \bfindex[restriction, $f\subseteq g$]:

\begin{defn}
Let $f$ and $g$ be functions.\\
\phx\qquad\qquad By $\boxed{f\subseteq g}$, we mean: \quad $(\,\,\D_f\subseteq\D_g\,\,)\,\,\&\,\,(\,\,g|\D_f=f\,\,)$.
\end{defn}

\noindent
We next define \bfindex[extension, $g\supseteq f$]:

\begin{defn}
Let $f$ and $g$ be functions.\\
\phx\qquad\qquad By $\boxed{g\supseteq f}$, we mean: \quad $(\,\,\D_f\subseteq\D_g\,\,)\,\,\&\,\,(\,\,g|\D_f=f\,\,)$.
\end{defn}

\noindent
Note: $(\,f\subseteq g\,)\,\Leftrightarrow\,(\,g\supseteq f\,)$.\\
\\
Unassigned HW:

\begin{thm}
$\forall$function $g$, $\forall S\subseteq\D_g$, $g|S\subseteq g$.
\end{thm}

\subsection{Composition of functions}

\begin{defn}
Let $f$ and $g$ be functions. Then:\\
\phx\qquad $\boxed{g\circ f}$ is the function defined by:\\
\phx\qquad\qquad\qquad $\forall x$, \quad $(g\circ f)_x:=g_{f_x}$
\end{defn}

\noindent
We read $g\circ f$ as ``$f$ then $g$'' or $g$ \bfindex[compose] $f$''.\\
The function $g\circ f$ is called the \bfindex[composition] of $g$ and $f$.

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$1\mapsto7$\\$3\mapsto3$\\$8\mapsto6$\\$9\mapsto2$\end{tabular}\right)$ and $g:=\left(\begin{tabular}{c}$2\mapsto0$\\$3\mapsto9$\\$4\mapsto5$\end{tabular}\right)$.\\
\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $g\circ f=\left(\begin{tabular}{c}$3\mapsto9$\\$9\mapsto0$\end{tabular}\right)$.
\end{thm}

\begin{thm}
Let $f$ and $g$ be functions. Then:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\D_{g\circ f}=f^*(\D_g)$ \quad and \quad $\I_{g\circ f}=g_*(\I_f)$.
\end{thm}

\begin{thm}\wrlab{thm-composition-preserves-type}
Let $A$, $B$, $C$ be sets,  $f$, $g$ be functions. Then:\\
\phx (1) $[\,(\,(\,f:A\drta B\,)\,\&\,(\,g:B\drta C\,)\,)\,\Rightarrow\,(\,g\circ f:A\drta C\,)\,]$ \quad and\\
\phx (2) $[\,(\,(\,f:A\,\to\,B\,)\,\&\,(\,g:B\,\to\,C\,)\,)\,\Rightarrow\,(\,g\circ f:A\,\to\,C\,\,)\,]$ \quad and\\
\phx (3) $[\,(\,(\,f:A\,\hookrightarrow\,B\,)\,\&\,(\,g:B\,\hookrightarrow\,C\,)\,)\,\Rightarrow\,(\,g\circ f:A\,\hookrightarrow C\,\,)\,]$ \quad and\\
\phx (4) $[\,(\,(f:A\,\to\!>B\,)\,\&\,(\,g:B\to\!>C\,)\,)\,\Rightarrow\,(\,g\circ f:A\to\!>C\,)\,]$ \quad and\\
\phx (5) $[\,(\,(f:A\,\hookrightarrow\!>B\,)\,\&\,(\,g:B\hookrightarrow\!>C\,)\,)\,\Rightarrow\,(\,g\circ f:A\hookrightarrow\!>C\,)\,]$.
\end{thm}

\subsection{Identity and inverse and characteristic functions}

The function $\id^A$ in the next definition is called
the \bfindex[identity function] on $A$.

\begin{defn}
Let $A$ be a set.\\
\phx\qquad\quad Then $\boxed{\id^A}:A\to A$ is defined by: \qquad $\forall x\in A$, \quad $\id^A_x=x$.
\end{defn}

\begin{thm}
\qquad $\id^{\{2,4,6\}}=\left(\begin{tabular}{c}$2\mapsto2$\\$4\mapsto4$\\$6\mapsto6$\end{tabular}\right)$.
\end{thm}

\begin{thm}
\qquad $\id^{\{2,4,6\}}_7=\frownie$ \qquad and \qquad $\id^{\{2,4,6\}}_4=4$.
\end{thm}

\begin{thm}
\qquad $\id^\R_4=4$ \qquad and \qquad $\id^\R_{\{4\}}=\frownie$.
\end{thm}

\begin{thm}
\qquad $\id^{\R_0^\times}_4=4$ \qquad and \qquad $\id^{\R_0^\times}_0=\frownie$.
\end{thm}

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$1\mapsto4$\\$2\mapsto6$\\$3\mapsto8$\end{tabular}\right)$ and $g:=\left(\begin{tabular}{c}$4\mapsto1$\\$6\mapsto2$\\$8\mapsto3$\end{tabular}\right)$.\\
\phx\qquad Then: $g\circ f=\left(\begin{tabular}{c}$1\mapsto1$\\$2\mapsto2$\\$3\mapsto3$\end{tabular}\right)=\id^{\{1,2,3\}}=\id^{\D_f}$ \qquad and\\
\phx\qquad\qquad\quad $f\circ g=\left(\begin{tabular}{c}$4\mapsto4$\\$6\mapsto6$\\$8\mapsto8$\end{tabular}\right)=\id^{\{4,6,8\}}=\id^{\D_g}$.
\end{thm}

\begin{thm}\wrlab{thm-1rtinv-inj-2leftinv-surj}
Let $A,B$ be sets. Let $f:A\to B$, $g:B\to A$.\\
Assume $g\circ f=\id^A$. Then: (1) $f:A\hookrightarrow B$ \quad and \quad (2) $g:B\to>A$.
\end{thm}

\begin{proof}
{\it Proof of (1):}\\
{\bf Want:}$\forall w,x\in\D_f$, $(f_w=f_x)\Rightarrow(w=x)$.\\
Given $w,x\in\D_f$. Assume $f_w=f_x$. {\bf Want:} $w=x$.\\
Since $w,x\in\D_f=A$, we get $(g\circ f)_w=\id^A_w$ and $(g\circ f)_x=\id^A_x$.\\
Then $w=\id^A_w=(g\circ f)_w=g_{f_w}=g_{f_x}=(g\circ f)_x=\id^A_x=x$.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}\\
{\bf Want:}$\I_g=A$. Since $g:B\to A$, we know: $\I_g\subseteq A$. {\bf Want:} $A\subseteq\I_g$.\\
{\bf Want:}$\forall x\in A$, $x\in\I_g$. \quad Given $x\in A$. {\bf Want:} $x\in\I_g$.\\
Since $x\in A=\D_f$, we get $f_x\in\I_f$.\\
Let $y:=f_x$. \quad Then $y\in\I_f$.\\
Then $y\in\I_f\subseteq B=\D_g$. \quad Then $g_y\in\I_g$.\\
We have $g_y=g_{f_x}=(g\circ f)_x=\id^A_x=x$. \quad Then $g_y=x$.\\
Then $x=g_y\in\I_g$.\\
{\it End of proof of (2).}
\end{proof}

\begin{thm}\wrlab{thm-exists-inverse-implies-bijection}
Let $A,B$ be sets, $f:A\to B$.\\
\phx\quad Assume: $\exists g:B\to A$ s.t. $(\,\,g\circ f=\id^A\,\,)\,\,\&\,\,(\,\,f\circ g=\id^B\,\,)$.\\
\phx\quad Then $f:A\hookrightarrow>B$.
\end{thm}

\begin{proof}
Since $g\circ f=\id^A$, by (1) of \tref{thm-1rtinv-inj-2leftinv-surj}, $f:A\hookrightarrow B$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad {\bf Want:} $f:A\to>B$.\\
Since $f\circ g=\id^B$, by (2) of \tref{thm-1rtinv-inj-2leftinv-surj}, $f:A\to>B$.
\end{proof}

The function $f^{-1}$ below is called
the \bfindex[inverse function] of $f$.

\begin{defn}
Let $f$ be a 1-1 function.\\
\phx\qquad Then $\boxed{f^{-1}}:\I_f\to\D_f$ is defined by: \quad $\forall y\in\I_f$, $\,$ $f^{-1}_y=\UE(f^*\{y\})$.
\end{defn}

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$1\mapsto4$\\$2\mapsto6$\\$3\mapsto8$\end{tabular}\right)$.\\
\\
\phx\qquad\qquad\qquad Then: $f^{-1}_4=\UE(f^*\{4\})=\UE\{1\}=1$.
\end{thm}

\begin{thm}
Let $f:=\left(\begin{tabular}{c}$1\mapsto4$\\$2\mapsto6$\\$3\mapsto8$\end{tabular}\right)$ and $g:=\left(\begin{tabular}{c}$4\mapsto1$\\$6\mapsto2$\\$8\mapsto3$\end{tabular}\right)$.\\
\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\quad Then: $g=f^{-1}$ and $f=g^{-1}$.
\end{thm}

\begin{thm}
Let $f$ be a 1-1 function.\\
\phx\qquad Then: \qquad $\forall x\in\D_f$, \quad $f^{-1}_{f_x}=x$.\\
\phx\qquad Also: \qquad $\forall y\in\I_f$, \quad $f_{f^{-1}_y}=y$.
\end{thm}

\begin{defn}
Let $S$ be a set and let $A\subseteq S$.\\
Then $\boxed{\chi_A^S}:S\to\{0,1\}$ is defined by:\\
\\
\phx\qquad\qquad $\forall q\in S$, \qquad $\chi_A^S(q)=
\begin{cases}1,&\hbox{if }q\in A\\0,&\hbox{if }q\notin A.\end{cases}$
\end{defn}

The function $\chi_A^S$, from the preceding definition,
is called the \bfindex[characteristic function] of $A$ in $S$.

\subsection{The axiom of choice}
\quad
\vskip.1in\noindent
We imagine that at the beginning of time,\\
the Grand Oracle has chosen,\\
\phx\qquad from every nonempty set $A$, an element denoted $\CH_A$.\\
This is embodied in the \bfindex[Axiom of Choice]:

\begin{axiom}
$\forall$nonempty set $S$, \quad $\CH_S\in S$.
\end{axiom}

\noindent
We also make the convention that $\CH_\emptyset=\frownie$.\\
\\
Alternate notation for $\CH_S$: $\CH(S)$ or $\CH S$.\\
\\
Then: $\forall$set $S$, we have: $\CH_S\,\,\,{}^*\!\!\in\,\,S$.

\begin{thm}
$\CH\{4\}=4$ \quad and $\CH\,\{\,\{1,2,3\,\}\,\}\,=\,\{1,2,3\}$.
\end{thm}

The chosen element of any singleton set is its unique element:

\begin{thm}
$\forall x$, $\CH\{x\}=x=\UE\{x\}$.
\end{thm}

For sets with more than one element,
we do not know which is chosen, but we do know that one of them is:

\begin{thm}
$(\,\CH\{2,3\}=2\,)\,\vee\,(\,\CH\{2,3\}=3\,)$.
\end{thm}

\begin{thm}\phx\\
\phx\qquad$(\,\CH\{2,3,5\}=2\,)\,\vee\,(\,\CH\{2,3,5\}=3\,)\,\vee\,(\,\CH\{2,3,5\}=5\,)$.
\end{thm}

\subsection{The world of sets - part 1}

\begin{thm}
Let $A$ be a set.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\id^A:A\hookrightarrow>A$.
\end{thm}

\begin{thm}
Let $A,B$ be sets, $f:A\hookrightarrow>B$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $f^{-1}:B\hookrightarrow>A$.
\end{thm}

By (5) of \tref{thm-composition-preserves-type}, we have:

\begin{thm}
Let $A,B,C$ be sets, $f:A\hookrightarrow\!>B$, $g:B\hookrightarrow\!>C$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $g\circ f:A\hookrightarrow\!>C$.
\end{thm}

\begin{defn}
Let $A,B$ be sets. Then:\\
\phx\qquad $\boxed{\exists A\hookrightarrow B}$ means: $\exists$a function $f$ s.t.~$f:A\hookrightarrow B$ \qquad and\\
\phx\qquad $\boxed{\exists A\to>B}$ means: $\exists$a function $f$ s.t.~$f:A\to>B$ \qquad and\\
\phx\qquad $\boxed{\exists A\hookrightarrow>B}$ means: $\exists$a function $f$ s.t.~$f:A\hookrightarrow>B$.
\end{defn}

\begin{thm}\phx\\
\phx\quad $\forall$set $A$, \quad $\exists A\hookrightarrow>A$.\\
\phx\quad $\forall$sets $A,B$, \quad $(\,\exists A\hookrightarrow>B\,)\,\Rightarrow\,(\,\exists B\hookrightarrow>A\,)$.\\
\phx\quad $\forall$sets $A,B,C$,
\quad $(\,(\,\exists A\hookrightarrow>B\,)\,\&\,(\,\exists B\hookrightarrow>C\,)\,)\,\Rightarrow\,(\,\exists A\hookrightarrow>C\,)$.
\end{thm}

\begin{thm}\wrlab{thm-surjection-gives-injection}
Let $A,B$ be sets, $g:B\to>A$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\exists f:A\to B$ s.t.~$g\circ f=\id^A$. 
\end{thm}

\begin{proof}\phx\\
{\it Claim:} $\forall x\in A$, $g^*\{x\}\ne\emptyset$.\\
{\it Proof of claim:}\\
Given $x\in A$. \quad {\bf Want:} $g^*\{x\}\ne\emptyset$.\\
Since $g:B\to A$, we get $\I_g=A$.\\
Since $x\in A=\I_g$, we get $x\in\I_g$.\\
Since $x\in\I_g$, choose $y\in\D_g$ s.t.~$g_y=x$.\\
Since $g_y=x$, we get $y\in g^*\{x\}$. \quad Then $g^*\{x\}\ne\emptyset$.\\
{\it End of proof of claim.}\\
\\
Since $g:B\to A$, we get $\D_g=B$.\\
Then: $\forall$set $S$, $g^*(S)\subseteq B$.\\
So, from the claim and the axiom of choice, we conclude:\\
\phx\qquad $\forall x\in A$, \quad $\CH_{g^*\{x\}}\in g^*\{x\}$.\\
Then: \qquad $\forall x\in A$, \quad $\CH_{g^*\{x\}}\in g^*\{x\}\subseteq B$.\\
Define $f:A\to B$ by: $\forall x\in A$, $f_x=\CH_{g^*\{x\}}$.\\
Then $f:A\to B$. \quad {\bf Want:} $g\circ f=\id^A$.\\
Since $f:A\to B$ and $g:B\to A$, we get $g\circ f:A\to A$.\\
Then $\D_{g\circ f}=A$. \quad Also, $\D_{\id^A}=A$. \quad {\bf Want:} $\forall x\in A$, $(g\circ f)_x=\id_x^A$.\\
Given $x\in A$. \quad {\bf Want:} $(g\circ f)_x=\id_x^A$. \quad {\bf Want:} $g_{f_x}=x$.\\
Let $y:=f_x$. \quad {\bf Want:} $g_y=x$.\\
Since $y=f_x=\CH_{g^*\{x\}}\in g^*\{x\}$, we get $y\in g^*\{x\}$.\\
Since $y\in g^*\{x\}$, we get $g_y\in\{x\}$. \quad Then $g_{f_x}=x$.
\end{proof}

\begin{thm}\wrlab{thm-exists-surj-implies-exists-reverse-inj}
Let $A,B$ be sets. \quad Assume: $\exists B\to\!>A$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad Then: \quad $\,\exists A\,\hookrightarrow\,B$.
\end{thm}

\begin{proof}
{\bf Want:}$\exists$function $f$ s.t.~$f:A\hookrightarrow B$.\\
Since $\exists B\to\!>A$, choose a function $g$ s.t.~$g:B\to\!>A$.\\
By \tref{thm-surjection-gives-injection}, choose $f:A\to B$ s.t.~$g\circ f=\id^A$.\\
Then $f$ is a function. \quad {\bf Want:} $f:A\hookrightarrow B$.\\
By (1) of \tref{thm-1rtinv-inj-2leftinv-surj}, $f:A\hookrightarrow B$.
\end{proof}

\begin{thm}\wrlab{thm-injection-gives-surjection}
Let $A,B$ be sets, $f:A\hookrightarrow B$.\\
\phx\qquad Assume $A\ne\emptyset$. \quad Then $\exists g:B\to A$ s.t.~$g\circ f=\id^A$.
\end{thm}

\begin{proof}
Since $f$ is 1-1, we know: \qquad $\forall x\in\D_f$, \quad $f^{-1}_{f_x}=x$.\\
Since $A\ne\emptyset$, choose $w$ s.t.~$w\in A$.\\
\\
Define $g:B\to A$ by: \quad $\forall y\in B$, $\,$ $\ds{g_y=\begin{cases}f^{-1}_y,&\hbox{if }y\in\I_f\\w,&\hbox{if }y\notin\I_f.\end{cases}}$\\
\\
Then $g:B\to A$. \quad {\bf Want:} $g\circ f=\id^A$.\\
Since $f:A\to B$ and $g:B\to A$, we get $g\circ f:A\to A$.\\
Then $\D_{g\circ f}=A$. \quad Also, $\D_{\id^A}=A$. \quad {\bf Want:} $\forall x\in A$, $(g\circ f)_x=\id_x^A$.\\
Given $x\in A$. \quad {\bf Want:} $(g\circ f)_x=\id_x^A$. \quad {\bf Want:} $g_{f_x}=x$.\\
Let $y:=f_x$. \quad {\bf Want:} $g_y=x$.\\
Since $x\in A=\D_f$, we get $f_x\in\I_f$ and $f^{-1}_{f_x}=x$.\\
Since $y=f_x\in\I_f$, by definition of $g$, we get $g_y=f^{-1}_y$.\\
Then $g_y=f^{-1}_y=f^{-1}_{f_x}=x$.
\end{proof}

\begin{thm}
Let $A,B$ be sets. \quad Assume: $\exists\,A\hookrightarrow\,B$.\\
\phx\qquad\qquad\qquad\qquad\quad$\,$ Assume $A\ne\emptyset$. \quad Then: \quad $\exists B\to\!>A$.
\end{thm}

\begin{proof}
{\bf Want:}$\exists$function $g$ s.t.~$g:B\to>A$.\\
Since $\exists A\hookrightarrow B$, choose a function $f$ s.t.~$f:A\hookrightarrow B$.\\
By \tref{thm-injection-gives-surjection}, choose $g:B\to A$ s.t.~$g\circ f=\id^A$.\\
Then $g$ is a function. \quad {\bf Want:} $g:B\to>A$.\\
By (2) of \tref{thm-1rtinv-inj-2leftinv-surj}, $g:B\to>A$.
\end{proof}

\subsection{Sequences and zero-sequences}

\begin{defn}
Let $s$ be an object.\\
By $s$ is a \bfindex[sequence], we mean:\\
\phx\qquad\qquad $s$ is a function \quad and \quad $\D_s=\N$.\\
By $s$ is a \bfindex[zero-sequence], we mean:\\
\phx\qquad\qquad $s$ is a function \quad and \quad $\D_s=\N_0$.
\end{defn}

\noindent
Let $s$ be a sequence.
Then $s$ is denoted $\boxed{(s_1,s_2,s_3,\ldots)}$.\\
\\
To say ``Let $s:=(1,1/2,1/3,1/4,\ldots)$''\\
is equivalent to saying ``Define $s:\N\to\R$ by: $\forall j\in\N$, $s_j=1/j$''.\\
\\
Let $s$ be a zero-sequence.
Then $s$ is denoted $\boxed{{}_0(s_0,s_1,s_2,s_3,\ldots)}$.\\
\\
To say ``Let $s:={}_0(1,2,4,8,16,32,64,\ldots)$''\\
is equivalent to saying ``Define $s:\N_0\to\R$ by: $\forall j\in\N_0$, $s_j=2^j$''.

\begin{defn}
Let $f$ be a function, $j\in\N_0$. Then:\\
\\
\phx\qquad $\boxed{f_\circ^j}\quad:=\quad\begin{cases}
\id^{\D_f},&\hbox{if }j=0\\
f,&\hbox{if }j=1\\
f\circ f,&\hbox{if }j=2\\
f\circ f\circ f,&\hbox{if }j=3\\
f\circ f\circ f\circ f,&\hbox{if }j=4\\
\quad\vdots&\qquad\qquad.
\end{cases}$
\end{defn}

\begin{defn}
Let $A$ be a set, $f:A\to A$, $x\in A$.\\
\phx\quad Define $s:\N_0\to A$ by: $\forall j\in\N_0$, $s_j=f_\circ^j(x)$.\\
\phx\quad Then $s$ is called the \bfindex[semi-forward-orbit] of $x$ under $f$.
\end{defn}

\begin{thm}
Define $f:\R\to\R$ by: $\forall x\in\R$, $f_x=2x$.\\
\phx\qquad Let $s$ be the semi-forward-orbit of $1$ under $f$.\\
\phx\qquad Then $s\,=\,{}_0(\,1\,,\,2\,,\,4\,,\,8\,,\,16\,,\,32\,,\,\ldots\,)$.
\end{thm}

\begin{thm}
Let $A$ be a set, $f:A\to A$, $x\in A$.\\
\phx\quad Let $s$ be the semi-forward-orbit of $x$ under $f$.\\
\phx\quad Then: \quad $(\,\,s_0=x\,\,)\,\,\&\,\,(\,\,\forall j\in\N_0,\,s_{j+1}=f_{s_j}\,\,)$.
\end{thm}

\begin{defn}
Let $A$ be a set, $f:A\to A$, $x\in A$.\\
\phx\quad Let $s$ be the strict-forward-orbit of $\sqrt{5}$ under $f$.\\
\phx\quad Then $s$ is called the \bfindex[strict-forward-orbit] of $x$ under $f$.
\end{defn}

\begin{thm}
Define $f:\R\to\R$ by: $\forall x\in\R$, $f_x=x+1$.\\
\phx\qquad Define $s\in\R^\N$ by: $\forall j\in\N$, $s_j=f_\circ^j(\sqrt{5})$.\\
\phx\qquad Then $s\,=\,(\,\sqrt{5}+1\,,\,\sqrt{5}+2\,,\,\sqrt{5}+3\,,\,\sqrt{5}+4\,,\,\sqrt{5}+5\,,\,\sqrt{5}+6\,,\,\ldots\,)$.
\end{thm}

\begin{thm}
Let $A$ be a set, $f:A\to A$, $x\in A$.\\
\phx\quad Let $s$ be the semi-forward-orbit of $x$ under $f$.\\
\phx\quad Then: \quad $(\,\,s_0=x\,\,)\,\,\&\,\,(\,\,\forall j\in\N_0,\,s_{j+1}=f_{s_j}\,\,)$.
\end{thm}

\subsection{Size of a set}

\begin{defn}
Let $A$ be a set. Then:\\
\phx\qquad\qquad\qquad\qquad $\boxed{\#A}\quad:=\quad\sup\{k\in\N_0\,|\,\exists[1..k]\hookrightarrow A\}$.
\end{defn}

\noindent
We have:\\
$[1..0]=\emptyset$. \qquad $\forall k\in\N,\,[1..k]=\{1,2,3,\ldots,k\}$.\\
$\exists[1..0]\hookrightarrow\emptyset$.\\
$\forall k\in\N$, $\not\exists[1..k]\hookrightarrow\emptyset$.

\begin{thm}
$\#\emptyset=0$.
\end{thm}

\noindent
We have:
$\forall k\in\N$, $[1..k]=\{1,2,3,\ldots,k\}$.\\
$2\cdot\N=\{2,4,6,8,\ldots\}$.\\
$\forall k\in[0..4], \exists[1..k]\hookrightarrow\{1,5,8,9\}$.\\
$\forall k\in[5..\infty),\,\not\exists[1..k]\hookrightarrow\{1,5,8,9\}$.\\
$\forall k\in[0..50],\,\exists[1..k]\hookrightarrow\{2,4,6,8,\ldots,100\}$.\\
$\forall k\in[51..\infty),\,\not\exists[1..k]\hookrightarrow\{2,4,6,8,\ldots,100\}$.\\
$\forall k\in\N_0,\,\exists[1..k]\hookrightarrow2\cdot\N$.

\begin{thm}\phx\\
\phx\qquad\qquad\qquad $\#\{1,5,8,9\}=4$ \qquad and\\
\phx\qquad\qquad\qquad $\#\{2,4,6,8,\ldots,100\}=50$ \qquad and\\
\phx\qquad\qquad\qquad $\#2\cdot\N=\infty$.
\end{thm}

\begin{thm}
$\#\N=\#\N_0=\#\Z=\#\Q=\#\R=\infty$.
\end{thm}

\begin{defn}
Let $A$ be a set.\\
\phx\qquad\qquad By $A$ is \bfindex[finite], we mean: $\#A<\infty$.\\
\phx\qquad\qquad By $A$ is \bfindex[infinite], we mean: $\#A=\infty$.
\end{defn}

\subsection{The world of sets - part 2}

\begin{thm}
Let $S$ and $T$ be sets.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then: \quad $\exists S\hookrightarrow T$ \quad or \quad $\exists T\hookrightarrow S$.
\end{thm}

\noindent
We omit the proof of the preceding theorem.\\
\\
We organize ``The World of Sets'' in such a way that\\
for any two sets $S$ and $T$,\\
\phx\qquad\qquad ( $S$ appears above $T$ ) iff ( $\exists S\hookrightarrow T$ but not $\exists T\hookrightarrow S$ )\\
\phx\quad and\\
\phx\qquad\qquad ( $T$ appears above $S$ ) iff ( $\exists T\hookrightarrow S$ but not $\exists S\hookrightarrow T$ )\\
\phx\quad and\\
\phx\qquad\qquad ( $S$ appears side-by-side with $T$ ) iff ( $\exists S\hookrightarrow T$ and $\exists T\hookrightarrow S$ ).\\
\\
According to our next result, that last condition\\
\phx\qquad\qquad\qquad\qquad $\exists S\hookrightarrow T$ \quad and \quad $\exists T\hookrightarrow S$\\
is equivalent to\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\exists S\hookrightarrow>T$.\\
So two sets appear side-by-side iff they are bijective.\\
\\
The following is called the \bfindex[Schroeder-Bernstein Theorem],

\begin{thm}
Let $S$ and $T$ be sets.\\
\phx\qquad\qquad\qquad\qquad\quad$\,$ Assume: $(\,\,\qquad\exists S\hookrightarrow T\,\,)\,\,\,\&\,\,(\,\,\exists T\hookrightarrow S\,\,)$.\\
\phx\qquad\qquad\qquad\qquad\quad$\,$ Then: \qquad\qquad\qquad$\,$ $\exists S\hookrightarrow>T$.
\end{thm}

\noindent
We omit the proof of the preceding theorem.\\
\\
We picture The World of Sets, starting with $\emptyset$ at the bottom.\\
By itself, it occupies the lowest level in The World of Sets.\\
Then the singleton sets are all side-by-side, just above the lowest level.\\
On the next level up are all sets with two elements.\\
On the next level up are all sets with three elements.\\
Next is an ellipsis, $\vdots$ indicating all the levels of finite sets.\\
Next is a horizontal line dividing finite sets from infinite sets.\\
Somewhere above that line appears $\N$.
\\
First question: Are there any infinite sets that are strictly below $\N$.\\
The next theorem answers that in the negative:

\begin{thm}
$\forall$set $S$, \quad $(S\hbox{ is infinite})\Leftrightarrow(\exists\N\hookrightarrow S)$.
\end{thm}

\noindent
We omit the proof of the preceding theorem.\\
\\
So, in The World of Sets, the level with $\N$ is the lowest level that is above the
dividing line between finite and infinite sets.
We draw a line just above that level.
Any set below that line is referred to as a countable set,
and any set above that line is said to be uncountable.
Any set on the same level with $\N$ is called countably infinite.
Formally:

\begin{defn}
Let $S$ be a set. Then:\\
\phx\qquad\qquad $S$ is \bfindex[countable] means: \qquad\qquad $\,\,\,\,\,\exists S\hookrightarrow\N$ \qquad and\\
\phx\qquad\qquad $S$ is \bfindex[uncountable] means: \qquad\quad $\,\,\,\,\not\exists S\hookrightarrow\N$ \qquad and\\
\phx\qquad\qquad $S$ is \bfindex[countably infinite] means: \quad $\exists S\hookrightarrow>\N$.
\end{defn}

\noindent
Note that, by Schroeder-Bernstein, a set is countably infinite iff it is both countable and infinite.\\
\\
Next question: Where do we place $\Q$?\\
\\
We first look at the set $\Q\cap(0;\infty)$ of positive rational numbers:

\begin{thm}\wrlab{thm-pos-ratls-ctbl}
$\exists\N\to>\Q\cap(0;\infty)$.
\end{thm}

\begin{proof}
The sequence\\
\phx\quad $(\,\,\,\,1/1\,\,\,\,,\,\,\,\,2/1,1/2\,\,\,\,,\,\,\,\,3/1,2/2,1/3\,\,\,\,,\,\,\,\,4/1,3/2,2/3,1/4,\,\,\,\,,\,\,\,\,\ldots\,\,\,\,)$\\
is a surjection $\N\to>S$. \quad
Then $\exists\N\to>\Q\cap(0;\infty)$.
\end{proof}

\noindent
By \tref{thm-exists-surj-implies-exists-reverse-inj}, \quad in The World of Sets,\\
\phx\qquad there are no surjections from a set to a set on a higher level.\\
Then \tref{thm-pos-ratls-ctbl} says that\\
\phx\qquad $\Q\cap(0;\infty)$ is either at the countable level with $\N$, or else below.\\
Unassigned HW: Show that $\Q\cap(0;\infty)$ is countably infinite.\\
\\
We next show that we place $\Q$ on the same level with $\N$,\\
that is, $\Q$ belongs on the level of countably infinite sets.

\begin{thm}\wrlab{thm-Q-ctbl}
The set $\Q$ is countable.
\end{thm}

\begin{proof}
By \tref{thm-pos-ratls-ctbl}, choose a function $s$ s.t.~$s:\N\rightarrow>\Q\cap(0;\infty)$.\\
Then the sequence\\
\phx\quad $(\quad0\quad,\quad s_1,-s_1\quad,\quad s_2,-s_2\quad,\quad s_3,-s_3\quad,\quad\ldots\quad)$\\
is a surjection $\N\to>\Q$. \quad
Then, by \tref{thm-exists-surj-implies-exists-reverse-inj}, $\exists\Q\hookrightarrow\N$.\\
Since $\id^\N:\N\hookrightarrow\Q$, we get $\exists\N\hookrightarrow\Q$.\\
Then, by Schroeder-Bernstein, $\exists\N\hookrightarrow>\Q$.
\end{proof}

\noindent
Next question: Where do we place $\N_0$ and $\Z$?\\
\\
The next theorem says that if three sets admit a cycle of injections,\\
then they admit a cycle of bijections:

\begin{thm}\wrlab{thm-inj-cycle-implies-bij-cycle}
Let $A,B,C$ be sets.\\
\phx\quad Assume $(\,\,\exists A\hookrightarrow B\,\,)\,\,\&\,\,(\,\,\exists B\hookrightarrow C\,\,)\,\,\&\,\,(\,\,\exists C\hookrightarrow A\,\,)$.\\
\phx\quad Then $(\,\,\exists A\hookrightarrow>B\,\,)\,\,\&\,\,(\,\,\exists B\hookrightarrow>C\,\,)\,\,\&\,\,(\,\,\exists C\hookrightarrow>A\,\,)$.
\end{thm}

\begin{proof}
By composition, since $(\,\,\exists B\hookrightarrow C\,\,)\,\,\&\,\,(\,\,\exists C\hookrightarrow A\,\,)$,\\
\phx\qquad we see that $\exists B\hookrightarrow A$.\\
So, since $\exists A\hookrightarrow B$, by Schroeder-Bernstein, we get: $\exists A\hookrightarrow>B$.\\
By composition, since $(\,\,\exists C\hookrightarrow A\,\,)\,\,\&\,\,(\,\,\exists A\hookrightarrow B\,\,)$,\\
\phx\qquad we see that $\exists C\hookrightarrow B$.\\
So, since $\exists B\hookrightarrow C$, by Schroeder-Bernstein, we get: $\exists B\hookrightarrow>C$.\\
{\bf It remains to show:} $\exists C\hookrightarrow>A$.\\
By composition, since $(\,\,\exists A\hookrightarrow B\,\,)\,\,\&\,\,(\,\,\exists B\hookrightarrow C\,\,)$,\\
\phx\qquad we see that $\exists A\hookrightarrow C$.\\
So, since $\exists C\hookrightarrow A$, by Schroeder-Bernstein, we get: $\exists C\hookrightarrow>A$.
\end{proof}

\begin{thm}\wrlab{thm-between-bijective-sets-implies-bijective-with-them}
Let $A,B,C$ be sets.\\
\phx\quad Assume $(\,\,A\subseteq B\subseteq C\,\,)\,\,\&\,\,(\,\,\exists A\hookrightarrow>C\,\,)$.\\
\phx\quad Then $(\,\,\exists A\hookrightarrow>B\,\,)\,\,\&\,\,(\,\,\exists B\hookrightarrow>C\,\,)$.
\end{thm}

\begin{proof}
Since $A\subseteq B\subseteq C$, we see that\\
\phx\qquad\qquad\qquad $\id^A:A\hookrightarrow B$ \quad and \quad $\id^B:B\hookrightarrow C$.\\
Then
\phx\qquad\qquad\quad $\exists A\hookrightarrow B$ \quad and \quad $\exists B\hookrightarrow C$.\\
Since $\exists A\hookrightarrow>C$, by inversion, we get $\exists C\hookrightarrow>A$.
Then $\exists C\hookrightarrow A$.\\
Then, by \tref{thm-inj-cycle-implies-bij-cycle},
$(\,\,\exists A\hookrightarrow>B\,\,)\,\,\&\,\,(\,\,\exists B\hookrightarrow>C\,\,)$.
\end{proof}

\begin{thm}
The sets $\N_0$ and $\Z$ are both countably infinite.
\end{thm}

\begin{proof}
By \tref{thm-Q-ctbl}, $\exists\N\hookrightarrow>\Q$.\\
Since $\N\subseteq\N_0\subseteq\Q$ and $\exists\N\hookrightarrow>\Q$,\\
\phx\quad we conclude, from \tref{thm-between-bijective-sets-implies-bijective-with-them} that $\exists\N\hookrightarrow>\N_0$.\\
Then $\N_0$ is countably ininite. {\bf Want:} $\Z$ is countably infinite.\\
Since $\N\subseteq\Z\subseteq\Q$ and $\exists\N\hookrightarrow>\Q$,\\
\phx\quad we conclude, from \tref{thm-between-bijective-sets-implies-bijective-with-them} that $\exists\N\hookrightarrow>\Z$.\\
Then $\Z$ is countably infinite.
\end{proof}

\noindent
In The World of Sets, we now see that\\
\phx\qquad $\N,\N_0,\Z,\Q$ are all on the countably infinite level.\\
Next question: Where do we place $\R$?

\begin{defn}
Let $A,B$ be sets. Then:\\
\phx\qquad\qquad $\boxed{B^A}\quad:=\quad\{\hbox{functions }f\,|\,f:A\to B\}$.
\end{defn}

\begin{defn}
Let $T$ be a set. Then:\\
\phx\qquad\qquad $\boxed{2^T}\quad:=\quad\{\hbox{sets }S\,|\,S\subseteq T\}$.
\end{defn}

\begin{thm}
$\{3,4,5\}^{\{1,2\}}\qquad=$\\
\phx\\
\phx\qquad  
$\bigg\{\quad
\left(\begin{tabular}{c}$1\mapsto3$\\$2\mapsto3$\end{tabular}\right)\quad,\quad
\left(\begin{tabular}{c}$1\mapsto3$\\$2\mapsto4$\end{tabular}\right)\quad,\quad
\left(\begin{tabular}{c}$1\mapsto3$\\$2\mapsto5$\end{tabular}\right)\quad,\\
\phx\qquad\quad\,\,\,\,
\left(\begin{tabular}{c}$1\mapsto4$\\$2\mapsto3$\end{tabular}\right)\quad,\quad
\left(\begin{tabular}{c}$1\mapsto4$\\$2\mapsto4$\end{tabular}\right)\quad,\quad
\left(\begin{tabular}{c}$1\mapsto4$\\$2\mapsto5$\end{tabular}\right)\quad,\\
\phx\qquad\quad\,\,\,\,
\left(\begin{tabular}{c}$1\mapsto5$\\$2\mapsto3$\end{tabular}\right)\quad,\quad
\left(\begin{tabular}{c}$1\mapsto5$\\$2\mapsto4$\end{tabular}\right)\quad,\quad
\left(\begin{tabular}{c}$1\mapsto5$\\$2\mapsto5$\end{tabular}\right)\quad\bigg\}$.
\end{thm}

\begin{thm}
Let $A,B$ be finite sets. Then $\#(B^A)=(\#B)^{\#A}$.
\end{thm}

\begin{thm}\wrlab{thm-01-to-789}
$\{0,1\}^{\{7,8,9\}}\qquad=$\\
\phx\\
\phx\quad
$\bigg\{\,
\left(\begin{tabular}{c}$7\mapsto0$\\$8\mapsto0$\\$9\mapsto0$\end{tabular}\right)\,,\,
\left(\begin{tabular}{c}$7\mapsto0$\\$8\mapsto0$\\$9\mapsto1$\end{tabular}\right)\,,\,
\left(\begin{tabular}{c}$7\mapsto0$\\$8\mapsto1$\\$9\mapsto0$\end{tabular}\right)\,,\,
\left(\begin{tabular}{c}$7\mapsto0$\\$8\mapsto1$\\$9\mapsto1$\end{tabular}\right)\,,\\
\phx\quad\,\,\,\,\,
\left(\begin{tabular}{c}$7\mapsto1$\\$8\mapsto0$\\$9\mapsto0$\end{tabular}\right)\,,\,
\left(\begin{tabular}{c}$7\mapsto1$\\$8\mapsto0$\\$9\mapsto1$\end{tabular}\right)\,,\,
\left(\begin{tabular}{c}$7\mapsto1$\\$8\mapsto1$\\$9\mapsto0$\end{tabular}\right)\,,\,
\left(\begin{tabular}{c}$7\mapsto1$\\$8\mapsto1$\\$9\mapsto1$\end{tabular}\right)\,\bigg\}$.
\end{thm}

\begin{thm}\wrlab{thm-01-to-S-bijection-2-to-S}
Let $S$ be a set.\\
\phx\qquad Then $f\,\,\mapsto\,\,f^*\{1\}\,\,:\,\,\{0,1\}^S\,\,\hookrightarrow>\,\,2^S$.
\end{thm}

\noindent
We omit the proof.\\
Applying \tref{thm-01-to-S-bijection-2-to-S} to the case $S=\{7,8,9\}$, we see:\\
\phx\qquad $f\,\,\mapsto\,\,f^*\{1\}\,\,:\,\,\{0,1\}^{\{7,8,9\}}\,\,\hookrightarrow>\,\,2^{\{7,8,9\}}$.\\
Since, in \tref{thm-01-to-789}, we calculated $\{0,1\}^{\{7,8,9\}}$,\\
in order to calculate $2^{\{7,8,9\}}$, we can simply, for each $f\in\{0,1\}^{\{7,8,9\}}$,\\
calculate $f^*\{1\}$, and assemble the resulting sets into a set of sets:

\begin{thm}\wrlab{thm-2-to-789}
$2^{\{7,8,9\}}\qquad=$\\
\phx\\
\phx\quad
$\bigg\{\qquad
\,\,\,\emptyset\qquad,\qquad
\,\,\,\,\{9\}\qquad,\qquad
\,\,\,\,\,\{8\}\qquad,\qquad
\,\,\,\,\,\,\{8,9\}\qquad,\\
\phx\qquad\qquad
\{7\}\qquad,\qquad
\{7,9\}\qquad,\qquad
\{7,8\}\qquad,\qquad
\{7,8,9\}\qquad\bigg\}$.
\end{thm}

\noindent
The following is a consequence of \tref{thm-01-to-S-bijection-2-to-S}:

\begin{thm}\wrlab{thm-01-to-S-bijective-2-to-S}
Let $S$ be a set.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\exists\,\,\{0,1\}^S\,\,\hookrightarrow>\,\,2^S$.
\end{thm}

\begin{thm}
Let $S$ be a set.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $x\,\,\mapsto\,\,\{x\}\,\,:\,\,S\,\,\hookrightarrow\,\,2^S$.
\end{thm}

\noindent
The preceding theorem is left as Unassigned HW.\\
The following is a consequence of the preceding theorem.

\begin{thm}
Let $S$ be a set.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\exists S\hookrightarrow 2^S$.
\end{thm}

\begin{thm}
Let $S$ be a set.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\not\exists2^S\hookrightarrow S$.
\end{thm}

\noindent
The preceding theorem is proved by ``Cantor diagonalization''.\\
That proof is omitted.\\
The preceding two theorems tell us that, in The World of Sets,\\
\phx\qquad for any set $S$, \quad $2^S$ must be placed strictly higher than $S$.\\
As a consequence, while $\emptyset$ is at the bottom of the World of Sets,\\
\phx\qquad there is no top to The World of Sets; that is,\\
\phx\qquad for any set $S$, the set $2^S$ is higher; moreover,\\
\phx\qquad\quad by \tref{thm-01-to-S-bijective-2-to-S}, \quad $2^S$ is side-by-side with $\{0,1\}^S$.\\
\\
For any two bijective sets $A$ and $B$,\\
\phx\quad $2^A$ and $2^B$ are bijective as well:

\begin{thm}
Let $A,B$ be sets.\\
\phx\qquad\qquad\qquad\qquad\quad  Assume $\exists A\hookrightarrow>B$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\,\,\,\,\,\exists2^A\hookrightarrow>2^B$.
\end{thm}

\noindent
The proof is an Unassigned HW.\\
\\
In The World of Sets, we create a level\\
\phx\qquad\qquad called the ``continuum cardinality'' level,\\
into which we place the sets $2^\N$, $2^{\N_0}$, $2^{\Z}$, $2^{\Q}$.\\
This level also has the sets $\{0,1\}^\N$, $\{0,1\}^{\N_0}$, $\{0,1\}^{\Z}$, $\{0,1\}^{\Q}$.\\
\\
NOTE: There is an Axiom of Set Theorem called the ``Continuum Hypothesis'', which states that
there are no sets strictly between countably infinite and continuum cardinality.
Some set-theorists may adopt this axiom, while others adopt its negation as an axiom.
In this course, we are agnostic about this question.\\
\\
We now turn to proving that $\R$ has continuum cardinality.

\begin{thm}\wrlab{thm-01-to-N-in-R}
$\exists\{0,1\}^\N\hookrightarrow\R$.
\end{thm}

\noindent
Idea of proof: The mapping which sends\\
\phx\qquad $f\in\{0,1\}^\N$ \quad to \quad the base ten number $0.f_1f_2f_3\cdots\in\R$\\
is an injection.\\
\\
NOTE: It is not surjective because $0.2$ is not in the image. The only digits allowed are $0$ and $1$.\\
\\
NOTE: Because we do not allow the digit $9$, the map is 1-1.

\begin{thm}\wrlab{thm-01-to-N-onto-intvl01}
$\exists\{0,1\}^\N\to>[0;1]$.
\end{thm}

\noindent
Idea of proof: The mapping which sends\\
\phx\qquad $f\in\{0,1\}^\N$ \quad to \quad the base two number $0.f_1f_2f_3\cdots\in[0;1]$\\
is a surjection.\\
\\
NOTE: It is not injective because, in base two, $0.01111\cdots=0.10000\cdots$.\\
\\
NOTE: The number $1$ is in the image because $1=0.1111\cdots$.

\begin{thm}\wrlab{thm-intvl-minus1to1-in-01-to-N}
$\exists[-1;1]\hookrightarrow\{0,1\}^\N$.
\end{thm}

\begin{proof}
By \tref{thm-01-to-N-onto-intvl01}, $\exists\{0,1\}^\N\to>[0;1]$.\\
So, since $x\mapsto2x-1:[0;1]\to>[-1;1]$,\\
by composing, we get $\exists\{0,1\}^\N\to>[-1;1]$.\\
Then, by \tref{thm-exists-surj-implies-exists-reverse-inj}, we get $\exists[-1;1]\hookrightarrow\{0,1\}^\N$.
\end{proof}

\begin{thm}\wrlab{thm-R-in-intvl-minus1to1}
$\exists\R\hookrightarrow[-1;1]$.
\end{thm}

\begin{proof}
Define $f:\R\to(-1;1)$ by: $\forall x\in\R$, $f_x=x/\sqrt{1+x^2}$.\\
Define $g:(-1;1)\to\R$ by: $\forall y\in\R$, $g_y=y/\sqrt{1-y^2}$.\\
Then $g\circ f=\id^\R$ and $f\circ g=\id^{(-1;1)}$, so, by \tref{thm-exists-inverse-implies-bijection},\\
\phx\qquad we see that $f:\R\hookrightarrow>(-1;1)$.\\
Then $f:\R\hookrightarrow(-1;1)$. \quad Then $\exists\R\hookrightarrow(-1;1)$.
\end{proof}

\noindent
The next theorem asserts that, in The World of Sets,\\
\phx\qquad $\R$ belongs on the continuum cardinality level, with $2^\N$.

\begin{thm}
$\exists2^\N\hookrightarrow>\R$.
\end{thm}

\begin{proof}
By \tref{thm-01-to-S-bijective-2-to-S}, {\bf want:} $\exists\{0,1\}^\N\hookrightarrow>\R$.\\
By \tref{thm-01-to-N-in-R}, $\exists\{0,1\}^\N\hookrightarrow\R$.\\
By \tref{thm-R-in-intvl-minus1to1}, $\exists\R\hookrightarrow[-1;1]$.\\
By \tref{thm-intvl-minus1to1-in-01-to-N}, $\exists[-1;1]\hookrightarrow\{0,1\}^\N$.\\
Then, by \tref{thm-inj-cycle-implies-bij-cycle}, $\exists\{0,1\}^\N\hookrightarrow>\R$.
\end{proof}

\subsection{Partitions}

\begin{defn}
Let $\scrs$ be a set of sets.\\
\phx\qquad\qquad\qquad\qquad By $\scrs$ is \bfindex[pairwise-disjoint], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall A,B\in\scrs$, \quad $(\,A\ne B\,)\,\Rightarrow\,(\,A\cap B=\emptyset\,)$.
\end{defn}

\noindent
We have $\{\,\,[1;3]\,\,,\,\,[3;5]\,\,\}$ is NOT pairwise-disjoint,\\
\phx\quad because $[1;3]\cap[3;5]=\{3\}\ne\emptyset$.\\
By contrast, $\{\,\,[1;3)\,\,,\,\,[3;5)\,\,\}$ IS pairwise-disjoint.\\
Note also that we may put in the empty set:\\
\phx\quad $\{\,\,[1;3)\,\,,\,\,[3;5)\,\,,\,\,\emptyset\,\,\}$ IS pairwise-disjoint.

\begin{defn}
Let $X$ be a set and let $\scrs$ be a set of sets.\\
\phx \qquad By $\scrs$ is a \bfindex[partition] of $X$, we mean:\\
\phx\qquad\qquad $\scrs$ is pairwise-disjoint \quad and \quad $\bigcup\scrs=X$.
\end{defn}

\noindent
Let \quad $X:=[1;5)$, \quad  $\scrs\,\,:=\,\,\{\,[1;3)\,,\,[3;5)\,,\,\emptyset\,\}$.\\
Then $\scrs$ is a partition of $X$.\\
However, the empty set really plays very little role here,\\
\phx\quad so we can remove it, as follows:\\
We have $\scrs^\times_\emptyset\,\,=\,\,\scrs\backslash\{\emptyset\}\,\,=\,\,\{\,[1;3)\,,\,[3;5)\,\}$,\\
\phx\qquad and $\scrs^\times_\emptyset$ is also a partition of $X$.\\
More generally, we have:

\begin{thm}
Let $X$ be a set and let $\scrs$ be a partition of $S$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\scrs^\times_\emptyset$ is a partition of $X$.
\end{thm}

\begin{defn}
Let $X$ be a set.\\
Let $\scrp$ and $\scrq$ be two partitions of $X$.\\
By $\scrp$ is a \bfindex[refinement] of $\scrq$, we mean:\\
\phx\qquad $\forall P\in\scrp$, $\exists Q\in\scrq$ s.t.~$P\subseteq Q$.
\end{defn}

\noindent
Let $X:=[1;5)$, $\scrq\,:=\,\{\,[1;3)\,,\,[3;5)\,\}$, $\scrp\,:=\,\{\,[1;2)\,,\,[2;3)\,,\,[3;4)\,,\,[4;5)\,\}$.\\
Then $\scrp$ is a refinement of $\scrq$.\\
Note that \qquad $\{\,[1;2)\,,\,[2;3)\,\}$ is a partition of $[1;3)$\\
\phx\qquad\qquad and that $\{\,[3;4)\,,\,[4;5)\,\}$ is a partition of $[3;5)$,\\
so each element of $\scrq$ is partitioned by a subset of $\scrp$.\\
More generally, we have:

\begin{thm}
Let $X$ be a set.\\
Let $\scrp$ and $\scrq$ be two partitions of $X$.\\
Assume that $\scrp$ is a refinement of $\scrq$.\\
Let $Q\in\scrq$. Let $\scrs:=\{P\in\scrp\,|\,P\subseteq Q\}$.\\
Then $\scrs$ is a partition of $Q$.
\end{thm}

\begin{defn}
Let $X$ be a set.\\
Let $\scrp$ and $\scrq$ be two partitions of $X$.\\
By $\scrp$ and $\scrq$ are \bfindex[comparable], we mean:\\
\phx\qquad $\scrp$ is a refinement of $\scrq$ \quad or \quad $\scrq$ is a refinement of $\scrp$.\\
By $\scrp$ and $\scrq$ are \bfindex[incomparable], we mean:\\
\phx\qquad $\scrp$ and $\scrq$ are not comparable.
\end{defn}

\noindent
Let $X:=[1;7)$, $\scrp\,:=\,\{\,[1;4)\,,\,[4;7)\,\}$, $\scrq\,:=\,\{\,[1;3)\,,\,[3;5)\,,\,[5,7)\,\}$.\\
Then $\scrp$ and $\scrq$ are incomparable.\\
However, by intersecting each element of $\scrp$ with each element of $\scrq$,\\
we can find a partition of $X$ that is\\
\phx\qquad simultaneously a refinement of $\scrp$ and a refinement of $\scrq$,\\
as follows. We compute:\\
\phx\quad $[1;4)\cap[1;3)=[1;3)$, \quad $[1;4]\cap[3;5)=[3;4)$, \quad $[1;4)\cap[5;7)=\emptyset$,\\
\phx\quad $[4;7)\cap[1;3)=\emptyset$, \quad $[4;7]\cap[3;5)=[4;5)$, \quad $[4;7)\cap[5;7)=[5;7)$.\\
Let $\scrs\,:=\,\{\,[1;3)\,,\,[3;4)\,,\,\emptyset\,,\,\emptyset\,,\,[4;5)\,,\,[5;7)\,\}$.\\
Then $\scrs$ is a partition of $X$ and, also,\\
\phx\quad $\scrs$ is a common refinement of $\scrp$ and $\scrq$.\\
More generally, we have:

\begin{thm}
Let $X$ be a set.\\
Let $\scrp$ and $\scrq$ be two partitions of $X$.\\
Let $\scrs:=\{P\cap Q\,|\,P\in\scrp\,,\,Q\in\scrq\}$.\\
Then: \qquad\qquad\qquad\qquad $\scrs$ is a partition of $X$ \quad and\\
\phx\qquad\quad $\scrs$ is a refinement of $\scrp$ \quad and \quad $\scrs$ is a refinement of $\scrq$.
\end{thm}

\subsection{Algebra of functionals}

\begin{defn}
Let $f$ be an object.\\
\phx\qquad By $f$ is a \bfindex[functional], we mean: $(\,f\hbox{ is a function}\,)\,\&\,(\,\I_f\subseteq\R\,)$.
\end{defn}

That is, a functional is a real-valued function.

\begin{defn}
Let $f$ be a functional.\\
\phx\qquad Then $\boxed{-f}$ is the functional defined by:\\
\phx\qquad\qquad\qquad $\forall x$, $\,\,$ $(-f)_x\,=\,-f_x$.
\end{defn}

\begin{thm}
$\forall$functional $f$, $\D_{-f}=\D_f$.
\end{thm}

\begin{thm}
$-(1,2,3,\ldots)=(-1,-2,-3,\ldots)$.
\end{thm}

\begin{defn}
Let $f$ be afunctional, $c\in\R$.\\
\phx\qquad Then $\boxed{c\cdot f}$ and $f\cdot c$ are the functionals defined by:\\
\phx\qquad\qquad\qquad $\forall x$, $\,\,$ $(c\cdot f)_x\,=\,c\cdot f_x$ \qquad and\\
\phx\qquad\qquad\qquad $\forall x$, $\,\,$ $(f\cdot c)_x\,=\,f_x\cdot c$.
\end{defn}

The ``$\cdot$'' is often omitted.

\begin{thm}
$2\cdot(1,2,3,\ldots)=(2,4,6,\ldots)=(1,2,3,\ldots)\cdot2$.
\end{thm}

\begin{thm}
$\forall$ functional $f$, $\forall c\in\R$, $c\cdot f=f\cdot c$ and $\D_{c\cdot f}=\D_f=\D_{f\cdot c}$.
\end{thm}

\begin{thm}
$\forall$ functional $f$, $1\cdot f=f$ and $(-1)\cdot f=-f$.
\end{thm}

\begin{defn}
Let $f$ and $g$ be functionals.\\
\phx\qquad Then $\boxed{f+g}$ and $\boxed{f-g}$ and $\boxed{f\cdot g}$ and $\boxed{f/g}$ are the functionals defined by:\\
\phx\qquad\qquad\qquad $\forall x$, $\,\,$ $(f+g)_x\,=\,f_x+g_x$ \qquad and\\
\phx\qquad\qquad\qquad $\forall x$, $\,\,$ $(f-g)_x\,=\,f_x-g_x$ \qquad and\\
\phx\qquad\qquad\qquad $\forall x$, $\,\,$ $(f\cdot g)_x\,=\,f_x\cdot g_x$ \qquad and\\
\phx\qquad\qquad\qquad $\forall x$, $\,\,$ $(f/g)_x\,=\,f_x/g_x$.
\end{defn}

The ``$\cdot$'' is often omitted.
We sometimes write $\ds{\frac{f}{g}}$ instead of $f/g$.

\begin{thm}
Let $f$ and $g$ be functionals. Then:\\
\phx\qquad $f+g=g+x$ $\,$ and $\,$ $f-g=-(g-f)$ $\,$ and $\,$ $f\cdot g=g\cdot f$ \quad and\\
\phx\qquad $\D_{f+g}=\D_{f-g}=\D_{f+g}=\D_f\cap\D_g$ $\,$ and $\,$ $\D_{f/g}=\D_f\cap[g^*(\R_0^*)]$.
\end{thm}

\begin{defn}
Let $f$ be a functional, $c\in\R$. Then:\\
\phx\qquad $\boxed{c/f}$ and $\boxed{f/c}$ are the functionals defined by:\\
\phx\qquad\qquad\qquad $\forall x$, $(c/f)_x\,=\,c/f_x$ \qquad and\\
\phx\qquad\qquad\qquad $\forall x$, $(f/c)_x\,=\,f_x/c$.
\end{defn}

We sometimes write $\ds{\frac{c}{f}}$ instead of $c/f$ and $\ds{\frac{f}{c}}$ instead of $f/c$.

\begin{thm}\wrlab{thm-s-times-1overt-is-sovert}
Let $s\in\R^\N$, $t\in\R^\N$. \quad
Then $s\cdot(1/t)=s/t$.
\end{thm}

\begin{proof}
We have $\D_{s\cdot(1/t)}\subseteq\N$ and $\D_{s/t}\subseteq\N$.\\
{\bf Want:} $\forall j\in\N$, \quad $(s\cdot(1/t))_j\,=\,(s/t)_j$.\\
Given $j\in\N$. \qquad {\bf Want:} $(s\cdot(1/t))_j\,=\,(s/t)_j$.\\
We have $\,\,(s\cdot(1/t))_j\,=\,s_j\cdot(1/t)_j\,=\,s_j\cdot(1/t_j)$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $=\!\!\!\!\!{}^*\,\,\,\,\,\,s_j/t_j\,=\,(s/t)_j$.
\end{proof}

\subsection{Balls in $\R$}
\quad
\vskip.1in\noindent
In the next definition, $B(a,\vep)$ is called\\
\phx\qquad\qquad the \bfindex[open ball] about $a$ of radius $\vep$.\\
We are sometimes sloppy and forget to say ``open''.\\
By default, in this course, a ``ball'' is an open ball.

\begin{defn}
Let $a\in\R$, $\vep\in\R$.\\
\phx\qquad\qquad Then $\boxed{B(a,\vep)}\,\,:=\,\,\{x\in\R~\hbox{s.t.}~|x-a|<\vep\}$.
\end{defn}

\begin{thm}
Let $a\in\R$, $\vep>0$.\\
\phx\qquad\qquad Then $B(a,\vep)\,\,=\,\,(a-\vep;a+\vep)$.
\end{thm}

\begin{thm}
$B(0,1/6)\,\,=\,\,(-1/6;1/6)$.
\end{thm}

\begin{defn}\phx\\
\phx\quad $\forall a\in\R$, \quad $\boxed{\scrb(a)}\,\,:=\,\,\{B(a,r)\,|\,r>0\}$.\\
\phx\qquad\qquad\qquad $\,\,\scrb_\R\,\,:=\,\,\{B(a,r)\,|\,a\in\R,\,r>0\}$.
\end{defn}

\noindent
The next theorem is the \bfindex[Subset Recentering Theorem]:

\begin{thm}\wrlab{thm-subset-recenter}
Let $C\in\scrb_\R$, $x\in C$.\\
\phx\qquad\qquad\qquad Then $\exists B\in\scrb(x)$ s.t.~$B\subseteq C$.
\end{thm}

\begin{proof}
Choose $a\in\R$, $r>0$ s.t.~$C=B(a,r)$.\\
Since $x\in C=B(a,r)$, we get $|x-a|<r$.\\
Let $\vep:=r-|x-a|$. \quad Then $\vep>0$. \quad Let $B:=B(x,\vep)$.\\
Then $B\in\scrb(x)$. \quad {\bf Want:} $B\subseteq C$.\\
{\bf Want:} $\forall z\in B$, $z\in C$.\\
Given $z\in B$. \quad {\bf Want:} $z\in C$.\\
Since $z\in B=B(x,\vep)$, \quad we get $|z-x|<\vep$.\\
Then $|z-x|<\vep=r-|a-x|$, \quad so $|z-x|+|x-a|<r$.\\
Then $|z-a|\le|z-x|+|x-a|<r$.\\
Then $|z-a|<r$, \quad so $z\in B(a,r)$.\\
Then $z\in B(a,r)=C$.
\end{proof}

\begin{thm}\wrlab{thm-subset-recenter-variant1}
Let $b\in\R$, $a<b$.\\
Let $q\in(a;b)$. \quad Then: $\exists\vep>0$ s.t.~$B(q,\vep)\subseteq(a;b)$.
\end{thm}

\begin{proof}
Let $c:=(a+b)/2$, $r:=(b-a)/2$.\\
Then $B(c,r)=(c-r;c+r)=(a;b)$.\\
Let $C:=B(c,r)$. Then $C=(a;b)$ and $C\in\scrb_\R$.\\
Since $q\in(a;b)=C$, by \tref{thm-subset-recenter},\\
\phx\quad choose $B\in\scrb(q)$ s.t.~$B\subseteq C$.\\
Since $B\in\scrb(q)$, choose $\vep>0$ s.t.~$B=B(q,\vep)$.\\
Then $\vep>0$. \quad {\bf Want:} $B(q,\vep)\subseteq(a;b)$.\\
We have: $B(q,\vep)=B\subseteq C=(a;b)$.
\end{proof}

\noindent
The next theorem is the \bfindex[Superset Recentering Theorem]:

\begin{thm}\wrlab{thm-superset-recenter}
Let $B\in\scrb_\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad Then $\exists C\in\scrb(a)$ s.t.~$B\subseteq C$.
\end{thm}

\begin{proof}
Choose $\alpha\in\R$, $\rho>0$ s.t.~$B=B(\alpha,\rho)$.\\
Let $s:=|\alpha-a|$. \quad Let $C:=B(a,\rho+s)$.\\
Then $C\in\scrb(a)$. \quad {\bf Want:} $B\subseteq C$.\\
{\bf Want:} $\forall x\in B$, $x\in C$.\\
Given $x\in B$. \quad {\bf Want:} $x\in C$.\\
Since $x\in B=B(\alpha,\rho)$, \quad we get $|x-\alpha|<\rho$.\\
We have $|x-a|\le|x-\alpha|+|\alpha-a|<\rho+s$, \quad so $|x-a|<\rho+s$.\\
Then $x\in B(a,\rho+s)=C$.
\end{proof}

\subsection{Bounded sets in $\R$}

\begin{defn}
Let $S\subseteq\R$.\\
By $S$ is \bfindex[bounded], we mean: $\exists B\in\scrb_\R$ s.t.~$S\subseteq B$.\\
\end{defn}

\begin{defn}
Let $S\subseteq\R$.\\
By $S$ is \bfindex[unbounded], we mean: $S$ is not bounded.
\end{defn}

\begin{thm}\phx\\
\phx\qquad $[1;2]$ is bounded.\\
\phx\qquad $[1;\infty)$ is unbounded.\\
\phx\qquad $\{1\,,\,1/2\,,\,1/3\,,\,\ldots\}$ is bounded.\\
\phx\qquad $\{2\,,\,4\,,\,6\,,\,8\,,\,\ldots\}$ is unbounded.\\
\end{thm}

\begin{defn}
Let $X\subseteq\R$.\\
\phx\qquad By $X$ is \bfindex[bounded above], we mean: $\exists z\in\R$ s.t.~$X\le z$.\\
\phx\qquad By $X$ is \bfindex[bounded below], we mean: $\exists z\in\R$ s.t.~$z\le X$.
\end{defn}

\begin{thm}\wrlab{thm-conv-seq-of-reals-bdd-above}
Let $t\in\R^\N$.\\
\phx\qquad Assume $t$ is convergent. \quad Then $\I_t$ is bounded above.
\end{thm}

\begin{proof}
{\bf Want:} $\exists z\in\R$ s.t.~$\I_t\le z$.\\
Since $t$ is convergent, choose $a\in\R$ s.t.~$t\to a$.\\
Since $t\to a$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|t_j-a|<1\,)$.\\
Then: \quad $\forall j\in[K..\infty)$, $\,$ $a-1<t_j<a+1$.\\
Let $b:=\max\{t_1,\ldots,t_K\}$.\\
Then: \quad $\forall j\in[1..K]$, $\,$ $t_j\le b$ \quad and \quad $\forall j\in[K..\infty)$, $\,$ $t_j<a+1$.\\
Let $z:=\max\{a+1,b\}$. \quad Then $z\in\R$. \quad {\bf Want:} $\I_t\le z$.\\
{\bf Want:} $\forall y\in\I_t$, $y\le z$.\\
Given $y\in\I_t$. \quad {\bf Want:} $y\le z$.\\
Since $y\in\I_t$, choose $j\in\D_t$ s.t.~$y=t_j$. \quad {\bf Want:} $t_j\le z$.\\
At least one of the following is true:\\
\phx\qquad ($\alpha$) $j\in[1..K]$ \qquad or \qquad ($\beta$) $j\in[K..\infty)$.\\
\\
{\it Case ($\alpha$):}
Since $j\in[1..K]$, we get $t_j\le b$.\\
Then $t_j\le b\le\max\{a+1,b\}=z$, so $t_j\le z$.\\
{\it End of Case ($\alpha$).}\\
\\
{\it Case ($\beta$):}
Since $j\in[K..\infty)$, we get $t_j<a+1$.\\
Then $t_j<a+1\le\max\{a+1,b\}=z$, so $t_j\le z$.\\
{\it End of Case ($\beta$).}
\end{proof}

\begin{thm}
Let $S\subseteq\R$. Then:\\
\phx $[\,\,S\hbox{ is bounded}\,\,]\,\,\Leftrightarrow\,\,[\,\,(\,S\hbox{ is bounded above}\,)\,\&\,(\,S\hbox{ is bounded below}\,)\,\,]$.
\end{thm}

\begin{thm}
Let $S,T\subseteq\R$.\\
Assume \quad $T$ is bounded \quad and \quad $S\subseteq T$.\\
\phx\qquad Then $S$ is bounded.
\end{thm}

\begin{thm}
Let $s$ and $t$ be sequences.\\
Assume \quad $t$ is a subsequence of $s$ \quad and \quad $\I_s$ is bounded.\\
\phx\qquad Then $\I_t$ is bounded.
\end{thm}

\begin{proof}
Since $\I_s$ is bounded and $\I_t\subseteq\I_s$, it follow that $\I_t$ is bounded.
\end{proof}

\begin{thm}
$\forall$finite $F\subseteq\R$, $\,$ $F$ is bounded.
\end{thm}

\begin{proof}
Since $\min F\le F\le\max F$,\\
\phx\quad we see that $F$ is bounded below and above.\\
Then $f$ is bounded.
\end{proof}

\begin{defn}
Let $S\subseteq\R$, $t\in\R$.\\
By $S$ is \bfindex[strictly-$t$-bounded], we mean:\\
\phx\qquad\qquad $\forall a,b\in S$, \quad $|a-b|<t$.\\
By $S$ is \bfindex[semi-$t$-bounded], we mean:\\
\phx\qquad\qquad $\forall a,b\in S$, \quad $|a-b|\le t$.
\end{defn}

\begin{thm}\phx\\
\phx\qquad $[-2;5)$ is strictly-$7$-bounded.\\
\phx\qquad $[-2;5]$ is NOT strictly-$7$-bounded, but IS semi-$7$-bounded.\\
\phx\qquad $\forall t\in\R$, \quad $\N$ is NOT strictly-$t$-bounded.\\
\phx\qquad $\forall t\in\R$, \quad $\emptyset$ IS strictly-$t$-bounded.
\end{thm}

\begin{thm}
$\forall a\in\R$, $\forall r>0$, $\,$ $B(a,r)$ is strictly-$2r$-bounded.
\end{thm}

\begin{thm}
Let $S\subseteq\R$, $t>0$.\\
\phx\qquad Assume $s$ is strictly-$t$-bounded.\\
\phx\qquad Then: \quad $\forall a\in S$, $\,$ $S\subseteq B(a,t)$.
\end{thm}

\noindent
The next theorem is UnHW:

\begin{thm}
Let $S\subseteq\R$. Then:\\
\phx\qquad $(\,S\hbox{ is bounded}\,)\,\Leftrightarrow\,(\,\exists t>0~\hbox{s.t.}~S\hbox{ is strictly-}t\hbox{-bounded}\,)$.
\end{thm}

\begin{thm}\wrlab{thm-same-center-cupcap-both-one-of-them}
Let $a\in\R$, $C,D\in\scrb(a)$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $C\cap D,C\cup D\in\{C,D\}$.
\end{thm}

\begin{proof}
Choose $r,s>0$ s.t.~$C=B(a,r)$ and $D=B(a,s)$.\\
Let $t:=\min\{r,s\}$.\\
Then $C\cap D=B(a,t)$.\\
Also, $t\in\{r,s\}$, \quad so $B(a,t)\in\{B(a,r),B(a,s)\}$.\\
Then $C\cap D=B(a,t)\in\{B(a,r),B(a,s)\}=\{C,D\}$.\\
{\bf Want:} $C\cup D\in\{C,D\}$.\\
Let $u:=\max\{r,s\}$.\\
Then $C\cup D=B(a,u)$.\\
Also, $u\in\{r,s\}$, \quad so $B(a,u)\in\{B(a,r),B(a,s)\}$.\\
Then $C\cup D=B(a,u)\in\{B(a,r),B(a,s)\}=\{C,D\}$.
\end{proof}

\begin{thm}
Let $X,Y\subseteq\R$.\\
\phx\qquad Assume $X$ and $Y$ are both bounded. \quad Then $X\cup Y$ is bounded.
\end{thm}

\begin{proof}
Since $X$ and $Y$ are both bounded,\\
\phx\qquad choose $A,B\in\scrb_\R$ s.t.~$X\subseteq A$ and $Y\subseteq B$.\\
By \tref{thm-superset-recenter}, choose $C,D\in\scrb(0)$ s.t.~$A\subseteq C$ and $B\subseteq D$.\\
By \tref{thm-same-center-cupcap-both-one-of-them}, $C\cup D\in\{C,D\}$.\\
Then $C\cup D\in\{C,D\}\subseteq\scrb(0)\subseteq\scrb_\R$, so $C\cup D\in\scrb_\R$.\\
{\bf It therefore suffices to show:} $X\cup Y\subseteq C\cup D$.\\
We have $X\cup Y\subseteq A\cup B\subseteq C\cup D$.
\end{proof}

\begin{thm}\wrlab{thm-bdd-btwn-minusr-r}
Let $A\subseteq\R$. Assume $A$ is bounded.\\
\phx\qquad Then $\exists r>0$ s.t.~$A\subseteq B(0,r)$.
\end{thm}

\begin{proof}
Since $A$ is bounded, choose $B\in\scrb_R$ s.t.~$A\subseteq B$.\\
By \tref{thm-superset-recenter}, choose $C\in\scrb(0)$ s.t. $B\subseteq C$.\\
Since $C\in\scrb(0)$, choose $r>0$ s.t.~$C=B(0,r)$. \quad Then $r>0$.\\
{\bf Want:} $A\subseteq B(0,r)$. \quad We have $A\subseteq B\subseteq C=B(0,r)$.
\end{proof}

\subsection{Hausdorff property of the real numbers}
\quad
\vskip.1in\noindent
The next theorem is called the \bfindex[Hausdorff property] of $\R$.

\begin{thm}\wrlab{thm-Hausdorff-R}
Let $a,b\in\R$. Assume $a\ne b$.\\
Then $\exists\vep>0$ s.t.~$(B(a,\vep))\cap(B(b,\vep))=\emptyset$.
\end{thm}

\begin{proof}
Since $a\ne b$, we get $b-a\ne0$, so $|b-a|>0$.\\
Let $\vep:=|b-a|/2$. \quad Then $\vep>0$.\\
{\bf Want:} $(B(a,\vep))\cap(B(b,\vep))=\emptyset$.\\
Assume $(B(a,\vep))\cap(B(b,\vep))\ne\emptyset$. \qquad {\bf Want:} Contradiction.\\
Choose $x$ s.t.~$x\in(B(a,\vep))\cap(B(b,\vep))$.\\
Since $x\in B(a,\vep)$, we get $|x-a|<\vep$.\\
Since $x\in B(b,\vep)$, we get $|x-b|<\vep$. \quad Then $|b-x|<\vep$.\\
By the Triangle Inequality, $|b-a|\le|b-x|+|x-a|$.\\
Then $|b-a|\le|b-x|+|x-a|$\\
\phx\qquad\qquad\quad $\,<\vep+\vep=2\vep=|b-a|$,\\
so $|b-a|<|b-a|$. Contradiction.
\end{proof}

\subsection{Density of $\Q$ in $\R$}

\begin{thm}
Let $a,b\in\R$.\\
\phx\qquad Assume $b-a>1$. \quad Then $\exists k\in\Z$ s.t.~$a<k<b$.
\end{thm}

\begin{proof}
By the AP, choose $j\in\N$ s.t.~$j>-a$.\\
Let $\alpha:=j+a$. Then $\alpha>0$. Let $\beta:=j+b$.\\
By the AP, choose $\lambda\in\N$ s.t.~$\lambda>a$.\\
Then $\lambda\in(\alpha;\infty)$ and $\lambda\in\N\subseteq\Z$.\\
Then $\lambda\in(\alpha;\infty)\cap\Z$ Then $\lambda\in(\alpha;\infty)\cap\Z\ne\emptyset$.\\
Since $\alpha>0$, we get $(\alpha;\infty)\subseteq(0;\infty)$.\\
Then $(\alpha;\infty)\cap\Z\subseteq(0;\infty)\cap\Z$.\\
So, since $(0;\infty)\cap\Z=\N$, we get $(\alpha;\infty)\cap\Z\subseteq\N$.\\
Then $\emptyset\ne(\alpha;\infty)\cap\Z\subseteq\N$.\\
Then, by the Well-Ordering Axiom, $\min(\,\,(\alpha;\infty)\,\cap\,\Z\,\,)\ne\frownie$.\\
Let $\kappa:=\min(\,\,(\alpha;\infty)\,\cap\,\Z\,\,)$.\\
Then $\kappa\in(\alpha;\infty)\,\cap\,\Z$.
Then $\kappa\in\Z$. Then $\kappa-1\in\Z$.\\
Moreover, since $\kappa-1<\kappa=\min(\,\,(\alpha;\infty)\,\cap\,\Z\,\,)$,\\
\phx\qquad we get $\kappa-1\ne(\alpha;\infty)\,\cap\,\Z$.\\
So, since $\kappa-1\in\Z$, it follows that $\kappa-1\ne(\alpha;\infty)$.\\
So, since $\kappa-1\in\Z\subseteq\R$, we get $\kappa-1\in\R\bksl(\alpha;\infty)$.\\
Then $\kappa-1\in\R\bksl(\alpha;\infty)=(-\infty;\alpha]\le\alpha$, so $\kappa-1\le\alpha$, so $\kappa\le\alpha+1$.\\
So, since $1<\beta-\alpha$, we get $\kappa\le\alpha+(\beta-\alpha)$, and so $\kappa<\beta$.\\
Also, $\kappa\in(\alpha;\infty)\,\cap\,\Z\subseteq(\alpha;\infty)>\alpha$, so $\kappa>\alpha$. \quad
Then $\alpha<\kappa<\beta$.\\
Let $k:=\kappa-j$. \quad Then $k\in\Z-j\subseteq\Z$. \quad {\bf Want:} $a<k<b$.\\
We have $\alpha-j<\kappa-j<\beta-j$, so $a<k<b$.
\end{proof}

The following is HW\#7-2:

\begin{thm}
Let $s,t\in\R$.\\
\phx\qquad Assume $s<t$. \quad Then $\exists x\in\Q$ s.t.~$s<x<t$.
\end{thm}

\subsection{Some topology on $\R$}
\quad
\vskip.1in\noindent
The \bfindex[boundary] of a set $X$ is denoted $\partial X$,
ad is defined as follows:

\begin{defn}
Let $X\subseteq\R$.\\
Then $\,\,\boxed{\partial X}\,\,\,:=\,\,\,\{\,q\in\R\,\,\,|\qquad(\,\exists s\in X^\N~\hbox{s.t.}~s\to q\,)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\&\,\,\,\,(\,\exists t\in(\R\bksl X)^\N~\hbox{s.t.}~t\to q\,)\,\}$.
\end{defn}

\noindent
Thinking of $X$ as ``we'', of $\R\bksl X$ is ``they'' and $\partial X$ as ``the wall'',\\
then the wall consists of the points that both we and they can approach.

\begin{thm}
Let $X:=(0;1)$. Then $\partial X=\{0,1\}$.
\end{thm}

\begin{proof}
Define $s,t,u,v\in\R^\N$ by: \quad $\forall j\in\N$,\\
\\
\phx\quad $\ds{s_j=\frac{1}{j+1}, \quad t_j=-\frac{1}{j}, \quad u_j=1-\frac{1}{j+1}, \quad v_j=1+\frac{1}{jh}}$.\\
\\
Then $s\in X^\N$ and $t\in(\R\bksl X)^\N$ and $s\to0$ and $t\to0$, so $0\in\partial X$.\\
Also, $u\in X^\N$ and $v\in(\R\bksl X)^\N$ and $u\to1$ and $v\to1$, so $1\in\partial X$.\\
Then $\{0,1\}\subseteq\partial X$. \quad {\bf Want:} $\partial X\subseteq\{0,1\}$.\\
{\bf Want:} $\forall q\in\partial X$, $\,$ $q\in\{0,1\}$.\\
Given $q\in\partial X$. \quad {\bf Want:} $\,$ $q\in\{0,1\}$. \quad {\bf Want:} $q\in[0;1]\bksl(0;1)$.\\
{\bf Want:} $q\in[0;1]$ and $q\notin(0;1)$.\\
Since $q\in\partial X$, $\,$choose $y\in X^\N$ s.t.~$y\to q$\\
\phx\qquad and \qquad choose $z\in(\R\bksl X)^\N$ s.t.~$z\to q$.\\
We have: $\forall j\in\N$, $y_j\in\I_y\subseteq X=(0;1)\subseteq[0;1]$, so $0\le y_j\le 1$.\\
So, as $y\to q$, we get: $0\le q\le 1$. \quad Then $q\in[0;1]$. \quad {\bf Want:} $q\notin(0;1)$.\\
Assume $q\in(0;1)$. \quad {\bf Want:} Contradiction.\\
Let $C:=B(1/2,1/2)$. \quad Then $C=(0,1)$.\\
Since $q\in(0;1)=C$, by the Subset Recentering Theorem,\\
\phx\quad choose $B\in\scrb(q)$ s.t.~$B\subseteq C$.\\
Since $B\in\scrb(q)$, choose $\vep>0$ s.t.~$B=B(q,\vep)$.\\
Since $z\to q$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\quad $(\,j\ge K\,)\,\Rightarrow\,(\,|z_j-q|<\vep\,)$.\\
Since $z\in(\R\bksl X)^\N$, we have $\I_z\subseteq\R\bksl X$.\\
Since $K\ge K$, by choice of $K$, we get $|z_K-q|<\vep$, so $z\in B(q,\vep)$.\\
Then $z_K\in B(q,\vep)=B\subseteq C=(0;1)=X$, so $z_K\in X$.\\
Also $z_K\in\I_z\subseteq\R\bksl X$, and so $z_K\notin X$. \quad Contradiction.
\end{proof}

\noindent
The following is an unassigned HW:

\begin{thm}\phx\\
\phx\quad $\partial[0;1]=\partial[0;1)=\partial(0;1]=\{0,1\}$.
\end{thm}

\begin{thm}
\quad $\forall X\subseteq\R$, \quad $\partial X=\partial(\R\bksl X)$.
\end{thm}

\noindent
Thinking of $X$ as ``we'', of $\R\bksl X$ is ``they'' and $\partial X$ as ``the wall'',\\
then our wall is their wall.\\
\\
Idea of proof: \quad Keep in mind: \quad $\R\bksl(\R\bksl X)=X$.\\
If a point in $\R$ can be approached\\
\phx\quad both \quad by a sequence in $X$ \quad and \quad by a sequence in $\R\bksl X$,\\
then it can be approached\\
\phx\quad both \quad by a sequence in $\R\bksl X$ \quad and \quad by a sequence in $\R\bksl(\R\bksl X)$.\\
Thus any point in $\partial X$ is a point in $\partial(\R\bksl X)$.\\
Then $\partial X\subseteq\partial(\R\bksl X)$. The reverse inclusion is similar. QED\\
\\
The \bfindex[closure] and \bfindex[interior] of a set $X$ are
denoted $\Cl\,X$ and $\Int\,X$, and defined as follows:

\begin{defn}
Let $X\subseteq\R$.\\
\phx\quad Then \quad $\boxed{\Cl\,X}\,\,:=\,\,X\,\cup\,\partial X$ \qquad and\\
\phx\qquad\qquad $\,\,\boxed{\Int\,X}\,\,:=\,\,X\,\bksl\,\partial X$.
\end{defn}

\noindent
We also use $\Cl_X$ and $\Cl(X)$ to denote $\Cl\,X$.\\
We also use $\Int_X$ and $\Int(X)$ to denote $\Int\,X$.\\
\\
Any set is between its interior and closure:

\begin{thm}
Let $S\subseteq\R$. Then $\Int\,S\subseteq S\subseteq\Cl\,S$.
\end{thm}

\noindent
Unassigned HW:\\
\phx\quad $\Int(0;1)=\Int[0;1]=\Int[0;1)=\Int(0,1]=(0;1)$ \qquad and\\
\phx\quad $\Cl(0;1)=\Cl[0;1]=\Cl[0;1)=\Cl(0,1]=[0;1]$.\\
In fact:

\begin{thm}
Let $b\in\R$ and let $a<b$. \quad Then:\\
\phx\qquad $\forall S\,\,\in\,\,\{\,(a;b)\,,\,[a;b]\,,\,[a;b)\,,\,(a;b]\,\}$,\\
\phx\qquad\qquad\qquad\qquad\qquad $\Int_S=(a;b)$ \quad and \quad $\Cl_S=[a;b]$.
\end{thm}

\begin{defn}
Let $X\subseteq\R$.\\
\phx\qquad By $X$ is \bfindex[closed], we mean: $\Cl\,X=X$.\\
\phx\qquad By $X$ is \bfindex[open], we mean: $\Int\,X=X$.
\end{defn}

Note that:\\
\phx\qquad $[0;1]$ is closed \qquad and\\
\phx\qquad $(0;1)$ is open \qquad and\\
\phx\qquad $[0;1)$ is neither \qquad and\\
\phx\qquad $(0;1]$ is neither.\\

\begin{thm}
Let $X\subseteq\R$. \quad Then:\\
\phx\qquad $[\,\,(\,X\hbox{ is open}\,)\,\Leftrightarrow\,(\,\partial X\subseteq\R\bksl X\,)\,\,]$ \qquad and\\
\phx\qquad $[\,\,(\,X\hbox{ is closed}\,)\,\Leftrightarrow\,(\,\partial X\subseteq X\,)\,\,]$.
\end{thm}

\noindent
Part of proof:\\
\phx\quad $X$ is closed $\Leftrightarrow$ $\Cl X=X$ $\Leftrightarrow$ $X\cup\partial X=X$ $\Leftrightarrow$ $\partial X\subseteq X$.\\
Thinking of $X$ as ``we'', of $\R\bksl X$ is ``they'' and $\partial X$ as ``the wall'',\\
one could say:\\
\phx\quad we and they both have the same wall.\\
However,\\
\phx\quad we might own the wall \qquad OR\\
\phx\quad they might own the wall \qquad OR\\
\phx\quad we both might own part of it.\\
In the first case, \quad we are closed \quad  and \quad they are open.\\
In the second case, \quad we are open \quad and \quad they are closed.\\
In the third case, \qquad $\,$ we are neither open nor closed\\
\phx\qquad\qquad\qquad and \qquad they are also neither open nor closed.\\
\\
Keep in mind that\\
\phx\qquad showing that a set fails to be open\\
is NOT the same as\\
\phx\qquad showing that it is closed.\\
Similarly\\
\phx\qquad showing that a set fails to be closed\\
is NOT the same as\\
\phx\qquad showing that it is open.\\
Many sets are neither open nor closed.\\
Closed an open are not opposites.\\
However they ARE complementary, in the following sense:

\begin{thm}
Let $X\subseteq\R$. Then\\
\phx\qquad $[(\,X\hbox{ is open}\,)\,\Leftrightarrow\,(\,\R\bksl X\hbox{ is closed}\,)]\qquad\&$\\
\phx\qquad $[(\,X\hbox{ is closed}\,)\,\Leftrightarrow\,(\,\R\bksl X\hbox{ is open}\,)]$.
\end{thm}

\noindent
Thinking of $X$ as ``we'', of $\R\bksl X$ is ``they'' and $\partial X$ as ``the wall'',\\
then saying that \quad we none of the wall (we are ``open'')\\
is the same as saying \quad they own all of it (they are ``closed'').\\
Also, saying that \quad we own all of the wall (we are ``closed'')\\
is the same as saying \quad they own none of it (they are ``open'').\\
\\
We know that some are closed and some are open,\\
but many sets are neither.\\
Question: Are any sets BOTH closed AND open.

\begin{defn}
Let $X\subseteq\R$.\\
\phx\quad By $X$ is \bfindex[clopen], we mean: $X$ is closed and open.
\end{defn}

\noindent
For us to be clopen, it would have to be true that\\
\phx\qquad both we and they own all of the wall,\\
but, since we $\cap$ they $=\emptyset$, this would mean that\\
\phx\qquad the wall simply doesn't exist.\\
That is,\\
\phx\qquad $\forall X\subseteq\R$, \qquad $($ $X$ is clopen $)$ \quad iff \quad $($ $\partial X=\emptyset$ $)$.\\

\begin{thm}
Let $X\subseteq\R$. \quad Then:\\
\phx\qquad $(\,X\hbox{ is clopen}\,)\,\,\,\Leftrightarrow\,\,\,(\,(\,X=\R\,)\vee(\,X=\emptyset\,)\,)$.
\end{thm}

\noindent
Idea of proof:\\
Since $X$ is clopen, $\partial X=\emptyset$.\\
Assume that $X\ne\R$ and $X\ne\emptyset$. {\bf Want:} Contradiction.\\
Since $X\ne\emptyset$, choose $p$ s.t.~$p\in X$.\\
Since $X\subseteq\R$ and $X\ne\R$, choose $q\in\R$ s.t.~$q\notin X$.\\
Since $p\in X$ and $q\notin X$, we get $p\ne q$, so either $p<q$ or $q<p$.\\
Then either $p\in X\cap(-\infty;q)$ or $p\in X\cap(q;\infty)$.\\
In the first case, let $r:=\sup(X\cap(-\infty;q))$.\\
In the second case, let $r:=\inf(X\cap(q;\infty))$.\\
In either case, one can show (with work) that $r\in\partial X$.\\
Since $r\in\partial X$, we get: $\partial X\ne\emptyset$.\\
Then $\emptyset\ne\partial X=\emptyset$. \quad Contradiction. QED

\begin{thm}\wrlab{thm-in-int-iff-deeply-in}
Let $S\subseteq\R$, $a\in \R$.\\
\phx\quad Then: \quad $a\in\Int S$ \quad $\Leftrightarrow$ \quad $\exists\delta>0$ s.t.~$B(a,\delta)\subseteq S$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}\\
Assume $a\in\Int S$. \qquad {\bf Want:} $\exists\delta>0$ s.t.~$B(a,\delta)\subseteq S$.\\
Assume $\neg(\,\exists\delta>0~\hbox{s.t.}~B(a,\delta)\subseteq S\,)$. \quad {\bf Want:} Contradiction.\\
We have: $\forall\delta>0$, $B(a,\delta)\not\subseteq S$.\\
Then: $\forall\delta>0$, $(B(a,\delta))\bksl S\ne\emptyset$.\\
For all $j\in\N$, let $Q_j:=(B(a,1/j))\bksl S$.\\
Then: $\forall j\in\N$, we have:\qquad\quad $Q_j\ne\emptyset$ \quad and \quad $Q_j\subseteq\R\bksl S$.\\
Define $z\in(\R\bksl S)^\N$ by: $\forall j\in\N$, $z_j=\CH_{Q_j}$.\\
We have: $\forall j\in\N$, $z_j\in Q_j=(B(a,1/j))\bksl S\subseteq B(a,1/j)$.\\
Then: $\forall j\in\N$, $|z_j-a|<1/j$. \quad Then $z\to a$.\\
Let $y:=(a,a,a,a,\ldots)$. \quad Then $y\to a$.\\
Since $a\in\Int S=S\bksl\partial S\subseteq S$, we get: $y\in S^\N$.\\
Since \quad $y\in S^\N$ $\,$ and $\,$ $y\to a$ $\,$ and $\,$ $z\in (\R\bksl S)^\N$ $\,$ and $\,$ $z\to a$,\\
\phx\qquad we conclude that: \quad $a\in\partial S$.\\
Since $a\in\Int S=S\bksl\partial S$, we get: $a\notin\partial S$. \quad Contradiction.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume $\exists\delta>0$ s.t.~$B(a,\delta)\subseteq S$. \qquad {\bf Want:} $a\in\Int S$.\\
Choose $\delta>0$ s.t.~$B(a,\delta)\subseteq S$. \qquad {\bf Want:} $a\in S\bksl\partial S$.\\
We have $|a-a|=0<\delta$, so $a\in B(a,\delta)$.\\
Since $a\in B(a,\delta)\subseteq S$, {\bf it remains to show:} $a\notin\partial S$.\\
Assume $a\in\partial S$. \quad {\bf Want:} Contradiction.\\
Since $a\in\partial S$, choose $z\in(\R\bksl S)^\N$ s.t.~$z\to a$.\\
Since $z\to a$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|z_j-a|<\delta\,)$.\\
Since $z\in(\R\bksl S)^\N$, we get: $z_K\in\R\bksl S$.\\
Since $K\ge K$, by choice of $K$, we get $|z_K-a|<\delta$, and so $z_K\in B(a,\delta)$.\\
Then $z_K\in B(a,\delta)\subseteq S$, so $z_K\in S$.\\
Since $z_K\in\R\bksl S$, we get $z_K\notin S$. \quad Contradiction.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The following is called \bfindex[monotonicity of interior]:

\begin{thm}
Let $S,T\subseteq\R$.\\
\phx\qquad\qquad Assume $S\subseteq T$. \qquad Then $\Int\,S\subseteq\Int\,T$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The following is called \bfindex[monotonicity of closure]:

\begin{thm}
Let $S,T\subseteq\R$.\\
\phx\qquad\qquad Assume $S\subseteq T$. \qquad Then $\Cl\,S\subseteq\Cl\,T$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
For any $U\subseteq\R$, we have $\Int\,U\subseteq U$, and so:\\
\phx\quad $\,\,U=\Int\,U$ \qquad iff \qquad $U\subseteq\Int\,U$.\\
\\
For any $U\subseteq\R$, for any $a\in\R$, we have:\\
\phx\quad $\,\,a\in\Int\,U$ \qquad iff \qquad $\exists\delta>0$ s.t.~$B(a,\delta)\subseteq U$\\
\phx\qquad\qquad\qquad\qquad iff \qquad $B\in\scrb(a)$ s.t.~$B\subseteq U$.\\
\\
For any $U\subseteq\R$, we have:\\
\phx\quad $\,\,U$ is open \qquad iff \qquad $U=\Int\,U$\\
\phx\qquad\qquad\qquad\qquad iff \qquad $U\subseteq\Int\,U$\\
\phx\qquad\qquad\qquad\qquad iff \qquad $\forall a\in U$, $a\in\Int\,U$\\
\phx\qquad\qquad\qquad\qquad iff \qquad $\forall a\in U$, $\exists\delta>0$ s.t.~$B(a,\delta)\subseteq U$\\
\phx\qquad\qquad\qquad\qquad iff \qquad $\forall a\in U$, $B\in\scrb(a)$ s.t.~$B\subseteq U$.\\
\\
It follows that the singleton set $\{0\}$ is not open.

\begin{thm}
Let $U\in\scrb_\R$. Then $U$ is open.
\end{thm}

\begin{proof}
{\bf Want:} $\forall x\in U$, $\exists B\in\scrb(x)$ s.t.~$B\subseteq U$.\\
Given $x\in U$. \quad {\bf Want:} $\exists B\in\scrb(x)$ s.t.~$B\subseteq U$.\\
By the Subset Recentering Theorem, $\exists B\in\scrb(x)$ s.t.~$B\subseteq U$.
\end{proof}

\begin{thm}
Let $U,V\subseteq\R$. Assume $U$, $V$ are both open.\\
\phx\quad Then: \qquad $U\cup V$ and $U\cap V$ are both open.
\end{thm}

\begin{proof}
This is HW\#11-4.
\end{proof}


\begin{thm}
Let $C,D\subseteq\R$. Assume $C$, $D$ are both closed.\\
\phx\quad Then: \qquad $C\cap D$ and $C\cup D$ are both closed.
\end{thm}

\begin{proof}
Let $U:=\R\bksl C$ and $V:=\R\bksl D$.\\
Then $U$ and $V$ are both open.\\
Then $U\cup V$ and $U\cap V$ are both open.\\
Then $R\bksl(U\cup V)$ and $\R\bksl(U\cap V)$ are both closed.\\
We have $\,\,\,R\bksl(U\cup V)=(\R\bksl U)\cap(\R\bksl V)=C\cap D$\\
\phx\quad and $\,\,\,\,\,\,\,\R\bksl(U\cap V)=(\R\bksl U)\cup(\R\bksl V)=C\cup D$.\\
Then $C\cap D$ and $C\cup D$ are both closed.
\end{proof}

\section{Sequences in $\R$}

\subsection{Limit of a sequence in $\R$}

\begin{defn}
Let $s$ be a sequence, $K\in\N$.\\
\phx\qquad\qquad Then the $K$-\bfindex[tail] of $s$ is $(s_K,s_{K+1},s_{K+2},\ldots)$.
\end{defn}

\begin{thm}
The $7$ tail of $(1,1/2,1/3,\ldots)$ is $(1/7,1/8,1/9,\ldots)$.
\end{thm}

\noindent
We next define \bfindex[limit of a sequence in $\R$]:

\begin{defn}
Let $s\in\R^\N$, $a\in\R$.
Then $\boxed{s\to a}$ means:\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,|s_j-a|<\vep\,\,)$.
\end{defn}

\noindent
We next define the \bfindex[constant function on $S$ with value $a$]:

\begin{defn}
Let $S$ be a set, $a$ an object. Then:\\
\phx\qquad\qquad\qquad\qquad\qquad $\boxed{C_a^S}:S\to\{a\}$ is defined by:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\forall x\in S$, \quad $C_a^S(x)=a$.
\end{defn}

\begin{thm}
$\forall a$, \quad $C_a^\N\,=\,(\,a\,,\,a\,,\,a\,,\,a\,,\,a\,,\,a\,,\,\ldots)$.
\end{thm}

\begin{thm}
Let $a\in\R$. Then $C_a^\N\to a$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(C_a^\N)_j-a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(C_a^\N)_j-a|<\vep\,)$.\\
Let $K:=1$. \qquad Then $K\in\N$.\\
{\bf Want:} $\forall j\in\N$, \quad $(\,j\ge K\,)\,\Rightarrow\,(\,|(C_a^\N)_j-a|<\vep\,)$.\\
Given $j\in\N$. Assume $j\ge K$.  {\bf Want:} $|(C_a^\N)_j-a|<\vep$.\\
We have $|(C_a^\N)_j-a|=|a-a|=|0|=0<\vep$.\\
\end{proof}

\begin{thm}
$(1,1/2,1/3,\ldots)\to0$.
\end{thm}

\begin{proof}
Let $s:=(1,1/2,1/3,\ldots)$. \qquad\quad
$\forall j\in\N$, $s_j=1/j$.\\
{\bf Want:} $s\to0$.\\
{\bf Want:} $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,|s_j-0|<\vep\,\,)$.\\
Given $\vep>0$. \quad
{\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,|s_j-0|<\vep\,\,)$.\\
By the AP, choose $K\in\N$ s.t.~$K>1/\vep$. \quad Then $K\in\N$.\\
{\bf Want:} $\forall j\in\N$, $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,|s_j-0|<\vep\,\,)$.\\
Given $j\in\N$. \quad
Assume $j\ge K$. \quad
{\bf Want:}$|s_j-0|<\vep$.\\
Since $\vep>0$, we get: $1/\vep>0$ and $1/(1/\vep)=\vep$.\\
Since $j\ge K>1/\vep$, we get $j>1/\vep$.\\
Since $j>1/\vep>0$, we get $1/j<1/(1/\vep)$.\\
Since $j\in\N>0$, we get $j>0$, so $1/j>0$, so $|1/j|=1/j$.\\
Then $|s_j-0|=|s_j|=|1/j|=1/j<1/(1/\vep)=\vep$.
\end{proof}

\begin{defn}
Let $s\in\R^\N$. Then $\boxed{s\to\infty}$ means:\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall M\in\R$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,s_j>M\,\,)$.
\end{defn}

\begin{defn}
Let $s\in\R^\N$. Then $\boxed{s\to-\infty}$ means:\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall N\in\R$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,s_j<N\,\,)$.
\end{defn}

\begin{thm}
Let $s\in\R^\N$, $a,c\in\R$.\\
\phx\quad Assume $s\to a$. \quad Then $c\cdot s\to c\cdot a$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(c\cdot s)_j-c\cdot a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(c\cdot s)_j-c\cdot a|<\vep\,)$.\\
Let $\rho:=\vep/(|c|+1)$.\qquad Then $\rho>0$.\\
Since $s_j\to a$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|s_j-a|<\rho\,)$.\\
Then $K\in\N$. {\bf Want:} $\forall j\in\N$, $(\,j\ge K\,)\,\Rightarrow\,(\,|(c\cdot s)_j-c\cdot a|<\vep\,)$.\\
Given $j\in\N$. Assume $j\ge K$. {\bf Want:} $|(c\cdot s)_j-c\cdot a|<\vep$.\\
Since $j\ge K$, by the choice of $K$, we have $|s_j-a|<\rho$.\\
By definition of $\rho$, we have $|c|\cdot\rho<\vep$.\\
Then $\,\,|\,(c\cdot s)_j\,-\,c\cdot a\,|\,\,=\,\,|\,c\cdot s_j\,-\,c\cdot a\,|$\\
\phx\qquad\qquad\qquad\qquad\qquad $=\,\,|\,c\cdot(s_j\,-\,a)\,|$\\
\phx\qquad\qquad\qquad\qquad\qquad $=\,\,|\,c\,|\cdot|\,s_j\,-\,a\,|$\\
\phx\qquad\qquad\qquad\qquad\qquad $\le\,\,|\,c\,|\cdot\,\rho\,\,<\,\,\vep$.
\end{proof}

\begin{thm}
Let $s,t\in\R^\N$, $a,b\in\R$.\\
\phx\quad Assume $s\to a$ and $t\to b$. \quad Then $s+t\to a+b$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(s+t)_j-(a+b)|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(s+t)_j-(a+b)|<\vep\,)$.\\
Since $s\to a$, choose $L\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge L\,)\,\Rightarrow\,(\,|s_j-a|<\vep/2\,)$.\\
Since $t\to b$, choose $M\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge M\,)\,\Rightarrow\,(\,|t_j-b|<\vep/2\,)$.\\
Let $K:=\max\{L,M\}$. \qquad Then $K\in\N$.\\
{\bf Want:} $\forall j\in\N$, \quad $(\,j\ge K\,)\,\Rightarrow\,(\,|(s+t)_j-(a+b)|<\vep\,)$.\\
Given $j\in\N$. Assume $j\ge K$. {\bf Want:} $|(s+t)_j-(a+b)|<\vep$.\\
Since $j\ge K\ge L$, by the choice of $L$, we have $|s_j-a|<\vep/2$.\\
Since $j\ge K\ge M$, by the choice of $M$, we have $|t_j-b|<\vep/2$.\\
Then $\,\,|(s+t)_j-(a+b)|\,\,=\,\,|(s_j+t_j)-(a+b)|$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $=\,\,|(s_j-a)+(t_j-b)|$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $\le\,\,|s_j-a|+|t_j-b|$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $<\,\,(\vep/2)+(\vep/2)\,\,=\,\,\vep$.
\end{proof}

\begin{thm}\wrlab{thm-prod-of-lims}
Let $s,t\in\R^\N$, $a,b\in\R$.\\
\phx\quad Assume $s\to a$ and $t\to b$. \quad Then $s\cdot t\to a\cdot b$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(s\cdot t)_j-(a\cdot b)|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(s\cdot t)_j-(a\cdot b)|<\vep\,)$.\\
Let $\rho\,\,:=\,\,\min\,\{\,1\,,\,\vep\,/\,(|b|+|a|+2)\,\}$. \qquad Then $\rho>0$.\\
Since $s\to a$, choose $L\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge L\,)\,\Rightarrow\,(\,|s_j-a|<\rho\,)$.\\
Since $t\to b$, choose $M\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge M\,)\,\Rightarrow\,(\,|t_j-b|<\rho\,)$.\\
Let $K:=\max\{L,M\}$. \qquad Then $K\in\N$.\\
{\bf Want:} $\forall j\in\N$, \quad $(\,j\ge K\,)\,\Rightarrow\,(\,|(s\cdot t)_j-(a\cdot b)|<\vep\,)$.\\
Given $j\in\N$. Assume $j\ge K$. {\bf Want:} $|(s\cdot t)_j-(a\cdot b)|<\vep$.\\
Since $j\ge K\ge L$, by the choice of $L$, we have $|s_j-a|<\rho$.\\
Since $j\ge K\ge M$, by the choice of $M$, we have $|t_j-b|<\rho$.\\
By definition of $\rho$, we have: $\rho\le1$ and $\rho\cdot(|b|+|a|+1)<\vep$.\\
By the Naive Product Rule,\\
\phx\quad $(s_j\cdot t_j)-(a\cdot b)=(s_j-a)\cdot b+a\cdot(t_j-b)+(s_j-a)\cdot(t_j-b)$.\\
Then $\,\,|(s\cdot t)_j-(a\cdot b)|\,\,=\,\,|(s_j\cdot t_j)-(a\cdot b)|$\\
\phx\qquad\qquad\qquad $=\,\,|(s_j-a)\cdot b+a\cdot(t_j-b)+(s_j-a)\cdot(t_j-b)|$\\
\phx\qquad\qquad\qquad $\le\,\,|s_j-a|\cdot|b|+|a|\cdot|t_j-b|+|s_j-a|\cdot|t_j-b|$\\
\phx\qquad\qquad\qquad $\le\,\,\rho\cdot|b|+|a|\cdot\rho+\rho\cdot\rho$\\
\phx\qquad\qquad\qquad $=\,\,\rho\cdot(|b|+|a|+\rho)$\\
\phx\qquad\qquad\qquad $\le\,\,\rho\cdot(|b|+|a|+1)\,\,<\,\,\vep$.
\end{proof}

\begin{thm}\wrlab{thm-reciproc-limit}
Let $s\in(\R_0^\times)^\N$, $a\in\R_0^\times$.\\
\phx\quad Assume $s\to a$. \quad Then $1/s\to1/a$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(1/s)_j-(1/a)|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|(1/s)_j-(1/a)|<\vep\,)$.\\
Since $a\in\R_0^\times$, we get $|a|>0$ and $a^2>0$.\\
Let $\rho\,\,:=\,\,\min\,\{\,|a|/2\,,\,\vep\cdot a^2/2\,\}$. \qquad Then $\rho>0$.\\
Since $s\to a$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|s_j-a|<\rho\,)$.\\
Let $K:=\max\{L,M\}$. \qquad Then $K\in\N$.\\
{\bf Want:} $\forall j\in\N$, \quad $(\,j\ge K\,)\,\Rightarrow\,(\,(1/s)_j-(1/a)\,)|<\vep\,)$.\\
Given $j\in\N$. Assume $j\ge K$. {\bf Want:} $|(1/s)_j-(1/a)|<\vep$.\\
Since $j\ge K$, by the choice of $K$, we have $|s_j-a|<\rho$.\\
By definition of $\rho$, we have: $\rho\le|a|/2$ and $2\cdot\rho\,/\,a^2\,\,\le\,\,\vep$.\\
We have $|a|-\rho\ge|a|-(|a|/2)=|a|/2$, so $|a|-\rho\ge|a|/2$.\\
Since $|\bullet|$ is distance semi-decreasing, we get $|\,|s_j|\,-\,|a|\,|\,\,\le\,\,|\,s_j\,-a\,|$.\\
Since $|\,|s_j|\,-\,|a|\,|\,\,\le\,\,|\,s_j\,-a\,|\,\,<\,\,\rho$, we get $|a|-\rho\,<\,|s_j|\,<\,|a|+\rho$.\\
Then $|s_j|>|a|-\rho\ge|a|/2$, so $|s_j|>|a|/2$.\\
\\
Then $\,\,\ds{\,\,|(1/s)_j-(1/a)|\,\,=\,\,\left|\frac{a-s_j}{a\cdot s_j}\right|}$\\
\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\frac{|a-s_j|}{|a|\cdot|s_j|}}$\\
\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{<\,\,\frac{|s_j-a|}{|a|\cdot(|a|/2)}}$\\
\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{<\,\,\frac{\rho}{|a|^2/2}\,\,=\,\,\frac{\rho}{a^2/2}\,\,=\,\,2\cdot\rho\,/\,a^2\,\,\le\,\,\vep}$.
\end{proof}

\begin{thm}
Let $s\in\R^\N$, $t\in(\R_0^\times)^\N$, $a\in\R$, $b\in\R_0^\times$.\\
\phx\quad Assume $s\to a$ and $t\to b$. \quad Then $s/t\to a/b$.
\end{thm}

\begin{proof}
By \tref{thm-reciproc-limit}, $1/t\to1/b$.\\
So, since $s\to a$, by \tref{thm-prod-of-lims}, we get $s\cdot(1/t)\to a\cdot(1/b)$.\\  
By \tref{thm-s-times-1overt-is-sovert}, $s\cdot(1/t)=s/t$. \quad Also $a\cdot(1/b)=a/b$.\\
Then $s/t\to a/b$.  
\end{proof}

\begin{thm}\wrlab{thm-alt-lim-def}
Let $s\in\R^\N$, $a\in\R$, $\vep>0$.\\
\phx\quad Assume $s\to a$. \qquad Then $\exists K\in\N$ s.t., $\forall j\in\N$, $s_j\in B(a,\vep)$.
\end{thm}

\begin{proof}
Since $s\to a$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|s_j-a|<\vep\,)$.\\
Then $K\in\N$. \qquad {\bf Want:} $\forall j\in[K..\infty)$, \quad $s_j\in B(a,\vep)$.\\
Given $j\in[K..\infty)$. \quad {\bf Want:} $s_j\in B(a,\vep)$.\\
We have $j\in[K..\infty)\subseteq\N$ and $j\in[K..\infty)\ge K$,\\
\phx\qquad so, by choice of $K$, we get $|s_j-a|<\vep$, and so $s_j\in B(a,\vep)$.
\end{proof}

\begin{thm}
Let $s:=(1,-1,1,-1,1,-1,\ldots)$.\\
\phx\qquad Then, $\forall a\in\R$, $\neg(s_j\to a)$.
\end{thm}

\begin{proof}
Given $a\in\R$. \quad {\bf Want:} $\neg(s_j\to a)$.\\
Assume $s_j\to a$. \quad {\bf Want:} Contradiction.\\
\\
{\it Claim:} $\forall j\in\N$, $|s_{j+1}-s_j|=2$.\\
{\it Proof of claim:}
Given $j\in\N$. {\bf Want:} $|s_{j+1}-s_j|=2$.\\
We have: \qquad (1) $j\in2\N$ \qquad or \qquad (2) $j\in2\N+1$.\\
\\
{\it Case (1):}\\
We have $s_j=-1$ and $s_{j+1}=1$, so $s_{j+1}-s_j=2$, so $|s_{j+1}-s_j|=2$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
We have $s_j=1$ and $s_{j+1}=-1$, so $s_{j+1}-s_j=-2$, so $|s_{j+1}-s_j|=2$.\\
{\it End of Case (2).}\\
{\it End of proof of claim.}\\
\\
Since $s_j\to a$, choose $K\in\N$ s.t., $\forall j\in\N$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad$(\,j\ge K\,)\,\Rightarrow\,(\,|s_j-a|<1\,)$.\\
Let $j:=K$. \qquad By the claim $|s_{j+1}-s_j|=2$.\\
Since $j\ge K$, by the choice of $K$, we get $|s_j-a|<1$. Then $|a-s_j|<1$.\\
Since $j+1\ge K$, by the choice of $K$, we get $|s_{j+1}-a|<1$.\\
Then $2=|s_{j+1}-s_j|\le|s_{j+1}-a|+|a-s_j|<1+1=2$.\\
Then $2<2$. \qquad Contradiction
\end{proof}

The preceding theorem shows some sequences that have no limit.

\begin{defn}
Let $s\in\R^\N$. Then $\boxed{\LIMS_s}:=\{a\in\R\,|\,s\to a\}$.
\end{defn}

\noindent
Alternate notations: $\LIMS\,s$ and $\LIMS(s)$.\\
The preceding theorem asserts that $\LIMS(1,-1,1,-1,1,-1,\ldots)=\emptyset$.\\
The next theorem asserts that, $\forall s\in\R^\N$, $\#\LIMS_s\le1$.

\begin{thm}\wrlab{thm-uniqueness-of-lim-seq}
Let $s\in\R^\N$, $a,b\in\R$.\\
Assume $s\to a$ and $s\to b$. \qquad Then $a=b$.
\end{thm}

\begin{proof}
Assume $a\ne b$. \qquad {\bf Want:} Contradiction.\\
By the Hausdorff property of $\R$, choose $\vep>0$ s.t.\\
\phx\qquad\qquad\qquad $(B(a,\vep))\cap(B(b,\vep))=\emptyset$.\\
By \tref{thm-alt-lim-def}, choose $K\in\N$ s.t., $\forall j\in[K..\infty)$, $s_j\in B(a,\vep)$.\\
By \tref{thm-alt-lim-def}, choose $L\in\N$ s.t., $\forall j\in[L..\infty)$, $s_j\in B(b,\vep)$.\\
Let $j:=\max\{K,L\}$. \qquad Then $j\in[K..\infty)$ and $j\in[L..\infty)$.\\
Since $j\in[K..\infty)$, by choice of $K$, we get $s_j\in B(a,\vep)$.\\      
Since $j\in[L..\infty)$, by choice of $L$, we get $s_j\in B(b,\vep)$.\\      
Then $s_j\in(B(a,\vep))\cap(B(b,\vep))$.\\
Then $(B(a,\vep))\cap(B(b,\vep))\ne\emptyset$. \qquad Contradiction.
\end{proof}

\begin{defn}
Let $s\in\R^\N$. Then $\boxed{\lim\,s}:=\UE(\LIMS_s)$.
\end{defn}

\noindent
Alternate notation: $\lim(s)$.

\begin{thm}
Let $s\in\R^\N$, $a\in\R$.\\
Then: \qquad $(\,s\to a\,)\,\Leftrightarrow\,(\,\lim s=a\,)$.
\end{thm}

\begin{proof}\phx\\
{\it Proof of $\Rightarrow$:}\\
Assume $s\to a$. \qquad {\bf Want:} $\lim\,s=a$.\\
Since $s\to a$, we get $a\in\LIMS\,s$.\\
Then, by \tref{thm-uniqueness-of-lim-seq}, we have: \quad $\forall b\in\LIMS\,s$, $\,\,$ $a=b$.\\
Then $\LIMS\,s=\{a\}$. \qquad Then $\lim\,s=\UE\{a\}=a$.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume $\lim\,s=a$. \qquad {\bf Want:} $s\to a$.\\
We have $a=\lim\,s=\UE(\LIMS\,s)\,\,\,{}^*\!\!\in\,\,\LIMS\,s$, \quad so $a\in\LIMS\,s$.\\
Since $a\in\LIMS\,s=\{x\in\R\,|\,s\to x\}$, we get $s\to a$.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\subsection{Compact subsets of $\R$}
\begin{defn}
Let $f:\R\drta\R$. Then:\\
\phx\phx $f$ is \bfindex[strictly-increasing] means: $\forall w,x\in\D_f$, $(w<x)\Rightarrow(f_w<f_x)$\\
and\\
\phx\phx $f$ is \bfindex[strictly-decreasing] means: $\forall w,x\in\D_f$, $(w<x)\Rightarrow(f_w>f_x)$.\\
\end{defn}

\begin{defn}
Let $f:\R\drta\R$.\\
\phx\qquad Then $f$ is \bfindex[strictly-monotone] means:\\
\phx\qquad\qquad\quad $f$ is strictly-increasing \qquad or \qquad$f$ is strictly-decreasing.
\end{defn}

\begin{thm}
$(1,4,9,16,25,36,49\ldots)$ is strictly-increasing.
\end{thm}

\noindent
If we reverse $1$ and $4$ in the sequence above, we get a new sequence,\\
\phx\qquad $(4,1,9,16,25,36,49,\ldots)$,\\
which is NOT strictly-increasing.

\begin{thm}
Let $s\in\R^\N$. \quad Then:\\
\phx\qquad $[\,(\,s\hbox{ is strictly-increasing}\,)\,\Leftrightarrow\,(\,\forall j\in\N,\,s_j<s_{j+1}\,)\,]$\\
and\\
\phx\qquad $[\,(\,s\hbox{ is strictly-decreasing}\,)\,\Leftrightarrow\,(\,\forall j\in\N,\,s_j>s_{j+1}\,)\,]$.\\
\end{thm}

\begin{defn}
Let $f:\R\drta\R$. Then:\\
\phx\phx $f$ is \bfindex[semi-increasing] means: $\forall w,x\in\D_f$, $(w\le x)\Rightarrow(f_w\le f_x)$,\\
and\\
\phx\phx $f$ is \bfindex[semi-decreasing] means: $\forall w,x\in\D_f$, $(w\le x)\Rightarrow(f_w\ge f_x)$.\\
\end{defn}

\begin{defn}
Let $f:\R\drta\R$.\\
\phx\qquad Then $f$ is \bfindex[semi-monotone] means:\\
\phx\qquad\qquad\quad $f$ is semi-increasing \qquad or \qquad$f$ is semi-decreasing.
\end{defn}

\begin{thm}\phx\\
\phx\qquad\qquad $(1,1,2,2,3,3,4,4,5,5,\ldots)$ is semi-increasing,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad but NOT strictly-increasing.
\end{thm}

\begin{thm}
Let $s\in\R^\N$. \quad Then:\\
\phx\qquad $[\,(\,s\hbox{ is semi-increasing}\,)\,\Leftrightarrow\,(\,\forall j\in\N,\,s_j\le s_{j+1}\,)\,]$\\
and\\
\phx\qquad $[\,(\,s\hbox{ is semi-decreasing}\,)\,\Leftrightarrow\,(\,\forall j\in\N,\,s_j\ge s_{j+1}\,)\,]$.\\
\end{thm}

\begin{thm}
Let $f,g:\R\drta\R$. \quad Then:\\
\phx\qquad $[\,(\,f\hbox{ is strictly-increasing}\,)\,\&\,(\,g\hbox{ is strictly-increasing}\,)\,]$\\
\phx\qquad\qquad\qquad\qquad $\Rightarrow\,[\,g\circ f\hbox{ is strictly-increasing}\,]$.
\end{thm}

\begin{thm}
Let $f,g:\R\drta\R$. \quad Then:\\
\phx\qquad $[\,(\,f\hbox{ is strictly-decreasing}\,)\,\&\,(\,g\hbox{ is strictly-increasing}\,)\,]$\\
\phx\qquad\qquad\qquad\qquad $\Rightarrow\,[\,g\circ f\hbox{ is strictly-decreasing}\,]$.
\end{thm}

\begin{thm}
Let $f,g:\R\drta\R$. \quad Then:\\
\phx\qquad $[\,(\,f\hbox{ is strictly-increasing}\,)\,\&\,(\,g\hbox{ is strictly-decreasing}\,)\,]$\\
\phx\qquad\qquad\qquad\qquad $\Rightarrow\,[\,g\circ f\hbox{ is strictly-decreasing}\,]$.
\end{thm}

\begin{thm}
Let $f,g:\R\drta\R$. \quad Then:\\
\phx\qquad $[\,(\,f\hbox{ is strictly-decreasing}\,)\,\&\,(\,g\hbox{ is strictly-decreasing}\,)\,]$\\
\phx\qquad\qquad\qquad\qquad $\Rightarrow\,[\,g\circ f\hbox{ is strictly-increasing}\,]$.
\end{thm}

Recall that $\sup\emptyset=-\infty$. Also:

\begin{thm}\wrlab{thm-sup-ne-minus-infty}
Let $X\subseteq\R$.\\
\phx\qquad Assume $X\ne\emptyset$. \qquad Then $\sup X\ne-\infty$.
\end{thm}

\begin{proof}
We have $X\le\sup X$.\\
Since $X\ne\emptyset$, choose $z$ s.t.~$z\in X$\\
Since $z\in Z\subseteq\R>-\infty$, we get $z>-\infty$.\\
Then $-\infty<z\in X\le\sup X$, so $-\infty<\sup X$. Then $\sup X\ne-\infty$.
\end{proof}

\begin{thm}\wrlab{thm-sup-ne-infty}
Let $X\subseteq\R$.\\
\phx\qquad Assume $X$ is bounded above. \qquad Then $\sup X\ne\infty$.
\end{thm}

\begin{proof}
Since $X$ is bounded above, choose $z\in\R$ s.t.~$X\le z$.\\
Then $z\in\UB_X\ge\min\UB_X=\sup X$.\\
Then $\sup X\le z\in\R<\infty$. Then $\sup X<\infty$, so $\sup X\ne\infty$.
\end{proof}

\begin{thm}\wrlab{thm-sup-real}
Let $X\subseteq\R$.\\
\phx\qquad Assume $X\ne\emptyset$ and $X$ is bounded above. \qquad Then $\sup X\in\R$.
\end{thm}

\begin{proof}
We have $\sup X\in\R^*$. \quad {\bf Want:} $\sup X\ne-\infty$ and $\sup X\ne\infty$.\\
By \tref{thm-sup-ne-minus-infty}, $\sup X\ne-\infty$. \quad {\bf Want:} $\sup X\ne\infty$.\\
By \tref{thm-sup-ne-infty}, $\sup X\ne\infty$.
\end{proof}

\begin{thm}\wrlab{thm-semiincr-bdd-above}
Let $s\in\R^\N$.\\
Assume: \quad $s$ is semi-increasing \quad and \quad $\I_s$ is bounded above.\\
Then: \qquad $s\to\sup\I_S$.
\end{thm}

\begin{proof}
Since $\D_s=\N\ne\emptyset$, it follows that $\I_s\ne\emptyset$.\\
So, since $\I_s$ is bounded above, by \tref{thm-sup-real}, we get: $\sup\I_s\in\R$.\\
Let $a:=\sup\I_s$. \qquad Then $a\in\R$. \qquad Want $s\to a$.\\
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall j\in\N$, $(\,j\ge K\,)\,\Rightarrow\,(\,|s_J-a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists\delta>0$ s.t., $\forall j\in\N$, $(\,j\ge K\,)\,\Rightarrow\,(\,|s_J-a|<\vep\,)$.\\
Since $a-\vep<a=\sup\I_s$, we see that $\neg(a-\vep\ge\sup\I_s)$.\\
Then $\neg(a-\vep\ge\I_s)$, so choose $x\in\I_s$ s.t.~$a-\vep<x$.\\
Since $x\in\I_s$, choose $K\in\D_s$ s.t.~$x=s_K$. \quad Then $K\in\D_s=\N$.\\
{\bf Want:} $\forall j\in\N$, \quad $(\,j\ge K\,)\,\Rightarrow\,(\,|s_J-a|<\vep\,)$.\\
Given $j\in\N$. \quad Assume $j\ge K$. \quad {\bf Want:} $|s_J-a|<\vep$.\\
\phx\qquad\qquad\qquad {\bf Want:} $a-\vep<s_j<a+\vep$.\\
Since $s_j\in\I_s\le\sup\I_s=a<a+\vep$, we get $s_j<a+\vep$.\\
\phx\qquad\qquad\qquad {\bf Want:} $a-\vep<s_j$.\\
Since $s$ is semi-increasing, since $j,K\in\N=\D_s$ and since $j\ge K$,\\
\phx\qquad it follows that $s_j\ge s_K$.\\
Then $s_j\ge s_K=x$, so $x\le s_j$. \quad Then $a-\vep<x\le s_j$.
\end{proof}

\begin{thm}\wrlab{thm-semidecr-bdd-below}
Let $s\in\R^\N$.\\
Assume: \quad $s$ is semi-decreasing \quad and \quad $\I_s$ is bounded below.\\
Then: \qquad $s\to\inf\I_S$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\begin{thm}\wrlab{thm-semiincr-not-bdd-above}
Let $s\in\R^\N$.\\
Assume: \quad $s$ is semi-increasing \quad and \quad $\I_s$ is not bounded above.\\
Then: \qquad $s\to\infty$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall M\in\R$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,s_j>M\,)$.\\
Given $M\in\R$. {\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,s_j>M\,)$.\\
Since $\I_s$ is not bounded above, we get: $\neg(\I_s\le M)$.\\
Choose $a\in\I_s$ s.t.~$a>M$.\\
Since $a\in\I_s$, choose $K\in\D_s$ s.t.~$a=s_K$.\\
Since $s\in\R^\N$, we get $\D_s=\N$. \quad Then $K\in\D_s=\N$.\\
{\bf Want:} $\forall j\in\N$, $\,$ $(\,j\ge K\,)\,\Rightarrow\,(\,s_j>M\,)$.\\
Given $j\in\N$. \quad Assume $j\ge K$. \quad {\bf Want:} $s_j>M$.\\
By hypothesis, $s$ is semi-increasing, so, since $j\ge K$, we get: $s_j\ge s_K$.\\
By choice of $K$, we get: $s_K=a$. \quad Then $s_j\ge s_K=a$.
\end{proof}

\begin{thm}\wrlab{thm-semidecr-not-bdd-below}
Let $s\in\R^\N$.\\
Assume: \quad $s$ is semi-decreasing \quad and \quad $\I_s$ is not bounded below.\\
Then: \qquad $s\to-\infty$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\begin{thm}
Let $s\in\R^\N$.\\
Assume $s$ is semi-monotone and $\I_s$ is bounded.
Then $s$ is convergent.
\end{thm}

\begin{proof}
At least one of the following must be true:\\
\phx\qquad\qquad (1) $s$ is semi-increasing \qquad or \qquad (2) $s$ is semi-decreasing.\\
\\
{\it Case (1):}
By \tref{thm-semiincr-bdd-above}, $s$ is convergent.
{\it End of Case (1).}\\
\\
{\it Case (2):}
By \tref{thm-semidecr-bdd-below}, $s$ is convergent.
{\it End of Case (2).}
\end{proof}

\begin{thm}
Let $s$ be a sequence, $k\in\N^\N$.\\
\phx\qquad\qquad\qquad Then $s\circ k\,\,=\,\,(s_{k_1},s_{k_2},s_{k_3},\ldots)$.
\end{thm}

\begin{thm}\phx\\
\phx\qquad\qquad $(1,1/2,1/3,\ldots)\circ(1,4,9,16,\ldots)\,\,=\,\,(1,1/4,1/9,1/16,\ldots)$.
\end{thm}

\begin{thm}
$\forall$sequences $s$,\\
\phx\qquad\qquad\qquad $s\circ(1,4,9,16,\ldots)\,\,=\,\,(s_1,s_4,s_9,s_{16},\ldots)$.
\end{thm}

\noindent
In the next theorem, we consider the sequence $k:\N\to\R$ defined by:\\
\phx\qquad\qquad $k_1=4$ \quad and \quad $k_2=1$ \quad and \quad $\forall j\in[3..\infty)$, $\,$ $k_j=j^2$.\\
Note that $k=(4,1,9,16,\ldots)$.

\begin{thm}
$\forall$sequences $s$,\\
\phx\qquad\qquad\qquad $s\circ(4,1,9,16,\ldots)\,\,=\,\,(s_4,s_1,s_9,s_{16},\ldots)$.
\end{thm}

\begin{thm}\phx\\
\phx\qquad\qquad $(1,1/2,1/3,\ldots)\circ(4,1,9,16,\ldots)\,\,=\,\,(1/4,1,1/9,1/16,\ldots)$.
\end{thm}

\begin{thm}\phx\\
\phx\qquad $(1,-1,1,-1,-1,1,-1,\ldots)\circ(1,3,5,7,\ldots)\,\,=\,\,(1,1,1,1,\ldots)$.
\end{thm}

\begin{defn}
Let $s$ and $t$ be sequences.\\
\phx\qquad By $t$ is a \bfindex[subsequence] of $s$, we mean:\\
\phx\qquad\qquad $\exists$strictly-increasing $k\in\N^\N$ s.t.~$t=s\circ k$.
\end{defn}

\begin{thm}\phx\\
\phx\qquad $(1,1/4,1/9,1/16,\ldots)$ is a subsequence of $(1,1/2,1/3,\ldots)$.\\
\phx\qquad $(1/4,1,1/9,1/16,\ldots)$ is NOT a subsequence of $(1,1/2,1/3,\ldots)$.\\
\phx\qquad $(1,1,1,\ldots)$ is a subsequence of $(1,-1,1,-1,1,-1,1,-1,\ldots)$.
\end{thm}

\begin{thm}
Let $s$ be a sequence.\\
\phx\qquad\qquad\qquad\qquad Then $s$ is a subsequence of $s$.
\end{thm}

\begin{proof}
Since $\id^\N\in\N^\N$ and $\id^\N$ is strictly-increasing and $s\circ\id^\N=s$,\\
\phx\qquad we conclude that: $s$ is a subsequence of $s$.
\end{proof}

\begin{thm}
Let $s$ be a sequence and let $t$ be a subsequence of $s$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $\I_t\subseteq\I_s$.
\end{thm}

\begin{proof}
Choose a strictly-increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
Then $\I_t=\I_{s\circ\ell}\subseteq\I_s$.
\end{proof}

\begin{thm}
Let $A$ be a set, $s\in\A^\N$.\\
Let $t$ be a subsequence of $s$. \qquad Then $t\in\A^\N$.
\end{thm}

\begin{proof}
Choose a strictly-increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
Since $\ell:\N\to\N$ and $s:\N\to A$, we get $s\circ\ell:\N\to A$.\\
So, since $t=s\circ\ell$, we get $t:\N\to A$. \quad Then $t\in A^\N$.
\end{proof}

\begin{defn}
Let $s\in\R^\N$.\\
\phx\qquad By $s$ is \bfindex[convergent], we mean: \quad $\exists a\in\R$ s.t.~$s\to a$.
\end{defn}

\begin{thm}\phx\\
\phx\qquad $(1,1/2,1/3,\ldots)$ is convergent.\\
\phx\qquad $(1,-1,1,-1,1,-1,\ldots)$ is not convergent.
\end{thm}

\noindent
The following is left as unassigned HW:

\begin{thm}
$\forall s\in\R^\N$,\\
\phx\qquad\qquad $(\,\,s\to\infty\,\,)\,\,\Rightarrow\,\,(\,\,s\hbox{ is not convergent}\,\,)$.
\end{thm}

\begin{thm}\phx\\
\phx\quad $(2,4,6,8,10,12,\ldots)$ is NOT convergent.
\end{thm}

\noindent
While the set of extended reals $\R^*$ does not have a standard ``distance'', as $\R$ does,
it does have a standard topology, if you happen to know what that means. We have:\\
\phx\quad $(2,4,6,8,10,12,\ldots)$ is convergent in $\R^*$, but NOT in $\R$ \quad and\\
\phx\quad $(1,-1,1,-1,1,-1,\ldots)$ is NEITHER convergent in $\R^*$ NOR in $\R$.\\
For any $s\in\R^\N$, if we say $s$ is convergent, and if we want to be completely clear,
we should say ``in $\R$'' or ``in $\R^*$''; however, in this course we will always mean ``in $\R$''.
We do not even assume the reader knows what a topological space is,
so ``convergent in $\R^*$'' is not defined.

\begin{thm}\wrlab{thm-each-seq-subseq-of-itself}
Let $s,t,u$ be sequences.\\
\phx\quad Assume: \quad $u$ is a subsequence of $t$ \quad and \quad $t$ is a subsequence of $s$.\\
\phx\quad Then: \qquad\qquad\qquad\qquad $u$ is a subsequence of $s$.
\end{thm}

\begin{proof}
Since $u$ is a subsequence of $t$,\\
\phx\qquad choose a strictly-increasing $\ell\in\N^\N$ s.t.~$u=t\circ\ell$.\\
Since $t$ is a subsequence of $s$,\\
\phx\qquad choose a strictly-increasing $k\in\N^\N$ s.t.~$t=s\circ k$.\\
Since $k\circ\ell\in\N^\N$ and $k\circ\ell$ is strictly-increasing and $u=s\circ k\circ\ell$,\\
\phx\qquad we conclude that: $u$ is a subsequence of $s$.
\end{proof}

\begin{thm}\wrlab{thm-str-incr-N-to-N-ge-identity}
Let $k\in\N^\N$. Assume $k$ is strictly increasing.\\
\phx\qquad\qquad\qquad Then: \quad $\forall j\in\N$, $\,$ $k_j\ge j$.
\end{thm}

\noindent
An informal proof is as follows:\\
\phx\quad Since $k$ is increasing, we have: $k_1<k_2<k_3<\ldots$.\\
\phx\quad {\bf Want:} $k_1\ge1$, $k_2\ge2$, $k_3\ge3$, {\it etc.}\\
\phx\quad We have: $k_1\in\N\ge1$, so $k_1\ge1$.\\
\phx\quad Then $k_2>k_1\ge1$ and $k_2\in\N$, so $k_2\in(1..\infty)\ge2$.\\
\phx\quad Then $k_3>k_2\ge2$ and $k_3\in\N$, so $k_3\in(2..\infty)\ge3$.\\
\phx\quad Then $k_4>k_3\ge3$ and $k_4\in\N$, so $k_4\in(3..\infty)\ge4$.\\
\phx\quad {\it Etc.}\\
A formal proof, by math induction, is left as unassigned HW.

\begin{thm}\wrlab{thm-subseq-conv-seq-is-conv}
Let $s,t\in\R^\N$, $a\in\R$.\\
\phx\qquad Assume: \quad $s\to a$ \quad and \quad $t$ is a subsequence of $s$.\\
\phx\qquad Then: \qquad $\,t\to a$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|t_j-a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|t_j-a|<\vep\,)$.\\
Since $s\to a$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,j\ge K\,)\,\Rightarrow\,(\,|s_j-a|<\vep\,)$.\\
Then $K\in\N$. \quad {\bf Want:} $\,$ $\forall j\in\N$, $(\,j\ge K\,)\,\Rightarrow\,(\,|t_j-a|<\vep\,)$.\\
Given $j\in\N$. \quad Assume $j\ge K$. \quad {\bf Want:} $|t_j-a|<\vep$.\\
Since $t$ is a subsequence of $s$,\\
\phx\quad choose a strictly-increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
By \tref{thm-str-incr-N-to-N-ge-identity}, $\ell_j\ge j$.\\
Since $\ell_j\ge j\ge K$, by the choice of $K$, we have $|s_{\ell_j}-a|<\vep$.\\
Then $|t_j-a|=|(s\circ\ell)_j-a|=|s_{\ell_j}-a|<\vep$.
\end{proof}

\noindent
The proof of the following two theorems are both\\
\phx\qquad similar to that of the preceding theorem.\\
They are left as unassigned HWs.

\begin{thm}\wrlab{thm-subseq-conv-inf-seq-is-conv}
Let $s,t\in\R^\N$.\\
\phx\qquad Assume: \quad $s\to\infty$ \quad and \quad $t$ is a subsequence of $s$.\\
\phx\qquad Then: \qquad $\,t\to\infty$.
\end{thm}

\begin{thm}\wrlab{thm-subseq-conv-minusinf-seq-is-conv}
Let $s,t\in\R^\N$.\\
\phx\qquad Assume: \quad $s\to-\infty$ \quad and \quad $t$ is a subsequence of $s$.\\
\phx\qquad Then: \qquad $\,t\to-\infty$.
\end{thm}

\noindent
Because of the following three theorems, we know:\\
\phx\quad Let $s,t\in\R^\N$, $a\in\R^*$.\\
\phx\qquad Assume: \quad $s\to a$ \quad and \quad $t$ is a subsequence of $s$.\\
\phx\qquad Then: \qquad $\,t\to a$.\\
It is natural to wonder if there might be some way to prove this,\\
without breaking the proof up into three cases:\\
\phx\qquad\qquad $a=-\infty$ \quad or \quad $a\in\R$ \quad or \quad $a=\infty$.\\
There IS such a proof, but it requires the reader to understand the basics of topology.

\begin{defn}
Let $s\in\R^\N$.\\
\phx\qquad By $s$ is \bfindex[subconvergent], we mean:\\
\phx\qquad\qquad $\exists$ subsequence $t$ of $s$ s.t.~$t$ is convergent.
\end{defn}

\noindent
In this course, for any $s\in\R^\N$, saying\\
\phx\qquad $s$ is subconvergent\\
will always mean\\
\phx\qquad $s$ is subconvergent in $\R$.\\
By \tref{thm-each-seq-subseq-of-itself}, convergent implies subconvergent.

\begin{thm}
$\forall$ convergent $s\in\R^\N$, $s$ is subconvergent.
\end{thm}

\begin{thm}
$(1,1/2,1/3,\ldots)$ is subconvergent.
\end{thm}

\begin{thm}\phx\\
\phx\quad $(1,-1,1,-1,1,-1,1,-1,\ldots)$ is subconvergent, but NOT convergent.
\end{thm}

\begin{thm} $(2,4,6,8,\ldots)$ is NOT subconvergent.
\end{thm}

\begin{thm} $(1,2,1,4,1,6,1,8,\ldots)$ is subconvergent.
\end{thm}

\begin{defn}
Let $X\subseteq\R$, $s\in X^\N$.\\
\phx\quad By $s$ is \bfindex[convergent in $X$], we mean:\\
\phx\qquad\qquad $\exists z\in X$ s.t.~$s\to z$.
\end{defn}

\begin{thm}
$(1,1/2,1/3,\ldots)$ is convergent in $[0;1]$.
\end{thm}

\begin{thm}
$(1,1/2,1/3,\ldots)$ is NOT convergent in $(0;1]$.
\end{thm}

\begin{defn}
Let $X\subseteq\R$, $s\in X^\N$.\\
\phx\quad By $s$ is \bfindex[subconvergent in $X$], we mean:\\
\phx\qquad\qquad $\exists$subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.
\end{defn}

\noindent
By \tref{thm-each-seq-subseq-of-itself}, convergent in $X$ implies subconvergent in $X$.

\begin{thm}\phx\\
\phx\quad $(1,-1,1,-1,1,-1,1,-1,\ldots)$ is subconvergent in $[-1;1]$.
\end{thm}

\begin{thm}
$(1,1/2,1/3,\ldots)$ is subconvergent in $[0;1]$.
\end{thm}

\begin{thm}\wrlab{thm-half-open-not-cpt}
$(1,1/2,1/3,\ldots)$ is NOT subconvergent in $(0;1]$.
\end{thm}

\begin{defn}
Let $K\subseteq\R$.\\
\phx\quad By $K$ is \bfindex[compact], we mean:\\
\phx\qquad\qquad $\forall s\in K^\N$, $\,$ $s$ is subconvergent in $K$.
\end{defn}

\begin{defn}
Let $a\in\R$, $r\ge0$.\\
\phx\qquad\qquad\qquad\qquad
Then $\boxed{\barB(a,r)}\,\,:=\,\,\{\,\,x\in\R~\hbox{s.t.}~|x-a|\le r\,\,\}$.
\end{defn}

\noindent
In the preceding definition, $\barB(a,r)$ is called\\
\phx\qquad the \bfindex[closed ball] about $a$ of radius $r$.\\
Note: \quad $\forall a\in\R$, $\forall r\ge0$, $\,$ $\barB(a,r)=[a-r;a+r]$.\\
Then: \quad $\forall r\ge0$, $\,$ $\barB(0,r)=[-r;r]$.\\

\begin{thm}\wrlab{thm-cpt-implies-bdd}
Let $X\subseteq\R$.\\
\phx\qquad Assume $X$ is compact. \quad Then $X$ is bounded.
\end{thm}

\begin{proof}
Assume $X$ is not bounded. {\bf Want:} Contradiction.\\
\\
{\it Claim 1:} \quad $\forall j\in\N$, $\,$ $X\bksl(\barB(0,j))\ne\emptyset$.\\
{\it Proof of Claim 1:}
Given $j\in\N$. \quad {\bf Want:} $X\bksl(\barB(0,j))\ne\emptyset$.\\
Since $\barB(0,j)\subseteq B(0,j+1)$, we see that $\barB(0,j)$ is bounded.\\
Since $\barB(0,j)$ is bounded and $X$ is not bounded, $X\not\subseteq(\barB(0,j))$.\\
Then $\exists x$ s.t. \quad both \quad $x\in X$ \quad and \quad $x\notin\barB(0,j)$.\\
Then $\exists x$ s.t.~$x\in X\bksl(\barB(0,j))$. \quad Then $X\bksl(\barB(0,j))\ne\emptyset$.\\
{\it End of proof of Claim 1.}\\
\\
By Claim 1, $\forall j\in\N$, $\,$ $X\bksl(\barB(0,j))\ne\emptyset$.\\
Define $s\in X^\N$ by: $\forall j\in\N$, $\,$ $s_j=\CH_{X\bksl(\barB(0,j))}$.\\
Since $s\in X^\N$ and $X$ is compact, $s$ is subconvergent in $X$.\\
Choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
Then $t$ is convergent, and so $\I_t$ is bounded.\\
By \tref{thm-bdd-btwn-minusr-r}, choose $r>0$ s.t.~$\I_t\subseteq B(0,r)$.\\
By the AP, choose $j\in\N$ s.t.~$j>r$.\\
Since $t$ is a subsequence of $s$,\\
\phx\qquad choose a strictly-increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
Then $\ell_j\ge j$. \quad Let $m:=\ell_j$. \quad Then $m\ge j$.\\
\\
{\it Claim 2:} $|s_m|>m$.\\
{\it Proof of Claim 2:}
By Claim 1, $X\bksl\barB(0,m)\ne\emptyset$.\\
By definition of $s$, we have $s_m=\CH_{X\bksl(\barB(0,m))}$.\\
Then $s_m\in X\bksl(\barB(0,m))$.\\
Then $\neg(s_m\in\barB(0,m))$. \quad Then $\neg(|s_m|\le m)$. \quad Then $|s_m|>m$.\\
{\it End of proof of Claim 2.}\\
\\
We have $t_j\in\I_t\subseteq B(0,r)$, \quad so $|t_j|<r$.\\
We have $s_m=s_{\ell_j}=(s\circ\ell)_j=t_j$, \quad and so $|t_j|=|s_m|$.\\
By Claim 2, $|s_m|>m$. \quad Then $|t_j|=|s_m|>m\ge j>r$, so $r<|t_j|$.\\
Then $r<|t_j|<r$, so $r<r$. \qquad Contradiction.
\end{proof}

\subsection{Maximizing compact subsets of $\R$}

\begin{thm}\wrlab{thm-cpt-subset-R-implies-bddabove}
Let $L\subseteq\R$.\\
\phx\qquad Assume $L$ is compact. \qquad Then $L$ is bounded above.
\end{thm}

\begin{proof}
This follows from \tref{thm-cpt-implies-bdd}.
\end{proof}

\noindent
By HW\#7-3 (The Squeeze Theorem), we have:

\begin{thm}
Let $t\in\R^\N$, $a\in\R$.\\
\phx\qquad Assume: $\forall j\in\N$, \quad $a-(1/j)\le t_j\le a$.\\
\phx\qquad Then: $t\to a$.
\end{thm}

\noindent
We restate the theorem with $t$ replaced by $s$:

\begin{thm}\wrlab{thm-squeeze-example}
Let $s\in\R^\N$, $a\in\R$.\\
\phx\qquad Assume: $\forall j\in\N$, \quad $a-(1/j)\le s_j\le a$.\\
\phx\qquad Then: $s\to a$.
\end{thm}

\begin{thm}\wrlab{thm-max-cpt-subset-R-exists}
Let $L\subseteq\R$.\\
\phx\qquad Assume $L$ is compact and nonempty. \quad
Then $\max L\ne\frownie$.
\end{thm}

\begin{proof}
Since $L$ is compact, $L$ is bounded.\\
Since $L$ is bounded and nonempty, $\sup L\in\R$.\\
Let $a:=\sup L$. \quad Then $a\in\R$. \quad {\bf Want:} $\max L=a$.\\
{\bf Want:} $a\in L$ and $a\ge L$.\\
We have $a=\sup L\ge L$. \quad {\bf Want:} $a\in L$.\\
For all $j\in\N$, let $X_j\,:=\,L\,\cap\,(\,a-(1/j)\,;\,\infty\,)$.\\
\\
{\it Claim 1:} $\forall j\in\N$, $X_j\ne\emptyset$.\\
{\it Proof of Claim 1:} Given $j\in\N$. {\bf Want:} $X_j\ne\emptyset$.\\
Because $a-(1/j)<a=\sup L$,\\
\phx\qquad we get $\neg(a-(1/j)\ge\sup L)$,\\
\phx\qquad and so $\neg(a-(1/j)\ge L)$,\\
\phx\qquad and so $\exists x\in L$ s.t.~$a-(1/j)<x$,\\
\phx\qquad and so $\exists x\in L$ s.t.~$x\,\in\,(\,a-(1/j)\,;\,\infty\,)$,\\
\phx\qquad and so $L\,\cap\,(\,a-(1/j)\,;\,\infty\,)\ne\emptyset$,\\
\phx\qquad and so $X_j\ne\emptyset$.\\
{\it End of proof of Claim 1.}\\
\\
Define $s\in L^\N$ by: $\forall j\in\N$, $s_j=\CH_{X_j}$.\\
\\
{\it Claim 2:} $\forall j\in\N$, $a-(1/j)\le s_j\le a$.\\
{\it Proof of Claim 2:} Given $j\in\N$. {\bf {\bf Want:}} $a-(1/j)\le s_j\le a$.\\
We have $s_j\,\in\,X_j=L\,\cap\,(\,a-(1/j)\,;\,\infty\,)\,\subseteq\,(\,a-(1/j)\,;\,\infty\,)\,>\,a-(1/j)$.\\
{\bf {\bf Want:}} $s_j\le a$. \quad $s_j\in L\le\sup L=a$.\\
{\it End of proof of Claim 2.}\\
\\
By Claim 2 and the Squeeze Theorem, we know that $s\to a$.\\
Since $s\in L^\N$ and since $L$ is compact,\\
\phx\qquad it follows that $s$ is subconvergent in $L$.\\
Choose a subsequence $t$ of $s$ such that $t$ is convergent in $L$.\\
Choose $b\in L$ s.t.~$t\to b$.\\
Since $s\to a$ and $t$ is a subsequence of $s$,\\
\phx\qquad it follows that $t\to b$.\\
Since $t\to a$ and $\to b$, it follows that $a=b$.\\
Then $a=b\in L$.
\end{proof}

\subsection{Sums of sequences}

\begin{thm}
Let $a\in[0;\infty)^\N$.\\
Define $s\in\R^\N$ by: $\forall j\in\N$, $s_j=a_1+\cdots+a_j$.\\
Then: \quad (i) if $\I_s$ is bounded, then $s$ is convergent \qquad and\\
\phx\qquad\qquad (ii) if $\I_s$ is unbounded, then $s\to\infty$.
\end{thm}

\begin{proof}
Part (i) follows from \tref{thm-semiincr-bdd-above}.\\
Part (ii) follows from \tref{thm-semiincr-not-bdd-above}.
\end{proof}

\subsection{Cauchy sequences and convergence}

\begin{defn}
Let $s\in\R^\N$.
By $s$ is \bfindex[Cauchy], we mean:\\
\phx\qquad\qquad\qquad $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall i,j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,i,j\ge K\,)\,\Rightarrow\,(\,|s_i-s_j|<\vep\,)$.
\end{defn}

\noindent
We sometimes say:\\
\phx\quad ``$s$ is Cauchy \qquad iff,\\
\phx\quad\qquad for every $\vep>0$, $s$ has an strictly-$\vep$-bounded tail.''\\
More accurately:\\
\phx\quad ``$s$ is Cauchy \qquad iff,\\
\phx\quad\qquad for every $\vep>0$, $s$ has a tail whose image is strictly-$\vep$-bounded.''

\begin{thm}
Let $s\in\R^\N$. \qquad Assume $s$ is Cauchy.\\
\phx\qquad\qquad\qquad\qquad\qquad\quad Then $\I_s$ is bounded.
\end{thm}

\begin{proof}
Choose $K\in\N$ s.t., $\forall i,j\in\N$, $(\,i,j\ge K\,)\,\Rightarrow\,(\,|s_i-s_j|<1\,)$.\\
Then: \qquad $\forall i\in\N$, \quad $(\,i\ge K\,)\,\Rightarrow\,(\,|s_i-s_K|<1\,)$.\\
Then: \qquad $\forall i\in\{K,K+1,K+2,\ldots\}$, \quad $|s_i-s_K|<1$.\\
Then: \qquad $\forall i\in\{K,K+1,K+2,\ldots\}$, \quad $s_i\in B(s_K,1)$.\\
Then $\{s_K,s_{K+1},s_{K+2},\ldots\}\subseteq B(s_K,1)$.\\
Then $\{s_K,s_{K+1},s_{K+2},\ldots\}$ is bounded.\\
Also, $\{s_1,\ldots,s_K\}$ is finite, and therefore bounded.\\
Then $\{s_1,\ldots,s_K\}\cup\{s_K,s_{K+1},s_{K+2},\ldots\}$ is bounded.\\
So, since $\I_s=\{s_1,s_2,s_3,\dots\}=\{s_1,\ldots,s_K\}\cup\{s_K,s_{K+1},s_{K+2},\ldots\}$,\\
\phx\qquad we conclude that $\I_s$ is bounded.
\end{proof}

\begin{thm}
Let $s\in\R^\N$. Then:\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,s\hbox{ is Cauchy}\,\,)\,\,\Leftrightarrow\,\,(\,\,s\hbox{ is convergent}\,\,)$.
\end{thm}

\begin{proof}
This is HW\#8-3 and HW\#8-5.
\end{proof}

\section{Continuity and limits of functions $\R\to\R$}

\subsection{Continuity of functions $\R\drta\R$}
\quad
\vskip.1in\noindent
We next define \bfindex[continuity of function $\R\drta\R$ at a point]:

\begin{defn}
Let $f:\R\drta\R$, $a\in\D_f$.\\
By $f$ is \bfindex[continuous] at $a$, we mean:\\
\phx\qquad $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.
\end{defn}

\noindent
It is our convention that, for any function $f$, for any object $a$,\\
\phx\qquad if $a\notin\D_f$, \quad then $f$ is NOT continuous at $a$.

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$, $\vep>0$, $\delta>0$.\\
Then: $($ $\forall x\in\D_f$, $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$ $)$\\
\phx\qquad\qquad\qquad\qquad $\Leftrightarrow$ $($ $f_*(B(a,\delta))\subseteq B(f_a,\vep)$ $)$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$.\\
Then: $($ $f$ is continuous at $a$ $) \qquad \Leftrightarrow$\\
\phx\qquad\qquad $($ $\forall\vep>0$, $\exists\delta>0$ s.t.~$f_*(B(a,\delta))\subseteq B(f_a,\vep)$ $)$.
\end{thm}

\begin{thm}\wrlab{thm-squaring-contin}
Define $f:\R\to\R$ by: $\forall x\in\R$, $f_x=x^2$.\\
Then $\forall a\in\R$, $f$ is continuous at $a$.
\end{thm}

\begin{proof}
Given $a\in\R$. {\bf Want:} $f$ is continuous at $a$.\\
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.\\
Let $\delta\,:=\,\min\,\{\,1\,,\,\vep/(2+2\cdot|a|)\,\}$. \qquad Then $\delta>0$.\\
{\bf Want:} $\forall x\in\D_f$, \quad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.\\
Given $x\in\D_f$. Assume $|x-a|<\delta$. {\bf Want:} $|f_x-f_a|<\vep\,)$.\\
We have $\delta\le1$ and $\delta\cdot(1+2\cdot|a|)<\vep$.\\
We have $|f_x-f_a|=|x^2-a^2|=|(x-a)(x+a)|$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\,\,\,=|x-a|\cdot|x+a|\le\delta\cdot(|x|+|a|)$.\\
Also, $|x|=|x-a+a|\le|x-a|+|a|<\delta+|a|$,\\
\phx\quad so $|x|+|a|<\delta+2\cdot|a|$. \quad
So, since $\delta\le1$, we get $|x|+|a|<1+2\cdot|a|$.\\
Then $|x^2-a^2|\le\delta\cdot(|x|+|a|)\le\delta(1+2\cdot|a|)<\vep$.
\end{proof}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$, $c\in\R$.\\
Assume $f$ is continuous at $a$. \quad Then $c\cdot f$ is continuous at $a$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\D_{c\cdot f}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(c\cdot f)_x-(c\cdot f)_a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists\delta>0$ s.t., $\forall x\in\D_{c\cdot f}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(c\cdot f)_x-(c\cdot f)_a|<\vep\,)$.\\
Let $\rho:=\vep/(1+|c|)$. \quad Then $\rho>0$ and $|c|\cdot\rho<\vep$.\\
Since $f$ is continuous at $a$, choose $\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\rho\,)$.\\
Then $\delta>0$.
{\bf Want:} $\forall x\in\D_{c\cdot f}$, $\,$ $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(c\cdot f)_x-(c\cdot f)_a|<\vep\,)$.\\
Given $x\in\D_{c\cdot f}$. Assume $|x-a|<\delta$. {\bf Want:} $|(c\cdot f)_x-(c\cdot f)_a|<\vep$.\\
We have $x\in\D_{c\cdot f}=\D_f$ and $|x-a|<\delta$,\\
\phx\qquad\qquad so, by the choice of $\delta$, we get: $|f_x-f_a|<\rho$.\\
Then $|(c\cdot f)_x-(c\cdot f)_a|\,\,=\,\,|c\cdot f_x-c\cdot f_a|$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,=\,\,|c\cdot(f_x-f_a)|$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,=\,\,|c|\cdot|f_x-f_a|\,\,\le\,\,|c|\cdot\rho\,\,<\,\,\vep$.
\end{proof}

\noindent
The following is HW\#5-1:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad Assume $f$ and $g$ are both continuous at $a$.\\
\phx\qquad Then $f+g$ is continuous at $a$.
\end{thm}

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad Assume $f$ and $g$ are both continuous at $a$.\\
\phx\qquad Then $f\cdot g$ is continuous at $a$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\D_{f\cdot g}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(f\cdot g)_x-(f\cdot g)_a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists\delta>0$ s.t., $\forall x\in\D_{f\cdot g}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(f\cdot g)_x-(f\cdot g)_a|<\vep\,)$.\\
Let $\rho\,\,:=\,\,\min\,\{\,1\,,\,\vep\,/\,(\,|g_a|\,+\,|f_a|\,+\,2\,)\,\}$.\\
Then $\rho>0$ and $\rho\le1$ and $\rho\cdot(\,|g_a|\,+\,|f_a|\,+\,1\,)\,\,<\,\,\vep$.\\
Since $f$ is continuous at $a$, choose $\lambda>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\lambda\,)\,\Rightarrow\,(\,|f_x-f_a|<\rho\,)$.\\
Since $g$ is continuous at $a$, choose $\mu>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\mu\,)\,\Rightarrow\,(\,|g_x-g_a|<\rho\,)$.\\
Let $\delta:=\min\{\lambda,\mu\}$. \qquad Then $\delta>0$.\\
{\bf Want:} $\forall x\in\D_{f\cdot g}$, \quad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(f\cdot g)_x-(f\cdot g)_a|<\vep\,)$.\\
Given $x\in\D_{f\cdot g}$. Assume $|x-a|<\delta$. {\bf Want:} $|(f\cdot g)_x-(f\cdot g)_a|<\vep$.\\
We have $\delta\le\lambda$ and $\delta\le\mu$.\\
We have $x\in\D_{f\cdot g}=\D_f\bigcap\D_g\subseteq\D_f$ and $|x-a|<\delta\le\lambda$,\\
\phx\qquad\qquad so, by the choice of $\lambda$, we get: $|f_x-f_a|<\rho$.\\
We have $x\in\D_{f\cdot g}=\D_f\bigcap\D_g\subseteq\D_g$ and $|x-a|<\delta\le\mu$,\\
\phx\qquad\qquad so, by the choice of $\mu$, we get: $|g_x-g_a|<\rho$.\\
By the Naive Product Rule,\\
\phx\quad $\,f_x\cdot g_x\,-\,f_a\cdot g_a\,\,=\,\,(f_x-f_a)\cdot g_a\,+\,f_a\cdot(g_x-g_a)\,+\,(f_x-f_a)\cdot(g_x-g_a)$.\\
Recall: $\rho\cdot(|g_a|+|f_a|+1)<\vep$.\\
Since $\rho\le1$, we get \qquad $\,\,\rho\cdot(\,|g_a|\,+\,|f_a|\,+\,\rho\,)\,\,\le\,\,\rho\cdot(\,|g_a|+|f_a|+1\,)$.\\
Then $\,\,|\,(f\cdot g)_x\,-\,(f\cdot g)_a\,|\,\,=\,\,|\,f_x\cdot g_x\,-\,f_a\cdot g_a\,|$\\
\phx\qquad\qquad $=\,\,|(f_x-f_a)\cdot g_a\,+\,f_a\cdot(g_x-g_a)\,+\,(f_x-f_a)\cdot(g_x-g_a)|$\\
\phx\qquad\qquad $\le\,\,|f_x-f_a|\cdot|g_a|\,+\,|f_a|\cdot|g_x-g_a|\,+\,|f_x-f_a|\cdot|g_x-g_a|$\\
\phx\qquad\qquad $\le\,\,\rho\cdot|g_a|\,+\,|f_a|\cdot\rho\,+\,\rho\cdot\rho$\\
\phx\qquad\qquad $=\,\,\rho\cdot(\,|g_a|\,+\,|f_a|\,+\,\rho\,)\,\,\le\,\,\rho\cdot(\,|g_a|+|f_a|+1\,)\,\,<\,\,\vep$.
\end{proof}

\noindent
Unassigned HW:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad Then: \quad $(\,\,a\in\D_{g\circ f}\,\,)\,\,\Leftrightarrow\,\,(\,\,f_a\in\D_g\,\,)$.
\end{thm}

\noindent
The following is HW\#5-2:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad Assume: \quad $f$ is continuous at $a$ \quad and \quad $g$ is continuous at $f_a$.\\
\phx\qquad\qquad\qquad Then $g\circ f$ is continuous at $a$.
\end{thm}

\noindent
We next define \bfindex[continuity of function $\R\drta\R$ on a subset of $\R$]:

\begin{defn}
Let $f:\R\drta\R$, $S\subseteq\R$.\\
\phx\qquad\qquad By $f$ is \bfindex[continuous] on $S$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall a\in S$, \quad $f$ is continuous at $a$.
\end{defn}

\noindent
We next define \bfindex[continuity of function $\R\drta\R$]:

\begin{defn}
Let $f:\R\drta\R$.\\
\phx\qquad\qquad By $f$ is \bfindex[continuous], we mean:\\
\phx\qquad\qquad\qquad\qquad $f$ is continuous on $\D_f$.
\end{defn}

\begin{thm}
Let $f:\R\drta\R$, $S\subseteq\D_f$.\\
\phx\qquad Assume $f$ is continuous on $S$. \quad Then $f|S$ is continuous.
\end{thm}

\begin{proof}
{\bf Want:} $\forall a\in\D_{f|S}$, $f|S$ is continuous at $a$.\\
Given $a\in\D_{f|S}$. \quad {\bf Want:} $f|S$ is continuous at $a$.\\
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\D_{f|S}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(f|S)_x-(f|S)_a|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists\delta>0$ s.t., $\forall x\in\D_{f|S}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(f|S)_x-(f|S)_a|<\vep\,)$.\\
Since $a\in\D_{f|S}=S$ and since $f$ is continuous on $S$,\\
\phx\qquad it follows that $f$ is continuous at $a$.\\
Then choose $\delta>0$ s.t., \quad $\forall x\in\D_f$, $\,$ $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.\\
Then $\delta>0$.\\
{\bf Want:} \quad $\forall x\in\D_{f|S}$, $\,$ $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|(f|S)_x-(f|S)_a|<\vep\,)$.\\
Given $x\in\D_{f|S}$. Assume $|x-a|<\delta$. {\bf Want:} $|(f|S)_x-(f|S)_a|<\vep$.\\
We have $\D_{f|S}=S$. By assumption, $S\subseteq\D_f$. Then $x\in\D_{f|S}=S\subseteq\D_f$.\\
So, as $|x-a|<\delta$, by choice of $\delta$, we get: $|f_x-f_a|<\vep$.\\
Since $x,a\in\D_{f|S}=S$, we get $(f|S)_x=f_x$ and $(f|S)_a=f_a$.\\
Then $|(f|S)_x-(f|S)_a|=|f_x-f_a|<\vep$.
\end{proof}

\noindent
The following is HW\#5-3:

\begin{thm}
Let $f:\R\drta\R$, $s\in(D_f)^\N$, $a\in\R$.\\
\phx Assume \quad $f$ is continuous at $a$ \quad and \quad $s\to a$. \quad Then \quad $f\circ s\to f_a$.
\end{thm}

\subsection{Lipschitz and uniformaly continuous functions $\R\drta\R$}
\quad
\vskip.1in\noindent
The next two definitions explain \bfindex[Lipschitz, for functions $\R\drta\R$].

\begin{defn}
Let $f:\R\drta\R$, $L\ge0$.\\
By $f$ is {\bf$L$-Lipschitz}, we mean:\\
\phx\qquad\qquad $\forall w,x,\in\D_f$, $\,$ $|f_x-f_w|\le L|x-w|$.
\end{defn}

\begin{defn}
Let $f:\R\drta\R$.\\
By $f$ is {\bf Lipschitz}, we mean:\\
\phx\qquad\qquad $\exists L\ge0$ s.t.~$f$ is $L$-Lipschitz.
\end{defn}

\noindent
The next two theorems are left as unassigned exercises.\\
The first asserts that we need not check $w$ and $x$ when $w=x$.\\
The second asserts that it's okay to lable the smaller of the two as $w$.

\begin{thm}
Let $f:\R\drta\R$, $L\ge0$.\\
Then: \qquad $f$ is {\bf$L$-Lipschitz} \qquad if and only if\\
\phx\qquad\qquad $\forall w,x,\in\D_f$, $\,$ $(\,w\ne x\,)\,\Rightarrow\,(\,|f_x-f_w|\le L|x-w|\,)$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$, $L\ge0$.\\
Then: \qquad $f$ is {\bf$L$-Lipschitz} \qquad if and only if\\
\phx\qquad\qquad $\forall w,x,\in\D_f$, $\,$ $(\,w<x\,)\,\Rightarrow\,(\,|f_x-f_w|\le L|x-w|\,)$.
\end{thm}

\noindent
We record a quadruply quantified equivalence to continuity:

\begin{thm}
Let $f:\R\drta\R$.\\
By $f$ is continuous \qquad if and only if\\
\phx\qquad\qquad $\forall\vep>0$, $\forall w\in\D_f$, $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-w|<\delta\,)\,\Rightarrow\,(\,|f_x-f_w|<\vep\,)$.
\end{thm}

\noindent
The preceding theorem is left as a unassigned HW.\\
The next definition covers\\
\phx\qquad\qquad \bfindex[uniformly continuous, for functions $\R\drta\R$].

\begin{defn}
Let $f:\R\drta\R$.\\
By $f$ is {\bf uniformly continuous} we mean:\\
\phx\qquad\qquad $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall w\in\D_f$, $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-w|<\delta\,)\,\Rightarrow\,(\,|f_x-f_w|<\vep\,)$.
\end{defn}

\noindent
Note that\\
\phx\qquad the quantified equivalence for continuity\\
is similiar to\\
\phx\qquad the definition of uniform continuity;\\
only the order of the quantified causes has been changed.\\
\\
In the preceding definition, we sometimes replace\\
\phx\qquad ``$\forall w\in\D_f$, $\forall x\in\D_f$'' \quad by \quad ``$\forall w,x\in\D_f$'',\\
for brevity. The reader must remember that\\
\phx\qquad the single $\forall$ in ``$\forall w,x\in\D_f$'' counts twice.\\
\\
We sometimes abbreviate uniformly continuous by \bfindex[u.c.]

The following is HW\#5-4:

\begin{thm}
Let $f:\R\drta\R$.\\
Assume $f$ is Lipschitz. \qquad Then $f$ is uniformly continuous.
\end{thm}

The following is HW\#5-5:

\begin{thm}
Let $f:\R\drta\R$.\\
Assume $f$ is uniformly continuous. \qquad Then $f$ is continuous.
\end{thm}

\noindent
Thus, Lipschitz $\Rightarrow$ u.c. $\Rightarrow$ continuous.\\
We eventually show that neither of these implications can be reversed:\\

\begin{defn}
Let $f:\R\drta\R$, $w,x\in\D_f$. Assume $w\ne x$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $\ds{\boxed{\DQ_f(w,x)}\,:=\,\frac{f_x-f_w}{x-w}}$.
\end{defn}

\noindent
Note that $\DQ_f(w,x)$ is equal to\\
\phx\qquad the slope of the secant line between $(w,f(w))$ and $(x,f(x))$.

\begin{defn}
Let $f:\R\drta\R$.\\
\phx\qquad\qquad Then $\boxed{\DQ_f}\,:=\,\{\,\DQ_f(w,x)\,|\,(\,w,x\in\D_f\,)\,\&\,(\,w\ne x\,)\,\}$.
\end{defn}

\noindent
Thus $\DQ_f$ collects all of the slopes of secant lines for the graph of $f$.

\begin{thm}
Let $f:\R\to\R$, $L\ge0$.\\
Then: \qquad $f$ is $L$-Lipschitz \qquad if and only if\\
\phx\qquad\qquad $\forall w,x,\in\D_f$, $\,$ $(\,w\ne x\,)\,\Rightarrow\,(\,|\DQ_f(w,x)|\le L\,)$.
\end{thm}

\begin{thm}
Let $f:\R\to\R$, $L\ge0$.\\
Then: \qquad $f$ is $L$-Lipschitz \qquad if and only if\\
\phx\qquad\qquad $\forall w,x,\in\D_f$, $\,$ $(\,w\ne x\,)\,\Rightarrow\,(\,-L\le\DQ_f(w,x)\le L\,)$.
\end{thm}

\begin{thm}
Let $f:\R\to\R$, $L\ge0$.\\
Then: \qquad $f$ is $L$-Lipschitz \qquad if and only if \qquad $-L\le\DQ_f\le L$.
\end{thm}

\noindent
That is, a function $\R\drta\R$ is $L$-Lipschitz iff\\
\phx\quad the slopes of its secant lines are bounded above and below.

\begin{thm}
Define $f:\R\to\R$ by $\forall x\in\R$, $\ds{f_x=\frac{x}{\sqrt{1+x^2}}}$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad Then $f$ is $1$-Lipschitz.
\end{thm}

\noindent
An examination of the graph of the function $f$ above indicates that\\
\phx\qquad\qquad all secant line slopes are strictly between $0$ and $1$,\\
or, in other words,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $0<\DQ_f<1$.\\
Proving this formally is left as an exercise for the reader.\\
\\
By contrast, for the squaring function, the graph is a parabola, so\\
\phx\quad its secant line slopes are neither bounded above nor below.\\
This indicates that the squaring function is not Lipschitz;\\
in fact it is not even uniformly continuous:

\begin{thm}
Define $f:\R\to\R$ by $\forall x\in\R$, $f_x=x^2$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $f$ is NOT uniformly continuous.
\end{thm}

\begin{proof}
Assume that $f$ is uniformly continuous. \quad {\bf Want:} Contradiction.\\
Since $f$ is uniformly continuous, choose $\delta>0$ s.t., $\forall w,x\in\D_f$,\\
\phx\qquad\qquad $(\,|x-w|<\delta\,)\,\Rightarrow\,(\,|f_x-f_w|<1\,)$.\\
Let $w:=1/\delta$ and let $x:=w+(\delta/2)$. \quad Then $w>0$.\\
Then $w,x\in\R=\D_f$ and $|x-w|=|\delta/2|=\delta/2<\delta$,\\
\phx\quad so, by choice of $\delta$, we get $|f_x-f_w|<1$.\\
Since $w>0$ and $\delta>0$, we get\\
\phx\qquad\qquad $\,\,\,\,\,w\cdot\delta+(\delta/2)^2\,\quad>\quad\,0$\\
and so \qquad $|w\cdot\delta+(\delta/2)^2|\quad=\quad w\cdot\delta+(\delta/2)^2$.\\
Then \quad $1>|f_x-f_w|=|x^2-w^2|=|(w+(\delta/2))^2-w^2|$\\
\phx\qquad\qquad $=|w^2+2\cdot w\cdot(\delta/2)+(\delta/2)^2-w^2|$\\
\phx\qquad\qquad $=|w\cdot\delta+(\delta/2)^2|=w\cdot\delta+(\delta/2)^2$\\
\phx\qquad\qquad $>w\cdot\delta=(1/\delta)\cdot\delta=1$,\\
so $1>1$. Contradiction.
\end{proof}

\noindent
Define $f:\R\to\R$ by $\forall x\in\R$, $f_x=x^2$.\\
By \tref{thm-squaring-contin}, $f$ is continuous.\\
However, according to the preceding theorem,\\
\phx\quad $f$ is not uniformly continuous.\\
We therefore see that continuous does not imply uniformly continuous.\\
\\
Now define $f:\R\to\R$ by $\forall x\in\R$, $f_x=\sqrt[3]{x}$.\\
We will argue that $f$ is uniformly continuous, but not Lipschitz.\\
The formal proof that $f$ is not Lipschitz will be left to the reader,\\
but an examination of the graph of $f$ will show that\\
\phx\quad if $w$ is close to zero, then $\DQ_f(-w,w)$ is very large.\\
In fact the slopes of secant lines are not bounded above.\\
We will supply a formal proof that $f$ is uniformly continuous:

\begin{thm}
Define $f:\R\to\R$ by $\forall x\in\R$, $f_x=\sqrt[3]{x}$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $f$ is uniformly continuous.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall w,x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-w|<\delta\,)\,\Rightarrow\,(\,|f_x-f_w|<\vep\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists\delta>0$ s.t., $\forall w,x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-w|<\delta\,)\,\Rightarrow\,(\,|f_x-f_w|<\vep\,)$.\\
Let $\delta:=\vep^2/8$. \qquad Then $\delta>0$.\\
{\bf Want:} $\forall w,x\in\D_f$, $\,$ $(\,|x-w|<\delta\,)\,\Rightarrow\,(\,|f_x-f_w|<\vep\,)$.\\
Given $w,x\in\D_f$. \qquad Assume $|x-w|<\delta$. \qquad {\bf Want:} $|f_x-f_w|<\vep$.\\
We have $0\le|x-w|<\vep^2/8$.\\
Let $s:=\min\{w,x\}$ and $t:=\max\{w,x\}$.\\
Since $s\le t$, we get $\sqrt[3]{s}\le\sqrt[3]{t}$, and so $f_s\le f_t$.\\
Then $|w-x|=t-s$ and $|f_x-f_w|=f_t-f_s$.\\
Then $0\le t-s<\vep^2/8$. \qquad {\bf Want:} $f_t-f_s<\vep$.\\
Let $\sigma:=f_s$ and $\tau:=f_t$. \qquad {\bf Want:} $\tau-\sigma<\vep$.\\
Assume $\tau-\sigma>\vep$. \qquad {\bf Want:} Contradiction.\\
Since $\tau\ge\sigma+\vep$, we get $\tau^3\ge(\sigma+\vep)^3$.\\
Then $\tau^3\ge\sigma^3+3\sigma^2\vep+3\sigma\vep^2+\vep^3$.\\
Then $\tau^3-\sigma^3\ge3\sigma^2\vep+3\sigma\vep^2+\vep^3$.\\
Then $3\sigma^2\vep+3\sigma\vep^2+\vep^3\le\tau^3-\sigma^3=t-s<\vep^3/8$.\\
Then $3\sigma^2\vep+3\sigma\vep^2+\vep^3-(\vep^3/8)<0$.\\
Then $3\sigma^2\vep+3\sigma\vep^2+(7/8)\vep^3<0$.\\
As $3\vep^3>0$, dividing by $3\vep^3$, we get:
\quad $\ds{\frac{3\sigma^2\vep}{3\vep^3}+\frac{3\sigma\vep^2}{3\vep^3}+\frac{7}{8}\cdot\frac{\vep^3}{3\vep^3}<0}$.\\
\\
Then $\ds{\frac{\sigma^2}{\vep^2}+\frac{\sigma}{\vep}+\frac{7}{24}<0}$. \quad
Then $\ds{\left(\frac{\sigma^2}{\vep^2}+2\cdot\frac{\sigma}{\vep}\cdot\frac{1}{2}+\frac{1}{4}\right)-\frac{1}{4}+\frac{7}{24}<0}$.\\
\\
We have $\ds{0\le\left(\frac{\sigma}{\vep}+\frac{1}{2}\right)^2}$, so
$\ds{-\frac{1}{4}+\frac{7}{24}\le\left(\frac{\sigma}{\vep}+\frac{1}{2}\right)^2-\frac{1}{4}+\frac{7}{24}}$.\\
\\
Then $\ds{\frac{1}{24}=-\frac{6}{24}+\frac{7}{24}=-\frac{1}{4}+\frac{7}{24}\le\left(\frac{\sigma}{\vep}+\frac{1}{2}\right)^2-\frac{1}{4}+\frac{7}{24}}$\\
\\
\phx\qquad\qquad $\ds{=\left(\frac{\sigma^2}{\vep^2}+2\cdot\frac{\sigma}{\vep}\cdot\frac{1}{2}+\frac{1}{4}\right)-\frac{1}{4}+\frac{7}{24}<0}$.\\
\\
Then $\ds{\frac{1}{24}<0}$. \qquad Contradiction.
\end{proof}

\subsection{Continuity and topological preimages}

\begin{thm}\wrlab{thm-contin-if-preim-closed-is-closed}
Let $f:\R\drta\R$.\\
\phx\qquad Assume: $\forall$closed $C\subseteq\R$, we have: $f^*C$ is closed.\\
\phx\qquad\qquad Then: $f$ is continuous.
\end{thm}

\begin{proof}
{\bf Want:} $\forall a\in\D_f$, $f$ is continuous at $a$.\\
Given $a\in\D_f$. \qquad {\bf Want:} $f$ is continuous at $a$.\\
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.\\
Given $\vep>0$. \quad {\bf Want:} $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.\\
By the Subset Recentering Theorem $B(f_a,\vep)$ is open.\\
Let $C:=\R\bksl(B(f_a,\vep))$. \quad Then $C$ is closed.\\
So, by assumption, $f^*C$ is closed. \quad Then $\R\bksl(f^*C)$ is open.\\
We have $|f_a-f_a|=0<\vep$, so $f_a\in B(f_a,\vep)$, so $f_a\notin C$, so $a\notin f^*C$.\\
We have $a\in\D_f\subseteq\R$ and $a\notin f^*C$, so $a\in\R\bksl(f^*C)$.\\
So, since $\R\bksl(f^*C)$ is open, by a class theorem,\\
\phx\qquad choose $\delta>0$ s.t.~$B(a,\delta)\subseteq\R\bksl(f^*C)$. \qquad\quad Then $\delta>0$.\\
{\bf Want:} \quad $\forall x\in\D_f$, $\,$ $(\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|<\vep\,)$.\\
Given $x\in\D_f$. \quad Assume: $|x-a|<\delta$. \quad {\bf Want:} $|f_x-f_a|<\vep$.\\
Since $|x-a|<\delta$, we get: $x\in B(a,\delta)$.\\
Then $x\in B(a,\delta)\subseteq\R\bksl(f^*C)$.
Then $x\notin f^*C$, and so $f_x\notin C$.\\
We have $x\in\D_f$, so $f_x\in\I_f$. \quad
Since $f:\R\drta\R$, we get: $\I_f\subseteq\R$.\\
Since $B(f_a,\vep)\subseteq\R$, we get: $\R\bksl(\R\bksl(B(f_a,\vep)))=B(f_a,\vep)$.\\
Since $f_x\in\I_f\subseteq\R$ and since $f_x\notin C=\R\bksl(B(f_a,\vep))$,\\
\phx\quad we conclude: $f_x\in\R\bksl(\R\bksl(B(f_a,\vep)))$.\\
Then $f_x\in\R\bksl(\R\bksl(B(f_a,\vep)))=B(f_a,\vep)$. \qquad
Then $|f_x-f_a|<\vep$.
\end{proof}

\begin{thm}\wrlab{thm-contin-if-preim-open-is-open}
Let $f:\R\drta\R$.\\
\phx\qquad Assume: $\forall$closed $C\subseteq\R$, we have: $f^*C$ is closed.\\
\phx\qquad\qquad Then: $f$ is continuous.
\end{thm}

\begin{proof}
This is HW\#11-5.
\end{proof}

\subsection{The Intermediate Value Theorem}
\quad
\vskip.1in\noindent
Recall: $\forall S\subseteq\R^*$, $(\,S\le\sup S\le\UB_S\,)\,\&\,(\,\LB_S\le\inf S\le S\,)$.

\begin{thm}\wrlab{thm-nonempty-subsetclosedintvl-supintheintvl}
Let $a\in\R$, $b\ge a$, $S\subseteq[a;b]$.\\
\phx\qquad Assume $S\ne\emptyset$. \qquad Then $\sup S\in[a;b]$.
\end{thm}

\begin{proof}
{\bf Want:} $b\ge\sup S\ge a$.\\
We have $b\ge[a;b]\supseteq S$, so $b\in\UB_S$. \quad
Then $b\in\UB_S\ge\sup S$.\\
{\bf Want:} $\sup S\ge a$.\\
Since $S\subseteq[a;b]\ge a$, we get $S\ge a$.\\
Then $\sup S\ge S\ge a$, so, since $S\ne\emptyset$, we get $\sup S\ge a$.
\end{proof}

\begin{thm}\wrlab{thm-upright}
Let \quad $f:\R\drta\R$, \quad $a,b,c,v\in\R$.\\
Assume $a<b$ and $[a;b]\subseteq\D_f$. \qquad
Assume $c\in[a;b)$ and $f_c<v$.\\
\phx\qquad\qquad\qquad Assume $f$ is continuous at $c$.\\
Then $\exists\delta>0$ s.t., $\forall x\in[c;c+\delta)$, \qquad
$(\,\,x\in[a;b]\,\,)\,\,\&\,\,(\,\,f_x<v\,\,)$.
\end{thm}

\begin{proof}
Let $\vep:=v-f_c$. \quad Since $f_c<v$, we get: $\vep>0$.\\
Then, since $f$ is continuous at $c$, choose $\alpha>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x-c|<\alpha\,)\,\Rightarrow\,(\,|f_x-f_c|<\vep\,)$.\\
Since $c\in[a;b)<b$, we get $b-c>0$.\\
Let $\delta:=\min\{\alpha,b-c\}$. \qquad Then $\delta>0$.\\
{\bf Want:} $\forall x\in[c;c+\delta)$, $\,\,\,\,$ $(\,\,x\in[a;b]\,\,)\,\,\&\,\,(\,\,f_x<v\,\,)$.\\
Given $x\in[c;c+\delta)$. \qquad {\bf Want:} $(\,\,x\in[a;b]\,\,)\,\,\&\,\,(\,\,f_x<v\,\,)$.\\
We have $x\in[c;c+\delta)\ge c\in[a;b)\ge a$, so $x\ge a$, so $a\le x$.\\
We have $\delta=\min\{\alpha,b-c\}\le b-c$, so $\delta\le b-c$, so $c+\delta\le b$.\\
Then $x\in[c;c+\delta)<c+\delta\le b$, so $x<b$.\\
Since $a\le x$ and $x<b$, we see that $x\in[a;b)$.
Then $x\in[a;b)\subseteq[a;b]$.\\
\\
{\bf It remains to show:} $f_x<v$.\\
\\
Since $x\in[c;c+\delta)$, we get both $c\le x$ and $x<c+\delta$.\\
Since $\delta>0$, we get $c-\delta<c$.\\
Since $c-\delta<c\le x$, we get $c-\delta<x$.\\  
Then $c-\delta<x<c+\delta$, and so $|x-c|<\delta$.\\
\\
By definition of $\delta$, we have $\delta\le\alpha$ and $\delta\le b-c$.\\
By hypothesis, $[a;b]\subseteq\D_f$.\\
Since $x\in[a;b]\subseteq\D_f$, and $|x-c|<\delta\le\alpha$, by choice of $\alpha$,\\
\phx\qquad we conclude that $|f_x-f_c|<\vep$, and so $f_c-\vep<f_x<f_c+\vep$.\\
Then $f_x<f_c+\vep=f_c+(v-f_c)=v$.
\end{proof}

The proof of the following is similar to the proof of the preceding.\\
It is left as unassigned HW.

\begin{thm}\wrlab{thm-downleft}
Let \quad $f:\R\drta\R$, \quad $a,b,c,v\in\R$.\\
Assume $a<b$ and $[a;b]\subseteq\D_f$. \qquad
Assume $c\in(a;b]$ and $v<f_c$.\\
\phx\qquad\qquad\qquad Assume $f$ is continuous at $c$.\\
Then $\exists\delta>0$ s.t., $\forall x\in(c-\delta;c]$, \qquad
$(\,\,x\in[a;b]\,\,)\,\,\&\,\,(\,\,v<f_x\,\,)$.
\end{thm}

\begin{thm}\wrlab{thm-gph-goes-up}
Let \quad $f:\R\drta\R$, \quad $a,b,v\in\R$.\\
Assume $a<b$. Assume $f$ is continuous on $[a;b]$. \qquad
Assume $f_a\le v\le f_b$.\\
Then $\exists c\in[a;b]$ s.t.~$f_c=v$.
\end{thm}

\begin{proof}
Exactly one of the following holds:\\
\phx\qquad (A) $v=f_a$ \qquad or \qquad (B) $v=f_b$ \qquad or \qquad (C) $f_a<v<f_b$.\\
\\
{\it Case (A):}
Let $c:=a$. Then $c\in[a;b]$. \qquad {\bf Want:} $f_c=v$.\\
We have $f_c=f_a=v$.\\
{\it End of Case (A).}\\
\\
{\it Case (B):}
Let $c:=b$. Then $c\in[a;b]$. \qquad {\bf Want:} $f_c=v$.\\
We have $f_c=f_b=v$.\\
{\it End of Case (B).}\\
\\
{\it Case (C):} 
Let $S:=\{x\in[a;b]\,|\,f_x<v\}$. \qquad Then $c=\sup S$.\\
By hypothesis $f_a<v$. \quad
Since $a\in[a;b]$ and $f_a<v$, we get $a\in S$.\\
Then $S\ne\emptyset$. \quad
Then, by \tref{thm-nonempty-subsetclosedintvl-supintheintvl}, $\sup S\in[a;b]$.\\
Then $c=\sup S\in[a;b]$. \qquad {\bf Want:} $f_c=v$.\\
\\
We wish to show: \quad (1) $f_c\ge v$ \quad and \quad (2) $f_c\le v$.\\
\\
{\it Proof of (1):}
Assume $f_c<v$. \qquad {\bf Want:} Contradiction.\\
We have $f_c<v$. \qquad By hypothesis, $v<f_b$.\\
Then $f_c<v<f_b$, so $f_c\ne f_b$, so $c\ne b$.\\
So, since $c\in[a;b]$, we get $c\in[a;b)$.\\
Then, by \tref{thm-upright}, choose $\delta>0$ s.t., $\forall x\in[c;c+\delta)$,\\
\phx\qquad\qquad $(\,\,x\in[a;b]\,\,)\,\,\&\,\,(\,\,f_x<v\,\,)$.\\
Then $[c;c+\delta)\subseteq\{x\in[a;b]\,|\,f_x<v\}$.\\
Then $c+(\delta/2)\in[c;c+\delta)\subseteq\{x\in[a;b]\,|\,f_x<v\}=S\le\sup S=c$.\\
Then $c+(\delta/2)\le c$, so $\delta/2\le0$, so $\delta\le0$.\\
Then $0<\delta\le0$, so $0<0$. \quad Contradiction.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}
Assume $f_c>v$. \qquad {\bf Want:} Contradiction.\\
We have $v<f_c$. \qquad By hypothesis, $f_a<v$.\\
Then $f_a<v<f_c$, so $f_a\ne f_c$, so $a\ne c$.\\
So, since $c\in[a;b]$, we get $c\in(a;b]$.\\
Then, by \tref{thm-downleft}, choose $\delta>0$ s.t., $\forall x\in(c-\delta;c]$,\\
\phx\qquad\qquad $(\,\,x\in[a;b]\,\,)\,\,\&\,\,(\,\,v<f_x\,\,)$.\\
Since $\delta>0$, we get $c-\delta<c$.\\
Since $c-\delta<c=\sup S=\min\,\UB_S$, we get $c-\delta<\min\,\UB_S$.\\
Then $c-\delta\notin\UB_S$, so $\neg(S\le c-\delta)$, so $\neg(\forall x\in S,\,x\le c-\delta)$.\\
Then choose $x\in S$ s.t.~$x>c-\delta$.\\
Since $x\in S$, by definition of $S$, we get $f_x<v$.\\
Since $x\in S\le\sup S=c$, we get $x\le c$.\\
Since $x>c-\delta$, we get $c-\delta<x$.\\
Since $c-\delta<x\le c$, we get $x\in(c-\delta;c]$.\\
Then, by choice of $\delta$, we get $(\,\,x\in[a;b]\,\,)\,\,\&\,\,(\,\,v<f_x\,\,)$.\\
Then $v<f_x<v$, so $v<v$. \qquad Contradiction.\\
{\it End of proof of (2).}\\
\\
{\it End of Case (C).}
\end{proof}

\begin{thm}\wrlab{thm-gph-goes-down}
Let \quad $f:\R\drta\R$, \quad $a,b,v\in\R$.\\
Assume $a<b$. Assume $f$ is continuous on $[a;b]$. \qquad
Assume $f_a\ge v\ge f_b$.\\
Then $\exists c\in[a;b]$ s.t.~$f_c=v$.
\end{thm}

\begin{proof}
Let $g:=-f$. \quad Then $g_a\le-v\le g_b$.\\
By \tref{thm-gph-goes-up}, choose $c\in[a;b]$ s.t.~$g_c=-v$.\\
Then $c\in[a;b]$. \quad {\bf Want:} $f_c=v$.\\
Since $g=-f$, it follows that $g_c=(-f)_c$.\\
Then $f_c=-(-f_c)=-((-f)_c)=-g_c=-(-v)=v$.
\end{proof}

\begin{defn}
$\forall a,b\in\R^*$, we define:\\
\phx\qquad\qquad\qquad\qquad $\boxed{[a|b]}\,\,:=\,\,[\,\min\{a,b\}\,;\,\max\{a,b\}\,]$\\
\phx\qquad\quad and \quad\qquad $\boxed{(a|b)}\,\,:=\,\,(\,\min\{a,b\}\,;\,\max\{a,b\}\,)$.
\end{defn}

\begin{thm}
$[7|1]=[1;7]=[1|7]$ and $(7|1)=(1;7)=(1|7)$.
\end{thm}

\begin{thm}
$\forall a,b\in\R^*$, \quad $(\,[a|b]=[b|a]\,)\,\,\&\,\,(\,(a|b)=(b|a)\,)$.
\end{thm}

\begin{thm}\wrlab{thm-combine-prev-two}
Let \quad $f:\R\drta\R$, \quad $\alpha,\beta,v\in\R$.\\
Assume $\alpha<\beta$. Assume $f$ is continuous on $[\alpha;\beta]$. \qquad
Assume $v\in[f_\alpha|f_\beta]$.\\
Then $\exists c\in[\alpha;\beta]$ s.t.~$f_c=v$.
\end{thm}

\begin{proof}\wrlab{thm-intermed-val-thm}
At least one of the following is true:\\
\phx\qquad (1) $f_\alpha\le f_\beta$ \qquad or \qquad (2) $f_\beta\le f_\alpha$.\\
\\
{\it Case (1):} Since $f_\alpha\le f_\beta$, we get $[f_\alpha|f_\beta]=[f_\alpha;f_\beta]$.\\
Then $v\in[f_\alpha|f_\beta]=[f_\alpha;f_\beta]$, so $f_\alpha\le v\le f_\beta$.\\
Then by \tref{thm-gph-goes-up}, $\exists c\in[\alpha;\beta]$ s.t.~$f_c=v$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):} Since $f_\beta\le f_\alpha$, we get $[f_\alpha|f_\beta]=[f_\beta;f_\alpha]$.\\
Then $v\in[f_\alpha|f_\beta]=[f_\beta;f_\alpha]$, so $f_\beta\le v\le f_\alpha$.\\
Then by \tref{thm-gph-goes-down}, $\exists c\in[\alpha;\beta]$ s.t.~$f_c=v$.\\
{\it End of Case (2).}
\end{proof}

\noindent
The following is the \bfindex[Intermediate Value Theorem] or \bfindex[IVT]:

\begin{thm}\wrlab{thm-IVT}
Let \quad $f:\R\drta\R$, \quad $a,b\in\R$.\\
Assume $f$ is continuous on $[a|b]$. \qquad
Then $[f_a|f_b]\subseteq f_*([a|b])$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall v\in[f_a|f_b]$, $v\in f_*([a|b])$.\\
Given $v\in[f_a|f_b]$. \quad {\bf Want:} $v\in f_*([a|b])$.\\
{\bf Want:} $\exists c\in[a|b]$ s.t.~$f_c=v$.\\
Exactly one the following is true:\\
\phx\qquad (1) $a=b$ \qquad or \qquad (2) $a<b$ \qquad or \qquad (3) $b<a$.\\
\\
{\it Case (1):} $v\in[f_a|f_b]=[f_a|f_a]=\{f_a\}$, so $v=f_a$.\\
Let $c:=a$. Then $c\in[a|b]$. \qquad {\bf Want:} $f_c=v$.\\
We have $f_c=f_a=v$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):} Since $a<b$, we get $[a|b]=[a;b]$.\\
Let $\alpha:=a$, $\beta:=b$.\\
Then $\alpha<\beta$, \quad Also, $[\alpha;\beta]=[a;b]=[a|b]$, so $[\alpha;\beta]=[a|b]$.\\
{\bf Want:} $\exists c\in[\alpha;\beta]$ s.t. $f_c=v$.\\
Then $f$ is continuous on $[\alpha;\beta]$ and  $v\in[f_a|f_b]=[f_\alpha|f_\beta]$.\\
Then, by \tref{thm-combine-prev-two}, $\exists c\in[\alpha;\beta]$ s.t. $f_c=v$.\\
{\it End of Case (2).}\\
\\
{\it Case (3):} Since $b<a$, we get $[a|b]=[b;a]$.\\
Let $\alpha:=b$, $\beta:=a$.\\
Then $\alpha<\beta$. \quad Also, $[\alpha;\beta]=[b;a]=[a|b]$, so $[\alpha;\beta]=[a|b]$.\\
{\bf Want:} $\exists c\in[\alpha;\beta]$ s.t. $f_c=v$.\\
Then $f$ is continuous on $[a|b]$ and $[\alpha;\beta]=[a|b]$, so $f$ is continuous on $[\alpha;\beta]$.
So, since $v\in[f_a|f_b]=[f_b|f_a]=[f_\alpha|f_\beta]$,\\
\phx\qquad by \tref{thm-combine-prev-two}, $\exists c\in[\alpha;\beta]$ s.t. $f_c=v$.\\
{\it End of Case (3).}
\end{proof}

\noindent
A \bfindex[power function on $\R$] is a power of $\id^\R$,\\
\phx\qquad\qquad {\it e.g.}, \quad $x\mapsto x^4:\R\to\R$.\\
A \bfindex[monomial on $\R$] is a scalar multiple of a power function on $\R$,\\
\phx\qquad\qquad {\it e.g.}, \quad $x\mapsto7x^4:\R\to\R$.\\
The function $f$ defined in the next proof is an example of\\
\phx\qquad\qquad\qquad\quad a \bfindex[polynomial on $\R$],\\
\phx\qquad\qquad {\it i.e.}, \quad  a finite sum of monomials on $\R$,\\
\phx\qquad\qquad {\it e.g.}, \quad $x\mapsto 7x^4+2x^3-5x+8:\R\to\R$.\\
We leave it as an exercise to show that any polynomial is continuous.

\begin{thm}
$\forall a\in\R$, $\exists x\in\R$ s.t.~$x^5-x^3+x=a$.
\end{thm}

\begin{proof}
Given $a\in\R$. {\bf Want:} $\exists x\in\R$ s.t.~$x^5-x^3+x=a$.\\
We have: $\forall t\in\R$, $-|t|\le t\le|t|$. Then $-|a|\le a\le|a|$.\\
Define $f:\R\to\R$ by $\forall x\in\R$, $f_x=x^5-x^3+x$.\\
Then $f$ is a polynomial on $\R$, and so $f$ is continuous.\\
{\bf Want:} $\exists x\in\R$ s.t.~$f_x=a$. \quad {\bf Want:} $a\in\I_f$.\\
Let $b:=\max\{1,|a|\}$. \quad Then $b\ge1$.\\
Also, $b\ge|a|$. \quad Negating this, we get $-b\le-|a|$.\\
Since $b\ge1$, we get $b^5\ge b^3$, and so $b^5-b^3\ge0$.\\
Then $b^5-b^3+b\ge b$. \quad  Negating this, we get $-b^5+b^3-b\le-b$.\\
Then $f_b=b^5-b^3+b\ge b\ge|a|\ge a$,\\
\phx\qquad\qquad so $a\le f_b$.\\
Also, $f_{-b}=(-b)^5-(-b)^3+(-b)=-b^5+b^3-b\le-b\le-|a|\le a$,\\
\phx\qquad\qquad so $f_{-b}\le a$.\\
Then $f_{-b}\le a\le f_b$, so $a\in[f_{-b}|f_b]$.\\
By the IVT, $[f_{-b}|f_b]\subseteq f_*[-b|b]$.\\
For any function $g$, for any set $S$, $g_*S\subseteq\I_g$. Then $f_*[-b|b]\subseteq\I_f$.\\
Then $a\in[f_{-b}|f_b]\subseteq f_*[-b|b]\subseteq\I_f$.
\end{proof}

\subsection{Limits at extended real numbers of functions $\R\drta\R$}

\begin{defn}
Let $a\in\R$, $\delta>0$. Then $\boxed{B^\times(a,\delta)}\,:=\,(B(a,\delta))_a^\times$.
\end{defn}

\noindent
The set $B^\times(a,\delta)$ is called\\
\phx\qquad the \bfindex[punctured open ball] about $a$ of radius $\delta$.

\begin{thm}
Let $a\in\R$, $\delta>0$. Then:\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,x\in B^\times(a,\delta)\,\,)\,\,\Leftrightarrow\,\,(\,\,0<|x-a|<\delta\,\,)$.
\end{thm}

\begin{defn}
Let $f:\R\drta\R$, $a,z\in\R$.\\
\phx\qquad\qquad By {\bf as $x\to a$, $f_x\to z$}, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,0<|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-z|<\vep\,)$.
\end{defn}

\noindent
Let $f:\R\drta\R$, $a,z\in\R$, $\delta,\vep>0$.
Then the quantified statement\\
\phx\qquad\qquad $\forall x\in\D_f$, \qquad $(\,0<|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-z|<\vep\,)$\\
is equivalent to\\
\phx\qquad\qquad $f_*(B^\times(a,\delta))\,\,\subseteq\,\,B(z,\vep)$.\\

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad By {\bf as $x\to a$, $f_x\to\infty$}, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall M\in\R$, $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,0<|x-a|<\delta\,)\,\Rightarrow\,(\,f_x>M\,)$.
\end{defn}

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad By {\bf as $x\to a$, $f_x\to-\infty$}, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall N\in\R$, $\exists\delta>0$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,0<|x-a|<\delta\,)\,\Rightarrow\,(\,f_x<N\,)$.
\end{defn}

\begin{defn}
Let $f:\R\drta\R$, $z\in\R$.\\
\phx\qquad\qquad By {\bf as $x\to-\infty$, $f_x\to z$}, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall\vep>0$, $\exists N\in\R$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,x<N\,)\,\Rightarrow\,(\,|f_x-z|<\vep\,)$.
\end{defn}

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad By {\bf as $x\to\infty$, $f_x\to\infty$}, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall M\in\R$, $\exists L\in\R$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,x>L\,)\,\Rightarrow\,(\,f_x>M\,)$.
\end{defn}

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad By {\bf as $x\to\infty$, $f_x\to-\infty$}, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall N\in\R$, $\exists L\in\R$ s.t., $\forall x\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,x>L\,)\,\Rightarrow\,(\,f_x<N\,)$.
\end{defn}

\begin{thm}
Let $f:\R\to\R$, $y\in\R_0^\times$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad as $x\to-\infty$, $f_x\to y$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad as $x\to-\infty$, $(1/f)_x\to(1/y)$.\\
\end{thm}

\begin{proof}
This is HW\#12-3.
\end{proof}

\subsection{Forward image of a compact set}

\begin{thm}\wrlab{thm-fwd-im-cpt-is-cpt}
Let $f:\R\drta\R$, $K\subseteq\D_f$.\\
Assume \quad $f$ is continuous on $K$ \quad and \quad $K$ is compact.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $f_*K$ is compact.
\end{thm}

\begin{proof}
{\bf Want:} $\forall s\in(f_*K)^\N$, $s$ is subconvergent in $f_*K$.\\
Given $s\in(f_*K)^\N$. \quad {\bf Want:} $s$ is subconvergent in $f_*K$.\\
{\bf Want:} $\exists$subsequence $t$ of $s$ s.t.~$t$ is convergent in $f_*K$.\\
For all $j\in\N$, let $A_j:=(f^*\{s_j\})\cap K$.\\
\\
{\it Claim 1:} $\forall j\in\N$, $A_j\ne\emptyset$.\\
{\it Proof of Claim 1:}
Given $j\in\N$. \quad Want $A_j\ne\emptyset$.\\
Since $s\in(f_*K)^\N$, we get $s_j\in f_*K$,\\
\phx\quad so choose $x\in K$ s.t.~$s_j=f_x$.\\
Since $f_x=s_j\in\{s_j\}$, we get $x\in f^*\{s_j\}$.\\
So, since $x\in K$, we get $x\in(f^*\{s_j\})\cap K$.\\
So, since $A_j:=(f^*\{s_j\})\cap K$, we get $x\in A_j$. \quad Then $A_j\ne\emptyset$.\\
{\it End of proof of Claim 1.}\\
\\
By definition of $A_j$, we have: $\forall j\in\N$, $A_j\subseteq K$.\\
By the Claim, we have: $\forall j\in\N$, $A_j\ne\emptyset$.\\
Define $\sigma\in K^\N$ by $\forall j\in\N$, $\sigma_j=\CH_{A_j}$.\\
By hypothesis $K$ is compact, so $\sigma$ is subconvergent in $K$.\\
Choose a subsequence $\tau$ of $\sigma$ s.t.~$\tau$ is convergent in $K$.\\
Choose a strictly-increasing $\ell\in\N^\N$ s.t.~$\tau=\sigma\circ\ell$.\\
Let $t:=s\circ\ell$. \quad Then $t$ is a subsequence of $s$.\\
{\bf Want:} $t$ is convergent in $f_*K$.\\
\\
{\it Claim 2:} $f\circ\sigma=s$.\\
{\it Proof of Claim 2:}
{\bf Want:} $\forall j\in\N$, $(f\circ\sigma)_j=s_j$.\\
Given $j\in\N$. \quad {\bf Want:} $(f\circ\sigma)_j=s_j$.\\
We have $\sigma_j\in A_j=(f^*\{s_j\})\cap K\subseteq f^*\{s_j\}$,
so $\sigma_j\in f^*\{s_j\}$, so $f_{\sigma_j}\in\{s_j\}$.\\
Then $f_{\sigma_j}=s_j$. \quad Then $(f\circ\sigma)_j=f_{\sigma_j}=s_j$.\\
{\it End of proof of Claim 2.}\\
\\
By Claim 2, $f\circ\sigma=s$. Then $f\circ\sigma\circ\ell=s\circ\ell$.\\
So since $\tau=\sigma\circ\ell$ and $t=s\circ\ell$, we get $f\circ\tau=t$.\\
Since $\tau$ is convergent in $K$, choose $\xi\in K$ s.t.~$\tau\to\xi$.\\
By hypothesis $f$ is continuous on $K$. \quad Then $f$ is continuous at $\xi$.\\
Then, by HW\#6-2, $f\circ\tau\to f_\xi$.\\
So, since $f\circ\tau=t$, we get $t\to f_\xi$.\\
Since $\xi\in K$ and $K\subseteq\D_f$, we get $f_\xi\in f_*K$.\\
So, since $t\to f_\xi$, we see that $t$ is convergent in $f_*K$.
\end{proof}

\subsection{Semi-monotone subsequences of real-valued sequences}
\quad
\vskip.1in\noindent
Note that, in Case (1) of the proof of the following theorem,\\
\phx\qquad $\ell$ is the strict-forward-orbit of $\min P$ under $f$\\
and that, in Case (2) of the proof of the following theorem,\\
\phx\qquad $\ell$ is the strict-forward-orbit of $(\max P)+1$ under $f$.\\

\begin{thm}\wrlab{thm-real-seq-has-semimonot-subseq}
Let $s\in\R^\N$.\\
\phx\qquad\qquad\qquad\qquad Then $\exists$subsequence $t$ of $s$ s.t.~$t$ is semi-monotone.
\end{thm}

\begin{proof}
Let $P:=\{j\in\N\,|\,\forall k\in(j..\infty),\,s_k<s_j\}$.\\
Then $P\subseteq\N$, \quad so $P^\N\subseteq\N^\N$.\\
Exactly one of the following is true:\\
\phx\qquad (1) $P$ is infinite \qquad\qquad or \qquad\qquad (2) $P$ is finite.\\
\\
{\it Case (1):}
Since $P$ is infinite, we get: \quad $\forall j\in\N$, $\,$ $\emptyset\ne P\bksl[1..j]\subseteq\N$.\\
So, by the Well-Ordering Axiom, we get: $\forall j\in\N$, $\,$ $\min(P\bksl[1..j])\ne\frownie$.\\
Define $f:P\to P$ by: $\forall j\in\N$, $f(j)=\min(P\bksl[1..j])$.\\
Then, $\forall j\in\N$, $f(j)\in P\bksl[1..j]$.\\
Define $\ell\in P^\N$ by: $\forall j\in\N$, $\ell_j=f_\circ^j(\min P)$.\\
Then, $\forall j\in\N$, we have $f(\ell_j)=\ell_{j+1}$.\\
Then, $\forall j\in\N$, we have $\ell_{j+1}=f(\ell_j)\in P\bksl[1..\ell_j]$.\\
\\
{\it Claim A:} $\ell$ is strictly increasing.\\
{\it Proof of Claim A:}
{\bf Want:} $\forall j\in\N$, $\ell_{j+1}>\ell_j$.\\
Given $j\in\N$. {\bf Want:} $\ell_{j+1}>\ell_j$.\\
We have $\ell_{j+1}\in P\bksl[1..\ell_j]\subseteq\N\bksl[1..\ell_j]=(\ell_j..\infty)>\ell_j$.\\
{\it End of proof of Claim A.}\\
\\
We have $\ell\in P^\N\subseteq\N^\N$, so, by Claim A,\\
\phx\qquad $s\circ\ell$ is a subsequence of $s$.\\
Let $t:=s\circ\ell$. \quad Then $t$ is a subsequence of $s$.\\
{\bf Want:} $t$ is semi-monotone.\\
{\bf It suffices to show:} $t$ is semi-decreasing.\\
{\bf It suffices to show:} $t$ is strictly-decreasing.\\
{\bf Want:} $\forall j\in\N$, $t_{j+1}<t_j$.\\
Given $j\in\N$. \quad {\bf Want:} $t_{j+1}<t_j$.\\
By Claim A, $\ell_{j+1}>\ell_j$. \quad
Since $\ell\in P^\N$, we get $\ell_{j+1}\in P$.\\
Since $\ell_{j+1}>\ell_j$ and $\ell_{j+1}\in P\subseteq\N$, we get: $\ell_{j+1}\in(\ell_j..\infty)$.\\
Since $\ell\in P^\N$, we see that $\ell_j\in P$,\\
\phx\quad so, by definition of $P$, we get: $\forall k\in(\ell_j..\infty)$, $\,$ $s_k<s_{\ell_j}$.\\
So, since $\ell_{j+1}\in(\ell_j..\infty)$, we get: $s_{\ell_{j+1}}<s_{\ell_j}$.\\
Then $t_{j+1}=(s\circ\ell)_{j+1}=s_{\ell_{j+1}}<s_{\ell_j}=(s\circ\ell)_j=t_j$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}
Since $P$ is finite, we get: $\max P\ne\frownie$.\\
Then $\max P\in P$. \quad Let $m:=\max P$. \quad Then $m\in P$.\\
Since $m\in P\subseteq\N$, we get $m\in\N$. \quad Then $m+1\in(m..\infty)$.\\
For all $j\in\N$, let $X_j:=\{k\in(j..\infty)\,|\,s_k\ge s_j\}$.\\
Then, $\forall j\in\N$, $X_j\subseteq(j..\infty)$.\\
\\
{\it Claim B:} $\forall j\in(m..\infty)$, $X_j\ne\emptyset$.\\
{\it Proof of Claim B:}
Given $j\in(m..\infty)$. \quad {\bf Want:} $X_j\ne\emptyset$.\\
Since $j>m=\max P$, we see that $j\notin P$.\\
Then, by definition of $P$, choose $k\in(j..\infty)$ s.t.~$s_k\ge s_j$.\\
Then, by definition of $X_j$, we get: $k\in X_j$. \quad
Then $X_j\ne\emptyset$.\\
{\it End of proof of Claim B.}\\
\\
We have: $\forall j\in\N$, \quad $X_j\subseteq(j..\infty)\subseteq\N$, \quad so $X_j\subseteq\N$.\\
So, by Claim B, we have: $\forall j\in\N$, $\emptyset\ne X_j\subseteq\N$.\\
Then, by the Well-Ordering Axiom, we get: $\forall j\in\N$, $\min X_j\ne\frownie$.\\
Then, $\forall j\in\N$, $\min X_j\in X_j$.\\
We have: $\forall j\in(m..\infty)$, \quad $j>m$, \quad so $(j..\infty)\subseteq(m..\infty)$.\\
We have: $\forall j\in(m..\infty)$, \quad $\min X_j\in X_j\subseteq(j..\infty)\subseteq(m..\infty)$.\\
Then: $\forall j\in(m..\infty)$, \quad $\min X_j\in(m..\infty)$.\\
Define $f:(m..\infty)\to(m..\infty)$ by: $\forall j\in(m..\infty)$, $f(j)=\min X_j$.\\
Then, $\forall j\in\N$, $f(j)\in X_j$.\\
We have: $\forall j\in\N$, \quad $f(j)\in X_j\subseteq(j..\infty)$, \quad so $f(j)\in(j..\infty)$.\\
Define $\ell\in(m..\infty)^\N$ by: $\forall j\in\N$, $\ell_j=f_\circ^j(m+1)$.\\
Then, $\forall j\in\N$, we have $f(\ell_j)=\ell_{j+1}$.\\
Then, $\forall j\in\N$, we have $\ell_{j+1}=f(\ell_j)\in X_{\ell_j}$, so $\ell_{j+1}\in X_{\ell_j}$.\\
Also, $\forall j\in\N$, we have $\ell_{j+1}=f(\ell_j)\in(\ell_j..\infty)>\ell_j$.\\
Then $\ell$ is strictly-increasing.\\
So, as $\ell\in P^\N\subseteq\N^\N$, we get: $s\circ\ell$ is a subsequence of $s$.\\
Let $t:=s\circ\ell$. \quad Then $t$ is a subsequence of $s$.\\
{\bf Want:} $t$ is semi-monotone.\\
{\bf It suffices to show:} $t$ is semi-increasing.\\
{\bf Want:} $\forall j\in\N$, $t_{j+1}\ge t_j$.\\
Given $j\in\N$. \quad {\bf Want:} $t_{j+1}\ge t_j$.\\
We have $\ell_{j+1}\in X_{\ell_j}=\{k\in(\ell_j..\infty)\,|\,s_k\ge s_{\ell_j}\}$. \quad
Then $s_{\ell_{j+1}}\ge s_{\ell_j}$.\\
Then $t_{j+1}=(s\circ\ell)_{j+1}=s_{\ell_{j+1}}\ge s_{\ell_j}=(s\circ\ell)_j=t_j$.\\
{\it End of Case (2).}
\end{proof}

\subsection{Sequentially-closed subsets of $\R$}

\begin{defn}
Let $A\subseteq\R$.\\
\phx\quad By $A$ is \bfindex[sequentially-closed], we mean:\\
\phx\qquad\qquad $\forall s\in A^\N$, \quad $(\,s\hbox{ is convergent}\,)\,\Rightarrow\,(\,s\hbox{ is convergent in }A\,)$.
\end{defn}

\begin{thm}
Let $A\subseteq\R$.\\
\phx\quad Then $A$ is sequentially-closed if and only if:\\
\phx\qquad\qquad $\forall s\in A^\N$, $\forall z\in R$, \quad $(\,s\to z\,)\,\Rightarrow\,(\,z\in A\,)$.
\end{thm}

\begin{thm}\wrlab{thm-lim-le}
Let $a,z\in\R$, $t\in\R^\N$.\\
\phx\qquad\qquad\qquad Assume $\forall j\in\N$, $t_j\le a$.\\
\phx\qquad\qquad\qquad Assume $t\to z$. \quad Then $z\le a$.
\end{thm}

\begin{proof}
Assume $z>a$. \quad {\bf Want:} Contradiction.\\
Let $\vep:=z-a$. \quad Then $\vep>0$.\\
Since $t\to z$, choose $K\in\N$ s.t., $\forall j\in\N$, $\,$ $(\,j\ge K\,)\,\Rightarrow\,(\,|t_j-z|<\vep\,)$.\\
By assumption, $t_K\le a$. By the choice of $K$, $|t_K-z|<\vep$.\\
Since $|t_K-z|<\vep$, we get $z-\vep<t_K<z+\vep$.\\
Then $t_K\le a=z-(z-a)=z-\vep<t_K$, so $t_K<t_K$. Contradiction.
\end{proof}

\begin{thm}\wrlab{thm-lim-ge}
Let $a,z\in\R$, $t\in\R^\N$.\\
\phx\qquad\qquad\qquad Assume $\forall j\in\N$, $a\le t_j$.\\
\phx\qquad\qquad\qquad Assume $t\to z$. \quad Then $a\le z$.
\end{thm}

\begin{proof}
Assume $a>z$. \quad {\bf Want:} Contradiction.\\
Let $\vep:=a-z$. \quad Then $\vep>0$.\\
Since $t\to z$, choose $K\in\N$ s.t., $\forall j\in\N$, $\,$ $(\,j\ge K\,)\,\Rightarrow\,(\,|t_j-z|<\vep\,)$.\\
By assumption, $a\le t_K$. By the choice of $K$, $|t_K-z|<\vep$.\\
Since $|t_K-z|<\vep$, we get $z-\vep<t_K<z+\vep$.\\
Then $t_K<z+\vep=z+(a-z)=a\le t_K$, so $t_K<t_K$. Contradiction.
\end{proof}

\begin{thm}\wrlab{thm-cpt-intvls-seq-closed}
Let $a,b\in\R$. Assume $a\le b$.\\
\phx\qquad\qquad\qquad Then $[a;b]$ is sequentially-closed.
\end{thm}

\begin{proof}
{\bf Want:} $\forall s\in[a;b]^\N$, $\forall z\in\R$, \quad $(\,s\to z\,)\,\Rightarrow\,(\,z\in[a;b]\,)$.\\
Given $s\in[a;b]^\N$\,\,,\,\,$z\in\R$. \quad Assume $s\to z$. \quad {\bf Want:} $z\in[a;b]$.\\
Since $s\in[a;b]^\N$, we get: $\forall j\in\N$, $s_j\in[a;b]$.\\
Then $\forall j\in\N$, we have $a\le s_j\le b$.\\
By \tref{thm-lim-le}, $z\le b$. \quad By \tref{thm-lim-ge}, $a\le z$.\\
Then $a\le z\le b$. \quad Then $z\in[a;b]$.
\end{proof}

\begin{thm}
Let $X\subseteq\R$.\\
\phx\qquad\qquad Then: $(\,X\hbox{ is closed}\,)\,\Leftrightarrow\,(X\hbox{ is sequentially-closed})$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}\\
Assume $X$ is closed. \quad {\bf Want:} $X$ is sequentially-closed.\\
{\bf Want:} $\forall s\in X^\N$, $\forall q\in\R$, $(\,s\to q\,)\,\Rightarrow\,(\,q\in X\,)$.\\
Given $s\in X^\N$, $q\in\R$. \quad Assume $s\to q$. \quad {\bf Want:} $q\in X$.\\
Assume $q\notin X$. \qquad {\bf Want:} Contradiction.\\
Since $q\in\R$ and $q\notin X$, we get: $q\in\R\bksl X$.\\
Since $S$ is closed, we get: $\partial X\subseteq X$.\\
Let $t:=(q,q,q,q,\ldots)$. \quad Then $t\in(\R\bksl)^\N$ and $t\to q$.\\
So, since $s\in X^\N$ and $s\to q$, we conclude: $q\in\partial X$.\\
Then $q\in\partial X\subseteq X$, so $q\in X$.\\
Then $q\in X$ and $q\notin X$. \quad Contradiction.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume $X$ is sequentially-closed. \quad {\bf Want:} $X$ is closed.\\
{\bf Want:} $\partial X\subseteq X$.\\
{\bf Want:} $\forall q\in\partial X$, $q\in X$.\\
Given $q\in\partial X$. \quad {\bf Want:} $q\in X$.\\
Since $q\in\partial X$, we know: $\exists s\in X^\N$ s.t.~$s\to q$.\\
So, since $X$ is sequentially-closed, $q\in X$.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{thm}
Let $X\subseteq\R$. \quad Then:\\
\phx\qquad\qquad\qquad $($ $X$ is compact $)$ \quad $\Leftrightarrow$ \quad $($ $X$ is closed and bounded $)$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}\\
Assume: $X$ is compact.\\
{\bf Want:} $X$ is closed and bounded.\\
By \tref{thm-cpt-implies-bdd}, $X$ is bounded. \quad {\bf Want:} $X$ is closed.\\
{\bf Want:} $X$ is sequentially-closed.\\
{\bf Want:} $\forall s\in X^\N$, $\forall q\in\R$, $(\,s\to q\,)\,\Rightarrow(\,q\in X\,)$.\\
Given $s\in X^\N$, $q\in\R$. \quad Assume $s\to q$. \quad {\bf Want:} $q\in X$.\\
Since $X$ is compact and $s\in X^\N$, we know: $s$ is subconvergent in $X$.\\
Choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
Choose $z\in X$ s.t.~$t\to z$.\\
Since $s\to q$ and since $t$ is a subsequence of $s$, we get: $t\to q$.\\
Since $t\to q$ and $t\to z$, we get: $q=z$.\\
Since $q=z\in X$, we get: $q\in X$.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume: $X$ is closed and bounded.\\
{\bf Want:} $X$ is compact.\\
{\bf Want:} $\forall s\in X^\N$, $s$ is subconvergent in $X$.\\
Given $s\in X^\N$. \quad {\bf Want:} $s$ is subconvergent in $X$.\\
{\bf Want:} $\exists$subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
Since $s\in X^\N\subseteq\R^\N$, by \tref{thm-real-seq-has-semimonot-subseq},\\
\phx\qquad choose a subsequence $t$ of $s$ s.t.~$t$ is semi-monotone.\\
Then $t$ is a subsequence of $s$. \quad {\bf Want:} $t$ is convergent in $X$.\\
Since $X$ is closed, we know: $X$ is sequentially-closed.\\
{\bf Want:} $t$ is convergent.\\
Since $\I_t\subseteq\I_s\subseteq X$ and since $X$ is bounded,\\
\phx\qquad we conclude: $\I_t$ is bounded.\\
So, since $t$ is semi-monotone, $t$ is convergent.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{thm}\wrlab{thm-intersect-compact-closed-is-cpt}
Let $C,K\subseteq\R$.\\
\phx\qquad\qquad Assume that $C$ is closed and that $K$ is compact.\\
\phx\qquad\qquad Then $C\cap K$ is compact.
\end{thm}

\begin{proof}
Since $K$ is compact, we get: $K$ is closed and bounded.\\
Since $C$ and $K$ are both closed, we get: $C\cap K$ is closed.\\
Since $K$ is bounded and since $C\cap K\subseteq K$, we get: $C\cap K$ is bounded.\\
Since $C\cap K$ is closed and bounded, $C\cap K$ is compact.
\end{proof}

\subsection{Extreme values of continuous functionals on $[0;1]$}
\quad
\vskip.1in\noindent
Our goal, in this section, is to prove:\\
\phx\quad $\forall$continuous $f:[0;1]\to\R$, \quad $\max\I_f\ne\frownie$.\\
We indicated, in class, why\\
\phx\quad this is NOT true when $[0;1]$ is replaced by $[0;1)$.\\
\\
By \tref{thm-half-open-not-cpt}, we see that $(0;1]$ is NOT compact.

\begin{thm}\wrlab{thm-cpt-intvl-cpt}
Let $a,b\in\R$. Assume $a\le b$.\\
\phx\qquad\qquad\qquad Then $[a;b]$ is compact.
\end{thm}

\begin{proof}
{\bf Want:} $\forall s\in[a;b]^\N$, $s$ is subconvergent in $[a;b]$.\\
Given $s\in[a;b]^\N$. \quad {\bf Want:} $s$ is subconvergent in $[a;b]$.\\
{\bf Want:} $\exists$subsequence $t$ of $s$ s.t.~$t$ is convergent in $[a;b]$.\\
By \tref{thm-real-seq-has-semimonot-subseq}, choose a subsequence $t$ of $s$ s.t.~$t$ is semi-monotone.\\
Then $t$ is a subsequence of $s$. \quad {\bf Want:} $t$ is convergent in $[a;b]$.\\
Since $\I_t\subseteq\I_s\subseteq[a;b]\subseteq B((a+b)/2;(b-a+2)/2)$, we see that $\I_t$ is bounded.\\
Since $t$ is semi-monotone and $\I_t$ is bounded, $t$ is convergent.\\
By \tref{thm-cpt-intvls-seq-closed}, $[a;b]$ is sequentially-closed.\\
So, since $t\in[a;b]^\N$ and $t$ is convergent,\\
\phx\qquad it follows that $t$ is convergent in $[a;b]$.
\end{proof}

\begin{thm}\wrlab{thm-EVT-for-cpt-subsets-of-R}
Let $K\subseteq\R$, $f:\R\drta\R$.\\
Assume: \quad $f$ is continuous on $K$ \quad and \quad $K$ is compact and nonempty.\\
\phx\qquad\qquad\qquad\qquad Then: $\max f_*K\ne\frownie$.
\end{thm}

\begin{proof}
\tref{thm-fwd-im-cpt-is-cpt}, we get: $f_*K$ is compact.\\
Since $K$ is nonempty, $f_*K$ is nonempty.\\
Let $L:=f_*K$. Then $L$ is compact and nonempty.\\
By \tref{thm-max-cpt-subset-R-exists}, $\max L\ne\frownie$.\\
So, since $L=f_*K$, we see that $\max f_*K\ne\frownie$.
\end{proof}

\noindent
Recall that our goal for this section was to prove:\\
\phx\quad $\forall$continuous $f:[0;1]\to\R$, \quad $\max\I_f\ne\frownie$.\\
With the preceding three theorems, we are now ready to prove more:

\begin{thm}
Let $a\in\R$, $b>a$. Let $f:[a;b]\to\R$.\\
\phx\quad Assume $f$ is continuous. \quad Then $\max\I_f\ne\frownie$.
\end{thm}

\begin{proof}
Let $K:=[a;b]$. \quad Then $\I_f=f_*\D_f=f_*[a;b]=f_*K$.\\
Also, $K$ is nonempty and $f$ is continuous on $K$.\\
By \tref{thm-cpt-intvl-cpt}, $K$ is compact.\\
Then, by \tref{thm-EVT-for-cpt-subsets-of-R}, $\max f_*K\ne\frownie$.\\
So, since $\I_f=f_*K$, we conclude that $\max\I_f\ne\frownie$.
\end{proof}

\subsection{Uniform convergence of sequences of functions $\R\drta\R$}

\begin{defn}
Let $D$ and $Y$ be sets, $s\in(Y^D)^\N$, $x\in D$.\\
Then $\boxed{s_\bullet(x)}\in Y^\N$ is defined by: $\forall j\in\N$, $((s_\bullet(x))_j=s_j(x)$.
\end{defn}

We define \bfindex[pointwise convergence].

\begin{defn}
Let $D\subseteq\R$, $s\in(\R^D)^\N$, $f\in\R^D$.\\
By {\bf $s\to f$ pointwise}, we mean: $\forall x\in D$, $s_\bullet(x)\to f(x)$.\\
\end{defn}

\noindent
Let $D\subseteq\R$, $s\in(\R^D)^\N$, $f\in\R^D$.\\
Then \qquad $s\to f$ pointwise \qquad iff\\
\phx\qquad\qquad $\forall x\in D$, $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,|\,[\,s_j(x)\,]\,-\,[\,f(x)\,]\,|<\vep\,\,)$.

\noindent
We define \bfindex[uniform convergence]:

\begin{defn}
Let $D\subseteq\R$, $s\in(\R^D)^\N$, $f\in\R^D$.\\
By {\bf $s\to f$ uniformly}, we mean: $\forall\vep>0$, $\exists K\in\N$ s.t., $\forall j\in\N$, $\forall x\in D$,\\
\phx\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,|\,[\,s_j(x)\,]\,-\,[\,f(x)\,]\,|<\vep\,\,)$.
\end{defn}

\begin{thm}
Define $\phi:\R\to\R$ by: $\forall x\in\R$, $\phi(x)=1/(1+x^2)$.\\
Define $s\in(\R^\R)^\N$ by: $\forall j\in\N$, $\forall x\in\R$, $s_j(x)=\phi(j\cdot x)$.\\
Let $f:\chi_{\{0\}}^\R$. Then $s\to f$ pointwise.
\end{thm}

\noindent
From the preceding theorem, we see that:\\
\phx\qquad a pointwise limit of continuous functions can be discontinuous.\\
By contrast, uniform limits of continuous functions are continuous:

\begin{thm}
Let $D\subseteq\R$, $s\in(\R^D)^\N$, $f\in\R^D$.\\
Assume: \quad $s\to f$ uniformly \quad and \quad $\forall j\in\N$, $s_j$ is continuous.\\
Then: \qquad $f$ is continuous.
\end{thm}

\begin{proof}
This is HW\#9-2.
\end{proof}

\subsection{Open Mapping Theorem}
\quad
\vskip.1in\noindent
Let $A:=[1;2]$, $B:=(3;4]$, $C:=[5;7]$.\\
Define $f:A\cup B\to C$ by: \qquad\qquad $\forall x\in A$, $f_x=x+4$\\
\phx\qquad\qquad\qquad\qquad and \qquad $\forall x\in B$, $f_x=x+3$.\\
Then $f:A\cup B\hookrightarrow>C$ and $f$ is continuous.\\
However $f^{-1}$ is not continuous at $6$.\\
So the inverse of a continuous function is not always continuous.\\
Basically, $f$ glues two intervals, $A$ and $B$, together,\\
\phx\quad whereas, whereas $f^{-1}$ tears $C$ apart;\\
\phx\quad gluing is continuous, while tearing apart is discontinouus.
Our goal in this section is to show, that\\
\phx\quad if a continuous injection has compact domain,\\
\phx\quad then its inverse is continuous:

\begin{thm}\wrlab{thm-open-mapping-theorem-cpt-domain}
Let $K\subseteq\R$, $f:K\hookrightarrow\R$.\\
\phx\qquad Assume: \quad $K$ is compact \quad and \quad $f$ is continuous.\\
\phx\qquad\qquad Then: \quad $f^{-1}$ is continuous.
\end{thm}

\begin{proof}
Since $f:K\hookrightarrow\R$, we get $\D_f=K$.\\
By \tref{thm-contin-if-preim-closed-is-closed}, want: $\forall$closed $C\subseteq\R$, $(f^{-1})^*C$ is closed.\\
Given a closed $C\subseteq\R$. \quad {\bf Want:} $(f^{-1})^*C$ is closed.\\
By \tref{thm-intersect-compact-closed-is-cpt}, $C\cap K$ is compact.\\
Then, by \tref{thm-fwd-im-cpt-is-cpt}, $f_*(C\cap K)$ is compact.\\
Then $f_*(C\cap K)$ is closed.\\
So, since $(f^{-1})^*C=f_*C=f_*(C\cap\D_f)=f_*(C\cap K)$,\\
\phx\quad we conclude: $(f^{-1})^*C$ is closed.
\end{proof}

\subsection{Continuity and uniform continuity on a compact set}

\begin{thm}\wrlab{thm-contin-on-cpt-implies-uc}
Let $f:\R\drta\R$.\\
Assume $f$ is continuous and $\D_f$ is compact. Then $f$ is uniformly continuous.
\end{thm}

\begin{proof}
Assume $f$ is not uniformly continuous. {\bf Want:} Contradiction.\\
Choose $\vep>0$ s.t., $\forall\delta>0$, $\exists w,x\in\D_f$ s.t.\\
\phx\qquad\qquad\qquad $(\,|w-x|<\delta\,)\,\&\,(\,|f_w-f_x|\ge\vep\,)$.\\
Let $K:=\D_f$. \qquad Then $K$ is compact.\\
Also, $\forall\delta>0$, $\exists w,x\in K$ s.t.\\
\phx\qquad\qquad\qquad $(\,|w-x|<\delta\,)\,\&\,(\,|f_w-f_x|\ge\vep\,)$.\\
Then: $\forall j\in\N$, $\exists w,x\in K$ s.t.\\
\phx\qquad\qquad\qquad $(\,|w-x|<1/j\,)\,\&\,(\,|f_w-f_x|\ge\vep\,)$.\\
By the Axiom of Choice, choose $w,x\in K^\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad $(\,|w_j-x_j|<1/j\,)\,\&\,(\,|f_{w_j}-f_{x_j}|\ge\vep\,)$.\\
Since $K$ is compact, $w$ is subconvergent in $K$.\\
Choose a subsequence $v$ of $w$ s.t.~$v$ is convergent in $K$.\\
Choose $q\in K$ s.t.~$v\to q$.\\
Choose a strictly-increasing $\ell\in\N^\N$ s.t.~$v=w\circ\ell$.\\
Then $w\circ\ell\to q$, so, by HW\#10-1, $x\circ\ell\to q$.\\
Since $w\circ\ell\to q$ and since $f$ is continuous at $q$, we get: $f\circ w\circ\ell\to f_q$.\\
Choose $A\in\N$ s.t., $\forall i\in\N$, $(\,i\ge A\,)\,\Rightarrow\,(\,|(f\circ w\circ\ell)_i-f_q|<\vep/2\,)$.\\
Since $x\circ\ell\to q$ and since $f$ is continuous at $q$, we get: $f\circ x\circ\ell\to f_q$.\\
Choose $B\in\N$ s.t., $\forall i\in\N$, $(\,i\ge B\,)\,\Rightarrow\,(\,|(f\circ x\circ\ell)_i-f_q|<\vep/2\,)$.\\
Let $i:=\max\{A,B\}$. \quad Then $i\in\N$ and $i\ge A$ and $i\ge B$.\\
Since $i\ge A$, we get: $|(f\circ w\circ\ell)_i-f_q|<\vep/2$.\\
Since $i\ge B$, we get: $|(f\circ x\circ\ell)_i-f_q|<\vep/2$.\\
Let $j:=\ell_i$. Then $|(f\circ w)_j-f_q|<\vep/2$ and $|(f\circ x)_j-f_q|<\vep/2$.\\
Then $|f_{w_j}-f_q|<\vep/2$ and $|f_{x_j}-f_q|<\vep/2$.\\
Since $\ell\in\N^\N$ and $j=\ell_i$, we get: $j\in\N$.\\
Then, by the choice of $w$ and $x$, we get: $|f_{w_j}-f_{x_j}|\ge\vep$.\\
Then $\vep\le|f_{w_j}-f_{x_j}|\le|f_{w_j}-f_q|+|f_q-f_{x_j}|$.\\
Then $\vep\le|f_{w_j}-f_{x_j}|\le|f_{w_j}-f_q|+|f_{x_j}-f_q|<(\vep/2)+(\vep/2)=\vep$.\\
Then $\vep<\vep$. \quad Contradiction.
\end{proof}

\section{Differentiability of functions $\R\drta\R$}

\subsection{The double translate}
\quad
\vskip.1in\noindent
The function $f_a^\T$ in the next definition is called the \bfindex[Double Translate] of $f$ based at $a$.

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
Then $\boxed{f_a^\T}:\R\drta\R$ is defined by: \qquad $\forall h\in\R$, \quad $(f_a^\T)_h=f_{a+h}-f_a$.
\end{defn}

\noindent
Note that: $\forall f:\R\drta\R$, $\forall a\in\R\bksl\D_f$, we have: $f_a^\T=\emptyset$.\\
\\
By HW\#6-4, we have:

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$.\\
\phx\quad Assume that $f_a^\T$ is continuous at $0$. \quad Then $f$ is continuous at $a$.
\end{thm}

\noindent
The following is HW\#6-5. It is the \bfindex[Precalculus Chain Rule].

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\D_{g\circ f}$.\\
\phx\quad Then: \quad $(g\circ f)_a^\T\quad=\quad g_{f_a}^\T\,\,\circ\,\,f_a^\T$.
\end{thm}

\noindent
The following is HW\#7-5. It is the \bfindex[Precalculus Product Rule].

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\D_{f\cdot g}$.\\
\phx\quad Then: \quad $(f\cdot g)_a^\T\quad=\quad f_q^\T\,\cdot\,g_q\,\,+\,\,f_q\,\cdot\,g_q^\T\,\,+\,\,f_q^\T\,\cdot\,g_q^\T$.
\end{thm}

\subsection{$\scrbigo$ and $\scrlito$}

\begin{defn}\phx\\
\phx\qquad $\boxed{(\bullet)}:\R\to\R$ is defined by: \quad $\forall x\in\R$, $\,$ $(\bullet)_x=x$.\\
\phx\qquad $\boxed{|\bullet|}:\R\to\R$ is defined by: \quad $\forall x\in\R$, $\,$ $|\bullet|_x=|x|$.\\
\phx\qquad $\boxed{\sqrt{\bullet}}:\R\drta\R$ is defined by: \quad $\forall x\in\R$, $\,$ $\sqrt{\bullet}_x=\sqrt{x}$.
\end{defn}

\begin{defn}
Let $k\in\N_0$. Then\\
\phx\qquad $\boxed{(\bullet)^k}:\R\to\R$ is defined by: \quad $\forall x\in\R$, $\,$ $(\bullet)^k_x=x^k$ \qquad and\\
\phx\qquad $\boxed{|\bullet|^k}:\R\to\R$ is defined by: \quad $\forall x\in\R$, $\,$ $|\bullet|^k_x=|x|^k$.
\end{defn}

\begin{thm}\phx\\
\phx\qquad$(\bullet)^0=|\bullet|^0=C_1^\R$ \quad and \quad $(\bullet)^1=(\bullet)=\id^\R$ and $|\bullet|^1=|\bullet|$.
\end{thm}

\begin{thm}
$\forall k\in\N_0$, $|\bullet|^{2k}=(\bullet)^{2k}$.
\end{thm}

\begin{thm}
$(\bullet)^2|[0;\infty):[0;\infty)\hookrightarrow>[0;\infty)$.
\end{thm}

\begin{thm}
$\sqrt{\bullet}=((\bullet)^2|[0;\infty))^{-1}$.
\end{thm}

\begin{thm}
$\sqrt{\bullet}:[0;\infty)\hookrightarrow>[0;\infty)$.
\end{thm}

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\quad Then $f$ is \bfindex[defined at $a$] means: $a\in D_f$.\\
\phx\quad Also, $f$ is \bfindex[defined near $a$] means:\\
\phx\qquad\qquad $\exists B\in\scrb(a)$ s.t.~$B\subseteq\D_f$.
\end{defn}

\noindent
Because $\D_{\sqrt{\bullet}}=[0;\infty)$, we get:

\begin{thm}\phx\\
\phx\qquad $\sqrt{\bullet}$ is defined near $0.01$ \qquad and\\
\phx\qquad $\sqrt{\bullet}$ is defined at $0$ \qquad and\\
\phx\qquad $\sqrt{\bullet}$ is NOT defined near $0$.
\end{thm}

\noindent
Convention: Each of $a\le b$ or $a<b$ or $a\ge b$ or $a>b$,\\
\phx\qquad\qquad\qquad implies that $a\ne\frownie\ne b$.

\begin{thm}
Let $f:\R\drta\R$, $a\in\R$. Then:\\
\phx\qquad $($ $f$ is defined near $a$ and continuous at $a$ $)$ \qquad $\Leftrightarrow$\\
\phx\qquad $(\,\,\,\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad\qquad $(\,\,\,|x-a|<\delta\,)\,\Rightarrow\,(\,|f_x-f_a|\le\vep\,)\,\,\,)$.
\end{thm}

\begin{defn}
Let $k\in\N_0$. Then:\\
\phx\qquad $\boxed{\scrlito(k)}\,\,\,:=\,\,\,\{\,\,\,f:\R\drta\R\,|\,\forall\vep>0,\,\exists\delta>0~\hbox{s.t.}~\forall x\in\R,$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x|<\delta\,)\,\Rightarrow\,(\,|f_x|\le\vep\cdot|x|^k\,)\,\,\,\}$. \index[terms]{$\scrlito(k)$}
\end{defn}

\noindent
Let $k\in\N_0$ and $f:\R\drta\R$. Then: \qquad $f\in\scrlito(k)$ \quad iff\\
\phx\qquad\qquad\qquad $\forall\vep>0$, \quad near $0$ we have $-\vep\cdot|\bullet|^k\le f\le\vep\cdot|\bullet|^k$.\\
\\
Let $f:\R\drta\R$. Then: \qquad $f\in\scrlito(7)$ \quad iff\\
\phx\qquad\qquad\qquad near $0$ we have $-|\bullet|^7\le f\le|\bullet|^7$ \qquad and\\
\phx\qquad\qquad\qquad near $0$ we have $-|\bullet|^7/2\le f\le|\bullet|^7/2$ \qquad and\\
\phx\qquad\qquad\qquad near $0$ we have $-|\bullet|^7/3\le f\le|\bullet|^7/3$ \qquad {\it etc.}\\
\\
Note that $(\bullet)^7\notin\scrlito(7)$ and that $|\bullet|^7\notin\scrlito(7)$.

\begin{thm}
Let $k\in\N_0$, $f\in\scrlito(k)$.\\
\phx\qquad Then: \quad $f_0=0$ \quad and \quad $f$ is defined near $0$.
\end{thm}

\begin{thm}
Let $f\in\scrlito(k)$. Then: \qquad $f\in\scrlito(0)$ \quad iff \\
\phx\qquad $(\,f\hbox{ is defined near }0\,)\,\&\,(\,f\hbox{ is continuous at }0\,)\,\&\,(\,f_0=0\,)$.
\end{thm}

\begin{defn}
$\forall x\in\R$, $\forall k\in\N_0$, \quad $\boxed{x^{k+(1/101)}}:=x^k\cdot\sqrt[101]{x}$.
\end{defn}

\begin{thm}\wrlab{thm-facts-on-1over101}\phx\\
\phx\qquad $\forall a\in\R$, $a^{1/101}=\sqrt[101]{a}$ \qquad and\\
\phx\qquad $\forall a\in\R$, $(a^{101})^{1/101}=a=(a^{1/101})^{101}$ \qquad and\\
\phx\qquad $\forall a\in\R$, $|a^{3+(1/101)}|=|a|^{3+(1/101)}=|a|^3\cdot|a|^{1/101}$ \qquad and\\
\phx\qquad $\forall a,b\in\R$, $(\,a<b\,)\,\Rightarrow\,(\,a^{3+(1/101)}<b^{3+(1/101)}\,)$.
\end{thm}

\begin{thm}\phx\\
\phx\qquad (a) $(\bullet)^4\,\in\,\scrlito(3)$ \qquad and\\
\phx\qquad (b) $(\bullet)^{3+(1/101)}\,\in\,\scrlito(3)$.
\end{thm}

\begin{proof}
Unassigned HW. (Hint: Use \tref{thm-facts-on-1over101}.)
\end{proof}

\begin{defn}
Let $k\in\N_0$.\\
\phx\quad Then $\,$ $\boxed{\scrbigo(k)}\,\,:=\,\,\{\,f:\R\drta\R\,|\,\exists C\ge0,\,\exists\delta>0~\hbox{s.t.}, \forall x\in\R,$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x|<\delta\,)\,\Rightarrow\,(\,|f_x|\le C\cdot|x|^k\,)\,\}$. \index[terms]{$\scrbigo(k)$}
\end{defn}

\noindent
NOTE: For any $k\in\N_0$, for any $f:\R\drta\R$, we have:\\
\phx\quad $[$ $f\in\scrbigo(k)$ $]$ \qquad iff \qquad $[$ near $0$, $\,$ $-C\cdot|\bullet|^k\,\le\,f\,\le\,C\cdot|\bullet|^k$ $]$.\\
Here, ``near $0$'' means ``on some ball in $\R$ centered at $0$''.\\

\begin{thm}
$\forall k\in\N$, $\forall f\in\scrbigo(k)$, \quad $f_0=0$.
\end{thm}

\noindent
Note that the preceding theorem is not true when $k=0$: $C^\R_1\in\scrbigo(0)$.\\
\\
On the other hand the next result holds for all $k\in\N_0$:

\begin{thm}
$\forall k\in\N_0$, $\forall f\in\scrbigo(k)$, \quad $f$ is defined near $0$.
\end{thm}

\begin{thm}
$\forall k\in\N_0$, \quad $(\bullet)^k,|\bullet|^k\in\scrbigo(k)$.
\end{thm}

The next result is called the \bfindex[chain of $\scrbigo$, $\scrlito$ spaces]:

\begin{thm}\phx\qquad\\
\phx $\scrbigo(1)\supseteq\scrlito(1)\supseteq
\scrbigo(2)\supseteq\scrlito(2)\supseteq
\scrbigo(3)\supseteq\scrlito(3)\supseteq
\scrbigo(4)\supseteq\scrlito(4)\supseteq$\\
\phx $\scrbigo(5)\supseteq\scrlito(5)\supseteq
\scrbigo(6)\supseteq\scrlito(6)\supseteq
\scrbigo(7)\supseteq\scrlito(7)\supseteq
\scrbigo(8)\supseteq\scrlito(8)\supseteq\cdots$.
\end{thm}

\begin{thm}
Let $k\in\N_0$. Then:\\
\phx\quad $\forall f,g\in\scrlito(k)$, \quad $f+g\in\scrlito(k)$ \qquad\qquad and\\
\phx\quad $\forall c\in\R$, $\forall f\in\scrlito(k)$, \quad $c\cdot f\in\scrlito(k)$.
\end{thm}

\noindent
The preceding and following theorem are both unassigned HW.\\
NOTE: The ``\bfindex[linear operations]'' are: addition, scalar multiplication.\\
The preceding theorem says that $\scrlito(k)$ is closed under linear operations.\\
The phrase ``$\scrlito(k)$ is \bfindex[linearly closed]'' expresses that.\\
The set $\scrbigo(k)$ is also linearly closed:

\begin{thm}
Let $k\in\N_0$. Then:\\
\phx\quad $\forall f,g\in\scrbigo(k)$, \quad $f+g\in\scrbigo(k)$ \qquad\qquad and\\
\phx\quad $\forall c\in\R$, $\forall f\in\scrbigo(k)$, \quad $c\cdot f\in\scrbigo(k)$.
\end{thm}

\begin{thm}
Let $k,\ell\in\N_0$, $f\in\scrlito(k)$, $g\in\scrlito(\ell)$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $g\circ f\in\scrlito(\ell\cdot k)$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x|<\delta\,)\,\Rightarrow\,(\,|(g\circ f)_x|\le\vep\cdot|x|^{\ell\cdot k}\,)$.\\
Given $\vep>0$. {\bf Want:} $\exists\delta>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x|<\delta\,)\,\Rightarrow\,(\,|(g\circ f)_x|\le\vep\cdot|x|^{\ell\cdot k}\,)$.\\
Since $\vep>0$ and $g\in\scrlito(\ell)$, choose $\mu>0$ s.t., $\forall y\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|y|<\mu\,)\,\Rightarrow\,(\,|g_y|\le\vep\cdot|y|^\ell\,)$.\\
Let $\tau:=\min\{\mu/2,1\}$. \quad Then $\tau>0$ and $\tau\le\mu/2$ and $\tau\le1$.\\
Since $\tau>0$ and $f\in\scrlito(k)$, choose $\lambda>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(\,|x|<\lambda\,)\,\Rightarrow\,(\,|f_x|\le\tau\cdot|x|^k\,)$.\\
Let $\delta:=\min\{\lambda,1\}$. \quad Then $\delta>0$ and $\delta\le\lambda$ and $\delta\le1$.\\
{\bf Want:} $\forall x\in\R$, $\,$ $(\,|x|<\delta\,)\,\Rightarrow\,(\,|(g\circ f)_x|\le\vep\cdot|x|^{\ell\cdot k}\,)$.\\
Given $x\in\R$. \quad Assume $|x|<\delta$. \quad {\bf Want:} $|(g\circ f)_x|\le\vep\cdot|x|^{\ell\cdot k}$.\\
Since $|x|<\delta\le\lambda$, by choice of $\lambda$, we get: $|f_x|\le\tau\cdot|x|^k$.\\
Let $y:=f_x$. \quad Then $|y|=|f_x|\le\tau\cdot |x|^k$, \quad so $|y|\le\tau\cdot|x|^k$.\\
We have $|x|<\delta\le1$, so, since $k\in\N_0$, we get: $|x|^k\le1$.\\
Then $|y|\le\tau\cdot|x|^k\le\tau\cdot1=\tau\le\mu/2<\mu$, \quad so $|y|<\mu$.\\
Since $|y|<\mu$, by choice of $\mu$, we get: $|g_y|\le\vep\cdot|y|^\ell$.\\
Since $|y|\le\tau\cdot|x|^k$ and $\tau\le1$, we get: $|y|\le|x|^k$.\\
Then $|(g\circ f)_x|=|g_{f_x}|=|g_y|\le\vep\cdot|y|^\ell\le\vep\cdot(|x|^k)^\ell=\vep\cdot|x|^{\ell\cdot k}$.
\end{proof}

\begin{thm}
Let $k,\ell\in\N_0$. Then:\\
\phx\qquad\qquad $\forall f\in\scrbigo(k)$, $\forall g\in\scrbigo(\ell)$, \quad $f\cdot g\in\scrbigo(k+\ell)$ \qquad and\\
\phx\qquad\qquad $\forall f\in\scrbigo(k)$, $\forall g\in\scrlito(\ell)$, \quad $f\cdot g\in\scrlito(k+\ell)$ \qquad and\\
\phx\qquad\qquad $\forall f\in\scrlito(k)$, $\forall g\in\scrbigo(\ell)$, \quad $f\cdot g\in\scrlito(k+\ell)$ \qquad and\\
\phx\qquad\qquad $\forall f\in\scrlito(k)$, $\forall g\in\scrlito(\ell)$, \quad $f\cdot g\in\scrlito(k+\ell)$.
\end{thm}

\noindent
Some of the following theorem fails when $k=0$ or $\ell=0$, so note the requirement that $k,\ell\in\N$.

\begin{thm}
Let $k,\ell\in\N$. Then:\\
\phx\qquad\qquad $\forall f\in\scrbigo(k)$, $\forall g\in\scrbigo(\ell)$, \quad $f\circ g\in\scrbigo(\ell\cdot k)$ \qquad and\\
\phx\qquad\qquad $\forall f\in\scrbigo(k)$, $\forall g\in\scrlito(\ell)$, \quad $f\circ g\in\scrlito(\ell\cdot k)$ \qquad and\\
\phx\qquad\qquad $\forall f\in\scrlito(k)$, $\forall g\in\scrbigo(\ell)$, \quad $f\circ g\in\scrlito(\ell\cdot k)$ \qquad and\\
\phx\qquad\qquad $\forall f\in\scrlito(k)$, $\forall g\in\scrlito(\ell)$, \quad $f\circ g\in\scrlito(\ell\cdot k)$.
\end{thm}

\noindent
We define\\
\phx\quad \bfindex[agreement, near a point, of two partial functions on $\R$]:

\begin{defn}
Let $f$ and $g$ be two functions, $q\in\R$.\\
Assume $\D_f\subseteq\R$ and $\D_g\subseteq\R$.\\
By {\bf near $q$, $f=g$}, we mean: $\exists B\in\scrb(q)$ s.t.~on $B$, $f=g$.
\end{defn}

\subsection{Polynomials $\R\to\R$}

\begin{defn}
$\forall k\in\N_0$, $\boxed{\scrh(k)}:=\{c\cdot(\bullet)^k\,|\,c\in\R\}$. \index[terms]{$\scrh(k)$}\\
\phx\qquad $\boxed{\scrc}:=\scrh(0)$, $\,$ $\boxed{\scrl}:=\scrh(1)$, $\,$ $\boxed{\scrq}:=\scrh(2)$, $\,$ $\boxed{\scrk}:=\scrh(3)$.
\index[terms]{$\scrc$, $\scrl$, $\scrq$, $\scrk$}
\end{defn}

\noindent
Elements of $\scrc$ are called \bfindex[constant].\\
Elements of $\scrl$ are called (homogeneous) \bfindex[linear].\\
Elements of $\scrq$ are called (homogeneous) \bfindex[quadratic].\\
Elements of $\scrk$ are called (homogeneous) \bfindex[cubic].\\
\\
For any $k\in\N_0$, elements of $\scrh(k)$ are called\\
\phx\quad (homogenous) \bfindex[polynomials $\R\to\R$ of degree $k$], \qquad or\\
\phx\quad $k$-\bfindex[polynomials] $\R\to\R$.\\
We may sometimes omit ``$\R\to\R$''.\\

\begin{thm}
$\forall C\in\scrc$, $C$ is Lipschitz-$0$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall x,y\in\R$, $|C_x-C_y|\le0\cdot|x-y|$.\\
Given $x,y\in\R$. \quad {\bf Want:} $|C_x-C_y|\le0\cdot|x-y|$.\\
Choose $a\in\R$ s.t.~$C=C_a^\R$.\\
Then $C_x=a$ and $C_y=a$.\\
Then $|C_x-C_y|=|a-a|=|0|=0\cdot|x-y|$.
\end{proof}

\begin{defn}
$\forall L\in\scrl$, $\boxed{[L]}:=L_1$. \index[terms]{$[L]$}
\end{defn}

\noindent
Let $m\in\R$ and let $L:=m\cdot(\bullet)$.\\
Then $[L]=L_1=m\cdot1=m$, so $[L]$ is just the slope of $L$.\\
Also, $|[L]|$ is the absolute value of the slope of $L$,\\
\phx\quad which we might call the ``absolute slope'' of $L$.\\
\\
We next show: Each linear function is Lipschitz,\\
\phx\quad with Lipschitz constant equal to the absolute slope:

\begin{thm}
$\forall L\in\scrl$, $L$ is Lipschitz-$|[L]|$.
\end{thm}

\begin{proof}
Choose $m\in\R$ s.t.~$L=m\cdot(\bullet)$.\\
Then $[L]=L_1=m\cdot1=m$. \qquad Let $a:=|m|$.\\
Then $a=|[L]|$. \quad {\bf Want:} $L$ is Lipschitz-$a$.\\
{\bf Want:} $\forall x,y\in\D_L$, $|L_x-L_y|\le a\cdot|x-y|$.\\
Given $x,y\in\D_L$. \quad {\bf Want:} $|L_x-L_y|\le a\cdot|x-y|$.\\
We have $L_x-L_y=m\cdot x-m\cdot y=m\cdot(x-y)$.\\
Then $|L_x-L_y|=|m|\cdot|x-y|=a\cdot|x-y|$, so $|L_x-L_y|=a\cdot|x-y|$.\\
Then $|L_x-L_y|\le a\cdot|x-y|$.
\end{proof}

\begin{thm}
Let $F\in(\scrh(0))\cup(\scrh(1))\cup(\scrh(2))\cup(\scrh(3))\cup\dots$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad Then $F$ is continuous.
\end{thm}

\noindent
{\it Idea of proof:}\\
If $F\in\scrh(0)$, then $F$ is constant, hence Lipschitz-$0$,\\
\phx\qquad hence Lipschitz, hence uniformly continuous, hence continuous.\\
If $F\in\scrh(1)$, then $F$ is linear, hence Lipschitz-$[F]$,\\
\phx\qquad hence Lipschitz, hence uniformly continuous, hence continuous.\\
If $F\in\scrh(2)$, then $F$ is quadratic,\\
\phx\qquad hence a product of two linear functions,\\
\phx\qquad hence a product of two continuous functions, hence continuous.\\
If $F\in\scrh(3)$, then $F$ is cubic,\\
\phx\qquad hence a product of three linear functions,\\
\phx\qquad hence a product of three continuous functions, hence continuous.\\
{\it Etc.}\\
{\it End of idea of proof.}\\
\\
The next result says that every $k$-polynomial has order $k$.\\
In particular, $\scrc\subseteq\scrbigo(0)$ and
$\scrl\subseteq\scrbigo(1)$ and $\scrq\subseteq\scrbigo(2)$ and
$\scrk\subseteq\scrbigo(3)$.

\begin{thm}
Let $k\in\N_0$. Then $\scrh(k)\subseteq\scrbigo(k)$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall P\in\scrh(k)$, $P\in\scrbigo(k)$.\\
Given $P\in\scrh(k)$. \quad {\bf Want:} $P\in\scrbigo(k)$.\\
{\bf Want:} $\exists C\ge0$, $\exists\delta>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad\qquad $(\,|x|<\delta\,)\,\Rightarrow\,(\,|P_x|\le C\cdot|x|^k\,)$.\\
Since $P\in\scrh(k)$, choose $a\in\R$ s.t.~$P=a\cdot(\bullet)^k$.\\
Let $C:=|a|$, $\delta:=1$. \quad Then $C\ge0$ and $\delta>0$.\\
{\bf Want:} $\forall x\in\R$, \quad $(\,|x|<\delta\,)\,\Rightarrow\,(\,|P_x|\le C\cdot|x|^k\,)$.\\
Given $x\in\R$. \quad Assume: $|x|<\delta$. \quad {\bf Want:} $|P_x|\le C\cdot|x|^k$.\\
We have $|P_x|=|a\cdot x^k|=|a|\cdot|x|^k=C\cdot|x|^k$.\\
Then $|P_x|=C\cdot|x|^k$, so $|P_x|\le C\cdot|x|^k$.
\end{proof}

\begin{defn}
$\boxed{\bfzero}:=C_0^\R$.\index[terms]{$\bfzero$}
\end{defn}

\begin{thm}Let $k\in\N_0$. Then:
$\bfzero\in\scrlito(k)$ and $\bfzero\in\scrbigo(k)$.
\end{thm}

\begin{thm}
Let $k\in\N_0$. \quad Then $(\scrh(k))\cap(\scrlito(k))=\{\bfzero\}$.
\end{thm}

\begin{proof}
$\bfzero=0\cdot(\bullet)^k\in\scrh(k)$. \quad Also, $\bfzero\in\scrlito(k)$.\\
Then $\bfzero\in(\scrh(k))\cap(\scrlito(k))$, so $\{\bfzero\}\subseteq(\scrh(k))\cap(\scrlito(k))$.\\
{\bf Want:} $(\scrh(k))\cap(\scrlito(k))\subseteq\{\bfzero\}$.\\
{\bf Want:} $\forall f\in(\scrh(k))\cap(\scrlito(k))$, \quad $f\in\{\bfzero\}$.\\
Given $f\in(\scrh(k))\cap(\scrlito(k))$. \quad {\bf Want:}$f\in\{\bfzero\}$.\\
Since $f\in\scrh(k)$, choose $c\in\R$ s.t.~$f=c\cdot(\bullet)^k$.\\
Since $0\cdot(\bullet)^k=\bfzero\in\{\bfzero\}$, {\bf it suffices to show:} $c=0$.\\
Assume $c\ne0$. \quad {\bf Want:} Contradiction.\\
Since $c\in\R$ and $c\ne0$, we get: $|c|>0$.\\
Let $\vep:=|c|/2$. \quad Then $\vep>0$.\\
So, since $f\in\scrlito(k)$, choose $\delta>0$ s.t., $\forall x\in\R$,\\
\phx\qquad\qquad\qquad $(\,|x|<\delta\,)\,\Rightarrow\,(\,|f_x|\le\vep\cdot|x|^k\,)$.\\
Since $\delta>0$, we get: $\delta/2>0$, and $\delta/2<\delta$.\\
Since $\delta/2>0$, we get: $|\delta/2|=\delta/2$.\\
Let $x:=\delta/2$. \quad Then $|x|=|\delta/2|=\delta/2>0$, so $|x|>0$.\\
Also, $|x|=|\delta/2|=\delta/2<\delta$, so $|x|<\delta$.\\
So, by choice of $\delta$, we get: $|f_x|\le\vep\cdot|x|^k$.\\
Since $f=c\cdot(\bullet)^k$, we get: $f_x=c\cdot x^k$.\\
Then $|c|\cdot|x|^k=|c\cdot x^k|=|f_x|\le\vep\cdot|x|^k$, so $|c|\cdot|x|^k\le\vep\cdot|x|^k$.\\
Since $|x|>0$ and $k\in\N_0$, we get: $|x|^k>0$.\\
So, since $|c|\cdot|x|^k\le\vep\cdot|x|^k$, we get $|c|\le\vep$.\\
Then $2\cdot\vep=2\cdot(|c|/2)=|c|\le\vep$, so $2\cdot\vep\le\vep$, so $2\cdot\vep-\vep\le\vep-\vep$,\\
\phx\qquad so $\vep\le0$, so $0\ge\vep$.\\
Then $0\ge\vep>0$, so $0>0$. \quad Contradiction.
\end{proof}

\subsection{Linearizations and derivatives}

\begin{thm}
Let $f:\R\drta\R$, $q\in\R$.\\
\phx\quad Assume $f$ is defined near $q$. \quad
Then, near $q$, we have: $f-f=\bfzero$.\\
\end{thm}

\begin{thm}
Let $f:\R\drta\R$, $q\in\D_f$. Then:\\
\phx\qquad\qquad $($ $f$ is defined near $q$ $)$ $\Rightarrow$ $($ $f_q^\T$ is defined near $0$ $)$.
\end{thm}

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad Then $\boxed{\LINS_af}\,\,:=\,\,\{\,L\in\scrl\,|\,f_a^\T-L\in\scrlito(1)\,\}$.
\index[terms]{$\LINS_af$}
\end{defn}

\noindent
Let $f:\R\drta\R$, $a\in\D_f$.\\
Elements of $\LINS_af$ are called \bfindex[linearizations] of $f$ at $a$.\\
\\
We next show that $(\bullet)^2$ has a linearization at $3$:

\begin{thm}\wrlab{thm-D-deriv-squaring-at-3}
Define $f:\R\to\R$ by: $\forall x\in\R$, $f_x=x^2$.\\
\phx\quad Define $L\in\scrl$ by: $\forall h\in\R$, $L_h=6h$. \quad
Then $L\in\LINS_3f$.
\end{thm}

\begin{proof}
{\bf Want:} $f_3^\T-L\in\scrlito(1)$.\\
Since $(\bullet)^2\in\scrq=\scrh(2)\subseteq\scrbigo(2)\subseteq\scrlito(1)$,\\
\phx\quad {\bf it suffices to show:} $f_3^\T-L=(\bullet)^2$.\\
{\bf Want:} $\forall h\in\R$, $(f_3^\T-L)_h=((\bullet)^2)_h$.\\
Given $h\in\R$. \quad {\bf Want:} $(f_3^\T-L)_h=((\bullet)^2)_h$.\\
We have: \quad $(f_3^\T-L)_h\,\,=\,\,(f_3^\T)_h-L_h$\\
\phx\qquad\qquad\qquad\qquad\qquad $=\!\!\!\!\!{}^*\,\,\,\,\,\,f_{3+h}-f_3-L_h$\\
\phx\qquad\qquad\qquad\qquad\qquad $=\!\!\!\!\!{}^*\,\,\,\,\,\,(3+h)^2-3^2-6h$\\
\phx\qquad\qquad\qquad\qquad\qquad $=\,\,\,9+6h+h^2-9-6h$\\
\phx\qquad\qquad\qquad\qquad\qquad $=\,\,\,h^2\quad=\quad((\bullet)^2)_h$.
\end{proof}

\noindent
We next show that $|\bullet|$ has no linearization at $0$:

\begin{thm}
Let $f:=|\bullet|$. \quad
Then $\LINS_0f=\emptyset$.
\end{thm}

\noindent
{\it Idea of proof:}
{\bf Want:} $\forall L\in\scrl$, $L\notin\LINS_0f$.\\
Given $L\in L$. {\bf Want:} $L\notin\LINS_0f$.\\
Choose $a\in\R$ s.t.~$L=a\cdot(\bullet)$.\\
In general, we would handle $a\ge0$ and  $a\le0$ separately.\\
We looked only at $a=1$. \qquad
{\bf Want:} $f_0^\T-(\bullet)\notin\scrlito(1)$.\\
Since $f_0=|0|=0$, we know: $f_0^\T=f$.\\
{\bf Want:} $f-(\bullet)\notin\scrlito(1)$.\\
We graphed $f-(\bullet)$, and saw that, near $0$,\\
\phx\quad that graph is not in the envelope semi-between $-|\bullet|$ and $|\bullet|$.\\
So, since the graph is not in every linear envelope, we get: $f-(\bullet)\notin\scrlito(1)$.\\
We leave it to the reader to formalize this argument.\\
We leave it to the reader to generalize the proof to all $a\ge0$.\\
We leave it to the reader, then to consider the case $a\le0$.\\
{\it End of idea of proof.}

\begin{thm}\wrlab{thm-exists-LR}
Let $f:\R\drta\R$, $a\in\R$. Assume $\LINS_af\ne\emptyset$.\\
\phx\qquad\qquad Then: \quad $\exists L\in\scrl$, $\exists R\in\scrlito(1)$ s.t.~$f_a^\T=L+R$.
\end{thm}

\begin{proof}
Since $\LINS_af\ne\emptyset$, choose $L$ s.t. $L\in\LINS_af$.\\
Then $L\in\LINS_af\subseteq\scrl$ and $f_a^\T-L\in\scrlito(1)$.\\
Let $R:=f_a^\T-L$. \quad Then $R\in\scrlito(1)$. \quad {\bf Want:} $f_a^\T=L+R$.\\
Since $L\in\scrl$, we get $-L+L=\bfzero$.\\
Then  $f_a^\T=f_a^\T-L+L=R+L=L+R$.
\end{proof}

\begin{thm}\wrlab{thm-basics-of-dbl-translate-at-pt-of-diff}
Let $f:\R\drta\R$, $a\in\R$. Assume $\LINS_af\ne\emptyset$.\\
Then: \quad $f_a^\T\in\scrbigo(1)$ \quad and \quad $f$ is defined near $a$\\
\phx\qquad\qquad\qquad\qquad\quad and \quad $f$ is continuous at $a$.
\end{thm}

\begin{proof}
By \tref{thm-exists-LR}, choose $L\in\scrl$, $R\in\scrlito(1)$ s.t.~$f_a^\T=L+R$.\\
Since $L\in\scrl=\scrh(1)\subseteq\scrbigo(1)$ and $R\in\scrlito(1)\subseteq\scrbigo(1)$,\\
\phx\qquad we conclude that $R+L\in\scrbigo(1)$. \quad Then $f_a^\T=R+L\in\scrbigo(1)$.\\
{\bf Want:} \quad $f$ is defined near $a$ \quad and \quad $f$ is continuous at $a$.\\
Since $f_a^\T\in\scrbigo(1)\subseteq\scrlito(0)$, we see that\\
\phx\qquad\qquad $f_a^\T$ is defined near $0$ \quad and \quad $f_a^\T$ is continuous at $0$.\\
Then: \qquad $f$ is defined near $a$ \quad and \quad $f$ is continuous at $a$.
\end{proof}

\noindent
We next show that\\
\phx\quad no function $\R\drta\R$ can have two linearizations at one point:

\begin{thm}\wrlab{thm-uniqueness-of-linearization}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad Let $L,M\in\LINS_af$. \qquad Then $L=M$.
\end{thm}

\begin{proof}
By assumption, $\LINS_af\ne\emptyset$.\\
Let $R:=f_a^\T-L$, $S:=f_a^\T-M$.\\
Since $R,S\in\scrlito(1)$, we get: $R-S\in\scrlito(1)$.\\
Since $f$
We have $R-S=(f_a^\T-f_a^\T)+(M-L)$\\
By \tref{thm-basics-of-dbl-translate-at-pt-of-diff}, $f_a^\T$ is defined near $0$.\\
Then: \qquad near $0$, \quad $f_a^\T-f_a^\T=\bfzero$.\\
Then: \qquad near $0$, \quad $R-S=M-L$.\\
So, since $R-S\in\scrlito(1)$, we get: $M-L\in\scrlito(1)$.\\
Since $L,M\in\scrl=\scrh(1)$, we get: $M-L\in\scrh(1)$.\\
Then $M-L\in(\scrh(1))\cap(\scrlito(1))$.\\
So, since $(\scrh(1))\cap(\scrlito(1))=\{\bfzero\}$, we get: $M-L\in\{\bfzero\}$.\\
Then $M-L=\bfzero$, and so $L=M$.
\end{proof}

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad Then $\boxed{D_af}:=\UE(\LINS_af)$.
\index[terms]{$D_af$}
\end{defn}

\noindent
In the preceding, $D_af$ is the \bfindex[D-derivative] at $a$ of $f$.

\begin{thm}\wrlab{thm-D-deriv-linearization-connection}
Let $f:\R\drta\R$, $a\in\R$, $L\in\scrl$. Then:\\
\phx\qquad\qquad $(\,D_af=L\,)\,\Leftrightarrow\,(\,L\in\LINS_af\,)\,\Leftrightarrow\,(\,f_a^\T-L\in\scrlito(1)\,)$.
\end{thm}

\noindent
{\it Idea of proof:}\\
By definition of $\LINS_af$, we have:\\
\phx\qquad\qquad $L\in\LINS_af$ \quad iff \quad $f_a^\T-L\in\scrlito(1)$.\\
We therefore need only show:
\phx\qquad\qquad $\,$ $L\in\LINS_af$ \quad iff \quad $L=D_af$.\\
By \tref{thm-uniqueness-of-linearization}, we have:\\
\phx\qquad\qquad $L\in\LINS_af$ \quad iff \quad $\{L\}=\LINS_af$.\\
Then: \quad $\,$ $L\in\LINS_af$ \quad iff \quad $L=\UE(\LINS_af)$.\\
Then: \quad $\,$ $L\in\LINS_af$ \quad iff \quad $L=D_af$.\\
{\it End of idea of proof.}\\
\\
By \tref{thm-D-deriv-squaring-at-3}, we get $D_3((\bullet)^2)=6\cdot(\bullet)$,\\
\phx\quad or, in other words:

\begin{thm}\wrlab{thm-D-deriv-squaring-at-3-redux}
Let $f=(\bullet)^2$, $L:=6\cdot(\bullet)$. Then $D_3f=L$.
\end{thm}

\begin{proof}
By \tref{thm-D-deriv-squaring-at-3}, we have: $L\in\LINS_3f$.\\
Then by \tref{thm-D-deriv-linearization-connection}, we get: $D_3f=L$.
\end{proof}

\begin{thm}
Let $f=|\bullet|$. Then $D_0f=\frownie$.
\end{thm}

\begin{defn}
Let $f:\R\drta\R$.\\
\phx\qquad Then $\boxed{f'}:\D_f\drta\R$ is defined by:\index[terms]{$f'$}
$\forall a\in\D_f$, $f'_a\,\,=\,\,[D_af]$.\\
\phx\qquad\qquad\qquad\qquad Also, $\D'_f:=\D_{f'}$.
\end{defn}

\noindent
In the preceding, $f'$ is called the \bfindex[prime derivative] of $f$.\\
Sometimes we simply call $f'$ the \bfindex[derivative] of $f$.\\
\\
Let $f:=(\bullet)^2$, $L:=6\cdot(\bullet)$. By \tref{thm-D-deriv-squaring-at-3-redux}, $D_3f=L$.\\
Then $f'_3=[D_3f]=[6\cdot(\bullet)]=(6\cdot(\bullet))_1=6\cdot1=6$.\\
Unassigned HW: Show: $\forall x\in\R$, $f'_x=2x$.\\
\\
Let $g:=|\bullet|$. Then, since $D_0g=\frownie$, we get: $g'_0=\frownie$.\\
Unassigned HW: Show: $\forall x<0$, $g'_x=-1$.\\
Unassigned HW: Show: $\forall x>0$, $g'_x=1$.

\begin{thm}
Let $g:=|\bullet|$. Then $\D'_g=\R_0^\times\subsetneq\R=\D_g$.
\end{thm}

\noindent
Let $f:=(\bullet)^2|[7;9]$. Then $f$ is not defined near $7$, so $7\notin\D'_f$.\\
In fact, we have:

\begin{thm}
Let $f:=(\bullet)^2|[7;9]$. Then $\D'_f=(7;9)$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$, $a\in\R$.\\
Then: $(\,a\in\D'_f\,)\,\Leftrightarrow\,(\,f'_a\ne\frownie\,)\,\Leftrightarrow\,(\,D_af\ne\frownie\,)\,\Leftrightarrow\,(\,\LINS_af\ne\emptyset\,)$.
\end{thm}

\noindent
For any $f:\R\drta\R$, for any $a\in\R$,\\
\phx\quad by $f$ is \bfindex[differentiable at $a$], we mean: $a\in\D'_f$.\\
\\
For any $f:\R\drta\R$, for any $S\subseteq\R$,\\
\phx\quad by $f$ is \bfindex[differentiable on $S$], we mean: $S\subseteq\D'_f$.\\
\\
For any $f:\R\drta\R$,\\
\phx\quad by $f$ is \bfindex[differentiable], we mean: $f$ is differentiable on $\D_f$.\\
This is equivalent to: $\D_f=\D'_f$.\\
\\
By the preceding theorem and \tref{thm-basics-of-dbl-translate-at-pt-of-diff}, we have:

\begin{thm}\wrlab{thm-basics-of-dbl-translate-at-pt-of-diff-2}
Let $f:\R\drta\R$, $a\in\D'_f$.\\
Then: \quad $f_a^\T\in\scrbigo(1)$ \quad and \quad $f$ is defined near $a$\\
\phx\qquad\qquad\qquad\qquad\quad and \quad $f$ is continuous at $a$.
\end{thm}

\begin{defn}
$\forall f:\R\drta\R$, we define:\\
\phx\quad $\boxed{f''}=(f')'$ and $f\boxed{'''}=((f')')'$ and $\boxed{f''''}=(((f')')')'$ and\\
\index[terms]{$f''$, $f'''$, $f''''$}
\phx\qquad\quad $\boxed{\D''_f}:=\D_{f''}$ and $\boxed{\D'''_f}:=\D_{f'''}$ and $\boxed{\D''''_f}:=\D_{f''''}$.
\index[terms]{$\D''_f$, $\D'''_f$ $\D''''_f$}
\end{defn}

\noindent
For any $f:\R\drta\R$, \quad $\D_f\supseteq\D'_f\supseteq\D''_f\supseteq\D'''_f\supseteq\D''''_f$.\\
\\
Let $S:=\{f\,|\,f:\R\drta\R\}$ be the set of partial functions $\R\drta\R$.\\
Define $\Phi:S\to S$ by: $\forall f\in S$, $\Phi(f)=f'$.\\
For any $f\in S$, for all $k\in\N_0$, we define $\boxed{f^{(k)}}:=\Phi_\circ^k(f)$.\\
For any $f\in S$, we have $f^{(0)}=f$ and $f^{(1)}=f'$ and $f^{(2)}=f''$\\
\phx\qquad and $f^{(3)}=f'''$ and $f^{(4)}=f''''$.\\
For any $f\in S$, we have: $\forall k\in\N_0$, $f^{(k+1)}=(f^{(k)})'$.\\
For any $f\in S$, for all $k\in\N_0$, we define $\D^{(k)}_f:=\D_{f^{(k)}}$.\\
For any $f\in S$, for all $k\in\N_0$, we have $\D^{(k)}_f\supseteq\D^{(k+1)}_f$.\\
Then: \quad $\forall f\in S$, $\,$ $\D^{(0)}_f\supseteq\D^{(1)}_f\supseteq\D^{(2)}_f\supseteq\D^{(3)}_f\supseteq\cdots$.

\subsection{Derivatives of Polynomials}

\begin{thm}
Let $C\in\scrc$, $a\in\R$. Then $C_a^\T=\bfzero$.
\end{thm}

\noindent
{\it Idea of proof:}
Choose $b\in\R$ s.t.~$C=C_b^\R$.
For any $h\in\R$, we have\\
\phx\quad $(C_a^\T)_h\,\,=\,\,C_{a+h}-C_a\,\,=\,\,(C_b^\R)_{a+h}-(C_b^\R)_a\,\,=\,\,b-b\,\,=\,\,0\,\,=\,\,\bfzero_h$.\\
{\it End of idea of proof.}

\begin{thm}
Let $C\in\scrc$, $a\in\R$. Then $D_aC=\bfzero$.
\end{thm}

\begin{proof}
Since $\bfzero\in\scrl$, {\bf it suffices to show:} $C_a^\T-\bfzero\in\scrlito(1)$.\\
We have $C_a^\T-\bfzero=\bfzero-\bfzero=\bfzero\in\scrlito(1)$.
\end{proof}

\begin{thm}
Let $C\in\scrc$. Then $C'=\bfzero$.
\end{thm}

\noindent
{\it Idea of proof:}
For any $x\in\R$, we have\\
\phx\quad $C'_x
\,\,=\,\,[D_xC]\,\,=\,\,[\bfzero]\,\,=\,\,\bfzero_1\,\,=\,\,0$.\\
{\it End of idea of proof.}

\begin{thm}
Let $L\in\scrl$, $a\in\R$. Then $L_a^\T=L$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall h\in\R$, $(L_a^\T)_h=L_h$.\\
Given $h\in\R$. \qquad {\bf Want:} $(L_a^\T)_h=L_h$.\\
Since $L$ is algebraically linear, we have: $L_{a+h}=L_a+\L_h$.\\
Then $(L_a^\T)_h=L_{a+h}-L_a=L_a+L_h-L_a=L_h$.
\end{proof}

\noindent
Since $(\bullet)=1\cdot(\bullet)^1\in\scrh_1=\scrl$,\\
\phx\quad the preceding theorem gives: $\forall a\in\R$, $(\bullet)_a^\T=(\bullet)$.

\begin{thm}
Let $L\in\scrl$, $a\in\R$. Then $D_aL=L$.
\end{thm}

\begin{proof}
We have $L^\T_a-L=L-L=\bfzero\in\scrlito(1)$, so $L\in\LINS_aL$.\\
Then, by uniqueness of linearization, we get: $\LINS_aL=\{L\}$.\\
Then $D_aL=\UE(\LINS_aL)=\UE\{L\}=L$.
\end{proof}

\begin{thm}
Let $m\in\R$, $L:=m\cdot(\bullet)$. Then $L'=C_m^\R$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall a\in\R$, $L'_a=(C_m^\R)_a$.\\
Given $a\in\R$. \qquad {\bf Want:} $L'_a=(C_m^\R)_a$.\\
We have $L'_a\,\,=\,\,[D_aL]\,\,=\,\,[L]\,\,=\,\,L_1=m\cdot1=m=(C_m^\R)_a$.
\end{proof}

\begin{thm}
$\forall j\in\N$, $((\bullet)^j)_a^\T\,-\,j\cdot a^{j-1}\cdot(\bullet)\in\scrlito(1)$.
\end{thm}

\begin{proof}
This is HW\#12-1.
\end{proof}

\begin{thm}
Let $j\in\N$. Then $((\bullet)^j)'=j\cdot(\bullet)^{j-1}$.
\end{thm}

\begin{proof}
This is HW\#12-2.
\end{proof}

\subsection{Sub-$k$ versus order $k$ vanishing}
\quad
\vskip.1in\noindent
Let $f:\R\drta\R$. Recall that \qquad $f_0=0$ \qquad iff\\
\phx\quad $f$ is defined near $0$ \quad and \quad $f$ is continuous at $0$ \quad and \quad $f_0=0$.\\
Then: \quad $\,\,f_0=0$ \quad $\Leftarrow$ \quad $f\in\scrlito(0)$,\\
\phx\quad but \quad $f_0=0$ \quad $\not\Rightarrow$ \quad $f\in\scrlito(0)$.\\
So: subconstant implies vanishes at zero, but not conversely.\\
We will show below that\\
\phx\qquad $f_0=f'_0=0$ \quad $\Leftrightarrow$ \quad $f\in\scrlito(1)$.\\
That is, sublinear iff vanishes to order $1$ at zero.\\
We will also show below (after the MVT) that\\
\phx\qquad\qquad $f_0=f'_0=f''_0=0$ \quad $\Rightarrow$ \quad $f\in\scrlito(2)$,\\
\phx\quad but \quad $\,f_0=f'_0=f''_0=0$ \quad $\not\Leftarrow$ \quad $f\in\scrlito(2)$,\\
So: vanishes to order $2$ at zero implies subquadratic, but not conversely.\\
Unassigned HW: show, for all $k\in[2..\infty)$, that\\
\phx\quad vanishes to order $k$ at zero implies sub-$k$, but not conversely.

\begin{thm}\wrlab{thm-sublin-iff-van-to-ord-1-at-0}
Let $f:\R\drta\R$. Then:\\
\phx\qquad $f\in\scrlito(1)$ \qquad $\Leftrightarrow$ \qquad $f_0=f'_0=0$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}\\
Assume: $f\in\scrlito(1)$ \qquad {\bf Want:} $f_0=f'_0=0$.\\
Since $f\in\scrlito(1)\subseteq\scrlito(0)$, it follows that:\\
\phx\quad $f$ is defined near $0$ \quad and \quad $f$ is continuous at $0$ \quad and \quad $f_0=0$.\\
Since $f_0=0$, {\bf it remains to show:} $f'_0=0$.\\
Since $f_0=0$, we get: $f_0^\T=f$.\\
Then $f_0^\T-\bfzero=f_0^\T=f\in\scrlito(1)$, and so $\bfzero\in\LINS_0f$.\\
Then, by uniqueness of linearization, $\LINS_0f=\{\bfzero\}$.\\
Then $D_0f=\UE(\LINS_0f)=\UE\{\bfzero\}=\bfzero$.\\
Then $f'_0=[\D_0f]=[\bfzero]=\bfzero_1=0$.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume: $f_0=f'_0=0$ \qquad {\bf Want:} $f\in\scrlito(1)$.\\
Since $f'_0\ne\frownie$, we get $D_0f\ne\frownie$, so $D_0f\in\LINS_0f$. \quad Let $L:=D_0f$.\\
Then $L\in\LINS_0f$, \quad so $f_0^\T-L\in\scrlito(1)$. \quad {\bf Want:} $f_0^\T-L=f$.\\
Since $f_0=0$, we get: $f_0^\T=f$. \quad {\bf Want:} $f-L=f$. \quad {\bf Want:} $L=\bfzero$.\\
{\bf Want:} $\forall h\in\R$, $L_h=\bfzero_h$. \qquad
Given $h\in\R$. \quad {\bf Want:} $L_h=\bfzero_h$.\\
Since $L\in\LINS_0f\subseteq\scrl$, we see that $L$ is algebraically linear.\\
Then $L_{h\cdot1}=h\cdot L_1$. \quad
We have $L_1=[L]=[D_0f]=f'_0=0$.\\
Then $L_h=L_{h\cdot1}=h\cdot L_1=h\cdot0=0=\bfzero_h$.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{defn}
Let $f:\R\to\R$, $a\in\R$.\\
By $f$ is \bfindex[continuous near $a$], we mean: $\exists B\in\scrb(a)$ s.t.~$f$ is continuous on $B$.\\
By $f$ is \bfindex[differentiable near $a$], we mean: $\exists B\in\scrb(a)$ s.t.~$B\subseteq\D'_f$.
\end{defn}

\noindent
Recall: $\forall g:\R\drta\R$, \qquad $0\in\D'_g$ \quad implies:\\
\phx $g_0^\T\in\scrbigo(1)$ $\,$ and $\,$ $g$ is defined near $0$ $\,$ and $\,$ $g$ is differentiable at $0$.\\
\\
Let $A:=\{1,1/2,1/3,\ldots\}$ and let $f:=\chi_A^\R\cdot|\bullet|^3$.\\
Then $f\in\scrbigo(3)\subseteq\scrlito(2)$. \quad
Also, $f$ is not continuous near $0$.\\
Since $f\in\scrlito(2)\subseteq\scrlito(1)$, by \tref{thm-sublin-iff-van-to-ord-1-at-0},
we get: $f_0=f'_0=0$.\\
Let $a:=0$. Then this function $f$ shows:\\
\phx\quad differentiable at $a$ does not imply continuous near $a$.\\
Since $f$ is not continuous near $0$,\\
it follows that $f$ is not differentiable near $0$.\\
Then $f'$ is not defined near $0$.\\
Let $g:=f'$. \quad Then $g$ is not defined near $0$. \quad Then $0\notin\D'_g$.\\
Then $0\notin\D'_g=\D'_{f'}=\D''_f$.\\
So this function $f$ shows:\\
\phx\quad subquadratic does not imply vanishes to order $2$ at zero.\\
Note that the counterexample $f$ fails to vanish to order $2$ at zero\\
\phx\quad because $f$ is not twice differentiable at zero.\\
This begs the question:\\
\\
Let $h:\R\drta\R$ be twice differentiable at zero.\\
\phx\quad Then do we have: \qquad $h_0=h'_0=h''_0=0$ \quad $\Leftrightarrow$ \quad $h\in\scrlito(2)$ \quad ?\\
The answer is yes, and, in fact, we'll eventually prove:

\begin{thm}
Let $h:\R\drta\R$, $k\in\N_0$.
Assume $0\in\D_h^{(k)}$.\\
\phx\quad Then: \qquad $h\in\scrlito(k)$ \qquad $\Leftrightarrow$ \qquad $h_0=h'_0=\cdots=h_0^{(k)}=0$.
\end{thm}

\subsection{Algebraic linearity of the D-derivative}

\begin{thm}
Let $f:=|\bullet|$, $g:=-|\bullet|$.\\
Then $D_0(f+g)=\bfzero$. \quad Also, $(D_0f)+(D_0g)=\frownie$.
\end{thm}

\begin{proof}
We have $f+g=\bfzero\in\scrc$, so $D_0(f+g)=\bfzero$.\\
{\bf Want:} $(D_0f)+(D_0g)=\frownie$.\\
Since $D_0f=\frownie$, it follows that $(D_0f)+(D_0g)=\frownie$.
\end{proof}

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
Then $D_a(f+g)\,\,\,\,=^*\,\,(D_af)+(D_ag)$.
\end{thm}

\begin{proof}
{\bf Want:} $($ $(D_af)+(D_ag)\ne\frownie$ $)$ $\Rightarrow$ $($ $D_a(f+g)=(D_af)+(D_ag)$ $)$.\\
Assume $(D_af)+(D_ag)\ne\frownie$. \quad {\bf Want:} $D_a(f+g)=(D_af)+(D_ag)$.\\
Let $L:=D_af$, $M:=D_ag$.
Then $L+M\ne\frownie$, so $L\ne\frownie\ne M$.\\
Then $L,M\in\scrl$ and $f_a^\T-L,g_a^\T-M\in\scrlito(1)$.\\
{\bf Want:} $D_a(f+g)=L+M$.\\
Since $\scrl$ is linearly closed and $L,M\in\scrl$, we get: $L+M\in\scrl$.\\
By uniqueness of linearization, want: $(f+g)_a^\T-(L+M)\in\scrlito(1)$.\\
Since $f_a^\T-L,g_a^\T-M\in\scrlito(1)$ and since $\scrlito(1)$ is linearly closed,\\
\phx\qquad we conclude: $(f_a^\T-L)+(g_a^\T-M)\in\scrlito(1)$.\\
Then $(f+g)_a^\T-(L+M)=f_a^\T+g_a^\T-L-M$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $=(f_a^\T-L)+(g_a^\T-M)\in\scrlito(1)$.
\end{proof}

\begin{thm}
Let $f:=|\bullet|$.\\
Then $D_0(0\cdot f)=\bfzero$. \quad Also, $0\cdot(D_0f)=\frownie$.
\end{thm}

\begin{proof}
We have $0\cdot f=\bfzero\in\scrc$, so $D_0(0\cdot f)=\bfzero$.\\
{\bf Want:} $0\cdot(D_0f)=\frownie$.\\
Since $D_0f=\frownie$, it follows that $0\cdot(D_0f)=\frownie$.
\end{proof}

\begin{thm}\wrlab{thm-D-commutes-with-scalarl-mult}
Let $f:\R\drta\R$, $a,c\in\R$.\\
Then $D_a(c\cdot f)\,\,\,\,=^*\,\,c\cdot(D_af)$.
\end{thm}

\begin{proof}
This is HW\#10-5.
\end{proof}

\begin{thm}\wrlab{thm-D-commutes-with-scalarl-mult-2}
Let $f:\R\drta\R$, $a\in\R$, $c\in\R_0^\times$.\\
Then $D_a(c\cdot f)\,\,=\,\,c\cdot(D_af)$.
\end{thm}

\begin{proof}
By \tref{thm-D-commutes-with-scalarl-mult}, we have: $D_a(c\cdot f)\,\,\,\,=^*\,\,c\cdot(D_af)$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad {\bf Want:} $D_a(c\cdot f)\,\,\,\,{}^*\!\!=\,\,\,\,c\cdot(D_af)$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad {\bf Want:} $c\cdot(D_af)\,\,\,\,=^*\,\,D_a(c\cdot f)$.\\
Let $\phi:=c\cdot f$ and let $\gamma:=1/c$.\\
By \tref{thm-D-commutes-with-scalarl-mult}, $D_a(\gamma\cdot\phi)\,\,\,\,=^*\,\,\gamma\cdot(D_a\phi)$.\\
\phx\qquad\quad $\,$ Then $c\cdot(D_a(\gamma\cdot\phi))\,\,\,\,=^*\,\,c\cdot\gamma\cdot(D_a\phi)$.\\
So, since $\gamma\cdot\phi=(1/c)\cdot c\cdot f=f$ and since $c\cdot\gamma=c\cdot(1/c)=1$, we get:\\
\phx\qquad\qquad\qquad\qquad $\,c\cdot(D_af)\,\,\,\,=^*\,\,1\cdot(D_a\phi)$.\\
Then $c\cdot(D_af)\,\,\,\,=^*\,\,1\cdot(D_a\phi)\,\,=\,\,D_a\phi\,\,=\,\,D_a(c\cdot f)$.
\end{proof}

\subsection{The $D$-product and chain rules}
\quad
\vskip.1in\noindent
The following is the $D$-\bfindex[product rule]:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad Then $D_a(f\cdot g)\,\,\,\,=^*\,\,(D_af)\cdot g_a\,+\,f_a\cdot(D_ag)$.
\end{thm}

\begin{proof}
{\bf Want:} $($ $(D_af)\cdot g_a\,+\,f_a\cdot(D_ag)\ne\frownie$ $)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\Rightarrow$ $($ $D_a(f\cdot g)\,=\,(D_af)\cdot g_a\,+\,f_a\cdot(D_ag)$ $)$.\\
Assume $(D_af)\cdot g_a\,+\,f_a\cdot(D_ag)\,\ne\,\frownie$.\\
{\bf Want:} $D_a(f\cdot g)\,=\,(D_af)\cdot g_a\,+\,f_a\cdot(D_ag)$.\\
Let $L:=D_af$, $M:=D_ag$, $y:=f_a$, $z:=g_a$.\\
Then $L\cdot z+y\cdot M\ne\frownie$, \quad so $L\ne\frownie$ $\&$ $z\ne\frownie$ $\&$ $y\ne\frownie$ $\&$ $M\ne\frownie$.\\
Then $y,z\in\R$ and $L,M\in\scrl$ and $f_a^\T-L,g_a^\T-M\in\scrlito(1)$.\\
{\bf Want:} $D_a(f\cdot g)\,=\,L\cdot z\,+\,y\cdot M$.\\
Since $\scrl$ is linearly closed and $L,M\in\scrl$, we get: $L\cdot z\,+\,y\cdot M\in\scrl$.\\
By uniqueness of linearization, want: $(f\cdot g)_a^\T-(L\cdot z+y\cdot M)\in\scrlito(1)$.\\
By the Precalculus Product Rule, $(f\cdot g)_a^\T=f_a^\T\cdot g_a+f_a\cdot g_a^\T+f_a^\T\cdot g_a^\T$.\\
Then $(f\cdot g)_a^\T-(L\cdot z+y\cdot M)=(f_a^\T-L)\cdot g_a+f_a\cdot(g_a^\T-M)+f_a^\T\cdot g_a^\T$.\\
{\bf Want:} $\,\,$ $(f_a^\T-L)\cdot g_a\,\,+\,\,f_a\cdot(g_a^\T-M)\,\,+\,\,f_a^\T\cdot g_a^\T\,\,\in\,\,\scrlito(1)$.\\
{\bf Want:} $\,\,$ $(f_a^\T-L)\cdot g_a,\,\,\,\,\,\,\,\,f_a\cdot(g_a^\T-M),\,\,\,\,\,\,\,\,\,f_a^\T\cdot g_a^\T\,\,\in\,\,\scrlito(1)$.\\
Since $f_a^\T-L\in\scrlito(1)$ and since $\scrlito(1)$ is linearly closed,\\
\phx\qquad\qquad we get: $(f_a^\T-L)\cdot g_a\,\in\,\scrlito(1)$.\\
Since $g_a^\T-M\in\scrlito(1)$ and since $\scrlito(1)$ is linearly closed,\\
\phx\qquad\qquad we get: $f_a\cdot(g_a^\T-M)\,\in\,\scrlito(1)$.\\
{\bf Want:} $f_a^\T\cdot g_a^\T\,\in\,\scrlito(1)$. \qquad Since $f_a^\T,g_a^\T\in\scrbigo(1)$, we get: $f_a^\T\cdot g_a^\T\,\in\,\scrbigo(2)$.\\
Then $f_a^\T\cdot g_a^\T\,\in\,\scrbigo(2)\,\subseteq\,\scrlito(1)$.
\end{proof}

\begin{thm}\wrlab{thm-lin-on-left}
Let $f$ and $g$ be functionals. Let $h$ be a function.\\
\phx\qquad\qquad\qquad Then $(f+g)\circ h=(f\circ h)+(g\circ h)$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall x$, $\,\,((f+g)\circ h)_x\,\,=\,\,((f\circ h)+(g\circ h))_x$.\\
Given $x$. \quad {\bf Want:} $((f+g)\circ h)_x\,\,=\,\,((f\circ h)+(g\circ h))_x$.\\
We have $((f+g)\circ h)_x\,\,=\,\,(f+g)_{h_x}\,\,=\,\,f_{h_x}+g_{h_x}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=\!\!\!\!\!{}^*\,\,\,\,\,\,(f\circ h)_x+(g\circ h)_x$\\ 
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=\!\!\!\!\!{}^*\,\,\,\,\,\,((f\circ h)+(g\circ h))_x$.
\end{proof}

\begin{thm}
Let $L\in\scrl$. Then:\\
\phx\qquad\qquad $[\,\,\,\forall c,x\in\R,\,\,\,L_{c\cdot x}=c\cdot L_x\,\,\,]$\\
\phx\qquad $\,\,\&\quad[\,\,\,\forall w,x\in\R,\,\,\,L_{w+x}=L_w+L_x\,\,\,]$.
\end{thm}

\noindent
The proof of the preceding theorem is left as an unassigned HW.\\
The preceding theorem can be used to prove the next two:

\begin{thm}\wrlab{thm-lin-on-rt-provided-1}
Let $L\in\scrl$ and let $c\in\R$ and let $f$ be a function.\\
\phx\qquad\qquad\qquad Then $L\circ(c\cdot f)=c\cdot(L\circ f)$.
\end{thm}

\begin{thm}\wrlab{thm-lin-on-rt-provided-2}
Let $L\in\scrl$ and let $f,g$ be functions.\\
\phx\qquad\qquad\qquad Then $L\circ(f+g)=(L\circ f)+(L\circ g)$.
\end{thm}

\noindent
\tref{thm-lin-on-left} is sometimes expressed by saying\\
\phx\qquad\quad $\circ$ is linear on the left.\\
\tref{thm-lin-on-rt-provided-1} and \tref{thm-lin-on-rt-provided-2} are sometimes expressed by saying\\
\phx\qquad\quad $\circ$ is linear on the right, PROVIDED the left function is linear.\\
However, if the left function is, say, a quadratic $Q$,\\
\phx\qquad then we get different formulas for $Q\circ(f+g)$ and $Q(c\cdot f)$:

\begin{thm}
Let $Q\in\scrq$. Let $f$ and $g$ be functions.\\
\phx\qquad\qquad\qquad Then $Q\circ(f+g)=(Q\circ f)+2\cdot f\cdot g+(Q\circ g)$.
\end{thm}

\begin{thm}
Let $Q\in\scrq$. Let $c\in\R$. Let $f$ be a function.\\
\phx\qquad\qquad\qquad Then $Q\circ(c\cdot f)=c^2\cdot(Q\circ f)$.
\end{thm}

\noindent
The next theorem expresses that $\scrl$ is closed under composition.\\
It also says that the slope of the composite is the product of the slopes.

\begin{thm}
Let $L,M\in\scrl$. Then:\\
\phx\qquad\qquad $M\circ L\in\scrl$ \qquad and \qquad $[M\circ L]=[M]\cdot[L]$.
\end{thm}

\begin{proof}
Since $L,M\in\scrl=\scrh(1)$, we get $M\circ L\in\scrh(1\cdot1)=\scrh(1)$.\\
{\bf Want:} $[M\circ L]=[M]\cdot[L]$.\\
Let $a:=[L]$, $b:=[M]$. \qquad\qquad {\bf Want:} $[M\circ L]=b\cdot a$.\\
We have $a=[L]=L_1$, so $a=L_1$.\\
We have $b=[M]=M_1$, so $b=M_1$.\\
By algebraic linearity of $M$, we have $M_{a\cdot1}=a\cdot M_1$.\\
Then $[M\circ L]=(M\circ L)_1=M_{L_1}=M_a=M_{a\cdot1}=a\cdot M_1=a\cdot b=b\cdot a$.
\end{proof}

\noindent
We will be using two properties of $\scrbigo$ and $\scrlito$:\\
\phx\qquad $\forall\alpha\in\scrbigo(1)$, $\forall\beta\in\scrlito(1)$, \quad $\beta\circ\alpha\in\scrlito(1\cdot1)=\scrlito(1)$ \qquad and\\
\phx\qquad $\forall\alpha\in\scrlito(1)$, $\forall\beta\in\scrbigo(1)$, \quad $\beta\circ\alpha\in\scrlito(1\cdot1)=\scrlito(1)$.\\
The following is the $D$-\bfindex[chain rule]:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$. Then:\\
\phx\qquad\qquad\qquad $D_a(g\circ f)\,\,\,\,=^*\,\,(D_{f_a}g)\circ(D_af)$.
\end{thm}

\begin{proof}
{\bf Want:} $($ $(D_{f_a}g)\circ(D_af)\ne\frownie$ $)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\Rightarrow$ $($ $D_a(g\circ f)=(D_{f_a}g)\circ(D_af)$ $)$.\\
Assume $(D_{f_a}g)\circ(D_af)\ne\frownie$.\\
{\bf Want:} $D_a(g\circ f)=(D_{f_a}g)\circ(D_af)$.\\
Let $L:=D_af$, $M:=D_{f_a}g$.\\
Then $M\circ L\ne\frownie$, \quad so $L\ne\frownie\ne M$.\\
Then $L,M\in\scrl$ and $f_a^\T-L,g_{f_a}^\T-M\in\scrlito(1)$.\\
Let $R:=f_a^\T-L$, $S:=g_{f_a}^\T-M$. \quad Then $R,S\in\scrlito(1)$.\\
Also $L+R=f_a^\T$ and $M+S=g_{f_a}^\T$.\\
{\bf Want:} $D_a(g\circ f)=M\circ L$.\\
Since $\scrl$ is closed under composition, and $L,M\in\scrl$, we get: $M\circ L\in\scrl$.\\
By uniqueness of linearization, want: $(g\circ f)_a^\T-(M\circ L)\in\scrlito(1)$.\\
By the Precalculus Chain Rule, $(g\circ f)_a^\T=g_{f_a}^\T\circ f_a^\T$.\\
{\bf Want:} $\,\,$ $g_{f_a}^\T\circ f_a^\T-(M\circ L)\in\scrlito(1)$.\\
We have $g_{f_a}^\T\circ f_a^\T\,\,=\,\,(M+S)\circ f_a^\T$\\
\phx\qquad\qquad\qquad\quad $\,\,\,=\,\,M\circ f_a^\T\,+\,S\circ f_a^\T$\\
\phx\qquad\qquad\qquad\quad $\,\,\,=\,\,M\circ(L+R)\,+\,S\circ f_a^\T$\\
\phx\qquad\qquad\qquad\quad $\,\,\,=\,\,M\circ L\,+\,M\circ R\,+\,S\circ f_a^\T$.\\
Then $g_{f_a}^\T\circ f_a^\T-(M\circ L)=M\circ R\,+\,S\circ f_a^\T$.\\
{\bf Want:} $M\circ R\,+\,S\circ f_a^\T\in\scrlito(1)$.\\
{\bf Want:} $M\circ R,\quad\,S\circ f_a^\T\in\scrlito(1)$.\\
Since $M\in\scrl=\scrh(1)\subseteq\scrbigo(1)$ and $R\in\scrlito(1)$, we get: $M\circ R\in\scrlito(1)$.\\
{\bf Want:} $S\circ f_a^\T\in\scrlito(1)$.\\
Since $S\in\scrlito(1)$ and $f_a^\T\in\scrbigo(1)$, we get: $S\circ f_a^\T\in\scrlito(1)$.
\end{proof}

\subsection{Properties of the prime derivative}
\quad
\vskip.1in\noindent
Unassigned HW:\\
\phx\qquad $\forall c\in\R$, $\forall L\in\scrl$, \qquad $[c\cdot L]=c\cdot[L]$ \qquad\qquad and\\
\phx\qquad $\forall L,M\in\scrl$, \qquad $[L+M]=[L]+[M]$.

\begin{thm}
Let $f,g:R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad Then: \quad $(f+g)'_a\,\,\,\,=^*\,\,f'_a+g'_a$.
\end{thm}

\begin{proof}
We have $(f+g)'_a\,\,=\,\,[D_a(f+g)]\,\,\,\,=^*\,\,[D_af+D_ag]$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $=\!\!\!\!\!{}^*\,\,\,\,\,\,[D_af]+[D_ag]\,\,=\,\,f'_a+g'_a$.
\end{proof}

\begin{thm}
Let $f:R\drta\R$, $a,c\in\R$.\\
\phx\qquad\qquad\qquad Then: \quad $(c\cdot f)'_a\,\,\,\,=^*\,\,c\cdot f'_a$.
\end{thm}

\begin{proof}
We have $(c\cdot f)'_a\,\,=\,\,[D_a(c\cdot f)]\,\,\,\,=^*\,\,[c\cdot D_af]$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,=\!\!\!\!\!{}^*\,\,\,\,\,\,c\cdot[D_af]\,\,=\,\,c\cdot f'_a$.
\end{proof}

\noindent
The preceding two theorems can be summarized as:\\
\phx\qquad the prime derivative is algebraically linear.\\
The following is the {\bf prime} \bfindex[product rule]:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad Then: \quad $(f\cdot g)'_a\,\,\,\,=^*\,\,f'_a\cdot g_a\,+\,f_a\cdot g'_a$.
\end{thm}

\begin{proof}
$(f\cdot g)'_a\,\,=\,\,[D_a(f\cdot g)]$\\
\phx\qquad\qquad\qquad $\,\,\,\,=^*\,\,[D_af\cdot g_a\,+\,f_a\cdot D_ag]$\\
\phx\qquad\qquad\qquad$\,\,=\,\,[D_af]\cdot g_a\,+\,f_a\cdot[D_ag]$\\
\phx\qquad\qquad\qquad$\,\,=\,\,f'_a\cdot g_a\,+\,f_a\cdot g'_a$.
\end{proof}

The following is the {\bf prime} \bfindex[chain rule]:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad Then: \quad $(g\circ f)'_a\,\,\,\,=^*\,\,g'_{f_a}\circ f'_a$.
\end{thm}

\begin{proof}
$(g\circ f)'_a\,\,=\,\,[D_a(g\circ f)]$\\
\phx\qquad\qquad\qquad $\,\,\,\,=^*\,\,[D_{f_a}g\circ D_af]$\\
\phx\qquad\qquad\qquad$\,\,=\,\,[D_{f_a}g]\cdot[D_af]$\\
\phx\qquad\qquad\qquad$\,\,=\,\,g'_{f_a}\circ f'_a$.
\end{proof}

The following is the {\bf prime} \bfindex[quotient rule]:

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\D'_f\cap\D'_g$.\\
Assume $g_a\ne0$. \quad Then: $\ds{\left(\frac{f}{g}\right)'_a=-\frac{g_a\cdot f'_a-f_a\cdot g'_a}{g_a^2}}$.
\end{thm}

\begin{proof}
This is HW\#11-3.
\end{proof}

\subsection{The Mean Value Theorem}

\begin{defn}
We define $\boxed{\sgn}:\R\to\{-1,0,1\}$ by:\index[terms]{$\sgn$}\\
\phx\qquad\qquad\qquad $\forall x\in\R$, \qquad $\sgn_x\,\,=\,\,\begin{cases}-1,&\hbox{if }x<0\\0,&\hbox{if }x=0\\1,&\hbox{if }x>0.\end{cases}$
\end{defn}

\noindent
The function $\sgn$ is read ``sign'',\\
not to be confused with the trignonometric function ``sine'',\\
which is not defined in this course.

\begin{thm}
$(\,\sgn_3=1\,)\,\&\,(\,\sgn_{-\pi}=-1\,)\,\&\,(\,\sgn_0=0\,)$.
\end{thm}

\noindent
The function $\sgn$ is multiplicative:\\

\begin{thm}
$\forall w,x\in\R$, $\,$ $\sgn_{w\cdot x}\,=\,\sgn_w\cdot\sgn_x$.
\end{thm}

\noindent
The function $\sgn$ is ``robust'', in the sense that\\
\phx\quad small perturbations to an input don't affect the output:

\begin{thm}\wrlab{thm-sgn-robust}
Let $a,b\in\R$.\\
\phx\qquad\qquad\qquad Assume $|a|\le|b|/2$. \qquad Then $\sgn_{a+b}=\sgn_b$.
\end{thm}

\begin{proof}
Exactly one of the following must be true:\\
\phx\qquad (1) $b<0$ \qquad (2) $b=0$ \qquad (3) $b>0$.\\
\\
{\it Case (1):}
Since $b<0$, we get: $\sgn_b=-1$ and $b/2<0$.\\
We have $|a|\le|b|/2=-b/2$, so $b/2\le a\le-b/2$.\\
Since $a\le-b/2$, we get $b+a\le b-(b/2)$.\\
Since $b+a\le b-(b/2)=b/2<0$, we get $\sgn_{b+a}=-1$.\\
Then $\sgn_{b+a}=-1=\sgn_b$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}
Since $b=0$, we get: $\sgn_b=0$ and $b/2=0$.\\
We have $|a|\le|b|/2=0$, so $-0\le a\le0$.\\
Then $a=0$, so $b+a=0+0=0$, so $\sgn_{b+a}=0$.\\
Then $\sgn_{b+a}=0=\sgn_b$.\\
{\it End of Case (2).}\\
\\
{\it Case (3):}
Since $b>0$, we get: $\sgn_b=1$ and $0<b/2$.\\
We have $|a|\le|b|/2=b/2$, so $-b/2\le a\le b/2$.\\
Since $-b/2\le a$, we get $b-(b/2)\le b+a$.\\
Since $0<b/2=b-(b/2)\le b+a$, we get $\sgn_{b+a}=1$.\\
Then $\sgn_{b+a}=1=\sgn_b$.\\
{\it End of Case (3).}
\end{proof}

\begin{defn}
Let $S$ be a set, $f$ a functional, $b\in\R$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f<b}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x<b$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f>b}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x>b$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f\le b}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x\le b$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f\ge b}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x\ge b$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,b<f}$, \quad we mean: \quad $\forall x\in S$, $\,$ $b<f_x$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,b>f}$, \quad we mean: \quad $\forall x\in S$, $\,$ $b>f_x$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,b\le f}$, \quad we mean: \quad $\forall x\in S$, $\,$ $b\le f_x$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,b\ge f}$, \quad we mean: \quad $\forall x\in S$, $\,$ $b\ge f_x$.
\end{defn}

\begin{defn}
Let $S$ be a set and let $f,g$ be functionals.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f<g}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x<g_x$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f>g}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x>g_x$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f\le g}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x\le g_x$.\\
\phx\quad By \quad $\boxed{\hbox{on }S,\,f\ge g}$, \quad we mean: \quad $\forall x\in S$, $\,$ $f_x\ge g_x$.
\end{defn}

\noindent
There are many theorems like the next one.\\
All are unassigned HW, and may be used without comment, in proofs.

\begin{thm}
Let $f:\R\drta\R$, $S\subseteq\R$, $a\in\D_f$, $b\in\R$.\\
\phx\quad Then: \qquad\quad $\,\,[$ on $S$, $\,$ $f<b$ $]$\\
\phx\qquad\qquad\quad  $\Leftrightarrow$ \quad $[$ on $S-a$, $\,$ $f_a^\T<b-f_a$ $]$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$, $\phi:=f_a^\T$.\\
\phx\quad Then $\LINS_af\,\,=\,\,\LINS_0\phi$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall L\in\scrl$, $(\,L\in\LINS_af\,)\,\Leftrightarrow\,(\,L\in\LINS_0\phi\,)$.\\
Given $L\in\scrl$. \quad {\bf Want:} $(\,L\in\LINS_af\,)\,\Leftrightarrow\,(\,L\in\LINS_0\phi\,)$.\\
Since $a\in\D_f$, \quad we get $(f_a)^\T_0=0$. \quad Then $\phi_0=0$. \quad Then $\phi_0^\T=\phi$.\\
Then $f_a^\T=\phi=\phi_0^\T$.\\
Then:
$(\,L\in\LINS_af\,)\,\Leftrightarrow\,(\,f_a^\T-L\in\scrlito(1)\,)$\\
\phx\qquad\qquad\qquad\qquad\quad $\,\Leftrightarrow\,(\,\phi_0^\T-L\in\scrlito(1)\,)\,\Leftrightarrow\,(\,L\in\LINS_0\phi\,)$.
\end{proof}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$, $\phi:=f_a^\T$.\\
Then: \quad $D_af\,\,=\,\,D_0\phi$ \quad and \quad $f'_a\,\,=\,\,\phi'_0$.
\end{thm}

\begin{proof}
From the preceding theorem, $\LINS_af=\LINS_0\phi$.\\
Then: \quad $D_af\,\,=\,\,\UE(\LINS_af)\,\,=\,\,\UE(\LINS_0\phi)\,\,=\,\,D_0\phi$.\\
{\bf Want:} \quad $f'_a\,\,=\,\,\phi'_0$.\\
We have: \quad $f'_a\,\,=\,\,[D_af]\,\,=\,\,[D_0\phi]\,\,=\,\,\phi'_0$.
\end{proof}

\begin{defn}
Let $f$ be a functional, $a\in\D_f$.\\
\phx\qquad\qquad By $f$ has a \bfindex[global semi-maximum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall x\in\D_f$, \quad $f_x\le f_a$.\\
\phx\qquad\qquad By $f$ has a \bfindex[global strict-maximum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall x\in(\D_f)_a^\times$, \quad $f_x<f_a$.\\
\phx\qquad\qquad By $f$ has a \bfindex[global semi-minimum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall x\in\D_f$, \quad $f_x\ge f_a$.\\
\phx\qquad\qquad By $f$ has a \bfindex[global strict-minimum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\forall x\in(\D_f)_a^\times$, \quad $f_x>f_a$.\\
\end{defn}

\begin{defn}
Let $f:\R\drta\R$, $a\in\D_f$.\\
\phx\qquad By $f$ has a \bfindex[global semi-extremum] at $a$, we mean:\\
\phx\qquad\qquad\qquad $\,\,f$ has a global semi-maximum at $a$\\
\phx\qquad\qquad or \quad $f$ has a global semi-minimum at $a$.\\
\phx\qquad By $f$ has a \bfindex[global strict-extremum] at $a$, we mean:\\
\phx\qquad\qquad\qquad $\,\,f$ has a global strict-maximum at $a$\\
\phx\qquad\qquad or \quad $f$ has a global strict-minimum at $a$.\\
\end{defn}

\begin{defn}
Let $f:\R\drta\R$, $a\in\D_f$.\\
\phx\qquad\qquad By $f$ has a \bfindex[local semi-maximum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\exists B\in\scrb(a)$ s.t., $\forall x\in B$, \quad $f_x\le f_a$.\\
\phx\qquad\qquad By $f$ has a \bfindex[local strict-maximum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\exists B\in\scrb(a)$ s.t., $\forall x\in B$, \quad $f_x\ge f_a$.\\
\phx\qquad\qquad By $f$ has a \bfindex[local semi-minimum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\exists B\in\scrb(a)$ s.t., $\forall x\in B_a^\times$, \quad $f_x<f_a$.\\
\phx\qquad\qquad By $f$ has a \bfindex[local strict-minimum] at $a$, we mean:\\
\phx\qquad\qquad\qquad\qquad $\exists B\in\scrb(a)$ s.t., $\forall x\in B_a^\times$, \quad $f_x>f_a$.\\
\end{defn}

\begin{defn}
Let $f$ be a functional, $a\in\D_f$.\\
\phx\qquad By $f$ has a \bfindex[local semi-extremum] at $a$, we mean:\\
\phx\qquad\qquad\qquad $\,\,f$ has a local semi-maximum at $a$\\
\phx\qquad\qquad or \quad $f$ has a local semi-minimum at $a$.\\
\phx\qquad By $f$ has a \bfindex[local strict-extremum] at $a$, we mean:\\
\phx\qquad\qquad\qquad $\,\,f$ has a local strict-maximum at $a$\\
\phx\qquad\qquad or \quad $f$ has a local strict-minimum at $a$.\\
\end{defn}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $f$ has a local strict-maximum at $a$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $f_a^\T$ has a local strict-maximum at $0$.\\
\end{thm}

\begin{proof}
This is HW\#12-4.
\end{proof}

\noindent
The preceding theorem is one of many:\\
\phx\quad You can change ``local'' to ``global''.\\
\phx\quad You can change ``strict'' to ``semi''.\\
\phx\quad You can change ``maximum'' to ``minimum'' or to ``extremum''.\\
Thus there are $2\cdot2\cdot3=12$ different results.\\
\\
There are also 12 converses:

\begin{thm}
Let $f:\R\drta\R$, $a\in\D_f$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $f_a^\T$ has a local strict-maximum at $0$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $f$ has a local strict-maximum at $a$.\\
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The preceding theorem is one of many:\\
\phx\quad You can change ``local'' to ``global''.\\
\phx\quad You can change ``strict'' to ``semi''.\\
\phx\quad You can change ``maximum'' to ``minimum'' or to ``extremum''.\\
Thus there are $2\cdot2\cdot3=12$ different results.

\begin{thm}\wrlab{thm-local-effect-of-pos-deriv}
Let $f:\R\drta\R$, $a\in\D'_f$. Assume $f'_a>0$.\\
\phx\qquad Then $\exists\delta>0$ s.t. \qquad\qquad\qquad $\,\,\,[$ on $(a-\delta\,;\,a)$, $\,$ $f<f_a$ $]$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad and \qquad $[$ on $(a\,;\,a+\delta)$, $\,$ $f>f_a$ $]$.
\end{thm}

\begin{proof}
Let $L:=D_af$, $m:=[L]$. Then $m=[D_af]=f'_a>0$, so $m>0$.\\
We have: $\forall h\in\R$, $L_h=L_{h\cdot1}=h\cdot L_1=h\cdot[L]=h\cdot m=m\cdot h$.\\
Let $R:=f_a^\T-L$. \quad Then $L+R=f_a^\T$.\\
Since $L\in\LINS_af$, we get $L\in\scrl$ and $R\in\scrlito(1)$.\\
Since $R\in\scrlito(1)$, choose $\delta>0$ s.t., $\forall h\in\R$,\\
\phx\qquad\qquad\qquad\qquad $(\,|h|<\delta\,)\,\Rightarrow\,(\,|R_h|\le(1/2)\cdot m\cdot|h|^1\,)$.\\
Then $\delta>0$. \qquad\quad {\bf Want:} \qquad\qquad $\,\,\,\,[$ on $(a-\delta\,;\,a)$, $\,$ $f<f_a$ $]$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad and \qquad $[$ on $(a\,;\,a+\delta)$, $\,$ $f>f_a$ $]$.\\
\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ on $(a-\delta\,;\,a)-a$, $\,$ $f_a^\T<f_a-f_a$ $]$\\
\phx\qquad\qquad and \qquad $[$ on $(a\,;\,a+\delta)-a$, $\,$ $f_a^\T>f_a-f_a$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ on $(-\delta\,;\,0)$, $\,$ $f_a^\T<0$ $]$\\
\phx\qquad\qquad and \qquad $[$ on $(0\,;\,\delta)$, $\,$ $f_a^\T>0$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ $\forall h\in(-\delta\,;\,0)$, $\,$ $(f_a^\T)_h<0$ $]$\\
\phx\qquad\qquad and \qquad $[$ $\forall h\in(0\,;\,\delta)$, $\,$ $(f_a^\T)_h>0$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ $\forall h\in(-\delta\,;\,0)$, $\,$ $\sgn((f_a^\T)_h)=-1$ $]$\\
\phx\qquad\qquad and \qquad $[$ $\forall h\in(0\,;\,\delta)$, $\,$ $\sgn((f_a^\T)_h)=1$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ $\forall h\in(-\delta\,;\,0)$, $\,$ $\sgn((f_a^\T)_h)=\sgn(h)$ $]$\\
\phx\qquad\qquad and \qquad $[$ $\forall h\in(0\,;\,\delta)$, $\,$ $\sgn((f_a^\T)_h)=\sgn(h)$ $]$.\\
\\
{\bf Want:} $\forall h\in(-\delta\,;\,\delta)$, $\,$ $\sgn((f_a^\T)_h)=\sgn(h)$.\\
Given $h\in(-\delta\,;\,\delta)$. \qquad {\bf Want:} $\sgn((f_a^\T)_h)=\sgn(h)$.\\
We have $|h|<\delta$, so, by the choice of $\delta$, we get: $|R_h|\le(1/2)\cdot m\cdot|h|^1$.\\
So, since $|L_h|=|m\cdot h|=|m|\cdot|h|=|m|\cdot|h|^1$, we have: $|R_h|\le(1/2)\cdot|L_h|$.\\
Let $b:=L_h$ and $a:=R_h$. \quad Then $|a|\le|b|/2$.\\
So, by \tref{thm-sgn-robust}, we get: $\sgn_{b+a}=\sgn_b$.\\
That is, $\sgn(L_h+R_h)=\sgn(L_h)$. \quad Since $m>0$, we get: $\sgn_m=1$.\\
Then $\sgn((f_a^\T)_h)\,\,=\,\,\sgn((L+R)_h)\,\,=\,\,\sgn(L_h+R_h)\,\,=\,\,\sgn(L_h)$\\
\phx\qquad\qquad\quad $=\,\,\sgn(m\cdot h)\,\,=\,\,\sgn_m\cdot\sgn_h\,\,=\,\,1\cdot\sgn_h\,\,=\,\,\sgn(h)$.
\end{proof}

\begin{thm}\wrlab{thm-local-effect-of-neg-deriv}
Let $f:\R\drta\R$, $a\in\D'_f$. Assume $f'_a<0$.\\
\phx\qquad Then $\exists\delta>0$ s.t. \qquad\qquad\qquad $\,\,\,[$ on $(a-\delta\,;\,a)$, $\,$ $f>f_a$ $]$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad and \qquad $[$ on $(a\,;\,a+\delta)$, $\,$ $f<f_a$ $]$.
\end{thm}

\begin{proof}
Let $L:=D_af$, $m:=[L]$. Then $m=[D_af]=f'_a<0$, so $m<0$.\\
We have: $\forall h\in\R$, $L_h=L_{h\cdot1}=h\cdot L_1=h\cdot[L]=h\cdot m=m\cdot h$.\\
Let $R:=f_a^\T-L$. \quad Then $L+R=f_a^\T$.\\
Since $L\in\LINS_af$, we get $L\in\scrl$ and $R\in\scrlito(1)$.\\
Since $R\in\scrlito(1)$, choose $\delta>0$ s.t., $\forall h\in\R$,\\
\phx\qquad\qquad\qquad\qquad $(\,|h|<\delta\,)\,\Rightarrow\,(\,|R_h|\le(1/2)\cdot m\cdot|h|^1\,)$.\\
Then $\delta>0$. \qquad\quad {\bf Want:} \qquad\qquad $\,\,\,\,[$ on $(a-\delta\,;\,a)$, $\,$ $f>f_a$ $]$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad and \qquad $[$ on $(a\,;\,a+\delta)$, $\,$ $f<f_a$ $]$.\\
\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ on $(a-\delta\,;\,a)-a$, $\,$ $f_a^\T>f_a-f_a$ $]$\\
\phx\qquad\qquad and \qquad $[$ on $(a\,;\,a+\delta)-a$, $\,$ $f_a^\T<f_a-f_a$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ on $(-\delta\,;\,0)$, $\,$ $f_a^\T>0$ $]$\\
\phx\qquad\qquad and \qquad $[$ on $(0\,;\,\delta)$, $\,$ $f_a^\T<0$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ $\forall h\in(-\delta\,;\,0)$, $\,$ $(f_a^\T)_h>0$ $]$\\
\phx\qquad\qquad and \qquad $[$ $\forall h\in(0\,;\,\delta)$, $\,$ $(f_a^\T)_h<0$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ $\forall h\in(-\delta\,;\,0)$, $\,$ $\sgn((f_a^\T)_h)=1$ $]$\\
\phx\qquad\qquad and \qquad $[$ $\forall h\in(0\,;\,\delta)$, $\,$ $\sgn((f_a^\T)_h)=-1$ $]$.\\
{\bf Want:} \qquad\qquad\quad $\,\,[$ $\forall h\in(-\delta\,;\,0)$, $\,$ $\sgn((f_a^\T)_h)=-\sgn(h)$ $]$\\
\phx\qquad\qquad and \qquad $[$ $\forall h\in(0\,;\,\delta)$, $\,$ $\sgn((f_a^\T)_h)=-\sgn(h)$ $]$.\\
\\
{\bf Want:} $\forall h\in(-\delta\,;\,\delta)$, $\,$ $\sgn((f_a^\T)_h)=-\sgn(h)$.\\
Given $h\in(-\delta\,;\,\delta)$. \qquad {\bf Want:} $\sgn((f_a^\T)_h)=-\sgn(h)$.\\
We have $|h|<\delta$, so, by the choice of $\delta$, we get: $|R_h|\le(1/2)\cdot m\cdot|h|^1$.\\
So, since $|L_h|=|m\cdot h|=|m|\cdot|h|=|m|\cdot|h|^1$, we have: $|R_h|\le(1/2)\cdot|L_h|$.\\
Let $b:=L_h$ and $a:=R_h$. \quad Then $|a|\le|b|/2$.\\
So, by \tref{thm-sgn-robust}, we get: $\sgn_{b+a}=\sgn_b$.\\
That is, $\sgn(L_h+R_h)=\sgn(L_h)$. \quad Since $m>0$, we get: $\sgn_m=-1$.\\
Then $\sgn((f_a^\T)_h)\,\,=\,\,\sgn((L+R)_h)\,\,=\,\,\sgn(L_h+R_h)\,\,=\,\,\sgn(L_h)$\\
\phx\qquad\qquad\quad $=\,\,\sgn(m\cdot h)\,\,=\,\,\sgn_m\cdot\sgn_h\,\,=\,\,-1\cdot\sgn_h\,\,=\,\,-\sgn(h)$.
\end{proof}

\begin{thm}\wrlab{thm-Fermat-for-local-semi-max}
Let $f:\R\drta\R$, $a\in\D'_f$.\\
\phx\qquad\qquad\qquad Assume: \quad $f$ has a local semi-maximum at $a$.\\
\phx\qquad\qquad\qquad Then: \qquad $f'_a=0$.
\end{thm}

\begin{proof}
Assume $f'_a\ne0$. \qquad {\bf Want:} Contradiction.\\
Exactly one of the following is true:\\
\phx\qquad (1) $f'_a>0$ \qquad or \qquad (2) $f'_a<0$.\\
\\
{\it Case (1):}\\
By \tref{thm-local-effect-of-pos-deriv}, choose $\delta>0$ s.t.\\
\phx\qquad $[$ on $(a-\delta\,;\,a)$, $f<f_a$ $]$ \quad and \quad $[$ on $(a\,;\,a+\delta)$, $f>f_a$ $]$.\\
Since $f$ has a local semi-maximum at $a$, choose $B\in\scrb(a)$ s.t.\\
\phx\qquad $\forall x\in B$, $\,$ $f_x\le f_a$.\\
Choose $\rho>0$ s.t.~$B=B(a,\rho)$. \quad Let $\mu:=\min\{\delta,\rho\}$.\\
Since $\mu\le\delta$, we get: $(a\,;\,a+\mu)\subseteq(a\,;\,a+\delta)$.\\
Since $\mu\le\rho$, we get: $B(a,\mu)\subseteq B(a,\rho)$.\\
Let $x:=a+(\mu/2)$. \quad Then $a<x<a+\mu$. \quad Then $x\in(a\,;\,a+\mu)$.\\
Since $x\in(a\,;\,a+\mu)\subseteq(a\,;\,a+\delta)$,\\
\phx\qquad by choice of $\delta$, we have $f_x>f_a$, \quad and so $f_a<f_x$.\\
Since $x\in(a\,;\,a+\mu)\subseteq B(a,\mu)\subseteq B(a,\rho)=B$,\\
\phx\qquad by choice of $B$, we have $f_x\le f_a$.\\
Then $f_a<f_x\le f_a$, so $f_a<f_a$. \quad Contradiction.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
By \tref{thm-local-effect-of-neg-deriv}, choose $\delta>0$ s.t.\\
\phx\qquad $[$ on $(a-\delta\,;\,a)$, $f>f_a$ $]$ \quad and \quad $[$ on $(a\,;\,a+\delta)$, $f<f_a$ $]$.\\
Since $f$ has a local semi-maximum at $a$, choose $B\in\scrb(a)$ s.t.\\
\phx\qquad $\forall x\in B$, $\,$ $f_x\le f_a$.\\
Choose $\rho>0$ s.t.~$B=B(a,\rho)$. \quad Let $\mu:=\min\{\delta,\rho\}$.\\
Since $\mu\le\delta$, we get: $(a-\mu\,;\,a)\subseteq(a-\delta\,;\,a)$.\\
Since $\mu\le\rho$, we get: $B(a,\mu)\subseteq B(a,\rho)$.\\
Let $x:=a-(\mu/2)$. \quad Then $a-\mu<x<a$. \quad Then $x\in(a-\mu\,;\,a)$.\\
Since $x\in(a-\mu\,;\,a)\subseteq(a-\delta\,;\,a)$,\\
\phx\qquad by choice of $\delta$, we have $f_x>f_a$, \quad and so $f_a<f_x$.\\
Since $x\in(a\,;\,a+\mu)\subseteq B(a,\mu)\subseteq B(a,\rho)=B$,\\
\phx\qquad by choice of $B$, we have $f_x\le f_a$.\\
Then $f_a<f_x\le f_a$, so $f_a<f_a$. \quad Contradiction.\\
{\it End of Case (2).}
\end{proof}

The following is called \bfindex[Fermat's Theorem]:

\begin{thm}
Let $f:\R\drta\R$, $a\in\D'_f$.\\
\phx\qquad\qquad\qquad Assume: \quad $f$ has a local semi-extremum at $a$.\\
\phx\qquad\qquad\qquad Then: \qquad $f'_a=0$.
\end{thm}

\begin{proof}
At least one of the following is true:\\
\phx\qquad\qquad\qquad (1) $f$ has a local semi-maximum at $a$.\\
\phx\qquad\qquad\qquad (2) $f$ has a local semi-minimum at $a$.\\
\\
{\it Case (1):}\\
By \tref{thm-Fermat-for-local-semi-max}, we get: $f'_a=0$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Since $f$ has a local semi-minimum at $a$,\\
it follows that $-f$ has a local semi-maximum at $a$,\\
so, by \tref{thm-Fermat-for-local-semi-max}, we get: $(-f)'_a=0$.\\
Since $a\in\D'_f$, we get: $(-f)'_a=-f'_a$.\\
Then $f'_a=-(-f'_a)=-((-f)'_a)=-0=0$.\\
{\it End of Case (2).}
\end{proof}

\noindent
The following theorem does not require differentiability of $f$:

\begin{thm}\wrlab{thm-exists-loc-semi-extr}
Let $f:\R\drta\R$, $a\in\R$ $b>a$.\\
\phx\qquad Assume $f$ is continuous on $[a;b]$. \quad Assume $f_a=f_b$.\\
\phx\qquad Then $\exists c\in(a;b)$ s.t.~$f$ has a local semi-extremum at $c$.
\end{thm}

\begin{proof}
Let $V:=f_*[a;b]$, $y:=\min V$, $z:=\max V$.\\
By the EVT, $y\ne\frownie\ne z$.\\
Then $\forall x\in[a;b]$, we have $y\le f_x\le z$.\\
In particular, $y\le f_a\le z$.\\
At least one of the following must be true:\\
\phx\qquad (1) $y=f_a=z$ \quad or \quad (2) $y\ne f_a$ \quad or \quad (3) $z\ne f_a$.\\
\\
{\it Case (1):}
Let $c:=(a+b)/2$. \quad Since $b>a$, we get: $c\in(a;b)$.\\
{\bf Want:} $f$ has a local semi-extremum at $c$.\\
{\bf Want:} $f$ has a local semi-maximum at $c$.\\
{\bf Want:} $\exists\delta>0$ s.t., $\forall x\in B(c,\delta)$, $f_x\le f_c$.\\
Let $\delta:=(b-a)/2$. Since $b>a$, we get: $\delta>0$.\\
{\bf Want:} $\forall x\in B(c,\delta)$, $f_x\le f_c$.\\
Given $x\in B(c,\delta)$. \qquad {\bf Want:} $f_x\le f_c$.\\
We have $c-\delta=a$ and $c+\delta=b$,\\
\phx\quad so $B(c,\delta)=(a;b)$. \qquad Then $B(c,\delta)\subseteq[a;b]$.\\
Since $f$ is continuous on $[a;b]$, we get: $[a;b]\subseteq\D_f$.\\
We have $x,c\in B(c,\delta)\subseteq[a;b]$, so $x,c\in[a;b]$.\\
Then $x,c\in[a;b]\subseteq\D_f$, so $x,c\in\D_f$.\\
Since $x,c\in[a;b]$ and $x,c\in\D_f$, we get $f_x,f_c\in f_*[a;b]$.\\
Since $f_x,f_c\in f_*[a;b]=V$, it follows that:\\
\phx\quad $\min V\le f_x\le\max V$ \quad and \quad $\min V\le f_c\le\max V$.\\
Then: \quad $y\le f_x\le z$ \quad and \quad $y\le f_c\le z$.\\
So, since $y=f_a=z$, we get: \quad $f_a\le f_x\le f_a$ \quad and \quad $f_a\le f_c\le f_a$.\\
Then $f_x=f_a$ and $f_c=f_a$. \quad Then $f_x=f_c$. \quad Then $f_x\le f_c$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}
Since $y\in V=f_*[a;b]$, choose $c\in[a;b]$ s.t.~$f_c=y$.\\
Since $f_c=y\ne f_a$, we get $f_c\ne f_a$, and so $c\ne a$.\\
By hypothesis, $f_a=f_b$.\\
Since $f_c=y\ne f_a=f_b$, we get $f_c\ne f_b$, and so $c\ne b$.\\
Then $c\in[a;b]\bksl\{a,b\}=(a;b)$.\\
{\bf Want:} $f$ has a local semi-extremum at $c$.\\
{\bf Want:} $f$ has a local semi-minimum at $c$.\\
{\bf Want:} $\exists\delta>0$ s.t., $\forall x\in B(c,\delta)$, $f_x\ge f_c$.\\
Since $(a;b)$ is open and $c\in(a;b)$, choose $\delta>0$ s.t.~$B(c,\delta)\subseteq(a;b)$.\\
Then $\delta>0$. \quad {\bf Want:} $\forall x\in B(c,\delta)$, $f_x\ge f_c$.\\
Given $x\in B(c,\delta)$. \quad {\bf Want:} $f_x\ge f_c$.\\
Since $x\in[a;b]$ and since $[a;b]\subseteq\D_f$, we get: $x\in\D_f$.\\
Since $x\in[a;b]$ and $x\in\D_f$, we get: $f_x\in f_*[a;b]$.\\
Since $f_x\in f_*[a;b]=V$ and $y=\min V$, we get: $f_x\ge y$.\\
Then $f_x\ge y=f_c$.\\
{\it End of Case (2).}\\
\\
{\it Case (3):}\\
Since $z\in V=f_*[a;b]$, choose $c\in[a;b]$ s.t.~$f_c=z$.\\
Since $f_c=z\ne f_a$, we get $f_c\ne f_a$, and so $c\ne a$.\\
By hypothesis, $f_a=f_b$.\\
Since $f_c=z\ne f_a=f_b$, we get $f_c\ne f_b$, and so $c\ne b$.\\
Then $c\in[a;b]\bksl\{a,b\}=(a;b)$.\\
{\bf Want:} $f$ has a local semi-extremum at $c$.\\
{\bf Want:} $f$ has a local semi-maximum at $c$.\\
{\bf Want:} $\exists\delta>0$ s.t., $\forall x\in B(c,\delta)$, $f_x\le f_c$.\\
Since $(a;b)$ is open and $c\in(a;b)$, choose $\delta>0$ s.t.~$B(c,\delta)\subseteq(a;b)$.\\
Then $\delta>0$. \quad {\bf Want:} $\forall x\in B(c,\delta)$, $f_x\le f_c$.\\
Given $x\in B(c,\delta)$. \quad {\bf Want:} $f_x\le f_c$.\\
Since $x\in[a;b]$ and since $[a;b]\subseteq\D_f$, we get: $x\in\D_f$.\\
Since $x\in[a;b]$ and $x\in\D_f$, we get: $f_x\in f_*[a;b]$.\\
Since $f_x\in f_*[a;b]=V$ and $z=\max V$, we get: $f_x\le z$.\\
Then $f_x\le z=f_c$.\\
{\it End of Case (3).}
\end{proof}

\begin{defn}
Let $f:\R\drta\R$, $S\subseteq\R$.\\
By $f$ is \bfindex[c/d] on $S$, we mean: \quad
$f$ is continuous on $S$ \quad and \quad $\Int\,S\subseteq\D'_f$.
\end{defn}

\noindent
Let $a\in\R$ and let $b\ge a$.\\
Recall: $\Int[a;b]=(a;b)$.\\
So, for any $f:\R\drta\R$, we have: $f$ is c/d on $[a;b]$ \quad iff\\
\phx\quad $f$ is continuous on $[a;b]$ \quad and \quad $f$ is differentiable on $(a;b)$.\\
\\
Let $f:\R\drta\R$ and let $S\subseteq\R$.\\
If $S\subseteq\D'_f$, then $f$ is continuous on $S$ and $\Int\,S\subseteq S\subseteq\D'_f$,\\
\phx\quad and so $f$ is c/d on $S$.
However, the converse is not necessarily true: A function might be\\
\phx\quad continuous on $[0;\infty)$ \quad and \quad differentiable on $(0;\infty)$\\
\phx\qquad\qquad\qquad but NOT differentiable at $0$.\\
\\
The following is \bfindex[Rolle's Theorem]:

\begin{thm}
Let $f:\R\drta\R$, let $a\in\R$ and let $b>a$.\\
\phx\qquad\qquad Assume: \quad $f$ is c/d on $[a;b]$ \quad and \quad $f_a=f_b$.\\
\phx\qquad\qquad Then: \qquad $\exists c\in(a;b)$ s.t.~$f'_c=0$.
\end{thm}

\begin{proof}
By \tref{thm-exists-loc-semi-extr},\\
\phx\qquad\qquad\qquad choose $c\in(a;b)$ s.t.~$f$ has a local semi-extremum at $c$.
Then $c\in(a;b)$. \quad {\bf Want:} $f'_c=0$.\\
By assumption, $f$ is c/d on $[a;b]$, and so $\Int[a;b]\subseteq\D'_f$.\\
Then $c\in(a;b)=\Int[a;b]\subseteq\D'_f$.\\
Then, by Fermat's Theorem, we have $f'_c=0$.
\end{proof}

\noindent
The following is the \bfindex[Mean Value Theorem] or \bfindex[MVT]:

\begin{thm}\wrlab{thm-MVT}
Let $f:\R\drta\R$, $a\in\R$, $b>a$.\\
\phx\qquad\qquad\qquad Assume: \quad $f$ is c/d on $[a;b]$.\\
\phx\qquad\qquad\qquad Then: \qquad $\exists c\in(a;b)$ s.t.~$f'_c=\DQ_f(a,b)$.
\end{thm}

\begin{proof}
Let $m:=\DQ_f(a,b)$, $L:=m\cdot(\bullet)$.\\
Then $L'=C^\R_m$. In particular, $\D'_L=\R$, and so $[a;b]\subseteq\D'_L$.\\
It follows that $L$ is c/d on $[a;b]$.\\
By assumption, $f$ is also c/d on $[a;b]$.\\
Then $f-L$ is c/d on $[a;b]$.\\
Let $g:=f-L$. \quad Then $g$ is c/d on $[a;b]$.\\
By HW\#6-3, we have: $g_a=g_b$.\\
Then, by Rolle's Theorem, choose $c\in(a;b)$ s.t.~$g'_c=0$.\\
Then $c\in(a;b)$. \quad {\bf Want:} $f'_c=\DQ_f(a,b)$.\\
Since $L'=C_m^\R$, we get $L_c=m$.\\
Since $f$ is c/d on $[a;b]$, we get: $\Int[a;b]\subseteq\D'_f$.\\
Since $c\in(a;b)=\Int[a;b]\subseteq\D'_f$ and $c\in\R=\D'_L$, we get:\\
\phx\qquad\qquad\qquad $(f-L)'_c=f'_c-L'_c$.\\
Then $0=g'_c=(f-L)'_c=f'_c-L'_c$, and so $f'_c=L'_c$.\\
Then $f'_c=L'_c=m=\DQ_f(a,b)$.
\end{proof}

\begin{defn}
Let $I\subseteq\R$.
By $I$ is an \bfindex[interval], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\forall a,b\in I$, $\,$ $[a|b]\subseteq I$.
\end{defn}

\begin{thm}
$(\,[1;3]\cup[5;7]\hbox{ is not an interval}\,)$\\
\phx\qquad\qquad\qquad\qquad $\&\quad\,(\,(4;9]\hbox{ is an interval}\,)$\\
\phx\qquad\qquad\qquad\qquad $\&\quad\,(\,[0;\infty)\hbox{ is an interval}\,)$\\
\phx\qquad\qquad\qquad\qquad $\&\quad\,(\,\emptyset\hbox{ is an interval}\,)$\\
\phx\qquad\qquad\qquad\qquad $\&\quad\,(\,\R\hbox{ is an interval}\,)$\\
\phx\qquad\qquad\qquad\qquad $\&\quad\,(\,\R_0^\times\hbox{ is not an interval}\,)$.\\
\end{thm}

\begin{thm}
Let $I\subseteq\R$ be a nonempty interval.\\
\phx\qquad Let \quad $a:=\inf I$, \quad $b:=\sup I$.\\
\phx\qquad Then: $(\,I=[a;b]\,)\,\vee\,(\,I=[a;b)\,)\,\vee\,(\,I=(a;b]\,)\,\vee\,(\,I=(a;b)\,)$.
\end{thm}

\begin{defn}
Let $f:\R\drta\R$, $S\subseteq\D_f$.\\
\phx\qquad\qquad Then: \qquad $\boxed{\DQ_f^S}\,\,:=\,\,\{\,\DQ_f(a,b)\,|\,a,b\in S,\,a\ne b\,\}$.
\end{defn}

\noindent
The set $\DQ_f^S$ represents the set of ``secant slopes for $f$ over $S$'',\\
or the set of ``slopes of secant lines for $f$ over $S$''.

\begin{defn}
Let $f$ be a function.
By $f$ is \bfindex[constant],\\
\phx\qquad\qquad\qquad we mean: \qquad $\forall a,b\in\D_f$, $\,\,$ $f_a=f_b$.
\end{defn}

\begin{thm}
$\emptyset$ is constant.
\end{thm}

\begin{thm}
Let $f$ be a function.\\
\phx\qquad Assume: $\#\D_f=1$. \qquad Then: $f$ is constant.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$. \quad Then:\\
\phx\qquad $(\,\#\I_f\le1\,)\,\Leftrightarrow\,(\,f\hbox{ is constant}\,)\,\Leftrightarrow\,(\,\DQ_f^{\D_f}\subseteq\{0\}\,)$.
\end{thm}

\noindent
The preceding theorem shows, for functions $\R\drta\R$, that\\
\phx\qquad a precalculus concept such as ``constant''\\
is equivalent to\\
\phx\qquad a statement about secant slopes.\\
The following theorem contains six such equivalences:

\begin{thm}\wrlab{thm-precalc-DQ-apps}
Let $f:\R\drta\R$, $S\subseteq\D_f$. \quad Then:\\
\phx\qquad $\,[\,(\,f|S\hbox{ is constant}\,)\,\Leftrightarrow\,(\,\DQ_f^S\subseteq\{0\}\,)\,]$\\
\phx\quad $\&\,\,[\,(\,f|S\hbox{ is one-to-one}\,)\,\Leftrightarrow\,(\,0\notin\DQ_f^S\,)\,]$\\
\phx\quad $\&\,\,[\,(\,f|S\hbox{ is strictly-increasing}\,)\,\Leftrightarrow\,(\,\DQ_f^S>0\,)\,]$\\
\phx\quad $\&\,\,[\,(\,f|S\hbox{ is semi-increasing}\,)\,\Leftrightarrow\,(\,\DQ_f^S\ge0\,)\,]$\\
\phx\quad $\&\,\,[\,(\,f|S\hbox{ is strictly-decreasing}\,)\,\Leftrightarrow\,(\,\DQ_f^S<0\,)\,]$\\
\phx\quad $\&\,\,[\,(\,f|S\hbox{ is semi-decreasing}\,)\,\Leftrightarrow\,(\,\DQ_f^S\le0\,)\,]$.
\end{thm}

\begin{thm}\wrlab{thm-find-a-lt-b}
Let $f:\R\drta\R$, $S\subseteq\D_f$, $m\in\DQ_f^S$.\\
\phx\quad Then: \quad $\exists a,b\in S$ \quad s.t. \quad $(\,a<b\,)\quad\&\quad(\,m=\DQ_f(a,b)\,)$.
\end{thm}

\begin{proof}
Since $m\in\DQ_f^S$, choose $\alpha,\beta\in S$ s.t.\\
\phx\qquad\qquad\qquad $(\,\alpha\ne\beta\,)\,\&\,(\,m=\DQ_f(\alpha,\beta)\,)$.\\
Let $a:=\min\{\alpha,\beta\}$, $b:=\max\{\alpha,\beta\}$. \quad Then $a,b\in S$.\\
{\bf Want:} \quad $(\,a<b\,)\quad\&\quad(\,m=\DQ_f(a,b)\,)$.\\
Since $\alpha\ne\beta$, we get: either $\alpha<\beta$ or $\beta<\alpha$.\\
Then: either \qquad $(\,(\,\alpha<\beta\,)\,\&\,(\,a=\alpha\,)\,\&\,(\,b=\beta\,)\,)$\\
\phx\qquad\qquad or \qquad $(\,(\,\beta<\alpha\,)\,\&\,(\,a=\beta\,)\,\&\,(\,b=\alpha\,)\,)$.\\
Then $a<b$. \quad {\bf Want:} $m=\DQ_f(a,b)$.\\
Since $m=\DQ_f(\alpha,\beta)$ and since $\DQ_f(\alpha,\beta)=\DQ_f(\beta,\alpha)$,\\
\phx\qquad it follows that $m=\DQ_f(a,b)$.
\end{proof}

\begin{thm}\wrlab{thm-functional-MVT}
Let $f:\R\drta\R$ and let $I$ be an interval.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $f$ is c/d on $I$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $\DQ_f^I\,\subseteq\,f'_*(\Int\,I)$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall m\in\DQ_f^I$, $m\in f'_*(\Int\,I)$.\\
Given $m\in\DQ_f^I$. \qquad {\bf Want:} $m\in f'_*(\Int\,I)$.\\
By \tref{thm-find-a-lt-b}, choose $a,b\in I$ s.t.~$(\,a<b\,)\quad\&\quad(\,m=\DQ_f(a,b)\,)$.\\
Since $a,b\in I$ and since $I$ is an interval, it follows that $[a|b]\subseteq I$.\\
Since $a<b$, it follows that $[a|b]=[a;b]$. \quad Then $[a;b]\subseteq I$.\\
By assumption, $f$ is c/d on $I$. \quad Then $f$ is c/d on $I$.\\
Then, by the MVT, choose $c\in(a;b)$ s.t.~$f'_c=\DQ_f(a,b)$.\\
Since $[a;b]\subseteq I$, we get $\Int[a;b]\subseteq\Int\,I$.\\
We have $c\in(a;b)=\Int[a;b]\subseteq\Int\,I$, so $c\in\Int\,I$.\\
Since $f$ is c/d on $I$, it follows that $\Int\,I\subseteq\D'_f$.\\
We have $c\in\Int\,I\subseteq\D'_f=\D_{f'}$, so $c\in\D_{f'}$.\\
Since $c\in\Int\,I$ and $c\in\D_{f'}$, we get: $f'_c\in f'_*(\Int\,I)$.\\
Then $m=\DQ_f(a,b)=f'_c\in f'_*(\Int\,I)$.
\end{proof}

\noindent
Combining \tref{thm-precalc-DQ-apps} with \tref{thm-functional-MVT},\\
\phx \quad we get six applications to the MVT,\\
as follows:

\begin{thm}\wrlab{thm-MVT-apps}
Let $f:\R\drta\R$. Let $I$ be an interval.\\
\phx\qquad Assume $f$ is c/d on $I$. \quad Then:\\
\phx\qquad\qquad\qquad $\,$ (i) $[\,(\,f|I\hbox{ is constant}\,)\,\Leftarrow\,(\,f'_*(\Int\,I)\subseteq\{0\}\,)\,]$\\
\phx\qquad\qquad\quad $\&\,\,$ (ii) $[\,(\,f|I\hbox{ is one-to-one}\,)\,\Leftarrow\,(\,0\notin f'_*(\Int\,I)\,)\,]$\\
\phx\qquad\qquad\quad $\&\,\,$ (iii) $[\,(\,f|I\hbox{ is strictly-increasing}\,)\,\Leftarrow\,(\,f'_*(\Int\,I)>0\,)\,]$\\
\phx\qquad\qquad\quad $\&\,\,$ (iv) $[\,(\,f|I\hbox{ is semi-increasing}\,)\,\Leftarrow\,(\,f'_*(\Int\,I)\ge0\,)\,]$\\
\phx\qquad\qquad\quad $\&\,\,$ (v) $[\,(\,f|I\hbox{ is strictly-decreasing}\,)\,\Leftarrow\,(\,f'_*(\Int\,I)<0\,)\,]$\\
\phx\qquad\qquad\quad $\&\,\,$ (vi) $[\,(\,f|I\hbox{ is semi-decreasing}\,)\,\Leftarrow\,(\,f'_*(\Int\,I)\le0\,)\,]$.
\end{thm}

\noindent
Let $f:=(\bullet)^3$ and let $I:=\R$.\\
Then $f$ is one-to-one and strictly-increasing.\\
Also, $0=f'_0\in f'_*(\R)=f'_*(\Int\,I)$, \quad so $\neg(\,f'_*(\Int\,I)>0\,)$.\\
This provides a counterexample to the converse of (ii) in \tref{thm-MVT-apps}\\
and provides a counterexample to the converse of (iii) in \tref{thm-MVT-apps}.\\
\\
Let $f:=-(\bullet)^3$ and let $I:=\R$.\\
Then $f$ is strictly-decreasing.\\
Also, $0=f'_0\in f'_*(\R)=f'_*(\Int\,I)$, \quad so $\neg(\,f'_*(\Int\,I)<0\,)$.\\
This provides a counterexample to the converse of (v) in \tref{thm-MVT-apps}.\\
\\
Unassigned HW:\\
\phx\quad The converses to (i), (iv) and (vi) in \tref{thm-MVT-apps} are all true:

\begin{thm}\wrlab{thm-converses}
Let $f:\R\drta\R$. Let $I$ be an interval.\\
\phx\qquad Assume $f$ is c/d on $I$. \quad Then:\\
\phx\qquad\qquad\qquad $\,$ $[\,(\,f|I\hbox{ is constant}\,)\,\Leftrightarrow\,(\,f'_*(\Int\,I)\subseteq\{0\}\,)\,]$\\
\phx\qquad\qquad\quad $\&\,\,$ $[\,(\,f|I\hbox{ is semi-increasing}\,)\,\Leftrightarrow\,(\,f'_*(\Int\,I)\ge0\,)\,]$\\
\phx\qquad\qquad\quad $\&\,\,$ $[\,(\,f|I\hbox{ is semi-decreasing}\,)\,\Leftrightarrow\,(\,f'_*(\Int\,I)\le0\,)\,]$.
\end{thm}

\subsection{Taylor's Theorem}
\quad
\vskip.1in\noindent
Here is another form of the MVT:

\begin{thm}
Let $f:\R\drta\R$, $a,b\in\R$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $[a|b]\subseteq\D'_f$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $\exists c\in[a|b]$ s.t.~$f_b-f_a=f'_c\cdot(b-a)$.
\end{thm}

\begin{proof}
We have $a,b\in[a|b]\subseteq\D'_f\subseteq\D_f$. Then $f_a,f_b\in\I_f\subseteq\R$.\\
Exactly one of the following is true:\\
\phx\quad (1) $a<b$ \quad or \quad (2) $a=b$ \quad or \quad (3) $a>b$.\\
\\
{\it Case (1):}
Since $a<b$, we have $[a|b]=[a;b]$.\\
Then $[a;b]=[a|b]\subseteq\D'_f$, and so $f$ is c/d on $[a;b]$.\\
By \tref{thm-MVT}, choose $c\in(a;b)$ s.t.~$f'_c=\DQ_f(a,b)$.\\
Then $c\in(a;b)\subseteq[a;b]=[a|b]$. \quad {\bf Want:} $f_b-f_a=f'_c\cdot(b-a)$.\\
By defnition of $\DQ_f(a,b)$, we have $f_b-f_a=(\DQ_f(a,b))\cdot(b-a)$.\\
Then $f_b-f_a=(\DQ_f(a,b))\cdot(b-a)=f'_c\cdot(b-a)$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Since $a=b$, we get $b-a=0$ and $f_b-f_a=0$.\\
Let $c:=a$. \quad Then $c\in[a|b]$. \quad {\bf Want:} $f_b-f_a=f'_c\cdot(b-a)$.\\
We have $c=a\in[a|b]\subseteq\D'_f$, so $f'_c\in\I_{f'}\subseteq\R$, so $0=f'_c\cdot0$.\\
 $f_b-f_a=0=f'_c\cdot0=f'_c\cdot(b-a)$.\\
{\it End of Case (2).}\\
\\
{\it Case (3):}\\
Since $a<b$, we have $[a|b]=[b;a]$.\\
Then $[b;a]=[a|b]\subseteq\D'_f$, and so $f$ is c/d on $[b;a]$.\\
By \tref{thm-MVT}, choose $c\in(b;a)$ s.t.~$f'_c=\DQ_f(b,a)$.\\
Then $c\in(b;a)\subseteq[b;a]=[a|b]$. \quad {\bf Want:} $f_b-f_a=f'_c\cdot(b-a)$.\\
By defnition of $\DQ_f(b,a)$, we have $f_b-f_a=(\DQ_f(b,a))\cdot(b-a)$.\\
Then $f_b-f_a=(\DQ_f(b,a))\cdot(b-a)=f'_c\cdot(b-a)$.\\
{\it End of Case (3).}
\end{proof}

\noindent
The following is Unassigned HW:

\begin{thm}
$\forall x,h\in\R$, $(\,x\in[0|h]\,)\,\Rightarrow\,(\,|x|<|h|\,)$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$, $k\in\N_0$.\\
\phx\qquad\qquad\qquad\qquad\qquad Assume: \quad $(\,f_0=0\,)\,\&\,(\,f'\in\scrlito(k)\,)$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: \qquad $f\in\scrlito(k+1)$.
\end{thm}

\begin{proof}
This is Problem 1 from the Final Exam.
\end{proof}

\begin{thm}
Let $f:\R\drta\R$, $k\in\N_0$.\\
\phx\qquad\qquad\qquad\qquad\qquad Assume: \quad $f_0=f'_0=f''_0=0$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: \qquad $f\in\scrlito(2)$.
\end{thm}

\begin{proof}
This is Problem 2 from the Final Exam.
\end{proof}

\noindent
The following is Unassigned HW:

\begin{thm}
Let $f:\R\drta\R$, $a\in\D'_f$.
Then $D_af=f'_a\cdot(\bullet)$.
\end{thm}

\begin{defn}
Let $f:\R\drta\R$, $a\in\R$, $k\in\N_0$.
Then\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\ds{\boxed{D_a^kf}:=\frac{1}{k!}\cdot f^{(k)}_a\cdot(\bullet)^k}$.
\end{defn}

\noindent
Note: \quad $D_a^0f=C_{f_a}^\R$, \quad $D_a^1f=D_af$, \quad $\ds{D_a^2f=\frac{1}{2}\cdot f''_a\cdot(\bullet)^2}$.\\
Note that $D_a^kf\,\,\,{}^*\!\!\in\,\,\scrh(k)$.\\
\\
Let \quad $f:\R\drta\R$, \quad $k\in\N_0$, \quad $a\in\D_f^{(k)}$.\\
The philosophy of Taylor's theorem is that the best\\
\phx\quad approximation of $f_a^\T$ by\\
\phx\qquad\quad a general (not necessarily homogeneous) $k$th order polynomial\\
\phx\quad is \qquad\qquad\qquad $(D_af)+(D_a^2f)+(D_a^3f)+\cdots+(D_a^kf)$,\\
and the error\\
\phx\qquad\qquad $\,\,\,f_a^\T\,\,-\,\,(\,(D_af)+(D_a^2f)+(D_a^3f)+\cdots+(D_a^kf)\,)$,\\
is ``sub-$k$'', or, in other words, \quad the error is an element of $\scrlito(k)$.\\
We will only prove the Taylor Theorem at second order, {\it i.e.}, for $k=2$,\\
\phx\quad but the proof we give easily generalizes to all $k$.\\
Note: The first order Taylor Theorem is just the assertion that\\
\phx\quad $f_a^\T\,\,-\,\,(D_af)\,\,\in\,\,\scrlito(1)$,\\
which follows from the definition of $D_af$.

\begin{defn}
Let $X$ be a set, $f:\R\drta X$, $a\in\R$.\\
\phx\quad Then $\boxed{f_{a+\bullet}}:\R\drta X$ is defined by: \quad $\forall h\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(f_{a+\bullet})_h\,\,=\,\,f_{a+h}$.
\end{defn}

\begin{thm}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $f_a^\T=f_{a+\bullet}-C_{f_a}^\R$.
\end{thm}

\begin{thm}
Let $f,g:\R\drta\R$, $C\in\scrc$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $f=g-C$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $f'=g'$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall h\in\R$, $f'_h\,\,=\,\,g'_h$.\\
Given $h\in\R$. \quad {\bf Want:} $f'_h\,\,=\,\,g'_h$.\\
Since $C\in\scrc$, we get $C'=\bfzero$. \quad Then $C'_h=0$.\\
Since $f=g-C$, we get $f'_h\,\,\,\,=^*\,\,g'_h-C'_h=g'_h-0=g'_h$.\\
{\bf Want:} $g'_h\,\,\,\,=^*\,\,f'_h$.\\
Since $C\in\scrc$, we get $-C+C=\bfzero$.\\
We have $f+C=g-C+C=g+\bfzero=g$.\\
Since $g=f+C$, we get $g'_h\,\,\,\,=^*\,\,f'_h+C'_h=f'_h+0=f'_h$.
\end{proof}

\begin{thm}\wrlab{thm-dbl-tranl-of-hor-transl}
Let $f:\R\drta\R$, $a,h\in\R$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $(f_{a+\bullet})_h^\T=f_{a+h}^\T$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall k\in\R$, $((f_{a+\bullet})_h^\T)_k\,\,=\,\,(f_{a+h}^\T)_k$.\\
Given $k\in\R$. {\bf Want:} $((f_{a+\bullet})_h^\T)_k\,\,=\,\,(f_{a+h}^\T)_k$.\\
We have $((f_{a+\bullet})_h^\T)_k\,\,=\,\,(f_{a+\bullet})_{h+k}-(f_{a+\bullet})_k$\\
\phx\qquad\qquad\qquad\qquad $\,\,\,=\,\,f_{a+h+k}-f_{a+k}\,\,=\,\,(f_{a+h}^\T)_k$.
\end{proof}

\noindent
We can express the next theorem by saying\\
\phx\quad differentiation commutes with (horizontal) translation.\\
It implies that $f'_{a+\bullet}$ is unambiguous; in principle, it might mean\\
\phx\qquad\qquad $(f_{a+\bullet})'$ \quad or \quad $(f')_{a+\bullet}$,\\
but, according to the theorem, these are equal.

\begin{thm}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad\qquad Then $(f_{a+\bullet})'=(f')_{a+\bullet}$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall h\in\R$, $((f_{a+\bullet})')_h\,\,=\,\,((f')_{a+\bullet})_h$.\\
Given $h\in\R$. \quad {\bf Want:} $((f_{a+\bullet})')_h\,\,=\,\,((f')_{a+\bullet})_h$.\\
{\bf Want:} $((f_{a+\bullet})')_h\,\,=\,\,(f')_{a+h}$. \quad
{\bf Want:} $(f_{a+\bullet})'_h\,\,=\,\,f'_{a+h}$.\\
By \tref{thm-dbl-tranl-of-hor-transl}, $(f_{a+\bullet})_h^\T=f_{a+h}^\T$.\\
Then \quad $\LINS_hf_{a+\bullet}=\{L\in\scrl\,|\,(f_{a+\bullet})_h^\T-L\in\scrlito(1)\}$\\
\phx\qquad\qquad\qquad\qquad $\,=\{L\in\scrl\,|\,f_{a+h}^\T-L\in\scrlito(1)\}=\LINS_{a+h}f$,\\
\phx\qquad so $\LINS_hf_{a+\bullet}=\LINS_{a+h}f$.\\
Then $D_hf_{a+\bullet}\,\,=\,\,\UE(\LINS_h\,f_{a+\bullet})\,\,=\,\,\UE(\LINS_{a+h}\,f)\,\,=\,\,D_{a+h}f$,\\
\phx\quad so $D_hf_{a+\bullet}\,\,=\,\,D_{a+h}f$.\\
Then \qquad $(f_{a+\bullet})'_h\,\,=\,\,[D_hf_{a+\bullet}]\,\,=\,\,[D_{a+h}f]\,\,=\,\,f'_{a+h}$.
\end{proof}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D'_f$.\\
\phx\qquad\qquad\qquad\qquad Then $(f_a^\T)'=f'_{a+\bullet}$.
\end{thm}

\begin{proof}
$(f_a^\T)'=(f_{a+\bullet}-C_{f_a}^\R)'=f'_{a+\bullet}-\bfzero=f'_{a+\bullet}$.
\end{proof}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D'_f$.\\
\phx\qquad\qquad\qquad\qquad Then $(f_a^\T)''=f''_{a+\bullet}$.
\end{thm}

\begin{proof}
$(f_a^\T)''=((f_a^\T)')'=(f'_{a+\bullet})'=f''_{a+\bullet}$.
\end{proof}

\noindent
The next theorem is Unassigned HW:

\begin{thm}\phx\\
\phx\qquad\qquad $($ $\forall m\in\R$, \quad $(m\cdot(\bullet))'=C_m^\R$ $)$ \qquad\qquad and\\
\phx\qquad\qquad $($ $\forall c\in\R$, \quad $(c\cdot(\bullet)^2)'=2\cdot c\cdot(\bullet)$ $)$.
\end{thm}

\noindent
We have a quantified equivalence for $g\supseteq f$:

\begin{thm}
Let $f$ and $g$ be functions.\\
\phx\qquad\qquad Then: \qquad $(\,\,\,g\supseteq f\,\,\,)\,\,\,\Leftrightarrow\,\,\,(\,\,\,\forall x,\,\,\,\,g_x\,\,\,\,=^*\,\,f_x\,\,\,)$.
\end{thm}

\noindent
When a superdomain for $f$ is known,\\
we have another quantified equivalence for $g\supseteq f$:

\begin{thm}
Let $f$ and $g$ be functions. Let $S$ be a set.\\
\phx\qquad\qquad\qquad\qquad\qquad Assume: \quad $\D_f\subseteq S$.\\
\phx\qquad\qquad Then: \qquad $(\,\,\,g\supseteq f\,\,\,)\,\,\,\Leftrightarrow\,\,\,(\,\,\,\forall x\in S,\,\,\,\,g_x\,\,\,\,=^*\,\,f_x\,\,\,)$.
\end{thm}

\begin{thm}\wrlab{thm-near-a-agreement-implies-at-a-deriv-contingent-agreement}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad Assume: \quad near $a$, $f=g$.\\
\phx\qquad Then: \qquad $f'_a\,\,=\,\,g'_a$.
\end{thm}

\begin{proof}
We have: \quad near $0$, $f_a^\T=g_a^\T$.\\
Then, $\forall L\in\scrl$, we have: \quad near $0$, $f_a^\T-L=g_a^\T-L$,\\
\phx\qquad\qquad\quad and so \quad $\,\,\,(\,\,f_a^\T-L\in\scrlito(1)\,\,)\,\,\Leftrightarrow\,\,(\,\,g_a^\T-L\in\scrlito(1)\,\,)$.\\
Then $\LINS_af=\LINS_ag$.\\
Then \quad $f'_a\,\,=\,\,[D_af]\,\,=\,\,[\UE(\LINS_af)]$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,=\!\!\!\!\!{}^*\,\,\,\,\,\,[\UE(\LINS_ag)]\,\,=\,\,[D_ag]\,\,=\,\,g'_a$.
\end{proof}

\begin{thm}\wrlab{thm-restriction-defined-near-a}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad\qquad\qquad Assume: \quad $(\,g\supseteq f\,)$ $\,\&\,$ $(\,f$ is defined near $a\,)$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: \qquad $\,\,\,\,g=f$ near $a$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\begin{thm}
Let $f,g:\R\drta\R$.\\
\phx\qquad\qquad\qquad\qquad\qquad Assume: \quad $g\supseteq f$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: \qquad $g'\supseteq f'$.
\end{thm}

\begin{proof}
{\bf Want:} $\forall a\in\R$, $g'_a\,\,=\,\,f'_a$.\\
Given $a\in\R$. \quad {\bf Want:} $g'_a\,\,=\,\,f'_a$.\\
{\bf Want:} $(\,f'_a\ne\frownie\,)\,\Rightarrow\,(\,g'_a=f'_a\,)$.\\
Assume $f'_a\ne\frownie$. \quad {\bf Want:} $g'_a=f'_a$.\\
Since $f'_a\ne\frownie$, we get $a\in\D'_f$, and so $f$ is defined near $a$.\\
So, since $g\supseteq f$, by \tref{thm-restriction-defined-near-a}, we conclude: $g=f$ near $a$.\\
Then, by \tref{thm-near-a-agreement-implies-at-a-deriv-contingent-agreement}, $g'_a\,\,=\,\,f'_a$.\\
So, since $f'_a\ne\frownie$, we conclude that $g'_a=f'_a$.
\end{proof}

\begin{thm}
Let $f,g:\R\drta\R$. Then $(f+g)'\supseteq f'+g'$.
\end{thm}

\begin{proof}
We have: \quad $\forall x\in\R$, \quad $(f+g)'_x\,\,\,\,=^*\,\,f'_x+g'_x\,\,=\,\,(f'+g')_x$.\\
\phx\qquad\quad Then: \qquad\qquad\qquad $\,\,\,(f+g)'\supseteq f'+g'$.
\end{proof}

\begin{thm}
Let $f,g:\R\drta\R$. Then $(f+g)''\supseteq f''+g''$.
\end{thm}

\begin{proof}
$(f+g)''=((f+g)')'\supseteq(f'+g')'\supseteq f''+g''$.
\end{proof}

\begin{thm}
Let $f,g:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad Then $(f+g)''_a\,\,\,\,=^*\,\,f''_a+g''_a$.
\end{thm}

\begin{proof}
Since $(f+g)''\supseteq f''+g''$,\\
\phx\qquad it follows that $(f+g)''_a\,\,\,\,=^*\,\,(f''+g'')_a$.\\
Then $(f+g)''_a\,\,\,\,=^*\,\,(f''+g'')_a\,\,=\,\,f''_a+g''_a$.
\end{proof}

\noindent
We can now state and prove the \bfindex[Taylor Theorem, second order]:

\begin{thm}
Let $f:\R\drta\R$, $a\in\D''_f$, $L:=D_af$, $Q:=D_a^2f$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: \quad $f_a^\T-L-Q\in\scrlito(2)$.
\end{thm}

\begin{proof}
Let $R:=f_a^\T-L-Q$. \quad {\bf Want:} $R\in\scrlito(2)$.\\
By Final Exam Problem 2, we want: $R_0=R'_0=R''_0=0$.\\
By hypothesis, $a\in\D''_f$. \quad
Then $a\in\D''_f\subseteq\D'_f$. \quad
Then, $\forall h\in\R$,\\
\phx\quad $L_h\,\,=\,\,L_{h\cdot1}\,\,=\,\,h\cdot L_1\,\,=\,\,h\cdot[L]\,\,=\,\,h\cdot[D_af]$\\
\phx\qquad\quad $\,=\!\!\!\!\!{}^*\,\,\,\,\,\,h\cdot f'_a\,\,=\,\,f'_a\cdot h\,\,=\,\,(f'_a\cdot(\bullet))_h$.\\
Then $L=f'_a\cdot(\bullet)$. Then $L'=C_{f'_a}^\R$. Then $L''=0$.\\
Then $L_0=0$ and $L'_0=f'_a$ and $L''_0=0$.\\
By hypothesis, $a\in\D''_f$.\\
We have $Q=D_a^2f=(1/2)\cdot f''_a\cdot(\bullet)^2$.\\
Then $Q=(1/2)\cdot f''_a\cdot(\bullet)^2$. Then $Q'=(1/2)\cdot f''_a\cdot 2\cdot(\bullet)=f''_a\cdot(\bullet)$.\\
Then $Q'=f''_a\cdot(\bullet)$. \quad Then $Q''=C_{f''_a}^\R$.\\
Then $Q_0=0$ and $Q'_0=0$ and $Q''_0=f''_a$.\\
By hypothesis, $a\in\D''_f$. \quad
Then $a\in\D''_f\subseteq\D_f$.\\
Then $(f_a^\T)_0=0$.
So, since $L_0=Q_0=0$, we get $(f_a^\T-L-Q)_0=0$.\\
Then $R_0=(f_a^\T-L-Q)_0=0$. \quad {\bf Want:} $R'_0=R''_0=0$.\\
By hypothesis, $a\in\D''_f$. \quad
Then $a\in\D''_f\subseteq\D'_f$. \quad Then $(f'_{a+\bullet})_0=f'_a$.\\
We have $(f_a^\T)'=f'_{a+\bullet}$. Then $(f_a^\T)'_0\,\,=\,\,(f'_{a+\bullet})_0\,\,=\,\,f'_a$, so $(f_a^\T)'_0=f'_a$.\\
So, since $L'_0=f'_a$ and $Q'_0=0$, we get $(f_a^\T-L-Q)'_0=f'_a-f'_a-0$.\\
Then $R'_0=(f_a^\T-L-Q)'_0=f'_a-f'_a-0=0$. \quad {\bf Want:} $R''_0=0$.\\
By hypothesis, $a\in\D''_f$. \quad Then $(f''_{a+\bullet})_0=f''_a$.\\
We have $(f_a^\T)''=f''_{a+\bullet}$. Then $(f_a^\T)''_0\,\,=\,\,(f''_{a+\bullet})_0\,\,=\,\,f''_a$, so $(f_a^\T)''_0=f''_a$.\\
So, since $L'_0=0$ and $Q'_0=f''_a$, we get $(f_a^\T-L-Q)''_0=f''_a-0-f''_a$.\\
Then $R''_0=(f_a^\T-L-Q)''_0=f''_a-0-f''_a=0$.
\end{proof}

\subsection{The Second Derivative Test}
\quad
\vskip.1in\noindent

\begin{thm}
Let $f:\R\drta\R$, $a\in\D''_f$.\\
\phx\qquad\qquad\qquad Assume: \quad $(\,f'_a=0\,)\,\&\,(\,f''_a>0\,)$.\\
\phx\qquad\qquad\qquad Then: \qquad $f$ has a local strict-minimum at $a$.
\end{thm}

\begin{proof}
This is Problem 3 on the Final Exam.
\end{proof}

\begin{thm}
Let $f:\R\drta\R$, $a\in\D''_f$.\\
\phx\qquad\qquad\qquad Assume: \quad $(\,f'_a=0\,)\,\&\,(\,f''_a<0\,)$.\\
\phx\qquad\qquad\qquad Then: \qquad $f$ has a local strict-maximum at $a$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\subsection{The Inverse Function Theorem}

\begin{thm}
Let $f:\R\drta\R$ be one-to-one. Let $g:=f^{-1}$.\\
\phx\qquad\qquad\qquad Assume: \quad $(\,f_0=0\,)\,\&\,(\,f'_0=3\,)\,\&\,(\,g_0\in\scrlito(0)\,)$.\\
\phx\qquad\qquad\qquad Then: \qquad $g'_0=1/3$.
\end{thm}

\begin{proof}
This is Problem 4 on the Final Exam.
\end{proof}

\begin{thm}\wrlab{thm-inv-fn-thm-00-assume-inverse-is-contin}
Let $f:\R\drta\R$ be one-to-one. Let $g:=f^{-1}$.\\
\phx\qquad\qquad\qquad Assume: \quad $(\,f_0=0\,)\,\&\,(\,f'_0\ne0\,)\,\&\,(\,g_0\in\scrlito(0)\,)$.\\
\phx\qquad\qquad\qquad Then: \qquad $g'_0=1/(f'_0)$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The next theorem is the \bfindex[Precalculus Inverse Function Theorem]:

\begin{thm}\wrlab{thm-precalc-inv-fn-thm}
Let $f:\R\drta\R$ be one-to-one. Let $g:=f^{-1}$.\\
\phx\qquad\qquad\qquad Let $a\in\D_f$. \quad Let $b:=f_a$.\\
\phx\qquad\qquad\qquad Then: \quad $f_a^\T$ is one-to-one \quad and \quad $(f_a^\T)^{-1}=g_b^\T$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The next theorem is called \bfindex[Invariance of Domain, $\R\drta\R$].

\begin{thm}\wrlab{thm-inv-of-dom-rtor}
Let $f:\R\drta\R$ be one-to-one. Let $g:=f^{-1}$.\\
\phx\qquad\qquad\qquad Let $a\in\D_f$. \quad Let $b:=f_a$.\\
\phx\qquad\qquad\qquad Assume: \quad $f$ is continuous near $a$.\\
\phx\qquad\qquad\qquad Then: \qquad $g$ is continuous near $b$.
\end{thm}

\begin{proof}
To be proved in spring semester.
\end{proof}

\noindent
Let $f:\R\drta\R$ be one-to-one. Let $g:=f^{-1}$.\\
Let $a\in\D_f$. \quad Let $b:=f_a$.\\
Then the following are all equivalent:\\
\phx\quad $f^\T_a$ is continuous near $0$.\\
\phx\quad $f$ is continuous near $a$.\\
\phx\quad $g$ is continuous near $b$.\\
\phx\quad $g^\T_b$ is continuous near $0$.

\noindent
There are many theorems called the Inverse Function Theorem.\\
There's the Precalculus Inverse Function Theorem mentioned above.\\
There are topological inverse function theorems,\\
\phx\quad but they're usually called ``Open Mapping Theorems''\\
and we covered one of them above, \tref{thm-open-mapping-theorem-cpt-domain}.\\
Finally, there are a variety of differentiable inverse function theorems.\\
We will call the following theorem\\
\phx\quad the \bfindex[Inverse Function Theorem, first order, $\R\to\R$].

\begin{thm}\wrlab{thm-inv-fn-thm}
Let $f:\R\drta\R$ be one-to-one. Let $g:=f^{-1}$.\\
\phx\qquad\qquad\qquad Let $a\in\D'_f$. \quad Let $b:=f_a$.\\
\phx\qquad\qquad\qquad Assume: \quad $(\,f'_a\ne0\,)\,\&\,(\,f\hbox{ is continuous near }a\,)$.\\
\phx\qquad\qquad\qquad Then: \qquad $g'_b=1/(f'_a)$.
\end{thm}

\begin{proof}
Unassigned HW. Uses \tref{thm-inv-fn-thm-00-assume-inverse-is-contin}.\\
Uses \tref{thm-precalc-inv-fn-thm}, the Precalculus Inverse Function Theorem.\\
Uses \tref{thm-inv-of-dom-rtor}, Invariance of Domain, $\R\drta\R$.
\end{proof}

\noindent
The disadvantage of \tref{thm-inv-fn-thm-00-assume-inverse-is-contin} is:\\
\phx\quad it assumes that $g\in\scrlito(0)$.\\
In a typical inverse problem, much is known about the function $f$,\\
\phx\quad and the GOAL is to understand $g$.\\
In that context, an assumption about $g$ might be difficult to verify.\\
\tref{thm-inv-fn-thm} uses Invariance of Domain to trade in\\
\phx\quad an assumption that $g$ is continuous near $b$\\
for\\
\phx\quad an assumption that $f$ is continuous near $a$.

\section{Integrability of functions $\R\drta\R$}

\subsection{Outer measure}
\quad
\vskip.1in\noindent
We define $\boxed{\infty+\infty}:=\infty$ and $\boxed{\infty-(-\infty)}:=\infty$.\\
For all $x\in\R$, we define\\
\phx\qquad $\boxed{x+\infty}:=\infty$ and $\boxed{\infty+x}:=\infty$ and $\boxed{\infty-x}:=\infty$.\\
For all $x\in\R$, we define\\
\phx\qquad $\boxed{-\infty+x}:=-\infty$ and $\boxed{-\infty-x}:=-\infty$.\\
We define $\boxed{\infty+(-\infty)}:=\frownie$ and $\boxed{(-\infty)+\infty}:=\frownie$.\\
For all $c\in(0;\infty]$, we define $\boxed{c\cdot\infty}:=\infty$ and $\boxed{\infty\cdot c}:=\infty$.\\
For all $c\in(0;\infty]$, we define $\boxed{c\cdot(-\infty)}:=-\infty$ and $\boxed{(-\infty)\cdot c}:=-\infty$.\\
For all $c\in[-\infty;0)$, we define $\boxed{c\cdot\infty}:=-\infty$ and $\boxed{\infty\cdot c}:=-\infty$.\\
For all $c\in[-\infty;0)$, we define $\boxed{c\cdot(-\infty)}:=\infty$ and $\boxed{(-\infty)\cdot c}:=\infty$.\\
We define $\boxed{0\cdot\infty}:=\frownie$ and $\boxed{\infty\cdot0}:=\frownie$.\\
We define $\boxed{0\cdot(-\infty)}:=\frownie$ and $\boxed{(-\infty)\cdot0}:=\frownie$.\\
For all $a\in\R^*$, we define $\boxed{-a}:=(-1)\cdot a$.\\
For all $a,b\in\R^*$, we defein $\boxed{a-b}:=a+(-b)$.

\begin{defn}
Let $a\in[0;\infty]^\N$. Then we define:\\
\phx\qquad\qquad\qquad\qquad $\ds{\boxed{\sum_{j\in\N}\,a}:=\sup\left\{\sum_{j=1}^k\,a_j\,|\,k\in\N\right\}}$.
\end{defn}

\begin{defn}
$\boxed{\scroi}:=\{(a;b)\,|\,a,b\in\R\}$.
\end{defn}

\noindent
That is, $\scroi$ is the set of bounded open intervals.\\
Note that $\emptyset\in\scroi$. We consider $\emptyset$ to be an interval.\\
We define the \bfindex[length] of any interval $I$:

\begin{defn}
Let $I$ be an interval.\\
\phx\qquad If $I=\emptyset$, then $\boxed{\L_I}:=0$.\\
\phx\qquad If $I\ne\emptyset$, then $\boxed{\L_I}:=(\sup I)-(\inf I)$.\\
\end{defn}

\begin{thm}
$\L_{[1;3)}=3-1=2$ and\\
\phx\qquad\qquad\qquad\qquad $\L_{(-\infty;4]}=4-(-\infty)=\infty$.
\end{thm}

\noindent
We define the\\
\phx\qquad\qquad \bfindex[total length] $\TL_U$ and \bfindex[support]  $\supp\,U$\\
of any sequence $U$ of bounded open intervals:

\begin{defn}
Let $U\in\scroi^\N$. Then\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\boxed{TL_U}\quad:=\quad\sum_{j\in\N}\,\L_{U_j}$\\
\phx\qquad\qquad and \qquad\qquad\quad $\,\boxed{\supp\,U}\quad:=\quad\{j\in\N\,|\,U_j\ne\emptyset\}$.
\end{defn}

\noindent
We next define various kinds of \bfindex[open cover]s of $S$:

\begin{defn}
Let $S\subseteq\R$. \quad Then:\\
\phx\qquad $\boxed{\LOC_S}\,\,:=\,\,\{\,U\in\scroi^\N\,|\,\bigcup\I_U\supseteq S\,\}$ \quad and\\
\phx\qquad $\boxed{\JOC_S}\,\,:=\,\,\{\,U\in\scroi^\N\,|\,(\,\bigcup\I_U\supseteq S\,)\,\&\,(\,\#\supp\,U<\infty\,)\,\}$.\\
Also, $\forall k\in\N$,\\
\phx\qquad $\boxed{\JOC_S^k}\,\,:=\,\,\{\,U\in\scroi^\N\,|\,(\,\bigcup\I_U\supseteq S\,)\,\&\,(\,\#\supp\,U\le k\,)\,\}$.
\end{defn}

\noindent
We next define various kinds of \bfindex[overmeasure]s of $S$:

\begin{defn}
Let $S\subseteq\R$. \quad Then:\\
\phx\qquad $\boxed{\TLOC_S}\,\,:=\,\,\{\,\TL_U\,|\,U\in\LOC_S\,\}$ \quad and\\
\phx\qquad $\boxed{\TJOC_S}\,\,:=\,\,\{\,\TL_U\,|\,U\in\JOC_S\,\}$.\\
Also, $\forall k\in\N$,\\
\phx\qquad $\boxed{\TJOC_S^k}\,\,:=\,\,\{\,\TL_U\,|\,U\in\JOC_S^k\,\}$.\\
\end{defn}

\noindent
For any $S\subseteq\R$, we now define\\
\phx\qquad the \bfindex[Lebesgue outer measure] $\LO_S$ of $S$ \qquad and\\
\phx\qquad the \bfindex[Jordan outer measure] $\JO_S$ of $S$ \qquad and\\
\phx\qquad for any $k\in\N$, the \bfindex[Jordan outer $k$-measure] $\JO_S^k$ of $S$\\
as follows:

\begin{defn}
Let $S\subseteq\R$. \quad Then:\\
\phx\qquad\qquad $\boxed{\LO_S}\,\,:=\,\,\inf\,\TLOC_S$ \quad and\\
\phx\qquad\qquad $\boxed{\JO_S}\,\,:=\,\,\inf\,\TJOC_S$.\\
Also, $\forall k\in\N$, we define:\\
\phx\qquad\qquad $\boxed{\JO_S^k}\,\,:=\,\,\inf\,\TJOC_S^k$.\\
\end{defn}

\begin{thm}
Let $S\subseteq\R$, $V\in\scroi^\N$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $\bigcup\I_V\supseteq S$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $TL_V\ge\LO_S$.
\end{thm}

\begin{thm}
Let $S\subseteq\R$, $V\in\scroi^\N$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $\bigcup\I_V\supseteq S$ \quad and \quad $\#\supp\,V<\infty$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $TL_V\ge\JO_S$.
\end{thm}

\begin{thm}
Let $S\subseteq\R$, $V\in\scroi^\N$, $k\in\N$.\\
\phx\qquad\qquad\qquad\qquad Assume: \quad $\bigcup\I_V\supseteq S$ \quad and \quad $\#\supp\,V\le k$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad $TL_V\ge\JO_S^k$.
\end{thm}

\begin{thm}
Let $S\subseteq\R$ be unbounded. Then $\JO_S=\infty$.
\end{thm}

\begin{proof}
We have: $\forall I\in\scroi$, $I$ is bounded.\\
Then $\forall U\in\scroi^\N$, if $\#\supp\,U<\infty$, then $\bigcup\I_U$ is bounded.\\
So, since $S$ is unbounded, we get $\JOC_S=\emptyset$, and so Then $\TJOC_S=\emptyset$.\\
Then $\JO_S=\inf\TJOC_S=\inf\emptyset=\infty$.
\end{proof}

\noindent
The preceding theorem shows, in particular, that $\JO_\Z=\infty$.\\
Unassigned HW: Show that $\LO_\Z=0$.\\
Thus $\JO$ and $\LO$ are different.

\begin{thm}\wrlab{thm-JO1-cpt-intvl}
\phx\\
\phx\qquad $\forall a,b\in\R$, \quad $\JO_{[a|b]}^1\,\ge\,|b-a|$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\begin{thm}\wrlab{thm-k-msr-intvl-bdd-below}
$\forall k\in\N$,\\
\phx\qquad $\forall a,b\in\R$, \quad $\JO_{[a|b]}^k\,\ge\,|b-a|$.
\end{thm}

\begin{proof}
Let $S:=\{k\in\N\,|\,\forall a,b\in\R,\,\JO_{[a|b]}^k\,\ge\,|b-a|\}$.\\
{\bf Want:} $S=\N$. \quad By \tref{thm-JO1-cpt-intvl}, $1\in S$.\\
By the PMI, want: $\forall k\in S$, $k+1\in S$.\\
Given $k\in S$. {\bf Want:} $k+1\in S$.\\
Know: $\forall a,b\in\R$, \quad $\JO_{[a|b]}^k\,\ge\,|b-a|$.\\
{\bf Want:} $\forall a,b\in\R$, \quad $\JO_{[a|b]}^{k+1}\,\ge\,|b-a|$.\\
Know: $\forall y,z\in\R$, \quad $\JO_{[y|z]}^k\,\ge\,|y-z|$.\\
{\bf Want:} $\forall\alpha,\beta\in\R$, \quad $\JO_{[\alpha|\beta]}^{k+1}\,\ge\,|\beta-\alpha|$.\\
Given $\alpha,\beta\in\R$. \quad {\bf Want:} $\JO_{[\alpha|\beta]}^{k+1}\,\ge\,|\beta-\alpha|$.\\
Let $a:=\min\{\alpha,\beta\}$, $b:=\max\{\alpha,\beta\}$. \quad
{\bf Want:} $\JO_{[a;b]}^{k+1}\,\ge\,b-a$.\\
Let $Q:=\TJOC_{[a;b]}^{k+1}$. \quad Then $\inf Q=\JO_{[a;b]}^{k+1}$.\\
{\bf Want:} $\inf Q\ge b-a$. \quad {\bf Want:} $Q\ge b-a$.\\
{\bf Want:} $\forall q\in Q$, $q\ge b-a$.\\
Given $q\in Q$. \quad {\bf Want:} $q\ge b-a$.\\
Since $q\in Q=\TJOC_{[a;b]}^{k+1}$, choose $U\in\JOC_{[a;b]}^{k+1}$ s.t.~$q=\TL_U$.\\
Since $U\in\JOC_{[a;b]}^{k+1}$, we know: $\bigcup\I_U\supseteq[a;b]$ and $\#\supp\,U\le k+1$.\\
Since $\ds{b\in[a;b]\subseteq\bigcup\I_U=\bigcup_{j\in\N}\,U_j}$, \quad choose $j\in\N$ s.t.~$b\in U_j$.\\
Since $U\in\scroi^\N$, we get $U_j\in\scroi$. \quad Choose $s,t\in\R$ s.t.~$U_j=(s;t)$.\\
Since $b\in U_j=(s;t)$, it follows that $(s;t)\ne\emptyset$. \quad Then $s<t$.\\
Since $b\in U_j=(s;t)$, we conclude that $s<b<t$.\\
Recall: $\forall y,z\in\R$, $\JO_{[y|z]}^k\,\ge\,|y-z|$. \qquad Then: $\JO_{[a;s]}^k\,\ge\,|s-a|$.\\
So, since $|s-a|\ge s-a$, we get: \qquad $\JO_{[a;s]}^k\,\ge\,s-a$.\\
Define $V\in\scroi^\N$ by: $\forall i\in\N$, \quad $V_i=\begin{cases}U_i,&\hbox{if }i\ne j\\\emptyset,&\hbox{if }i=j.\end{cases}$\\
Then $\TL_V=\TL_U-\L_{U_j}$ \quad and \quad $\bigcup\I_V\supseteq[a;s]$\\
\phx\qquad\qquad and \quad $\#\supp\,V=(\#\supp\,U)-1\le(k+1)-1=k$.\\
Since $\bigcup\I_V\supseteq[a;s]$ and $\#\supp\,V\le k$, we get: $V\in\JOC_{[a;s]}^k$.\\
Since $V\in\JOC_{[a;s]}^k$, we get $\TL_V\in\TJOC_{[a;s]}^k$, so $\TL_V\ge\inf\TJOC_{[a;s]}^k$.\\
Then $\TL_V\ge\inf\TJOC_{[a;s]}^k=\JO_{[a;s]}^k$, so $\TL_V\ge\JO_{[a;s]}^k$.\\
Since $\TL_V=\TL_U-\L_{U_j}$, we get: $\TL_U=\L_{U_j}+\TL_V$.\\
Since $U_j=(s;t)$ and $s<t$, we get: $\L_{U_j}=t-s$.\\
So, since $\TL_V\ge\JO_{[a;s]}^k\ge s-a$, we get: $\L_{U_j}+\TL_V\ge(t-s)+(s-a)$.\\
Since $b<t$, we get: $t-a>b-a$.\\
Then $\TL_U=\L_{U_j}+\TL_V\ge(t-s)+(s-a)=t-a>b-a$,\\
\phx\qquad\qquad so $\TL_U>b-a$, \quad so $\TL_U\ge b-a$.\\
Then $q=\TL_U\ge b-a$.
\end{proof}

\begin{thm}\wrlab{thm-JO-lower-bd}
Let $a,b\in\R$. Then $\JO_{[a|b]}\ge|b-a|$.
\end{thm}

\begin{proof}
Let $Q:=\TJOC_{[a|b]}$. \quad Then $\inf Q=\JO_{[a|b]}$.\\
{\bf Want:} $\inf Q\ge|b-a|$. \quad {\bf Want:} $Q\ge|b-a|$.\\
{\bf Want:} $\forall q\in Q$, $q\ge b-a$.\\
Given $q\in Q$. \quad {\bf Want:} $q\ge b-a$.\\
Since $q\in Q=\TJOC_{[a|b]}$, choose $U\in\JOC_{[a|b]}$ s.t.~$q=\TL_U$.\\
Since $U\in\JOC_{[a|b]}$, we get $\#\supp\,U<\infty$, so $\#\supp\,U\in\N_0$.\\
Let $k:=\#\supp\,U$. \quad Then $k\in\N_0$.\\
Since $U\in\JOC_{[a|b]}$, we get: $\bigcup\I_U\supseteq[a|b]$.\\
Since $a\in[a|b]$, we get: $[a|b]\ne\emptyset$.\\
So, since $\bigcup\I_U\supseteq[a|b]$, we get $\bigcup\I_U\ne\emptyset$.\\
Since $\ds{\bigcup_{j\in\N}\,U_j=\bigcup\I_U\ne\emptyset}$, we conclude: $\exists j\in\N$ s.t.~$U_j\ne\emptyset$.\\
Then $\supp\,U\ne\emptyset$. \quad Then $\#\supp\,U\ne0$.\\
Since $k\in\N_0$ and since $k=\#\supp\,U\ne0$, we get: $k\in\N$.\\
So, since $k=\#\supp\,U$ and since $\bigcup\I_U\supseteq[a|b]$, we get: $U\in\JOC_{[a|b]}^k$.\\
Then $\TL_U\in\TJOC_{[a|b]}^k$. \qquad
Then $\TL_U\ge\inf\TJOC_{[a|b]}^k$.\\
So, since $\JO_{[a|b]}^k=\inf\TJOC_{[a|b]}^k$, we get $\TL_U\ge\JO_{[a|b]}^k$.\\
By \tref{thm-k-msr-intvl-bdd-below}, we get: $\JO_{[a|b]}^k\ge|b-a|$.\\
Then $\TL_U\ge\JO_{[a|b]}^k\ge|b-a|$.
\end{proof}

\begin{thm}
Let $a\in\R$, $b\ge a$. Then $\JO_{[a;b]}=b-a$.
\end{thm}

\begin{proof}
By \tref{thm-JO-lower-bd}, $\JO_{[a|b]}\ge|b-a|$.\\
Then $\JO_{[a;b]}=\JO_{[a|b]}\ge|b-a|=b-a$. \quad {\bf Want:} $\JO_{[a;b]}\le b-a$.\\
{\bf Want:} $\forall\vep>0$, $\JO_{[a;b]}\le b-a+\vep$.\\
Given $\vep>0$. \quad {\bf Want:} $\JO_{[a;b]}\le b-a+\vep$.\\
Let $I:=(\,a-(\vep/2)\,;\,b+(\vep/2)\,)$. \quad Then $I\supseteq[a;b]$.\\
Let $U\,\,:=\,\,(\,\,I\,\,,\,\,\emptyset\,\,,\,\,\emptyset\,\,,\,\,\emptyset\,\,,\,\,\emptyset\,\,,\,\,\emptyset\,\,,\,\,\ldots\,\,)$.\\
Then $U\in\scroi^\N$ and $\bigcup\I_U=I\cup\emptyset\cup\emptyset\cup\cdots=I\supseteq[a;b]$.\\
Also, since $\supp\,U=\{1\}$, we get $\#\supp\,U<\infty$. \quad Then $U\in\JOC_{[a;b]}$.\\
Then $\TL_U\in\TJOC_{[a;b]}$. \quad Then $\TL_U\ge\inf\TJOC_{[a;b]}$.\\
So, since $\JO_{[a;b]}\inf\TJOC_{[a;b]}$, we get $\TL_U\ge\JO_{[a;b]}$, and so $\JO_{[a;b]}\le\TL_U$.\\
Then $\JO_{[a;b]}\le\TL_U=b-a+\vep$.
\end{proof}

\begin{thm}
Let $a\in\R$. Then $\JO_{\{a\}}=0$.
\end{thm}

\begin{proof}
By the preceding theorem, $\JO_{[a;a]}=a-a$.\\
Then $\JO_{\{a\}}=\JO_{[a;a]}=a-a=0$.
\end{proof}

\noindent
We next show that $\JO$ is monotonic:

\begin{thm}
Let $S,T\subseteq\R$.\\
\phx\qquad\qquad Assume: $T\supseteq S$. \qquad Then: $\JO_T\ge\JO_S$.
\end{thm}

\begin{proof}
Since $T\supseteq S$, it follows that $\JOC_T\subseteq\JOC_S$, so $\TJOC_T\subseteq\TJOC_S$.\\
We have $\TJOC_T\subseteq\TJOC_S\ge\inf\TJOC_S=\JO_S$.\\
Since $\TJOC_T\ge\JO_S$, it follows that $\inf\TJOC_T\ge\JO_S$.\\
Then $\JO_T=\inf\TJOC_T\ge\JO_S$.
\end{proof}

\noindent
We next show that $\JO$ is subadditive:

\begin{thm}
Let $S,T\subseteq\R$. \quad Then $\JO_{S\cup T}\,\,\le\,\,\JO_S\,+\,\JO_T$.
\end{thm}

\begin{proof}
This is HW\#13-1.
\end{proof}

\noindent
The next two theorems are Unassigned HW:

\begin{thm}
Let $I\in\scroi$, $a:=\inf I$, $b:=\sup I$. Then:\\
\phx\qquad\qquad $(\,I=\emptyset\,)\,\Rightarrow\,(\,(a=\infty)\,\&\,(b=-\infty)\,)$ \qquad and\\
\phx\qquad\qquad $(\,I\ne\emptyset\,)\,\Rightarrow\,(\,-\infty<a<b<\infty\,)$ \qquad and\\
\phx\qquad\qquad $I=(a;b)$ \qquad and \qquad $\Cl_I=[a;b]$.
\end{thm}

\begin{thm}
Let $I\in\scroi$, $a:=\inf I$, $b:=\sup I$, $\gamma>0$.\\
\phx\quad Let $J:=(a-\gamma;b+\gamma)$. Then:\\
\phx\qquad\qquad\qquad $(\,I=\emptyset\,)\,\Leftrightarrow\,(\,J=\emptyset\,)$ \qquad and\\
\phx\qquad\qquad $\Cl_I\,\subseteq\,J$ \qquad and \qquad $\L_J\le L_I+2\cdot\gamma$.
\end{thm}

\begin{thm}\wrlab{thm-expandU}
Let $U\in\scroi^\N$, $\vep>0$.\\
\phx\qquad\qquad Then $\exists V\in\scroi^\N$ s.t.\\
\phx\qquad\qquad\qquad\qquad\qquad $\supp\,U=\supp\,V$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall j\in\N$, $\Cl_{U_j}\subseteq V_j$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\TL_V\le\TL_U+\vep$.
\end{thm}

\begin{proof}
Define $a,b\in[-\infty;\infty]^\N$ by: $\forall j\in\N$,\\
\phx\qquad $a_j:=\inf U_j$ \quad and \quad $b_j:=\sup U_j$.\\
Define $s,t\in[-\infty;\infty]^\N$ by: $\forall j\in\N$,\\
\phx\qquad $\ds{s_j:=a_j-\frac{\vep/2}{2^j}}$ \quad and \quad $\ds{t_j:=b_j+\frac{\vep/2}{2^j}}$.\\
Then, $\forall j\in\N$, we have: $(\,U_j=\emptyset\,)\,\Rightarrow\,(\,(s_j=\infty)\,\&\,(t_j=-\infty)\,)$.\\
Then, $\forall j\in\N$, we have: $(\,U_j=\emptyset\,)\,\Rightarrow\,(\,(s_j;t_j)=\emptyset\,)$.\\
Define $V\in\scroi^\N$ by: $\forall j\in\N$, $V_j=(s_j;t_j)$. \quad Then $V\in\scroi^\N$.\\
{\bf Want:} \quad $\,\,\supp\,U=\supp\,V$ \qquad and\\
\phx\quad\qquad\quad $\forall j\in\N$, $\Cl_{U_j}\subseteq V_j$ \qquad and\\
\phx\quad\qquad\quad $\TL_V\le\TL_U+\vep$.\\
We have: $\,$ $\forall j\in\N$,\\
\phx\qquad\qquad\qquad $(\,U_j=\emptyset\,)\,\Leftrightarrow\,(\,V_j=\emptyset\,)$\\
\phx\qquad and \qquad $\Cl_{U_j}=\Cl(\,(\inf U_j;\sup U_j)\,)=\Cl(\,(a_j;b_j)\,)$\\
\phx\qquad\qquad\qquad\qquad $\,=[a_j;b_j]\subseteq(s_j;t_j)=V_j$\\
\phx\qquad and \qquad $\ds{\L_{V_j}\le\L_{U_j}+2\cdot\frac{\vep/2}{2^j}}$.\\
Then: \quad $\,\,\supp\,U=\supp\,V$ \qquad and\\
\phx\quad\qquad\quad $\forall j\in\N$, $\Cl_{U_j}\subseteq V_j$.\\
{\bf Want:} $\TL_V\le\TL_U+\vep$.\\
We have $\ds{\TL_V\,\,\le\,\,\TL_U+2\cdot\left(\sum_{j\in\N}\,\frac{\vep/2}{2^j}\right)}$\\
\phx\qquad\qquad\qquad\qquad $=\,\,\TL_U+2\cdot(\vep/2)\,\,=\,\,\TL_U+\vep$.
\end{proof}

\begin{thm}\wrlab{thm-union-finsupp-closed-is-closed}
Let $U\in\scroi^\N$. Assume $\#\supp\,U<\infty$.\\
\phx\qquad Define $\barU\in(2^\R)^\N$ by: $\forall j\in\N$, $\barU_j=\Cl\,U_j$.\\
\phx\qquad\qquad Then $\bigcup\I_\barU$ is closed.
\end{thm}

\begin{proof}
We have: $\forall i\in\N$, $\barU_i$ is closed.\\
Let $F:=\supp\,U$. Then $F$ is finite.\\
Then $\bigcup_{i\in F}\,\barU_i$ is closed.\\
Since $F=\supp\,U$, we get: $\forall i\in\N\bksl F$, $U_i=\emptyset$.\\
Then \quad $\forall i\in\N\bksl F$, \quad $\barU_i=\Cl\,U_i=\Cl\,\emptyset=\emptyset$.\\
Then \qquad\quad $\,\,\bigcup_{i\in\N}\,\barU_i=\bigcup_{i\in F}\,\barU_i$.\\
Since $\bigcup\I_\barU=\bigcup_{i\in\N}\,\barU_i=\bigcup_{i\in F}\,\barU_i$, \quad
and since $\bigcup_{i\in F}\,\barU_i$ is closed,\\
\phx\qquad we conclude that $\bigcup\I_\barU$ is closed.
\end{proof}

\begin{thm}
Let $S\subseteq\R$. Then $\JO_S=JO_{\Cl\,S}$.
\end{thm}

\begin{proof}
Let $\barS:=\Cl\,S$. \quad {\bf Want:} $\JO_S=\JO_\barS$.\\
Since $S\subseteq\Cl\,S=\barS$, we get $\JO_S\le\JO_\barS$.\\
{\bf Want:} $\JO_\barS\le\JO_S$. \quad We have: $\JO_S=\inf\TJOC_S$.\\
{\bf Want:} $\JO_\barS\le\inf\TJOC_S$. \quad {\bf Want:} $\JO_\barS\le\TJOC_S$.\\
{\bf Want:} $\forall a\in\TJOC_S$, $\JO_\barS\le a$.\\
Given $a\in\TJOC_S$. \qquad {\bf Want:} $\JO_\barS\le a$.\\
Since $a\in\TJOC_S$, choose $U\in\JOC_S$ s.t.~$a=\TL_U$.\\
{\bf Want:} $\JO_\barS\le\TL_U$. \quad {\bf Want:} $\forall\vep>0$, $\JO_\barS\le\TL_U+\vep$.\\
Given $\vep>0$. \quad {\bf Want:} $\JO_\barS\le\TL_U+\vep$.\\
By \tref{thm-expandU}, choose $V\in\scroi^\N$ s.t. \qquad $($ $\supp\,U=\supp\,V$ $)$\\
\phx\quad and \quad $($ $\forall j\in\N,\,\Cl\,U_j\subseteq V_j$ $)$ \quad and \quad $($ $\TL_V\le\TL_U+\vep$ $)$.\\
{\bf Want:} $\JO_\barS\le\TL_V$.\\
Define $\barU\in(2^\R)^\N$ by: $\forall j\in\N$, $\barU_j=\Cl\,U_j$.\\
Since $U\in\JOC_S$, we get: $\bigcup\I_U\supseteq S$ and $\#\supp\,U<\infty$.\\
By \tref{thm-union-finsupp-closed-is-closed}, $\bigcup\I_\barU$ is closed, \quad and so $\Cl\left(\bigcup\I_\barU\right)=\bigcup\I_\barU$.\\
Since \qquad $\forall j\in\N$, $U_j\subseteq\Cl\,U_j=\barU_j$, \qquad we get: $\bigcup\I_U\subseteq\bigcup\I_\barU$.\\
Since \qquad $\forall j\in\N$, $\barU_j=\Cl\,U_j\subseteq V_j$, \qquad we get: $\bigcup\I_\barU\subseteq\bigcup\I_V$.\\
Since $S\subseteq\bigcup\I_U\subseteq\bigcup\I_\barU$, we get: $\Cl\,S\subseteq\Cl\left(\bigcup\I_\barU\right)$.\\
Then $\barS=\Cl\,S\subseteq\Cl\left(\bigcup\I_\barU\right)=\bigcup\I_\barU\subseteq\bigcup\I_V$.\\
So, since $\#\supp\,V=\#\supp\,U<\infty$, we get: $V\in\JOC_\barS$.\\
Then $\TL_V\in\TJOC_\barS$. \quad Then $\TL_V\ge\inf\TJOC_\barS$.\\
Then $\JO_\barS=\inf\TJOC_\barS\le\TL_V$.
\end{proof}

\noindent
For any sets $A$ and $S$,\\
\phx\qquad $\{\,\,S\cap A\,\,,\,\,S\bksl A\,\,\}$ is a partition of $S$,\\
and this would lead us to expect that\\
\phx\qquad\quad $\JO_{S\cap A}+\JO_{S\bksl A}=\JO_S$,\\
but we will soon see that this is not always true.\\
We capture the equation $\JO_{S\cap A}+\JO_{S\bksl A}=\JO_S$ in a definition:

\begin{defn}
Let $A,S\subseteq\R$.\\
\phx\qquad By $A$ \bfindex[splits $S$ well], we mean: \quad $\JO_{S\cap A}+\JO_{S\bksl A}=\JO_S$.
\end{defn}

\noindent
Our focus here is on Jordan measure theory,\\
but we can do something similar for Lebesgue measure:

\begin{defn}
Let $A,S\subseteq\R$.\\
\phx\qquad By $A$ \bfindex[splits $S$ L-well], we mean: \quad $\LO_{S\cap A}+\LO_{S\bksl A}=\LO_S$.
\end{defn}

\noindent
Since $\Cl([0;1]\cap\Q)=[0;1]$,\\
\phx\quad from the preceding theorem, we get: $\JO_{[0;1]\cap\Q}=\JO_{[0;1]}$.\\
So, since $\JO_{[0;1]}=1-0$, we conclude: $\JO_{[0;1]\cap\Q}=1$.\\
Since $\Cl([0;1]\bksl\Q)=[0;1]$,\\
\phx\quad from the preceding theorem, we get: $\JO_{[0;1]\bksl\Q}=\JO_{[0;1]}$.\\
So, since $\JO_{[0;1]}=1-0$, we conclude: $\JO_{[0;1]\bksl\Q}=1$.\\
Then $\{\,\,[0;1]\cap\Q\,\,,\,\,[0;1]\bksl\Q\}$ is a partition of $[0;1]$, but, paradoxically,\\
\phx\qquad\qquad $\JO_{[0;1]\cap\Q}\,\,+\,\,\JO_{[0;1]\bksl\Q}\,\,\ne\,\,\JO_{[0;1]}$.\\
So $\Q$ does NOT split $[0;1]$ well.\\
In this sense, $\Q$ is not a good set\\
\phx\quad from the point of view of Jordan measure.\\
Note that $\Q\cap[7;8]$ splits $[0;1]$ well, because\\
\phx\quad $[0;1]\cap(\Q\cap[7;8])=\emptyset$ \quad and \quad $[0;1]\bksl(\Q\cap[7;8])=[0;1]$.\\
However, there's a {\it different} set that $\Q\cap[7;8]$ does NOT split well.\\
Specifically, $\Q\cap[7;8]$ does NOT split $[7;8]$ well.\\
In this sense, $\Q\cap[7;8]$ is another bad set\\
\phx\qquad from the point of view of Jordan measure.\\
In the next definition, we will formalize the idea that a ``good'' set,\\
\phx\qquad from the point of view of Jordan measure,\\
is one which splits {\it every} subset of $\R$ well.

\begin{defn}
Let $A\subseteq\R$.\\
By $A$ is \bfindex[Carath\'eodory-Jordan measurable] or \bfindex[CJ-measurable],\\
\phx\qquad\qquad we mean: \qquad $\forall S\subseteq\R$, \quad $A$ splits $S$ well.
\end{defn}

\begin{defn}
Let $A\subseteq\R$.\\
By $A$ is \bfindex[Carath\'eodory-Lebesgue measurable] or \bfindex[CL-measurable],\\
\phx\qquad\qquad we mean: \qquad $\forall S\subseteq\R$, \quad $A$ splits $S$ L-well.
\end{defn}

\noindent
We won't be developing Lebesgue measure theory,\\
but we comment that,\\
\phx\quad every CJ-measurable set is CL-measurable,\\
so the Lebesgue theory\\
\phx\qquad has fewer paradoxical decompositions than
the Jordan theory, and is, in that sense, a better theory.
However, it is not perfect:\\
\phx\quad there do exist subsets of $\R$ that are not CL-measurable,\\
but proof of their existence is known to require the Axiom of Choice.\\
So subsets of $\R$ that are not CL-measurable are very obscure.\\
By contrast, it is not hard to describe\\
\phx\qquad subsets of $\R$ (like $\Q$) that are not CJ-measurable.\\
However, we will eventually show that\\
\phx\qquad there is a broad enough collection of CJ-measurable sets\\
to suffice for most applications in the natural sciences.\\
In that sense, Jordan measure theory\\
\phx\qquad\qquad and the corresponding integration theory,\\
\phx\qquad\qquad\qquad which we will soon be describing\\
are good enough for government work.\\
\\
We develop some of the theory of CJ-measurable sets,\\
then use it in showing that every interval is CJ-measurable.\\
We begin by showing that\\
\phx\quad Jordan outer measure is pairwise-additive on CJ-measurable sets:

\begin{thm}\wrlab{thm-pw-additive}
Let $A,B\subseteq\R$.\\
Assume $A$ is CJ-measurable.\\
Assume $A\cap B=\emptyset$. \qquad Then $\JO_{A\cup B}=\JO_A+\JO_B$.
\end{thm}

\noindent
The preceding theorem expresses that Jordan measure is \bfindex[pairwise additive].

\begin{proof}
Let $S:=A\cup B$.\\
Then, because $A\cap B=\emptyset$, it follows that  $S\cap A=A$ and $S\bksl A=B$.\\
Since $A$ is CJ-measurable, $A$ splits $S$ well, so $\JO_S=\JO_{S\cap A}+\JO_{S\bksl A}$.\\
Then $\JO_{A\cup B}=\JO_S=\JO_{S\cap A}+\JO_{S\bksl A}=\JO_A+\JO_B$.
\end{proof}

\noindent
Unassigned HW: Use \tref{thm-pw-additive} and induction on $\#\scrq$ to prove the following.

\begin{thm}
Let $S\subseteq\R$.\\
Let $\scrq$ be a finite partition of $S$ by CJ-measurable sets.\\
\phx\qquad\qquad Then \qquad $\ds{\JO_S=\sum_{A\in\scrq}\,\JO_A}$.
\end{thm}

\noindent
The preceding theorem expresses that Jordan measure is \bfindex[finitely additive].

\begin{defn}
$\forall A\subseteq\R$, $\boxed{A^c}:=\R\bksl A$.
\end{defn}

\noindent
For any $A,S\subseteq\R$, we have: $S\bksl A=S\cap A^c$, and so\\
\phx\quad $A$ splits $S$ well \qquad iff \qquad $\JO_S=\JO_{S\cap A}+\JO_{S\cap A^c}$.

\begin{thm}\wrlab{thm-complements-msbl}
Let $A\subseteq\R$ be CJ-measurable.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $A^c$ is CJ-measurable.
\end{thm}

\begin{proof}
{\bf Want:} $\forall S\subseteq\R$, $A^c$ splits $S$ well.\\
Given $S\subseteq\R$. \quad {\bf Want:} $A^c$ splits $S$ well.\\
{\bf Want:} $\JO_S=\JO_{S\cap A^c}+\JO_{S\cap A^{cc}}$.\\
Since $A$ is CJ-measurable,\\
\phx\quad we conclude that $A$ splits $S$ well,\\
\phx\quad and so $\JO_S=\JO_{S\cap A}+\JO_{S\cap A^c}$.\\
So, since $A=A^{cc}$, we get $\JO_S=\JO_{S\cap A^{cc}}+\JO_{S\cap A^c}$.\\
Then $\JO_S=\JO_{S\cap A^c}+\JO_{S\cap A^{cc}}$.
\end{proof}

\noindent
Unassigned HW. Show: Let $A,B\subseteq\R$. Then\\
\phx\quad $\{\,\,A\cap B\,\,,\,\,A\cap B^c\,\,,\,\,A^c\cap B\,\,,\,\,A^c\cap B^c\,\,\}$\\
is a partition of $\R$.

\begin{thm}\wrlab{thm-fourfold-good-splitting}
Let $A,B\subseteq\R$ both be CJ-measurable.\\
Let \quad $W':=A\cap B$, \quad $\,X':=A\cap B^c$,\\
\phx\qquad $\,\,\,Y':=A^c\cap B$, \quad $Z':=A^c\cap B^c$.\\
Let \quad $W\subseteq W'$, \quad $X\subseteq X'$, \quad $Y\subseteq Y'$, \quad $Z\subseteq Z'$.\\
Then \quad $\JO_{W\cup X\cup Y\cup Z}=\JO_W+\JO_X+\JO_Y+\JO_Z$.
\end{thm}

\begin{proof}
Let $S:=W\cup X\cup Y\cup Z$.
{\bf Want:} $\JO_S=\JO_W+\JO_X+\JO_Y+\JO_Z$.\\
Since $W\subseteq W'$, we get \quad $W\cap W'=W$.\\
We have: $\,\,\{\,\,W'\,\,,\,\,X'\,\,,\,\,Y'\,\,,\,\,Z'\,\}$ is pairwise-disjoint.\\
So, since $W\subseteq W'$, we get:
\quad $W\cap X'=W\cap Y'=W\cap Z'=\emptyset$.\\
Then $\,\,S\cap W'=(W\cup X\cup Y\cup Z)\cap W'$\\
\phx\qquad\qquad\qquad $=(W\cap W')\cup(W\cap X')\cup(W\cap Y')\cup(W\cap Z')$\\
\phx\qquad\qquad\qquad $=W\cup\emptyset\cup\emptyset\cup\emptyset=W$.\\
Similarly, $S\cap X'=X$ and $S\cap Y'=Y$ and $S\cap Z'=Z$.\\
{\bf Want:} $\JO_S=\JO_{S\cap W'}+\JO_{S\cap X'}+\JO_{S\cap Y'}+\JO_{S\cap Z'}$.\\
Because $A$ is CJ-measurable, $A$ splits $S$ well,\\
\phx\quad so $\JO_S=\JO_{S\cap A}+\JO_{S\cap A^c}$.\\
Because $B$ is CJ-measurable, $B$ splits $S\cap A$ well,\\
\phx\quad so $\JO_{S\cap A}=\JO_{S\cap A\cap B}+\JO_{S\cap A\cap B^c}$.\\
Then $\JO_{S\cap A}=\JO_{S\cap W'}+\JO_{S\cap X'}$.\\
Because $B$ is CJ-measurable, $B$ splits $S\cap A^c$ well,\\
\phx\quad so $\JO_{S\cap A^c}=\JO_{S\cap A^c\cap B}+\JO_{S\cap A^c\cap B^c}$.\\
Then $\JO_{S\cap A^c}=\JO_{S\cap Y'}+\JO_{S\cap Z'}$.\\
Then $\,\JO_S=\JO_{S\cap A}+\JO_{S\cap A^c}$\\
\phx\qquad\qquad $\,\,=\JO_{S\cap W'}+\JO_{S\cap X'}+\JO_{S\cap Y'}+\JO_{S\cap Z'}$.
\end{proof}

\begin{thm}\wrlab{thm-intersect-msbl}
Let $A,B\subseteq\R$ both be CJ-measurable.\\
\phx\qquad\qquad\qquad\qquad Then $A\cap B$ is CJ-measurable.
\end{thm}

\begin{proof}
Let \quad $W':=A\cap B$, \quad $\,X':=A\cap B^c$,\\
\phx\qquad\qquad\quad $\,\,\,Y':=A^c\cap B$, \quad $Z':=A^c\cap B^c$.\\
{\bf Want:} $W'$ is CJ-measurable.\\
{\bf Want:} $\forall S\subseteq\R$, $W'$ splits $S$ well.\\
Given $S\subseteq\R$. \quad {\bf Want:} $W'$ splits $S$ well.\\
{\bf Want:} $\JO_S=\JO_{S\cap W'}+\JO_{S\bksl W'}$.\\
Let \quad $W:=S\cap W'$, \quad $\,X:=S\cap X'$,\\
\phx\qquad $\,\,\,Y:=S\cap Y'$, \quad $Z:=S\cap Z'$.\\
Since \qquad\qquad\quad $\,\,\,\{\,\,W'\,\,,\,\,X'\,\,,\,\,Y'\,\,,\,\,Z'\,\,\}$ is a partition of $\R$,\\
\phx\qquad\quad we get: \quad $\{\,\,W\,\,,\,\,\,X\,\,\,,\,\,Y\,\,\,,\,\,\,Z\,\,\,\}$ is a partition of $S$.\\
Then $S\bksl W=X\cup Y\cup Z$. \quad Also, $S\bksl W=S\bksl(S\cap W')=S\bksl W'$.\\
We get: \quad  $\JO_{S\cap W'}=\JO_W$ \quad and \quad $\JO_{S\bksl W'}=\JO_{S\bksl W}=\JO_{X\cup Y\cup Z}$.
{\bf Want:} $\JO_S=\JO_W+\JO_{X\cup Y\cup Z}$.\\
By \tref{thm-fourfold-good-splitting}, we get:\\
\phx\qquad\qquad both \quad $\JO_{W\cup X\cup Y\cup Z}=\JO_W+\JO_X+\JO_Y+\JO_Z$\\
\phx\qquad\qquad and \quad $\,\,\,\JO_{\emptyset\cup X\cup Y\cup Z}=\JO_\emptyset\,+\JO_X+\JO_Y+\JO_Z$.\\
Then: \quad $\,\,$ both \qquad\qquad $\,\,\,\,\JO_S=\JO_W+\JO_X+\JO_Y+\JO_Z$\\
\phx\qquad\qquad and $\,\,$ \quad\quad $\JO_{X\cup Y\cup Z}\,=\,\,\,\,0\,\,\,\,\,+\,\JO_X+\JO_Y+\JO_Z$.\\
Then $\JO_S=\JO_W+\JO_X+\JO_Y+\JO_Z$\\
\phx\qquad\qquad $\,=\JO_W+(0+\JO_X+\JO_Y+\JO_Z)$\\
\phx\qquad\qquad $\,=\JO_W+\JO_{X\cup Y\cup Z}$.
\end{proof}

\begin{thm}
Let $A,B\subseteq\R$ both be CJ-measurable.\\
\phx\qquad\qquad\qquad\qquad Then $A\cap B$, $A\cup B$, $A\bksl B$ are all CJ-measurable.
\end{thm}

\begin{proof}
By \tref{thm-intersect-msbl}, $A\cap B$ is CJ-measurable.\\
{\bf Want:} $A\cup B$, $A\bksl B$ are both CJ-measurable.\\
By \tref{thm-complements-msbl}, we get: $A^c$, $B^c$ are both CJ-measurable.\\
Since $A$, $B^c$ are both CJ-measurable, by \tref{thm-intersect-msbl},\\
\phx\qquad $A\cap B^c$ is CJ-measurable.\\
So, since $A\bksl B=A\cap B^c$, we see that $A\bksl B$ is CJ-measurable.\\
{\bf Want:} $A\cup B$ is CJ-measurable.\\
Since $A^c$ and $B^c$ are both CJ-measurable, by \tref{thm-intersect-msbl},\\
\phx\qquad $A^c\cap B^c$ is CJ-measurable.\\
Then, by \tref{thm-complements-msbl}, $(A^c\cap B^c)^c$ is CJ-measurable.\\
So, since $A\cup B=(A^c\cap B^c)^c$, we see that $A\cup B$ is CJ-measurable.
\end{proof}

\begin{thm}\wrlab{thm-msr-BminusA}
Let $A,B\subseteq\R$.\\
\phx\qquad\qquad\qquad Assume: \quad $A$ is CJ-measurable \quad and \quad $\JO_A<\infty$.\\
\phx\qquad\qquad\qquad Then: \qquad $\JO_{B\bksl A}=\JO_B-\JO_A$.\\
\end{thm}

\begin{proof}
Since $A$ is CJ-measurable, $A$ splits $B$ well,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad so $\,\,\,\,\JO_B=\JO_{B\cap A}+\JO_{B\bksl A}$.\\
Since $A\subseteq B$, we get $B\cap A=A$. \quad
Then $\JO_B=\JO_A+\JO_{B\bksl A}$.\\
So, since $\JO_A<\infty$, we get: $\JO_B-\JO_A=\JO_{B\bksl A}$.\\
Then $\JO_{B\bksl A}=\JO_B-\JO_A$.
\end{proof}

\noindent
We have developed a certain amount of theory about CJ-measurable sets.\\
However, we have yet to produce examples.\\
Our next goal is to show that all intervals are CJ-measurable.\\
We begin by showing, that: $\forall a\in\R$, $\forall U\in\scroi$,\\
\phx\quad the sets $(-\infty;a)$ and $(a;\infty)$ split $U$ well, in length:

\begin{thm}\wrlab{thm-length-splits-well}
Let $U\in\scroi$, $a\in\R$, $A:=(-\infty;a)$, $B:=(a;\infty)$.\\
\phx\qquad\quad Then \quad $(\,U\cap A,U\cap B\in\scroi\,)\quad\&\quad(\,L_U=L_{U\cap A}+L_{U\cap B}\,)$.
\end{thm}

\noindent
Idea of proof:\\
There are two cases: $(\,U=\emptyset\,)\,\vee\,(\,U\ne\emptyset\,)$.\\
The case where $U=\emptyset$ is an exercise for the reader.\\
We concentrate on the case where $U\ne\emptyset$.\\
Choose $s,t\in\R$ s.t.~$s<t$ and $U=(s;t)$.\\
We have $L_U=L_{(s;t)}=\sup_{(s;t)}-\inf_{(s;t)}=t-s$, so $L_U=t-s$.\\
There are three subcases: $(\,a\le s\,)\,\vee\,(\,s<a<t\,)\,\vee(\,t\le a\,)$.\\
The subcases where $a\le s$ or $t\le a$ are exercises for the reader.\\
We concentrate on the case where $s<a<t$.\\
Then $U\cap A=(s;a)$ and $U\cap B=(a;t)$.\\
Then $U\cap A,U\cap B\in\scroi$. \quad {\bf It remains to show:} $L_U=L_{U\cap A}+L_{U\cap B}$.\\
We have $L_{U\cap A}=L_{(s;a)}=\sup_{(s;a)}-\inf_{(s;a)}=a-s$, so $L_{U\cap A}=a-s$.\\
We have $L_{U\cap B}=L_{(a;t)}=\sup_{(a;t)}-\inf_{(a;t)}=t-a$, so $L_{U\cap B}=t-a$.\\
Then $L_{U\cap B}+L_{U\cap A}=(t-a)+(a-s)=t-s=L_U$.\\
Then $L_U=L_{U\cap A}+L_{U\cap B}$. \quad QED

\begin{thm}
Let $A,S\subseteq\R$.\\
\phx\qquad Assume $\JO_S=\infty$. \quad Then $A$ splits $S$ well.
\end{thm}

\begin{proof}
By subadditivity of $\JO$, we get: $\JO_S\le\JO_{S\cap A}+\JO_{S\bksl A}$.\\
{\bf Want:} $\JO_{S\cap A}+\JO_{S\bksl A}\le\JO_S$.\\
We have $\JO_{S\cap A}+\JO_{S\bksl A}\in\R^*\le\infty=\JO_S$.
\end{proof}

\noindent
Because of the preceding theorem,\\
to show that a set $A$ is CJ-measurable,\\
it suffices to show that it splits all\\
\phx\qquad sets of finite outer Jordan measure\\
well; the sets of infinite measure are split well for free.

\begin{thm}
Let $S\subseteq\R$. Then: \quad $S$ is CJ-measurable \quad iff\\
\phx\quad $\forall S\subseteq\R$, \quad $(\,\JO_S<\infty\,)\,\Rightarrow\,(\,A\hbox{ splits }S\hbox{ well}\,)$.
\end{thm}

\begin{thm}\wrlab{thm-lt-a-msbl}
Let $a\in\R$. \quad Then $(-\infty;a)$ is CJ-measurable.
\end{thm}

\begin{proof}
Let $A:=(-\infty;a)$, $B:=(a;\infty)$. \quad {\bf Want:} $A$ is CJ-measurable.\\
{\bf Want:} $\forall S\subseteq\R$, $($ $\JO_S<\infty$ $)$ $\Rightarrow$ $($ $A$ splits $S$ well $)$.\\
Given $S\subseteq\R$. \quad Assume $\JO_S<\infty$. \quad {\bf Want:} $A$ splits $S$ well.\\
{\bf Want:} $\JO_S=\JO_{S\cap A}+\JO_{S\bksl A}$.\\
By HW 13-1, $\JO_S\le\JO_{S\cap A}+\JO_{S\bksl A}$.\\
{\bf Want:} $\JO_{S\cap A}+\JO_{S\bksl A}\le\JO_S$.\\
{\bf Want:} $\forall\vep>0$, \quad $\JO_{S\cap A}+\JO_{S\bksl A}\le\JO_S+\vep$.\\
Given $\vep>0$. \quad {\bf Want:} $\JO_{S\cap A}+\JO_{S\bksl A}\le\JO_S+\vep$.\\
Since $\JO_S=\inf\,\TJOC_S$, we get $\neg(\JO_S+\vep\le\TJOC_S)$.\\
Choose $c\in\TJOC_S$ s.t. $\JO_S+\vep>c$.\\
{\bf Want:} $\JO_{S\cap A}+\JO_{S\bksl A}\le c$.\\
Since $c\in\TJOC_S$, choose $U\in\JOC_S$ s.t.~$c=\TL_U$.\\
Since $U\in\JOC_S$, we get:\\
\phx\quad $U\in\scroi^\N$ and $\#\supp\,U<\infty$ and $\bigcup\I_U\supseteq S$.\\
Define $V,W\in\scroi^\N$ by: $\forall j\in\N$,\\
\phx\qquad\qquad $V_j=U_j\cap A$ \quad and \quad $W_j=U_j\cap B$.\\
Since $\supp\,V\subseteq\supp\,U$, we get $\#\supp\,V\le\#\supp\,U$.\\
We have $\bigcup\I_V=\bigcup_{j\in\N}\,V_j=\bigcup_{j\in\N}\,(U_j\cap A)$\\
\phx\qquad\qquad\qquad $=\left(\bigcup_{j\in\N}U_j\right)\cap A=(\bigcup\I_U)\cap A\supseteq S\cap A$.\\
Then $\bigcup\I_V\supseteq S\cap A$. We also have $\#\supp\,V\le\#\supp\,U<\infty$,\\
\phx\qquad and so we get: $V\in\JOC_{S\cap A}$.\\
Then $\TL_V\in\TJOC_{S\cap A}\ge\inf\TJOC_{S\cap A}=\JO_{S\cap A}$, so $\TL_V\ge\JO_{S\cap A}$.\\
Since $\supp\,W\subseteq\supp\,U$, we get $\#\supp\,W\le\#\supp\,U$.\\
We have $\bigcup\I_W=\bigcup_{j\in\N}\,W_j=\bigcup_{j\in\N}\,(U_j\cap B)$\\
\phx\qquad\qquad\qquad $\,=\left(\bigcup_{j\in\N}U_j\right)\cap B=(\bigcup\I_U)\cap B\supseteq S\cap B$.\\
Then $\bigcup\I_W\supseteq S\cap B$. We also have, $\#\supp\,W\le\#\supp\,U<\infty$,\\
\phx\qquad and so we get: $W\in\JOC_{S\cap B}$.\\
Then $\TL_W\in\TJOC_{S\cap B}\ge\inf\TJOC_{S\cap B}=\JO_{S\cap B}$, so $\TL_W\ge\JO_{S\cap B}$.\\
We have both $\TL_V\ge\JO_{S\cap A}$ and $\TL_W\ge\JO_{S\cap B}$,\\
\phx\qquad\qquad and so $\JO_{S\cap A}+\JO_{S\cap B}\le\TL_V+\TL_W$.\\
By \tref{thm-length-splits-well}, we get: $\forall j\in\N$, $\,$ $L_{U_i}=L_{U_i\cap A}+L_{U_i\cap B}$.\\
Then $\TL_U=\sum_{i\in\N}\,L_{U_i}=\sum_{i\in\N}\,(L_{U_i\cap A}+L_{U_i\cap B})=\sum_{i\in\N}\,(L_{V_i}+L_{W_i})$\\
\phx\qquad\qquad $\,\,=\left(\sum_{i\in\N}\,L_{V_i}\right)+\left(\sum_{i\in\N}\,L_{W_i}\right)=\TL_V+\TL_W$.\\
We have: $\,S\bksl A=S\cap A^c=S\cap[a;\infty)=S\cap(\{a\}\cup(a;\infty))$\\
\phx\qquad\qquad\qquad $=S\cap(\{a\}\cup B)=(S\cap\{a\})\cup(S\cap B)$\\
\phx\qquad\qquad\qquad $\subseteq\{a\}\cup(S\cap B)$.\\
Then $\JO_{S\bksl A}\le\JO_{\{a\}\cup(S\cap B)}$.\\
So, by subadditivity of $\JO$, we get: $\JO_{S\bksl A}\le\JO_{\{a\}}+\JO_{S\cap B}$.\\
We have $\JO_{\{a\}}=\JO_{[a;a]}=a-a=0$. Then $\JO_{S\bksl A}\le\JO_{S\cap B}$.\\
Then $\JO_{S\cap A}+\JO_{S\bksl A}\le\JO_{S\cap A}+\JO_{S\cap B}\le\TL_V+\TL_W=\TL_U=c$.
\end{proof}

\begin{thm}
Let $a\in\R$. Then $[a;\infty)$ is CJ-measurable.
\end{thm}

\begin{proof}
By \tref{thm-lt-a-msbl}, $(-\infty;a)$ is CJ-measurable.\\
Then $(-\infty;a)^c$ is CJ-measurable.\\
So, since $(-\infty;a)^c=[a;\infty)$, we get: $[a;\infty)$ is CJ-measurable.
\end{proof}

\begin{thm}\wrlab{thm-gt-a-msbl}
Let $a\in\R$. Then $(a;\infty)$ is CJ-measurable.
\end{thm}

\begin{proof}
Unassigned HW. Similar to \tref{thm-lt-a-msbl}.
\end{proof}

\begin{thm}
Let $a\in\R$. Then $(-\infty;a]$ is CJ-measurable.
\end{thm}

\begin{proof}
By \tref{thm-gt-a-msbl}, $(a;\infty)$ is CJ-measurable.\\
Then $(a;\infty)^c$ is CJ-measurable.\\
So, since $(a;\infty)^c=(-\infty;a]$, we get: $(-\infty;a]$ is CJ-measurable.
\end{proof}

\begin{thm}
Let $a,b\in\R$. Then $[a;b]$ is CJ-measurable.
\end{thm}

\begin{proof}
Since $(-\infty;b]$ and $[a;\infty)$ are CJ-measurable,\\
\phx\qquad we get: $(-\infty;b]\cap[a;\infty)$ is CJ-measurable.\\
So, since $(-\infty;b]\cap[a;\infty)=[a;b]$, we get: $[a;b]$ is CJ-measurable.
\end{proof}

\begin{thm}
Let $a,b\in\R$. Then $[a;b)$ is CJ-measurable.
\end{thm}

\begin{proof}
Since $(-\infty;b)$ and $[a;\infty)$ are CJ-measurable,\\
\phx\qquad we get: $(-\infty;b)\cap[a;\infty)$ is CJ-measurable.\\
So, since $(-\infty;b)\cap[a;\infty)=[a;b)$, we get: $[a;b)$ is CJ-measurable.
\end{proof}

\begin{thm}
Let $a,b\in\R$. Then $(a;b]$ is CJ-measurable.
\end{thm}

\begin{proof}
Since $(-\infty;b]$ and $(a;\infty)$ are CJ-measurable,\\
\phx\qquad we get: $(-\infty;b]\cap(a;\infty)$ is CJ-measurable.\\
So, since $(-\infty;b]\cap(a;\infty)=(a;b]$, we get: $(a;b]$ is CJ-measurable.
\end{proof}

\begin{thm}
Let $a,b\in\R$. Then $(a;b)$ is CJ-measurable.
\end{thm}

\begin{proof}
Since $(-\infty;b)$ and $(a;\infty)$ are CJ-measurable,\\
\phx\qquad we get: $(-\infty;b)\cap(a;\infty)$ is CJ-measurable.\\
So, since $(-\infty;b)\cap(a;\infty)=(a;b)$, we get: $(a;b)$ is CJ-measurable.
\end{proof}

\noindent
Since $\emptyset=(0;0)$, we get: $\emptyset$ is CJ-measurable.\\
So, since $\emptyset^c=\R$, we get: $\R$ is CJ-measurable.\\
We have now proved: every interval is CJ-measurable.\\
A set of sets is called a \bfindex[ring of sets] if it is closed under\\
\phx\quad pairwise intersection, \quad pairwise union \quad and \quad set subtraction.\\
A set is \bfindex[constructible] if it is in the ring of sets generated by intervals.\\
Sets of use in the natural sciences are typically constructible,\\
\phx\quad and we now know: every constructible set is CJ-measurable.

\begin{thm}
Let $a\in\R$, $b\ge a$. \quad Then:\\
\phx\qquad\quad $\JO_{[a;b]}\,\,=\,\,\JO_{[a;b)}\,\,=\,\,\JO_{(a;b]}\,\,=\,\,\JO_{(a;b)}\,\,=\,\,b-a$.
\end{thm}

\noindent
Idea of proof: \quad
We already proved $\JO_{[a;b]}=b-a$.\\
{\bf Want:} $\JO_{[a;b)}\,\,=\,\,\JO_{(a;b]}\,\,=\,\,\JO_{(a;b)}\,\,=\,\,b-a$.\\
We have $\JO_{\{b\}}=\JO_{[b;b]}=b-b=0$ and $[a;b)=[a;b]\backslash\{b\}$.\\
By \tref{thm-msr-BminusA}, $\JO_{[a;b)}=\JO_{[a;b]}-\JO_{\{b\}}$.\\
Then $\JO_{[a;b)}=\JO_{[a;b]}-\JO_{\{b\}}=b-a+0=b-a$.\\
{\bf Want:} $\JO_{(a;b]}\,\,=\,\,\JO_{(a;b)}\,\,=\,\,b-a$.\\
The rest is left as unassigned Homework. \quad
QED

\subsection{Jordan integration}
\quad
\vskip.1in\noindent
Addition is associative, and so we have:

\begin{thm}\wrlab{thm-sum-fiber-sums-is-total-sum}
Let $\scrp,F$ be finite sets, $\alpha:\scrp\to\R$, $\beta:\scrp\to F$.\\
\phx\qquad\qquad Then \quad $\ds{\sum_{y\in F}\left(\sum_{P\in\beta^*\{y\}}\,\alpha_P\right)=\sum_{P\in\scrp}\,\alpha_P}$.
\end{thm}

\noindent
In \tref{thm-sum-fiber-sums-is-total-sum}, for any $y\in F$,\\
\phx\qquad the sum $\ds{\sum_{P\in\beta^*\{y\}}\,\alpha_P}$ is the ``fiber sum'' of $\alpha$ over $y$.\\
Also, $\ds{\sum_{P\in\scrp}\,\alpha_P}$ is the ``total sum'' of $\alpha$.\\
Then, informally, \tref{thm-sum-fiber-sums-is-total-sum} asserts:\\
\phx\qquad The sum of the fiber sums \quad is equal to \quad the total sum.\\
That is, the total sum can be ``grouped'' into fiber sums, and,\\
by the associative law, the sum is unchanged by that grouping.

\begin{defn}
Let $s$ be a function.
Let $\scrq$ be a partition of $\D_s$.\\
By $s$ is \bfindex[subordinate] to $\scrq$, we mean:\\
\phx\qquad $\forall Q\in\scrq$, \quad $s|Q$ is constant.
\end{defn}

\begin{thm}
Let $s$ be a function.\\
\phx\qquad\qquad\qquad Let $\scrp$ and $\scrq$ be partitions of $\D_s$.\\
Assume \quad $s$ is subordinate to $\scrq$ \quad and \quad $\scrp$ is a refinement of $\scrq$.\\
\phx\qquad\qquad\qquad Then $s$ is subordinate to $\scrp$.
\end{thm}

\begin{defn}
Let $s:\R\drta\R$.\\
By $s$ is \bfindex[J-simple], we mean:\\
\phx\qquad $\exists$finite partition $\scrq$ of $\D_s$ s.t.~$s$ is subordinate to $\scrq$\\
\phx\qquad\qquad and s.t. \quad $\forall Q\in Q$, $\,$ $Q$ is CJ-measurable.
\end{defn}

\begin{defn}
Let $s:\R\drta\R$.\\
By $s$ is \bfindex[L-simple], we mean:\\
\phx\qquad $\exists$countable partition $\scrq$ of $\D_s$ s.t.~$s$ is subordinate to $\scrq$\\
\phx\qquad\qquad and s.t. \quad $\forall Q\in Q$, $\,$ $Q$ is CL-measurable.
\end{defn}

\noindent
We read ``J-simple'' as ``Jordan simple''.\\
We read ``L-simple'' as ``Lebesgue simple''.\\
Any J-simple function $\R\drta\R$ is L-simple.

\begin{thm}
Let $s:\R\drta\R$ be J-simple.
Then $\I_s$ is finite.
\end{thm}

\begin{thm}
Let $s:\R\drta\R$ be L-simple.
Then $\I_s$ is countable.
\end{thm}

\noindent
We now define\\
\phx\qquad the \bfindex[simple integral] of a simple function $s$,\\
denoted $SI_s$, as follows:

\begin{defn}
Let $a\in\R$, $b\ge a$, $s:[a;b]\to\R$.\\
\phx\qquad Assume $s$ is J-simple. \quad Then:\\
\phx\qquad\qquad\qquad $\ds{\boxed{\JI_s}:=\sum_{y\in\I_s}\,(\JO_{s^*\{y\}}\,\cdot\,y)}$.
\end{defn}

\begin{thm}\wrlab{thm-base-measures-from-subordinate-partition}
Let \quad $a\in\R$, \quad $b\ge a$, \quad $s:[a;b]\to\R$.\\
Let $\scrp$ be a finite partition of $[a;b]$.\\
Assume: \quad $s$ is subordinate to $\scrp$.\\
Assume: \quad $\forall P\in\scrp$, $\,$ $P$ is CJ-measurable and nonempty.\\
Define $\beta:\scrp\to\I_s$ by: $\forall P\in\scrp$, $\beta_P=\UE_{s_*P}$.\\
Then: \quad $\forall y\in\I_s$, \quad $\ds{JO_{s^*\{y\}}\,=\,\sum_{P\in\beta^*\{y\}}\,\JO_P}$.
\end{thm}

\noindent
Idea of Proof: \quad
Given $y\in\I_s$. {\bf Want:} $\ds{JO_{s^*\{y\}}\,=\,\sum_{P\in\beta^*\{y\}}\,\JO_P}$.\\
We leave it as an exercise to show that $\beta^*\{y\}$ is a partition of $s^*\{y\}$.\\
Then, by finite additivity of Jordan measure,\\
\phx\quad we get the desired result: $\ds{JO_{s^*\{y\}}\,=\,\sum_{P\in\beta^*\{y\}}\,\JO_P}$. \quad QED

\begin{thm}\wrlab{thm-simple-integration-from-subordinate-partition}
Let \quad $a\in\R$, \quad $b\ge a$, \quad $s:[a;b]\to\R$.\\
Let $\scrp$ be a finite partition of $[a;b]$.\\
Assume: \quad $s$ is subordinate to $\scrp$.\\
Assume: \quad $\forall P\in\scrp$, $\,$ $P$ is CJ-measurable and nonempty.\\
Then: \quad $\ds{\JI_s\,\,=\,\,\sum_{P\in\scrp}\,(\,\JO_P\cdot\UE_{s_*P}\,)}$.
\end{thm}

\begin{proof}
Define $\alpha:\scrp\to\R$ by: $\forall P\in\scrp$, $\alpha_P\,=\,\JO_P\,\cdot\,\UE_{s_*P}$.\\
{\bf Want:} \quad $\ds{\JI_s\,\,=\,\,\sum_{P\in\scrp}\,\alpha_P}$.\\
Define $\beta:\scrp\to\I_s$ by: $\forall P\in\scrp$, $\beta_P=\UE_{s_*P}$.\\
By \tref{thm-base-measures-from-subordinate-partition},\\
\phx\qquad $\forall y\in\I_s$, \quad $\ds{JO_{s^*\{y\}}\,=\,\sum_{P\in\beta^*\{y\}}\,\JO_P}$.\\
Then $\ds{\JI_s\,\,=\,\,\sum_{y\in\I_s}\,\JO_{s^*\{y\}}\,\cdot\,y}$\\
\phx\qquad\qquad $\ds{=\,\,\sum_{y\in\I_s}\,\bigg(\sum_{P\in\beta^*\{y\}}\,JO_P\bigg)\,\cdot\,y}$\\
\phx\qquad\qquad $\ds{=\,\,\sum_{y\in\I_s}\,\sum_{P\in\beta^*\{y\}}\,(\,JO_P\,\cdot\,y\,)}$.\\
We have: $\forall y\in\I_s$, $\forall P\in\beta^*\{y\}$, \quad $\beta_P\in\{y\}$, \quad so $\beta_P=y$.\\
Then $\ds{\JI_s\,\,=\,\,\sum_{y\in\I_s}\,\sum_{P\in\beta^*\{y\}}\,(\,JO_P\,\cdot\,\beta_P\,)}$.\\
By definition of $\beta$, we have: \quad $\forall P\in\scrp$, $\,$ $\beta_P=\UE_{s_*P}$.\\
Then $\ds{\JI_s\,\,=\,\,\sum_{y\in\I_s}\,\sum_{P\in\beta^*\{y\}}\,(\,JO_P\,\cdot\,\UE_{s_*P}\,)}$.\\
By definition of $\alpha$, we have: \quad $\forall P\in\scrp$, $\,$ $\alpha_P=JO_P\,\cdot\,\UE_{s_*P}$.\\
Then $\ds{\JI_s\,\,=\,\,\sum_{y\in\I_s}\,\sum_{P\in\beta^*\{y\}}\,\alpha_P}$.\\
Then, by \tref{thm-sum-fiber-sums-is-total-sum}, we get: \quad $\ds{\JI_s\,\,=\,\,\sum_{P\in\scrp}\,\alpha_P}$.
\end{proof}

\begin{thm}
Let $a\in\R$, $b>a$.\\
Let $s,t:[a;b]\to\R$ both be J-simple.\\
Then: \quad $s+t$ is J-simple \quad and\\
\phx\qquad\qquad\qquad\qquad $\JI_{s+t}=\JI_s+\JI_t$.
\end{thm}

\begin{proof}
Choose a finite partition $\scrp$ of $[a;b]$ s.t.\\
\phx\qquad\qquad\qquad $\forall P\in\scrp$, \quad $P$ is CJ-measurable \quad and\\
\phx\qquad\qquad\qquad $s$ is subordinate to $\scrp$.\\
Choose a finite partition $\scrq$ of $[a;b]$ s.t.\\
\phx\qquad\qquad\qquad $\forall Q\in\scrq$, \quad $Q$ is CJ-measurable \quad and\\
\phx\qquad\qquad\qquad $t$ is subordinate to $\scrq$.\\
Let $\scrr:=\{P\cap Q\,|\,P\in\scrp,\,Q\in\scrq\}^\times_\emptyset$.\\
Then $\scrr$ is a finite partition of $[a;b]$ s.t.\\
\phx\qquad\qquad\qquad $\forall R\in\scrr$, \quad $R$ is nonempty and CJ-measurable \quad and\\
\phx\qquad\qquad\qquad both $s$ and $t$ are subordinate to $\scrp$.\\
Since both $s$ and $t$ are subordinate to $\scrr$,\\
\phx\qquad it follows that $s+t$ is subordinate to $\scrr$.\\
Then $s+t$ is J-simple. \quad {\bf Want:} $\JI_{s+t}=\JI_s+\JI_t$.\\
We have: \quad $\forall R\in\scrr$, \quad $\UE_{(s+t)_*R}\,\,=\,\,\UE_{s_*R}\,\,+\,\,\UE_{t_*R}$.\\
Then: \quad $\forall R\in\scrr$, \quad $\JO_R\,\cdot\,\UE_{(s+t)_*R}\,\,=\,\,\JO_R\,\cdot\,\UE_{s_*R}\,\,+\,\,\JO_R\,\cdot\,\UE_{t_*R}$.\\
Then: \quad $\ds{\sum_{R\in\scrr}\,(\JO_R\,\cdot\,\UE_{(s+t)_*R})}$\\
\phx\qquad\qquad\qquad $\ds{=\,\,\left[\sum_{R\in\scrr}\,(\JO_R\,\cdot\,\UE_{s_*R})\right]\,\,+\,\,\left[\sum_{R\in\scrr}\,(\JO_R\,\cdot\,\UE_{t_*R})\right]}$.\\
Then, by \tref{thm-simple-integration-from-subordinate-partition}, we get: \quad $\JI_{s+t}=\JI_s+\JI_t$.
\end{proof}

\begin{thm}
Let $a\in\R$, $b>a$, $c\in\R$.\\
Let $s:[a;b]\to\R$ be J-simple.\\
Then: \quad $c\cdot s$ is J-simple \quad and \quad $\JI_{c\cdot s}=c\cdot\JI_s$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The preceding two theorems can be summarized by saying:\\
\phx\qquad Jordan simple integration, $\JI$, is algebraically linear.\\
The next theorem says:\\
\phx\qquad Jordan simple integration, $\JI$, is monotonic.

\begin{thm}
Let $a\in\R$, $b>a$, $I:=[a;b]$.\\
Let $s,t:[a;b]\to\R$ both be J-simple.\\
Assume: \quad on $I$, $s\le t$. \qquad
Then $\JI_s\le\JI_t$.
\end{thm}

\begin{proof}
By algebraic linearity of $\JI$, we conclude:\\
\phx\qquad $t-s$ is J-simple \quad and \quad $\JI_{t-s}=\JI_t-\JI_s$.\\
On $I$, we have $t-s\ge0$. \qquad
So, since $\D_{t-s}=I$, we see: \quad $\I_{t-s}\ge0$.\\
Then, by definition of $\JI_{t-s}$, we get: \quad $\JI_{t-s}\ge0$.\\
Then $\JI_t-\JI_s=\JI_{t-s}\ge0$, \quad so $\JI_t\ge\JI_s$, \quad so $\JI_s\le\JI_t$.
\end{proof}

\noindent
The \bfindex[upper simple functions] and \bfindex[lower simple functions]\\
for $f$ on $I$ are\\
\phx\quad those that majorize $f$ \quad and \quad those majorized by $f$\\
on $I$, as follows:

\begin{defn}
Let $a\in\R$, $b\ge a$, $I:=[a;b]$.\\
Let $f:\R\drta\R$. \quad Assume $I\subseteq\D_f$.\\
Then $\boxed{\US_I^f}\,:=\,\{\,\hbox{J-simple }t:I\to\R\,|\,\hbox{on }I,\,f\le t\,\}$.\\
Also, $\boxed{\LS_I^f}\,:=\,\{\,\hbox{J-simple }s:I\to\R\,|\,\hbox{on }I,\,s\le f\,\}$.
\end{defn}

\noindent
The \bfindex[upper simple integrals] and \bfindex[lower simple integrals]\\
for $f$ on $I$ are the Jordan integrals of the\\
\phx\quad upper simple functions \quad and \quad lower simple functions\\
for $f$ on $I$, \quad as follows:

\begin{defn}
Let $a\in\R$, $b\ge a$, $I:=[a;b]$.\\
Let $f:\R\drta\R$. \quad Assume $I\subseteq\D_f$.\\
Then $\boxed{USI_I^f}\,:=\,\{\,\JI_t\,|\,t\in\US_I^f\,\}$.\\
Also, $\boxed{LSI_I^f}\,:=\,\{\,\JI_s\,|\,s\in\LS_I^f\,\}$.
\end{defn}

\noindent
The \bfindex[Jordan upper integral] and \bfindex[Jordan lower integral]\\
for $f$ on $I$ are the \quad infimum \quad and \quad supremum \quad of the\\
\phx\quad upper simple integrals \quad and \quad lower simple integrals\\
for $f$ on $I$, \quad as follows:

\begin{defn}
Let $a\in\R$, $b\ge a$, $I:=[a;b]$.\\
Let $f:\R\drta\R$. \quad Assume $I\subseteq\D_f$.\\
Then \quad $\boxed{\JU_I^f}\,:=\,\inf\,\USI_I^f$ \quad and \quad $\boxed{\JL_I^f}\,:=\,\sup\,\LSI_I^f$.
\end{defn}

\begin{thm}\wrlab{thm-supA-le-infB}
Let $A,B\subseteq\R$.\\
Assume: \qquad $\forall a\in A$, $\forall b\in B$, \quad $a\le b$.\\
Then: \qquad $\sup A\le\inf B$.
\end{thm}

\begin{proof}
We have: \quad $\forall a\in A$, $a\le B$, \quad hence $a\le\inf B$.\\
Then: \qquad $A\le\inf B$, \qquad and so $\sup A\le\inf B$.
\end{proof}

\begin{thm}\wrlab{thm-JL-le-JU}
Let $a\in\R$, $b\ge a$, $I:=[a;b]$.\\
Let $f:\R\drta\R$. \quad Assume $I\subseteq\D_f$.\\
Then $\JL_I^f\le\JU_I^f$.
\end{thm}

\begin{proof}
{\bf Want:} $\sup\LSI_I^f\le\inf\USI_I^f$.\\
By \tref{thm-supA-le-infB}, {\bf it suffices to show:}\\
\phx\quad $\forall a\in\LSI_I^f$, $\forall b\in\USI_I^f$, \quad $a\le b$.\\
Given $a\in\LSI_I^f$, $b\in\USI_I^f$. \quad Want $a\le b$.\\
Since $a\in\LSI_I^f$, choose $s\in\LS_I^f$ s.t.~$a=\JI_s$.\\
Since $b\in\USI_I^f$, choose $t\in\US_I^f$ s.t.~$b=\JI_t$.\\
Since $s\in\LS_I^f$, we have: \quad on $I$, $s\le f$.\\
Since $t\in\US_I^f$, we have: \quad on $I$, $f\le t$.\\
Then \quad on I, $s\le t$.\\
So, by monotonicity of Jordan simple integration, $\JI_s\le\JI_t$.\\
Then $a=\JI_s\le\JI_t=b$.
\end{proof}

\noindent
The next theorem says that $\JL$ and $\JU$ are monontonic:

\begin{thm}\wrlab{thm-monotone-JL-JU}
Let $a\in\R$, $b\ge a$, $I:=[a;b]$, $f,g:\R\drta\R$.\\
\phx\qquad\qquad\qquad Assume: \quad on $I$, $f\le g$.\\
\phx\qquad\qquad\qquad Thene: \qquad $\JL_I^f\le\JL_I^g$ \quad and \quad $\JU_I^f\le\JU_I^g$.
\end{thm}

\begin{proof}
Monotonicity of $\JL$ is Problem 5 on the Final exam.\\
Monotonicity of $\JU$ is Unassigned HW.
\end{proof}

\noindent
When the Jordan upper and lower integrals of $f$ on $I$ agree,\\
that common integral is called the \bfindex[Jordan integral] of $f$ on $I$:

\begin{defn}
Let $a\in\R$, $b\ge a$, $I:=[a;b]$.\\
Let $f:\R\drta\R$. \quad Assume $I\subseteq\D_f$.\\
Then: \quad $\ds{\boxed{\int_If}\,\,:=\,\,\UE\,\{\,\JL_I^f\,,\,\JU_I^f\,\}}$.
\end{defn}

\subsection{Jordan integrability of continuous functions}
\quad
\vskip.1in\noindent
We next show that continuity implies Jordan integrability.\\
This is one of two deep theorems we will cover in Jordan integration,\\
\phx\quad the other being \quad the Fundamental Theorem of Calculus,\\
which will be proved later.

\begin{thm}\wrlab{thm-continuity-implies-integrability}
Let $a\in\R$, $b>a$, $I:=[a;b]$.\\
Let $f:\R\drta\R$. \quad Assume $f$ is continuous on $I$.\\
Then: \quad $\ds{\int_If}\ne\frownie$.
\end{thm}

\begin{proof}
{\bf Want:} $\JL_I^f=\JU_I^f$. \quad
By \tref{thm-JL-le-JU}, $\JL_I^f\le\JU_I^f$.\\
{\bf It suffices to show:} $\JU_I^f\le\JL_I^f$. \quad
{\bf Want:} $\forall\vep>0$, $\JU_I^f\le\JL_I^f+\vep$.\\
Given $\vep>0$. \quad {\bf Want:} $\JU_I^f\le\JL_I^f+\vep$.\\
Since $I=[a;b]$, we see that $I$ is closed and bounded.\\
Then $I$ is compact.\\
Since $f$ is continuous on $I$, it follows that $f|I$ is continuous.\\
Let $g:=f|I$. \quad Then $g$ is continuous.\\
So, since $I$ is compact, by \tref{thm-contin-on-cpt-implies-uc}, $g$ is uniformly continuous.\\
By hypothesis $b>a$. Then $b-a>0$. Then $\vep/(b-a)>0$.\\
By uniform continuity of $g$, choose $\delta>0$ s.t., $\forall w,x\in\D_g$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,|w-x|<\delta\,)\,\Rightarrow\,(\,|g_w-g_x|<\vep/(b-a)\,)$.\\
By the AP, choose $N\in\N$ s.t.~$N>(b-a)/\delta$. \quad Then $(b-a)/N<\delta$.\\
Let $\gamma:=(b-a)/N$. \quad Then $\gamma<\delta$.\\
We have $a+N\cdot\gamma=a+(b-a)=b$.\\
For all $j\in[0..N]$, let $x_j:=a+j\cdot\gamma$.\\
Then $x_0=a$ and $x_N=b$.\\
Also, $\forall j\in[1..N]$, we have $x_j-x_{j-1}=\gamma$.\\
For all $j\in[1..N]$, let $K_j:=[x_{j-1};x_j]$.\\
We have: $\forall j\in[1..N]$, $K_j$ is closed and bounded, hence compact.\\
Let $Q_1:=[x_0;x_1]$. \quad Also, $\forall j\in[2..N]$, let $Q_j:=(x_{j-1};x_j]$.\\
By hypothesis, $I=[a;b]$. Then $\{Q_1,\ldots,Q_N\}$ is a partition of $I$.\\
Moreover, $\forall j\in[1..N]$, $Q_j$ is an interval, so $Q_j$ is CJ-measurable.\\
So, by finite additivity of Jordan measure, $\sum_{j=1}^N\,\JO_{Q_j}=\JO_I$.\\
Also, $\forall j\in[1..N]$, we have: $\JO_{Q_j}=x_j-x_{j-1}$.\\
Then, $\forall j\in[1..N]$, we have: $\JO_{Q_j}=\gamma$.\\
We have: $\forall j\in[1..N]$, $\Cl\,Q_j=[x_{j-1};x_j]=K_j$.\\
For all $j\in[1..N]$, let $y_j:=\min f_*K_j$.\\
For all $j\in[1..N]$, by the EVT, $y_j\ne\frownie$, so choose $u_j\in K_j$ s.t.~$f_{u_j}=y_j$.\\
For all $j\in[1..N]$, let $z_j:=\max f_*K_j$.\\
For all $j\in[1..N]$, by the EVT, $z_j\ne\frownie$, so choose $v_j\in K_j$ s.t.~$f_{v_j}=z_j$.\\
\\
{\it Claim 1:} \quad $\forall j\in[1..N]$, $\,$ $z_j-y_j<\vep/(b-a)$.\\
\\
{\it Proof of Claim 1:}
Given $j\in[1..N]$. {\bf Want:} $z_j-y_j<\vep/(b-a)$.\\
We have: $u_j,v_j\in K_j=[x_{j-1};x_j]$. \quad Then $u_j,v_j\in[x_0;x_N]=[a;b]=I$.\\
Then $u_j,v_j\in[x_{j-1};x_j]$ and $u_j,v_j\in I$.\\
Since $g=f|I$ and since $u_j,v_j\in I$, we get $g_{u_j}=f_{u_j}$ and $g_{v_j}=f_{v_j}$.\\
Since $y_j=\min f_*K_j\le\max f_*K_j=z_j$, we get $|y_j-z_j|=z_j-y_j$.\\
{\bf Want:} $|y_j-z_j|<\vep/(b-a)$.\\
Since $u_j,v_j\in[x_{j-1};x_j]$, we get: \quad $|u_j-v_j|\le x_j-x_{j-1}$.\\
Then $|u_j-v_j|\le x_j-x_{j-1}=\gamma<\delta$.\\
Also, $u_j,v_j\in I=\D_{f|I}=\D_g$.\\
Then, by choice of $\delta$, we have: $|g_{u_j}-g_{v_j}|<\vep/(b-a)$.\\
So, since $y_j=f_{u_j}=g_{u_j}$ and $z_j=f_{v_j}=g_{u_j}$, we get: $|y_j-z_j|<\vep/(b-a)$.\\
{\it End of proof of Claim 1.}\\
\\
Define $s,t:I\to\R$ by: $\forall j\in[1..N]$, $\forall x\in Q_j$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $s_x=y_j$ \quad and \quad $t_x=z_j$.\\
Then $s$ and $t$ are both subordinate to $\{Q_1,\ldots,Q_N\}$.\\
Recall: $\forall j\in[1..N]$, $Q_j$ is CJ-measurable.\\
Then $s$ and $t$ are both J-simple.\\
Also, $\JI_s=\sum_{j=1}^N\,(\JO_{Q_j}\cdot y_j)$ and $\JI_t=\sum_{j=1}^N\,(\JO_{Q_j}\cdot z_j)$.\\
Then $\JI_t-\JI_s=\sum_{j=1}^N(\JO_{Q_j})\cdot(z_j-y_j)$.\\
Then, by Claim 1, $\JI_t-\JI_s\le\sum_{j=1}^N(\,(\JO_{Q_j})\cdot(\vep/(b-a))\,)$.\\
So, since $\sum_{j=1}^N\,\JO_{Q_j}=\JO_I$, we conclude:\\
\phx\quad $\JI_t-\JI_s\le(\JO_I)\cdot(\vep/(b-a))$.\\
So, since $\JO_I=\JO_{[a;b]}=b-a$, we get: $\JI_t-\JI_s\le\vep$.\\
\\
{\it Claim 2:} \quad On $I$, $\,$ $s\le f\le t$.\\
\\
{\it Proof of Claim 2:}
{\bf Want:} $\forall x\in I$, $s_x\le f_x\le t_x$.\\
Given $x\in I$. \quad {\bf Want:} $s_x\le f_x\le t_x$.\\
Since $\{Q_1,\ldots,Q_N\}$ is a partition of $I$ and since $x\in I$,\\
\phx\qquad choose $j\in[1..N]$ s.t.~$x\in Q_j$.\\
Then, by definition of $s$ and $t$, we get $s_x=y_j$ and $t_x=z_j$.\\
We have $x\in Q_j\subseteq\Cl\,Q_j=K_j$, \quad so $x\in K_j$.\\
Since $x\in K_j$, we get $\min f_*K_j\le f_x$.\\
Then $s_x=y_j=\min f_*K_j\le f_x$, \quad so $s_x\le f_x$. \quad {\bf Want:} $f_x\le t_x$.\\
Since $x\in K_j$, we get $f_x\le\max f_*K_j$.\\
Then $f_x\le\max f_*K_j=z_j=t_x$, \quad so $f_x\le t_x$.\\
{\it End of proof of Claim 2.}\\
\\
By Claim 2, we have: \quad on $I$, $s\le f$.\\
So, since $s$ is J-simple, we get $s\in\LS_I^f$.\\
Then $\JI_s\in\LSI_I^f$, so $\JI_s\le\sup\LSI_I^f$.\\
Then $\JI_s\le\sup\LSI_I^f=\JL_I^f$.\\
So, since $\JI_t-\JI_s\le\vep$, we get:\\
\phx\quad $\JI_s+(\JI_t-\JI_s)\le\JL_I^f+\vep$.\\
Then $\JI_t\le\JL_I^f+\vep$.\\
By Claim 2, we have: \quad on $I$, $f\le t$.\\
So, since $t$ is J-simple, we get $t\in\US_I^f$.\\
Then $\JI_t\in\USI_I^f$, so $\JI_t\ge\inf\USI_I^f$.\\
Then $\JI_t\ge\inf\USI_I^f=\JU_I^f$. \qquad
Then $\JU_I^f\le\JI_t$.\\
So, since $\JI_t\le\JL_I^f+\vep$, we get: $\JU_I^f\le\JL_I^f+\vep$.
\end{proof}

\subsection{Cocycle formulas}

\begin{defn}
Let $f:\R\drta\R$, $a,b\in\R$, $I:=[a|b]$.\\
\\
\phx\quad Assume $I\subseteq\D_f$. \qquad
Then $\ds{\boxed{\int_a^b\,f}\,\,\,:=\,\,\,\begin{cases}\ds{\phantom{-}\int_I}\,f,&\hbox{if }a<b\\\qquad\,0,&\hbox{if }a=b\\\ds{\,-\int_I}\,f,&\hbox{if }a>b\end{cases}}$.
\end{defn}

\begin{thm}\wrlab{thm-coycle-special}
Let $a\in\R$, $b\ge a$, $f:\R\drta\R$.\\
\phx\quad Assume $[a;b]\subseteq\D_f$. \quad Let $s,t,u\in[a;b]$. \quad Assume $s\le t\le u$.\\
\phx\qquad\qquad\quad Then $\ds{\int_s^u\,f\,\,\,\,=^*\,\,\left(\int_s^t\,f\right)\,+\,\left(\int_t^u\,f\right)}$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The assumption that $s\le t\le u$ can be relaxed:

\begin{thm}\wrlab{thm-coycle-medium}
Let $a\in\R$, $b\ge a$, $f:\R\drta\R$.\\
\phx\quad Assume $[a;b]\subseteq\D_f$. \quad Let $s,t,u\in[a;b]$. \quad Assume $s\le u$.\\
\phx\qquad\qquad\quad Then $\ds{\int_s^u\,f\,\,\,\,=^*\,\,\left(\int_s^t\,f\right)\,+\,\left(\int_t^u\,f\right)}$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\noindent
The assumption that $s\le u$ can be removed:

\begin{thm}\wrlab{thm-coycle-general}
Let $a\in\R$, $b\ge a$, $f:\R\drta\R$.\\
\phx\qquad Assume $[a;b]\subseteq\D_f$. \qquad Let $s,t,u\in[a;b]$.\\
\phx\qquad\qquad\quad Then $\ds{\int_s^u\,f\,\,\,\,=^*\,\,\left(\int_s^t\,f\right)\,+\,\left(\int_t^u\,f\right)}$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\begin{thm}\wrlab{thm-coycle-continuous}
Let $a\in\R$, $b\ge a$, $f:\R\drta\R$.\\
\phx\qquad Assume $[a;b]\subseteq\D_f^\con$. \qquad Let $s,t,u\in[a;b]$.\\
\phx\qquad\qquad\quad Then $\ds{\int_s^u\,f\,\,\,\,=\,\,\,\,\left(\int_s^t\,f\right)\,+\,\left(\int_t^u\,f\right)}$.
\end{thm}

\begin{proof}
By \tref{thm-coycle-general}, we have:\\
\phx\qquad\qquad\qquad $\ds{\int_s^u\,f\,\,\,\,=^*\,\,\left(\int_s^t\,f\right)\,+\,\left(\int_t^u\,f\right)}$.\\
By \tref{thm-continuity-implies-integrability}, \quad $\ds{\int_s^t\,f\,\,\ne\,\,\frownie\,\,\ne\,\,\int_t^u\,f}$.\\
Then $\ds{\int_s^u\,f\,\,\,\,=\,\,\,\,\left(\int_s^t\,f\right)\,+\,\left(\int_t^u\,f\right)}$.
\end{proof}

\subsection{The Fundamental Theorem of Calculus}

\begin{thm}\wrlab{thm-int-const}
Let $a,b,y\in\R$.
Then: $\ds{\int_a^b\,C_y^\R\,\,\,=\,\,\,(b-a)\cdot y}$.
\end{thm}

\begin{proof}
Unassigned HW.
\end{proof}

\begin{defn}
Let $f:\R\drta\R$, $y\in\R$.
Then $\boxed{f-y}\,\,:=\,\,f-C_y^\R$.
\end{defn}

\begin{thm}
Let $f:\R\drta\R$, $a,y\in\R$, $b\ge a$.\\
\phx\quad Assume $[a;b]\subseteq\D_f^\con$. \quad Then $\ds{\int_a^b\,(f-y)\,\,=\,\,\left(\int_a^b\,f\right)\,-\,y\cdot(b-a)}$.
\end{thm}

\begin{proof}
$\ds{\int_a^b\,(f-y)\,\,=\,\,\int_a^b\,(f-C_y^\R)\,\,=\,\,\left(\int_a^b\,f\right)\,-\,y\cdot(b-a)}$.
\end{proof}

\begin{thm}
Let $a,\in\R$, $b\ge a$, $f,g:\R\drta\R$.\\
\phx\qquad Assume: \quad $(\,[a;b]\subseteq\D_f^\con\cap\D_g^\con\,)\,\&\,(\,\hbox{on }[a;b],\,\,f\le g\,)$.\\
\\
\phx\qquad Then: \qquad $\ds{\int_a^b\,f\,\,\le\,\,\int_a^b\,g}$.
\end{thm}

\begin{proof}
Let $I:=[a;b]$.\\
By \tref{thm-continuity-implies-integrability}, \quad $\ds{\int_a^b\,f\,\,\ne\,\,\frownie\,\,\ne\,\,\int_a^b\,g}$.\\
Then: \quad $\ds{\int_a^b\,f\,\,=\,\,\JL_I\,f}$ \quad and \quad $\ds{\int_a^b\,g\,\,=\,\,\JL_I\,g}$.\\
By \tref{thm-monotone-JL-JU}, $\JL_I\,f\,\,\le\,\,\JL_I\,g$.\\
Then $\ds{\int_a^b\,f\,\,=\,\,\JL_I\,f\,\,\le\,\,\JL_I\,g\,\,=\,\,\int_a^b\,g}$.
\end{proof}

\noindent
The following is the \bfindex[Fundamental Theorem of Calculus]:

\begin{thm}
Let $a\in\R$, $b\ge a$, $f:\R\drta\R$.\\
\phx\qquad\qquad\qquad Assume: \quad $[a;b]\subseteq\D_f^\con$.\\
\phx\qquad\qquad\qquad Define $g:[a;b]\to\R$ by: \quad $\forall x\in[a;b]$, $\ds{g_x=\int_a^x\,f}$.\\
\phx\qquad\qquad\qquad Then: \qquad $\forall x\in(a;b)$, $\,$ $g'_x=f_x$.
\end{thm}

\begin{proof}
Given $x\in(a;b)$. \quad {\bf Want:} $g'_x=f_x$.\\
We have $[D_xg]=g'_x$. \quad {\bf Want:} $[D_xg]=f_x$.\\
Let $y:=f_x$. \quad {\bf Want:} $[D_xg]=y$.\\
Let $L:=y\cdot(\bullet)$.
Then $L\in\scrl$ and $[L]=L_1=y\cdot1=y$.\\
{\bf Want:} $[D_xg]=[L]$. \quad {\bf Want:} $D_xg=L$.\\
We have $\UE(\LINS_xg)=D_xg$. \quad {\bf Want:} $\UE(\LINS_xg)=L$.\\
{\bf Want:} $\LINS_xg=\{L\}$.\\
By uniqueness of linearlization, {\bf it suffices to show:} $L\in\LINS_xg$.\\
{\bf Want:} $g_x^\T-L\in\scrlito(1)$.\\
{\bf Want:} $\forall\vep>0$, $\exists\delta>0$ s.t., $\forall h\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,|h|<\delta\,)\,\Rightarrow\,(\,|(g_x^\T-L)_h|\le\vep\cdot|h|^1\,)$.\\
Given $\vep>0$. \quad {\bf Want:} $\exists\delta>0$ s.t., $\forall h\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,|h|<\delta\,)\,\Rightarrow\,(\,|(g_x^\T-L)_h|\le\vep\cdot|h|^1\,)$.\\
Since $x\in(a;b)$ and since $(a;b)$ is open,\\
\phx\quad choose $\lambda>0$ s.t.~$B(x,\lambda)\subseteq(a;b)$.\\
By hypothesis, $[a;b]\subseteq\D_f^\con$.\\
Since $x\in(a;b)\subseteq[a;b]\subseteq\D_f^\con$, we get: $\,$ $f$ is continuous at $x$.\\
Then choose $\mu>0$ s.t., $\forall w\in\D_f$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,|w-x|<\mu\,)\,\Rightarrow\,(\,|f_w-f_x|<\vep\,)$.\\
Let $\delta:=\min\{\lambda,\mu\}$. \quad
Then $\delta\le\lambda$ and $\delta\le\mu$ and $\delta>0$.\\
{\bf Want:} $\forall h\in\R$, \quad $(\,|h|<\delta\,)\,\Rightarrow\,(\,|(g_x^\T-L)_h|\le\vep\cdot|h|^1\,)$.\\
Given $h\in\R$. \quad Assume $|h|<\delta$. \quad {\bf Want:} $|(g_x^\T-L)_h|\le\vep\cdot|h|^1$.\\
Exactly one of the following is true:\\
\phx\quad (1) $h>0$ \quad or \quad (2) $h=0$ \quad or \quad (3) $h<0$.\\
\\
{\it Case (1):}\\
We have $|(x+h)-x|=|h|<\delta$, so $x+h\in B(x,\delta)$.\\
Then $x,x+h\in B(x,\delta)$.\\
Since $\delta\le\lambda$ and $\delta\le\mu$, it follows that:\\
\phx\qquad $B(x,\delta)\subseteq B(x,\lambda)$ \quad and \quad $B(x,\delta)\subseteq B(x,\mu)$.\\
Then: \quad $x,x+h\in B(x,\lambda)$ \quad and \quad $x,x+h\in B(x,\mu)$.\\
We have $x,x+h\in B(x,\lambda)\subseteq(a;b)\subseteq[a;b]$, so $x,x+h\in[a;b]$.\\
Then $x,x+h\in[a;b]=\D_g$ and $x,x+h\in\R=\D_L$,\\
\phx\quad so $(g_x^\T-L)_h\,\,=\,\,g_{x+h}-g_x-L_h$.\\
We have $\ds{\int_a^{x+h}\,f\,\,=\,\,\left(\int_a^x\,f\right)+\left(\int_x^{x+h}\,f\right)}$,\\
\phx\quad so $\ds{\left(\int_a^{x+h}\,f\right)-\left(\int_a^x\,f\right)\,\,=\,\,\int_x^{x+h}\,f}$.\\
By \tref{thm-int-const}, $\ds{\int_x^{x+h}\,y\,\,=\,\,((x+h)-x)\cdot y}$.\\
Then $\ds{\int_x^{x+h}\,y\,\,=\,\,((x+h)-x)\cdot y\,\,=\,\,y\cdot h\,\,=\,\,(y\cdot(\bullet))_h\,\,=\,\,L_h}$.\\
Then $(g_x^\T-L)_h\,\,=\,\,g_{x+h}-g_x-L_h$\\
\phx\qquad\qquad\qquad\quad $\ds{=\,\,\left(\int_a^{x+h}\,f\right)-\left(\int_a^x\,f\right)-\left(\int_x^{x+h}\,y\right)}$\\
\phx\qquad\qquad\qquad\quad $\ds{=\,\,\left(\int_x^{x+h}\,f\right)-\left(\int_x^{x+h}\,y\right)\,\,=\,\,\int_x^{x+h}\,(f-y)}$.\\
{\bf Want:} $\ds{\left|\int_x^{x+h}\,(f-y)\right|\,\,\le\,\,\vep\cdot|h|^1}$.\\
Since $h>0$, we get $|h|=h$. \quad Then $|h|^1=|h|=h$.\\
{\bf Want:} $\ds{\left|\int_x^{x+h}\,(f-y)\right|\,\,\le\,\,\vep\cdot h}$.\\
{\bf Want:} $\ds{-\vep\cdot h\,\,\le\,\,\int_x^{x+h}\,(f-y)\,\,\le\,\,\vep\cdot h}$.\\
{\bf Want:} $\ds{\int_x^{x+h}\,(-\vep)\,\,\le\,\,\int_x^{x+h}\,(f-y)\,\,\le\,\,\int_x^{x+h}\,\vep}$.\\
{\bf Want:} on $[x;x+h]$, \quad $-\vep\,\,\le\,\,f-y\,\,\le\,\,\vep$.\\
{\bf Want:} $\forall w\in[x;x+h]$, \quad $-\vep\,\,\le\,\,(f-y)_w\,\,\le\,\,\vep$.\\
Given $w\in[x;x+h]$. \quad {\bf Want:} $-\vep\,\,\le\,\,(f-y)_w\,\,\le\,\,\vep$.\\
{\bf Want:} $-\vep\,\,\le\,\,f_w-y\,\,\le\,\,\vep$. \quad
{\bf Want:} $|f_w-y|\,\,\le\,\,\vep$.\\
Recall that $x,x+h\in B(x,\delta)$.\\
Since $B(x,\delta)=(x-\delta;x+\delta)$, we see that $B(x,\delta)$ is an interval.\\
Then $[x|x+h]\subseteq B(x,\delta)$.\\
Since $h>0$, we get $[x|x+h]=[x;x+h]$.\\
Then $w\in[x;x+h]=[x|x+h]\subseteq B(x,\delta)$, so $w\in B(x,\delta)$.\\
Recall: \quad $B(x,\delta)\subseteq B(x,\lambda)$ \quad and \quad $B(x,\delta)\subseteq B(x,\mu)$.\\
By choice of $\lambda$, we have: $B(x,\lambda)\subseteq(a;b)$.\\
By assumption, $[a;b]\subseteq\D_f^\con$.\\
Since $w\in B(x,\delta)\subseteq B(x,\lambda)\subseteq(a;b)\subseteq[a;b]\subseteq\D_f^\con\subseteq\D_f$,\\
\phx\quad we concude that $w\in\D_f$.\\
Since $w\in B(x,\delta)\subseteq B(x,\mu)$, we get: $|w-x|<\mu$.\\
Then, by the choice of $\mu$, we get: $|f_w-f_x|<\mu$.\\
So, since $y=f_x$, we get: $|f_w-y|<\mu$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Unassigned HW.
{\it End of Case (2).}\\
\\
{\it Case (3):}\\
Unassigned HW.
{\it End of Case (3).}
\end{proof}

\vfil\eject

\printindex[terms]

FOR OFFICE USE ONLY: \tref{thm-dbly-quant}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

% The remainder of this file is GNU Emacs commands to set the mode and
% other aspects of the editing session.  These must come at the end of
% the file 

% Local Variables:
% TeX-command-default: "LaTeX"
% TeX-parse-self: t
% TeX-auto-regexp-list:LaTeX-auto-regexp-list
% End:
