%%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]
\newtheorem{thmmain}{\tref{thm-main}} \renewcommand{\thethmmain}{}
\newtheorem{cormain}{\cref{cor-main}} \renewcommand{\thecormain}{}
\newtheorem{lem}[thm]{LEMMA} \newtheorem{rmk}[thm]{REMARK}
\newtheorem{fact}[thm]{FACT} \newtheorem{axiom}[thm]{AXIOM}
\newtheorem{cor}[thm]{COROLLARY} \newtheorem{prop}[thm]{PROPOSITION}
\newtheorem{conj}[thm]{CONJECTURE} \newtheorem{quest}[thm]{QUESTION}
\newtheorem{hyp}[thm]{HYPOTHESES} \newtheorem{thm*}{THEOREM}[]
\newtheorem{defn}[thm]{DEFINITION} \newtheorem{ex}[thm]{EXAMPLE}
\newtheorem{mthm}[thm]{META-THEOREM}

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

\newcommand{\tref}[1]{Theorem~\ref{#1}}
\newcommand{\bftref}[1]{{\bf THEOREM~\ref{#1}}}
\newcommand{\cref}[1]{Corollary~\ref{#1}}
\newcommand{\pref}[1]{Proposition~\ref{#1}}
\newcommand{\dref}[1]{Definition~\ref{#1}}
\newcommand{\lref}[1]{Lemma~\ref{#1}}
\newcommand{\aref}[1]{Axiom~\ref{#1}}
\newcommand{\rref}[1]{Remark~\ref{#1}}
\newcommand{\fref}[1]{Fact~\ref{#1}}
\newcommand{\mtref}[1]{Meta-Theorem~\ref{#1}}
\newcommand{\exref}[1]{Example~\ref{#1}}

% BLACK BOARD BOLD

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

\def\N{{\mathbb N}} \def\Z{{\mathbb Z}} \def\Q{{\mathbb Q}}
\def\R{{\mathbb R}} \def\C{{\mathbb C}} \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}}

% HATTEDCAL
\def\hatscrp{{\widehat{\scrp}}}
\def\hatscrq{{\widehat{\scrq}}}

\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\EUCL{{\rm EUCL}}
\def\TNSR{{\rm TNSR}}
\def\starstar{{**}}
\def\fincap{{\hbox{{\rm fin}}\,\cap}}
\def\fincup{{\hbox{{\rm fin}}\,\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\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}}

%misc
\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{What is Mathematics?}

What is mathematics? What distinguishes it from the many subjects that {\it use} mathematics?
Answer: Mathematics is the study of~absolute truth. Following Antis Pilate, we ask: What is truth?
In the view of the pure mathematician, to distinguish truth from falsehood, we need to have
a precise formal language and a set of~formal rules for identifying which statements are mathematical
statements. Then we need another set of formal rules for proceeding from a collection
of assumed statements, called axioms, to a collection of~statements, called theorems.

In this section, we will outline one way of formalizing the meaning of~a~mathematical statement.
It is not necessarily the easiest formalism to use, but it is relatively easy to describe, and is tailored to
the needs of a real analysis course like this one.
In what follows, by a \bfindex[logic purist], I will mean someone who is ONLY willing to consider the
highly restrictive formalism described in this section.

We will be using the following abbreviations:
\begin{center}
\begin{tabular}{|c|l|}
\hline
 $\forall$ & forall \qquad (or, sometimes, for any) \\ 
\hline
 $\exists$ & there exists \qquad (or, sometimes, there exist) \\ 
\hline
 $\exists1$ & there exists a unique \\ 
\hline
 s.t. & such that \\ 
\hline
 $\neg$ & not \\ 
\hline
 \& & and \\ 
\hline
 $\vee$ & or \\ 
\hline
 $\therefore$ & therefore \\ 
\hline
 $\Rightarrow$ & implies \\ 
\hline
 $\Leftrightarrow$ & if and only if \\ 
\hline
 iff & if and only if \\ 
\hline
 $\in$ & is an element of \\ 
\hline
 $\frownie$ & undefined \\ 
\hline
\end{tabular}
\end{center}

The symbols ``$\forall$'' and ``$\exists$'' are called \bfindex[quantifiers].
The first one, ``$\forall$'', is called the \bfindex[universal quantifier], and the second one,
``$\exists$'', is called the \bfindex[existential quantifier].
The symbol ``$\in$'' is {\it NOT} the Greek letter epsilon, written ``$\varepsilon$''.
Our use of $\frownie$ is unconventional.
We will use it to indicate that some particular
computation cannot be completed in a conventional manner.
So, for example, in this course,
$\,1/0\,=\,\frownie$.

Now let's start with a mathematical sounding statement:
$$\hbox{Every real number is not an integer.}$$
This sentence is quite ambiguous.
It may mean that there are real numbers that are not integers,
or it may mean that no real number is ever an~integer.
Ambiguity is one of the many enemies of truth, and so we need to know
which kinds of statements we even consider worth trying to prove,
and which statements are so poorly worded that it's
a waste of time to even try to understand them.
The statement above would likely lose you some points,
if you write it on homework or an~exam.
Written in a more precise way, it would come out as:
$$\neg\,(\,\forall\hbox{real }x,\quad x\hbox{ an integer})\quad.$$
For our course, this statment will be considered
close enough to a formal mathematical statement that it will be acceptable.
However, once we give our exact definition of a formal statement,
we will see that, to be perfectly correct, we need to say:
$$\neg\,(\,(\forall x)(\,(x\hbox{ is a real number})\,\Rightarrow\,(x\hbox{ is an integer})\,)\,)\qquad.$$

To describe which streams of~symbols are formal statements,
we begin by deciding which symbols
we will use to build such  statements.
In this course, our symbols will come in three types:

First, \bfindex[alphabetic characters]:
\begin{itemize}
\item[]lowercase Roman letters: \quad a,b,c,\ldots,z \qquad ;
\item[]uppercase Roman letters: \quad A,B,C,\ldots,Z \qquad ;
\item[]a blank space to separate words.
\end{itemize}
Later, we may add more (like period and comma) as needed.

Second, \bfindex[variables].
We will use:
\begin{itemize}
\item[]lowercase italic Roman letters: \quad $a$,$b$,$c$,\ldots,$z$ \qquad ;
\item[]uppercase italic Roman letters: \quad $A$,$B$,$C$,\ldots,$Z$ \qquad ;
\item[]uppercase script letters: \quad $\scra$,$\scrb$,$\scrc$,\ldots,$\scrz$ \qquad ;
\item[]lowercase Greek letters: \quad $\alpha$,$\beta$,$\gamma$,\ldots,$\omega$ \qquad ;
\item[]some uppercase Greek letters: \quad $\Gamma$,$\Delta$,$\Theta$,$\Lambda$,$\Xi$,$\Pi$,$\Sigma$,$\Phi$,$\Psi$,$\Omega$.
\end{itemize}
Some uppercase Greek letters look exactly like uppercase Roman letters, {\it e.g.}, a capital $\eta$ is $H$.
They are not exactly omitted from~our~list of variables; they are just not listed twice.
This completes our list of~variables.
The Roman alphabet has $26$ letters.
The Greek alphabet has $24$ letters.
We compute $26+26+26+24+10=112$.
We therefore have $112$ variables to start.
Later, we may add more, as needed.

Third, various \bfindex[special characters]:
\begin{itemize}
\item[]$\forall$\,\,,\,\,$\exists$\,\,,\,\,$($\,\,,\,\,$)$\,\,,\,\,$+$\,\,,\,\,$-$\,\,,\,\,$\cdot$\,\,,\,\,$\in$\,\,,\,\,$\neg$\,\,,\,\,$\&$\,\,,\,\,$\vee$\,\,,\,\,$\Rightarrow$\,\,,\,\,$<$\,\,,\,\,$=$\,\,,\,\,
\item[]$\infty$\,\,,\,\,$\frownie$\,\,,\,\,$0$\,\,,\,\,$1$\,\,,\,\,$2$\,\,,\,\,$3$\,\,,\,\,$4$\,\,,\,\,$5$\,\,,\,\,$6$\,\,,\,\,$7$\,\,,\,\,$8$\,\,,\,\,$9$ \qquad .
\end{itemize}
Later, we may add more, as needed.

Using our characters, we form our list of constants:
\begin{itemize}
\item[]$\infty$\,\,,\,\,$-\infty$\,\,,\,\,$\frownie$\,\,,\,\,$0$\,\,,\,\,$1$\,\,,\,\,$2$\,\,,\,\,$3$\,\,,\,\,$4$\,\,,\,\,$5$\,\,,\,\,$6$\,\,,\,\,$7$\,\,,\,\,$8$\,\,,\,\,$9$ \qquad .
\end{itemize}
Note that most constants are single characters, but character streams, like ``$-\infty$'' are okay, too.
Later, we may add more constants, as needed.

Next, we have our list of ten \bfindex[starter statements].
Keep in~mind that every formal mathematical statement has a list of free variables,
abbreviated ``FV''.
In~each of our ten starter statements, every variable is free.
We will get to more complicated statements later,
and you will see how some variables can fail to be free.
Here are our ten starter statements, together with the list free variables in each:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $x$ is a real number & $x$ \\
\hline
 $j$ is an integer & $j$ \\
\hline
 $S$ is a set & $S$ \\
\hline
 $a=b$ & $a,b$ \\
\hline
 $a\in S$ & $a,S$ \\
\hline
 $x<y$ & $x,y$ \\
\hline
 $x+y=z$ & $x,y,z$ \\
\hline
 $x\cdot y=z$ & $x,y,z$ \\
\hline
 $\UE(S)=a$ & $S,a$ \\
\hline
 $\CH(S)=a$ & $S,a$ \\
\hline
\end{tabular}
\end{center}
These ten character streams are simply declared to be formal statements.
We may add more starter statements, as needed.

If we pick a starter statement, and then replace the variables by variables or constants,
we end up with a \bfindex[atomic statement].
Sometimes, more than one variable is replaced by the same variable,
{\it e.g.}, ``$x<y$'' becomes ``$z<z$'', on replacing both ``$x$'' and ``$y$'' by ``$z$''.
Sometimes, more than one variable is replaced by the same constant,
{\it e.g.}, ``$x<y$'' becomes ``$1<1$'', on replacing both ``$x$'' and ``$y$'' by ``$1$''.
All of the following are ``atomic statements'':
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $a$ is an integer & $a$ \\
\hline
 $b$ is a real number & $b$ \\
\hline
 $\infty$ is a real number & \\
\hline
 $q=q$ & $q$ \\
\hline
 $A\in\scrb$ & $A,\scrb$ \\
\hline
 $-\infty=\infty$ & \\
\hline
 $3<4$ & \\
\hline
 $4<3$ & \\
\hline
 $3<z$ & $z$ \\
\hline
 $x+y=x$ & $x,y$ \\
\hline
 $p\cdot q=1$ & $p,q$ \\
\hline
 $p\cdot p=p$ & $p$ \\
\hline
 $3\cdot4=5$ & \\
\hline
 $3+4=5$ & \\
\hline
\end{tabular}
\end{center}
As you can see, some atomic statements are simply untrue.
Since there are (currently) $112$ variables and $13$ constants,
the starter statement
``$x$~is an integer'' yields $125$ atomic statements.
Similarly, ``$x+y=z$'' yields $125^3=1,953,125$ atomic statements.
Continuing, we see that there are only finitely many atomic statements.
It would not be difficult to write computer code that would print them all out.

There are two general methods by which we can take known statements and develop them into new statements:
\begin{itemize}
\item[(1)]Quantification development \qquad and
\item[(2)]Construction development \qquad .
\end{itemize}

First, \bfindex[quantification development].
This kind of development comes in two types: $\exists$-quantification and $\forall$-quantification.
To illustrate $\exists$-quantification, we will start with:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $r=z$ & $r,z$ \\
\hline
\end{tabular}
\end{center}
We select one of its free variables, say ``$z$''.
We then surround the statement by parentheses.
We then place ``$(\exists z)$'' in front.
We then remove ``$z$'' from the list of free variables, obtaining:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $(\exists z)(r=z)$ & $r$ \\
\hline
\end{tabular}
\end{center}
Next, to illustrate $\forall$-quantification,
we will select the only remaining free variable, ``$r$'',
and then apply $(\forall r)$-quantification, obtaining:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $(\forall r)((\exists z)(r=z))$ & \\
\hline
\end{tabular}
\end{center}
Note that there are now no free variables remaining,
so we cannot apply quantification to this statement.

Second, \bfindex[construction devleopment].
This comes in four types:
\begin{itemize}
\item[]$\neg$-construction \qquad ,
\item[]$\&$-construction \qquad ,
\item[]$\vee$-construction \qquad and
\item[]$\Rightarrow$-construction.
\end{itemize}
To illustrate $\neg$-construction, we will start with the statement
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $a\in B$ & $a,B$\\
\hline
\end{tabular}
\end{center}
We now surround the statement by parentheses.
We then place the symbol ``$\neg$'' in front.
The list of free variables is unchanged:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $\neg(a\in B)$ & $a,B$\\
\hline
\end{tabular}
\end{center}
To illustrate $\&$-construction, we start with two statements:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $a\in B$ & $a,B$\\
\hline
 $s<t$ & $s,t$\\
\hline
\end{tabular}
\end{center}
We now surround each by parentheses,
and concatenate them, but with ``$\&$'' in bewteen.
The free variables are also concatenated:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $(a\in B)\,\&\,(s<t)$ & $a,B,s,t$\\
\hline
\end{tabular}
\end{center}
As you might expect,
$\vee$-construction and $\Rightarrow$-construction work similarly.
Start again with the two statements:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $a\in B$ & $a,B$\\
\hline
 $s<t$ & $s,t$\\
\hline
\end{tabular}
\end{center}
If we apply $\vee$-construction and $\Rightarrow$-construction,
we obtain:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $(a\in B)\,\vee\,(s<t)$ & $a,B,s,t$\\
\hline
 $(a\in B)\Rightarrow(s<t)$ & $a,B,s,t$\\
\hline
\end{tabular}
\end{center}

By a \bfindex[formal statement], we mean a finite sequence of characters (from the character list)
that can be developed from
\begin{itemize}
\item[]the collection of all atomic statements
\end{itemize}
via repeated quantification and construction.
Example:
\begin{itemize}
\item[]$((\forall p)(p<q))\Rightarrow(q=\infty)$ \qquad .
\end{itemize}
To get this formal statement, start with the atomic statement ``$p<q$'',
then use $(\forall p)$-quantification on it, to get ``$(\forall p)(p<q)$''.
Then, using the $\Rightarrow$-construction,
combine that with the atomic statement ``$q=\infty$''.
We will generally leave it as work for the reader to~think about how a particular
formal statement is developed, and about what free variables it has.
In ``$((\forall p)(p<q))\Rightarrow(q=\infty)$''
the only free variable is ``$q$''.
Applying $(\exists q)$-quantification, we get
\begin{itemize}
\item[]$(\exists q)(((\forall p)(p<q))\Rightarrow(q=\infty))$ \qquad ,
\end{itemize}
which is a formal statement that has no~free variables.

Unassigned homework: Write code that would take a string as input and,
after analyzing it, would ouput either\\
\phx\qquad ``the string is not a formal statement'' \qquad\qquad or\\
\phx\qquad ``the string is a formal statement, with free variables:'' \qquad\qquad ,\\
\phx\qquad\qquad followed by a list of\\
\phx\qquad\qquad\qquad all of the free variables in the formal statement \qquad\qquad .
This code implements an algorithm that we will call
the \bfindex[formal statement algorithm].
Once this code is written, a more precise definition of a formal sentence
would simply be a string that, if input into the formal sentence algorithm, yields
``the string is a formal statement, \dots''.

By a \bfindex[formal sentence], we mean a formal statement that has no free variables.
Example: ``$(\exists q)(((\forall p)(p<q))\Rightarrow(q=\infty))$''.
The logic purist would be aghast, but we sometimes replace some parentheses
by~brackets, for readability, {\it e.g.}:
``$(\exists q)([(\forall p)(p<q)]\Rightarrow[q=\infty])$''.

Unassigned homework: Write code that would take a string as input and,
after analyzing it, would ouput either\\
\phx\qquad ``the string is not a formal sentence'' \qquad\qquad or\\
\phx\qquad ``the string is a formal sentence'' \qquad\qquad .\\
This code implements an algorithm that we will call
the \bfindex[formal sentence algorithm].
Once this code is written, a more precise definition of a formal sentence
would simply be a string that, if input into the formal sentence algorithm, yields
``the string is a formal sentence''.

A~\bfindex[formal axiom] means: a formal sentence that is accepted as true without proof.
In the first few weeks of this course, we will be describing various formal sentences as axioms.
Unassigned homework: After those few weeks are over,
write code that would take a string as input and,
after analyzing it, would output either\\
\phx\qquad ``the string is not an axiom'' \qquad\qquad or\\
\phx\qquad ``the string is an axiom'' \qquad\qquad .\\
This code implements an algorithm that we will call
the \bfindex[axiom algorithm].
Once this code is written, a more precise definition of an axiom
would simply be a string that, if input into the axiom algorithm, yields
``the string is an axiom''.

Let's say that two strings are \bfindex[inference ready] if the first\\
\phx\qquad is a finite sequence of formal sentences,\\
\phx\qquad\qquad\qquad separated by commas \qquad ,\\
and the second\\
\phx\qquad is a single formal sentence \qquad .\\
Unassigned homework: After studying truth tables and logical rules of~inference,
write code that would take as input two strings
and, after analyzing them, would output\\
\phx\qquad ``the two strings are not infrence ready'' \qquad or\\
\phx\qquad ``the single sentence follows from the sequence of sentences'' \qquad or\\
\phx\qquad ``the single sentence does not follow\\
\phx\qquad\qquad\qquad  from the sequence of sentences'' \qquad .\\
This code implements an algorithm that we will call the \bfindex[inference algorithm].
Once this code is written, if $\bfP$ and $\bfQ$ are two strings,
then, by $\bfP\models\bfQ$, we mean:
if you input $\bfP$ and $\bfQ$ into the inference algorithm,
the output will be ``the single sentence follows from the sequence of sentences''.
If this code is written correctly, then, for example,\\
\phx\qquad $(2+2=5)\,\vee\,(2+2=4)\,\,,\,\,\neg(2+2=5)\quad\models\quad2+2=4$ \qquad .\\
In fact, part of the coding should enable the inference algorithm to~know that,
for any two formal sentences $\bfS$ and $\bfT$,\\
\phx\qquad $(\bfS)\,\vee\,(\bfT)\,\,,\,\,\neg(\bfS)\quad\models\quad\bfT$ \qquad .\\
Another part of the coding should enable the inference algorithm to~know that,
for any two formal sentences $\bfS$ and $\bfT$,\\
\phx\qquad $(\bfS)\,\Rightarrow\,(\bfT)\,\,,\,\,\bfS\quad\models\quad\bfT$ \qquad .\\
There are a few other logical inferences that will need to be coded into the inference algorithm.
In this course, we will not take the time to write them all out.
However, if you have ever learned to compute truth tables,
then you know enough logic to write the code for the inference algorithm.
Keep in mind that\\
\phx\qquad $(2+2=5)\,\vee\,(2+2=4)\,\,,\,\,\neg(2+2=5)\quad\not\models\quad1+1=2$ \qquad .\\
The inference algorithm should not know how to add, and should not know any mathematics
except for the basics of propositional logic ({\it i.e.},~the logic of truth tables).

A \bfindex[formal proof] is a finite sequence of formal sentences, separated by commas,
such that each one either\\
\phx\qquad is an axiom \qquad or
\phx\qquad follows from earlier sentences according to the inference algorithm \qquad .
In this course, we will not write down any completely formal proofs.
We {\it WILL} develop standards of proof, but not be at~the level required to please the logic purist.
By~a~\bfindex[formal theorem], we mean the last formal sentence in a formal proof.

In this course, we relax standards from ``formal'' to ``pidgin''.
That is, we usually use pidgin statements,
pidgin sentences, pidgin axioms, pidgin theorems, pidgin proofs.
By a \bfindex[pidgin statement], we mean 
\begin{itemize}
\item[]a finite sequence of characters
\end{itemize}
that can be rewritten as a formal statement.
As the course goes on, you should come to understand, better and better, how this rewriting process is done.
In pidgin statements, we will allow a few extra characters, like comma and period.

There are simliar meanings for~\bfindex[pidgin sentences], \bfindex[pidgin axioms], \bfindex[pidgin theorems] and \bfindex[pidgin proofs].
Since we will not be developing formal proofs,
we will not describe how to rewrite a pidgin proof into a formal proof.
However, you should be aware that such rewriting is always possible,
and it is this formalism that makes mathematics rigorous,
even if it only operates in the background.
For more information on formal proofs, read up on~the~foundations of mathematics.

Our first axiom expresses the idea that
\begin{itemize}
\item[]Everything is equal to itself.
\end{itemize}
As written, such a statement is not sufficiently formalized
to be acceptable in this course.
If it were to appear in homework or exams, would result in loss of points.
In pidgin form, it becomes acceptable:

\begin{axiom}\wrlab{axiom-equals-itself}
$\forall x,\qquad x=x$.
\end{axiom}
The logic purist would say ``tsk!'' and insist on a formal statement:
\begin{itemize}
\item[]$(\forall x)(x=x)$ \qquad .
\end{itemize}
We will look at more and more pidgin statements, and rewrite them into formal statements.
Our first theorem:

\begin{thm}\wrlab{thm-symm-of-equality}
$\forall x,y$, \quad $[\,(x=y)\,\Rightarrow\,(y=x)\,]$.
\end{thm}

\begin{proof}
See \tref{thm-symm-of-equality-appendix}.
\end{proof}

Our main focus now is not on proofs,
but on converting from pidgin to formal.
To rewrite \tref{thm-symm-of-equality} as a formal sentence, we start with:
\begin{itemize}
\item[]$(\forall x)(\forall y)([x=y]\Rightarrow[y=x])$ \qquad .
\end{itemize}

To be completely pure, we need to change brackets to parentheses.
Also, following our rules for quantification development,
we should surround ``$(\forall y)((x=y)\Rightarrow(y=x))$''
by parentheses, obtaining:
\begin{itemize}
\item[]$(\forall x)((\forall y)((x=y)\Rightarrow(y=x)))$ \qquad .
\end{itemize}

Our next theorem:
\begin{thm}\wrlab{thm-trans-of-equality}
$\forall x,y,z$, \quad $[\,(x=y=z)\,\Rightarrow\,(x=z)\,]$.
\end{thm}

\begin{proof}
See \tref{thm-trans-of-equality-appendix}.
\end{proof}

To rewrite this as a formal sentence, we start with
\begin{itemize}
\item[]$(\forall x)(\forall y)(\forall z)((x=y=z)\,\Rightarrow\,(x=z))$ \qquad .
\end{itemize}
We should change ``$x=y=z$'' to ``$(x=y)\,\&\,(y=z)$''.
Also, because of the rules of quantification development, we need more parentheses:
\begin{itemize}
\item[]$(\forall x)((\forall y)((\forall z)(((x=y)\,\&\,(y=z))\,\Rightarrow\,(x=z))))$ \qquad .
\end{itemize}

Our first definition:
\begin{defn}\wrlab{defn-ne}
$\forall a,b$, by $a\ne b$ we mean: $\neg(a=b)$.
\end{defn}
In our formalism, the logic purist does not tolerate definitions.
The logic purist would ask that we remove this definition,
and that we
\begin{itemize}
\item extend our
character list to by adding: ``$\ne$'' \qquad ,
\item add a new starter statement: ``$a\ne b$'' \qquad and
\item put in a new axiom: \quad
$(\forall a)((\forall b)([a\ne b]\Leftrightarrow[\neg(a=b)]))$ \quad .
\end{itemize}
This would be followed replacement of brackets by parentheses.
Also, the ``$\Leftrightarrow$'' needs to be broken into two implications,
yielding:
$$(\forall a)((\forall b)(((a\ne b)\Rightarrow(\neg(a=b)))\,\&\,((\neg(a=b))\Rightarrow(a\ne b))))\quad.$$
But who can read such dense code?

Finally, let's look at:

\begin{thm}\wrlab{thm-eg1-deltaformula-lt-epsilon-preview}
$\forall\varepsilon>0$,
$\exists\delta>0$~s.t.~$\delta^2+\delta\le\varepsilon$.
\end{thm}

By convention, in this course,
``$\forall\varepsilon>0$'' means
``$\forall$real $\varepsilon>0$''.
Also,
``$\exists\delta>0$'' means
``$\exists$real $\delta>0$.
The logic purist would prefer:
\begin{itemize}
\item[]$(\forall\varepsilon)\,(\,[\,(\,\varepsilon\hbox{ is a real number}\,)\,\&\,(\,\varepsilon>0\,)\,]\Rightarrow\,[$
\item[]$(\exists\delta)\,(\,[\,(\,\delta\hbox{ is a real number}\,)\,\&\,(\,\delta>0\,)\,]\&\,[$
\begin{itemize}
\item[]\qquad\qquad $\delta^2+\delta\le\varepsilon$
\end{itemize}
\item[]\qquad\qquad\qquad\qquad $]\,)\,]\,)$ \qquad .
\end{itemize}
The logic purist would replace the text ``$\delta^2+\delta\le\varepsilon$'' by something like:
\begin{itemize}
\item[]$\exists$real $a,L\hbox{ is a real number}$~s.t.
\item[]\qquad$(\,(\,\delta\cdot\delta=a\,)\,\&\,\,(\,a+\delta=L\,)\,)\,\&\,(\,(\,L<\varepsilon\,)\,\vee\,(\,L=\varepsilon\,)\,)$ \qquad .
\end{itemize}
After a bit more ``tsk!''ing, we get to
\begin{itemize}
\item[]$(\forall\varepsilon)\,(\,[\,(\,\varepsilon\hbox{ is a real number}\,)\,\&\,(\,\varepsilon>0\,)\,]\Rightarrow\,[$
\item[]$(\exists\delta)\,(\,[\,(\,\delta\hbox{ is a real number}\,)\,\&\,(\,\delta>0\,)\,]\&\,[$
\item[]$(\exists a)\,(\,[\,a\hbox{ is a real number}\,]\,\&\,[$
\item[]$(\exists L)\,(\,[\,L\hbox{ is a real number}\,]\,\&\,[$
\begin{itemize}
\item[]$(\,(\,\delta\cdot\delta=a\,)\,\&\,(\,a+\delta=L\,)\,)\,\&\,(\,(\,L<\varepsilon\,)\,\vee\,(\,L=\varepsilon\,)\,)$
\end{itemize}
\item[]\qquad\qquad\qquad\qquad $]\,)\,]\,)\,]\,)\,]\,)$ \qquad .
\end{itemize}
Finally, change brackets to parentheses and write this all on one line.

Life ain't easy for the logic purist.

\section{Some set theory}

\begin{defn}\wrlab{defn-subset}
$\forall S,T$, \quad $S\subseteq T$ means:\\
\phx\qquad\qquad $(\,S\hbox{ and }T\hbox{ are sets}\,)$ \quad and \quad $(\forall x\in S$, $x\in T)$.
\end{defn}

Logic purist: Introduce a new special character ``$\subseteq$'',
then introduce a new starter statement ``$S\subseteq T$'',
then introduce a new axiom:
\begin{itemize}
\item[]$(\forall S)($
\item[]$(\forall T)($
\begin{itemize}
\item[]$[\,S\subseteq T\,]\quad\Leftrightarrow$
\item[]$[\,\,(\,(\,S\hbox{ is a set}\,)\,\&\,(\,T\hbox{ is a set}\,)\,)\,\&$
\item[]\qquad\qquad\qquad\qquad $(\,(\forall x)([x\in S]\Rightarrow[x\in T])\,)\,\,]$
\end{itemize}
\item[]\qquad\qquad\qquad$)\,)$ \qquad .
\end{itemize}
The logic purist would ask us to change brackets to parentheses, 
break the ``$\Leftrightarrow$'' into two implications,
and to put all of this on one line.

The text ``$S\subseteq T$'' is read ``$S$ is a \bfindex[subset] of $T$''.

\begin{defn}\wrlab{defn-superset}
$\forall S,T$, \qquad $T\supseteq S$ means: \quad $S\subseteq T$.
\end{defn}

Logic purist: Introduce a new special character ``$\supseteq$'',
then introduce a new starter statement ``$T\supseteq S$'',
then introduce a new axiom:
\begin{itemize}
\item[]$(\forall S)($
\item[]$(\forall T)($
\begin{itemize}
\item[]$(T\supseteq S)\Leftrightarrow(S\subseteq T)$
\end{itemize}
\item[]\qquad\qquad\qquad$)\,)$ \qquad .
\end{itemize}
The logic purist would ask us to break the ``$\Leftrightarrow$'' into two implications,
and to put all of this on one line.

The text ``$S\supseteq T$'' is read ``$S$ is a \bfindex[superset] of $T$''.

The following is sometimes called the \bfindex[Axiom of Extensionality].
It is a quantified equivalence for equality of sets.

\begin{axiom}\wrlab{axiom-extensionality}
$\forall$sets $S,T$, $[\,\,(\,S=T\,)\,\,\Leftrightarrow\,\,(\,[\,S\subseteq T\,]\,\&\,[\,T\subseteq S\,]\,)\,\,]$.
\end{axiom}

Logic purist:
\begin{itemize}
\item[]$(\forall S)([S\hbox{ is a set}]\Rightarrow[$
\item[]$(\forall T)([T\hbox{ is a set}]\Rightarrow[$
\begin{itemize}
\item[]$(S=T)\Leftrightarrow([S\subseteq T]\,\&\,[T\subseteq S])$
\end{itemize}
\item[]\qquad\qquad\qquad$]\,)\,]\,)$ \qquad .
\end{itemize}
The logic purist would ask us to change brackets to parentheses,
break the ``$\Leftrightarrow$'' into two implications,
and to put all of this on one line.

\begin{defn}\wrlab{defn-notin}
$\forall a$, $\forall$set $S$, by $a\notin S\,$, we mean $\neg(a\in S)$.
\end{defn}

Logic purist: Introduce a new special character ``$\notin$'',
then introduce a new starter statement ``$a\notin S$'',
then introduce a new axiom:
\begin{itemize}
\item[]$(\forall a)($
\item[]$(\forall S)([S\hbox{ is a set}]\Rightarrow[$
\begin{itemize}
\item[]$(a\notin S)\Leftrightarrow(\neg(a\in S))$
\end{itemize}
\item[]\qquad\qquad\qquad$]\,)\,)$ \qquad .
\end{itemize}
The logic purist would ask us to change brackets to parentheses,
break the ``$\Leftrightarrow$'' into two implications,
and to put all of this on one line.

The preceding remarks about \dref{defn-notin}
apply, {\it mutatis mutandis}, to the following two definitions.

\begin{defn}\wrlab{defn-notsubseteq}
$\forall$sets $S,T$, by $S\not\subseteq T$, we mean $\neg(S\subseteq T)$.
\end{defn}

\begin{defn}\wrlab{defn-notsupseteq}
$\forall$sets $S,T$, by $S\not\supseteq T$, we mean $\neg(S\supseteq T)$.
\end{defn}

We sometimes put a definition within an axiom or a theorem, {\it e.g.}:

\begin{axiom}\wrlab{axiom-emptyset}
$\exists1$set $S$, denoted $\emptyset$, s.t.~$\forall x$, $x\notin S$.
\end{axiom}

We will say a few words about ``denoted $\emptyset$''.
A logic purist would insist that, instead of \aref{axiom-emptyset}, we add
\begin{itemize}
\item[]a new special character: $\emptyset$ \qquad ,
\item[]a new constant: $\emptyset$ \qquad ,
\item[]a new axiom: \quad $\emptyset$ is a set \qquad and
\item[]a new axiom: \quad $\forall$set $S$, \quad $[\,(\,\forall x,\,x\notin S\,)\,\Leftrightarrow\,(\,S=\emptyset\,)\,]$.
\end{itemize}
Exercise: Formalize these two axioms.
The set $\emptyset$ is called the \bfindex[empty set].
The symbol ``$\emptyset$'' is {\it NOT} the Greek letter phi, written ``$\phi$''.

\begin{axiom}\wrlab{axiom-elts-are-in-sets-only}
$\forall a,S$, $[\,(\,a\in S\,)\,\Rightarrow\,(\,S\hbox{ is a set}\,)\,]$.
\end{axiom}

Logic purist:
\begin{itemize}
\item[]$(\forall a)($
\item[]$(\forall S)($
\begin{itemize}
\item[]$(\,a\in S\,)\,\Rightarrow\,(\,S\hbox{ is a set}\,)$
\end{itemize}
\item[]\qquad\qquad$)\,)$ \qquad .
\end{itemize}

Can there be a set that is an element of itself?
It would have to be a pretty weird set, and, in fact,
we will not allow such a set to exist:

\begin{axiom}\wrlab{axiom-foundation-no-set-elt-itself}
$\forall a$, $a\notin a$.
\end{axiom}

Logic purist:
\begin{itemize}
\item[]$(\forall a)($
\begin{itemize}
\item[]$a\notin a$
\end{itemize}
\item[]\qquad\qquad$)$ \qquad .
\end{itemize}

The next axiom states that $\frownie$ ``lives outside of set theory'':

\begin{axiom}\wrlab{axiom-frownie-outside-sets}
$(\,\frownie\hbox{ is not a set}\,)\,\&\,(\,\forall\hbox{set }S,\,\frownie\notin S\,)$.
\end{axiom}

Logic purist: $[\,\neg(\,\frownie\hbox{ is a set}\,)\,]\,\&\,[\,(\forall S)(\,[S\hbox{ is a set}]\,\Rightarrow\,[\,\frownie\notin S\,]\,)\,]$ .\\
The logic purist would then ask us to change brackets to parentheses.

It follows that $\frownie$ has no elements:

\begin{thm}\wrlab{thm-frownie-has-no-elts}
$\forall a$, \qquad $a\notin\frownie$.
\end{thm}

\begin{proof}
Given $a$. \qquad
Want: $a\notin\frownie$.\\
Assume $a\in\frownie$. \qquad
Want: Contradiction.\\
By \aref{axiom-elts-are-in-sets-only}, $\frownie$ is a set.\\
By \aref{axiom-frownie-outside-sets}, $\frownie$ is not a set.\\
Contradiction.
\end{proof}

The logic purist would prefer: \qquad $(\forall a)(a\notin\frownie)$.

\section{Sets of up to nine objects}

We will use ``$\forall\!\!\smile\!\!a,\,\ldots\ldots$'' to mean
``$(\forall a)(\,[\,a\ne\frownie\,]\,\Rightarrow\,[\,\ldots\ldots\,]\,)$''.
Similar conventions are adopted for all the 112 variables, not just ``$a$''.

\begin{axiom}\wrlab{axiom-singletons}
$\forall\!\!\smile\!\!a$, $\exists1$set $S$, denoted $\{a\}$, s.t.
$$\forall x,\qquad[\,(\,x\in S\,)\Leftrightarrow(\,x=a\,)\,].$$
\end{axiom}

Logic purist: Introduce two new special characters ``$\{$'' and $\}$,
then a new starter statement ``$\{a\}=S$'',
then two new axioms:
\begin{itemize}
\item[]$\forall\!\!\smile\!\!a$, $\exists$set $S$ s.t.~$\{a\}=S$ \qquad and
\item[]$\forall\!\!\smile\!\!a$, $\forall$set $S$,
$[\,(\,\{a\}=S\,)\,\Leftrightarrow\,(\,\forall x,\,[\,(\,x\in S\,)\,\Leftrightarrow\,(\,x=a\,)\,]\,)\,]\,\,\,.$
\end{itemize}
Exercise: Formalize these two axioms.

We have similar axioms for $\{a,b\}$ and $\{a,b,c\}$:

\begin{axiom}\wrlab{axiom-cardtwo-sets}
$\forall\!\!\smile\!\!a,\forall\!\!\smile\!\!b$, $\exists1$set $S$, denoted $\{a,b\}$, s.t.
$$\forall x,\qquad[\,(\,x\in S\,)\Leftrightarrow(\,[x=a]\vee[x=b]\,)\,].$$
\end{axiom}

\begin{axiom}\wrlab{axiom-cardthree-sets}
$\forall\!\!\smile\!\!a,\forall\!\!\smile\!\!b,\forall\!\!\smile\!\!c$, $\exists1$set $S$, denoted $\{a,b,c\}$, s.t.
$$\forall x,\qquad[\,(\,x\in S\,)\Leftrightarrow(\,[x=a]\vee[x=b]\vee[x=c]\,)\,].$$
\end{axiom}

There are more of these axioms, ending with:

\begin{axiom}\wrlab{axiom-cardnine-sets}
$\forall\!\!\smile\!\!a,\ldots,\forall\!\!\smile\!\!i$, $\exists1$set $S$, denoted $\{a,\ldots,i\}$, s.t.
$$\forall x,\qquad[\,(\,x\in S\,)\Leftrightarrow(\,[x=a]\vee\cdots\vee[x=i\,)\,].$$
\end{axiom}

\begin{axiom}\wrlab{axiom-frownie-in-singleton}
$\{\frownie\}=\frownie$.
\end{axiom}

\begin{axiom}\wrlab{axiom-frownie-in-cardtwo}
$\forall a$, $[\,\,(\,\{a,\frownie\}=\{\frownie,a\}=\frownie\,)\,\,]$.
\end{axiom}

\begin{axiom}\wrlab{axiom-frownie-in-cardthree}
$\forall a,\forall b$,\\
\phx\qquad$[\,\,(\,\{a,b,\frownie\}=\{a,\frownie,b\}=\{\frownie,a,b\}=\frownie\,)\,\,]$.
\end{axiom}

This continues until:

\begin{axiom}\wrlab{axiom-frownie-in-cardnine}
$\forall a,\ldots,\forall h$,\\
\phx\qquad$[\,\,(\,\{a,\ldots,h,\frownie\}=\cdots=\{\frownie,a,\ldots,h\}=\frownie\,)\,\,]$.
\end{axiom}

In \aref{axiom-cardnine-sets} and \aref{axiom-frownie-in-cardnine},
the use of an ellipsis (``$\cdots$'') causes the logic purist great pain,
but we think you can fill in those blanks.
Also, we leave it to you to fill and formalize the missing axioms between
\aref{axiom-cardthree-sets} and \aref{axiom-cardnine-sets},
as well as the missing axioms beween \aref{axiom-frownie-in-cardthree} and \aref{axiom-frownie-in-cardnine}.
We could continue with sets of ten elements, but nine should be enough.

\aref{axiom-frownie-in-singleton} through \aref{axiom-frownie-in-cardnine}
are part of a general understanding that $\frownie$ is ``infective''.
That is, if an expression has $\frownie$ inside, then it equals $\frownie$.

\begin{thm}\wrlab{thm-12-equals-21}
$\{1,2\}=\{2,1\}$.
\end{thm}

More formally:\\
\phx\qquad $\exists L$, $\exists R$ s.t.\\
\phx\qquad\qquad $[\,\,(\,\{1,2\}=L\,]\,\,\&\,\,[\,\{2,1\}=R\,]\,\,\&\,\,[\,L=R\,]$ \qquad .

A simpler way to formalize \tref{thm-12-equals-21}:\\
\phx\qquad $(\exists S)(\,(\,\{1,2\}=S\,)\,\&\,(\,\{2,1\}=S\,)\,)$ \quad .

\begin{thm}\wrlab{thm-33-equals-3}
$\{3,3\}=\{3\}$.
\end{thm}

More formally:\\
\phx\qquad $\exists L$, $\exists R$ s.t.\\
\phx\qquad\qquad $[\,\{3,3\}=L\,]\,\,\&\,\,[\,\{3\}=R\,]\,\,\&\,\,[\,L=R\,]$ \qquad .

\begin{thm}\wrlab{thm-setset33}
$\{\{3\},\{3,3\}\}=\{\{3\},\{3\}\}=\{\{3\}\}$.
\end{thm}

More formally:\\
$($\\
\phx\qquad $\exists S$, $\exists T$, $\exists L$, $\exists R$ s.t.\\
\phx\qquad\qquad $[\,\{3\}=S\,]\,\,\&\,\,[\,\{3,3\}=T\,]\,\,\&\,\,[\,\{S,T\}=L\,]\,\&$\\
\phx\qquad\qquad\qquad\qquad $[\,\{S,S\}=R\,]\,\,\&\,\,[\,L=R\,]$\\
$)\,\,\,\,\&\,\,\,\,($\\
\phx\qquad $\exists S$, $\exists L$, $\exists R$ s.t.\\
\phx\qquad $[\,\{3\}=S\,]\,\,\&[\,\{S,S\}=L\,]\,\,\&[\,\{S\}=R\,]\,\,\&[\,L=R\,]$\\
$)$ \qquad .\\

A simpler way to formalize \tref{thm-setset33}:\\
\phx\qquad $(\exists S)(\,(\exists T)(\,\,\,\,\,[\,(\,\{3,3\}=S\,)\,\&\,(\,\{3\}=S\,)\,]\,\,\,\,\,\&$\\
\phx\qquad\qquad\qquad\qquad\qquad $[\,(\,\{S,S\}=T\,)\,\&\,(\,\{S\}=T\,)\,]\,\,\,\,\,)\,)$ \quad .

\begin{thm}\wrlab{thm-3-notin-setset3}
$3\notin\{\{3\}\}$.
\end{thm}

More formally:\\
\phx\qquad $\exists L$, $\exists S$, $\exists R$ s.t.\\
\phx\qquad\qquad $[\,3=L\,]\,\,\&\,\,[\,\{3\}=S\,]\,\,\&\,\,[\,\{S\}=R\,]\,\,\&\,\,[\,L=R\,]$ \qquad .

\begin{thm}\wrlab{thm-setset3}
$3\in\{3\}\in\{\{3\}\}$.
\end{thm}

More formally:\\
$($\\
\phx\qquad $\exists L$, $\exists R$ s.t.\\
\phx\qquad\qquad $[\,3=L\,]\,\,[\,\{3\}=R\,]\,\,[\,L\in R\,]$\\
$)\,\,\,\,\&\,\,\,\,($\\
\phx\qquad $\exists S$, $\exists L$, $\exists R$ s.t.\\
\phx\qquad\qquad $[\,\{3\}=L\,]\,\,[\,\{3\}=S\,]\,\,[\,\{S\}=R\,]\,\,[\,L\in R\,]$\\
$)$ \qquad .\\

A simpler way to formalize \tref{thm-setset3}:\\
\phx\qquad $(\exists S)(\,(\exists T)(\,\,\,\,\,[\,(\,\{3\}=S\,)\,\&\,(\,\{S\}=T\,)\,]\,\,\,\,\,\&$\\
\phx\qquad\qquad\qquad\qquad\qquad $[\,(\,3\in S\,)\,\&\,(\,S\in T\,)\,]\,\,\,\,\,)\,)$ \quad .

\vskip.1in
Unassigned homework: Formalize the next four theorems.

\begin{thm}\wrlab{thm-1-notin-setset12}
$(\,1\notin\{\{1,2\}\}\,)\,\&\,(\,2\notin\{\{1,2\}\}\,)$.
\end{thm}

\begin{thm}\wrlab{thm-setset12}
$1,2\in\{1,2\}\in\{\{1,2\}\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-setwithfrownie}
$\{1,\frownie,3,4,5\}=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-setwithfrownie}
$\{1,\{\frownie,3,4,5\}\}=\{1,\frownie\}=\frownie$.
\end{thm}

\section{Picking an element from a set}

We will use ``$\exists\!\!\smile\!\!a,\,\ldots\ldots$'' to mean
``$(\exists a)(\,[\,a\ne\frownie\,]\,\&\,[\,\ldots\ldots\,]\,)$''.
Similar conventions are adopted for all the 112 variables, not just ``$a$''.

\begin{defn}\wrlab{defn-singleton}
$\forall S$, by $S$ is a \bfindex[singleton], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,S\hbox{ is a set}\,\,)\,\,\&\,\,(\,\,\exists\!\!\smile\!\!a$ s.t.~$S=\{a\}\,\,\,)$.
\end{defn}

The logic purist would prefer to introduce a new starter statement, ``$S$ is a singleton'',
and to make \dref{defn-singleton} into an axiom:\\
\phx\quad$\forall S$, $[\,(\,S\hbox{ is a singleton}\,)\,\Leftrightarrow\\
\phx\qquad\qquad\qquad
(\,(\,S\hbox{ is a set}\,)\,\&\,(\,\exists a\hbox{ s.t. }[\,a\ne\frownie\,]\,\&\,[\,\{a\}=S\,]\,)\,]$ .

\begin{thm}
$\emptyset$ is not a singleton, \qquad
$\{1\}$ is a singleton,\\
\phx\qquad\qquad
$\{1,2\}$ is not a singleton \qquad and \qquad
$\{\,\{1,2\}\,\}$ is a singleton.
\end{thm}

Recall the starter statement:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $\UE(S)=a$ & $S,a$ \\
\hline
\end{tabular}
\end{center}

\begin{axiom}\wrlab{axiom-unique-element}
$\forall$singleton $S$, $\forall a$, $[\,(\,\UE(S)=a\,)\,\Leftrightarrow\,(\,a\in S\,)\,]$.
\end{axiom}

So, for any singleton $S$, $\UE(S)$ is the unique element of $S$.

We are sometimes sloppy and leave off parentheses, writing $\CH\,S$.

We can write \aref{axiom-unique-element} in a more ``pure'' way:
\begin{itemize}
\item[]$(\forall S)([S\hbox{ is a singleton}]\Rightarrow[$
\item[]$(\forall a)($
\begin{itemize}
\item[]\quad$[\,(\,\UE(S)=a\,)\,\Leftrightarrow\,(\,a\in S\,)\,]$
\end{itemize}
\item[]\qquad\qquad\qquad$)\,]\,)\,$ \qquad .
\end{itemize}

We insist that, when $S$ is not a singleton, then $S$ has no unique element,
and therefore we should have $\UE(S)=\frownie$:

\begin{axiom}\wrlab{axiom-no-unique-element}
$\forall S$, $[\,(\,S\hbox{ is not a singleton}\,)\,\Rightarrow\,(\,\UE(S)=\frownie\,)\,]$ \qquad .
\end{axiom}

As always, there is lots to ``tsk!'' about.
More formally:
\begin{itemize}
\item[]$(\forall S)($
\begin{itemize}
\item[]$(\,\neg[\,S\hbox{ is a singleton}\,]\,)\,\Rightarrow\,(\,\UE(S)=\frownie\,)$
\end{itemize}
\item[]\qquad\qquad$)$ \qquad .
\end{itemize}
If you are feeling energetic, change the brackets to parentheses,
and then write this entire stream of symbols on one line.

\begin{thm}
\qquad $\UE\,\emptyset=\frownie$.
\end{thm}

Recall the starter statement:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $\CH(S)=a$ & $S,a$ \\
\hline
\end{tabular}
\end{center}

We next state the \bfindex[Axiom of Choice]:

\begin{axiom}\wrlab{axiom-choice}
$\forall$nonempty set $S$,
$\exists a\in S$ s.t.~$\CH(S)=a$.
\end{axiom}

So, for any nonempty set $S$, $\CH(S)$ is some element of $S$.
So $\CH$ chooses, from every nonempty set, one of its elements.

We are sometimes sloppy and leave off parentheses, writing $\CH\,S$.

We can write \aref{axiom-choice} in a more formal way:
\begin{itemize}
\item[]$(\forall S)(\,[\,(\,S\hbox{ is a set}\,)\,\&\,(\,S\ne\emptyset\,)\,]\,\Rightarrow\,[$
\item[]$(\exists a)(\,[\,a\in S\,]\,\&\,[$
\begin{itemize}
\item[]\qquad\qquad\qquad\qquad $\CH(S)=a$
\end{itemize}
\item[]\qquad\qquad\qquad\qquad\qquad\qquad $]\,)\,]\,)\,$ \qquad .
\end{itemize}
If you are feeling energetic, change the brackets to parentheses,
and then write this entire stream of symbols on one line.

Sad to say, the set $\emptyset$ has no element to choose:

\begin{axiom}\wrlab{axiom-no-element}
\quad $\CH\,\emptyset=\frownie$.
\end{axiom}

\begin{thm}
\qquad $\UE\{1\}=1$.
\end{thm}

\begin{thm}
\qquad $\UE\{2\}=2$.
\end{thm}

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

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

\begin{thm}
\qquad $\CH\{1\}=1$.
\end{thm}

\begin{thm}
\qquad $\CH\{2\}=2$.
\end{thm}

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

\begin{thm}
\qquad $\CH\{1,2\}\in\{1,2\}$.
\end{thm}

\begin{thm}
\qquad $\CH\{1,2\}\ne\frownie=\UE\{1,2\}$.
\end{thm}

\begin{axiom}\wrlab{axiom-frownie-infects-UE-CH}
$\UE(\frownie)=\frownie=\CH(\frownie)$.
\end{axiom}

\section{Formalism and intuition}

Logic purity really takes it out of a fellow.
The point is not that we {\it SHOULD} rewrite every pidgin statement as a formal statement,
only that it {\it CAN} be done, if the need for extra precision should arise.
There are many reasons why we do not want to obsess about formalism.
For~one thing, it requires a great deal of effort,
and produces results that are very difficult to read.
More importantly, if we focus on formalism to~the~complete exclusion of intuition,
then we have lost a crucial aspect of the mathematical experience.

Intuition and formalism are yin and yang.
At first blush, they may seem in competition,
but, in fact, each reinforces the other, and each depends on the other.
For example, intuition depends on formalism:
Each person's intuition is based on their own experiences,
so rigor and formal writing provides a basis for resolving differences of opinion.
Conversely, I find that formal writing almost
always starts as vague intuitive ideas, refined repeatedly
to increasing levels of~formality.
I cannot imagine proving any complicated theorem without having some
intuitive insight driving my thinking.

From the purist's point of view, certain streams of symbols are
statements, and others are just the ramblings of someone who has
learned to speak the English language, and accepts all the lack of
clarity that comes with it.
From this purist point of view,
a proof is a sequence of~formal statements each of which follows,
by precise rules, from earlier statements, or from a list of axioms.
So we could feed a proof into~a~computer,
and the computer can check its validity.

We, however, are not computers.
When we see
$$(\forall x)(x=x)$$
we want it to have some intuitive meaning;
otherwise, mathematics becomes a subject fit only for code-monkeys.
Reading
$$(\forall x)(x=x)$$
or the less formal version, ``$\forall x,\,x=x$'', one might interpret it to mean
$$\hbox{ for any mathematical object }x,\,\,\hbox{we have: }x=x\quad,$$
but this begs the question: Which objects are mathematial objects?

The answer actually varies from subject to subject, from mathematician to mathematician.
Logicians someimes refer to the collection of~all mathematical objects as the
``domain of discourse'', and so, we are asking:
What is the domain of discourse in this particular course,
{\it i.e.}, what is our mathematical universe?
For us, it consists of
\begin{itemize}
\item[]real numbers \qquad , \qquad sets \qquad,
\item[]$\infty$ \qquad , \qquad $-\infty$ \qquad\hbox{and} \qquad $\frownie$ \qquad .
\end{itemize}
These terms are intuitive.
We will not, in this course, try to define a real number or set,
or any of the other three objects.
Also, at the moment, we have not given a name to any real number,
so, while can talk about all of~them at once,
we cannot yet talk about any particular real number.
So, for example, the statement
$$1\hbox{ is a real number}$$
is just a stream of symbols that, according to our rules, is a formal statement.
We do not yet have the axiomatic framework to determine whether or not it is a theorem.
However, we rely on your intuition and earlier learning to know that
we should eventually set up our axioms in such a way that that statement {\it IS} a formal theorem.

Similarly, ``$\infty$'' is not just a sideways ``$8$''.
If you see ``$\infty$'' used, you do not need to turn your head to~understand it.
We hope you have some intuitive sense of the infinite,
and the formal theorems that we will prove later on should dovetail with that intuition.

\section{A doubly quantified theorem}\wrlab{sect-dbly-quant-thm}

In \secref{sect-dbly-quant-thm-redux}, we will explain how to prove:

\begin{thm}\wrlab{thm-eg1-deltaformula-lt-epsilon}
$\forall\varepsilon>0$,
$\exists\delta>0$~s.t.~$\delta^2+\delta\le\varepsilon$.
\end{thm}

In this section, we only attempt to understand,
{\it at an intuitive level}, why the \tref{thm-eg1-deltaformula-lt-epsilon} is true.
It is very difficult to prove a~theorem until you believe in your heart that it is valid.

Imagine the following game, which is based on \tref{thm-eg1-deltaformula-lt-epsilon}:
\begin{itemize}
\item[]You move first: You choose a real $\varepsilon>0$, and reveal it to me.
\item[]My move: I choose a real $\delta>0$, and reveal it to you.
\item[]We check to see if $\delta^2+\delta\le\varepsilon$.
\begin{itemize}
\item[]If so, then I win.
\item[]If not, then you win.
\end{itemize}
\end{itemize}
Let's play:
Say you choose $\varepsilon=100$.
I will laugh at your poor play, and choose $\delta=1$.
We check that $1^2+1\le100$ is true, so I win.
We play again.
You try $\varepsilon=1000$.
I laugh even harder, and choose $\delta=1$ again.
We check that $1^2+1\le1000$ is true, so I win again.
You begin to see that making $\varepsilon$ large is not in your interest.
However, by~the rules, you cannot make it negative or zero.
You try $\varepsilon=0.001$.
Now I have to concentrate.
I choose $\delta=0.00001$.
We check that $0.00001^2+0.00001\le0.001$ is true, so I win again.
You begin to think the game is rigged.
Saying that the game is rigged against you is the same as saying that
you believe that \tref{thm-eg1-deltaformula-lt-epsilon} is true,
and that is really the first step in proving it.

\tref{thm-eg1-deltaformula-lt-epsilon} is ``doubly quantified'';
it has one ``$\forall$'' and one ``$\exists$'', totaling to two quantifiers.
Most of us do not spend a great deal of~time considering the
validity of doubly quantified assertions, {\it EXCEPT} when we play games.
The chess player may say:
``whatever move my opponent makes,
I will be able to checkmate him/her on my next move''.
This is an example of a doubly quantified statement:
\begin{itemize}
\item[]$\forall$move of my opponent, $\,$ $\exists$move of mine $\,$ s.t. $\,$ checkmate $\,$ .
\end{itemize}
Somehow we are hardwired to deal with highly quantified statements
while playing certain games, and you can piggyback off that hardwiring
by converting highly quantified theorems into games.

Now that we believe in \tref{thm-eg1-deltaformula-lt-epsilon},
we need a specific strategy to~win.
It is not enough to say, ``Well, just make sure the $\delta$ is very small''.
We need a specific method for~choosing $\delta$ after we know $\varepsilon$.

Sometimes, it helps to focus first on the finish,
in order to see what is needed in the $\delta$-strategy.
We wish to force
\begin{itemize}
\item[]$\delta^2+\delta\le\varepsilon$ \quad.
\end{itemize}
Some students may have practiced solving quadratic inequalities,
which is one route to setting up a $\delta$-strategy.
However, there are more complicated problems leading to, {\it e.g.}, $\delta^5+\delta^2+\delta\le\varepsilon$,
and this kind of~inequality is hard to solve.
We favor a more robust approach,
in which we break the problem down, term by term.
That is, we work separately on the first term $\delta^2$ and the second term $\delta$.
If we can force
\begin{itemize}
\item[]$\delta^2\le\varepsilon/2$ \quad and \quad $\delta\le\varepsilon/2$ \quad.
\end{itemize}
then we will win the game.
It is therefore enough to force
\begin{itemize}
\item[]$0<\delta\le\sqrt{\varepsilon/2}$ \quad and \quad $\delta\le\varepsilon/2$ \quad.
\end{itemize}
This leads us to the strategy:
\begin{itemize}
\item[]Let $\delta:=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$.
\end{itemize}

We now need to take this strategy and turn it into a pidgin proof.
Before we can do that, however, we will need to expose
the basics of~arithmetic and inequalities.
In particular, we need to define
$$\min\{\phantom{X},\phantom{Y}\}\qquad\hbox{and}\qquad\sqrt{\phantom{X}}\qquad.$$
That will take a few sections, but, in \secref{sect-dbly-quant-thm-redux},
we will prove \tref{thm-eg1-deltaformula-lt-epsilon}.

\section{Arithmetic}\wrlab{sect-arithmetic}

Here are two of our starter statements:
\begin{center}
\begin{tabular}{|l||l|}
\hline
 Statement & FV \\
\hline\hline
 $x$ is a real number & $x$ \\
\hline
 $j$ is an integer & $j$ \\
\hline
\end{tabular}
\end{center}

\begin{axiom}\wrlab{axiom-set-of-integers}
$\exists1$set $S$, denoted $\Z$, s.t.:\\
\phx\qquad$\forall j$,\qquad $[\,(\,j\in S\,)\,\Leftrightarrow\,(\,j\hbox{ is an integer}\,)\,]$.
\end{axiom}

The logic purist would drop the axiom above,
then add ``$\Z$'' to the list of special characters and to the list of constants,
and would then add two axioms:
\begin{itemize}
\item[]$\Z$ is a set \qquad\qquad and
\item[]$\forall$set $S$, $[\,(\,\forall j,\,[\,(j\in S)\,\Leftrightarrow\,(j\hbox{ is an integer})\,]\,)\,\Leftrightarrow\,(\,S=\Z\,)\,]$ \quad .
\end{itemize}
Exercise: Formalize the last of these axioms.

\begin{axiom}\wrlab{axiom-set-of-real-numbers}
$\exists1$set $S$, denoted $\R$, s.t.:\\
\phx\qquad$\forall x$,\qquad $[\,(\,x\in S\,)\,\Leftrightarrow\,(\,x\hbox{ is a real number}\,)\,]$.
\end{axiom}

The logic purist would drop the axiom above,
then add ``$\R$'' to the list of special characters and to the list of constants,
and would then add two axioms:
\begin{itemize}
\item[]$\R$ is a set \qquad\qquad and
\item[]$\forall$set $S$, $[(\forall x,\,[(x\in S)\Leftrightarrow(x\hbox{ is a real number})])\Leftrightarrow(\,S=\R\,)]\,\,$ .
\end{itemize}
Exercise: Formalize the last of these axioms.

Our next axiom says, in set-theoretic language, that $1$ is an integer, and that every integer is a real number:

\begin{axiom}\wrlab{axiom-integers-are-real-are-cx}
$0,1\in\Z\subseteq\R$.
\end{axiom}

Our next axiom says that any two real numbers have a real sum:

\begin{axiom}\wrlab{axiom-domain-addition}
$\forall x,y\in\R$, $\exists z\in\R$ s.t.~$x+y=z$.
\end{axiom}

More formally:
\begin{itemize}
\item[]$\forall x$, $(\,[x\in\R]\,\Rightarrow\,[$
\item[]$\forall y$, $(\,[y\in\R]\,\Rightarrow\,[$
\item[]$\exists z$ s.t.~$(\,[z\in\R]\,\&\,[$
\begin{itemize}
\item[]$x+y=z$
\end{itemize}
\item[]\qquad\qquad$]\,)\,]\,)\,]\,)$ \qquad .
\end{itemize}
Finally, if you are feeling energetic, change the brackets to parentheses,
and then write the entire stream of symbols on one line.

Our next axiom:
\begin{axiom}\wrlab{axiom-zero-add-ident}
$\forall x\in\R$, \qquad $x+0=x$.
\end{axiom}
More formally:
\begin{itemize}
\item[]$\forall x$, \qquad $(x\in\R)\,\Rightarrow\,(x+0=x)$.
\end{itemize}
From there, the remaining ``tsk!''s are easily dealt with:
\begin{itemize}
\item[]$(\forall x)((x\in\R)\,\Rightarrow\,(x+0=x))$ \qquad.
\end{itemize}

\begin{axiom}\wrlab{axiom-add-commutes}
$\forall x,y\in\R$, \quad $x+y=y+x$.
\end{axiom}

The equation ``$x+y=y+x$''
needs to be broken apart into several
atomic statements, like:
$$x+y=L,\qquad y+x=R\qquad,\qquad L=R\qquad.$$
So we could partially formalize \aref{axiom-add-commutes} as
\begin{itemize}
\item[]$\forall x,y\in\R$, $\exists L,R\in\R$ s.t.
\begin{itemize}
\item[]$(x+y=L)\,\&\,(y+x=R)\,\&\,(L=R)$ \qquad .
\end{itemize}
\end{itemize}
From there, we can work on ``$\forall\cdots\in\R$''
and ``$\exists\cdots\in\R$'':
\begin{itemize}
\item[]$(\forall x)([x\in\R]\Rightarrow[$
\item[]$(\forall y)([y\in\R]\Rightarrow[$
\item[]$(\exists L)([L\in\R]\,\&\,[$
\item[]$(\exists R)([R\in\R]\,\&\,[$
\begin{itemize}
\item[]$(x+y=L)\,\&\,(y+x=R)\,\&\,(L=R)$
\end{itemize}
\item[]\ \ \ \qquad\qquad\qquad\qquad$]\,)\,]\,)\,]\,)\,]\,)$ \qquad .
\end{itemize}
Finally, if you are feeling energetic, change the brackets to parentheses,
and then write the entire stream of symbols on one line.

\begin{axiom}\wrlab{axiom-add-associative}
$\forall x,y,z\in\R$, \quad $x+(y+z)=(x+y)+z$.
\end{axiom}

We could formalize the above axiom as:
\begin{itemize}
\item[]$\forall x,y,z\in\R$, $\exists a,b,L,R\in\R$ s.t.
\begin{itemize}
\item[]$(y+z=a)\,\&\,(x+a=L)\,\&$
\item[]$(x+y=b)\,\&\,(b+z=R)\,\&$
\item[]$(L=R)$ \qquad .
\end{itemize}
\end{itemize}
From there, we can work on ``$\forall\cdots\in\R$''
and ``$\exists\cdots\in\R$'':
\begin{itemize}
\item[]$(\forall x)([x\in\R]\Rightarrow[$
\item[]$(\forall y)([y\in\R]\Rightarrow[$
\item[]$(\forall z)([z\in\R]\Rightarrow[$
\item[]$(\exists a)([a\in\R]\,\&\,[$
\item[]$(\exists b)([b\in\R]\,\&\,[$
\item[]$(\exists L)([L\in\R]\,\&\,[$
\item[]$(\exists R)([R\in\R]\,\&\,[$
\begin{itemize}
\item[]\ \ \qquad\qquad $(y+z=a)\,\&\,(x+a=L)\,\&$
\item[]\ \ \qquad\qquad $(x+y=b)\,\&\,(b+z=R)\,\&$
\item[]\ \ \qquad\qquad $(L=R)$
\end{itemize}
\item[]\ \ \ \qquad\qquad\qquad\qquad\qquad\qquad$]\,)\,]\,)\,]\,)\,]\,)\,]\,)\,]\,)\,]\,)$\qquad .
\end{itemize}
Finally, if you are feeling energetic, change the brackets to parentheses,
and then write the entire stream of symbols on one line.
Uff da!

For lack of time, going forward,
we will avoid formalizing most of our pidgin statements.
However, if any question arises about how to~convert a pidgin statement
into a formal statement, be sure to ask.

Some more axioms:

\begin{axiom}\wrlab{axiom-domain-mult}
$\forall x,y\in\R$, $\exists z\in\R$ s.t.~$xy=z$.
\end{axiom}

\begin{axiom}\wrlab{axiom-one-mult-ident}
$\forall x\in\R$, \qquad $x\cdot1=x$.
\end{axiom}

\begin{axiom}\wrlab{axiom-mult-commutes}
$\forall x,y\in\R$, \qquad $xy=yx$.
\end{axiom}

\begin{axiom}\wrlab{axiom-mult-associative}
$\forall x,y,z\in\R$, \qquad $x(yz)=(xy)z$.
\end{axiom}

\begin{axiom}\wrlab{axiom-mult-dist-over-add}
$\forall x,y,z\in\R$, \qquad $x(y+z)=xy+xz$.
\end{axiom}

To formalize ``$x(y+z)=xy+xz$'',
we would write:
\begin{itemize}
\item[]$\exists a,b,c,L,R\in\R$ s.t.
\begin{itemize}
\item[]$(y+z=a)\,\&\,(x\cdot a=L)\,\&$
\item[]$(x\cdot y=b)\,\&\,(x\cdot z=c)\,\&\,(b+c=R)\,\&$
\item[]$(L=R)$ \qquad .
\end{itemize}
\end{itemize}
We leave the rest of this formalization as an exercise for the reader.

Next, we develop negation and subtraction.

\begin{axiom}\wrlab{axiom-additive-inverses}
$\forall x\in\R$, $\exists1y\in\R$, denoted $-x$, s.t.~$x+y=0$.
\end{axiom}

\begin{defn}\wrlab{defn-subtraction}
$\forall a,b\in\R$, \quad $b-a\,\,:=\,\,b+(-a)$.
\end{defn}

In high school, we teach students to solve simple equations in a single unknown.
For example, solving $4+x=7$ leads to $x=3$.
It should be no surprise that, for any two real numbers $a$ and $b$,
we can solve $a+x=b$, and find a real solution $x$.
More formally, we have:

\begin{thm}\wrlab{thm-solve-aplusxequalsb}
$\forall a,b\in\R$, $\exists x\in\R$ s.t.~$a+x=b$.
\end{thm}

We are not yet writing proofs, but, in the proof of this theorem,
at~some point, we would write ``Let $x:=b-a$'',
see \tref{thm-solve-aplusxequalsb-appendix}.

\begin{thm}
$\forall a,x,y\in\R$, \quad $(\,a+x=a+y\,)\,\Rightarrow\,(\,x=y\,)$.
\end{thm}

\begin{thm}
$\forall x\in\R$, \quad $x\cdot0=0$.
\end{thm}

Next, division.
The next axiom is the multiplicative analogue of~\tref{thm-solve-aplusxequalsb}.
It says: $\forall a,b\in\R$,
we can solve $ax=b$, {\it PROVIDED} $a\ne0$.
That solution $x$ is unique, and is denoted $b/a$.
Formally:

\begin{axiom}\wrlab{axiom-solve-axequalsb}
$\forall a,b\in\R$,\\
\phx\qquad$(\,a\ne0\,)\,\Rightarrow\,(\,\exists1x\in\R,\hbox{ denoted }b/a,~\hbox{s.t.}~ax=b\,)$.
\end{axiom}

Logic Purist: Add a new special character ``$/$'', then add a new starter statement ``$b/a=x$'',
then add two new axioms:
\begin{itemize}
\item[]$\forall a,b\in\R$, $(\,a\ne0\,)\,\Rightarrow\,(\,\exists x\in\R~\hbox{s.t.}~b/a=x\,)$ \qquad\qquad  and
\item[]$\forall a,b\in\R$,
$(\,a\ne0\,)\,\Rightarrow\,(\,\forall\hbox{real }x,\,[\,(\,ax=b\,)\,\Leftrightarrow\,(\,b/a=x\,)\,]\,)\,\,\,\,$.
\end{itemize}

\begin{axiom}\wrlab{axiom-division-by-zero}
$\forall a$, $a/0=\frownie$.
\end{axiom}

The next axioms are part of a general understanding that $\frownie$ is ``infective''.
That is, if an expression has $\frownie$ inside, then it equals $\frownie$.

\begin{axiom}\wrlab{axiom-frownie-infects-negation}
$-\frownie=\frownie$.
\end{axiom}

\begin{axiom}\wrlab{axiom-frownie-infects-addition}
$\forall x,\quad x+\frownie=\frownie+x=\frownie$.
\end{axiom}

\begin{axiom}\wrlab{axiom-frownie-infects-mult}
$\forall x,\quad x\cdot\frownie=\frownie\cdot x=\frownie$.
\end{axiom}

\begin{axiom}\wrlab{axiom-frownie-infects-div}
$\forall x,\quad x/\frownie=\frownie/x=\frownie$.
\end{axiom}

\section{Some real numbers of interest}

Let's pin down how $1,\ldots,9$ are related:

\begin{axiom}\wrlab{axiom-one-through-nine}
All of the following are true:
\begin{eqnarray*}
&&1+1=2,\qquad2+1=3,\qquad3+1=4,\qquad4+1=5,\\
&&5+1=6,\qquad6+1=7,\qquad7+1=8,\qquad8+1=9.
\end{eqnarray*}
\end{axiom}

The logic purist would ask either that we create eight separate axioms,
or that we combine with parentheses and ``$\&$''s:
\begin{eqnarray*}
&&(1+1=2)\,\&\,(2+1=3)\,\&\,(3+1=4)\,\&\,(4+1=5)\,\&\,\\
&&(5+1=6)\,\&\,(6+1=7)\,\&\,(7+1=8)\,\&\,(8+1=9)\qquad.
\end{eqnarray*}
The logic purist would have us put this all on one line.

\begin{defn}\wrlab{defn-ten}
$10:=9+1$.
\end{defn}

Logic purist:
Make
\begin{itemize}
\item[] a new constant: ``$10$'' \qquad and
\item[] a new axiom: ``$9+1=10$'' \qquad .
\end{itemize}

\begin{defn}\wrlab{defn-100}
\qquad $100:=10\cdot10$.
\end{defn}

\begin{defn}\wrlab{defn-1000}
\qquad $1000:=10\cdot100$.
\end{defn}

\begin{defn}\wrlab{defn-10000}
\qquad $10000:=10\cdot1000$.
\end{defn}

\begin{defn}\wrlab{defn-100000}
\qquad $100000:=10\cdot10000$.
\end{defn}

\begin{defn}\wrlab{defn-point001-point0001}
\qquad $0.1:=1/10$ and $0.01:=1/100$ and\\
\phx\qquad $0.001:=1/1000$ and $0.0001:=1/10000$ and $0.00001:=1/100000$.
\end{defn}

\begin{defn}\wrlab{defn-12-to-19}
$11:=10+1$, $12:=10+2$, $13:=10+3$,\\
\phx\qquad\qquad\qquad $14:=10+4$, $15:=10+5$, $16:=10+6$,\\
\phx\qquad\qquad\qquad $17:=10+7$, $18:=10+8$, $19:=10+9$.
\end{defn}

\begin{thm}\wrlab{thm-some-numbers-are-real}
$0,1,2,3,\ldots,19\in\R$.\\
\phx\qquad\qquad Also, $100,1000,10000,100000\in\R$.\\
\phx\qquad\qquad Also, $0.1,0.01,0.001,0.0001,0.00001\in\R$.\\
\end{thm}

\section{Sets of sets, unions and intersections}

A ``set of sets'' is just a set all of whose elements are sets:

\begin{defn}\wrlab{defn-set-sets}
$\forall\scrs$, by $\scrs$ is a \bfindex[set of sets], we mean:\\
\phx\qquad $(\,\scrs\hbox{ is a set}\,)\qquad\qquad\&\qquad\qquad(\,\forall A\in\scrs$, $A$ is a set\,).
\end{defn}

\begin{thm}\wrlab{thm-eg1-set-of-sets}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.\\
\phx\qquad Then $\{A,B\}$ is a set of sets.
\end{thm}

\begin{thm}\wrlab{thm-emptyset-set-of-sets}
$\emptyset$ is a set of sets.
\end{thm}

\begin{proof}
See \tref{thm-emptyset-set-of-sets-repeat}.
\end{proof}

\begin{thm}
$\{\emptyset\}$ is a set of sets.
\end{thm}

\begin{axiom}\wrlab{axiom-union}
$\forall$set $\scrs$ of sets,
$\exists1$set $U$, denoted $\bigcup\scrs$, s.t.:\\
\phx\qquad\qquad\qquad $\forall x,\quad
[\,(\,x\in U\,)\,\Leftrightarrow\,(\,\exists A\in\scrs\hbox{ s.t. }x\in A\,)\,]$.
\end{axiom}

\begin{axiom}\wrlab{axiom-union-frownie}
$\bigcup\frownie=\frownie$.
\end{axiom}

\begin{thm}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.
Then
$$\bigcup\{A,B\}=\{5,6,7,8,9\}.$$
\end{thm}

\begin{thm}\wrlab{thm-union-emptyset}
\qquad$\bigcup\emptyset=\emptyset$.
\end{thm}

\begin{proof}
See \tref{thm-union-emptyset-repeat}.
\end{proof}

\begin{thm}
\qquad$\bigcup\{\emptyset\}=\emptyset$.
\end{thm}

\begin{axiom}\wrlab{axiom-intersection}
$\forall$nonempty set $\scrs$ of sets,
$\exists1$set $V$, denoted $\bigcap\scrs$, s.t.:\\
\phx\qquad\qquad\qquad $\forall x,\quad
[\,(\,x\in V\,)\,\Leftrightarrow\,(\,\forall A\in\scrs,\,x\in A\,)\,]$.
\end{axiom}

\begin{axiom}\wrlab{asiom-cap-emptyset}
\qquad$\bigcap\frownie=\bigcap\emptyset=\frownie$.
\end{axiom}

\begin{thm}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.
Then
$$\bigcap\{A,B\}=\{7,8\}.$$
\end{thm}

\begin{thm}
\qquad$\bigcap\{\emptyset\}=\emptyset$.
\end{thm}

\begin{axiom}
$\forall\scrs$, $(\,\scrs\hbox{ is not a set of sets}\,)\,\Rightarrow\,(\,\bigcup\scrs=\frownie=\bigcap\scrs\,)$.
\end{axiom}

\begin{thm}
$\forall$set $A$, $\bigcup\,\{A\}=A=\bigcap\,\{A\}$.
\end{thm}

\begin{defn}\wrlab{defn-cup-cap-pair-sets}
$\forall$sets $A,B,$\\
\phx\qquad $A\cup B\,\,:=\,\,\bigcup\,\{A,B\}\qquad\hbox{and}\qquad A\cap B\,\,:=\,\,\bigcap\,\{A,B\}$.
\end{defn}

\begin{thm}\wrlab{thm-eg-cup-cap-pair-sets}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.
Then
$$A\cup B=\{5,6,7,8,9\}\qquad\hbox{and}\qquad A\cap B=\{7,8\}.$$
\end{thm}

\begin{defn}\wrlab{defn-cup-cap-triple-sets}
$\forall$sets $A,B,C,$\\
\phx\qquad $A\cup B\cup C:=\bigcup\,\{A,B,C\}\qquad\hbox{and}$\\
\phx\qquad $A\cap B\cap C:=\bigcap\,\{A,B,C\}$.
\end{defn}

\begin{defn}\wrlab{defn-cup-cap-quadruple-sets}
$\forall$sets $A,B,C,D$,\\
\phx\qquad $A\cup B\cup C\cup D:=\bigcup\,\{A,B,C,D\}\qquad\hbox{and}$\\
\phx\qquad $A\cap B\cap C\cap D:=\bigcap\,\{A,B,C,D\}$.
\end{defn}

We leave it to you to continue these definitions until we have unions and intersections of nine sets $A,\ldots,I$,
finishing by writing out the following definition, without ellipses.

\begin{defn}\wrlab{defn-cup-cap-octuple-sets}
$\forall$sets $A,\ldots,I$,\\
\phx\qquad $A\cup\cdots\cup I:=\bigcup\,\{A,\ldots,I\}\qquad\hbox{and}$\\
\phx\qquad $A\cap\cdots\cap I:=\bigcap\,\{A,\ldots,I\}$.
\end{defn}

\section{Extended reals and inequalities}

\begin{defn}\wrlab{defn-le}
$\forall x,y$, by $x\le y$, we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(x<y)\!\vee\!(x=y)$.
\end{defn}

\begin{defn}\wrlab{defn-gt}
$\forall x,y$, by $x>y$, we mean: $y<x$.
\end{defn}

\begin{defn}\wrlab{defn-ge}
$\forall x,y$, by $x\ge y$, we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(x>y)\!\vee\!(x=y)$.
\end{defn}

\begin{axiom}\wrlab{axiom-transitivity-less-than}
$\forall x,y,z$, \quad $(x<y<z)\Rightarrow(x<z)$.
\end{axiom}

\begin{axiom}\wrlab{axiom-not-less-than-itself}
$\forall x$, \quad $\neg(x<x)$.
\end{axiom}

\begin{thm}\wrlab{thm-lt-imples-not-ge}
$\forall x,y$, \quad $(x<y)\Rightarrow(\neg(x\ge y)$.
\end{thm}

\begin{axiom}\wrlab{axiom-frownie-not-infty-or-minusinfinity}
\qquad $\infty\ne\frownie\ne-\infty$.
\end{axiom}

By \aref{axiom-frownie-not-infty-or-minusinfinity} and
\aref{axiom-cardtwo-sets}, there is a set denoted $\{-\infty,\infty\}$
whose elements are exactly $-\infty$ and $\infty$.

\begin{defn}\wrlab{defn-Rstar}
$\R^*:=\R\cup\{-\infty,\infty\}$.
\end{defn}

Elements of $\R^*$ are called \bfindex[extended real numbers].

We can now formulate our domain of discourse, as an axiom:

\begin{axiom}
$\forall\!\!\smile\!\!x$, $[\,(\,x\in\R^*\,)\,\vee\,(\,x\hbox{ is a set}\,)\,]$.
\end{axiom}

\begin{axiom}\wrlab{axiom-ext-reals-not-sets}
$\forall x\in\R^*$, \quad $x$ is not a set.
\end{axiom}

\begin{axiom}\wrlab{axiom-reals-between-minusinfty-infty}
$\forall x\in\R$, \quad $-\infty<x<\infty$
\end{axiom}

\begin{thm}
\quad $-\infty<\infty$.
\end{thm}

\begin{thm}
$\forall x\in\R$, \quad $-\infty\ne x\ne\infty\ne-\infty$.
\end{thm}

\begin{axiom}\wrlab{axiom-zero-lt-one}
$0<1$.
\end{axiom}

\begin{axiom}\wrlab{axiom-translation-preserves-lt}
$\forall a,x,y\in\R$, \quad $(x<y)\Rightarrow(a+x<a+y)$.
\end{axiom}

\begin{thm}\wrlab{thm-1-thru-9-in-order}
$1<2<3<4<5<6<7<8<9<10$.
\end{thm}

\begin{axiom}\wrlab{axiom-dilation-preserves-lt}
$\forall a,x,y\in\R$, \quad $[\,(a>0)\,\&\,(x<y)\,]\,\Rightarrow\,[\,ax<ay\,]$.
\end{axiom}

\begin{defn}
$20:=2\cdot10$, $30:=3\cdot10$, $40:=4\cdot10$, $50:=5\cdot10$,\\
\phx\qquad\qquad\qquad\qquad $60:=6\cdot10$, $70:=7\cdot10$, $80:=8\cdot10$ and $90:=9\cdot10$.
\end{defn}

\begin{thm}\wrlab{thm-10-thru-90-in-order}
$10<20<30<\cdots<90<100$.
\end{thm}

\begin{axiom}\wrlab{axiom-neg-refl}
$\forall x,y\in\R$, \quad $(x<y)\Rightarrow(-x>-y)$.
\end{axiom}

\begin{thm}\wrlab{thm-minus10-to-minus1}
$-10<-9<-8<\cdots<-1<0$.
\end{thm}

\begin{axiom}\wrlab{axiom-trichotomy}
$\forall x,y\in\R^*$, \quad $(x<y)\vee(x=y)\vee(x>y)$.
\end{axiom}

Combining \aref{axiom-trichotomy} and \tref{thm-lt-imples-not-ge}, we get:

\begin{thm}
$\forall x,y\in\R^*$, \quad $(x<y)\Leftrightarrow(\neg(x\ge y))$.
\end{thm}

\begin{defn}\wrlab{def-positive-negative-etc}
Let $x\in\R$.\\
\phx\qquad By $x$ is \bfindex[positive], we mean $x>0$.\\
\phx\qquad By $x$ is \bfindex[semi-positive], we mean $x\ge0$.\\
\phx\qquad By $x$ is \bfindex[negative], we mean $x<0$.\\
\phx\qquad By $x$ is \bfindex[semi-negative], we mean $x\le0$.
\end{defn}

Finally, $\frownie$ is strictly incomparable with everything:

\begin{axiom}\wrlab{axiom-frownie-incomparable}
$\forall x$, \qquad $[\,\,\,(\,\neg[\,\frownie<x\,]\,)\,\,\,\&\,\,\,(\,\neg[\,x<\frownie\,]\,)\,\,\,]$.
\end{axiom}

\begin{thm}\wrlab{axiom-frownie-nonstrictly-incomparable}
$\forall\!\!\smile\!\!x$, \qquad $[\,\,\,(\,\neg[\,\frownie\le x\,]\,)\,\,\,\&\,\,\,(\,\neg[\,x\le \frownie\,]\,)\,\,\,]$.
\end{thm}

However, do keep in mind that, by \aref{axiom-equals-itself}, $\frownie=\frownie$.
It follows that $\frownie$~compares {\it NONstrictly} with itself:

\begin{thm}\wrlab{thm-frownie-le-itself}
$\frownie\le\frownie$.
\end{thm}

\section{Axioms of specification}

By a \bfindex[specification triple], we mean three pieces of data:
\begin{itemize}
\item[(1)]a formal statement with at least one free variable \qquad ,
\item[(2)]one of its free variables \qquad\qquad  and
\item[(3)]a set \qquad .
\end{itemize}
Since we know how to formalize pidgin statements, we will relax, and allow a
pidgin statement in (1), so long it has at least one free variable.

We will soon see, example by example,
that each specification triple leads to an \bfindex[Axiom of Specification].
There are infinitely many such triples,
leading to infintely many axioms.
We illustrate a few:

We begin with the specification triple
\begin{itemize}
\item[(1)]$a<x<b$ \qquad ,
\item[(2)]$x$ \qquad  and
\item[(3)]$\R$ \qquad .
\end{itemize}
To get the corresponding Axiom of Specification,
identify all the free variables in (1), {\it except} for the variable in (2).
This yields: ``$a$'' and ``$b$''.
Then the axiom we seek begins ``$\forall a,\forall b$''.
It reads:
\begin{axiom}\wrlab{axiom-eg1-spec}
$\forall a$, $\forall b$, $\exists1$set $S$, denoted $\{x\in\R\,|\,a<x<b\}$,\\
\phx\quad s.t., $\forall x$, $(\,\,[\,x\in S\,]\,\,\Leftrightarrow\,\,[\,(\,x\in\R\,)\,\&\,(\,a<x<b\,)\,]\,\,)$.
\end{axiom}

Here is another specification triple:
\begin{itemize}
\item[(1)]$\exists t\in\R$~s.t.~$a+q+t^2=1$ \qquad ,
\item[(2)]$a$ \qquad  and
\item[(3)]$\Z$ \qquad .
\end{itemize}
To get the corresponding Axiom of Specification,
identify all the free variables in (1), {\it except} for the variable in (2).
This yields: ``$q$''.
Then the axiom we seek begins ``$\forall q$''.
It reads:
\begin{axiom}\wrlab{axiom-eg2-spec}
$\forall q$, $\exists1$set $S$, denoted $\{a\in\Z\,|\,\exists t\in\R~\hbox{s.t.}~a+q+t^2=1\}$,\\
\phx\qquad s.t., $\forall a$, $(\,\,[\,a\in S\,]\,\,\Leftrightarrow\,\,[\,(\,a\in\Z\,)\,\&\,(\,\exists t\in\R~\hbox{s.t.}~a+q+t^2=1\,)\,]\,\,)$.
\end{axiom}

Here is another specification triple:
\begin{itemize}
\item[(1)]$z\ne0$ \qquad ,
\item[(2)]$z$ \qquad  and
\item[(3)]$\R$ \qquad .
\end{itemize}
To get the corresponding Axiom of Specification,
identify all the free variables in (1), {\it except} for the variable in (2).
There are none.
The axiom reads:
\begin{axiom}\wrlab{axiom-eg3-spec}
$\exists1$set $S$, denoted $\{z\in\R\,|\,z\ne0\}$,\\
\phx\qquad\qquad s.t., $\forall z$, $(\,\,[\,z\in S\,]\,\,\Leftrightarrow\,\,[\,(\,z\in\R\,)\,\&\,(\,z\ne0\,)\,]\,\,)$.
\end{axiom}

Here is another specification triple:
\begin{itemize}
\item[(1)]$x^2=a$ \qquad ,
\item[(2)]$x$ \qquad  and
\item[(3)]$\R$ \qquad .
\end{itemize}
To get the corresponding Axiom of Specification,
look at all the free variables, {\it except} the one in (2).
This yields: ``$a$''.
Then the axiom we seek begins ``$\forall a$''.
It reads:
\begin{axiom}\wrlab{axiom-eg4-spec}
$\forall a$, $\exists1$set $S$, denoted $\{x\in\R\,|\,x^2=a\}$,\\
\phx\qquad\qquad s.t., $\forall x$, $(\,\,[\,x\in S\,]\,\,\Leftrightarrow\,\,[\,(\,x\in\R\,)\,\&\,(\,x^2=a\,)\,]\,\,)$.
\end{axiom}

Here is another specification triple:
\begin{itemize}
\item[(1)]$x^2=4$ \qquad ,
\item[(2)]$x$ \qquad  and
\item[(3)]$\R$ \qquad .
\end{itemize}
To get the corresponding Axiom of Specification,
look at all the free variables, {\it except} the one in (2).
There are none.
The axiom reads:
\begin{axiom}\wrlab{axiom-eg5-spec}
$\exists1$set $S$, denoted $\{x\in\R\,|\,x^2=4\}$,\\
\phx\qquad\qquad s.t., $\forall x$, $(\,\,[\,x\in S\,]\,\,\Leftrightarrow\,\,[\,(\,x\in\R\,)\,\&\,(\,x^2=4\,)\,]\,\,)$.
\end{axiom}

In high school algebra one learns that
the solutions of $x^2=4$ are $-2$ and $2$.
We express that result as a theorem:

\begin{thm}\wrlab{thm-sqrts-of-four}
\qquad $\{x\in\R\,|\,x^2=4\}\quad=\quad\{-2,2\}$.
\end{thm}

The focus on the variable $x$ is somewhat arbitrary.
We also have:

\begin{thm}\wrlab{thm-sqrts-of-four-using-z}
\qquad $\{z\in\R\,|\,z^2=4\}\quad=\quad\{-2,2\}$.
\end{thm}

Because this is a real analysis course,
and not a complex analysis course,
our formalism is focused on $\R$.
You may have learned, in high school, that $(1+i)^2=2i$,
but, for us, this is not a theorem.
Consequently, we do {\it NOT} have a theorem
that says
$$\{z\in\C\,|\,z^2=2i\}\quad=\quad\{1+i,-1-i\}.$$
In fact, $\C$ is not a set in this course,
and ``$z^2=2i$'' is not a formal statement.
So we do not have a specification axiom that defines
the set $\{z\in\C\,|\,z^2=2i\}$.
The point is: There are many formal systems of~mathematics.
We are tailoring ours to this particular course.

Now that we have specification, we can define
many useful sets.

\begin{defn}\wrlab{defn-real-intervals}
$\forall a,b\in\R^*$,
\begin{itemize}
\item[]$[a;b]:=\{x\in\R^*\,|\,a\le x\le b\}$,
\item[]$(a;b):=\{x\in\R^*\,|\,a<x<b\}$,
\item[]$[a;b):=\{x\in\R^*\,|\,a\le x<b\}$ \quad  and
\item[]$(a;b]:=\{x\in\R^*\,|\,a<x\le b\}$.
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-1point3-2point6}
$1.3:=1+(3/10)$ and $2.6:=2+(6/10)$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-real-intervals}
$[1.3;1.3]=\{1.3\}$, $1.3\notin(1.3;2.6]$, $2.6\in(1.3;2.6]$,\\
\phx\qquad\qquad$(2.6;2.6)=[2.6;1.3)=[2.6;1.3]=\emptyset$.
\end{thm}

\begin{defn}\wrlab{defn-Zstar}
$\Z^*:=\Z\cup\{-\infty,\infty\}$.
\end{defn}

Elements of $\Z^*$ are called \bfindex[extended integers].

\begin{defn}\wrlab{defn-integer-intervals}
$\forall a,b\in\R^*$,
\begin{itemize}
\item[]$[a..b]:=\{x\in\Z^*\,|\,a\le x\le b\}$ \quad ,
\item[]$(a..b):=\{x\in\Z^*\,|\,a<x<b\}$ \quad ,
\item[]$[a..b):=\{x\in\Z^*\,|\,a\le x<b\}$ \quad  and
\item[]$(a..b]:=\{x\in\Z^*\,|\,a<x\le b\}$ \quad .
\end{itemize}
\end{defn}

\begin{thm}\wrlab{thm-eg1-integer-intervals}
$[1..1]=\{1\}$ and $(1..2]=\{2\}$ and \\
\phx\qquad\qquad $(1.3..2.6)=\{2\}$ and $(2..2)=[2..2)=(2..2]=[2..1)=\emptyset$.
\end{thm}

\begin{defn}\wrlab{defn-N-N0-Nstar}
$\N:=[1..\infty)$, \quad $\N_0:=[0..\infty)$,\\
\phx\qquad\qquad\qquad\qquad $\N^*:=[1..\infty]$, \quad $\N_0^*:=[0..\infty]$.
\end{defn}

\begin{defn}\wrlab{defn-diff-pair-sets}
Let $A$ and $B$ be sets.\\
\phx\qquad Then we define \quad
$A\backslash B\,:=\,\{x\in A\,|\,x\notin B\}$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-diff-pair-sets}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.\\
\phx\qquad Then \quad
$A\backslash B\quad=\quad\{5,6\}$.
\end{thm}

\begin{defn}\wrlab{defn-rational-numbers}
\qquad $\Q\,\,:=\,\,\{\,\,j/k\in\R\,\,|\,\,(\,j\in\Z\,)\,\,\&\,\,(\,k\in\N\,)\,\}$.
\end{defn}

According to specification, between ``$\{$'' and ``$|$'',
we {\it should} have:
\begin{itemize}
\item[]a single variable, \quad then ``$\in$'' \quad then a set \qquad.
\end{itemize}
The logic purist would therefore do some rewriting of \dref{defn-rational-numbers}:
$$\Q\,\,:=\,\,\{x\in\R\,|\,\exists j\in\Z,\exists k\in\N~\hbox{s.t.}~j/k=x\}.$$
Elements of $\Q$ are called \bfindex[rational numbers].

\section{Upper bounds, lower bounds, max, min, sup and inf}

\begin{defn}\wrlab{defn-set-inequalities}
$\forall S\subseteq\R^*$,
$\forall a\in\R^*$,
\begin{itemize}
\item[]$S\le a$ means: \qquad $\forall x\in S$, $x\le a$ \qquad\qquad ,
\item[]$a\ge S$ means: \qquad $\forall x\in S$, $a\ge x$ \qquad\qquad ,
\item[]$a\le S$ means: \qquad $\forall x\in S$, $a\le x$ \qquad\qquad ,
\item[]$S\ge a$ means: \qquad $\forall x\in S$, $x\ge a$ \qquad\qquad ,
\item[]$S<a$ means: \qquad $\forall x\in S$, $x<a$ \qquad\qquad ,
\item[]$a>S$ means: \qquad $\forall x\in S$, $a>x$ \qquad\qquad ,
\item[]$a<S$ means: \qquad $\forall x\in S$, $a<x$ \qquad\qquad and
\item[]$S>a$ means: \qquad $\forall x\in S$, $x>a$ \qquad\qquad .
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-UB-LB}
$\forall S\subseteq\R^*$,
\begin{itemize}
\item[]$\UB(S):=\{a\in\R^*\,|\,S\le a\}$ \quad and \quad $\LB(S):=\{a\in\R^*\,|\,a\le S\}$.
\end{itemize}
\end{defn}

We also define $\UB(\frownie):=\frownie$.

\begin{defn}\wrlab{defn-max-min}
$\forall S\subseteq\R^*$,
\begin{itemize}
\item[]$\max(S):=\UE(S\cap[\UB(S)])$ and $\min(S):=\UE(S\cap[\LB(S)])$.
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-sup-inf}
$\forall S\subseteq\R^*$,
\begin{itemize}
\item[]$\sup(S):=\min(\UB(S))$ \quad and \quad $\inf(S):=\max(\LB(S))$.
\end{itemize}
\end{defn}

Here, ``$\sup(S)$'' is read ``the supremum of $S$''.
Sometimes ``supremum'' is abbreviated to ``sup'', which is read ``soup''.
We sometimes change ``$\min$'' to ``least''
and ``$\UB$'' to ``upper bound'',
and then ``$\sup$'' becomes ``least upper bound''.

Also, ``$\inf(S)$'' is read ``the infimum of $S$''.
Sometimes ``infimum'' is abbreviated to ``inf'', which is read as written.
We sometimes change ``$\max$'' to ``greatest''
and ``$\LB$'' to ``lower bound'',
and then ``$\inf$'' becomes ``greatest lower bound''.
Some examples:

\begin{center}
\begin{tabular}{|c||c|c|c|c|c|c|}
\hline
 $S$ & $\LB$ & $\UB$ & $\min$ & $\max$ & $\inf$ & $\sup$ \\ 
\hline\hline
$\{5\}$ & $[-\infty;5]$ & $[5;\infty]$ & $5$ & $5$ & $5$ & $5$ \\  \hline
$[0;1]$ & $[\infty;0]$ & $[1;\infty]$ & $0$ & $1$ & $0$ & $1$ \\  \hline
$(0;1)$ & $[\infty;0]$ & $[1;\infty]$ & \frownie & \frownie & $0$ & $1$ \\  \hline
$[0;1)$ & $[\infty;0]$ & $[1;\infty]$ & $0$ & \frownie & $0$ & $1$ \\  \hline
$(0;1]$ & $[\infty;0]$ & $[1;\infty]$ & \frownie & $1$ & $0$ & $1$ \\  \hline
$\{0,1\}$ & $[\infty;0]$ & $[1;\infty]$ & $0$ & $1$ & $0$ & $1$ \\ \hline
$\R^*$ & $\{-\infty\}$ & $\{\infty\}$ & $-\infty$ & $\infty$ & $-\infty$ & $\infty$ \\  \hline
$\R$ & $\{-\infty\}$ & $\{\infty\}$ & \frownie & \frownie & $-\infty$ & $\infty$ \\  \hline
$\emptyset$ & $\R^*$ & $\R^*$ & \frownie & \frownie & $\infty$ & $-\infty$ \\  \hline
\end{tabular}
\end{center}

\vskip.1in
Up to this point, all of our axioms about $\R$ would be equally true about $\Q$.
There is, however, a significant problem with trying to do real analysis using only
rational numbers: Let $S:=\{x\in\Q\,|\,x^2\le2\}$.
It turns out that the supremum of $S$ is {\it NOT} a rational number,
so, working over $\Q$ has the disadvantage that
not every subset of $\Q$ has its supremum in $\Q$.
Since $\sup\R=\infty$, we are aslo forced into working in~$\R^*$
if we want to guarantee infima and suprema.
And we do!
The next axiom is called \bfindex[completeness of the extended reals]:

\begin{axiom}\wrlab{axiom-completeness-of-reals}
$\forall S\subseteq\R^*$, \quad $\inf(S)\ne\frownie\ne\sup(S)$.
\end{axiom}

\begin{thm}\wrlab{thm-sqrt}
$\forall a\in[0;\infty)$, $\exists1 r\in[0;\infty)$ s.t.~$r^2=a$.
\end{thm}

More formally, \tref{thm-sqrt} would be written:
\begin{itemize}
\item[]$(\forall a)\,(\,[\,a\in[0;\infty)\,]\,\Rightarrow\,[$
\begin{itemize}
\item[]$(\,\,(\exists r)\,(\,[r\in[0;\infty)\,]\,\&\,[\,r^2=a\,]\,)\,\,)\,\,\&$
\item[]$(\,\,(\forall r)\,(\,(\forall s)\,($
\begin{itemize}
\item[]$(\quad[\,r\in[0;\infty)\,]\,\&\,[\,s\in[0;\infty)\,]\,\&$
\item[]\qquad\qquad$[\,r^2=a\,]\,\&\,[\,s^2=a\,]\quad)$
\item[]\qquad$\Rightarrow\quad(\quad r=s\quad)$
\end{itemize}
\item[]\qquad\qquad$\,)\,\,)\,\,)$
\end{itemize}
\item[]\qquad\qquad\qquad$]\,)$ \quad .
\end{itemize}

\begin{thm}\wrlab{thm-no-sqrt}
$\forall a\in(-\infty;0)$, $\not\exists r\in\R$ s.t.~$r^2=a$.
\end{thm}

More formally, \tref{thm-no-sqrt} would be written:
\begin{itemize}
\item[]$(\forall a)\,(\,[a\in(-\infty;0)\,]\,\Rightarrow\,[$
\begin{itemize}
\item[]$\neg(\,(\exists r)\,(\,[r\in\R]\,\&\,[r^2=a]\,)\,)$
\end{itemize}
\item[]\qquad\qquad\qquad $]\,)$.
\end{itemize}

\begin{defn}\wrlab{defn-squareroot}
$\forall a\in\R$, \quad $\sqrt{a}:=\UE\{r\in[0;\infty)\,|\,r^2=a\}$.
\end{defn}

By \tref{thm-sqrt},
$\forall a\in[0;\infty)$, $\sqrt{a}\in[0;\infty)$.
On the other hand, by~\tref{thm-no-sqrt},
$\forall a\in(-\infty;0)$, $\sqrt{a}=\frownie$.

In this course,
when we write $a\,\,{}^\frown\!\!\in\,S$,
we mean: $(\,a=\frownie\,)\,\vee\,(\,a\in S\,)$.

\begin{thm}\wrlab{thm-min-in-set}
$\forall S\subseteq\R^*$, \quad $(\,\min S\,\,{}^\frown\!\!\in S\,)\,\&\,(\,\max S\,\,{}^\frown\!\!\in S\,)$.
\end{thm}

\noindent
In this course, when we write $a\,\,{}^\frown\!\!<\,b$, we mean: $(\,a=\frownie\,)\,\vee\,(\,a<b\,)$.
In this course, when we write $a\,\,{}^\frown\!\!>\,b$, we mean: $(\,a=\frownie\,)\,\vee\,(\,a>b\,)$.
In this course, when we write $a\,\,{}^\frown\!\!\le\,b$, we mean: $(\,a=\frownie\,)\,\vee\,(\,a\le b\,)$.
In this course, when we write $a\,\,{}^\frown\!\!\ge\,b$, we mean: $(\,a=\frownie\,)\,\vee\,(\,a\ge b\,)$.
In this course, when we write $a\,<^\frown\,b$, we mean: $(\,a<b\,)\,\vee\,(\,b=\frownie\,)$.
In this course, when we write $a\,>^\frown\,b$, we mean: $(\,a>b\,)\,\vee\,(\,b=\frownie\,)$.
In this course, when we write $a\,\le^\frown\,b$, we mean: $(\,a\le b\,)\,\vee\,(\,b=\frownie\,)$.
In this course, when we write $a\,\ge^\frown\,b$, we mean: $(\,a\ge b\,)\,\vee\,(\,b=\frownie\,)$.

\begin{thm}\wrlab{thm-min-le-set}
$\forall S\subseteq\R^*$, \quad $(\,\min S\,\,{}^\frown\!\!\le\,S\,)\,\&\,(\,\max S\,\,{}^\frown\!\!\ge\,S\,)$.
\end{thm}

\begin{thm}\wrlab{thm-inf-le-set}
$\forall S\subseteq\R^*$, \quad $(\,\inf S\,\le\,S\,)\,\&\,(\,\sup S\,\ge\,S\,)$.
\end{thm}

\begin{axiom}\wrlab{axiom-sup-N-infty}
\qquad $\sup\N=\infty$.
\end{axiom}

\section{Unassigned homework}

\begin{thm}\wrlab{thm-min-pos-set-is-pos}
$\forall S\subseteq\R^*$, \quad $[\,\,(\,S>0\,)\,\Rightarrow\,(\,\min S\,\,{}^\frown\!\!>0)\,)\,\,]$.
\end{thm}

\begin{thm}\wrlab{thm-finding-the-min}
$\forall S\subseteq\R^*$, $\forall x\in S$, \quad
$[\,(\,x\le S\,)\,\Rightarrow\,(\,\min S=x\,)\,]$.
\end{thm}

\begin{thm}\wrlab{thm-min-two-elts-exists}
$\forall a,b\in\R^*$, $[\,(\min\{a,b\}=a)\,\vee\,(\min\{a,b\}=b)\,]$.
\end{thm}

\begin{thm}\wrlab{thm-min-two-pos-is-pos}
$\forall a>0,\,\forall b>0$, \quad $\min\{a,b\}>0$.
\end{thm}

\begin{thm}\wrlab{thm-min-two-is-le-both}
$\forall a,b\in\R^*$, $[\,\,(\,\min\{a,b\}\le a\,)\,\&\,(\,\min\{a,b\}\le b\,)\,\,]$.
\end{thm}

\begin{thm}\wrlab{thm-pos-over-pos-is-pos}
$\forall\varepsilon>0$, $\forall a>0$, \quad $\varepsilon/a>0$.
\end{thm}

\begin{thm}\wrlab{thm-sqrt-pos-is-pos}
$\forall x>0$, \quad $\sqrt{x}>0$.
\end{thm}

\begin{thm}\wrlab{thm-square-inequality}
$\forall a,b\in\R$, \quad $[\,\,(\,0\le a\le b\,)\,\Rightarrow\,(\,a^2\le b^2\,)\,\,]$.
\end{thm}

We cannot square the inequality $-2<-1$; in fact, $(-2)^2>(-1)^2$.
So, in \tref{thm-square-inequality}, the assumption that $0\le a$ is important.

\begin{thm}\wrlab{thm-add-inequalities}
$\forall a,b,c,d\in\R$,\\
\phx\qquad\qquad$(\,\,[\,a<b\,]\,\,\&\,\,[\,c<d\,]\,\,)\,\Rightarrow\,(\,\,a+c<b+d\,\,)$.
\end{thm}

\begin{thm}\wrlab{thm-ge0-implies-sqofsqrt-is-id}
$\forall s>0$, \quad $(\sqrt{s})^2=s$.
\end{thm}

\begin{thm}\wrlab{thm-half-plus-half}
$\forall\varepsilon\in\R$, \quad $(\varepsilon/2)+(\varepsilon/2)=\varepsilon$.
\end{thm}

\begin{thm}\wrlab{thm-compare-1squared-plus-1}
\qquad $1^2+1<100<1000$.
\end{thm}

\begin{thm}\wrlab{thm-compare-point00001squared-plus-point00001}
\qquad $0.00001^2+0.00001<0.001$.
\end{thm}

\section{A doubly quantified theorem, redux}\wrlab{sect-dbly-quant-thm-redux}

We next discuss the art of proof-writing,
with a focus on proving \tref{thm-eg1-deltaformula-lt-epsilon}.
In writing proofs,
the most common mistake made by~students in this course
is failure to follow the
\bfindex[Cardinal Binding Rule]:
\begin{itemize}
\item[]You must {\bf bind} a variable before you use it.
\end{itemize}
In any proof, {\it ANY} time you use a variable, you {\it MUST} be able to~tell me
where you did the binding of that variable,
and that binding must happen {\it before} the variable is used.
Otherwise, you lose some credit.
There is only one exception to this rule,
see \secref{sect-how-to-define-fn}.
Also tricky: Some bindings are temporary,
and only last until the end of the clause in~which they appear.
For example, suppose, in~a~homework, I see
\begin{itemize}
\item[]$(\,\forall x\in S,\,x>3\,)\,\&\,(\,x+5\hbox{ is an integer}\,)$ \quad .
\end{itemize}
Then the binding on $x$ expires before ``$x+5\hbox{ is an integer}$'',
and the student will lose some credit.
By contrast, if I see
\begin{itemize}
\item[]$\forall x\in S,\,[\,(\,x>3\,)\,\&\,(\,x+5\hbox{ is an integer}\,)\,]$ \quad ,
\end{itemize}
then the binding continues to ``$]$'', so there is no problem.

For the logic purist, each time ``$(\forall x)(\dots\dots)$''
or ``$(\exists x)(\dots\dots)$'' appears,
the binding of the variable $x$ continues inside ``$(\dots\dots)$''.
Immediately after ``$)$'', that binding expires.
This is a straightforward rule.
In less formal (``pidgin'') mathematical writing,
to follow the Cardinal Binding Rule,
it helps to know how to formalize pidgin statements,
to~determine where their clauses begin and end.

The past participle of ``to bind'' is ``bound''; it is NOT ``bounded''.
After you bind a variable, it becomes \bfindex[bound], NOT bounded.
Confusion arises because the verb ``to bound''
is also used frequently in~mathematics,
and the past participle of~``to~bound'' is ``bounded''.
After you bound a variable, it becomes bounded.
Within this section, we will bound no variables; we only bind them.
So, in this section, no~variables become bounded; they become bound.

Free is the opposite of bound.
To say that a variable is \bfindex[free]
is to~say that it is not bound.
Read everything in the Exposition Handout (\bfindex[EH])
up to, but not including, (7) on pp.~1--3.
This describes how to tell if~a given variable is free or bound.
Recall \tref{thm-eg1-deltaformula-lt-epsilon}, which we restate:

\begin{thm}\wrlab{thm-eg1-deltaformula-lt-epsilon-redux}
$\forall\varepsilon>0$,
$\exists\delta>0$~s.t.~$\delta^2+\delta\le\varepsilon$.
\end{thm}

Recall, from \secref{sect-dbly-quant-thm},
that \tref{thm-eg1-deltaformula-lt-epsilon-redux}
is doubly quantified:
There is one ``$\forall$'' quantifier, and one ``$\exists$'' quantifier.

In this section, we explain how to write a proof
of \tref{thm-eg1-deltaformula-lt-epsilon-redux}.
First, observe that, in \tref{thm-eg1-deltaformula-lt-epsilon-redux},
\begin{itemize}
\item[]the quantifier ``$\forall$'' binds the variable ``$\varepsilon$'' \quad and
\item[]the quantifier ``$\exists$'' binds the variable ``$\delta$'',
\end{itemize}
but both of these bindings are temporary,
and they expire at the end of~the sentence.
So, as we begin our proof, there are NO bound variables.
We therefore cannot use any variables, until some binding happens.
Now read (7)--(12) on the EH, pp.~3--4.

At the start of our proof, we will implement Template (10) on p.~4 of the EH.
Following it, we write:
\begin{itemize}
\item[]Given $\varepsilon>0$.
\item[]Want: $\exists\delta>0$~s.t.~$\delta^2+\delta\le\varepsilon$.
\end{itemize}
At this point, the variable ``$\varepsilon$'' is bound until the end of the proof,
and that is the only bound variable.
The variable ``$\delta$'' was temporarily bound,
but that binding expired at the end of its sentence.

We next implement Template (11) on p.~4 of the EH.
Following it, we leave a~blank space,
and keep in mind that, somewhere in that blank space,
a~line must eventually appear that binds the variable $\delta$,
and, moreover, it is important that $\delta>0$.
We will refer to this blank space as our ``$\delta$-strategy''.
After this blank space, we write:
\begin{itemize}
\item[]Want: $\delta^2+\delta\le\varepsilon$.
\end{itemize}
Then we leave a blank space for the remainder of the proof,
followed by a small rectangular box.
We will call this second blank space the ``finish''.
At this point we have finished \bfindex[structuring the proof],
and the proof has the following apperance:

\begin{proof}
Given $\varepsilon>0$. \qquad
Want: $\exists\delta>0$~s.t.~$\delta^2+\delta\le\varepsilon$.\\
BLANK SPACE FOR $\delta$-strategy.\\
Want: $\delta^2+\delta\le\varepsilon$.\\
BLANK SPACE FOR finish.
\end{proof}

For a proof of a doubly quantified theorem, if you can even
structure the proof correctly, then you should receive substantial credit,
typically about one third of the available points.
The structuring of a proof is straightforward:
You just untangle the quantifiers,
carefully following templates (10)--(12) on p.~4 of the EH,
leaving blank spaces as needed.

The hard part comes next: We must fill in the blanks,
which typically requires that you
both understand the proof as a game and know a~winning strategy.
It also requires that you {\it communicate} that strategy,
following all of the rules in the Exposition Handout (EH).

In the case of \tref{thm-eg1-deltaformula-lt-epsilon-redux},
recall the strategy from \secref{sect-dbly-quant-thm}:
\begin{itemize}
\item[]Let $\delta:=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$.
\end{itemize}
Because $\varepsilon>0$, by \tref{thm-pos-over-pos-is-pos} and \tref{thm-sqrt-pos-is-pos},
it follows that both $\varepsilon/2$ and $\sqrt{\varepsilon/2}$ are positive.
Then, by \tref{thm-min-two-pos-is-pos}, $\delta>0$.
So our $\delta$-stragtegy could be expressed as follows:
\begin{itemize}
\item[]Let $\delta:=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$. \qquad Then $\delta>0$.
\end{itemize}
All we have left is the finish.

Read (24) on p.~8.
We cannot stop until we {\it KNOW} that
$\delta^2+\delta\le\varepsilon$.
Read (25) on p.~8.
We {\it MUST} stop once we know that
$\delta^2+\delta\le\varepsilon$.

Following \tref{thm-min-two-is-le-both},
because $\delta=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$,
we consider the inequalities
$\delta\le\sqrt{\varepsilon/2}$ and $\delta\le\varepsilon/2$
to be obvious.
Then, by \tref{thm-ge0-implies-sqofsqrt-is-id},
$(\sqrt{\varepsilon/2})^2=\varepsilon/2$.
Finally, by \tref{thm-half-plus-half},
$(\varepsilon/2)+(\varepsilon/2)=\varepsilon$.
So, knowing \tref{thm-square-inequality}
and \tref{thm-add-inequalities},
the finish might read:
\begin{itemize}
\item[]$0\le\delta\le\sqrt{\varepsilon/2}$, so $\delta^2\le\varepsilon/2$.
\item[]$\delta\le\varepsilon/2$ and $\delta^2\le\varepsilon/2$, so $\delta+\delta^2\le\varepsilon$.
\end{itemize}
By (24) and (25) of the EH, we must stop writing because what we know matches what we want.
The full proof now reads:

\begin{proof}
Given $\varepsilon>0$. \qquad
Want: $\exists\delta>0$~s.t.~$\delta^2+\delta\le\varepsilon$.\\
Let $\delta:=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$. \qquad
Then $\delta>0$.\\
Want: $\delta^2+\delta\le\varepsilon$.\\
$0\le\delta\le\sqrt{\varepsilon/2}$, so $\delta^2\le\varepsilon/2$.\\
$\delta\le\varepsilon/2$ and $\delta^2\le\varepsilon/2$, so $\delta+\delta^2\le\varepsilon$.
\end{proof}

Question for discussion:
Suppose, in some proof, a student shows that $\delta>0$, and, somewhere after that, writes
\begin{itemize}
\item[]$\delta\le\sqrt{\varepsilon/2}$, so $\delta^2\le\varepsilon/2$
\end{itemize}
instead of
\begin{itemize}
\item[]$0\le\delta\le\sqrt{\varepsilon/2}$, so $\delta^2\le\varepsilon/2$ \qquad .
\end{itemize}
Is this bad style?
Should it result in a loss of credit?
I say yes.
Recall: We cannot square the inequality $-2<-1$; in fact, $(-2)^2>(-1)^2$.

For some students, it may be tempting to replace
\begin{itemize}
\item[]$0\le\delta\le\sqrt{\varepsilon/2}$, so $\delta^2\le\varepsilon/2$
\end{itemize}
by
\begin{itemize}
\item[]$0\le\delta\le\sqrt{\varepsilon/2}$ \quad $\Rightarrow$ \quad $\delta^2\le\varepsilon/2$ \qquad .
\end{itemize}
However, this is bad style, and would lead to a loss of credit.
The problem is that we {\it KNOW} that $0\le\delta\le\sqrt{\varepsilon/2}$,
so this statement does not belong on the left of $\Rightarrow$.
When we say $A\Rightarrow B$, the understood meaning is
``I am not sure if $A$ is true, but if it should turn out to~be true, then $B$ must be true as well.''
Typically, someone who knows for~sure that it is raining outside would not say:
``If it is raining outside, then I will need my umbrella.''
Instead, they would say:
``It is raining outside, so I will need my umbrella.''
For more explanation of this, read (26) on pp.~8--9 of the EH.
I accept ``$\therefore$'' as an abbreviation for ``therefore'' or ``so''.
Consequently, if you wish, you may replace
\begin{itemize}
\item[]$0\le\delta\le\sqrt{\varepsilon/2}$, so $\delta^2\le\varepsilon/2$
\end{itemize}
by
\begin{itemize}
\item[]$0\le\delta\le\sqrt{\varepsilon/2}$ \quad $\therefore$ \quad $\delta^2\le\varepsilon/2$ \qquad .
\end{itemize}

\section{Three subtleties in mathematical logic}

First, we discuss \bfindex[null true] statements.
Let $\bfP$ and $\bfQ$ be formal statements,
and suppose we are, for some reason, interested in proving that $\bfP\Rightarrow\bfQ$.
The rules of inference are set up in such a way that,
if~we~can prove $\neg\bfP$, then $\bfP\Rightarrow\bfQ$ follows.
One sometimes expresses this by~saying that $\bfP\Rightarrow\bfQ$ is ``null true'',
because $\bfP$ is false.
Example:

\begin{thm}\wrlab{thm-3lt3-implies-1equals2}
\quad $(3\ne3)\,\,\Rightarrow\,\,(1=2)$.
\end{thm}

Read (13), p.~7 of the Exposition Handout, on proof by contradiction.

\begin{proof}
Assume $3\ne3$. \qquad
Want: $1=2$.\\
Assume $1\ne2$. \qquad
Want: Contradiction.\\
$3\ne3$. \quad
By \aref{axiom-equals-itself}, $3=3$. \quad
Contradiction.
\end{proof}

Keep in mind:\\
\phantom{xxxx}any false statement \quad implies \quad every statement, true or false.\\
So be careful what you believe in!

Second, we apply null truth to the empty set $\emptyset$,
obtaining \bfindex[void true] statements.
For example, the two statements
\begin{itemize}
\item[]$\forall u\in\emptyset,\qquad u=9$
\end{itemize}
and
\begin{itemize}
\item[]$\forall u\in\emptyset,\qquad u\ne9$
\end{itemize}
are {\it both} true.
In fact, for any formal statement $\bfP$,
if $u$ is the only free variable in $\bfP$, then
\begin{itemize}
\item[]$\forall u\in\emptyset,\qquad\bfP$
\end{itemize}
is a theorem.
For example:

\begin{thm}\wrlab{thm-in-emptyset-implies-equalto9}
$\forall u\in\emptyset$, $u=9$.
\end{thm}

\begin{proof}
Given $u\in\emptyset$. \qquad
Want: $u=9$.\\
Assume $u\ne9$. \qquad
Want: Contradiction.\\
$u\in\emptyset$. \quad
By \aref{axiom-emptyset}, $u\notin\emptyset$. \quad
Contradiction.
\end{proof}

\begin{thm}\wrlab{thm-emptyset-subset-of-all-sets}
$\forall$set $A$, $\emptyset\subseteq A$.
\end{thm}

\begin{proof}
Given a set $A$. \qquad
Want: $\emptyset\subseteq A$.\\
Want: $\forall x\in\emptyset$, $x\in A$.\\
Given $x\in\emptyset$. \qquad
Want: $x\in A$.\\
Assume $x\notin A$. \qquad
Want: Contradiction.\\
$x\in\emptyset$. \quad
By \aref{axiom-emptyset}, $x\notin\emptyset$. \quad
Contradiction.
\end{proof}

The following is \tref{thm-emptyset-set-of-sets}:

\begin{thm}\wrlab{thm-emptyset-set-of-sets-repeat}
$\emptyset$ is a set of sets.
\end{thm}

\begin{proof}
Know: $\emptyset$ is a set.\\
Want: $\forall A\in\emptyset$, $A$ is a set.\\
Given $A\in\emptyset$. \qquad
Want: $A$ is a set.\\
Assume $A$ is not a set. \qquad
Want: Contradiction.\\
$A\in\emptyset$. \quad
By \aref{axiom-emptyset}, $A\notin\emptyset$. \quad
Contradiction.
\end{proof}

The following is \tref{thm-union-emptyset}:

\begin{thm}\wrlab{thm-union-emptyset-repeat}
\qquad$\bigcup\emptyset=\emptyset$.
\end{thm}

\begin{proof}
By \tref{thm-emptyset-subset-of-all-sets},
$\emptyset\subseteq\bigcup\emptyset$.\\
So, by the Axiom of Extensionality (\aref{axiom-extensionality}),\\
Want: $\bigcup\emptyset\subseteq\emptyset$.\\
Want: $\forall x\in\bigcup\emptyset$, $x\in\emptyset$.\\
Given $x\in\bigcup\emptyset$. \qquad
Want: $x\in\emptyset$.\\
Assume $x\notin\emptyset$. \qquad
Want: Contradiction.\\
Since $x\in\bigcup\emptyset$, choose $A\in\emptyset$ s.t.~$x\in A$.\\
Then $A\in\emptyset$. \quad
By \aref{axiom-emptyset}, $A\notin\emptyset$. \quad
Contradiction.
\end{proof}

Third, the \bfindex[inclusive or].
When Hamlet says, ``To be or not to be'',
it is understood that a choice must be made.
Hamlet cannot decide both both to ``be'' and ``not be'' at the same time.
However, this is {\it not} how ``or'' is used in mathematics.
The rules of inference are set up in~such a way that,
for any two formal statements $\bfP$ and $\bfQ$,
if both $\bfP$ and $\bfQ$ are known,
then $\bfP\vee\bfQ$ is known.
So for eample, we have:

\begin{thm}\wrlab{thm-semipos-or-semineg}
$\forall x\in\R^*$, \quad $[\,(\,x\le0\,)\,\vee\,(\,x\ge 0\,)\,]$.
\end{thm}

Read (16)--(17) on p.~6 of the Exposition Handout (EH).

\begin{proof}
Given $x\in\R^*$. \qquad
Want: $(\,x\le0\,)\,\vee\,(\,x\ge 0\,)$.\\
By \aref{axiom-trichotomy}, one of the following is true:
\begin{itemize}
\item[(1)]$x<0$,
\item[(2)]$x=0$ \qquad or
\item[(3)]$x>0$.
\end{itemize}

\noindent
{\it Case (1):}\\
Since $x<0$, $x\le0$, so $[\,(\,x\le0\,)\,\vee\,(\,x\ge 0\,)\,]$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Since $x=0$, $x\le0$, so $[\,(\,x\le0\,)\,\vee\,(\,x\ge 0\,)\,]$.\\
{\it End of Case (2).}\\
\\
{\it Case (3):}\\
Since $x>0$, $x\ge0$, so $[\,(\,x\le0\,)\,\vee\,(\,x\ge 0\,)\,]$.\\
{\it End of Case (3).}
\end{proof}

\section{Unassigned homework}

\begin{thm}\wrlab{thm-transitivity-le}
$\forall x,y,z\in\R^*$, \quad $(x\le y\le z)\Rightarrow(x\le z)$.
\end{thm}

\begin{thm}\wrlab{thm-improved-square-inequality}
$\forall a,b,c\in\R$, \quad $[\,\,(\,0\le a\le b\le c\,)\,\Rightarrow\,(\,a^2\le c^2\,)\,\,]$.
\end{thm}

\section{A triply quantified theorem with implication}

In this section, we explain how to write a proof of:

\begin{thm}\wrlab{thm-eg1-triply-quant-with-implication}
$\forall\varepsilon>0$,
$\exists\delta>0$~s.t., $\forall x\in\R$,
$$[\,\,0\le x\le\delta\,\,]\quad\Rightarrow\quad[\,\,x^2+x\le\varepsilon\,\,].$$
\end{thm}

There are two ``$\forall$'' quantifiers, one ``$\exists$'' quantifier and one ``$\Rightarrow$'',
so we describe \tref{thm-eg1-triply-quant-with-implication} as:
triply quantified with implication.

We begin by structuring the proof, using
\begin{itemize}
\item[](10) on p.~4, for ``$\forall\varepsilon>0,\ldots\ldots$'', \quad then
\item[](11) on p.~4, for ``$\exists\delta>0~\hbox{s.t.}~\ldots\ldots$'', \quad then
\item[](10) on p.~4, for ``$\forall x\in\R,\ldots\ldots$'', \qquad then
\item[](12) on p.~4, for ``$[\cdots\cdots]\Rightarrow[\cdots\cdots]$'' \quad .
\end{itemize}
This yields:

\begin{proof}
Given $\varepsilon>0$.\\
Want: $\exists\delta>0$~s.t., $\forall x\in\R$,\quad
$(\,\,[\,0\le x\le\delta\,]\,\Rightarrow\,[\,x^2+x\le\varepsilon\,]\,\,)$.\\
BLANK SPACE FOR $\delta$-strategy.\\
Want: $\forall x\in\R$,\quad
$(\,\,[\,0\le x\le\delta\,]\,\Rightarrow\,[\,x^2+x\le\varepsilon\,]\,\,)$.\\
Given $x\in\R$. \qquad
Want: $[\,\,0\le x\le\delta\,\,]\,\,\Rightarrow\,\,[\,\,x^2+x\le\varepsilon\,\,]$.\\
Assume: $0\le x\le\delta$. \qquad
Want: $x^2+x\le\varepsilon$.\\
BLANK SPACE FOR finish.
\end{proof}

The first blank area is for our ``$\delta$-strategy'',
within which $\delta$ must become bound, satisfying $\delta>0$.
The second blank area is for our ``finish''.
In this second blank area, we must show that $x^2+x\le\varepsilon$.
Also, once we have proven $x^2+x\le\varepsilon$, we {\it MUST} immediately STOP.

\tref{thm-eg1-triply-quant-with-implication} is triply quantified with implication,
and, for the structuring of a proof of that kind of statement,
I would typically give half credit.
This is a good deal, so learn the structuring process.
In~particular, learn p.~4 of the Exposition Handout.

To go further, it helps to turn \tref{thm-eg1-triply-quant-with-implication}
into a game:
\begin{itemize}
\item[]You move first: You choose a real $\varepsilon>0$, and reveal it to me.
\item[]My move: I choose $\delta>0$, and reveal it to you.
\item[]Your move: You choose $x\in\R$, and reveal it to me.
\item[]We check to see if $[0\le x\le\delta]\Rightarrow[x^2+x\le\varepsilon]$.
\begin{itemize}
\item[]If so, then I win.
\item[]If not, then you win.
\end{itemize}
\end{itemize}
Remember that, if you choose $x$ so that $\neg[0\le x\le\delta]$, then the implication
\begin{itemize}
\item[]$[0\le x\le\delta]\Rightarrow[x^2+x\le\varepsilon]$
\end{itemize}
is ``null true'', and so I will win.
So you are effectively forced to choose $x$ satisfying $0\le x\le\delta$.
if you want to have any hope of winning.
For that reason, it is common to revise the game,
and make it part of the rules that your choice of~$j$ must satisfy $j\ge K$.
This revised game reads:
\begin{itemize}
\item[]You move first: You choose a real $\varepsilon>0$, and reveal it to me.
\item[]My move: I choose $\delta>0$, and reveal it to you.
\item[]You move: You choose a $x\in\R$ s.t.~$0\le x\le\delta$, and reveal it to me.
\item[]We check to see if $x^2+x\le\varepsilon$.
\begin{itemize}
\item[]If so, then I win.
\item[]If not, then you win.
\end{itemize}
\end{itemize}

Let's play.
Say you choose $\varepsilon=100$.
I will laugh at your poor play, and choose $\delta=3$.
You choose, say, $x=1$.
Since $1^2+1\le100$, I win.
We play again.
You try $\varepsilon=1000$.
I laugh even harder, and choose $\delta=3$ again.
Maybe this time, you try $x=2$.
Since $2^2+2\le100$, I win.
You begin to see that making $\varepsilon$ large is not in your interest.
However, by the rules, you cannot make it negative or zero.
You try $\varepsilon=0.001$.
Now I have to concentrate.
I choose $\delta=0.00001$.
You begin to understand that your goal, in choosing $x$,
is to make $x$ as large as~possible,
so that  $x^2+x$ will be large.
However, you face a constraint:
You are required to choose $x$ so that $0\le x\le0.00001$.
So your best move is $x=0.00001$.
Since $0.00001^2+0.00001\le0.001$, I win.
You begin to think the game is rigged.
Saying that the game is rigged against you is the same as saying that
you believe that \tref{thm-eg1-triply-quant-with-implication} is true.
Belief is the first step in proof.
Now that we believe in \tref{thm-eg1-triply-quant-with-implication},
we need a specific strategy to win.
It is not enough to say, ``Well, just make sure the $\delta$ is really small''.
We have to come up with a specific method for~choosing $\delta$ after we know $\varepsilon$.

Sometimes, it helps to focus first on the finish,
in order to see what is needed in the $\delta$-strategy.
We wish to force
\begin{itemize}
\item[]$x^2+x\le\varepsilon$ \quad.
\end{itemize}
We break the problem down term-by-term.
That is, work separately on the first term $x^2$ and the second term $x$.
If we can force
\begin{itemize}
\item[]$x^2\le\varepsilon/2$ and $x\le\varepsilon/2$ \quad.
\end{itemize}
then we will win the game.
It is therefore enough to force
\begin{itemize}
\item[]$0\le x\le\sqrt{\varepsilon/2}$ and $x\le\varepsilon/2$ \quad.
\end{itemize}
So, since $0\le x\le\delta$, we can win by forcing
\begin{itemize}
\item[]$\delta\le\sqrt{\varepsilon/2}$ and $\delta\le\varepsilon/2$ \quad.
\end{itemize}
This leads us to the same $\delta$-strategy as for \tref{thm-eg1-deltaformula-lt-epsilon-redux}:
\begin{itemize}
\item[]Let $\delta:=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$. \qquad Then $\delta>0$.
\end{itemize}

For the finish, by \tref{thm-transitivity-le} and \tref{thm-improved-square-inequality},
we could write:
\begin{itemize}
\item[]$x\le\delta\le\varepsilon/2$, so $x\le\varepsilon/2$.
\item[]$0\le x\le\delta\le\sqrt{\varepsilon/2}$, so $x^2\le\varepsilon/2$.
\item[]$x^2\le\varepsilon/2$ and $x\le\varepsilon/2$, so $x^2+x\le\varepsilon$.
\end{itemize}

Here, then, is the full proof:

\begin{proof}
Given $\varepsilon>0$.\\
Want: $\exists\delta>0$~s.t.~$\forall x\in\R$,\quad
$(\,\,[\,0\le x\le\delta\,]\,\Rightarrow\,[\,x^2+x\le\varepsilon\,]\,\,)$.\\
Let $\delta:=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$. \qquad
Then $\delta>0$.\\
Want: $\forall x\in\R$,\quad
$(\,\,[\,0\le x\le\delta\,]\,\Rightarrow\,[\,x^2+x\le\varepsilon\,]\,\,)$.\\
Given $x\in\R$. \qquad
Want: $[\,\,0\le x\le\delta\,\,]\,\,\Rightarrow\,\,[\,\,x^2+x\le\varepsilon\,\,]$.\\
Assume: $0\le x\le\delta$. \qquad
Want: $x^2+x\le\varepsilon$.\\
$x\le\delta\le\varepsilon/2$, so $x\le\varepsilon/2$.\\
$0\le x\le\delta\le\sqrt{\varepsilon/2}$, so $x^2\le\varepsilon/2$.\\
$x^2\le\varepsilon/2$ and $x\le\varepsilon/2$, so $x^2+x\le\varepsilon$.
\end{proof}

\begin{defn}\wrlab{absolute-value}
For all $s\in\R$, we define
$|x|:=\max\{x,-x\}$.
\end{defn}

Let $x\in\R$.
Then $|x|$ is called the \bfindex[absolute value] of $x$.

\begin{thm}\wrlab{thm-eg1-absolute-value}
\qquad $|3|=3$ \quad and \quad $|-6|=6$.
\end{thm}

\begin{thm}\wrlab{thm-abs-val-nonneg}
$\forall x\in\R$, \quad  $|x|\ge0$.
\end{thm}

\begin{thm}\wrlab{thm-absval-not-additive}
\qquad $|(-2)+3|\ne|-2|+|3|$.
\end{thm}

\begin{thm}
All of the following are true:
\begin{itemize}
\item[(1)]$\forall x\in\R$, \quad $|x|\ge0$.
\item[(2)]$\forall x,y\in\R$, \quad $|x\cdot y|=|x|\cdot|y|$.
\item[(3)]$\forall x\in\R$, \quad $|x^2|=|x|^2$.
\item[(4)]$\forall x,y\in\R$, \quad $|x+y|\le|x|+|y|$.
\end{itemize}
\end{thm}

\begin{thm}
$\forall\varepsilon>0$,
$\exists\delta>0$~s.t., $\forall x\in\R$,
$$[\,\,||x<\delta\,\,]\quad\Rightarrow\quad[\,\,|x^2+x|<\varepsilon\,\,].$$
\end{thm}

\begin{proof}
Given $\varepsilon>0$.\\
Want: $\exists\delta>0$~s.t.~$\forall x\in\R$,\quad
$(\,\,[\,|x|<\delta\,]\,\Rightarrow\,[\,|x^2+x|<\varepsilon\,]\,\,)$.\\
Let $\delta:=\min\{\varepsilon/2,\sqrt{\varepsilon/2}\}$. \qquad
Then $\delta>0$.\\
Want: $\forall x\in\R$,\quad
$(\,\,[\,|x|<\delta\,]\,\Rightarrow\,[\,|x^2+x|<\varepsilon\,]\,\,)$.\\
Given $x\in\R$. \qquad
Want: $[\,\,|x|<\delta\,\,]\,\,\Rightarrow\,\,[\,\,|x^2+x|<\varepsilon\,\,]$.\\
Assume: $|x|<\delta$. \qquad
Want: $|x^2+x|<\varepsilon$.\\
$|x|<\delta\le\varepsilon/2$, so $|x|<\varepsilon/2$.\\
$0\le|x|<\delta\le\sqrt{\varepsilon/2}$, so $0\le|x|<\sqrt{\varepsilon/2}$, so $|x|^2<\varepsilon/2$.\\
Then
\begin{eqnarray*}
|x^2+x|&\le&|x^2|+|x|\,\,=\,\,|x|^2+|x|\\
&<&(\varepsilon/2)+(\varepsilon/2)\,\,=\,\,\varepsilon,
\end{eqnarray*}
as desired.
\end{proof}

\section{Unassigned homework}

\begin{thm}\wrlab{thm-ltsup-implies-notleset}
Let $S\subseteq\R^*$ and let $x\in\R^*$.\\
Assume $x<\sup\,S$. \quad
Then $\neg(S\le x)$.
\end{thm}

\begin{thm}\wrlab{thm-notleset-implies-gt-someelt}
Let $S\subseteq\R^*$ and let $x\in\R^*$.\\
Assume $\neg(S\le x)$. \quad
Then $\exists y\in S$ s.t.~$y>x$.
\end{thm}

\section{The Archimedean Principle}

The next theorem is called the \bfindex[Archimedean Principle].

\begin{thm}\wrlab{thm-arch-principle}
$\forall x\in\R$, $\exists k\in\N$ s.t.~$x<k$.
\end{thm}

\begin{proof}
Given $x\in\R$. \qquad
Want: $\exists k\in\N$ s.t.~$x<k$.\\
By \aref{axiom-sup-N-infty}, $\sup\N=\infty$.\\
Since $x\in\R$, by \aref{axiom-reals-between-minusinfty-infty}, $x<\infty$.\\
Then $x<\sup\N$.\\
Then $\neg(\N\le x)$.\\
Choose $k\in\N$ s.t.~$k>x$.\\
Want: $x<k$.\\
Since $k>x$, we conclude that $x<k$, as desired.
\end{proof}

\section{Arithmetic of sets of real numbers}

\begin{defn}\wrlab{defn-neg-set}
$\forall S\subseteq\R$,
$-S:=\{-x\in\R\,|\,x\in S\}$.
\end{defn}

\begin{defn}\wrlab{defn-set-and-real-constructions}
$\forall S\subseteq\R$, $\forall a\in\R$,\\
\phx\qquad $S+a:=\{x+a\in\R\,|\,x\in S\}$,
\phx\qquad $S-a:=\{x-a\in\R\,|\,x\in S\}$,\\
\phx\qquad $a+S:=\{a+x\in\R\,|\,x\in S\}$,
\phx\qquad $a-S:=\{a-x\in\R\,|\,x\in S\}$,\\
\phx\qquad $a\cdot S:=\{ax\in\R\,|\,x\in S\}$ \qquad and
\qquad $S\cdot a:=\{xa\in\R\,|\,x\in S\}$.\\
Also, $\forall S\subseteq\R\backslash\{0\}$, $\forall a\in\R$,
\phx\qquad $a/S:=\{a/x\in\R\,|\,x\in S\}$.\\
Also, $\forall S\subseteq\R$, $\forall a\in\R\backslash\{0\}$,
\phx\qquad $S/a:=\{x/a\in\R\,|\,x\in S\}$.\\
\end{defn}

\begin{thm}\wrlab{thm-aplusS-vs-Splusa}
$\forall S\subseteq\R$, $\forall a\in\R$, \quad $a+S=S+a$.
\end{thm}

\begin{thm}
Let $S:=(0;1]$.
Then\\
\phx\qquad\qquad $-S=[-1;0)$,\\
\phx\qquad\qquad $S+3=3+S=(3;4]$,\\
\phx\qquad\qquad $S-4=(-4;-3]$,\\
\phx\qquad\qquad $4-S=[3;4)$,\\
\phx\qquad\qquad $6S=S\cdot6=(0;6]$,\\
\phx\qquad\qquad $1/S=[1;\infty)$ \qquad and\\
\phx\qquad\qquad $S/5=(0;1/5]$.
\end{thm}

\section{Primitive ordered pairs, relations and functions}

\begin{defn}\wrlab{defn-prim-ordered-pairs}
$\forall x,y$, $\langle\langle x,y\rangle\rangle:=\{\{x\},\{x,y\}\}$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-pop}
$\langle\langle1,2\rangle\rangle=\{\{1\},\{1,2\}\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-pop}
$\langle\langle2,1\rangle\rangle=\{\{2\},\{1,2\}\}\ne\{\{1\},\{1,2\}\}=\langle\langle1,2\rangle\rangle$.
\end{thm}

\begin{thm}
$\forall x,y,\qquad\{x,y\}=\{y,x\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg3-pop}
$\langle\langle3,3\rangle\rangle=\{\{3\},\{3,3\}\}=\{\{3\},\{3\}\}=\{\{3\}\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg4-pop}
$\langle\langle5,\frownie\rangle\rangle=\{\{5\},\{5,\frownie\}\}=\{\{5\},\frownie\}=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-frownie-infects-pop}
$\forall a$, \quad $\langle\langle a,\frownie\rangle\rangle=\frownie=\langle\langle \frownie,a\rangle\rangle$.
\end{thm}

\begin{thm}\wrlab{thm-equality-of-pops}
$\forall\!\!\smile\!\!a,\forall\!\!\smile\!\!b,\forall\!\!\smile\!\!c,\forall\!\!\smile\!\!d$,
$$(\,\,\langle\langle a,b\rangle\rangle=\langle\langle c,d\rangle\rangle\,\,)\,\,\,\Leftrightarrow\,\,\,(\,\,[\,a=c\,]\,\&\,[\,b=d\,]\,\,)\qquad.$$
\end{thm}

\begin{defn}\wrlab{defn-pop}
$\forall q$, by $q$ is a \bfindex[primitive ordered pair], we mean: $\exists\!\!\smile\!\!x$, $\exists\!\!\smile\!\!y$ s.t.~$q=\langle\langle x,y\rangle\rangle$.
\end{defn}

\begin{axiom}\wrlab{axiom-primprod}
$\forall$sets $A,B$,
$\exists1$set $C$, denoted $A\timestimes B$, s.t., $\forall z$,
\qquad$[\,\,(\,z\in C\,)\quad\Leftrightarrow\quad(\,\exists x\in A,\exists y\in B~\hbox{s.t.}~z=\langle\langle x,y\rangle\rangle\,)\,\,]$.
\end{axiom}

Well refer to the set $A\timestimes B$ of \dref{axiom-primprod}
as the \bfindex[primitive product] of $A$ and $B$.
A set of primitive ordered pairs is called a relation:

\begin{defn}\wrlab{defn-reln}
$\forall R$, by $R$ is a \bfindex[relation], we mean:
\begin{itemize}
\item[]$R$ is a set \qquad\qquad\qquad and
\item[]$\forall q\in R$, \quad $q$ is a primitive ordered pair.
\end{itemize}
\end{defn}

\begin{thm}\wrlab{thm-eg1-relation}
Let $R:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle5,9\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.\\
\phx\qquad Then $R$ is a relation.
\end{thm}

\begin{thm}\wrlab{thm-eg2-relation-emptyset}
\qquad $\emptyset$ is a relation.
\end{thm}

\begin{axiom}\wrlab{axiom-domain-of-relation}
Let $R$ be a relation.
Then $\exists1$set $A$, denoted $\dom[R]$,\\
\phx\qquad s.t., \qquad $\forall x,\,[\,(\,x\in A\,)\,\Leftrightarrow\,(\,\exists y\hbox{ s.t. }\langle\langle x,y\rangle\rangle\in R\,)\,]$.
\end{axiom}

\begin{axiom}\wrlab{axiom-im-of-relation}
Let $R$ be a relation.
Then $\exists1$set $B$, denoted $\im[R]$,\\
\phx\qquad s.t., \qquad $\forall y,\,[\,(\,y\in B\,)\,\Leftrightarrow\,(\,\exists x\hbox{ s.t. }\langle\langle x,y\rangle\rangle\in R\,)\,]$.
\end{axiom}

\begin{thm}\wrlab{thm-eg1-dom-dom-inverse}
Let $R:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle5,9\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.\\
\phx\qquad\qquad\qquad Then $\dom[R]=\{5,7,8\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-dom-im}
Let $R:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle5,9\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.\\
\phx\qquad Then $\im[R]=\{2,4,6,9\}$.
\end{thm}

\begin{defn}\wrlab{defn-sets-inverse-of-relation}
Let $R$ be a relation,\\
\phx\qquad\qquad\qquad\qquad $A:=\dom[R]$, $B:=\im[R]$.\\
\phx\qquad Then $R^{-1}\,\,:=\,\,\{\,\,\langle\langle y,x\rangle\rangle\in B\timestimes A\,\,|\,\,\langle\langle x,y\rangle\rangle\in R\,\,\}$.
\end{defn}

According to specification, between ``$\{$'' and ``$|$'',
we {\it should} have:
\begin{itemize}
\item[]a single variable, \quad then ``$\in$'' \quad then a set \qquad.
\end{itemize}
The logic purist would therefore do some rewriting of \dref{defn-sets-inverse-of-relation},
and define $R^{-1}$ to be
$$\{z\in B\timestimes A\,|\,\exists x\in A,\exists y\in B~\hbox{s.t.}~[(\langle\langle x,y\rangle\rangle\in R)\&(\langle\langle y,x\rangle\rangle=z)]\}.$$

\begin{thm}\wrlab{thm-eg1-relation-inverse}
Let $R:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle5,9\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.\\
Then $R^{-1}=\{\,\langle\langle2,5\rangle\rangle,\,\langle\langle9,5\rangle\rangle,\,\langle\langle6,7\rangle\rangle,\,\langle\langle4,8\rangle\rangle\,\}$,\\
\phx\qquad\qquad\qquad $\dom[R^{-1}]=\{2,4,6,9\}=\im[R]$,\\
\phx\qquad\qquad\qquad $\im[R^{-1}]=\{5,7,8\}=\dom[R]$ \qquad and\\
\phantom{xxx}$(R^{-1})^{-1}=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle5,9\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}=R$.
\end{thm}

\begin{thm}\wrlab{thm-reln-in-primprod}
Let $R$ be a relation.\\
Then: \quad $R\subseteq(\dom[R])\timestimes(\im[R])$ \quad and\\
\phx\qquad\qquad$\forall x\in\dom[R],\exists y\in\im[R]~\hbox{s.t.}~\langle\langle x,y\rangle\rangle\in R$ \quad and\\
\phx\qquad\qquad$\forall y\in\im[R],\exists x\in\dom[R]~\hbox{s.t.}~\langle\langle x,y\rangle\rangle\in R$.
\end{thm}

\begin{thm}\wrlab{thm-dom-im-inverse}
$\forall$relation $R$, \qquad\qquad $[\,\,\,(\,(R^{-1})^{-1}=R\,)\,\,\,\&$\\
\phx\qquad $(\,\dom[R^{-1}]=\im[R]\,)\,\,\,\&\,\,\,(\,\im[R^{-1}]=\dom[R]\,)\,\,\,]$.
\end{thm}

\begin{defn}\wrlab{defn-fn}
$\forall f$, by $f$ is a \bfindex[function], we mean:
\begin{itemize}
\item[(1)]$f$ is a relation \qquad\qquad and
\item[(2)]$\forall x\in\dom[f]$, $\forall y,z\in\im[f]$,\\
\phx\qquad\qquad\qquad\qquad $[\,\langle\langle x,y\rangle\rangle,\langle\langle x,z\rangle\rangle\in f\,]\,\,\,\Rightarrow\,\,\,[\,y=z\,]$.
\end{itemize}
\end{defn}

Condition (2) in \dref{defn-fn} is called the \bfindex[vertical line test].

\begin{thm}\wrlab{thm-eg1-non-fucntion}
Let $R:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle,\,\langle\langle5,9\rangle\rangle\,\}$.\\
Then $R$ is a not a function.
\end{thm}

\begin{thm}\wrlab{thm-eg1-dom-im-of-fn}
Let $f:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.\\
Then: \quad $f$ is a function, \quad $\dom[f]=\{5,7,8\}$ \quad and \quad $\im[f]=\{2,4,6\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-dom-im-inverse}
Let $f:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,6\rangle\rangle\,\}$.\\
Then: \quad $f$ is a function, \quad $\dom[f]=\{5,7,8\}$ \quad and \quad $\im[f]=\{2,6\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg3-dom-im-inverse}
Let $f:=\{\langle\langle x,y\rangle\rangle\in\R\timestimes\R\,|\,y=x^2\}$.\\
Then: \quad $f$ is a function, \quad $\dom[f]=\R$ \quad and \quad$\im[f]=[0;\infty)$.
\end{thm}

\begin{thm}\wrlab{thm-eg4-dom-im-inverse}
Let $f:=\{\langle\langle x,y\rangle\rangle\in\R\timestimes\R\,|\,y=x^3\}$.\\
Then: \quad $f$ is a function, \quad $\dom[f]=\R$ \quad and \quad$\im[f]=\R$.
\end{thm}

\begin{thm}\wrlab{thm-eg5-dom-im-inverse-emptyfn}
Let $f:=\emptyset$.\\
Then: \quad $f$ is a function, \quad $\dom[f]=\emptyset$ \qquad and \qquad $\im[f]=\emptyset$.
\end{thm}

\begin{defn}\wrlab{defn-f-of-x}
Let $f$ be a function.
Then, $\forall x$,\\
\phx\qquad$f(x)\quad:=\quad\UE\,\,\{\,\,y\in\im[f]\,\,|\,\,\langle\langle x,y\rangle\rangle\in f\,\,\}$.
\end{defn}

We also often use $f_x$ instead of $f(x)$:

\begin{defn}\wrlab{defn-f-sub-x}
Let $f$ be a function.
Then, $\forall x$,\\
\phx\qquad$f_x\quad:=\quad\UE\,\,\{\,\,y\in\im[f]\,\,|\,\,\langle\langle x,y\rangle\rangle\in f\,\,\}$.
\end{defn}

\begin{thm}\wrlab{thm-eg-fn}
Let $f:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.\\
\phx\qquad\qquad Then $f(7)=6$, \quad $f_8=4$ \quad and \quad $f(0)=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-fn}
Let $f:=\{\,\langle\langle2,8\rangle\rangle,\,\langle\langle3,8\rangle\rangle,\,\langle\langle4,9\rangle\rangle\,\}$.\\
Then $f$ is a function, \quad $f(2)=f(3)=8$, $f(4)=9$ and $f(5)=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-eg3-fn}
Let $f:=\{\langle\langle x,y\rangle\rangle\in\R\timestimes[0;\infty)\,|\,y=x^2\}$.
Then\\
\phx\qquad\qquad\quad $f(3)=f(-3)=9$, \quad $f_2=4$, \quad $f(0)=0$,\\
\phx\qquad\qquad $f(\infty)=f(-\infty)=\frownie$ \qquad and \qquad $f(\frownie)=\frownie$.
\end{thm}

\begin{defn}\wrlab{defn-nonfn-at-x}
$\forall f$,\\
\phx\qquad$[\,\,f\hbox{ not a function}\,\,]\,\,\Rightarrow\,\,[\,\,\forall x,\,\,(\,\,(\,f(x):=\frownie\,)\,\&\,(\,f_x:=\frownie\,)\,\,)\,\,]$.
\end{defn}

\begin{thm}
Let $R:=\{\langle\langle5,2\rangle\rangle,\langle\langle5,9\rangle\rangle,\langle\langle7,6\rangle\rangle,\langle\langle8,4\rangle\rangle\}$.\\
Then $R_5=R_7=R_8=R_1=\frownie$.\\
Also, $\forall x,\qquad R_x=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-fn-inverse-not-fn}
Let $f:=\{\,\langle\langle2,8\rangle\rangle,\,\langle\langle3,8\rangle\rangle,\,\langle\langle4,9\rangle\rangle\,\}$.
Then\\
\phx\qquad $f^{-1}=\{\,\langle\langle8,2\rangle\rangle,\,\langle\langle8,3\rangle\rangle,\,\langle\langle9,4\rangle\rangle\,\}$,\\
\phx\qquad $f^{-1}$ is not a function,\\
\phx\qquad $f^{-1}(0)=\frownie$, \quad$f^{-1}(8)=\frownie$, \quad $f^{-1}(9)=\frownie$ \quad and\\
\phx\qquad\qquad\qquad $\forall x,\,\,f^{-1}(x)=\frownie$
\end{thm}

Unhappiness is infective:

\begin{thm}
$\forall f,\qquad f(\frownie)=f_{\frownie}=\frownie$.
\end{thm}

\begin{defn}\wrlab{defn-set-valued}
$\forall S$, by $S$ is \bfindex[set-valued], we mean:\\
\phx\qquad $(\,S\hbox{ is a function}\,)\qquad\hbox{and}\qquad(\,\forall j\in\dom[S],\quad S_j\hbox{ is a set}\,)$.
\end{defn}

\begin{thm}\wrlab{thm-eg-set-valued}
Let $S:=\{\,\langle\langle1,\{2,5\}\rangle\rangle,\,\langle\langle7,\{0\}\rangle\rangle,\,\langle\langle9,\emptyset\rangle\rangle\,\}$.\\
Then $S$ is set-valued,
$S_1=\{2,5\}$, $S_7=\{0\}$, $S_9=\emptyset$ and $S_2=\frownie$.
\end{thm}

We will use the following notational convention:
By
$\left(\begin{tabular}{c}
$5\mapsto2$\\
$7\mapsto6$\\
$8\mapsto4$
\end{tabular}\right)$,
we mean the function $\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.
Following this convention, then
$\left(\begin{tabular}{c}
$1\mapsto7$\\
$2\mapsto4$\\
$3\mapsto0$\\
$4\mapsto6$
\end{tabular}\right)$
is the function $\{\,\langle\langle1,7\rangle\rangle,\,\langle\langle2,4\rangle\rangle,\,\langle\langle3,0\rangle\rangle,\,\langle\langle4,6\rangle\rangle\,\}$.
Also,
$\left(\begin{tabular}{c}
$1\mapsto\{2,5\}$\\
$7\mapsto\{0\}$\\
$9\mapsto\emptyset$
\end{tabular}\right)$
is the function $\{\,\langle\langle1,\{2,5\}\rangle\rangle,\,\langle\langle7,\{0\}\rangle\rangle,\,\langle\langle9,\emptyset\rangle\rangle\,\}$.

We will use the following notational convention:
By $(7,4,0,6)$, we mean the function
$\left(\begin{tabular}{c}
$1\mapsto7$\\
$2\mapsto4$\\
$3\mapsto0$\\
$4\mapsto6$
\end{tabular}\right)$.
Following this convention, then $(3,7)$ is the function
$\left(\begin{tabular}{c}
$1\mapsto3$\\
$2\mapsto7$
\end{tabular}\right)$,
which, in turn, is equal to
$\{\,\langle\langle1,3\rangle\rangle,\,\langle\langle3,7\rangle\rangle\,\}$.
Also, $(\{3,7\})$ is the function
$\left(\begin{tabular}{c}
$1\mapsto\{3,7\}$
\end{tabular}\right)$,
which, in turn, is equal to~$\{\langle\langle1,\{3,7\}\rangle\rangle\}$.
Finally, $()$ is the empty set, sometimes called the empty function.
That is, $()=\emptyset$.

The logic purist has no patience with conventions,
and would insist that every function be written out as
a set of primitive ordered pairs.

\begin{defn}\wrlab{defn-ordered-pair}
$\forall q$, by $q$ is an \bfindex[ordered pair], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\exists\!\!\smile\!\!a$, $\exists\!\!\smile\!\!b$ s.t.~$q=(a,b)$.
\end{defn}

\begin{defn}\wrlab{defn-ordered-triple}
$\forall q$, by $q$ is an \bfindex[ordered triple], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\exists\!\!\smile\!\!a$, $\exists\!\!\smile\!\!b$, $\exists\!\!\smile\!\!c$ s.t.~$q=(a,b,c)$.
\end{defn}

An ordered pair is sometimes called an \bfindex[ordered $2$-tuple].
An ordered triple is sometimes called an \bfindex[ordered $3$-tuple].
There are similar definitions for \bfindex[ordered quadruple], {\it a.k.a.}~\bfindex[ordered $4$-tuple],
and for~\bfindex[ordered pentatuple], {\it a.k.a.}~\bfindex[ordered $5$-tuple].
Let's not use ``hexatuple'', ``septuple'', ``octuple'', ``nonuple'',
and instead, keep it simple, by using ``$6$-tuple'', ``$7$-tuple'', ``$8$-tuple'', ``$9$-tuple''.

Exercise: Continue with the definitions appearing above, until you get to ordered $9$-tuples.
In particular, fill in the ellipses in:

\begin{defn}
$\forall q$, by $q$ is an \bfindex[ordered $9$-tuple], we mean:\\\
phantom{x}\qquad\qquad\qquad\qquad\qquad\qquad $\exists\!\!\smile\!\!a$, \dots, $\exists\!\!\smile\!\!i$, s.t.~$q=(a,\ldots,i)$.
\end{defn}

\begin{thm}\wrlab{thm-eg-pair-sets}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.\\
Then $(A,B)=\left(\begin{tabular}{c}
$1\mapsto A$\\
$2\mapsto B$
\end{tabular}\right)=\{\,\langle\langle1,\{5,6,7,8\}\rangle\rangle,\,\langle\langle2,\{7,8,9\}\rangle\rangle\,\}$.\\
Also, we have $\dom[(A,B)]=\{1,2\}$ and $\im[(A,B)]=\{A,B\}$.\\
Also, $(A,B)$ is set-valued.
\end{thm}

\begin{thm}\wrlab{thm-eg1-cup-cap-setvalued}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.\\
Let $\ds{S:=\left(\begin{tabular}{c}$0\mapsto A$\\$3\mapsto B$\end{tabular}\right)}$.
Then $S=\{\langle\langle0,A\rangle\rangle,\langle\langle1,B\rangle\rangle\}$.\\
Also, $\dom[S]=\{0,3\}$ and $\im[S]=\{A,B\}$.\\
Also, $S_0=A$ and $S_3=B$ and $S_1=\frownie$.\\
Also $S$ is set-valued.
\end{thm}

\begin{thm}\wrlab{thm-im-set-valued-is-set-of-sets}
$\forall$set-valued $S$, $\im[S]$ is a set of sets.
\end{thm}

\begin{defn}\wrlab{defn-cup-set-valued}
$\forall$set-valued $S$, \quad
$\bigcup S_\bullet\,:=\,\bigcup\im[S]$.
\end{defn}

\begin{defn}\wrlab{defn-cap-set-valued}
$\forall$set-valued $S$, \quad
$\bigcap S_\bullet\,:=\,\bigcap\im[S]$.
\end{defn}

\begin{thm}\wrlab{thm-eg-emptyset-union}
\quad $\bigcup()_\bullet=\bigcup\emptyset_\bullet=\bigcup\im[\emptyset]=\bigcup\emptyset=\emptyset$.
\end{thm}

\begin{thm}\wrlab{thm-eg-emptyset-intersection}
\quad $\bigcap()_\bullet=\bigcap\emptyset_\bullet=\bigcap\im[\emptyset]=\bigcap\emptyset=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-cup-cap-setvalued}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.\\
Then $\bigcup(A,B)_\bullet=\{5,6,7,8,9\}$
and $\bigcap(A,B)_\bullet=\{7,8\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg3-cup-cap-setvalued}
Let $A:=\{5,6,7,8\}$ and let $B:=\{7,8,9\}$.\\
Let $\ds{S:=\left(\begin{tabular}{c}$0\mapsto A$\\$3\mapsto B$\end{tabular}\right)}$.
Then $\bigcup S_\bullet=\{5,6,7,8,9\}$
and $\bigcap S_\bullet=\{7,8\}$.
\end{thm}

\section{Injectivity}

\begin{defn}\wrlab{defn-1-1}
$\forall$function $f$, by $f$ is \bfindex[one-to-one], we mean:
\begin{itemize}
\item[($*$)]$\forall w,x\in\dom[f],\quad(\,\,[\,f(w)=f(x)\,]\,\Rightarrow\,[\,w=x\,]\,\,)$.
\end{itemize}
\end{defn}

Condition ($*$) in \dref{defn-1-1} is called the \bfindex[horizontal line test].

The word \bfindex[injective] is synonomous with one-to-one.
We typically write ``one-to-one'' as ``1-1''.

\begin{thm}\wrlab{thm-eg2-dom-im-inverse-redux}
Let $f:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,6\rangle\rangle\,\}$.
Then
\begin{itemize}
\item[]$f$ is a function,
\item[]$f(7)=6=f(8)$, \qquad $f$ is not 1-1,
\item[]$f^{-1}\,=\,\{\,\langle\langle2,5\rangle\rangle\,,\,\langle\langle6,7\rangle\rangle\,,\,\langle\langle6,8\rangle\rangle\}$,
\item[]$\langle\langle6,7\rangle\rangle\,,\,\langle\langle6,8\rangle\rangle\in f^{-1}$, \quad\quad $f^{-1}$ is not a function,
\item[]$f^{-1}(6)=\frownie$, \quad $f^{-1}(2)=\frownie$ \quad and \quad $(\,\,\forall x,\,\,f^{-1}(x)=\frownie\,\,)$.
\end{itemize}
\end{thm}

\begin{thm}\wrlab{thm-eg1-dom-im-inverse-redux}
Let $f:=\{\,\langle\langle5,2\rangle\rangle,\,\langle\langle7,6\rangle\rangle,\,\langle\langle8,4\rangle\rangle\,\}$.
Then
\begin{itemize}
\item[]$f$ is a 1-1 function, \qquad $f(7)=6$,
\item[]$f^{-1}\,=\,\{\,\langle\langle2,5\rangle\rangle\,,\,\langle\langle4,8\rangle\rangle\,,\,\langle\langle6,7\rangle\rangle\,\}$,
\item[]$f^{-1}$ is a function \qquad and \qquad $f^{-1}(6)=7$.
\end{itemize}
\end{thm}

\begin{thm}\wrlab{thm-eg3-dom-im-inverse-redux}
Let $f:=\{\langle\langle x,y\rangle\rangle\in\R\timestimes\R\,|\,y=x^2\}$.
Then
\begin{itemize}
\item[]$f$ is a function,
\item[]$f(3)=9=f(-3)$, \qquad $f$ is not 1-1,
\item[]$f^{-1}=\{\langle\langle y,x\rangle\rangle\in\R\timestimes\R\,|\,y=x^2\}$,
\item[]$\langle\langle9,3\rangle\rangle,\,\langle\langle9,-3\rangle\rangle\in f^{-1} $,
\item[]$f^{-1}$ is not a function \qquad and \qquad $f^{-1}(9)=f^{-1}(0)=\frownie$
\item[]\qquad and \qquad $(\,\,\forall x,\,\,f^{-1}(x)=\frownie\,\,)$.
\end{itemize}
\end{thm}

\begin{thm}\wrlab{thm-eg4-dom-im-inverse-redux}
Let $f:=\{\langle\langle x,y\rangle\rangle\in\R\timestimes\R\,|\,y=x^3\}$.
Then
\begin{itemize}
\item[]$f$ is a 1-1 function, \qquad $f(2)=8$,
\item[]$f^{-1}=\{\langle\langle y,x\rangle\rangle\in\R\timestimes\R\,|\,y=x^3\}$,
\item[]$f^{-1}$ is a function \qquad and \qquad $f^{-1}(8)=2$.
\end{itemize}
\end{thm}

\begin{thm}\wrlab{thm-quant-equiv-1-1}
$\forall$function $f$,\\
\phantom{xx}\qquad$(\quad f\hbox{ is 1-1}\quad)\qquad\Leftrightarrow\qquad(\quad f^{-1}\hbox{ is a function}\quad)$.
\end{thm}

\section{Arrow notation for functions}\wrlab{sect-arrow-notation}

\begin{defn}
Let $f$ be a function and let $A$ be a set.
By $A$ is a \bfindex[superdomain] of $f$,
we mean: $A\supseteq\dom[f]$.
\end{defn}

The following is a quantified equivalence for equality of functions.
Two functions are equal iff they agree on a common superdomain:

\begin{thm}
Let $f$ and $g$ be functions and let $A$ be a set.\\
Assume that $A\supseteq\dom[f]$ and that $A\supseteq\dom[g]$.\\
Then: \quad $(f=g)\,\,\Leftrightarrow\,\,(\forall x\in A,\,\,f(x)=g(x))$
\end{thm}

\begin{defn}
Let $f$ be a function and let $B$ be a set.
By $B$ is a \bfindex[superimage] or \bfindex[target] of $f$,
we mean: $A\supseteq\im[f]$.
\end{defn}

Any function has many superdomains and many superimages, but only one domain and one image.

In this course, we will not use the term ``range'', since it has
different meanings to different people:
Some take it to mean image, while others take it to mean target.

\begin{defn}\wrlab{defn-drta-notation-for-functions}
$\forall f,A,B$, \quad by $f:A\drta B$, we mean
\begin{itemize}
\item[]$f$ is a function \qquad and \qquad $A$ and $B$ are sets \qquad and
\item[]$\dom[f]\subseteq A$ \qquad and \qquad $\im[f]\subseteq B$.
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-arrow-notation-for-functions}
$\forall f,A,B$, \quad by $f:A\to B$, we mean
\begin{itemize}
\item[]$f$ is a function \qquad and \qquad $A$ and $B$ are sets \qquad and
\item[]$\dom[f]=A$ \qquad and \qquad $\im[f]\subseteq B$.
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-doublearrow-notation-for-functions}
$\forall f,A,B$, \quad by $f:A\to>B$, we mean
\begin{itemize}
\item[]$f$ is a function \qquad and \qquad $A$ and $B$ are sets \qquad and
\item[]$\dom[f]=A$ \qquad and \qquad $\im[f]=B$.
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-hookarrow-notation-for-functions}
$\forall f,A,B$, \quad by $f:A\hookrightarrow B$, we mean
\begin{itemize}
\item[]$f:A\to B$ \qquad and \qquad $f$ is 1-1.
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-hookdoublearrow-notation-for-functions}
$\forall f,A,B$, \quad by $f:A\hookrightarrow>B$, we mean
\begin{itemize}
\item[]$f:A\to>B$ \qquad and \qquad $f$ is 1-1.
\end{itemize}
\end{defn}

\begin{thm}\wrlab{thm-inverse-trades-dom-im}
Let $f:A\hookrightarrow>B$.
Then $f^{-1}:B\hookrightarrow>A$.
\end{thm}

\begin{defn}
$\forall$sets $A,B$,\\
\phx\qquad$\exists A\hookrightarrow B$ means: $\exists f$ s.t.~$f:A\hookrightarrow B$,\\
\phx\qquad$\exists A\to>B$ means: $\exists f$ s.t.~$f:A\to>B$ \qquad and\\
\phx\qquad$\exists A\hookrightarrow>B$ means: $\exists f$ s.t.~$f:A\hookrightarrow>B$.
\end{defn}

\begin{thm}
$\forall$sets $A,B$, \quad $[\,\exists A\hookrightarrow>B\,]\,\Leftrightarrow\,[\,\exists B\hookrightarrow>A\,]$.
\end{thm}

\section{How to define a function}\wrlab{sect-how-to-define-fn}

Instead of
$$f\quad:=\quad\{\langle\langle x,y\rangle\rangle\in\R\timestimes\R\,|\,y=x^2\},$$
the logic purist would prefer
$$f\quad:=\quad\{z\in\R\timestimes\R\,|\,\exists x,y\in\R~\hbox{s.t.}~y=x^2\&\langle\langle x,y\rangle\rangle\}.$$
We are not logic purists, but, nevertheless,
from here on out, in this course, we will treat
$$f\quad:=\quad\{\langle\langle x,y\rangle\rangle\in\R\timestimes\R\,|\,y=x^2\}$$
as an example of poor style (with a loss of credit).
Instead, the preferred syntax will be\\
\phx\qquad Define $f:\R\drta\R$ by $f(x)=x^2$.\\
The variable $x$ is free, and it might be better to write
\phx\qquad Define $f:\R\drta[0;\infty)$ by: \qquad $\forall x\in\dom[f]$, $f(x)=x^2$.\\
However, in practice, the ``$\forall x\in\dom[f]$'' is typically omitted.
This is our ONLY exception to the Cardinal Binding Rule.
We compute\\
\phx\qquad $\dom[f]=\{x\in\R\,|\,x^2\in\R\}=\R$,\quad
$\im[f]=\{x^2\in\R\,|\,x\in\R\}=[0;\infty)$.
We could therefore just as easily have written:
\begin{itemize}
\item[]Define $f:\R\to\R$ by $f(x)=x^2$ \qquad .
\end{itemize}
Or:
\begin{itemize}
\item[]Define $f:\R\to(-3;\infty]$ by $f(x)=x^2$ \qquad .
\end{itemize}
All that is important is that the superimage (or ``target'') contain the image of $f$,
which is $[0;\infty)$.
In this course, it is unacceptable to say ``Let $f(x)=x^2$''.
You must always specify a superdomain and superimage.

Another example:
\begin{itemize}
\item[]Let $g:\R\drta[5;\infty)$ be defined by by $g(x)=1/x$ \qquad .
\end{itemize}
We only know that $\R$ is a superdomain of~$g$,
{\it i.e.}, that $\R$ is a superset of $\dom[g]$.
In this situation, $g(0)=\frownie\notin[5;\infty)$,
and so it is understood that $0$ is not in the domain of $g$.
In fact, by~convention, if we write
\begin{itemize}
\item[]Let $g:\R\drta[5;\infty)$ be defined by by $g(x)=1/x$ \qquad ,
\end{itemize}
then the domain of $g$ is given by:
\begin{itemize}
\item[]$\dom[g]\quad=\quad\{\,\,x\in\R\,\,|\,\,1/x\in[5;\infty)\,\,\}\quad=\quad(0;1/5]$ \qquad .
\end{itemize}

\begin{defn}
Let $A$ be a set.\\
\phx\qquad\qquad We define $\id_A:A\to A$ by $\id_A(x)=x$.\\
\phx\qquad\qquad The function $\id_A$ is called the \bfindex[identity function] on $A$.
\end{defn}

\begin{thm}
$\forall$set $A$, \quad $\id_A:A\hookrightarrow>A$.
\end{thm}

\begin{thm}
$\forall$set $A$, \quad $\exists A\hookrightarrow>A$.
\end{thm}

\section{Restriction, forward image and preimage}

\begin{defn}\wrlab{defn-restriction-of-fn}
$\forall$function $f$,
$\forall$set $A$,\\
\phx\qquad the function $f|A:A\cap(\dom[f])\to\im[f]$\\
\phx\qquad is defined by $(f|A)(x)=f(x)$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-restriction-of-fn}
Let $B:=\{3,4,5\}$, $C:=\{8,9\}$, $\ds{f:=\left(\begin{tabular}{c}$3\mapsto9$\\$4\mapsto9$\\$5\mapsto8$\end{tabular}\right)}$.
Let $A:=\{0,3,5\}$.
Then $f:B\to C$ and $\ds{f|A=\left(\begin{tabular}{c}$3\mapsto9$\\$5\mapsto8$\end{tabular}\right)}$.
\end{thm}

\begin{thm}\wrlab{thm-restriction-domain}
Let $A$, $B$ and $C$ be sets.
Let $f:B\to C$.\\
\phx\quad Then $f|A$ is a function \quad and \quad $\dom[f|A]=(\dom[f])\cap A$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-restriction-of-fn}
Let $B:=\{3,4,5\}$, $C:=\{8,9\}$, $\ds{f:=\left(\begin{tabular}{c}$3\mapsto9$\\$4\mapsto9$\\$5\mapsto8$\end{tabular}\right)}$.
Let $A:=\{3,5\}$.
Then $A\subseteq B$ and $f:B\to C$ and $\ds{f|A=\left(\begin{tabular}{c}$3\mapsto9$\\$5\mapsto8$\end{tabular}\right)}$.
\end{thm}

\begin{thm}\wrlab{thm-restriction-of-fn}
Let $B$ and $C$ be sets.
Let $A\subseteq B$.
Let $f:B\to C$.
Then, $\forall t\in A$, $(f|A)(t)=f(t)$.
Also, $\forall t\notin A$, $(f|A)(t)=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-restriction-of-squaring}
Define $f:\R\to\R$ by $f(x)=x^2$.
Let $A:=[0;\infty)$.\\
Then: \quad\quad $f$ is not 1-1 \quad and \quad $f|A$ is 1-1 \quad and\\
\phx\quad\qquad $f|A:A\hookrightarrow>A$ \quad and
\phx\qquad $\forall y\in A$, $(f|A)^{-1}(y)=\sqrt{y}$.
\end{thm}

\begin{defn}\wrlab{defn-image-preimage-set}
Let $f$ be a function.
Let $S$ be a set.
Then
\begin{itemize}
\item[]$f_*(S)\,\,:=\,\,\{\,\,f(x)\in\im[f]\,\,|\,\,x\in S\cap(\dom[f])\,\,\}$ \qquad and
\item[]$f^*(S)\,\,:=\,\,\{\,\,x\in\dom[f]\,\,|\,\,f(x)\in S\,\,\}$.
\end{itemize}
\end{defn}

\begin{thm}\wrlab{thm-eg1-image-preimage-set}
Let $f:=\left(\begin{tabular}{c}
$1\mapsto7$\\
$2\mapsto7$\\
$3\mapsto6$\\
$4\mapsto9$
\end{tabular}\right)$.
Then\\
\phx\qquad $f_*(\{0,1,2,4\})=\{7,9\}$ \quad and \quad $f^*(\{6,7,8\})=\{1,2,3\}$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-image-preimage-set}
Define $f:\R\to\R$ by $f(x)=x+2$.\\
Then: \quad $f_*([0;\infty))=[2;\infty)$ \quad and \quad $f^*([0;\infty))=[-2;\infty)$.
\end{thm}

\begin{thm}
Define $f:\R\to\R$ by $f(x)=x^2$.
Then\\
\phx\qquad $f^*([9;16))=(-4;-3]\cup[3;4)$.
\end{thm}

\section{Composition}

\begin{thm}\wrlab{thm-comp-fns}
Let $f$ and $g$ be functions.
Then $\exists1$function $h$, denoted $g\circ f$,\\
\phx\qquad\qquad s.t., \qquad $\forall x,\quad h(x)=g(f(x))$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-comp-fns}
Define $f,g:\R\to\R$ by $f(x)=x+2$, $g(x)=\sqrt{x}$.\\
Then, $\forall x\in\R$, $(g\circ f)(x)=\sqrt{x+2}$.\\
Also, $\dom[g\circ f]=[-2;\infty)=f^*(\dom[g])$.\\
Also, $\im[g\circ f]=[0;\infty)=g_*(\im[f])$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-comp-fns}
Define $f,g:\R\to\R$ by $f(x)=\sqrt{x}$, $g(x)=x+2$.\\
Then, $\forall x\in\R$, $(g\circ f)(x)=\sqrt{x}+2$.\\
Also, $\dom[g\circ f]=[0;\infty)=f^*(\dom[g])$.\\
Also, $\im[g\circ f]=[2;\infty)=g_*(\im[f])$.
\end{thm}

\begin{thm}\wrlab{thm-dom-im-composite}
Let $f$ and $g$ be functions. \quad
Then
\begin{itemize}
\item[(1)]$\dom[g\circ f]=f^*(\dom[g])$ \qquad and
\item[(2)]$\im[g\circ f]=g_*(\im[f])$.
\end{itemize}
\end{thm}

Composition of functions is associative:

\begin{thm}
$\forall$functions $f,g,h$, we have: $h\circ(g\circ f)=(h\circ g)\circ f$.
\end{thm}

\begin{thm}
Let $f:A\hookrightarrow>B$ and let $g:B\hookrightarrow>C$.
Then $g\circ f:A\hookrightarrow>C$.
\end{thm}

\begin{thm}
Let $A$, $B$ and $C$ be sets.\\
\phx\qquad\qquad Assume that $\exists A\hookrightarrow B$ \qquad and that \qquad $\exists B\hookrightarrow C$.\\
\phx\qquad\qquad Then: \qquad $\exists A\hookrightarrow C$.
\end{thm}

\section{Power sets and sets of functions}

\begin{axiom}\wrlab{axiom-powerset}
$\forall$set $S$, $\exists1$set $\scrp$, denoted $2^S$, s.t.\\
\phx\qquad $\forall A$, $(A\in\scrp)\Leftrightarrow(A\subseteq S)$.
\end{axiom}

For any set $S$, the set $2^S$ is called the \bfindex[power set] of $S$.
It is the set of all subsets of $S$.

\begin{thm}\wrlab{thm-eg1-powerset}
$2^{\{7,8,9\}}=$\\
\phx\qquad\qquad\qquad $\{\,\,\emptyset,\,\,\{9\},\,\,\{8\},\,\,\{8,9\},$\\
\phx\qquad\qquad\qquad $\,\,\,\,\{7\},\,\,\{7,9\},\,\{7,8\},\,\{7,8,9\}\,\,\}$.
\end{thm}

\begin{defn}\wrlab{defn-set-to-the-set}
$\forall$sets $A,B$,
$B^A:=\{f\subseteq A\timestimes B\,|\,f:A\to B\}$.
\end{defn}

According to specification, between ``$\{$'' and ``$|$'',
we {\it should} have:
\begin{itemize}
\item[]a single variable, \quad then ``$\in$'' \quad then a set \qquad.
\end{itemize}
The logic purist would therefore do some rewriting of \dref{defn-sets-inverse-of-relation},
and define $B^A$ to be
$B^A:=\{f\in2^{A\timestimes B}\,|\,f:A\to B\}$.

\begin{thm}\wrlab{thm-eg-set-to-set}
$\ds{\{0,1\}^{\{7,8,9\}}=}$\\
\phx\quad$\ds{\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$\ds{\,\,\,\,\,
\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-01toA-bijective-2toA}
$\forall$set $A$, $\exists\{0,1\}^A\hookrightarrow>2^A$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-set-to-the-12}
\quad$\{7,8,9\}^{\{1,2\}}\quad=$\\
\phantom{xxx}\qquad\qquad$\ds{\bigg\{
\left(\begin{tabular}{c}$1\mapsto7$\\$2\mapsto7$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto7$\\$2\mapsto8$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto7$\\$2\mapsto9$\end{tabular}\right),}$\\
\phx\qquad\qquad\qquad
$\ds{\left(\begin{tabular}{c}$1\mapsto8$\\$2\mapsto7$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto8$\\$2\mapsto8$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto8$\\$2\mapsto9$\end{tabular}\right),}$\\
\phx\qquad\qquad\qquad
$\ds{\left(\begin{tabular}{c}$1\mapsto9$\\$2\mapsto7$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto9$\\$2\mapsto8$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto9$\\$2\mapsto9$\end{tabular}\right)
\bigg\}}=$\\
\phantom{xxx}$\{\,(7,7)\,,\,(7,8)\,,\,(7,9)\,,\,\,(8,7)\,,\,(8,8)\,,\,(8,9)\,,\,\,(9,7)\,,\,(9,8)\,,\,(9,9)\,\}$.
\end{thm}

\section{Orbits}

\begin{defn}\wrlab{defn-orbit}
Let $f$ be a function.
Let $k\in\N_0$.\\
Let $S:=(\dom[f])\cup(\im[f])$. \quad
Then, $\forall a$,\\
\phantom{xx}$\ORB_f^k(a):=\UE\{x\in S^{[0..k]}\,|\,(x_0=a)\&(\forall j\in[1..k],\,f(x_{j-1})=x_j)\}$.
\end{defn}

The function $\ORB_f^k(a)$ is called the {\bf$k$-orbit}\index[terms]{orbit} of $a$ under $f$.

\begin{thm}\wrlab{thm-eg1-orbit}
Define $f:[1,8]\to\R$ by $f(x)=x+2$.\\
Then \quad $\ORB_f^0(3)=(0\mapsto3)$, \quad $\ORB_f^1(3)=\left(\begin{tabular}{c}$0\mapsto3$\\$1\mapsto5$\end{tabular}\right)$,\\
\phx\quad\quad\quad $\ORB_f^2(3)=\left(\begin{tabular}{c}$0\mapsto3$\\$1\mapsto5$\\$2\mapsto7$\end{tabular}\right)$,
\quad $\ORB_f^3(3)=\left(\begin{tabular}{c}$0\mapsto3$\\$1\mapsto5$\\$2\mapsto7$\\$3\mapsto9$\end{tabular}\right)$ \quad and\\
\phx\quad\quad\quad $\ORB_f^4(3)=\frownie$.\\
Also, \quad $(\ORB_f^0(3))_0=3$, \quad $(\ORB_f^1(3))_1=5$,\\
\phx\qquad\quad $(\ORB_f^2(3))_2=7$, \qquad $(\ORB_f^3(3))_3=9$ \qquad and\\
\phx\qquad\quad $(\ORB_f^4(3))_4=\frownie$.
\end{thm}

\begin{defn}\wrlab{defn-mult-composite}
Let $f$ be a function, $k\in\N_0$.\\
\phx\qquad\qquad Then, $\forall a$, \quad $f_\circ^k(a):=(\ORB_f^k(a))_k$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-mult-composite}
Define $f:[1,8]\to\R$ by $f(x)=x+2$.\\
Then $f_\circ^0(3)=3$, $f_\circ^1(3)=5$, $f_\circ^2(3)=7$, $f_\circ^3(3)=9$, $f_\circ^4(3)=\frownie$.
\end{thm}

\begin{thm}\wrlab{thm-}
Define $f:[1,8]\to\R$ by $f(x)=x+2$.\\
\phx\qquad Then $f_\circ^0(3)=3$, \quad $f_\circ^1(3)=f(3)$, \quad $f_\circ^2(3)=(f\circ f)(3)$,\\
\phx\qquad\qquad $\,\,f_\circ^3(3)=(f\circ f\circ f)(3)$ \quad and \quad $f_\circ^4(3)=(f\circ f\circ f\circ f)(3)$.
\end{thm}

\begin{thm}\wrlab{thm-composition-power-is-repeated-fn}
$\forall$function $f$, $\forall a$,\\
\phx\qquad\qquad\qquad $f_\circ^0(a)=a$, \quad $f_\circ^1(a)=f(a)$, \quad $f_\circ^2(a)=(f\circ f)(a)$,\\
\phx\qquad\qquad\qquad $f_\circ^3(a)=(f\circ f\circ f)(a)$ \quad and \quad $f_\circ^4(a)=(f\circ f\circ f\circ f)(a)$.
\end{thm}

\begin{thm}
$\forall$function $f$, $\forall a$, \quad $f(f_\circ^j(a))=f_\circ^{j+1}(a)$.
\end{thm}

\begin{defn}\wrlab{defn-semipos-powers}
Let $a\in\R$.
Define $f:\R\to\R$ by $f(x)=ax$.\\
Then, $\forall k\in\N_0$, $a^k\,:=\,f_\circ^k(1)$.
\end{defn}

\begin{defn}\wrlab{defn-neg-powers}
$\forall a\in\R,\,\forall k\in\N,\,\,\,a^{-k}\,:=\,1/(a^k)$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-powers}
\quad $2^0=1$, \quad $2^1=2$, \quad $2^2=4$, \quad $2^3=8$,\\
\phx\qquad\qquad\qquad\qquad $2^{-1}=1/2$, \quad $2^{-2}=1/4$, \quad $2^{-3}=1/8$.
\end{thm}

\begin{thm}
$\forall j\in\N_0$, \quad $2\cdot2^j=2^{j+1}$.
\end{thm}

\begin{thm}\wrlab{thm-zero-power}
$\forall a\in\R$, $a^0=1$.
\end{thm}

\begin{thm}
\qquad $0^0=1$.
\end{thm}

\begin{thm}
$\forall a\in\R$, \quad $a^1=a$ and $a^{-1}=1/a$.
\end{thm}

\begin{defn}\wrlab{defn-set-to-the-k}
$\forall$set $A$, $\forall k\in\N$, $A^k:=A^{[1..k]}$.
\end{defn}

Review \tref{thm-eg1-set-to-the-12}.

\begin{thm}\wrlab{thm-eg1-set-to-the-k}
\quad$\{7,8,9\}^2\quad=\quad\{7,8,9\}^{\{1,2\}}\quad=$\\
\phantom{xxx}$\{\,(7,7)\,,\,(7,8)\,,\,(7,9)\,,\,\,(8,7)\,,\,(8,8)\,,\,(8,9)\,,\,\,(9,7)\,,\,(9,8)\,,\,(9,9)\,\}$.
\end{thm}

\begin{defn}\wrlab{defn-A-times-B}
$\forall$sets $A$ and $B$,
$$A\times B\quad:=\quad\{\,\,(a,b)\in(A\cup B)^2\,\,|\,\,(\,a\in A\,)\,\&\,(\,b\in B\,)\,\,\}.$$
\end{defn}

We call $A\times B$ of \dref{defn-A-times-B}
the \bfindex[product] of $A$ and $B$.

\begin{thm}\wrlab{eg1-A-times-B}
\quad$\{7\}\,\times\,\{8,9\}\quad=\quad\{\,(7,8)\,,\,(7,9)\,\}$.
\end{thm}

\begin{thm}\wrlab{eg2-A-times-B}
\quad$\{1,2,3\}\,\times\,\{8,9\}\quad=$
\begin{itemize}
\item[]$\{\,(1,8)\,,\,(2,8)\,,\,(3,8)\,,\,(1,9)\,,\,(2,9)\,,\,(3,9)\,\}$
\end{itemize}
\end{thm}

\begin{defn}\wrlab{defn-A-times-B-times-C}
$\forall$sets $A$ and $B$ and $C$,
$$A\times B\times C:=\{(a,b,c)\in(A\cup B\cup C)^3\,|\,(a\in A)\&(b\in B)\&(c\in C\}.$$
\end{defn}

We call $A\times B\times C$ of \dref{defn-A-times-B-times-C}
the \bfindex[product] of $A$, $B$ and $C$.

\begin{thm}\wrlab{eg1-A-times-B-times-C}
\quad$\{1,2,3\}\,\times\,\{8,9\}\,\times\,\{0\}\quad=$
\begin{itemize}
\item[]$\{\,(1,8,0)\,,\,(2,8,0)\,,\,(3,8,0)\,,\,(1,9,0)\,,\,(2,9,0)\,,\,(3,9,0)\,\}$
\end{itemize}
\end{thm}

We leave it to you to continue these definitions up to nine sets.
For~the last definition, fill in the ellipses ($\cdots$) in:

\begin{defn}\wrlab{defn-A-times-B-times-dots}
$\forall$sets $A,\ldots,I$,
$$A\times\cdots\times I:=\{(a,\ldots,i)\in(A\cup\cdots\cup I)^9\,|\,(a\in A)\&\cdots\&(i\in I)\}.$$
\end{defn}

\begin{thm}
$\forall$set $A$, $A^2=A\times A$ and $A^3=A\times A\times A$ and
$A^4=A\times A\times A\times A$ and
$A^5=A\times A\times A\times A\times A$.
\end{thm}

We also have similar formulas for $A^6$, $A^7$, $A^8$ and $A^9$.

Let $A$, $B$ and $C$ be sets.
Let $f:A\times B\to C$.
Then, $\forall x\in A$, $\forall y\in B$,
we have $(x,y)\in A\times B$ and $f((x,y))\in C$,
but it is common to eliminate one set of parentheses, and write $f(x,y)$
instead of $f((x,y))$.

The logic purist eschews ellipses ($\cdots$).
Consider the theorem
$$1\,\,+\,\,\cdots\,\,+\,\,4\quad=\quad10\qquad.$$
The logic purist would prefer
$$1\,\,+\,\,2\,\,+\,\,3\,\,+\,\,4\quad=\quad10\qquad.$$

On the other hand, consider the theorem:

\begin{thm}\wrlab{thm-eg-use-PMI}
$\forall\ell\in\N$, \quad $1+\cdots+\ell=\ell(\ell+1)/2$.
\end{thm}

We now have a challenge in eliminating the ellipsis,
because $\ell$ is a variable.
We can use composition powers to deal with this challenge:

\begin{thm}\wrlab{thm-summation-1-to-4}
Define $f:\Z\times\R\to\Z\times\R$ by\\
\phx\qquad\qquad\qquad\qquad\qquad $f(j,x)=(j+1,x+j)$.\\
Then $f(1,0)=(2,1)$ \qquad and \qquad $f(2,1)=(3,3)$ \qquad and\\
\phx\qquad $f(3,3)=(4,6)$ \qquad and \qquad $f(4,6)=(5,10)$.\\
Also, $(f_\circ^1(1,0))_2\,\,=\,\,((2,1))_2\,\,=\,\,1$,\\
\phx\qquad $(f_\circ^2(1,0))_2\,\,=\,\,((3,3))_2\,\,=\,\,3\,\,=\,\,1+2$,\\
\phx\qquad $(f_\circ^3(1,0))_2\,\,=\,\,((4,6))_2\,\,=\,\,6\,\,=\,\,1+2+3$ \quad and\\
\phx\qquad $(f_\circ^4(1,0))_2\,\,=\,\,((5,10))_2\,\,=\,\,10\,\,=\,\,1+2+3+4$.
\end{thm}

Instead of \tref{thm-eg-use-PMI},
the logic purist would prefer:

\begin{thm}\wrlab{thm-summation-1-to-ell-finalresult}
Define $f:\Z\times\R\to\Z\times\R$ by\\
\phx\qquad\qquad\qquad\qquad\qquad $f(j,x)=(j+1,x+j)$.\\
Then, $\forall\ell\in\N$, we have $(f_\circ^\ell(1,0))_2=\ell(\ell+1)/2$.
\end{thm}

However, as is often the case, purity comes at the cost of readability,
and, in this course, we will often use ellipses.
\tref{thm-eg-use-PMI} is proved below,
see \tref{thm-eg-use-PMI-redux}.
Next, we introduce the summation notation:

\begin{defn}\wrlab{defn-summation-notation-pidgin}
Let $\alpha$ be a function, let $k,\ell\in\N$.\\
Assume $k\le\ell$, $[k..\ell]\subseteq\dom[\alpha]$ and $\im[\alpha]\subseteq\R$.\\
Then: \qquad $\ds{\sum_k^\ell\,\alpha_\bullet\quad:=\quad \alpha_k+\cdots+\alpha_\ell}$.
\end{defn}

Assuming that $j$ is a free variable, we can also use the notation
$\ds{\sum_{j=k}^\ell\,\alpha_j}$ to denote $\ds{\sum_k^\ell\,\alpha_\bullet}$.
In this case, the variable $j$ becomes bound between ``$\ds{\sum_{j=k}^\ell}$'' and ``$\alpha_j$'',
and is then free again.
If $j$ is not free, but $i$ is free, then we could use
$\ds{\sum_{i=k}^\ell\,\alpha_i}$, and, again $i$ is temporarily bound.
Any free variable is acceptable, not just $i$ or $j$.
For this reason, the variable is sometimes called a ``dummy variable'',
meaning a variable that is easily replaced by another,
as a dummy mannequin is easly replaced by another in a department store.

\dref{defn-summation-notation-pidgin} is not acceptable to a logic purist
because of the ellipsis.
The following, while difficult to read, is formally better.

\begin{defn}\wrlab{defn-summation-notation}
Let $\alpha$ be a function and let $k,\ell\in\N$.\\
Assume $k\le\ell$, $[k..\ell]\subseteq\dom[\alpha]$ and $\im[\alpha]\subseteq\R$.\\
Define $f:[k..\ell]\times\R\to\Z\times\R$ by $f(j,x)=(j+1,x+\alpha_j)$.\\
Then: \qquad $\ds{\sum_k^\ell\,\alpha_\bullet\quad:=\quad(\,f_\circ^{\ell-k+1}(k,0)\,)_2}$.
\end{defn}

The product notation is similar:

\begin{defn}\wrlab{defn-prod-notation-pidgin}
Let $\alpha$ be a function and let $k,\ell\in\N$.\\
Assume $k\le\ell$, $[k..\ell]\subseteq\dom[\alpha]$ and $\im[\alpha]\subseteq\R$.\\
Then $\ds{\prod_k^\ell\,\alpha_\bullet\quad:=\quad \alpha_k\,\cdot\,\cdots\,\cdot\,\alpha_\ell}$.
\end{defn}

Assuming that $j$ is a free variable, we can also use the notation
$\ds{\prod_{j=k}^\ell\,\alpha_j}$ to denote $\ds{\prod_k^\ell\,\alpha_\bullet}$.
In this case, the variable $j$ becomes bound between ``$\ds{\prod_{j=k}^\ell}$'' and ``$\alpha_j$'',
and is then free again.
If $j$ is not free, but $i$ is free, then we could use
$\ds{\prod_{i=k}^\ell\,\alpha_i}$, and, again $i$ is temporarily bound.
This is another dummy variable; any free variable is okay, not just $i$ or~$j$.

More formally:

\begin{defn}\wrlab{defn-prod-notation}
Let $\alpha$ be a function and let $k,\ell\in\N$.\\
Assume $k\le\ell$, $[k..\ell]\subseteq\dom[\alpha]$ and $\im[\alpha]\subseteq\R$.\\
Define $f:[k..\ell]\times\R\to\Z\times\R$ by $f(j,x)=(j+1,x\cdot \alpha_j)$.\\
Then: \qquad $\ds{\prod_k^\ell\,\alpha_\bullet\quad:=\quad(\,f_\circ^{\ell-k+1}(k,1)\,)_2}$.
\end{defn}

Using summation notation, we can rewrite \tref{thm-eg-use-PMI}
in a way that is readable and avoids ellipses:

\begin{thm}
\phx\qquad $\forall\ell\in\N$, \quad $\ds{\sum_{j=1}^\ell\,j=\ell(\ell+1)/2}$.
\end{thm}

\begin{thm}\wrlab{thm-eg-use-PMI-redux2}
\phx\qquad Then $\forall\ell\in\N$, \quad $\ds{\sum_1^\ell\,(\id_\R)_\bullet=\ell(\ell+1)/2}$.
\end{thm}

\section{Appendix 1}

The following is \tref{thm-symm-of-equality}:

\begin{thm}\wrlab{thm-symm-of-equality-appendix}
$\forall x,y$, \quad $[\,(x=y)\,\Rightarrow\,(y=x)\,]$.
\end{thm}

\begin{proof}
Given $x,y$.\\
Want: $(x=y)\,\Rightarrow\,(y=x)$.\\
Assume $x=y$.\\
Want: $y=x$.\\
By \aref{axiom-equals-itself}, $x=x$.\\
Since $x=y$, we may replace the first $x$ in $x=x$ by $y$.\\
Then $y=x$, as desired.
\end{proof}

The following is \tref{thm-trans-of-equality}.

\begin{thm}\wrlab{thm-trans-of-equality-appendix}
$\forall x,y,z$, \quad $[\,(x=y=z)\,\Rightarrow\,(x=z)\,]$.
\end{thm}

\begin{proof}
We have $x=y$ and $y=z$.\\
Since $x=y$, we may replace $y$ in $y=z$ by $x$.\\
Then $x=z$, sa desired.
\end{proof}

The following is \tref{thm-solve-aplusxequalsb}:

\begin{thm}\wrlab{thm-solve-aplusxequalsb-appendix}
$\forall a,b\in\R$, $\exists x\in\R$ s.t.~$a+x=b$.
\end{thm}

\begin{proof}
Given $a,b\in\R$. \qquad
Want: $\exists x\in\R$ s.t.~$a+x=b$.\\
Let $x:=b-a$.\\
Then
\begin{eqnarray*}
a+x&=&a+(b-a)\,\,=\,\,a+b+(-a)\\
&=&b+a+(-a)\,\,=\,\,b+0\,\,=\,\,b,
\end{eqnarray*}
as desired.
\end{proof}

\section{Principle of Mathematical Induction}

\begin{defn}\wrlab{defn-successor-closed}
$\forall S\subseteq\R$,
by $S$ is \bfindex[successor closed], we mean:\\
\phx\qquad\qquad\qquad $\forall x\in S$, \quad $x+1\in S$.
\end{defn}

\begin{axiom}\wrlab{axiom-0inZ-and-Z-spclosed}
$\N$ is successor closed.
\end{axiom}

Recall that $\N=[1..\infty)$.
Then $1\in\N$.
Recall:
\begin{eqnarray*}
&&(1+1=2)\,\&\,(2+1=3)\,\&\,(3+1=4)\,\&\,(4+1=5)\,\&\,\\
&&(5+1=6)\,\&\,(6+1=7)\,\&\,(7+1=8)\,\&\,(8+1=9)\qquad,
\end{eqnarray*}
and $9+1=10$.
So, as $\N:=[1..\infty)\subseteq\Z$, using \aref{axiom-0inZ-and-Z-spclosed},
we have:

\begin{thm}\wrlab{thm-0-thru-10-in-Z}
$1,2,3,4,5,6,7,8,9,10\in\N\subseteq\Z$.
\end{thm}

\begin{axiom}\wrlab{axiom-Z-is-minusN-0-N}
$\Z=(-\N)\cup\{0\}\cup\N$.
\end{axiom}

\begin{thm}\wrlab{thm-neg-0-thru-10-in-Z}
$0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10\in\Z$.
\end{thm}

The next axiom is the \bfindex[Principle of Mathematical Induction].

\begin{axiom}\wrlab{axiom-princ-math-ind}
Let $S\subseteq\N$.\\
\phantom{xxxx}Assume that \quad $1\in S$ \quad and that \quad $S$ is successor closed.\\
\phantom{xxxx}Then $S=\N$.
\end{axiom}

\begin{thm}\wrlab{thm-eg-use-PMI-redux}
$\forall\ell\in\N$, \quad $1+\cdots+\ell=\ell(\ell+1)/2$.
\end{thm}

\begin{proof}
Let $S:=\{\ell\in\N\,|\,1+\cdots+\ell=\ell(\ell+1)/2\}$.\\
Want: $S=\N$.\\
Since $1=1\cdot(1+1)/2$, it follows that $1\in S$.\\
So, by the PMI, it suffices to show: $S$ is successor closed.\\
Want: $\forall\ell\in S$, $\ell+1\in S$.\\
Given $\ell\in S$. \qquad
Want: $\ell+1\in S$.\\
Know: $1+\cdots+\ell=\ell(\ell+1)/2$.\\
Want: $1+\cdots+\ell+(\ell+1)=(\ell+1)((\ell+1)+1)/2$.
\\
We have:
\begin{eqnarray*}
1+\cdots+\ell+(\ell+1)&=&(\ell(\ell+1)/2)+(\ell+1)\\
&=&((\ell^2+\ell)/2)+((2\ell+2)/2)\\
&=&(\ell^2+3\ell+2)/2\,\,=\,\,(\ell+1)(\ell+2)/2\\
&=&(\ell+1)((\ell+1)+1)/2,
\end{eqnarray*}
as desired.
\end{proof}

\begin{thm}
$\forall j,k\in\N,\quad j+k\in\N$.
\end{thm}

\begin{proof}
Let $S:=\{k\in\N\,|\,\forall j\in\N,\,j+k\in\N\}$.\\
Want: $S=\N$.\\
Since $\N$ is successor closed, we know: $\forall j\in\N$, $j+1\in\N$.\\
Then $1\in S$.\\
By the PMI, it suffices to show: $S$ is successor closed.\\
Want: $\forall k\in S$, $k+1\in S$.\\
Given $k\in S$. \qquad
Want: $k+1\in S$.\\
Know: $\forall j\in\N,\,j+k\in\N$.\\
Want: $\forall j\in\N,\,j+(k+1)\in\N$.\\
Given $j\in\N$. \qquad
Want: $j+(k+1)\in\N$.\\
$j+k\in\N$ and $\N$ is successor closed.\\
Then $(j+k)+1\in\N$.\\
Then $j+(k+1)=(j+k)+1\in\N$, as desired
\end{proof}

We leave it as unassigned homework to show that successor closed is ``translation invariant''.
That is:\\
\phx\quad\qquad $\forall S\subseteq\R$, $\forall a\in\R$,\\
\phx\quad\qquad\qquad $[\,(\,S\hbox{ is successor closed}\,)\,\Rightarrow\,(\,S+a\hbox{ is successor closed}\,)\,]$.

We can generalize the PMI:

\begin{thm}\wrlab{thm-gen-PMI}
Let $k\in\Z$. \quad
Let $S\subseteq[k..\infty)$.\\
Assume that $k\in S$ and that $S$ is successor closed.\\
\phx\qquad Then: \qquad $S=[k..\infty)$.
\end{thm}

\begin{proof}
Let $a:=1-k$. \qquad
Then $a+k=1$.\\
Since $S$ is successor closed, \quad $S+a$ is successor closed.\\
Since $k\in S$, \quad $k+a\in S+a$.\\
Since $S\subseteq[k..\infty)$, \quad $S+a\subseteq[k..\infty)+a$.\\
Then $S+a$ is successor closed\\
\phx\qquad and $1=k+a\in S+a$\\
\phx\qquad and $S+a\subseteq[k..\infty)+a=[1..\infty)$,\\
so, by \aref{axiom-princ-math-ind}, \quad $S+a=\N$.\\
Then $S=\N-a=[1..\infty)-a=[k..\infty)$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-2-to-j-ge-j-plus-1}
$\forall j\in\N_0,\,\,2^j\ge j+1$.
\end{thm}

\begin{proof}
Let $S:=\{j\in\N_0\,|\,2^j\ge j+1\}$.\\
Then $S\subseteq\N_0=[0..\infty)$. \qquad
Want: $S=\N_0$. \qquad
Want: $S=[0..\infty)$.\\
Since $2^0=1\ge0+1$, we see that $0\in S$.\\
Then, by \tref{thm-gen-PMI},
it suffices to show: $S$ is successor closed.\\
Want: $\forall j\in S,\,\,j+1\in S$.\\
Given $j\in S$. \qquad
Want: $j+1\in S$.\\
Know: $2^j\ge j+1$. \qquad
Want: $2^{j+1}\ge(j+1)+1$.\\
Since $2^j\ge j+1$, we get $2\cdot2^j\ge2\cdot(j+1)$.\\
Since $j\in S\subseteq\N_0=[0..\infty)\ge0$, we get $j\ge0$.\\
Then $j+(j+2)\ge 0+(j+2)$, so $2j+2\ge j+2$.\\
Then $2^{j+1}=2\cdot2^j\ge2\cdot(j+1)=2j+2\ge j+2=(j+1)+1$.
\end{proof}

\begin{thm}
$\forall j\in\N_0,\,\,2^j>j$.
\end{thm}

\begin{proof}
Given $j\in\N_0$. \qquad
Want: $2^j>j$.\\
By \tref{thm-2-to-j-ge-j-plus-1}, $2^j\ge j+1$.\\
Then $2^j\ge j+1>j$, as desired.
\end{proof}

\section{Well-ordered sets}

\begin{defn}\wrlab{defn-well-ordered}
Let $S\subseteq\R^*$.
By $S$ is \bfindex[well-ordered], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall$nonempty $A\subseteq S$, \quad $\min A\ne\frownie$.
\end{defn}

\begin{thm}\wrlab{thm-jtoinftydisjoint-not-kto-infty}
Let $A\subseteq\N^*$ and let $j\in\N_0$. \qquad
Let $k:=j+1$.\\
Assume $[1..j]\cap A=\emptyset\ne[1..k]\cap A$.
Then $\min\,A=k$.
\end{thm}

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

\begin{thm}\wrlab{thm-well-ordered-Nstar}
\quad $\N^*$ is well-ordered.
\end{thm}

\begin{proof}
Want: $\forall$nonempty $A\subseteq\N^*$, $\min\,A\ne\frownie$.\\
Given nonempty $A\subseteq\N^*$.\\
Want: $\min\,A\ne\frownie$.\\
Assume $\min\,A=\frownie$.\\
Want: Contradiction.\\
\\
{\it Claim 1:} $\forall j\in\N_0$, $[1..j]\cap A=\emptyset$.\\
{\it Proof of Claim 1:}\\
Let $S:=\{j\in\N_0\,|\,[1..j]\cap A=\emptyset\}$.\\
Want: $S=\N_0$. \qquad
Want: $S=[0..\infty)$.\\
Since $[1..0]\cap A=\emptyset\cap A=\emptyset$, we see that $0\in S$.\\
Then, by the GPMI,\\
Want: $S$ is successor closed.\\
Want: $\forall j\in S$, $j+1\in S$.\\
Given $j\in S$.\qquad
Want: $j+1\in S$.\\
Let $k:=j+1$. \qquad
Want: $k\in S$.\\
Since $j\in S$, we have $[1..j]\cap A=\emptyset$.\\
So, since $k\ne\frownie=\min A$,
by \tref{thm-jtoinftydisjoint-not-kto-infty},
we see that $[1..k]\cap A=\emptyset$.\\
Then $k\in A$, as desired.
{\it End of proof of Claim 1.}\\
\\
{\it Claim 2:} $A\subseteq\{\infty\}$.\\
{\it Proof of Claim 2:}\\
We have $\N^*\backslash\N=\{\infty\}$. \qquad
Want: $A\subseteq\N^*\backslash\N$.\\
We have $A\subseteq\N^*$. \qquad
Want: $\forall j\in\N$, $j\notin A$.\\
Given $j\in\N$. \qquad
Want: $j\notin A$.\\
Since $j\in\N$, we conclude that $j\in[1..j]$.\\
By Claim 1, $[1..j]\cap A=\emptyset$.\\
Then $j\notin[1..j]\cap A$.\\
So, since $j\in[1..j]$, we see that $j\notin A$, as desired.\\
{\it End of proof of Claim 2.}\\
\\
Since $\emptyset\ne A\subseteq\{\infty\}$,
we see that $A=\{\infty\}$, so $\min\,A=\infty$.\\
Then $\min\,A=\infty\ne\frownie$ and $\min\,A=\frownie$.\\
Contradiction.
\end{proof}

\begin{thm}\wrlab{thm-subset-well-ordered-well-ordered}
Let $T\subseteq\R^*$ and let $S\subseteq T$.\\
\phx\qquad Assume that $T$ is well-ordered. \quad
Then $S$ is well-ordered.
\end{thm}

\begin{thm}\wrlab{thm-well-ordered-N}
\quad $\N$ is well-ordered.
\end{thm}

\begin{thm}\wrlab{thm-translation-well-ordered-well-ordered}
Let $S\subseteq\R^*$ and let $t\in\R$.\\
\phx\qquad Assume that $S$ is well-ordered. \quad
Then $S+t$ is well-ordered.
\end{thm}

\begin{thm}\wrlab{thm-well-ordered-ktoinfty}
\quad $\forall k\in\Z$, $[k..\infty]$ is well-ordered.
\end{thm}

\begin{thm}\wrlab{thm-well-ordered-ktoinfty-too}
\quad $\forall k\in\Z$, $[k..\infty)$ is well-ordered.
\end{thm}

\begin{defn}\wrlab{defn-bdd}
Let $S\subseteq\R$.\\
\phx\qquad By $S$ is \bfindex[bounded below] in $\R$,
we mean: $\exists u\in\R$ s.t. $u\le S$.\\
\phx\qquad By $S$ is \bfindex[bounded above] in $\R$,
we mean: $\exists u\in\R$ s.t. $S\le u$.\\
\end{defn}

\begin{thm}\wrlab{thm-eg1-bdd}
The following are all true:\\
\phx\qquad $[1;\infty)$ is bounded below in $\R$, but not bounded above in $\R$,\\
\phx\qquad $\N$ is bounded below in $\R$, but not bounded above in $\R$,\\
\phx\qquad $(-\infty;5)$ is bounded above in $\R$, but not bounded below in $\R$,\\
\phx\qquad $\Z$ is neither bounded above nor bounded below in $\R$ \quad and\\
\phx\qquad $(2;5]$ is both bounded above and bounded below in $\R$.\\
\phx\qquad $\emptyset$ is both bounded above and bounded below in $\R$.
\end{thm}

The following will be called the \bfindex[Reverse Archimedean Principle]:

\begin{thm}\wrlab{thm-reverse-arch-principle}
$\forall u\in\R$, $\exists k\in-\N$ s.t.~$k<u$.
\end{thm}

\begin{proof}
Given $u\in\R$. \quad
Want: $\exists k\in-\N$ s.t.~$k<u$.
By the Archimedean Principle (\tref{thm-arch-principle}),\\
choose $j\in\N$ s.t.~$j>-u$.\\
Let $k:=-j$.\\
Want: $k<u$.\\
Since $j>-u$, we see that $-j<-(-u)$.\\
Then $k=-j<-(-u)=u$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-well-ordering-within-Z}
Let $S\subseteq\Z$ be nonempty.\\
Assume that $S$ is bounded below in $\R$. \quad
Then $\min\,S\ne\frownie$.
\end{thm}

\begin{proof}
Since $S$ is bounded below in $\R$, choose $u\in\R$ s.t.~$u\le S$.\\
By the Reverse Archimedean Principle (\tref{thm-reverse-arch-principle}),\\
\phx\qquad choose $k\in-\N$ s.t.~$k<u$.\\
Then $S\subseteq(k;\infty)\cap\Z=(k..\infty)\subseteq[k..\infty]$.\\
By \tref{thm-well-ordered-ktoinfty-too}, $[k..\infty]$ is well-ordered.\\
So, since $\emptyset\ne S\subseteq[k..\infty]$,
we get $\min\,S\ne\frownie$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-reflection-bdd-above-is-bdd-below}
Let $S\subseteq\R$.\\
Assume that $S$ is bounded above in $\R$.\\
Then $-S$ is bounded below in $\R$.
\end{thm}

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

\begin{thm}\wrlab{thm-min-refl-is-refl-max}
$\forall S\subseteq\R$, \quad $\min(-S)=-(\max\,S)$.
\end{thm}

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

\begin{thm}\wrlab{thm-more-well-ordering-within-Z}
Let $S\subseteq\Z$ be nonempty.\\
Assume that $S$ is bounded above in $\R$. \quad
Then $\max\,S\ne\frownie$.
\end{thm}

\begin{proof}
Since $S\subseteq\Z$, we see that $-S\subseteq\Z$.\\
Since $S\ne\emptyset$, we see that $-S\ne\emptyset$.\\
Since $S$ is bounded above in $\R$, by \tref{thm-reflection-bdd-above-is-bdd-below},\\
\phx\qquad we see that $-S$ is bounded below in $\R$.\\
Then, by \tref{thm-well-ordering-within-Z} (with $S$ replaced by $-S$),\\
\phx\qquad we see that $\min(-S)\ne\frownie$.\\
By \tref{thm-min-refl-is-refl-max}, \quad $\min(-S)=-(\max\,S)$.\\
Then $-(\max\,S)\ne\frownie$. \quad
Then $\max\,S\ne\frownie$, as desired.
\end{proof}

\section{Constants, punctures, fills and adjustments}

\begin{defn}\wrlab{defn-const-fn}
$\forall$set $A$, $\forall\!\!\smile\!\!y$,\\
\phx\qquad\qquad\qquad we define $C_A^y:A\to\{y\}$ by \quad $C_A^y(x)=y$.
\end{defn}

The function $C_A^y$ of \dref{defn-const-fn}
is called the \bfindex[constant function] on $A$ with value $y$.
For example, the graph of~$C_\R^1$ is the horizontal line through the point $(0,1)$.
Another example:

\begin{thm}\wrlab{thm-eg1-const-fn}
$\ds{C_{\{2,5,9\}}^6\,\,=\,\,\left(\begin{tabular}{c}
$2\mapsto6$\\
$5\mapsto6$\\
$9\mapsto6$\\
\end{tabular}\right)}$.
\end{thm}

In class, we graphed $C_\R^1$.

\begin{defn}\wrlab{defn-0-fn-on-S}
$\forall$set $S$, \quad $0_S:=C_S^0$.
\end{defn}

\begin{defn}\wrlab{defn-puncture-fill}
Let $A$ be a set.
Then, $\forall\!\!\smile\!\!b$,
$$A_b^\times\,\,:=\,\,A\backslash\{b\}\qquad\hbox{and}\qquad
A_b^+\,\,:=\,\,A\cup\{b\}.$$
Also, $\forall b$, the set $A_b^\times$ is called $A$ \bfindex[punctured] at $b$.\\
Also, $\forall b$, the set $A_b^+$ is called $A$ \bfindex[filled] by $b$, or
$A$ \bfindex[adjoin] $b$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-puncture-fill}
Let $A:=\{5,6,7,8\}$.
Then
\begin{itemize}
\item[]$A_5^\times=\{6,7,8\}$, \qquad $A_9^\times=\{5,6,7,8\}$ \qquad ,
\item[]$A_5^+=\{5,6,7,8\}$, \qquad $A_9^+=\{5,6,7,8,9\}$ \qquad .
\end{itemize}
\end{thm}

Let $X:=(0;2)$.\\
In class, we graphed $X$ and then $X_1^\times$ and then $X_1^+$ on a number line.
We then graphed $X_3^\times$ and then $X_3^+$.\\

\begin{thm}\wrlab{thm-adjust-fn}
Let $f$ be a function.\\
Then, $\forall\!\!\smile\!\!p,\forall\!\!\smile\!\!q$, $\exists1$function $g$, denoted $\adj_p^q\,f$, s.t.\\
\phx\qquad
$[\,\,\forall x,\quad (\,x\ne p\,)\,\,\Rightarrow\,\,(\,g(x)=f(x)\,)\,\,]\qquad\hbox{and}\qquad[\,\,g(p)=q\,\,]$.\\
The function $\adj_p^q\,f$ is called the \bfindex[adjustment] of $f$ sending $p$ to $q$.
\end{thm}

\begin{thm}
Let $\ds{f\,:=\,\left(\begin{tabular}{c}
$1\mapsto4$\\
$2\mapsto-1$\\
$5\mapsto6$\\
\end{tabular}\right),\quad
\phi\,:=\,\left(\begin{tabular}{c}
$0\mapsto3$\\
$1\mapsto4$\\
$2\mapsto-1$\\
$5\mapsto6$\\
\end{tabular}\right)}$.\\
\phx\qquad\qquad\qquad
Then \quad $\ds{\adj_0^7\,f\,\,=\,\,\adj_0^7\,\phi\,\,=\,\,\left(\begin{tabular}{c}
$0\mapsto7$\\
$1\mapsto4$\\
$2\mapsto-1$\\
$5\mapsto6$\\
\end{tabular}\right)}$.
\end{thm}

\begin{thm}\wrlab{eg1-adjust-fn}
Define $f:\R\dashrightarrow\R$ by $f(x)=x/x$.\\
\phx\qquad\qquad\qquad\qquad Then $\adj_0^1\,f=C_\R^1$.
\end{thm}

\begin{thm}\wrlab{thm-eg2-adjust-fn}
Define $f:\R\dashrightarrow\R$ by $f(x)=(x^2+x-2)/(x-1)$.\\
Let $g:=\adj_1^3\,f$. \quad
Then, $\forall x\in\R_1^\times$, $f(x)=x+2$. \quad
Also, $f(1)=\frownie$.\\
\phx\qquad\qquad\qquad\qquad Also, $\forall x\in\R$, $\,\,\,g(x)=x+2$.
\end{thm}

\begin{thm}\wrlab{thm-dom-im-after-adj}
$\forall$function $f$, $\forall\!\!\smile\!\!p$, $\forall\!\!\smile\!\!q$,\\
\phx\qquad $\dom[(\adj_p^q\,f)]=(\dom[f])_p^+$ \quad and \quad $\im[(\adj_p^q\,f)]\subseteq(\im[f])_q^+$.
\end{thm}

\section{Finite and infinite sets}

\begin{thm}
Let $S$ be a set.
Let $A:=\{j\in\N_0\,|\,\exists S\hookrightarrow[1..j]\}$.\\
\phx\qquad Let $B:=A_\infty^+$. \quad
Then $\emptyset\ne B\subseteq\N_0^*$.
\end{thm}

\begin{defn}\wrlab{defn-count-set}
Let $S$ be a set.
Let $A:=\{j\in\N_0\,|\,\exists S\hookrightarrow[1..j]\}$.
\phx\qquad Let $B:=A_\infty^+$. \quad
Then $\#S:=\min B$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-count-set}
$\#\{2,7,9\}=3$ and $\#\Z=\infty=\#\R$ and $\#\emptyset=0$.
\end{thm}

\begin{thm}\wrlab{thm-size-of-set-is-nonneg-ext-integer}
$\forall$set $S$, \quad $\#S\in\N_0^*$.
\end{thm}

\begin{defn}\wrlab{defn-finite}
$\forall$set $S$, by $S$ is \bfindex[finite],
we mean $\#S<\infty$.
\end{defn}

\begin{defn}\wrlab{defn-infinite}
$\forall$set $S$, by $S$ is \bfindex[infinite],
we mean $\#S=\infty$.
\end{defn}

\begin{thm}\wrlab{thm-k-elts-bijective-with-1tok}
Let $S$ be a set, $k\in\N_0$.\\
\phx\qquad\qquad\qquad\qquad Then: \quad $(\,\#S=k\,)\,\Leftrightarrow\,(\,\exists[1..k]\hookrightarrow>S\,)$.
\end{thm}

\begin{thm}
$\forall$finite sets $A$, $B$,\\
\phx\qquad\qquad\qquad\qquad Then: \quad $(\,\#A=\#B\,)\,\Leftrightarrow\,(\,\exists A\hookrightarrow>B\,)$.
\end{thm}

\begin{thm}
$\forall$sets $A,B$, $[\,\,(\,\exists A\hookrightarrow B\,)\,\,\vee\,\,(\,\exists B\hookrightarrow A\,)\,\,]$.
\end{thm}

The next theorem is the \bfindex[Schroeder-Bernstein Theorem]:

\begin{thm}\wrlab{thm-SchBern}
$\forall$sets $A,B$,\\
\phx\qquad $[\quad(\,\exists A\hookrightarrow B\,)\quad\&\quad(\,\exists B\hookrightarrow A\,)\quad]\quad\Rightarrow\quad[\quad\exists A\hookrightarrow>B\quad]$.
\end{thm}

We described the ``World of Sets'', as a big blob on the board, with no top.
Inside, sets that are at the same horizontal level are bijective.
If one set is above another then there's an injection from the lower one to the upper one,
but not the other way around.
Inside, starting at the bottom, we showed the empty set, then singletons, then unordered pairs, etc.,
and then a dividing line between finite and infinite.

\begin{thm}\wrlab{thm-k-elts-inf-elts-includes-N}
Let $S$ be a set.\\
\phx\qquad\qquad\qquad\qquad Then: \quad $(\,\#S=\infty\,)\,\Leftrightarrow\,(\,\exists\N\hookrightarrow S\,)$.
\end{thm}

In the World of Sets, we showed $\N$ at the bottom of the infinite sets.
Sets at or below $\N$ are said to be ``countable''.
Sets above $\N$ are ``uncountable''.
Sets at the same horizontal level as $\N$ are ``countably infite''.
That is:

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

\begin{thm}
Let $S$ be a set. Then:\\
\phx\qquad $[\,S\hbox{ is countably infnite}\,]\,\Leftrightarrow\,[\,(\,S\hbox{ is countable}\,)\,\&\,(\,S\hbox{ is infnite}\,)\,]$.
\end{thm}

\begin{thm}
$\forall$countable set $C$, $\forall A\subseteq C$, \quad $A$ is countable.
\end{thm}

\begin{thm}
$N_0$ and $\Z$ and $\Q$ are all countably infinite.
\end{thm}

We put $\N_0$, $\Z$, $\Q$ all at the same level as $\N$.

\begin{thm}
$\forall$ sets $A$, $[\,\,(\,\exists A\hookrightarrow2^A\,)\,\&\,(\,\not\exists2^A\hookrightarrow A\,)\,\,]$.
\end{thm}

We put in $2^\N$ and $2^{2^\N}$, and explained that there is no top.

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

We put in $\R$ at the same level as $2^\N$.
Sets at that level are said to have ``continuum cardinality'':

\begin{defn}
Let $S$ be a set.\\
By $S$ has \bfindex[continuum cardinality], we mean: $\exists S\hookrightarrow>\R$.
\end{defn}

Any Euclidean space had continuum cardinality:

\begin{thm}
$\forall k\in\N$, $\R^k$ has continuum cardinality.
\end{thm}

We put $\R^1$, $\R^2$, $\R^3$ at the same level as $\R$.

Any nondegenerate interval has continuum cardinality:

\begin{thm}
Let $a,b\in\R^*$.
Assume $a<b$.
Then:\\
\phx\qquad $[a;b]$, $[a;b)$, $(a;b]$ and $(a;b)$ all have continuum cardinality.
\end{thm}

We put $[0;1]$ and $(0;1)$ at the same level as $\R$.

Within our axiom system,
there is no way to determine if there are any sets strictly between $\N$ and $2^\N$.
The assertion\\
\phx\qquad$\not\exists$set $S$ s.t.~$(\,(\exists\N\hookrightarrow S)\,\&\,(\exists S\hookrightarrow2^\N)\,\&\,(\not\exists S\hookrightarrow\N)\,\&\,(\not\exists2^\N\hookrightarrow S)\,)$\\
is called the \bfindex[Continuum Hypothesis] or \bfindex[CH].
The axiom system of~this course is equivalent to a standard axiomatic system called ZFC.
Within ZFC, it is impossible to prove CH, but it is also impossible to~prove $\neg$CH.
To convey this, one says: ``CH is independent of ZFC''.

Within our axiom system, $\forall$infinite set $A$,
there is no way to determine if there are any sets strictly between $A$ and $2^A$.
The \bfindex[Generalized Continuum Hypothesis] or \bfindex[GCH] is the assertion: \quad
$\forall$infinite set $A$,\\
\phx\qquad$\not\exists$set $S$ s.t.~$(\,(\exists A\hookrightarrow S)\,\&\,(\exists S\hookrightarrow2^A)\,\&\,(\not\exists S\hookrightarrow A)\,\&\,(\not\exists2^A\hookrightarrow S)\,)$\\
Within ZFC, it is impossible to prove GCH, but it is also impossible to~prove $\neg$GCH.
That is, GCH is independent of ZFC.

Here are a few important sets:\\
\phx\qquad Let $c_0:=\emptyset$.\\
\phx\qquad Let $c_1:=\{c_0\}$.\\
\phx\qquad Let $c_2:=\{c_0,c_1\}$.\\
\phx\qquad Let $c_3:=\{c_0,c_1,c_2\}$.\\
\phx\qquad\qquad$\vdots$\\
\phx\qquad Let $\aleph_0:=\{c_0,c_1,c_2,c_3,\ldots\}$.\\
Then $c_0$ is called the $0$th cardinal number, and it is the only set at the bottom level of the World of Sets.
The first cardinal number is $c_1$, and we will position it as the leftmost set at the level of singleton sets.
The second cardinal number is $c_2$, and we will position it as the leftmost set at the level of unordered pairs.
The third cardinal number is $c_3$, and we will position it as the leftmost set at the level of sets with three elements.
The countably infinite cardinal number is $\aleph_0$, and we will position it as the leftmost set at the level of countably infinite sets.

We will not go into more detail here, but there is a system for producing exactly one cardinal number
at each horizontal level in the World of Sets, and I like to position these sets on the left.
The ``cardinality'' of a set is the unique cardinal number that is bijective with that set.
Then two sets are bijective iff they have the same cardinality.

\begin{thm}\wrlab{thm-finite-sets-have-min-max}
$\forall$finite, nonempty $A\subseteq\R^*$, $\min\,A\ne\frownie\ne\max\,A$.
\end{thm}

Recall \tref{thm-eg-set-to-set}:

\begin{thm}\wrlab{thm-eg-set-to-set-repeat}
$\ds{\{0,1\}^{\{7,8,9\}}=}$\\
\phx\quad$\ds{\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$\ds{\,\,\,\,\,
\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}

Recall \tref{thm-eg1-set-to-the-12}:

\begin{thm}\wrlab{thm-eg1-set-to-the-12-repeat}
\quad$\{7,8,9\}^{\{1,2\}}\quad=$\\
\phantom{xxx}\qquad\qquad$\ds{\bigg\{
\left(\begin{tabular}{c}$1\mapsto7$\\$2\mapsto7$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto7$\\$2\mapsto8$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto7$\\$2\mapsto9$\end{tabular}\right),}$\\
\phx\qquad\qquad\qquad
$\ds{\left(\begin{tabular}{c}$1\mapsto8$\\$2\mapsto7$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto8$\\$2\mapsto8$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto8$\\$2\mapsto9$\end{tabular}\right),}$\\
\phx\qquad\qquad\qquad
$\ds{\left(\begin{tabular}{c}$1\mapsto9$\\$2\mapsto7$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto9$\\$2\mapsto8$\end{tabular}\right),
\left(\begin{tabular}{c}$1\mapsto9$\\$2\mapsto9$\end{tabular}\right)
\bigg\}}=$\\
\phantom{xxx}$\{\,(7,7)\,,\,(7,8)\,,\,(7,9)\,,\,\,(8,7)\,,\,(8,8)\,,\,(8,9)\,,\,\,(9,7)\,,\,(9,8)\,,\,(9,9)\,\}$.
\end{thm}

\begin{thm}
$\forall$finite sets $A,B$, \quad $\#(B^A)=(\#B)^{\#A}$.
\end{thm}

Recall: \tref{thm-eg1-powerset}:

\begin{thm}\wrlab{thm-eg1-powerset-repeat}
$2^{\{7,8,9\}}=$\\
\phx\qquad\qquad\qquad $\{\,\,\emptyset,\,\,\{9\},\,\,\{8\},\,\,\{8,9\},$\\
\phx\qquad\qquad\qquad $\,\,\,\,\{7\},\,\,\{7,9\},\,\{7,8\},\,\{7,8,9\}\,\,\}$.
\end{thm}

Recall \tref{thm-01toA-bijective-2toA}:

\begin{thm}\wrlab{thm-01toA-bijective-2toA-repeat}
$\forall$set $A$, $\exists\{0,1\}^A\hookrightarrow>2^A$.
\end{thm}

\begin{thm}
$\forall$finite set $A$, \quad $\#(2^A)=2^{\#A}$.
\end{thm}

\section{Arithmetic of functionals}

\begin{defn}
$\forall f$, by $f$ is a \bfindex[functional], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,f\hbox{ is a function}\,)\,\&\,(\,\im[f]\subseteq\R\,)$.
\end{defn}

\begin{defn}\wrlab{defn-scmult-fn}
Let $a\in\R$ and let $f$ be a functional.\\
Then $a\cdot f$, $a/f$ and $f/a$ are the functionals defined by: $\forall x$,
\begin{itemize}
\item[]$(a\cdot f)(x)=a\cdot[f(x)]$,
\item[]$(a/f)(x)=a/[f(x)]$ \quad and
\item[]$(f/a)(x)=[f(x)]/a$.
\end{itemize}
\end{defn}

We often write $af$ instead of $a\cdot f$.

\begin{defn}
For any functional $f$, we define $-f:=(-1)\cdot f$.
\end{defn}


\begin{defn}\wrlab{defn-add-mult-fns}
Let $f$ and $g$ be functionals.\\
Assume that $\im[f]\subseteq\R$ and that $\im[g]\subseteq\R$.\\
Then $f+g$, $f-g$, $f\cdot g$ and $f/g$ are the functionals defined by: $\forall x$,
\begin{itemize}
\item[]$(f+g)(x)=[f(x)]+[g(x)]$,
\item[]$(f-g)(x)=[f(x)]-[g(x)]$,
\item[]$(f\cdot g)(x)=[f(x)]\cdot[g(x)]$ \qquad and
\item[]$(f/g)(x)=[f(x)]/[g(x)]$.
\end{itemize}
\end{defn}

We often write $fg$ instead of $f\cdot g$.

\begin{thm}\wrlab{thm-eg1-addition-subtraction-in-Rk}
$(1,2,3)+(4,0,-3)=(5,2,0)$ and\\
\phx\quad\qquad\qquad\qquad\qquad $(1,2,3)-(4,0,-3)=(-3,2,6)$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-scalar-mult-in-Rk}
\qquad $3\cdot(2,0,-3,1)=(6,0,-9,3)$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-scalar-div-in-Rk}
\qquad $(6,0,-9,3)/3=(2,0,-3,1)$.
\end{thm}

\section{Absolute value and dot product}

\begin{thm}\wrlab{thm-square-nonneg}
$\forall x\in\R$, \quad $x^2\ge0$.
\end{thm}

\begin{thm}\wrlab{thm-square-zero-iff-zero}
$\forall x\in\R$, \quad $(\,x^2=0\,)\,\Leftrightarrow\,(\,x=0\,)$.
\end{thm}

\begin{thm}\wrlab{thm-nonneg-abs-val-itself}
$\forall x\ge0$, \quad $|x|=x$
\end{thm}

\begin{thm}\wrlab{thm-nonpos-abs-val-neg}
$\forall x\le0$, \quad  $|x|=-x$
\end{thm}

\begin{thm}\wrlab{thm-square-squareroot}
$\forall x\in\R$, \quad  $|x|=\sqrt{x^2}$.
\end{thm}

\begin{thm}\wrlab{thm-properties-of-absval}
All of the following are true:
\begin{itemize}
\item[(1)]$\forall x\in\R$, \qquad\qquad\qquad $[\,(\,x=0\,)\,\Leftrightarrow\,(\,|x|=0\,)\,]$.
\item[(2)]$\forall a\in\R$, $\forall x\in\R$, \qquad\quad $|ax|=|a|\cdot|x|$.
\item[(3)]$\forall x,y\in\R$, \qquad\quad\qquad $|x+y|\le|x|+|y|$.
\end{itemize}
\end{thm}

In \tref{thm-properties-of-absval},
\begin{itemize}
\item[](1) says that ``$|\bullet|$ separates zero'' \qquad ,
\item[](2) says that ``$|\bullet|$ is absolute homogeneous'' \qquad and
\item[](3) says that ``$|\bullet|$ is subadditive'' \qquad .
\end{itemize}
The three properties together say ``$|\bullet|$ is a norm''.

\begin{defn}\wrlab{defn-dot-prod}
$\forall k\in\N$, $\forall v,w\in\R^k$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $v\sbullet w:=v_1w_1+\cdots+v_kw_k$.
\end{defn}

Logic purist:
Replace ``$v_1w_1+\cdots+v_kw_k$'' by ``$\ds{\sum_1^k\,(vw)_\bullet}$''.

\begin{defn}\wrlab{defn-44}
$44:=4\cdot10+4$.
\end{defn}

\begin{thm}\wrlab{thm-eg1-dot-prod}
\phx\quad $(1,3,5)\sbullet(2,4,6)=1\cdot2+3\cdot4+5\cdot6=44$.
\end{thm}

\begin{thm}\wrlab{thm-dot-prod-comm}
$\forall k\in\N$, $\forall v,w\in\R^k$, \quad $v\sbullet w=w\sbullet v$.
\end{thm}

\begin{thm}\wrlab{thm-dot-prod-biadditive}
$\forall k\in\N$, $\forall u,v,w\in\R^k$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $u\sbullet(v+w)=(u\sbullet v)+(u\sbullet w)$.
\end{thm}

\begin{thm}\wrlab{thm-dot-prod-bi-scalar-comm}
$\forall k\in\N$, $\forall a\in\R$, $\forall v,w\in\R^k$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(av)\sbullet w=a\cdot(v\sbullet w)$.
\end{thm}

\begin{thm}\wrlab{thm-dot-prod-pos-def}
$\forall k\in\N$, $\forall v\in\R^k$, \qquad $v\sbullet v\ge0$.
\end{thm}

\section{Standard norms on Euclidean spaces}

FOR NEXT YEAR: Define $|v|_p:=(|v_1|^p+\cdots+|v_k|^p)^{1/p}$
and note that $|v|_2=\sqrt{v\sbullet v}$.
Don't use $|v|_k$; instead, use $|v|_2$.
LATER, don't use $|v|_{k,p}$; instead, use $|v|_p$.

\begin{defn}\wrlab{k-two-norm}
$\forall k\in\N$, $\forall v\in\R^k$, we define $|v|_k:=\sqrt{v\sbullet v}$.
\end{defn}

\begin{thm}\wrlab{thm-vdotv-is-norm-v-squared}
$\forall k\in\N$, $\forall v\in\R^k$, \quad $v\sbullet v=|v|_k^2$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-k-two-norm}
$|(3,4)|_2=\sqrt{(3,4)\sbullet(3,4)}=\sqrt{3^2+4^2}=5$.
\end{thm}

\begin{defn}\wrlab{defn-194}
$194:=1\cdot100+9\cdot10+4$.
\end{defn}

\begin{thm}\wrlab{thm-eg2-k-two-norm}
$|(7,8,9)|_3=\sqrt{7^2+8^2+9^2}=\sqrt{194}$.
\end{thm}

Recall (\dref{defn-0-fn-on-S}) that, $\forall$set $S$, we defined $0_S:=C_S^0$.

\begin{defn}\wrlab{defn-zero-in-Rk}
$\forall k\in\N$, \qquad $0_k:=0_{[1..k]}$.
\end{defn}

Then $0_2=(0,0)$ and $0_3=(0,0,0)$ and $0_4=(0,0,0,0)$, {\it etc.}

\begin{thm}\wrlab{thm-properties-of-k2norm}
Let $k\in\N$.
Then all of the following are true:
\begin{itemize}
\item[(1)]$\forall v\in\R^k$, \qquad\qquad\qquad $[\,(\,v=0_k\,)\,\Leftrightarrow\,(\,|v|_k=0\,)\,]$.
\item[(2)]$\forall a\in\R$, $\forall v\in\R^k$, \qquad\quad $|av|_k=|a|\cdot|v|_k$.
\item[(3)]$\forall v,w\in\R^k$, \qquad\qquad\quad $|v+w|_k\le|v|_k+|w|_k$.
\end{itemize}
\end{thm}

Let $k\in\N$.
In \tref{thm-properties-of-k2norm},
\begin{itemize}
\item[](1) says that ``$|\bullet|_k$ separates zero'' \qquad ,
\item[](2) says that ``$|\bullet|_k$ is absolute homogeneous'' \qquad and
\item[](3) says that ``$|\bullet|_k$ is subadditive'' \qquad .
\end{itemize}
The three properties together say ``$|\bullet|_k$ is a norm''.

We sometimes refer to the absolute value function, $|\bullet|:\R\to[0;\infty)$, as the \bfindex[standard norm on $\R$].
For all $k\in\N$, the \bfindex[standard norm on $\R^k$] is $|\bullet|_k:\R^k\to[0;\infty)$.
Some use ``Euclidean norm'' instead of standard norm.

\begin{thm}\wrlab{thm-polar-decomp}
Let $k\in\N$, $v\in\R^k$.
Let $a:=|v|_k$.\\
\phx\qquad Then $\exists u\in\R^k$ s.t.: \qquad $(\,|u|_k=1\,)\,\,\,\,\&\,\,\,\,(\,v=au\,)$.
\end{thm}

\begin{proof}
One of the following is true:
\begin{itemize}
\item[(1)]$v=0_k$ \qquad or
\item[(2)]$v\ne0_k$.
\end{itemize}
\vskip.1in\noindent
{\it Case (1):}\\
Let $u:=(1,0,\ldots,0)$.\\
Want: $(\,|u|_k=1\,)\,\,\,\&\,\,\,(\,v=au\,)$.\\
We have $|u|_k=\sqrt{1^2+0^2+\cdots+0^2}=1$.\\
Want: $v=au$.\\
We have $v=0_k=0\cdot u=au$.\\
{\it End of Case (1).}\\
\\
\noindent
{\it Case (2):}\\
Since $v\ne0_k$, we see that $|v|_k\ne0$.\\
Then $a=|v|_k\ne0$.\\
So, since $a\in[0;\infty)$, we conclude that $a\in\R_0^\times$.\\
Let $u:=v/a$.\\
Want: $(\,|u|_k=1\,)\,\,\,\&\,\,\,(\,v=au\,)$.\\
We have $|u|_k=|v/a|_k=(|v|_k)/a=a/a=1$.\\
Want: $v=au$.\\
We have $v=a\cdot(v/a)=au$.\\
{\it End of Case (2).}
\end{proof}

The following theorem is the \bfindex[Cauchy-Schwarz inequality]:

\begin{thm}\wrlab{thm-Cauchy-Schwarz-in-Euclidean-space}
$\forall k\in\N$, $\forall v,w\in\R^k$, \quad $|v\sbullet w|\,\,\le\,\,|v|_k\cdot|w|_k$.
\end{thm}

\begin{proof}
Let \qquad $a:=|v|_k$ \qquad and \qquad $b:=|w|_k$.\\
By \tref{thm-polar-decomp},
choose $t\in\R^k$ s.t.~$|t|_k=1$ and $v=at$.\\
By \tref{thm-polar-decomp},
choose $u\in\R^k$ s.t.~$|u|_k=1$ and $w=bu$.\\
Then $t\sbullet t=|t|_k^2=1^2=1$. \qquad
Also, $u\sbullet u=|u|_k^2=1^2=1$.\\
We have $(t-u)\sbullet(t-u)\ge0$.\\
Expanding this, we get $1-2\cdot(t\sbullet u)+1\ge0$, so $2-2\cdot(t\sbullet u)\ge0$.\\
Then $2\ge2\cdot(t\sbullet u)$, so $1\ge t\sbullet u$.\\
Then $t\sbullet u\le1$, so $(ab)\cdot(t\sbullet u)\le ab$.\\
Then $v\sbullet w=(at)\sbullet(bu)=(ab)\cdot(t\sbullet u)\le ab=|v|_k\cdot|w|_k$.
\end{proof}

\section{Unassigned homework}

\begin{thm}
$\forall a,z\in\R$,
$[\,|a|\le z\,]\,\Leftrightarrow\,[\,(\,a\le z\,)\,\&\,(\,-a\le z\,)\,]$.
\end{thm}

\section{Metric spaces}

FOR NEXT YEAR: Put nonemptyness as part of the definition of a metric space.

FOR NEXT YEAR: Maybe we should define ``extended metric'' as a function $d:S\times S\to[0;\infty]$
with the same properties as a metric, but with the target including $\infty$.
So, some points could be at an infinite distance from others.
This would allow for a standard {\it extended} metric on $\R^*$.
We'd need to define: $\forall a\in\R^+_\infty$, $a+\infty=\infty$ to make the triangle inequality make sense.

\begin{defn}\wrlab{defn-metric-on-set}
Let $S$ be a set, and let $d:S\times S\to[0;\infty)$.\\
By~$d$ is a \bfindex[metric] on $S$, we mean:
\begin{itemize}
\item[(1)]$\forall x,y\in S$, \qquad\quad $(\,\,[\,x=y\,]\,\,\Leftrightarrow\,\,[\,d(x,y)=0\,]\,\,)$,
\item[(2)]$\forall x,y\in S$, \qquad\quad $d(x,y)=d(y,x)$ \qquad\qquad\qquad and
\item[(3)]$\forall x,y,z\in S$, \qquad$\,\,$ $d(x,z)\le[d(x,y)]+[d(y,z)]$.
\end{itemize}
\end{defn}

In \dref{defn-metric-on-set},
\begin{itemize}
\item[](1) says that ``$d$ separates points'' \qquad ,
\item[](2) says that ``$d$ is symmetric'' \qquad\qquad\qquad and
\item[](3) says that ``$d$ satisfies the triangle inequality'' \qquad .
\end{itemize}

\begin{defn}\wrlab{defn-set-of-metrics}
For any set $S$,\\
\phx\qquad $\scrm(S)\quad:=\quad\{d:S\times S\to[0;\infty)\,|\,d\hbox{ is a metric on S}\}$.
\end{defn}

The logic purist would object because, according to our Axioms of~Specification,
in \dref{defn-set-of-metrics}, we should write ``$\{d\in\ldots|\ldots\}$''.
To fix this, we could write\\
\phx\qquad $\scrm(S)\quad:=\quad\{d\in[0;\infty)^{S\times S}\,|\,d\hbox{ is a metric on S}\}$.

\begin{thm}\wrlab{thm-eg1-metric-on-R}
$\exists 1d\in\scrm(\R)$, denoted $d_0$,\\
\phx\qquad\qquad\qquad\qquad s.t., $\forall x,y\in\R$, \quad $d(x,y)=|y-x|$.\\
We call $d_0$ the \bfindex[standard metric on $\R$].
\end{thm}

\begin{thm}\wrlab{thm-eg2-metric-on-Rk}
Let $k\in\N$.
Then $\exists 1d\in\scrm(\R^k)$, denoted $d_k$,\\
\phx\qquad\qquad\qquad\qquad s.t., $\forall v,w\in\R^k$, \quad $d(v,w)=|w-v|_k$.\\
We call $d_k$ the \bfindex[standard metric on $\R^k$].
\end{thm}

\begin{defn}\wrlab{defn-metric-space}
A \bfindex[metric space] is an ordered pair $(S,d)$ s.t.
\begin{itemize}
\item[]\qquad $S$ is a set \qquad\qquad and \qquad\qquad $d\in\scrm(S)$.
\end{itemize}
\end{defn}

\begin{defn}\wrlab{defn-metric-and-space-in-metric-space}
Let $X$ be a metric space.\\
Then $X_{\hbox{\rm set}}:=X_1$ and $d_X:=X_2$.\\
Also, $X_{\hbox{\rm set}}$ is called the {\bf underlying set}\index[terms]{underlying set of a metric space} of $X$.\\
Also, $d_X$ is called the {\bf metric}\index[terms]{metric on a metric space} on $X$.
\end{defn}

We sometimes omit the subscript ``$X$'' from ``$d_X$''.

We almost always omit the subscript ``set'' from ``$X_{\hbox{\rm set}}$'',
so, by sloppiness, the underlying set $X_{\hbox{\rm set}}$ of~$X$ is often denoted $X$.
This means that $X$ has two different meanings, and, in each usage,
you have to figure out, by context, which $X$ is intended.
For example, if you see ``$d_X$'', then $X$ is a metric space.
On the other hand, if you see ``$a:\R\to X$'' or ``$b\in X$'', then $X$ is a set.

For your confusion, $(\R,d_0)$ is denoted $\R$.
Then $d_0=d_\R$.

Let $k\in\N$.
For confusion, $(\R^k,d_k)$ is denoted $\R^k$.
Then $d_k=d_{\R^k}$.

\begin{thm}\wrlab{thm-eg1-distances}
\qquad $d_\R(5,7)=2$ \quad and \quad $d_\R(9,3)=6$ \quad and\\
\phx\qquad $d_2((1,7),(4,3))=\sqrt{(1-4)^2-(7-3)^2}=5$.
\end{thm}

A basic property of $|\bullet|$ is that it is ``distance semi-decreasing'':

\begin{thm}\wrlab{thm-absval-dist-semidecr}
$\forall x,y\in\R$, \quad $d_\R(|x|,|y|)\le d_\R(x,y)$.
\end{thm}

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

According to \tref{thm-absval-dist-semidecr},
$\forall x,y\in\R$,
\begin{itemize}
\item[]$|\,\,\,|x|\,\,\,-\,\,\,|y|\,\,\,|\qquad\le\qquad|\,\,\,x\,\,\,-\,\,\,y\,\,\,|$.
\end{itemize}

For each $k\in\N$, $|\bullet|_k$ is also ``distance semi-decreasing'':

\begin{thm}\wrlab{thm-k2norm-dist-semidecr}
$\forall k\in\N$, $\forall v,w\in\R^k$, \quad $d_\R(|v|_k,|w|_k)\le d_k(v,w)$.
\end{thm}

\begin{proof}
Given $k\in\N$ and $v,w\in\R^k$.\\
Want: $d_\R(|v|_k,|w|_k)\le d_k(v,w)$.\\
Let $a:=|v|_k-|w|_k$ and let $z:=|v-w|_k$.\\
Then $d_\R(|v|_k,|w|_k)=|a|$ and $d_k(v,w)=z$.\\
Want: $|a|\le z$. \qquad
Want: $a\le z$ and $-a\le z$.\\
We have $|v|_k=|w+(v-w)|_k\le|w|_k+|v-w|_k=|w|_k+z$.\\
Subtracting $|w|_k$ from both sides, we see that $a\le z$.\\
Want: $-a\le z$.\\
We have \quad $|w-v|_k=|v-w|_k=z$ \quad and \quad $-a=|w|_k-|v|_k$.\\
Then $|w|_k=|v+(w-v)|_k\le|v|_k+|w-v|_k=|v|_k+z$.\\
Subtracting $|v|_k$ from both sides, we see that $-a\le z$, as desired.
\end{proof}

According to \tref{thm-k2norm-dist-semidecr}, $\forall k\in\N$,
$\forall v,w\in\R^k$,
\begin{itemize}
\item[]$|\,\,\,\,|v|_k\,\,\,-\,\,\,|w|_k\,\,\,|\qquad\le\qquad|\,\,\,v\,\,\,-\,\,\,w\,\,\,|_k$.
\end{itemize}

\begin{defn}\wrlab{defn-open-ball}
Let $X$ be a metric space, $z\in X$, $r>0$.\\
\phx\qquad\qquad\qquad Then $B_X(z,r):=\{q\in X\,|\,d_X(z,q)<r\}$.
\end{defn}

We sometimes omit the subscript ``$X$'' from ``$B_X(z,r)$''.

The set $B_X(z,r)$ of \dref{defn-open-ball}
is called: the \bfindex[open ball] about $z$ of radius $r$.
We sometimes omit ``open'' and simply say
``\bfindex[ball] about $z$ of radius $r$''.

\begin{thm}
$\forall a\in\R$, $\forall\delta>0$, \quad
$B_\R(a,\delta)=(a-\delta;a+\delta)$.
\end{thm}

The next result says that any two points in a metric space can
be separated by balls of equal radii.

\begin{thm}\wrlab{thm-Hausdorff-property}
Let $X$ be a metric space, and let $y,z\in X$.\\
Assume $y\ne z$. \qquad 
Then $\exists r>0$ s.t.~$[B_X(y,r)]\cap[B_X(z,r)]=\emptyset$.
\end{thm}

\begin{proof}
This is HW\#6-2.
\end{proof}

\tref{thm-Hausdorff-property}, above, is the \bfindex[Hausdorff property] of metric spaces.

\begin{defn}
Let $X$ be a metric space and let $z\in X$.\\
We define $\scrb_X(z):=\{B(z,r)\,|\,r>0\}$.
\end{defn}

We sometimes omit the subscript ``$X$'' from ``$\scrb_X(z)$''.

\begin{thm}\wrlab{thm-ball-version-of-Hausdorff}
Let $X$ be a metric space and let $p,q\in X$.\\
Assume that $p\ne q$. \quad
Then $\exists A\in\scrb_X(p)$, $\exists B\in\scrb_X(q)$
s.t.~$A\cap B=\emptyset$.
\end{thm}

\begin{proof}
By \tref{thm-Hausdorff-property},\\
choose $r>0$ s.t.~$[B(y,r)]\cap[B(z,r)]=\emptyset$.
Let $A:=B(y,r)$ and $B:=B(z,r)$.\\
Want: $A\cap B=\emptyset$.\\
We have: $A\cap B=[B(y,r)]\cap[B(z,r)]=\emptyset$, as desired.
\end{proof}

\begin{defn}\wrlab{defn-set-of-balls-in-MS}
Let $X$ be a metric space.\\
\phx\qquad Then \qquad\qquad $\scrb_X\,\,\,:=\,\,\,\{\,\,B(z,r)\,\subseteq\,X\,\,|\,\,z\in X,\,\,r>0\,\,\}$.
\end{defn}

\begin{thm}\wrlab{thm-subset-recentering}
Let $X$ be a metric space, $B\in\scrb_X$ and $p\in B$.\\
Then $\exists A\in\scrb(p)$ s.t.~$A\subseteq B$.
\end{thm}

\begin{proof}
Since $B\in\scrb_X$, choose $q\in X$ and $t>0$ s.t.~$B=B(q,t)$.\\
Since $p\in B=B(q,t)$, we get $d(p,q)<t$.\\
Let $s:=d(p,q)$. \quad
Then $s<t$.\\
Let $r:=t-s$. \quad
Then $r>0$ and $r+s=t$.\\
Let $A:=B(p,r)$. \quad
Then $A\in\scrb(p)$.\\
Want: $A\subseteq B$.\\
Want: $\forall z\in A$, $z\in B$.\\
Given $z\in A$. \quad
Want: $z\in B$.\\
Since $z\in A=B(p,r)$, we get $d(z,p)<r$.\\
Since $d(z,p)<r$ and $d(p,q)=s$,\\
\phx\qquad we get $[d(z,p)]+[d(p,q)]<r+s$.\\
Then $d(z,q)\le[d(z,p)]+[d(p,q)]<r+s=t$,
so $z\in B(q,t)$.\\
Then $z\in B(q,t)=B$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-supset-recentering}
Let $X$ be a metric space, $A\in\scrb_X$ and $q\in X$.\\
Then $\exists B\in\scrb(q)$ s.t.~$B\supseteq A$.
\end{thm}

\begin{proof}
This is HW\#6-3.
\end{proof}

\tref{thm-subset-recentering} is called the \bfindex[Subset Recentering Lemma]\index[terms]{Recentering Lemma, Subset}.

\tref{thm-supset-recentering} is called the \bfindex[Superset Recentering Lemma]\index[terms]{Recentering Lemma, Superset}.

\begin{defn}\wrlab{defn-bdd-in-MS}
Let $X$ be a metric space and let $S\subseteq X$.\\
\phx\qquad By $S$ is \bfindex[bounded] in $X$, we mean:
$\exists B\in\scrb_X$ s.t.~$S\subseteq B$.
\end{defn}

The following is the same as \tref{thm-eg1-bdd}:

\begin{thm}
The following are all true:\\
\phx\qquad $[1;\infty)$ is bounded below in $\R$, but not bounded above in $\R$,\\
\phx\qquad $\N$ is bounded below in $\R$, but not bounded above in $\R$,\\
\phx\qquad $(-\infty;5)$ is bounded above in $\R$, but not bounded below in $\R$,\\
\phx\qquad $\Z$ is neither bounded above nor bounded below in $\R$ \quad and\\
\phx\qquad $(2;5]$ is both bounded above and bounded below in $\R$.\\
\phx\qquad $\emptyset$ is both bounded above and bounded below in $\R$.
\end{thm}

\begin{thm}
The following are all true:\\
\phx\qquad $[1;\infty)$ is not bounded in $\R$,\\
\phx\qquad $\N$ is not bounded in $\R$,\\
\phx\qquad $(-\infty;5)$ is not bounded in $\R$,\\
\phx\qquad $\Z$ is not bounded in $\R$ \quad and\\
\phx\qquad $(2;5]$ bounded in $\R$.\\
\phx\qquad $\emptyset$ bounded in $\R$.
\end{thm}

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

\section{Sequences}

\begin{defn}
$\forall a$, by $a$ is a \bfindex[sequence],
we mean:\\
\phx\qquad
$a$ is a function \quad and \quad $\dom[a]=\N$.
\end{defn}

\begin{defn}
$\forall a$, $\forall X$, by $a$ is a \bfindex[sequence] in $X$,
we mean:\\
\phx\qquad
$a\in X^\N$.
\end{defn}

\begin{defn}
Let $f$ be a function and let $X$ be a set.\\
\phx\qquad
By $f$ is $X$-\bfindex[valued], we mean $\im[f]\subseteq X$.
\end{defn}

\begin{defn}\wrlab{defn-bounded-function-into-MS}
Let $X$ be a metric space and let $f$ be an $X$-valued function.\\
By $f$ is {\bf bounded into $X$}\index[terms]{bounded function},
we mean:\\
\phx\qquad
$\im[f]$ is bounded in $X$.
\end{defn}

We sometimes say ``bounded in $X$'' instead of ``bounded into $X$''.

FOR NEXT YEAR, let's just write ``$a\to z$ in $X$'', not ``$a_\bullet\to z$ in $X$''.
Also, use $s$ instead of $a$; think of $a$ is indicating a sequence of reals,
and $s$ as a more general sequence.

\begin{defn}
Let $X$ be a metric space, $a\in X^\N$ and $z\in X$.\\
By $a_\bullet\to z$ in $X$, we mean: \quad
$\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad
$(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d(a_j,z)<\varepsilon\,\,)$.
\end{defn}

We sometimes omit ``in $X$'' in ``$a_\bullet\to z$ in $X$''.
For any sequence $a$, we sometimes denote $a$ by $(a_1,a_2,a_3,\ldots)$.
Then, for example, the text\\
\phx\qquad
Define $a\in\R^\N$ by $a_j=1/j$\\
might be replaced by\\
\phx\qquad
Let $a:=(1,1/2,1/3,\ldots)$.\\
This is very irksome to the logic purist who does not like ellipses.

\begin{thm}\wrlab{thm-one-over-j-approaches-zero-first-version}
$(1,1/2,1/3,\ldots)_\bullet\to0$ in $\R$.
\end{thm}

The purist would prefer:

\begin{thm}\wrlab{thm-one-over-j-approaches-zero-second-version}
Define $a\in\R^\N$ by $a_j=1/j$.
Then $a_\bullet\to0$ in $\R$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad
$(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d(a_j,0)<\varepsilon\,\,)$.\\
Given $\varepsilon>0$.\quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad
$(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d(a_j,0)<\varepsilon\,\,)$.\\
By the Archimedean Principle (\tref{thm-arch-principle}),\\
\phx\qquad
choose $K\in\N$ s.t.~$K>1/\varepsilon$.\\
Want: $\forall j\in\N$, \quad
$[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d(a_j,0)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \quad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d(a_j,0)<\varepsilon\,\,)$.\\
Assume $j\ge K$. \quad Want: $d(a_j,0)<\varepsilon$.\\
Since $j\ge K>1/\varepsilon$, we get $j>1/\varepsilon$.\\
Since $j>1/\varepsilon>0$, we get $1/j<\varepsilon$.\\
Since $a_j=1/j>0$, we get $|a_j|=a_j$.\\
Then $d(a_j,0)=|a_j-0|=|a_j|=a_j=1/j<\varepsilon$, as desired.
\end{proof}

\begin{defn}
Let $X$ be a metric space and let $a\in X^\N$.\\
Then $a$ is \bfindex[convergent] in $X$ means:\\
\phx\qquad
$\exists z\in X$ s.t.~$a_\bullet\to z$ in $X$.
\end{defn}

Sometimes ``in $X$'' is omitted from ``convergent in $X$''.

From \dref{defn-bdd-in-MS} and \dref{defn-bounded-function-into-MS}, we have:

\begin{thm}
$\forall$metric space $X$, $\forall a\in X^\N$,\\
\phx\qquad
$(a\hbox{ is bounded in }X)\quad\Leftrightarrow\quad(\im[a]\hbox{ is bounded in }X)$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad
$\Leftrightarrow\quad(\exists S\in\scrb_X~\hbox{s.t.}~\im[a]\subseteq S)$.
\end{thm}

A bounded sequence is not necessarily convergent:

\begin{thm}
Define $a\in\R^N$ by $a_j=(-1)^j$.\\
Then: \quad $a=(-1,1,-1,1-1,1-1,1-1,1-1,1,\ldots)$ \qquad and\\
\phx\qquad\quad
$a$ is bounded in $\R$ \qquad and\\
\phx\qquad\quad
$a$ is not convergent in $\R$.
\end{thm}


\begin{thm}\wrlab{thm-lim-means-every-ball-contains-tail}
Let $X$ be a metric space, $a\in X^\N$ and $z\in X$.\\
Assume that $a_\bullet\to z$ in $X$.\\
Then: $\forall B\in\scrb_X(z)$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,a_j\in B\,\,)$.\\
\end{thm}

\begin{proof}
Given $B\in\scrb_X(z)$. \quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,a_j\in B\,\,)$.\\
Since $B\in\scrb_X(z)$, choose $\varepsilon>0$ s.t.~$B=B_X(z,\varepsilon)$.\\
Since $a_\bullet\to z$ in $X$, \quad
choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_X(a_j,z)<\varepsilon\,\,)$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,a_j\in B\,\,)\,\,]$.\\
Given $j\in\N$. \quad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,a_j\in B\,\,)$.\\
Assume $j\ge K$. \quad
Want: $a_j\in B$.\\
Since $j\ge K$, by choice of $K$,\\
\phx\qquad\qquad we have $d_X(a_j,z)<\varepsilon$, and so $a_j\in B_X(z,\varepsilon)$.\\
Then $a_j\in B_X(z,\varepsilon)=B$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-uniqueness-of-limit}
Let $X$ be a metric space, $p,q\in X$ and $s\in X^\N$.\\
Assume: $(\,\,s_\bullet\to p\hbox{ in }X\,\,)\,\,\&\,\,(\,\,s_\bullet\to q\hbox{ in }X\,\,)$. \qquad
Then $p=q$.
\end{thm}

\begin{proof}
Assume that $p\ne q$. \qquad
Want: Contradiction.\\
By \tref{thm-ball-version-of-Hausdorff},
choose $A\in\scrb_X(p)$ and $B\in\scrb_X(q)$ s.t.~$A\cap B=\emptyset$.\\
Since $s_\bullet\to p$ in $X$, by \tref{thm-lim-means-every-ball-contains-tail},
choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,s_j\in A\,\,)$.\\
Since $s_\bullet\to q$ in $X$, by \tref{thm-lim-means-every-ball-contains-tail},
choose $L\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge L\,\,)\,\,\Rightarrow\,\,(\,\,s_j\in B\,\,)$.\\
Let $j:=\max\{K,L\}$. \qquad
Then $j\in\N$.\\
Since $j\ge K$, by choice of $K$, we have $s_j\in A$.\\
Since $j\ge L$, by choice of $L$, we have $s_j\in B$.\\
Then $s_j\in A\cap B$, so $A\cap B\ne\emptyset$.\\
By choice of $A$ and $B$, we have: $A\cap B=\emptyset$.\quad
Contradiction.
\end{proof}

\section{Properties of limits}

\begin{thm}\wrlab{thm-additivity-of-lims}
Let $s,t\in\R^\N$ and let $x,y\in\R$.\\
Assume: $(\,\,s_\bullet\to x\hbox{ in }\R\,\,)\,\,\&\,\,(\,\,t_\bullet\to y\hbox{ in }\R\,\,)$.\\
Then $(s+t)_\bullet\to x+y\hbox{ in }\R$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R((s+t)_j,x+y)<\varepsilon\,\,)$.\\ 
Given $\varepsilon>0$. \quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R((s+t)_j,x+y)<\varepsilon\,\,)$.\\
Since $s_j\to x$ in $\R$, choose $L\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge L\,\,)\quad\Rightarrow\quad(\,\,d_\R(s_j,x)<\varepsilon/2\,\,)$.\\ 
Since $t_j\to y$ in $\R$, choose $M\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge M\,\,)\quad\Rightarrow\quad(\,\,d_\R(t_j,y)<\varepsilon/2\,\,)$.\\ 
Let $K:=\max\{L,M\}$. \quad
Then $K\in\N$ and $K\ge L$ and $K\ge M$.\\
Want: $\forall j\in\N$, \quad $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R((s+t)_j,x+y)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \qquad Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R((s+t)_j,x+y)<\varepsilon\,\,)$.\\
Assume $j\ge K$. \qquad
Want: $d_\R((s+t)_j,x+y)<\varepsilon$.\\
Since $j\ge K\ge L$, by choice of $L$, we have $d_\R(s_j,x)<\varepsilon/2$.\\
Since $j\ge K\ge M$, by choice of $M$, we have $d_\R(t_j,y)<\varepsilon/2$.\\
Then $d_\R((s+t)_j,x+y)\,\,=\,\,d_\R(s_j+t_j,x+y)$\\
\phx\qquad\qquad $=\,\,|\,(\,s_j+t_j\,)\,-\,(\,x+y\,)\,|\,\,=\,\,|\,(\,s_j-x\,)\,+\,(\,t_j-y\,)\,|$\\
\phx\qquad\qquad $\le\,\,|\,s_j-x\,|\,\,+\,\,|\,t_j-y\,|\,\,=\,\,[\,d_\R(s_j,x)\,]\,\,+\,\,[\,d_\R(t_j,y)\,]$\\
\phx\qquad\qquad $<\,\,[\,\varepsilon/2\,]\,\,+\,\,[\,\varepsilon/2)\,]\,\,=\,\,\varepsilon$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-scalar-mult-and-lim-seqs-in-R}
Let $s\in\R^\N$ and let $a,y\in\R$.\\
Assume that $s_\bullet\to x$ in $\R$.
Then $(as)_\bullet\to ax$ in $\R$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R((as)_j,ax)<\varepsilon\,\,)$.\\ 
Given $\varepsilon>0$. \quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R((as)_j,ax)<\varepsilon\,\,)$.\\
Let $b:=|a|+1$. \qquad
Then $b>0$ and $|a|/b<1$.\\
Since $s_j\to x$ in $\R$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R(s_j,x)<\varepsilon/b\,\,)$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R((as)_j,ax)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \qquad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R((as)_j,ax)<\varepsilon\,\,)$.\\
Assume $j\ge K$. \qquad
Want: $d_\R((as)_j,ax)<\varepsilon$.\\
Since $j\ge K$, by choice of $K$, we have $d_\R(s_j,x)<\varepsilon/b$.\\
So, since $|a|\ge0$, we get $|a|\cdot[d_\R(s_j,x)]\le|a|\cdot[\varepsilon/b]$.\\
Since $|a|/b<1$ and $\varepsilon>0$, we get $[|a|/b]\cdot\varepsilon<\varepsilon$.\\
Then $d_\R((as)_j,ax)\,\,=\,\,d_\R(a\cdot s_j,a\cdot x)\,\,=\,\,|\,a\cdot s_j\,-\,a\cdot x\,|$\\
\phx\qquad $=\,\,|\,a\cdot(s_j-x)\,|\,\,=\,\,|a|\cdot|s_j-x|\,\,=\,\,|a|\cdot[d_\R(s_j,x)]$\\
\phx\qquad $\le\,\,|a|\cdot[\varepsilon/b]\,\,=\,\,[|a|/b]\cdot\varepsilon\,\,<\,\,\varepsilon$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-constants-approach-the-constant}
Let $X$ be a metric space and let $z\in X$.\\
Then $C_\N^y\to y$ in $X$.
\end{thm}

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

\begin{thm}\wrlab{thm-subtraction-of-lims}
Let $s,t\in\R^\N$ and let $x,y\in\R$.\\
Assume: $(\,\,s_\bullet\to x\hbox{ in }\R\,\,)\,\,\&\,\,(\,\,t_\bullet\to y\hbox{ in }\R\,\,)$.\\
Then $(s-t)_\bullet\to x-y\hbox{ in }\R$.
\end{thm}

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

\begin{thm}\wrlab{thm-lim-prod-is-prod-lims}
Let $s,t\in\R^\N$ and $x,y\in\R$.\\
Assume that $s_\bullet\to x$ in $\R$ and that $t_\bullet\to y$ in $\R$.\\
Then $(st)_\bullet\to xy$ in $\R$.
\end{thm}

\begin{proof}
Since $s_\bullet$ is convergent in $\R$, by HW\#6-4, $s_\bullet$ is bounded in $\R$.\\
Let $c:=C_\N^y$. \quad
By \tref{thm-constants-approach-the-constant}, $c_\bullet\to y$ in $\R$.\\
So, since $t_\bullet\to y$ in $\R$ and since $y-y=0$, by \tref{thm-subtraction-of-lims},\\
\phx\qquad we see that $(t-c)_\bullet\to0$ in $\R$.\\
So, since $s_\bullet$ is bounded in $\R$, by HW\#6-5,\\
\phx\qquad we see that $(s\cdot(t-c))_\bullet\to0$ in $\R$.\\
So, since $s\cdot(t-c)=st-sc$,
we get $(st-sc)_\bullet\to0$ in $\R$.\\
Since $s_\bullet\to x$ in $\R$,
by \tref{thm-scalar-mult-and-lim-seqs-in-R}, we get $ys\to yx$ in $\R$.\\
So, since $ys=cs=sc$ and since $yx=xy$, we get $sc\to xy$ in $\R$.\\
So, since $(st-sc)_\bullet\to0$ in $\R$, by \tref{thm-additivity-of-lims},\\
\phx\qquad we see that $(sc+st-sc)_\bullet\to xy+0$ in $\R$.\\
So, since $sc+st-sc=st$ and since $xy+0=xy$,\\
\phx\qquad we see that $(st)_\bullet\to xy$ in $\R$, as desired.
\end{proof}

Recall (\tref{thm-absval-dist-semidecr}): $|\bullet|$ is distance semi-decreasing.\\
That is, $\forall x,y\in\R$, we have: \quad $d(|x|,|y|)\le d(x,y)$.

\begin{thm}\wrlab{thm-recip-lim-is-lim-recip}
Let $b\in(\R_0^\times)^\N$ and $z\in\R_0^\times$.\\
Assume that $b_\bullet\to z$ in $\R$.\\
Then $(1/b)_\bullet\to1/z$ in $\R$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R((1/b)_j,1/z)<\varepsilon\,\,)$.\\ 
Given $\varepsilon>0$. \quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R((1/b)_j,1/z)<\varepsilon\,\,)$.\\
Let $\eta\,\,:=\,\,\min\,\{\,|z|/2\,,\,\varepsilon z^2/2\,\}$.\\
Then $\eta\le|z|/2$ and $\eta<\varepsilon z^2/2$.\\
Since $z\in\R_0^\times$, we get $|z|>0$ and $z^2>0$.\\
So, since $\varepsilon>0$, we get $\eta>0$.\\
So, since $b_j\to z$ in $\R$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_\R(b_j,z)<\eta\,\,)$.\\
Want: $\forall j\in\N$,
$[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R((1/b)_j,1/z)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \qquad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R((1/b)_j,1/z)<\varepsilon\,\,)$.\\
Assume $j\ge K$. \qquad
Want: $d_\R((1/b)_j,1/z)<\varepsilon$.\\
Since $j\ge K$, it follows, from the choice of $K$, that $d_\R(b_j,z)<\eta$.\\
Then $|z-b_j|=d_\R(z,b_j)=d_\R(b_j,z)<\eta$.\\
By \tref{thm-absval-dist-semidecr}, $d_\R(|b_j|,|z|)\le d_\R(b_j,z)$.\\
Since $d_\R(|b_j|,|z|)\le d_\R(b_j,z)<\eta$,
we get $|z|-\eta\le|b_j|\le|z|+\eta$.\\
Since $\eta\le|z|/2$, we get $|z|-\eta\ge|z|-(|z|/2)=|z|/2$.\\
Then $|b_j|>|z|-\eta\ge|z|-(|z|/2)=|z|/2$.\\
So, since $|z-b_j|<\eta$,
we get: $\ds{\frac{|z-b_j|}{|b_j|\cdot|z|}<\frac{\eta}{(|z|/2)\cdot|z|}.}$\\
Then
$\ds{d_\R((1/b)_j,1/z)=d_\R\left(\frac{1}{b_j},\frac{1}{z}\right)=\left|\frac{1}{b_j}-\frac{1}{z}\right|=\left|\frac{z-b_j}{b_jz}\right|}$\\
\phx\qquad\quad
$\ds{=\frac{|z-b_j|}{|b_j|\cdot|z|}<\frac{\eta}{(|z|/2)\cdot|z|}=\frac{2\cdot\eta}{|z|^2}=\frac{2\cdot\eta}{z^2}\le\frac{2\cdot(\varepsilon z^2/2))}{z^2}=\varepsilon.}$
\end{proof}

\begin{thm}
Let $a\in\R^\N$, $y\in\R$, $b\in(\R_0^\times)T\N$, $z\in\R_0^\times$.
Assume that $a_\bullet\to y$ in $\R$ and that $b_\bullet\to z$ in $\R$.
Then $(a/b)_\bullet\to y/z$ in $\R$.
\end{thm}

\begin{proof}
By \tref{thm-recip-lim-is-lim-recip}, $(1/b)_\bullet\to1/z$ in $\R$.\\
So, since $a_\bullet\to y$ in $\R$, by \tref{thm-lim-prod-is-prod-lims},
$((1/b)\cdot a)_\bullet\to(1/z)\cdot y$ in $\R$.\\
So, since $(1/z)\cdot y=y/z$, we get:
$((1/b)\cdot a)_\bullet\to y/z$ in $\R$.\\
It therefore suffices to show: $a/b=(1/b)\cdot a$.\\
Want: $\forall j\in\N$, $(a/b)_j=((1/b)\cdot a)_j$.\\
Given $j\in\N$. \quad
Want: $(a/b)_j=((1/b)\cdot a)_j$.\\
We have
$(a/b)_j=a_j/b_j=(1/b_j)\cdot a_j=((1/b)\cdot a)_j$,
as desired.
\end{proof}

\section{Diamond and square norms}

\begin{defn}
$\forall k\in\N$, $\forall v\in\R^k$, we define:\\
\phx\qquad $|v|_k^D:=|v_1|+\cdots+|v_k|$ \qquad and\\
\phx\qquad $|v|_k^S:=\max\{|v_1|,\ldots,|v_k|\}$.
\end{defn}

Let $k\in\N$.
We leave it as an unassigned exercise to show that $|\bullet|_k^D$
separates $0_k$, is symmetric and satisfies the triangle inequality.
Thus $|\bullet|_k^D$ is a norm, called the \bfindex[diamond norm] in $\R^k$.
Since $|\bullet|_k^D$ is a norm, its unit level set\\
\phx\qquad\qquad\qquad\qquad $\{v\in\R^k~\hbox{s.t.}~|v|_k^D=1\}$\\
is called its ``unit sphere'' and is denoted $\{|\bullet|_k^D=1\}$.
Since $|\bullet|_k^D$ is a norm, its open unit sublevel set\\
\phx\qquad\qquad\qquad\qquad $\{v\in\R^k~\hbox{s.t.}~|v|_k^D<1\}$\\
is called its ``unit ball'' and is denoted $\{|\bullet|_k^D<1\}$.

We graphed $\{|\bullet|_2^D=1\}$, and observed that it is a diamond.

Let $k\in\N$.
We leave it as an unassigned exercise to show that $|\bullet|_k^S$
separates $0_k$, is symmetric and satisfies the triangle inequality.
Thus $|\bullet|_k^S$ is a norm, called the \bfindex[square norm] in $\R^k$.
Since $|\bullet|_k^S$ is a norm, its unit level set\\
\phx\qquad\qquad\qquad\qquad $\{v\in\R^k~\hbox{s.t.}~|v|_k^S=1\}$\\
is called its ``unit sphere'' and is denoted $\{|\bullet|_k^S=1\}$.
Since $|\bullet|_k^S$ is a norm, its open unit sublevel set\\
\phx\qquad\qquad\qquad\qquad $\{v\in\R^kk~\hbox{s.t.}~|v|_k^S<1\}$\\
is called its ``unit ball'' and is denoted $\{|\bullet|_k^S<1\}$.

We graphed $\{|\bullet|_2^S=1\}$, and observed that it is a square.

We explained how to reccover any absolutely homgeneous function from its unit level set.
The graph of that unit level set contains, in~geometric form, all of the information of the function,
and it is a skill to~look at that graph, and, from it, to ``see'' properties of the function.
For example, for any absolutely homogeneous function,
that function is a norm iff\\
\phx\qquad its unit level set is symmetric through the origin, \qquad and\\
\phx\qquad its unit sublevel set is convex.

Let $k\in\N$.
Every positive multiple of a norm is a norm.
So, for example $2\cdot|\bullet|_k^S$ is a norm.
We observed that\\
\phx\quad $\{2\cdot|\bullet|_k^S<1\}\,\,\subseteq\,\,\{|\bullet|_k^D<1\}\,\,\subseteq\,\,\{|\bullet|_k<1\}\,\,\subseteq\,\,\{|\bullet|_k^S<1\}$.\\
According to the ``\bfindex[Compensation Principle]'',
big norms have small balls and small norms have big balls.
Thus, we expect that:\\
\phx\quad $\forall v\in\R^k$, $2\cdot|v|_k^S\,\,\ge\,\,\cdot|v|_k^D\,\,\ge\,\,\cdot|v|_k\,\,\ge\,\,\cdot|v|_k^S$,\\
and we will leave it as homework to verify these inequalities via symbolic proofs.
(See HW\#7-1, HW\#7-2 and HW\#7-3.)

\section{Pairing together functions}

\begin{defn}\wrlab{defn-pair-fns}
$\forall$functions $f,g$, by $(f,g)_{\rm fn}$, we mean the function defined by: \qquad
$\forall x$, $(f,g)_{\rm fn}(x)=(f(x),g(x))$.
\end{defn}

Keep in mind that, in \dref{defn-pair-fns}, $(f,g)$ would refer to an ordered pair,
and $\ds{(f,g)=\left(\begin{array}{c}1\mapsto f\\2\mapsto g\end{array}\right)}$.
Unfortunately, the subscript ``fn'' is almost always omitted from the notation
``$(f,g)_{\rm fn}$'', and so ``$(f,g)$'' might mean $(f,g)_{\rm fn}$ or it might mean
$\ds{\left(\begin{array}{c}1\mapsto f\\2\mapsto g\end{array}\right)}$.
It is up to the reader to figure out, from context, which is meant.

\begin{thm}\wrlab{thm-eg1-pairing}
Let $f,g:\R\drta\R$ be defined by $f(x)=\sqrt{x}$ and $g(x)=\sqrt{1-x}$.
Then\\
\phx\qquad $(f,g):\R\drta\R^2$,\\
\phx\qquad $\forall x\in\R$, $(f,g)(x)=(\sqrt{x},\sqrt{1-x})$ \qquad and\\
\phx\qquad $\dom[(f,g)]=[0;\infty)\cap(-\infty;1]=(\dom[f])\cap(\dom[g])$.
\end{thm}

The domain of the pairing is always the intersection of the domains, for any two functions,
not just for the particular two functions $f$ and~$g$ that were specified in \tref{thm-eg1-pairing}:

\begin{thm}\wrlab{thm-dom-of-pairing-is-cap-of-doms}
$\forall$functions $f$ and $g$, we have:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\dom[(f,g)]=(\dom[f])\cap(\dom[g])$.
\end{thm}

Since a sequence is just a function with domain $\N$, we see, from \tref{thm-dom-of-pairing-is-cap-of-doms},
that a pairing of two sequences is again a sequence:

\begin{thm}\wrlab{thm-pairing-seq-is-seq}
$\forall$sequences $a$ and $b$, $(a,b)$ is a sequence.
\end{thm}

Moreover, any evaulation of a paired sequence is done
by evaluating the first and second parts of the pair:

\begin{thm}\wrlab{thm-value-of-paired-seq}
$\forall$sequences $a$ and $b$, $\forall j\in\N$, $(a,b)_j=(a_j,b_j)$.
\end{thm}

Targets of paired functions also behave predictably:

\begin{thm}\wrlab{thm-target-of-paired-fn}
$\forall$sets $S$ and $T$, $\forall$functions $f$ and $g$,\\
\phx\qquad $[\,\,(\,\im[f]\subseteq S\,)\,\,\&\,\,(\,\im[g]\subseteq T\,)\,\,]\,\,\Rightarrow\,\,[\,\,\im[(f,g)]\subseteq S\times T\,\,]$.
\end{thm}

Targets of paired sequences also behave predictably:

\begin{thm}\wrlab{thm-target-of-paired-seq}
$\forall$sets $S$ and $T$, $\forall a\in S^\N$, $\forall b\in T^\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\quad\qquad\qquad $(a,b)\,\,\in\,\,(S\times T)^\N$.
\end{thm}

Projection to the $x$-axis is distance semi-decreasing:

\begin{thm}\wrlab{thm-proj1-dist-semidecr}
$\forall v,w\in\R^2$, $d_\R(v_1,w_1)\le d_2(v,w)$.
\end{thm}

\begin{proof}
Given $v,w\in\R^2$. \quad
Want: $d_\R(v_1,w_1)\le d_2(v,w)$.\\
Let $x:=v-w$. \quad
Then $|x|_2=d_2(v,w)$.\\
Want: $d_\R(v_1,w_1)\le|x|_2$.\\
Since $x_1=v_1-w_1$, we get $|x_1|=d_\R(v_1,w_1)$.\\
Want: $|x_1|\le|x|_2$.\\
Since $0\le x_1^2$ and $0\le x_2^2$, we get $0\le x_1^2\le x_1^2+x_2^2$.\\
It follows that $\sqrt{x_1^2}\le\sqrt{x_1^2+x_2^2}$.\\
Then $|x_1|=\sqrt{x_1^2}\le\sqrt{x_1^2+x_2^2}=|x|_2$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-each-converges-implies-pair-converges}
Let $a,b\in\R^\N$ and let $p,q\in\R$.\\
Assume that $a_\bullet\to p$ in $\R$ and that $b_\bullet\to q$ in $\R$.\\
Then $(a,b)_\bullet\to(p,q)$ in $\R^2$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_2((a,b)_j,(p,q))<\varepsilon\,\,)$.\\
Given $\varepsilon>0$. \quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_2((a,b)_j,(p,q))<\varepsilon\,\,)$.\\
Let $\eta:=\varepsilon/2$.\\
Then $\eta>0$ and $2\eta=\varepsilon$.\\
Since $a_\bullet\to p$ in $\R$, choose $L\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge L\,\,)\quad\Rightarrow\quad(\,\,d_\R(a_j,p)<\eta\,\,)$.\\
Since $b_\bullet\to q$ in $\R$, choose $M\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge M\,\,)\quad\Rightarrow\quad(\,\,d_\R(b_j,q)<\eta\,\,)$.\\
Let $K:=\max\{L,M\}$. \quad
Then $K\ge L$ and $K\ge M$ and $K\in\N$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_2((a,b)_j,(p,q))<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \quad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_2((a,b)_j,(p,q))<\varepsilon\,\,)$.\\
Assume $j\ge K$. \quad
Want: $d_2((a,b)_j,(p,q))<\varepsilon$.\\
Since $j\ge K\ge L$, by choice of $L$, we have: $d_\R(a_j,p)<\eta$.\\
Since $j\ge K\ge M$, by choice of $M$, we have: $d_\R(b_j,q)<\eta$.\\
Let $v:=(a_j-p,b_j-q)$.\\
Then $v=(a_j,b_j)-(p,q)$ and $|v|_2^D=|a_j-p|+|b_j-q|$.\\
By HW 7-1, we have: $|v|_2^D\,\ge\,|v|_2$.\\
Then $d_2((a,b)_j,(p,q))=d_2((a_j,b_j),(p,q))=|(a_j,b_j)-(p,q)|_2$\\
\phx\qquad\qquad $=|v|_2\le|v|_2^D=|a_j-p|+|b_j-q|$\\
\phx\qquad\qquad $=[d_\R(a_j,p)]+[d_\R(b_j,q)]<\eta+\eta=2\eta=\varepsilon$, as desired.
\end{proof}

\section{Product metrics and relative metrics}

\begin{defn}\wrlab{defn-prod-metric}
Let $X$ and $Y$ be metric spaces.\\
Define $d\in\scrm(X\times Y)$ by\\
\phx\qquad\qquad $d(v,w)=\sqrt{[d_X(v_1,w_1)]^2+[d_Y(v_2,w_2)]^2}$.\\
Then $d$ is called the \bfindex[product metric] on $X\times Y$ from $X$ and $Y$.
\end{defn}

We leave it as an unassigned exercise to show that the function\\
\phx\qquad\qquad\qquad $d:(X\times Y)\times(X\times Y)\to[0;\infty)$\\
of \dref{defn-prod-metric} is, in fact, a metric on $X\times Y$.

In \dref{defn-prod-metric},
the phrase ``from $X$ and $Y$'' is often omitted.
For any metric spaces $X$ and $Y$, the standard metric on $X\times Y$ is the product metric.

We can generalize \dref{defn-prod-metric} to products
$X\times Y\times Z$ of three metric spaces $X$ and $Y$ and $Z$.
Or to four, or to five, {\it etc.}

\begin{thm}\wrlab{thm-pair-approaches-pair-iff-coords-approach-coords}
Let $X$ and $Y$ be metric spaces.\\
Let $a\in X^\N$, $p\in X$, $b\in Y^\N$ and $q\in Y$.\\
Then: \qquad\qquad $(\,\,[\,\,(a,b)_\bullet\to (p,q)\hbox{ in }X\times Y\,\,]\,\,\Leftrightarrow$\\
\phx\qquad\qquad\qquad\qquad $[\,\,(\,a_\bullet\to p\hbox{ in }X\,)\,\,\&\,\,(\,b_\bullet\to q\hbox{ in }Y\,)\,\,]\,\,)$.
\end{thm}

\begin{defn}\wrlab{defn-rel-metric}
Let $X$ be a metric space and let $S\subseteq X$.\\
Then $d_X|(S\times S)$ is called the \bfindex[relative metric] on $S$
inherited from $X$.
\end{defn}

We leave it as an unassigned exercise to show that the function\\
\phx\qquad\qquad\qquad $d|(S\times S):S\times S\to[0;\infty)$\\
of \dref{defn-rel-metric} is, in fact, a metric on $S$.

In \dref{defn-rel-metric},
the phrase ``inherited from $X$'' is often omitted.
For any metric space $X$, for any $S\subseteq X$, the standard metric on $S$ is the relative metric.

\begin{thm}
Let $C:=\{v\in\R^2\,|\,v_1^2+v_2^2=1\}$\\
\phx\qquad\qquad\qquad\qquad be the unit circle about the origin in $\R^2$.\\
Let $d$ be the product metric on $\R\times\R$ from $(\R,d_\R)$ and $(\R,d_\R)$.\\
Let $\delta$ be the relative metric on $C$ inherited from $(\R\times\R,d)$.\\
Let $v:=(1,0)$ and $w:=(0,1)$.\\
Then \quad $d=d_2$ \quad and \quad $\delta(v,w)=\sqrt{2}$.
\end{thm}

\section{Continuity}

\begin{defn}\wrlab{defn-continuity-at}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\to Y$ and $p\in X$.\\
By $f$ is \bfindex[continuous at $p$] from $X$ to $Y$, we mean:\\
\phx\quad $\forall a\in X^\N$, $(\,\,a_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,(f\circ a)_\bullet\to f(p)\hbox{ in }Y\,\,)$.\\
\end{defn}

\begin{defn}\wrlab{defn-continuity-on}
Let $X$ and $Y$ be metric spaces, $f:X\to Y$.\\
By $f$ is \bfindex[continuous] from $X$ to $Y$, we mean:\\
\phx\quad $\forall p\in X$, $f$ is continuous at $p$ from $X$ to $Y$.\\
Also, $\forall S\subseteq X$, by $f$ is \bfindex[continuous on $S$] from $X$ to $Y$, we mean:\\
\phx\quad $\forall p\in S$, $f$ is continuous at $p$ from $X$ to $Y$.\\
\end{defn}

In \dref{defn-continuity-at} and in \dref{defn-continuity-on},
sometimes, the text ``from $X$ to $Y$'' is omitted, provide the domain and target of $f$ are clear.

\begin{defn}
Let $\phi$ be a functional and let $k\in\N$.\\
Define $f:\R\to\R$ by $f(x)=x^k$.\\
Then $\phi^k:=f\circ\phi$.
\end{defn}

\begin{thm}
$\forall$functional $\phi$,\\
\phx\quad $\phi^0=C_{\dom[\phi]}^1$ and $\phi^1=\phi$ and $\phi^2=\phi\cdot\phi$ and $\phi^3=\phi\cdot\phi\cdot\phi$.
\end{thm}

\begin{thm}
$\forall a\in\R^\N$,\\
\phx\quad $a^0=C_\N^1$ and $a^1=a$ and $a^2=a\cdot a$ and $a^3=a\cdot a\cdot !a$.
\end{thm}

\begin{thm}
Let $f:\R\to\R$ be defined by $f(x)=x^2$.\\
Then $f$ is continuous from $\R$ to $\R$.
\end{thm}

\begin{proof}
Want: $\forall x\in\R$, $f$ is continuous at $x$ from $\R$ to $\R$.\\
Given $x\in\R$. \quad
Want: $f$ is continuous at $x$ from $\R$ to $\R$.\\
Want: $\forall a\in\R^\N$,
$[\,\,(\,\,a_\bullet\to x\hbox{ in }\R\,\,)\,\,\Rightarrow(\,\,(f\circ a)_\bullet\to f(x)\hbox{ in }\R\,\,)\,\,]$.\\
Given $a\in\R^\N$. \quad
Want: $(\,\,a_\bullet\to x\hbox{ in }\R\,\,)\,\,\Rightarrow(\,\,(f\circ a)_\bullet\to f(x)\hbox{ in }\R\,\,)$.\\
Assume that $a_\bullet\to x$ in $\R$. \qquad
Want: $(f\circ a)_\bullet\to f(x)$ in $\R$.\\
Since $a_\bullet\to X$ in $\R$ and since $a_\bullet\to x$ in $\R$,\\
\phx\quad by \tref{thm-lim-prod-is-prod-lims}, we get $(a\cdot a)_\bullet\to x\cdot x$ in $\R$.\\
So, since $a\cdot a=a^2=f\circ a$ and since $x\cdot x=x^2=f(x)$,\\
\phx\quad we get $(f\circ a)_\bullet\to f(x)$ in $\R$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-addn-is-contin}
Let $A:\R^2\to\R$ be defined by $A(x,y)=x+y$.\\
Then $A$ is continuous from $\R^2$ to $\R$.
\end{thm}

\begin{proof}
Want: $\forall z\in\R^2$, $A$ is continuous at $z$ from $\R^2$ to $\R$.\\
Given $z\in\R^2$. \quad
Want: $A$ is continuous at $z$ from $\R^2$ to $\R$.\\
Want: $\forall v\in(\R^2)^\N$,
$[\,\,(\,\,v_\bullet\to z\hbox{ in }\R^2\,\,)\,\,\Rightarrow\,\,(\,\,(A\circ v)_\bullet\to A(z)\hbox{ in }\R\,\,)\,\,]$.
Given $v\in(\R^2)^\N$. \quad
Want: $(\,\,v_\bullet\to z\hbox{ in }\R^2\,\,)\,\,\Rightarrow\,\,(\,\,(A\circ v)_\bullet\to A(z)\hbox{ in }\R\,\,)$.\\
Assume that $v_\bullet\to z$ in $\R^2$. \quad
Want: $(A\circ v)_\bullet\to A(z)$ in $\R$.\\
Let $x:=z_1$ and $y:=z_2$. \quad
Then $z=(z_1,z_2)=(x,y)$.\\
Define $s,t\in\R^\N$ by $s_j=(v_j)_1$ and $t_j=(v_j)_2$.\\
Then, $\forall j\in\N$, $v_j=((v_j)_1,(v_j)_2)=(s_j,t_j)=(s,t)_j$.\\
Then $v=(s,t)$.\\
Since $v_\bullet\to z$ in $\R^2$, since $v=(s,t)$ and since $z=(x,y)$,\\
\phx\qquad we see that $(s,t)_\bullet\to(x,y)$ in $\R^2$.\\
Then, by \tref{thm-pair-approaches-pair-iff-coords-approach-coords},\\
\phx\qquad we see that $s_\bullet\to x$ in $\R$ and $t_\bullet\to y$ in $\R$.
Then, by \tref{thm-additivity-of-lims}, we see that $(s+t)_\bullet\to x+y$ in $\R$.\\
So, since $A(x,y)=x+y$, we see that $(s+t)_\bullet\to A(x,y)$ in $\R$.\\
Recall that we want: $(A\circ v)_\bullet\to A(z)$ in $\R$.\\
It therefore suffices to show that $A\circ v=s+t$.\\
Want: $\forall j\in\N$, $(A\circ v)_j=(s+t)_j$.\\
Given $j\in\N$. \quad
Want: $(A\circ v)_j=(s+t)_j$.\\
We have $(A\circ v)_j=A(v_j)=A(s_j,t_j)=s_j+t_j=(s+t)_j$, as desired.
\end{proof}

The next two theorems are proved similarly.

\begin{thm}\wrlab{thm-subtr-is-contin}
Let $S:\R^2\to\R$ be defined by $S(x,y)=x-y$.\\
Then $S$ is continuous from $\R^2$ to $\R$.
\end{thm}

\begin{thm}\wrlab{thm-mult-is-contin}
Let $M:\R^2\to\R$ be defined by $M(x,y)=xy$.\\
Then $M$ is continuous from $\R^2$ to $\R$.
\end{thm}

In \tref{thm-division-is-continuous}, below,
the metric on $\R\times\R_0^\times$ is the
relative metric inherited from $(\R^2,d_2)$.
In \tref{thm-division-is-continuous}, below,
the metric on $\R$ is the standard metric $d_\R$.

\begin{thm}\wrlab{thm-division-is-continuous}
Let $D:\R\times\R_0^\times\to\R$ be defined by $D(x,y)=x/y$.\\
Then $D$ is continuous from $\R\times\R_0^\times$ to $\R$.
\end{thm}

\begin{thm}\wrlab{thm-approaches-in-subsp-implies-approaches-in-ambient}
Let $X$ be a metric space.\\
Let $S\subseteq X$, $a\in S^\N$ and $p\in S$.\\
Assume that $a_\bullet\to p$ in $S$. \quad
Then $a_\bullet\to p$ in $X$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_X(a_j,p)<\varepsilon\,\,)$.\\
Given $\varepsilon>0$. \quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_X(a_j,p)<\varepsilon\,\,)$.\\
Since $a_\bullet\to p$ in $S$, choose $K\in\N$ s.t.,, $\forall j\in\N$,\\
\phx\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_S(a_j,p)<\varepsilon\,\,)$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(a_j,p)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \quad
Want: $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(a_j,p)<\varepsilon\,\,)\,\,]$.\\
Assume $j\ge K$. \quad
Want: $d_X(a_j,p)<\varepsilon$.\\
Since $j\ge K$, by choice of $K$, we get $d_S(a_j,p)<\varepsilon$.\\
Since $a_j,p\in S\subseteq X$, we have $d_S(a_j,p)=d_X(a_j,p)$.\\
Then $d_X(a_j,p)=d_S(a_j,p)<\varepsilon$, as desired.
\end{proof}

The converse of \tref{thm-approaches-in-subsp-implies-approaches-in-ambient} holds, with similar proof:

\begin{thm}\wrlab{thm-approaches-in-ambient-implies-approaches-in-subsp}
Let $X$ be a metric space.\\
Let $S\subseteq X$, $a\in S^\N$ and $p\in S$.\\
Assume that $a_\bullet\to p$ in $X$. \quad
Then $a_\bullet\to p$ in $S$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_S(a_j,p)<\varepsilon\,\,)$.\\
Given $\varepsilon>0$. \quad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_S(a_j,p)<\varepsilon\,\,)$.\\
Since $a_\bullet\to p$ in $X$, choose $K\in\N$ s.t.,, $\forall j\in\N$,\\
\phx\qquad $(\,\,j\ge K\,\,)\quad\Rightarrow\quad(\,\,d_X(a_j,p)<\varepsilon\,\,)$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_S(a_j,p)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \quad
Want: $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(a_j,p)<\varepsilon\,\,)\,\,]$.\\
Assume $j\ge K$. \quad
Want: $d_X(a_j,p)<\varepsilon$.\\
Since $j\ge K$, by choice of $K$, we get $d_S(a_j,p)<\varepsilon$.\\
Since $a_j,p\in S\subseteq X$, we have $d_S(a_j,p)=d_X(a_j,p)$.\\
Then $d_S(a_j,p)=d_X(a_j,p)<\varepsilon$, as desired.
\end{proof}

The buzz phrase for \tref{thm-restr-maintains-continuity}, below,
is ``restriction maintains continuity''.
In \tref{thm-restr-maintains-continuity}, below,
the metric on $S$ is the relative metric, inherited from $X$.

\begin{thm}\wrlab{thm-restr-maintains-continuity}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\to Y$, $S\subseteq X$ and $p\in S$.\\
Assume that $f$ is continuous at $p$ from $X$ to $Y$.\\
Then $f|S$ is continuous at $p$ from $S$ to $Y$.
\end{thm}

\begin{proof}
Want: $\forall a\in S^\N$,\\
\phx\qquad $(\,\,a_\bullet\to p\hbox{ in }S\,\,)\quad\Rightarrow\quad(\,\,((f|S)\circ a)_\bullet\to(f|S)(p)\hbox{ in }Y\,\,)$.\\
Given $a\in S^\N$.\\
Want: $(\,\,a_\bullet\to p\hbox{ in }S\,\,)\,\,\Rightarrow\,\,(\,\,((f|S)\circ a)_\bullet\to(f|S)(p)\hbox{ in }Y\,\,)$.\\
Assume $a_\bullet\to p\hbox{ in }S$. \quad
Want: $((f|S)\circ a)_\bullet\to(f|S)(p)\hbox{ in }Y$.\\
Since $a_\bullet\to p$ in $S$,
it follows, by \tref{thm-approaches-in-subsp-implies-approaches-in-ambient},\\
\phx\qquad that $a_\bullet\to p$ in $X$.\\
Then, by continuity of $f$ at $p$ from $X$ to $Y$,\\
\phx\qquad we see that $(f\circ a)_\bullet\to f(p)$ in $Y$.\\
Since $p\in S$, we have $(f|S)(p)=f(p)$.\\
Then $(f\circ a)_\bullet\to(f|S)(p)$ in $Y$.\\
Recall that we want: $((f|S)\circ a)_\bullet\to(f|S)(p)\hbox{ in }Y$.\\
It therefore suffices to show that $f\circ a=(f|S)\circ a$.\\
Want: $\forall j\in\N$, $(f\circ a)_j=((f|S)\circ a)_j$.\\
Given $j\in\N$. \quad
Want: $(f\circ a)_j=((f|S)\circ a)_j$.\\
Since $a\in S^\N$, we get $a_j\in S$, and so $(f|S)(a_j)=f(a_j)$.\\
Then $(f\circ a)_j=f(a_j)=(f|S)(a_j)=((f|S)\circ a)_j$, as desired.
\end{proof}

The buzz phrase for \tref{thm-dectarg-maintains-continuity}, below,
is ``decrease of target maintains continuity''.
The buzz phrase for \tref{thm-incrtarg-maintains-continuity}, below,
is ``increase of target maintains continuity''.
In both \tref{thm-dectarg-maintains-continuity} and \tref{thm-incrtarg-maintains-continuity}, below,
the metric on $Y_0$ is the relative metric, inherited from $Y$.

\begin{thm}\wrlab{thm-dectarg-maintains-continuity}
Let $X$ and $Y$ be metric spaces.\\
Let $p\in X$, $Y_0\subseteq Y$ and $\phi:X\to Y_0$.\\
Assume that $\phi$ is continuous at $p$ from $X$ to $Y$.\\
Then $\phi$ is continuous at $p$ from $X$ to $Y_0$.
\end{thm}

\begin{proof}
We have both $\phi:X\to Y_0$ and $\phi:X\to Y$.\\
Want: $\forall a\in X^\N$, \quad
$[\,\,(\,\,a_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,(\phi\circ a)_\bullet\to\phi(p)\hbox{ in }Y_0\,\,)\,\,]$.\\
Given $a\in X^\N$. \quad
Want: $(\,\,a_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,(\phi\circ a)_\bullet\to\phi(p)\hbox{ in }Y_0\,\,)$.\\
Assume $a_\bullet\to p\hbox{ in }X$. \quad
Want: $(\phi\circ a)_\bullet\to\phi(p)\hbox{ in }Y_0$.\\
Since $a_\bullet\to p\hbox{ in }X$,
by continuity of $\phi$ at $p$ from $X$ to $Y$,\\
\phx\qquad we see that $(\phi\circ a)_\bullet\to\phi(p)$ in $Y$.\\
Since $a\in X^\N$ and $\phi:X\to Y_0$, it follows that $\phi\circ a\in Y_0^\N$.\\
Since $p\in X$ and $\phi:X\to Y_0$, it follows that $\phi(p)\in Y_0$.\\
Then, by \tref{thm-approaches-in-ambient-implies-approaches-in-subsp}
(with $b$ replaced by $\phi\circ a$, and $q$ by $\phi(p)$),\\
\phx\qquad we see that $(\phi\circ a)_\bullet\to\phi(p)$ in $Y_0$, as desired.
\end{proof}

The converse of \tref{thm-dectarg-maintains-continuity} holds, with similar proof:

\begin{thm}\wrlab{thm-incrtarg-maintains-continuity}
Let $X$ and $Y$ be metric spaces.\\
Let $p\in X$, $Y_0\subseteq Y$ and $\phi:X\to Y_0$.\\
Assume that $\phi$ is continuous at $p$ from $X$ to $Y_0$.\\
Then $\phi$ is continuous at $p$ from $X$ to $Y$.
\end{thm}

\begin{proof}
We have both $\phi:X\to Y_0$ and $\phi:X\to Y$.\\
Want: $\forall a\in X^\N$, \quad
$[\,\,(\,\,a_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,(\phi\circ a)_\bullet\to\phi(p)\hbox{ in }Y\,\,)\,\,]$.\\
Given $a\in X^\N$. \quad
Want: $(\,\,a_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,(\phi\circ a)_\bullet\to\phi(p)\hbox{ in }Y\,\,)$.\\
Assume $a_\bullet\to p\hbox{ in }X$. \quad
Want: $(\phi\circ a)_\bullet\to\phi(p)\hbox{ in }Y$.\\
Since $a_\bullet\to p\hbox{ in }X$,
by continuity of $\phi$ at $p$ from $X$ to $Y_0$,\\
\phx\qquad we see that $(\phi\circ a)_\bullet\to\phi(p)$ in $Y_0$.\\
Since $a\in X^\N$ and $\phi:X\to Y_0$, it follows that $\phi\circ a\in Y_0^\N$.\\
Since $p\in X$ and $\phi:X\to Y_0$, it follows that $\phi(p)\in Y_0$.\\
Then, by \tref{thm-approaches-in-subsp-implies-approaches-in-ambient}
(with $b$ replaced by $\phi\circ a$, and $q$ by $\phi(p)$),\\
\phx\qquad we see that $(\phi\circ a)_\bullet\to\phi(p)$ in $Y$, as desired.
\end{proof}

The next theorem, \tref{thm-transitivity-of-inherited-metrics} below, is \bfindex[transitivity of inherited metrics]; it follows from HW 8-2.

\begin{thm}\wrlab{thm-transitivity-of-inherited-metrics}
Let $X$ be a metric space, let $T\subseteq X$ and let $S\subseteq T$.\\
Then $(d_X|(T\times T))|(S\times S)=d_X|(S\times S)$
\end{thm}

In \tref{thm-p-in-S-then-fofp-in-fofS} below,
the point is that, to prove that $f(p)\in f_*(S)$,
it is not sufficient that $p\in S$; one also needs $p\in\dom[f]$.
Otherwise, we get: $f(p)\frownie\notin f_*(S)$.

\begin{thm}\wrlab{thm-p-in-S-then-fofp-in-fofS}
$\forall$function $f$, $\forall$set $S$, $\forall p$,\\
\phx\qquad\qquad\qquad $[\,\,(\,p\in S\,)\,\,\&\,\,(\,\,p\in\dom[f]\,\,]\,\,\Rightarrow\,\,[\,\,f(p)\in f_*(S)\,\,]$.
\end{thm}

\begin{thm}\wrlab{thm-composition-dom-and-im}
Let $S$, $T$, $U$ and $V$ be sets,
let $a:S\to T$ and let $f:U\to V$.\\
Assume that $T\subseteq U$. \quad
Then $f\circ a:S\to f_*(T)$.
\end{thm}

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

\begin{thm}\wrlab{thm-preimage-in-dom-fwdim-in-im}
$\forall$functions $f$ and $g$, $\forall$set $S$, we have:\\
\begin{itemize}
\item[(1)]$f^*(S)\subseteq\dom[f]$ \qquad and
\item[(2)]$f_*(S)\in\im[f]$.
\end{itemize}
\end{thm}

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

\begin{thm}\wrlab{thm-comp-contin-fns-is-contin}
Let $X$, $Y$ and $Z$ be metric spaces.\\
Let $f:X\drta Y$, $g:Y\drta Z$ and $p\in X$.\\
Assume that $f$ is continuous at $p$ from $\dom[f]$ to $Y$.\\
Assume that $g$ is continuous at $f(p)$ from $\dom[g]$ to $Z$.\\
Then $g\circ f$ is continuous at $p$ from $\dom[g\circ f]$ to $Z$.\\
\end{thm}

\begin{proof}
Want: $\forall a\in(\dom[g\circ f])^\N$,\\
\phx\qquad$(\,\,a_\bullet\to p\hbox{ in }\dom[g\circ f]\,\,)\,\,\Rightarrow\,\,(\,\,((g\circ f)\circ a)_\bullet\to(g\circ f)(p)\hbox{ in }Z\,\,)$.\\
Given $a\in(\dom[g\circ f])^\N$.\\
Want: $(\,\,a_\bullet\to p\hbox{ in }\dom[g\circ f]\,\,)\,\,\Rightarrow\,\,(\,\,((g\circ f)\circ a)_\bullet\to(g\circ f)(p)\hbox{ in }Z\,\,)$.\\
Assume that $a_\bullet\to p$ in $\dom[g\circ f]$.\\
Want: $((g\circ f)\circ a)_\bullet\to(g\circ f)(p)$ in $Z$.\\
By (1) of \tref{thm-preimage-in-dom-fwdim-in-im}, we have: $f^*(\dom[g])\subseteq\dom[f]$.\\
Since $a\in(\dom[g\circ f])^\N$, we get $a:\N\to\dom[g\circ f]$.\\
Since $f:X\drta Y$, we get $f:\dom[f]\to Y$.\\
By (1) of \tref{thm-dom-im-composite}, we have $\dom[g\circ f]=f^*(\dom[g])$.\\
So, since $f^*(\dom[g])\subseteq\dom[f]$,
we conclude that $\dom[g\circ f]\subseteq\dom[f]$.\\
Since $a:\N\to\dom[g\circ f]$ and $\dom[g\circ f]\subseteq\dom[f]$ and $f:\dom[f]\to Y$,\\
\phx\qquad it follows, from \tref{thm-composition-dom-and-im}, that $f\circ a:\N\to f_*(\dom[g\circ f])$.\\
Recall that $\dom[g\circ f]=f^*(\dom[g])$.\\
By HW\#8-1, we have $f_*(f^*(\dom[g]))\subseteq\dom[g]$.\\
Then $f_*(\dom[g\circ f])=f_*(f^*(\dom[g]))\subseteq\dom[g]$.\\
So, since $f\circ a:\N\to f_*(\dom[g\circ f])$, we get $f\circ a:\N\to\dom[g]$.\\
Then $f\circ a\in(\dom[g])^\N$.\\
Since $f$ is continuous at $p$, it follows that $p\in\dom[f]$.\\
Since $g$ is continuous at $f(p)$, it follows that $f(p)\in\dom[g]$.\\
Since $(\,\,a_\bullet\to p\hbox{ in }\dom[g\circ f]\,\,)$ and since $(\,\,\dom[g\circ f]\subseteq\dom[g]\,\,)$,\\
\phx\qquad we conclude, from \tref{thm-approaches-in-subsp-implies-approaches-in-ambient}, that $a_\bullet\to p$ in $\dom[f]$.\\
So, since $f$ is continuous at $p$ from $\dom[f]$ to $Y$,\\
\phx\qquad we conclude that $(f\circ a)_\bullet\to f(p)$ in $Y$.\\
So, since $f\circ a\in(\dom[g])^\N$ and $f(p)\in\dom[g]$,\\
\phx\qquad we conclude, from \tref{thm-approaches-in-ambient-implies-approaches-in-subsp}, that $(f\circ a)_\bullet\to f(p)$ in $\dom[g]$.\\
So, since $g$ is continuous at $p$ from $\dom[g]$ to $Z$,\\
\phx\qquad we conclude that $(g\circ(f\circ a))_\bullet\to g(f(p))$ in $Z$.\\
So, since $g\circ(f\circ a)=(g\circ f)\circ a$ and since $g(f(p))=(g\circ f)(p)$,\\
\phx\qquad we conclude that $((g\circ f)\circ a)_\bullet\to(g\circ f)(p))$ in $Z$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-pairing-preserves-continuity}
Let $X$, $Y$ and $Z$ be metric spaces.\\
Let $f:X\drta Y$ and $g:X\drta Z$.\\
Assume that $f$ is continuous at $p$.\\
Assume that $g$ is continuous at $p$.\\
Then $(f,g)$ is continuous at $p$.
\end{thm}

\begin{proof}
Let $S:=\dom[f]$ and $T:=\dom[g]$. \quad
Then $S\cap T=\dom[(f,g)]$.\\
Also, $f:S\to Y$ and $g:T\to Z$ and $(f,g):S\cap T\to Y\times Z$.\\
Also, $f$ is continuous at $p$ from $S$ to $Y$.\\
Also, $g$ is continuous at $p$ from $T$ to $Z$.\\
Want: $(f,g)$ is continuous at $p$ from $S\cap T$ to $Y\times Z$.\\
Want: $\forall a\in(S\cap T)^\N$,\\
\phx\quad $(\,\,a_\bullet\to p\hbox{ in }S\cap T\,\,)\,\,\Rightarrow\,\,(\,\,((f,g)\circ a)_\bullet\to(f,g)(p)\hbox{ in }Y\times Z\,\,)$.\\
Given $a\in(S\cap T)^\N$.\\
Want: $(\,\,a_\bullet\to p\hbox{ in }S\cap T\,\,)\,\,\Rightarrow\,\,(\,\,((f,g)\circ a)_\bullet\to(f,g)(p)\hbox{ in }Y\times Z\,\,)$.\\
Assume $a_\bullet\to p$ in $S\cap T$. \quad
Want: $((f,g)\circ a)_\bullet\to(f,g)(p)$ in $Y\times Z$.\\
Since $a_\bullet\to p$ in $S\cap T$, by \tref{thm-approaches-in-subsp-implies-approaches-in-ambient},\\
\phx\qquad we conclude that $a_\bullet\to p$ in $S$.\\
So, since $f$ is continuous at $p$ from $S$ to $Y$,\\
\phx\qquad we conclude that $(f\circ a)_\bullet\to f(p)$ in $Y$.\\
Since $a_\bullet\to p$ in $S\cap T$, by \tref{thm-approaches-in-subsp-implies-approaches-in-ambient},\\
\phx\qquad we conclude that $a_\bullet\to p$ in $T$.\\
So, since $g$ is continuous at $p$ from $T$ to $Z$,\\
\phx\qquad we conclude that $(g\circ a)_\bullet\to g(p)$ in $Z$.\\
Since $(f\circ a)_\bullet\to f(p)$ in $Y$ and $(g\circ a)_\bullet\to g(p)$ in $Z$,\\
\phx\qquad by $\Leftarrow$ of \tref{thm-pair-approaches-pair-iff-coords-approach-coords},
we get $(f\circ a,g\circ a)_\bullet\to(f(p),g(p))$ in $Z$.\\
So, since $(f,g)(p)=(f(p),g(p))$,
we get $(f\circ a,g\circ a)_\bullet\to(f,g)(p)$ in $Z$.\\
Recall that we want: $((f,g)\circ a)_\bullet\to(f,g)(p)$ in $Y\times Z$.\\
It therefore suffices to show: $(f\circ a,g\circ a)=(f,g)\circ a$.\\
Want: $\forall j\in\N$, $(f\circ a,g\circ a)_j=((f,g)\circ a)_j$.\\
Given $j\in\N$. \quad
Want: $(f\circ a,g\circ a)_j=((f,g)\circ a)_j$.\\
We have $(f\circ a,g\circ a)_j=((f\circ a)_j,(g\circ a)_j)=(f(a_j),g(a_j))$\\
\phx\qquad\qquad\qquad $=(f,g)(a_j)=((f,g)\circ a)_j$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-sum-contin-is-contin}
Let $X$ be a metric space.\\
Let $f,g:X\drta\R$ and let $p\in\R$.\\
Assume that $f$ is continuous at $p$ from $\dom[f]$ to $\R$.\\
Assume that $g$ is continuous at $p$ from $\dom[g]$ to $\R$.\\
Then $f+g$ is continuous at $p$ from $\dom[f+g]$ to $\R$.
\end{thm}

\begin{proof}
We have $(f,g):X\drta\R^2$.\\
Let $A:\R^2\to\R$ be defined by $A(x,y)=x+y$.\\
Since $(f,g)$ is continuous at $p$ and $A$ is continuous at $(f,g)(p)$,\\
\phx\qquad it follows, from \tref{thm-comp-contin-fns-is-contin}, that\\
\phx\qquad\qquad $A\circ(f,g)$ is continuous at $p$ from $\dom[A\circ(f,g)]$ to $\R$.\\
Recall that we want: $f+g$ is continuous at $p$ from $\dom[f+g]$ to $\R$.\\
It therefore suffices to show: $A\circ(f,g)=f+g$.\\
Want: $\forall z\in X$, $(A\circ(f,g))(z)=(f+g)(z)$.\\
Given $z\in\R$. \quad
Want: $(A\circ(f,g))(z)=(f+g)(z)$.\\
We have $(A\circ(f,g))(z)=A((f,g)(z))=A(f(z),g(z))$\\
\phx\qquad\qquad\qquad\qquad $=[f(z)]+[g(z)]=(f+g)(z)$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-prod-contin-is-contin}
Let $X$ be a metric space.\\
Let $f,g:X\drta\R$ and let $p\in\R$.\\
Assume that $f$ is continuous at $p$ from $\dom[f]$ to $\R$.\\
Assume that $g$ is continuous at $p$ from $\dom[g]$ to $\R$.\\
Then $fg$ is continuous at $p$ from $\dom[f+g]$ to $\R$.
\end{thm}

\begin{proof}
We have $(f,g):X\drta\R^2$.\\
Let $M:\R^2\to\R$ be defined by $M(x,y)=xy$.\\
Since $(f,g)$ is continuous at $p$ and $M$ is continuous at $(f,g)(p)$,\\
\phx\qquad it follows, from \tref{thm-comp-contin-fns-is-contin}, that\\
\phx\qquad\qquad $M\circ(f,g)$ is continuous at $p$ from $\dom[M\circ(f,g)]$ to $\R$.\\
Recall that we want: $fg$ is continuous at $p$ from $\dom[fg]$ to $\R$.\\
It therefore suffices to show: $M\circ(f,g)=fg$.\\
Want: $\forall z\in X$, $(M\circ(f,g))(z)=(fg)(z)$.\\
Given $z\in\R$. \quad
Want: $(M\circ(f,g))(z)=(fg)(z)$.\\
We have $(M\circ(f,g))(z)=M((f,g)(z))=M(f(z),g(z))$\\
\phx\qquad\qquad\qquad\qquad $=[f(z)]\cdot[g(z)]=(fg)(z)$, as desired.
\end{proof}

\section{A squeeze theorem}

\begin{thm}\wrlab{thm-first-squeeze-thm}
Let $u\in\R^\N$ and let $x\in\R$.\\
Assume: $\forall j\in\N$, $x-(1/j)\le u_j\le x$.\\
Then $u_\bullet\to x$ in $\R$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R(u_j,x)<\varepsilon\,\,)$.\\
Given $\varepsilon>0$. \qquad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R(u_j,x)<\varepsilon\,\,)$.\\
By the Archimedean Principle, choose $K\in\N$ s.t.~$K>1/\varepsilon$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R(u_j,x)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \qquad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_\R(u_j,x)<\varepsilon\,\,)$.\\
Assume that $j\ge K$. \qquad
Want: $d_\R(u_j,x)<\varepsilon$.\\
Want: $|u_j-x|<\varepsilon$. \qquad
Want: $x-\varepsilon<u_j<x+\varepsilon$.\\
By assumption $u_j\le x$. \qquad
Since $\varepsilon>0$, we get $x<x+\varepsilon$.\\
Then $u_j\le x<x+\varepsilon$. \qquad
Want: $x-\varepsilon<u_j$.\\
By assumption, $x-(1/j)\le u_j$.\\
Want: $x-\varepsilon<x-(1/j)$. \qquad
Want: $1/j<\varepsilon$.\\
Since $j\ge K>1/\varepsilon$, we get $j>1/\varepsilon$.\\
Since $\varepsilon>0$, it follows that $1/\varepsilon>0$.\\
Since $j>1/\varepsilon>0$, we conclude that $1/j<\varepsilon$, as desired.
\end{proof}

\section{The supremum is a limit}

\begin{thm}\wrlab{thm-sup-is-lim}
Let $S\subseteq\R$ and let $x:=\sup S$.\\
Assume that $S\ne\emptyset$ and that $S$ is bounded above in $\R$.\\
Then $\exists u\in S^\N$ s.t.~$u_\bullet\to x$ in $\R$.
\end{thm}

\begin{proof}
We have $S\le\sup S=x$, so $S\le x$.\\
Also, $\forall w<x$, we have $\not(S\le w)$.\\
\\
{\it Claim:} $\forall j\in\N$, $[x-(1/j);x]\cap S\ne\emptyset$.\\
\\
{\it Proof of Claim:}\\
Given $j\in\N$. \qquad
Want: $[x-(1/j);x]\cap S\ne\emptyset$.\\
Since $(\forall w<x, \not(S\le w))$ and since $x-(1/j)<x$,\\
\phx\qquad we conclude: $\not(S\le x-(1/j))$.\\
Then choose $t\in S$ s.t. $t>x-(1/j)$.\\
We have $t\in S\le x$, so $t\le x$.\\
Also, $x-(1/j)<t\le x$, so $x-(1/j)<t$.\\
Then $x-(1/j)<t\le x$, so $t\in(x-(1/j);x]$.\\
Since $t\in(x-(1/j);x]\subseteq[x-(1/j);x]$ and since $t\in S$,\\
\phx\qquad we conclude: $t\in[x-(1/j);x]\cap S$.\\
Then $[x-(1/j);x]\cap S\ne\emptyset$, as desired.\\
{\it End of proof of Claim.}\\
\\
By the Claim, and by \aref{axiom-choice}, we have:\\
\phx\qquad $\forall j\in\N$, \quad $\CH([x-(1/j);x]\cap S)\,\,\in\,\,[x-(1/j);x]\cap S$.\\
Define $u\in S^\N$ by $u_j=\CH([x-(1/j);x]\cap S)$.\\
Want $u_\bullet\to x$ in $\R$.\\
By \tref{thm-first-squeeze-thm}, it suffices to show: $\forall j\in\N$, $x-(1/j)\le u_j\le x$.\\
Given $j\in\N$. \qquad
Want: $x-(1/j)\le u_j\le x$.\\
We have $u_j=\CH([x-(1/j);x]\cap S)\in[x-(1/j);x]\cap S\subseteq[x-(1/j);x]$.\\
Then $x-(1/j)\le u_j\le x$, as desired.\\
\end{proof}

\section{Limit preserves nonstrict inequalities}

\begin{thm}\wrlab{thm-limit-preserves-le}
Let $w\in\R^\N$ and let $y,z\in\R$.\\
Assume that $w_\bullet\to z$ in $\R$.\\
Assume: $\forall j\in\N$, $w_j\le y$.\\
Then $z\le y$.
\end{thm}

\begin{proof}
HW\#8-2.
\end{proof}

\begin{thm}\wrlab{thm-limit-preserves-ge}
Let $w\in\R^\N$ and let $y,z\in\R$.\\
Assume that $w_\bullet\to z$ in $\R$.\\
Assume: $\forall j\in\N$, $w_j\ge y$.\\
Then $z\ge y$.
\end{thm}

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

\section{Increasing and decreasing functions $\R\drta\R$}

\begin{defn}\wrlab{defn-incr-decr-variants}
Let $f:\R\drta\R$ and let $S\subseteq\dom[f]$.\\
By $f$ is \bfindex[strictly increasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t<u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)<f(u)\,\,)\,\,]$.\\
By $f$ is \bfindex[strictly decreasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t<u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)>f(u)\,\,)\,\,]$.\\
By $f$ is \bfindex[semi-increasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t\le u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)\le f(u)\,\,)\,\,]$.\\
By $f$ is \bfindex[semi-decreasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t\le u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)\ge f(u)\,\,)\,\,]$.
\end{defn}

\begin{thm}
Let $f:\R\drta\R$ and let $S\subseteq\dom[f]$. \qquad
Then:\\
\phx\qquad (1) $(\,f\hbox{ is strictly increasing on }S\,)\,\,\Rightarrow\,\,\\
\phx\qquad\qquad\qquad (\,f\hbox{ is semi-increasing on }S\,)$\\
\phx and (2) $(\,f\hbox{ is strictly decreasing on }S\,)\,\,\Rightarrow\,\,\\
\phx\qquad\qquad\qquad (\,f\hbox{ is semi-dencreasing on }S\,)$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$ and let $S\subseteq\dom[f]$. \qquad
Then:\\
\phx and (1) $(\,f\hbox{ is strictly increasing on }S\,)\,\,\Leftrightarrow$\\
\phx\qquad\qquad\qquad $\,\,(\,\forall t,u\in S,\,[\,(\,t>u\,)\,\Rightarrow\,(\,f(t)>f(u)\,)\,]\,)$\\
\phx and (2) $(\,f\hbox{ is strictly decreasing on }S\,)\,\,\Leftrightarrow$\\
\phx\qquad\qquad\qquad $\,\,(\,\forall t,u\in S,\,[\,(\,t>u\,)\,\Rightarrow\,(\,f(t)<f(u)\,)\,]\,)$\\
\phx and (3) $(\,f\hbox{ is semi-increasing on }S\,)\,\,\Leftrightarrow$\\
\phx\qquad\qquad\qquad $\,\,(\,\forall t,u\in S,\,[\,(\,t\ge u\,)\,\Rightarrow\,(\,f(t)\ge f(u)\,)\,]\,)$\\
\phx and (4) $(\,f\hbox{ is semi-decreasing on }S\,)\,\,\Leftrightarrow$\\
\phx\qquad\qquad\qquad $\,\,(\,\forall t,u\in S,\,[\,(\,t\ge u\,)\,\Rightarrow\,(\,f(t)\le f(u)\,)\,]\,)$.
\end{thm}

\begin{defn}
Let $f:\R\drta\R$.\\
By $f$ is \bfindex[strictly increasing], we mean:\\
\phx\qquad\qquad $f$ is strictly increasing on $\dom[f]$.\\
By $f$ is \bfindex[strictly decreasing], we mean:\\
\phx\qquad\qquad $f$ is strictly decreasing on $\dom[f]$.\\
By $f$ is \bfindex[semi-increasing], we mean:\\
\phx\qquad\qquad $f$ is semi-increasing on $\dom[f]$.\\
By $f$ is \bfindex[semi-decreasing], we mean:\\
\phx\qquad\qquad $f$ is semi-decreasing on $\dom[f]$.
\end{defn}

\begin{defn}\wrlab{defn-diff-quot}
$\forall f:\R\drta\R$, $\forall a,b$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\ds{(\DQ_f)(a,b):=\frac{[f(b)]-[f(a)]}{b-a}}$.
\end{defn}

In \dref{defn-diff-quot}, ``DQ'' stands for ``\bfindex[Difference Quotient]''.

We drew a graph of a function $f$ and demonstrated how $(\DQ_f)(a,b)$ is the slope of a secant line.

For \tref{thm-eg1-decr-incr} below, we showed the graphs of $\id_\R$ and $(\id_\R)^2$ and $(\id_\R)^3$ and $C_\R^3$.
We discussed slopes of secant lines for these graphs and used various variants of HW\#9-1.

\begin{thm}\wrlab{thm-eg1-decr-incr}
All of the following are true:\\
\phx\qquad (1) $(\,\,\id_\R\hbox{ is strictly increasing}\,\,)$\\
\phx  and (2) $(\,\,(\id_\R)^3\hbox{ is strictly increasing}\,\,)$\\
\phx  and (3) $(\,\,(\id_\R)^2\hbox{ is neither strictly decreasing nor strictly increasing}\,\,)$\\
\phx  and (4) $(\,\,(\id_\R)^2\hbox{ is strictly decreasing on }(-\infty;0]\,\,)$\\
\phx  and (5) $(\,\,(\id_\R)^2\hbox{ is strictly increasing on }[0;\infty)\,\,)$\\
\phx  and (6) $(\,\,C_\R^3\hbox{ is neither strictly decreasing nor strictly increasing}\,\,)$\\
\phx  and (7) $(\,\,C_\R^3\hbox{ is both semi-decreasing and semi-increasing}\,\,)$.
\end{thm}

\begin{thm}\wrlab{thm-gt0-implies-ge1}
$\forall\ell\in\Z$, $[\,(\,\ell>0\,)\,\Rightarrow\,(\,\ell\ge1\,)\,]$.
\end{thm}

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

\tref{thm-gt-implies-geplus1}, below, is of use in HW\#9-2.
It follows easily from \tref{thm-gt0-implies-ge1}, above.

\begin{thm}\wrlab{thm-gt-implies-geplus1}
$\forall j,k\in\Z$, $[\,(\,j<k\,)\,\Rightarrow\,(\,j+1\le k\,)\,]$.
\end{thm}

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

\begin{defn}
Let $f$ be a functional.\\
By $f$ is \bfindex[bounded above] into $\R$, we mean:\\
\phx\qquad\qquad\qquad $\im[f]$ is bounded above in $\R$.\\
By $f$ is \bfindex[bounded below] into $\R$, we mean:\\
\phx\qquad\qquad\qquad $\im[f]$ is bounded below in $\R$.
\end{defn}

\section{Cauchy sequences}

\begin{defn}
Let $X$ be a metric space, $S\subseteq X$ and $\varepsilon>0$.\\
By $S$ is $\varepsilon$-\bfindex[small] in $X$, we mean:
$\forall y,z\in S$, $d_X(y,z)<\varepsilon$.
\end{defn}

\begin{defn}\wrlab{defn-Cauchy}
Let $X$ be a metric space and $a\in X^\N$.\\
By $a$ is \bfindex[Cauchy] in $X$, we mean:
$\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall i,j\in\N$,\\
\phx\qquad\qquad $(\,\,i,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(a_i,a_j)<\varepsilon\,\,)$.
\end{defn}

A buzz phrase for \dref{defn-Cauchy} is:\\
\phx\qquad\qquad ``A sequence is Cauchy iff,\\
\phx\qquad\qquad\qquad $\forall\varepsilon>0$, the sequence has an $\varepsilon$-small tail.''\\
More precisely, $\forall\varepsilon>0$, there is a tail with $\varepsilon$-small image.

\section{Intermediate Value Theorems (IVTs) }

The following is HW\#8-4:

\begin{thm}\wrlab{thm-lim-preserves-le}
Let $w\in\R^\N$ and let $y,z\in\R$.\\
\phx\qquad Assume that $w_\bullet\to y$ in $\R$. \quad
Assume: $\forall j\in\N$, $w_j\le z$.\\
\phx\qquad Show: $y\le z$.
\end{thm}

The following is an unassigned exercise:

\begin{thm}\wrlab{thm-lim-preserves-ge}
Let $w\in\R^\N$ and let $y,z\in\R$.\\
\phx\qquad Assume that $w_\bullet\to y$ in $\R$. \quad
Assume: $\forall j\in\N$, $w_j\ge z$.\\
\phx\qquad Show: $y\ge z$.
\end{thm}

\begin{thm}
Let $f$ be a function and let $S$ be a set.
Then, $\forall p$,\\
\phx\qquad$[\,(\,p\in S\,)\,\&\,(\,p\in\dom[f]\,)\,]\quad\Rightarrow\quad[\,f(p)\in f_*(S)\,]$.
\end{thm}

\begin{thm}\wrlab{thm-approach-from-above-formula}
Let $b,x\in\R$. \qquad
Assume that $x<b$.\\
\phx\qquad\qquad Define $v\in\R^\N$ by $\ds{v_j=x+\frac{b-x}{j}}$.\\
\phx\qquad\qquad Then $(\,v_\bullet\to x\hbox{ in }\R\,)$ and $(\,\forall j\in\N, x<v_j\le b\,)$.
\end{thm}

\begin{thm}\wrlab{thm-first-IVT}
Let $f:\R\drta\R$.\\
Let $a,b,y\in\R$. \quad
Assume $a\le b$.\\
Assume $f$ is continuous on $[a;b]$ from $\dom[f]$ to $\R$.\\
Assume $f(a)\le y\le f(b)$. \quad
Then $\exists x\in[a;b]$ s.t.~$f(x)=y$.
\end{thm}

\begin{proof}
Since $f$ is continuous on $[a;b]$, we see that $[a;b]\subseteq\dom[f]$.\\
Let $S:=\{t\in[a;b]\,|\,f(t)\le y\}$.\\
Then $S\subseteq[a;b]\subseteq\dom[f]$. \qquad
Then $S^\N\subseteq(\dom[f])^\N$.\\
\\
{\it Claim 1:} $f_*(S)\le y$.\\
{\it Proof of Claim 1:}\\
Want: $\forall q\in f_*(S)$, $q\le y$.\\
Given $q\in f_*(S)$. \qquad
Want: $q\le y$.\\
Since $q\in f_*(S)$, choose $t\in S\cap(\dom[f])$ s.t.~$f(t)=q$.\\
Since $t\in S$, it follows, from the definition of $S$, that $f(t)\le y$.\\
Then $q=f(t)\le y$, as desired.\\
{\it End of proof of Claim 1.}\\
\\
By assumption, $f(a)\le y$.\\
Since $a\in[a;b]$ and $f(a)\le y$, we conclude,\\
\phx\qquad\qquad from the definition of $S$, that $a\in S$.\\
Since $a\in S$, it follows that $S\ne\emptyset$.\\
We have $a\in S\le\sup\,S$, so $a\le\sup S$.\\
Since $S\subseteq[a;b]\le b$, we get $S\le b$.\\
Then $\sup\,S\le b$. \qquad
Then $a\le\sup\,S\le b$.\\
Let $x:=\sup\,S$.\quad
Then $a\le x\le b$, so $x\in[a;b]$.\\
Want: $f(x)=y$.\\
Since $x\in[a;b]$ and since $f$ is continuous on $[a;b]$ from $\dom[f]$ to $\R$,\\
\phx\qquad\qquad we conclude that $f$ is continuous at $x$ from $\dom[f]$ to $\R$.\\
Since $S\le b$, we conclude that $S$ is bounded above in $\R$.\\
So, since $S\ne\emptyset$, by \tref{thm-sup-is-lim}, choose $u\in S^\N$ s.t.~$u_\bullet\to x$ in $\R$.\\
We have $u\in S^\N\subseteq(\dom[f])^\N$. \qquad
Also, $x\in[a;b]\subseteq\dom[f]$.\\
Then, by \tref{thm-approaches-in-ambient-implies-approaches-in-subsp}, $u_\bullet\to x$ in $\dom[f]$.\\
So, since $f$ is continuous at $x$ from $\dom[f]$ to $\R$,\\
\phx\qquad\qquad we see that $(f\circ u)_\bullet\to f(x)$ in $\R$.\\
\\
{\it Claim 2:} $\forall j\in\N$, $(f\circ u)_j\le y$.\\
{\it Proof of Claim 2:}\\
Given $j\in\N$. \qquad
Want: $(f\circ u)_j\le y$.\\
Since $u\in S^\N$, we get $u_j\in S$.\\
Then $u_j\in S\subseteq\dom[f]$.\\
By Claim 1, $f_*(S)\le y$.\\
Since $u_j\in S$ and $u_j\in\dom[f]$, we get: $f(u_j)\in f_*(S)$.\\
Then $(f\circ u)_j=f(u_j)\in f_*(S)\le y$, as desired.\\
{\it End of proof of Claim 2.}\\
\\
Since $(f\circ u)_\bullet\to f(x)$ in $\R$, by \tref{thm-lim-preserves-le},\\
\phx\qquad\qquad it follows, from Claim 2, that $f(x)\le y$.\\
It remains to show: $f(x)\ge y$.\\
Since $x\in[a;b]$, we conclude that one of the following is true:\\
\phx\qquad $(\alpha)$ $x=b$ \qquad or \qquad $(\beta)$ $x\in[a;b)$.\\
\\
{\it Case $(\alpha)$:}\\
By assumption $y\le f(b)$.\\
Then $f(x)=f(b)\ge y$, as desired.\\
{\it End of Case $\alpha$.}\\
\\
{\it Case $(\beta)$:}\\
Define $v\in\R^\N$ by $\ds{v_j=x+\frac{b-x}{j}}$.\\
By \tref{thm-approach-from-above-formula}, we know both of the following:\\
\phx\qquad (A) $v_\bullet\to x$ in $\R$\\
\phx  and (B) $\forall j\in\N$, $x<v_j\le b$.\\
\\
{\it Claim 3:} $v\in[a;b]^\N$.\\
{\it Proof of Claim 3:}\\
Since $v\in\R^\N$, we see that $\dom[v]=\N$.\\
Want: $\im[v]\subseteq[a;b]$.\\
Want: $\forall z\in\im[v]$, $z\in[a;b]$.\\
Given $z\in\im[v]$. \qquad
Want $z\in[a;b]$.\\
Since $z\in\im[v]$ and $v:\N\to\R$, choose $j\in\N$ s.t.~$z=v_j$.\\
By (B), $x<v_j\le b$.\\
Since $x\in[a;b]$, we get $a\le x$.\\
Then $a\le x<v_j$, so $a<v_j$. \quad
Then $a\le v_j$.\\
Since $a\le v_j\le b$, we get $v_j\in[a;b]$.\\
Then $z=v_j\in[a;b]$.\\
{\it End of proof of Claim 3.}\\
\\
By (A), we have: $v_\bullet\to x$ in $\R$.\\
Recall that $x\in\dom[f]$.\\
Since $[a;b]\subseteq\dom[f]$, it follows that $[a;b]^\N\subseteq(\dom[f])^\N$.\\
Then, by Claim 3, we see that $v\in(\dom[f])^\N$.\\
It follows, from \tref{thm-approaches-in-ambient-implies-approaches-in-subsp},
that $v_\bullet\to x$ in $\dom[f]$.\\
So, since $f$ is continuous at $x$ from $\dom[f]$ to $\R$,\\
\phx\qquad\qquad we see that $(f\circ v)_\bullet\to f(x)$ in $\R$.\\
Recall that we want to show: $f(x)\ge y$.\\
Then, by \tref{thm-lim-preserves-ge},
it suffices to prove: $\forall j\in\N$, $(f\circ v)_j\ge y$.\\
Given $j\in\N$. \qquad
Want: $(f\circ v)_j\ge y$.\\
By (B), $x<v_j$.\\
Since $S\le\sup\,S=x<v_j$, we get $S<v_j$, so $v_j>S$, so $v_j\notin S$.\\
By Claim 3, $\im[v]\subseteq[a;b]$.\\
Then $v_j\in\im[v]\subseteq[a;b]$, so $v_j\in[a;b]$.\\
So, since $v_j\notin S$, by definition of $S$, we see that $\neg(f(v_j)\le y)$.\\
Then $f(v_j)>y$. \qquad
Then $f(v_j)\ge y$.\\
So, since $(f\circ v)_j=f(v_j)$, we get: $(f\circ v)_j\ge y$, as desired.\\
{\it End of Case $(\beta)$.} \qquad
\end{proof}

\begin{thm}\wrlab{thm-second-IVT}
Let $f:\R\drta\R$.\\
Let $a,b,y\in\R$. \quad
Assume $a\le b$.\\
Assume $f$ is continuous on $[a;b]$ from $\dom[f]$ to $\R$.\\
Assume $f(a)\ge y\ge f(b)$. \quad
Then $\exists x\in[a;b]$ s.t.~$f(x)=y$.
\end{thm}

\begin{proof}
Let $g:=-f$ and let $z:=-y$.\\
We have $g(a)=-(f(a))$ and $z=-y$ and $g(b)=-(f(b))$.\\
Since $f(a)\ge y\ge f(b)$, we get $-(f(a))\le-y\le-(f(b))$.\\
Then $g(a)\le z\le g(b)$.\\
By HW\#8-3, $g$ is continuous on $[a;b]$.\\
Then, by \tref{thm-first-IVT} (with $f$ replaced by $g$ and $y$ by $z$),\\
\phx\qquad\qquad choose $x\in[a;b]$ s.t.~$g(x)=z$.\\
Want: $f(x)=y$.\\
Since $g=-f$, we get $g(x)=-(f(x))$, and so $f(x)=-(g(x))$.\\
We have $z=-y$, so $-z=y$.\\
Then $f(x)=-(g(x))=-z=y$, as desired.
\end{proof}

\begin{defn}
$\forall a,b\in\R^*$, \quad $[a|b]:=[a;b]\cup[b;a]$.
\end{defn}

\begin{thm}
$[1|3]=[1;3]=[3|1]$.
\end{thm}

\begin{thm}
$\forall a,b\in\R^*$, \quad $[\,a\,|\,b\,]\,\,=\,\,[\,\min\{a,b\}\,;\,\max\{a,b\}\,]$.
\end{thm}

The following is the \bfindex[Intermediate Value Theorem].

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

\begin{proof}
Want: $\forall y\in[f(a)|f(b)]$, $y\in f_*([a|b])$.\\
Given $y\in [f(a)|f(b)]$. \qquad
Want: $y\in f_*([a|b])$.\\
Want: $\exists x\in[a|b]\cap(\dom[f])$ s.t.~$f(x)=y$.\\
Since $f$ is continuous on $[a|b]$,\\
\phx\qquad\qquad it follows that $[a|b]\subseteq\dom[f]$,\\
\phx\qquad\qquad  so $[a|b]\cap(\dom[f])=[a|b]$.\\
Want: $\exists x\in[a|b]$ s.t.~$f(x)=y$.\\
Let $\alpha:=\min\{a,b\}$ and $\beta:=\max\{a,b\}$.\\
Then $[a|b]=[\alpha;\beta]$,
so, by assumption, $f$ is continuous on $[\alpha;\beta]$.\\
Also, $[f(a)|f(b)]=[f(\alpha)|f(\beta)]$, so $y\in[f(\alpha)|f(\beta)]$.\\
Want: $\exists x\in[\alpha;\beta]$ s.t. $f(x)=y$.\\
At least one of the following is true:\\
\phx\qquad (1) $f(\alpha)\le f(\beta)$ \qquad or \qquad (2) $f(\alpha)\ge f(\beta)$.\\
\\
{\it Case 1:}\\
We have $[f(\alpha)|f(\beta)]=[f(\alpha);f(\beta)]$, so $y\in[f(\alpha);f(\beta)]$,\\
\phx\qquad so $f(\alpha)\le y\le f(\beta)$.\\
Then, by \tref{thm-second-IVT} (with $a$ replaced by $\alpha$ and $b$ by $\beta$),\\
\phx\qquad we see that $\exists x\in[\alpha;\beta]$ s.t. $f(x)=y$, as desired.\\
{\it End of Case 1.}\\
\\
{\it Case 2:}\\
We have $[f(\alpha)|f(\beta)]=[f(\beta);f(\alpha)]$, so $y\in[f(\beta);f(\alpha)]$,\\
\phx\qquad so $f(\alpha)\ge y\ge f(\beta)$.\\
Then, by \tref{thm-first-IVT} (with $a$ replaced by $\alpha$ and $b$ by $\beta$),\\
\phx\qquad we see that $\exists x\in[\alpha;\beta]$ s.t. $f(x)=y$, as desired.\\
{\it End of Case 2.}
\end{proof}

\section{Isometries and homeomorphisms}

\begin{defn}
Let $X$ and $Y$ be metric spaces.\\
Then, $\forall f$, by $f$ is an \bfindex[isometry] from $X$ to $Y$, we mean:\\
\phx\qquad $(\quad f\,:\,X\,\hookrightarrow>\,Y\quad)\quad\&$\\
\phx\qquad $(\quad\forall p,q\in X,\,\,\,\,d_Y\,(\,f(p)\,,\,f(q)\,)\,=\,d_X\,(\,p\,,\,q\,)\quad)$.\\
Also, by $X$ and $Y$ are \bfindex[isometric], we mean:\\
\phx\qquad $\exists f$ s.t.~$f$ is an isometry from $X$ to $Y$.\\
Also, $\forall f$, by $f$ is a \bfindex[homeomorphism] from $X$ to $Y$, we mean:\\
\phx\qquad $(\quad f\,:\,X\,\hookrightarrow>\,Y\quad)\quad\&$\\
\phx\qquad $(\quad f\hbox{ is continuous from }X\hbox{ to }Y\quad)\quad\&$\\
\phx\qquad $(\quad f^{-1}\hbox{ is continuous from }Y\hbox{ to }X\quad)$.\\
Also, by $X$ and $Y$ are \bfindex[homeomorphic], we mean:\\
\phx\qquad $\exists f$ s.t.~$f$ is a homeomorphism from $X$ to $Y$.\\
\end{defn}

We sometimes omit ``from $X$ to $Y$''.
We sometimes say ``$X$ is isometric to $Y$'' or ``$Y$ is isometric to $X$'' instead of
``$X$ and $Y$ are isometric''.
We sometimes say ``$X$ is homeomorphic to $Y$'' or ``$Y$ is homeomorphic to $X$'' instead of
``$X$ and $Y$ are homeomorphic''.

We drew pictures indicating that two circles of the same radius are isometric.
We indicated that any circle is homeomorphic to any ellipse.
We drew a wandring simple closed curve and indicated that it is homeomorphic to a circle.

\begin{thm}\wrlab{thm-bdd-open-intvl-homeom-R}
$(-1;1)$ is homeomorphic to $\R$.
\end{thm}

\begin{proof}
Define $f:(-1;1)\to\R$ by $f(x)=x/\sqrt{1-x^2}$.\\
Unassigned HW: $f$ is a homeomorphism from $(-1;1)$ to $\R$.\\
Then $(-1;1)$ is homeomorphic to $\R$.
\end{proof}

\tref{thm-bdd-open-intvl-homeom-R} shows that it is possible for a bounded subset of $\R$ like $(-1;1)$ 
to be homeomorphic to an unbounded one, like $\R$ itself.


\begin{defn}\wrlab{defn-closed-ball-sphere}
Let $X$ be a metric space, $p\in X$, $r>0$.
Then:\\
\phx\qquad $\barB_X(p,r):=\{q\in X\,|\,d_X(p,q)\le r\}$ \qquad and\\
\phx\qquad $S_X(p,r):=\{q\in X\,|\,d_X(p,q)=r\}$.
\end{defn}

We sometimes omit the subscript $X$ from ``$\barB_X(p,r)$'' and ``$S_X(p,r)$''.

The set $\barB_X(p,r)$ is called the \bfindex[closed ball] in $X$ about $p$ of radius $r$.
When $X=\R$, $\barB_X(p,r)$ is a closed interval.
When $X=\R^2$, $\barB_X(p,r)$ is a closed disk.
The set $S_X(p,r)$ is called the \bfindex[sphere] in $X$ about $p$ of~radius $r$.
When $X=\R$, $\barB_X(p,r)$ is a set of two real numbers.
When $X=\R^2$, $\barB_X(p,r)$ is a circle.

\begin{thm}\wrlab{thm-punctured-circle-homeom-R}
Let $C:=S_{\R^2}(0_2,1)$ and let $p:=(0,1)$.\\
Then $C_p^\times$ is homeomorphic to $\R$.
\end{thm}

\begin{proof}
Define $f:C_p^\times\to\R$ by $f(x,y)=x/(1-y)$.\\
Unassigned HW: $f$ is a homeomorphism from $C_p^\times$ to $\R$.\\
Then $C_p^\times$ is homeomorphic to $\R$.
\end{proof}

\tref{thm-punctured-circle-homeom-R} shows that it is possible for a bounded subset of $\R^2$ like $C_p^\times$ 
to be homeomorphic to an unbounded subset of $\R$, like $\R$ itself.

\begin{defn}\wrlab{defn-top-geom-bdd}
Let $X$ be a metric space.\\
By $X$ is \bfindex[geometrically bounded], we mean: $X$ is bounded in $X$.\\
By $X$ is \bfindex[topologically bounded], we mean: $\forall$metric space $Y$,\\
\phx\qquad$(\,\,Y\hbox{ is homeomorphic to }X\,\,)\,\,\Rightarrow\,\,(\,\,Y\hbox{ is geometrically bounded}\,\,)$.
\end{defn}

Note that the definition of topologically bounded is universally quantified over metric spaces.
This makes it a challenge to study, but study it we will.
Moreover, even though it is a topological concept, we will relate it to real analysis through the Extreme Value Theorem.

\begin{thm}\wrlab{thm-egs-geom-top-bdd}
Let $C:=S_{\R^2}(0_2,1)$ and $p:=(0,1)$.\\
Let $X:=\{(x,0)\,|\,x\in\R\}$. \qquad
Let $I:=(-1;1)$ and $J:=[-1;1]$.\\
Then $I$, $J$ $C$ and $C_p^\times$ are all geometrically bounded.\\
Also, $\R$ and $X$ are both not geometrically bounded.\\
Also, $I$, $C_p^\times$, $\R$ and $X$ are all not topologically bounded.
\end{thm}

In \tref{thm-egs-geom-top-bdd},
the fact that $I$ is not topologically bounded
follows from \tref{thm-bdd-open-intvl-homeom-R}.
In \tref{thm-egs-geom-top-bdd},
the fact that $C_p^\times$ is not topologically bounded
follows from \tref{thm-punctured-circle-homeom-R}.

Let $C:=S_{\R^2}(0_2,1)$ and let $J:=[-1;1]$.
We drew pictures of subsets of $\R^2$ that are homeomorphic to $J$,
and noted that they were all geometrically bounded.
Some were very big, stretching across several blackboards,
but all were geometrically bounded.
We drew pictures of~subsets of $\R^2$ that are homeomorphic to $C$,
and noted that they were all geometrically bounded.
Some were very big, stretching across several blackboards,
but all were geometrically bounded.
Based on~these observations,
we speculated that $J$ and $C$ are both topologically bounded.
Our intention is to spend the next class or two developing
the material necessary to analyze topological boundedness.

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

The intuition is:
The sequence $t$ is obtained from $s$ by dropping some of the terms of $s$.
The terms of $s$ that are NOT dropped must appear in $t$
in exactly the same order as they appear in $s$.

\begin{thm}
The following are all true:\\
\phantom{xxxxx}
$(1/2,1/4,1/6,1/8,\ldots)$ is a subsequence of $(1,1/2,1/3,1/4,\ldots)$.\\
\phantom{xxxxx}
$(4^2,8^2,12^2,16^2,\ldots)$ is a subsequence of $(2,4,6,8,\ldots)$.\\
\phantom{xxxxx}
$(3,4,5,6,\ldots)$ is a subsequence of $(1,2,3,4,\ldots)$.\\
\phantom{xxxxx}
$(2,1,3,4,5,6,7,8,9,\ldots)$ is NOT a subsequence of $(1,2,3,4,\ldots)$.
\end{thm}

All of the following are true:\\
\phantom{xxxxx}
$(1/2,1/4,1/6,1/8,\ldots)=(1,1/2,1/3,1/4,\ldots)\circ(2,4,6,8,\ldots)$.\\
\phantom{xxxxx}
$(4^2,8^2,12^2,16^2,\ldots)=(2,4,6,8,\ldots)\circ(8,32,72,128,\ldots)$.\\
\phantom{xxxxx}
$(3,4,5,6,\ldots)=(1,2,3,4,\ldots)\circ(3,4,5,6,\ldots)$.\\
\phantom{xxxxx}
$(2,1,3,4,5,6,7,8,9,\ldots)=(1,2,3,4,\ldots)\circ(2,1,3,4,5,\ldots)$.\\
We noted that $(2,1,3,4,5,\ldots)$ is not strictly increasing.

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

We sometimes drop ``in $X$'' from ``subconvergent in $X$''.

\begin{thm}
The following are all true:\\
\phantom{xxxxx}$(-1,1,-1,1,-1,1,-1,1,\ldots)$ is NOT convergent in $\R$.\\
\phantom{xxxxx}$(-1,1,-1,1,-1,1,-1,1,\ldots)$ IS subconvergent in $\R$.\\
\phantom{xxxxx}$(1,2,3,4,\ldots)$ is NOT subconvergent in $\R$.
\end{thm}

\begin{defn}
Let $X$ be a metric space.\\
By $X$ is \bfindex[compact], we mean:\\
\phx\qquad $\forall s\in X^\N$, $s$ is subconvergent in $X$.\\
Also, by $X$ is \bfindex[proper], we mean:\\
\phx\qquad $\forall$bounded $s\in X^\N$, $s$ is subconvergent in $X$.
\end{defn}

Our upcoming goals:\\
\phantom{xxxxx}(1) $[-1;1]$ and $S_{\R^2}(0_2,1)$ are both compact.\\
\phantom{xxxxx}(2) If a metric space is homeomorphic to a compact metric space,
\phantom{xxxxx}\qquad\qquad\qquad then it is compact.\\
\phantom{xxxxx}(3) Any compact metric space is geometrically bounded.\\
By \dref{defn-top-geom-bdd} and (2) and (3), we get:\\
\phantom{xxxxx}(A) Any compact metric space is topologically bounded.\\
By (1) and (4), we get our earlier goal:\\
\phantom{xxxxx}(B) $[-1;1]$ and $S_{\R^2}(0_2,1)$ are both topologically bounded.\\
We will see that (1) is hard, (2) is easy and (3) is medium.

A subsequence of a convergent sequence has the same limit:

\begin{thm}\wrlab{thm-subseq-has-same-limit}
Let $X$ be a metric space, $s\in X^\N$ and $p\in X$.\\
Let $t$ be a subsequence of $s$. \quad
Assume that $s_\bullet\to p$ in $X$.\\
Then $t_\bullet\to p$ in $X$.
\end{thm}

\begin{proof}
Want: $\forall\varepsilon>0$, $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(t_j,p)<\varepsilon\,\,)$.\\
Given $\varepsilon>0$. \qquad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(t_j,p)<\varepsilon\,\,)$.\\
Since $s_\bullet\to p$ in $X$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(s_j,p)<\varepsilon\,\,)$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(t_j,p)<\varepsilon\,\,)\,\,]$.\\
Given $j\in\N$. \qquad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_X(t_j,p)<\varepsilon\,\,)$.\\
Assume $j\ge K$. \qquad
Want: $d_X(t_j,p)<\varepsilon$.\\
Since $t$ is a subsequence of $s$,\\
\phantom{xxxxx} choose a strictly increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
By HW\#9-2, we see that $\ell_j\ge j$.\\
Since $\ell_j\ge j\ge K$, by the choice of $K$, we get: $d_X(s_{\ell_j},p)<\varepsilon$.\\
So, since $t_j=(s\circ\ell)_j=s_{\ell_j}$, we get $d_X(t_j,p)<\varepsilon$, as desired.
\end{proof}

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

\begin{thm}\wrlab{thm-to-pm-infty-implies-not-bdd}
Let $s\in\R^\N$.\\
\phantom{xxxxx}
Then $(\,\,s_\bullet\to\infty\hbox{ in }\R^*\,\,)\,\,\Rightarrow\,\,(\,\,s\hbox{ is not bounded above in }\R\,\,)$.\\
\phantom{xxxxx}
Also, $(\,\,s_\bullet\to-\infty\hbox{ in }\R^*\,\,)\,\,\Rightarrow\,\,(\,\,s\hbox{ is not bounded below in }\R\,\,)$.
\end{thm}

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

\begin{thm}\wrlab{thm-inf-limit-subseq-has-same-limit}
Let $s\in\R^\N$.\\
Let $t$ be a subsequence of $s$. \quad
Assume that $s_\bullet\to\infty$ in $\R^*$.\\
Then $t_\bullet\to\infty$ in $\R^*$.
\end{thm}

\begin{proof}
Want: $\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\,\,(\,\,t_j>M\,\,)$.\\
Given $M\in\R$. \qquad
Want: $\exists K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,t_j>M\,\,)$.\\
Since $s_\bullet\to\infty$ in $X$, choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,s_j>M\,\,)$.\\
Want: $\forall j\in\N$, $[\,\,(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,t_j>M\,\,)\,\,]$.\\
Given $j\in\N$. \qquad
Want: $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,t_j>M\,\,)$.\\
Assume $j\ge K$. \qquad
Want: $t_j>M$.\\
Since $t$ is a subsequence of $s$,\\
\phantom{xxxxx} choose a strictly increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
By HW\#9-2, we see that $\ell_j\ge j$.\\
Since $\ell_j\ge j\ge K$, by the choice of $K$, we get: $s_{\ell_j}>M$.\\
So, since $t_j=(s\circ\ell)_j=s_{\ell_j}$, we get $t_j>M$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-minusinf-limit-subseq-has-same-limit}
Let $s\in\R^\N$.\\
Let $t$ be a subsequence of $s$. \quad
Assume that $s_\bullet\to-\infty$ in $\R^*$.\\
Then $t_\bullet\to-\infty$ in $\R^*$.
\end{thm}

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

\section{The $\varepsilon$-$\delta$ quantified equivalence for continuity}

\begin{thm}\wrlab{thm-another-squeeze}
Let $a\in\R^\N$. \qquad
Assume: $\forall j\in\N$, $0\le a_j<1/j$.\\
Then $a_\bullet\to0$ in $\R$.
\end{thm}

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

\begin{thm}\wrlab{thm-eps-delta-implies-sequential-contin}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\to Y$ and let $q\in X$.\\
Assume: $\forall\varepsilon>0$, $\exists\delta>0$ s.t., $\forall p\in X$,\\
\phx\qquad\qquad\qquad\qquad $(\,\,d_X(\,p\,,\,q\,)\,<\,\delta\,\,)\,\,\Rightarrow\,\,(\,\,d_Y(\,f(p)\,,\,f(q)\,)\,<\,\varepsilon\,\,)$.\\
Then $f$ is continuous at $q$ from $X$ to $Y$.
\end{thm}

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

The converse of \tref{thm-eps-delta-implies-sequential-contin} is also true:

\begin{thm}\wrlab{thm-sequential-contin-implies-eps-delta}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\to Y$ and let $q\in X$.\\
Assume that $f$ is continuous at $q$ from $X$ to $Y$.\\
Then: $\forall\varepsilon>0$, $\exists\delta>0$ s.t., $\forall p\in X$,\\
\phx\qquad\qquad\qquad\qquad $(\,\,d_X(\,p\,,\,q\,)\,<\,\delta\,\,)\,\,\Rightarrow\,\,(\,\,d_Y(\,f(p)\,,\,f(q)\,)\,<\,\varepsilon\,\,)$.
\end{thm}

\begin{proof}
Assume: $\exists\varepsilon>0$ s.t., $\forall\delta>0$, $\exists p\in X$ s.t.\\
\phx\qquad\qquad\qquad\qquad $(\,\,d_X(\,p\,,\,q\,)\,<\,\delta\,\,)\,\,\&\,\,(\,\,d_Y(\,f(p)\,,\,f(q)\,)\,\ge\,\varepsilon\,\,)$.\\
Want: Contradiction.\\
Choose $\varepsilon>0$ s.t., $\forall\delta>0$, $\exists p\in X$ s.t.\\
\phx\qquad\qquad\qquad\qquad $(\,\,d_X(\,p\,,\,q\,)\,<\,\delta\,\,)\,\,\&\,\,(\,\,d_Y(\,f(p)\,,\,f(q)\,)\,\ge\,\varepsilon\,\,)$.\\
Define $A:\N\to2^\R$ by\\
\phx  $A_j\,\,=\,\,\{\,\,p\in X\,\,|\,\,(\,d_X(\,p\,,\,q\,)\,<\,1/j\,)\,\&\,(\,d_Y(\,f(p)\,,\,f(q)\,)\,\ge\,\varepsilon\,)\}$.\\
\\
{\it Claim 1:} $\forall j\in\N$, $A_j\ne\emptyset$.\\
{\it Proof of Claim 1:}\\
Given $j\in\N$. \qquad
Want: $A_j\ne\emptyset$.\\
Since $1/j>0$, by the choice of $\varepsilon$, choose $p\in X$ s.t.\\
\phx\qquad\qquad\qquad\qquad $(\,\,d_X(\,p\,,\,q\,)\,<\,1/j\,\,)\,\,\&\,\,(\,\,d_Y(\,f(p)\,,\,f(q)\,)\,\ge\,\varepsilon\,\,)$.\\
Then $p\in A_j$, so $A_j\ne\emptyset$, as desired.\\
{\it End of proof of Claim 1.}
\\
Define $s\in X^\N$ by $s_j=\CH(A_j)$.\\
\\
{\it Claim 2:} $\forall j\in\N$, $0\le(d_X(s,q))_j<1/j$.\\
{\it Proof of Claim 2:}\\
Given $j\in\N$. \qquad
Want: $0\le(d_X(s,q))_j<1/j$.\\
Since $(d_X(s,q))_j=d_X(s_j,q)$, we want: $0\le d_X(s_j,q)<1/j$.\\
Since $d_X(s_j,q)\in\im[d_X]\subseteq[0;\infty)\ge0$,
want: $d_X(s_j,q)<1/j$.\\
Since $A_j\ne\emptyset$, it follows that $\CH(A_j)\in A_j$.\\
Since $s_j=\CH(A_j)\in A_j$, we conclude that:\\
\phx\qquad\qquad\qquad\qquad $(\,\,d_X(\,s_j\,,\,q\,)\,<\,1/j\,\,)\,\,\&\,\,(\,\,d_Y(\,f(s_j)\,,\,f(q)\,)\,\ge\,\varepsilon\,\,)$.\\
Then $d_X(s_j,q)<1/j$, as desired.\\
{\it End of proof of Claim 2.}\\
\\
{\it Claim 3:} $\forall j\in\N$, $d_Y(\,(f\circ s)_j\,,\,f(q)\,)\,\ge\,\varepsilon$.\\
{\it Proof of Claim 3:}\\
Given $j\in\N$. \qquad
Want: $d_Y(\,(f\circ s)_j\,,\,f(q)\,)\,\ge\,\varepsilon$.\\
Since $A_j\ne\emptyset$, it follows that $\CH(A_j)\in A_j$.\\
Since $s_j=\CH(A_j)\in A_j$, we conclude that:\\
\phx\qquad\qquad\qquad\qquad $(\,\,d_X(\,s_j\,,\,q\,)\,<\,1/j\,\,)\,\,\&\,\,(\,\,d_Y(\,f(s_j)\,,\,f(q)\,)\,\ge\,\varepsilon\,\,)$.\\
Then $d_Y(\,(f\circ s)_j\,,\,f(q)\,)\,=\,d_Y(\,f(s_j)\,,\,f(q)\,)\,\ge\,\varepsilon$, as desired.\\
{\it End of proof of Claim 3.}\\
\\
By Claim 2 and \tref{thm-another-squeeze}, we see that $(d_X(s,q))_\bullet\to0$ in $\R$.\\
Then, by $\Leftarrow$ of HW\#10-2, we have: $s_\bullet\to q$ in $X$.\\
By assumption, $f$ is continuous at $q$ from $X$ to $Y$.\\
Then $(f\circ s)_\bullet\to f(q)$ in $Y$,
so choose $K\in\N$ s.t., $\forall j\in\N$,\\
\phx\qquad\qquad $(\,\,j\ge K\,\,)\,\,\Rightarrow\,\,(\,\,d_Y(\,(f\circ s)_j\,,\,f(q)\,)\,<\,\varepsilon\,\,)$.\\
Let $j:=K$.\\
From Claim 3, we get: $\varepsilon\,\le\,d_Y(\,(f\circ s)_j\,,\,f(q)\,)$.\\
Since $j\ge K$, by the choice of $K$, we have:\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $d_Y(\,(f\circ s)_j\,,\,f(q)\,)\,<\,\varepsilon$.\\
Then $\varepsilon\,\le\,d_Y(\,(f\circ s)_j\,,\,f(q)\,)\,<\,\varepsilon$, so $\varepsilon<\varepsilon$. \qquad
Contradiction.
\end{proof}

\section{Distance between a sequence and a point}

\begin{defn}
Let $X$ be a metric space, $s\in X^\N$ and $q\in X$.\\
Then $d_X(s,q)\in[0;\infty)^\N$ is defined by: $(d_X(s,q))_j=d_X(s_j,q)$.
\end{defn}

The subscript $X$ in ``$d_X(s,q)$'' is sometimes omitted.

\begin{thm}\wrlab{thm-dist-to-ssq-is-ssq-of-dist-to-seq}
Let $X$ be a metric space, $s,t\in X^\N$ and $q\in X$.\\
Assume that $t$ is a subsequence of $s$.\\
Then $d_X(t,q)$ is a subsequence of $d_X(s,q)$.
\end{thm}

\begin{proof}
Let $a:=d_X(s,q)$ and $b:=d_X(t,q)$.\\
Want: $b$ is a subsequence of $a$.\\
Want: $\exists$strictly increasing $\ell\in\N^\N$ s.t.~$b=a\circ\ell$.\\
Since $t$ is a subsequence of $s$,\\
\phx\qquad choose a strictly increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
Want: $b=a\circ\ell$.\\
Want: $\forall j\in\N$, $b_j=(a\circ\ell)_j$.\\
Given $j\in\N$. \qquad
Want: $b_j=(a\circ\ell)_j$.\\
Let $k:=\ell_j$. \qquad
Then $a_k=(d_X(s,q))_k=d_X(s_k,q)$.\\
Since $t_j=(s\circ\ell)_j=s_{\ell_j}=s_k$, we get $d_X(t_j,q)=d_X(s_k,q)$.\\
Then $b_j=(d_X(t,q))_j=d_X(t_j,q)=d_X(s_k,q)=a_k=a_{\ell_j}=(a\circ\ell)_j$.
\end{proof}

\begin{thm}\wrlab{thm-dist-to-bdd-is-bdd}
Let $X$ be a metric space, $s\in X^\N$ and $q\in X$.\\
Assume that $s$ is bounded in $X$. \qquad
Then $d_X(s,q)$ bounded in $\R$.
\end{thm}

\begin{proof}
Let $\sigma:=d_X(s,q)$. \qquad
Want: $\sigma$ is bounded in $\R$.\\
Want: $\im[\sigma]$ is bounded in $\R$. \qquad
Want: $C\in\scrb_\R$ s.t. $\im[\sigma]\subseteq C$.\\
Since $s$ is bounded in $X$, we know that $\im[s]$ is bounded in $X$.\\
Then choose $B\in\scrb_X$ s.t.~$\im[s]\subseteq B$.\\
Choose $p\in X$ and $r>0$ s.t.~$B=B_X(p,r)$. \qquad
Let $a:=d_X(p,q)$.\\
Since $a=d_X(p,q)\in\im[d_X]\subseteq[0;\infty)\ge0$, we get $a\ge0$.\\
So, since $r>0$, we conclude that $a+r>0$.\\
Let $C:=B_\R(0,r+a)$. \qquad
Then $C\in\scrb_\R$. \qquad
Want: $\im[\sigma]\subseteq C$.\\
Want: $\forall z\in\im[\sigma]$, $z\in C$.\\
Given $z\in\im[\sigma]$. \qquad
Want: $z\in C$.\\
Want: $z\in B_\R(0,r+a)$. \qquad
Want: $d_\R(z,0)<r+a$.\\
Since $z\in\im[\sigma]$, choose $j\in\N$ s.t.~$z=\sigma_j$.\\
Then $z=\sigma_j=(d_X(s,q))_j=d_X(s_j,q)$.\\
By the triangle inequality, $d_X(s_j,q)\le[d_X(s_j,p)]+[d_X(p,q)]$.\\
We have $s_j\in\im[s]\subseteq B=B_X(p,r)$, so $d_X(s_j,p)<r$.\\
So, since $d_X(p,q)=a$, we get $[d_X(s_j,p)]+[d_X(p,q)]<r+a$.\\
Since $a+r>0$, we see that $-(a+r)<0$.\\
Since $d_X(s_j,q)\in\im[d_X]\subseteq[0;\infty)\ge0$,\\
\phx\qquad we get $d_X(s_j,q)\ge0$, and so $0\le d_X(s_j,q)$.\\
Then $-(r+a)<0\le d_X(s_j,q)=z$, so $-(r+a)<z$.\\
Also, $z=d_X(s_j,q)\le[d_X(s_j,p)]+[d_X(p,q)]<r+a$, so $z<r+a$.\\
Then $-(r+a)<z<r+a$, so $|z|<r+a$.\\
Then $d_\R(z,0)=|z-0|=|z|<r+a$, as desired.
\end{proof}

\section{Compact implies geometrically bounded}

We finish goal (3):

\begin{thm}
Let $X$ be a nonempty compact metric space.\\
Then $X$ is geometrically bounded.
\end{thm}

\begin{proof}
Let $A:=X$. \qquad
Then $A$ is compact.\\
So, by HW\#10-5, we conclude that $A$ is bounded in $X$.\\
Then $X$ is bounded in $X$, so $X$ is geometrically bounded.
\end{proof}

Our remaining goals:\\
\phantom{xxxxx}(1) $[-1;1]$ and $S_{\R^2}(0_2,1)$ are both compact.\\
\phantom{xxxxx}(2) If a metric space is homeomorphic to a compact metric space,
\phantom{xxxxx}\qquad\qquad\qquad then it is compact.\\

\section{A continuous image of a compact is compact}

\begin{thm}\wrlab{thm-im-ssq-is-ssq-im}
Let $X$ and $Y$ be sets, $f:X\to Y$ and $s,t\in X^\N$.\\
Assume that $t$ is a subsequence of $s$.\\
Then $f\circ t$ is a subsequence of $f\circ s$.\\
\end{thm}

\begin{proof}
Want: $\exists$strictly increasing $\ell\in\N^\N$ s.t.~$f\circ t=(f\circ s)\circ\ell$.\\
Since $t$ is a subsequence of $s$,\\
\phx\qquad\qquad choose a strictly increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
Want: $f\circ t=(f\circ s)\circ\ell$.\\
We have $f\circ t=f\circ(s\circ\ell)=(f\circ s)\circ\ell$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-im-conv-is-conv}
Let $X$ and $Y$ be metric spaces and let $t\in X^\N$.\\
Assume that $f$ is continuous from $X$ to $Y$.\\
Assume that $t$ is convergent in $X$.\\
Then $f\circ t$ is convergent in $Y$.
\end{thm}

\begin{proof}
Choose $p\in X$ s.t.~$t_\bullet\to p$ in $X$.\\
Since $t_\bullet\to p$ in $X$ and since $f$ is continuous at $p$ from $X$ to $Y$,\\
\phx\qquad it follows that $f\circ t\to f(p)$ in $Y$.\\
Then $f\circ t$ is convergent in $Y$.
\end{proof}

\begin{thm}\wrlab{thm-surj-implies-fibers-nonempty}
Let $X$ and $Y$ be sets.
Let $f:X\to>Y$.\\
Then, $\forall z\in Y$, $f^*(\{z\})\ne\emptyset$.
\end{thm}

\begin{proof}
Given $z\in Y$. \qquad
Want: $f^*(\{z\})\ne\emptyset$.\\
Since $f:X\to>Y$, we see that $\im[f]=Y$.\\
Then $z\in Y=\im[f]$, so choose $p\in X$ s.t.~$f(p)=z$.\\
Since $f(p)=z\in\{z\}$, it follows that $p\in f^*(\{z\})$.\\
Then $f^*(\{z\})\ne\emptyset$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-contin-im-cpt-is-cpt}
Let $X$ and $Y$ be metric spaces.
Let $f:X\to>Y$.\\
Assume that $f$ is continuous from $X$ to $Y$.\\
Asume that $X$ is compact. \qquad
Then $Y$ is compact.
\end{thm}

\begin{proof}
Want: $\forall\sigma\in Y^\N$, $\sigma$ is subconvergent in $Y$.\\
Given $\sigma\in Y^\N$. \qquad
Want: $\sigma$ is subconvergent in $Y$.\\
\\
{\it Claim 1:} $\forall j\in\N$, $f^*(\{\sigma_j\})\ne\emptyset$.\\
{\it Proof of Claim 1:}\\
Given $j\in\N$. \qquad
Want: $f^*(\{\sigma_j\})\ne\emptyset$.\\
By \tref{thm-surj-implies-fibers-nonempty} (with $z$ replaced by $\sigma_j$),\\
\phx\qquad we see that $f^*(\{\sigma_j\})\ne\emptyset$, as desired.\\
{\it End of proof of Claim 1.}\\
\\
By Claim 1, $\forall j\in\N$, $\CH(f^*(\{\sigma_j\}))\in f^*(\{\sigma_j\})$.\\
Define $s\in X^\N$ by $s_j=\CH(f^*(\{\sigma_j\}))$.\\
Then: $\forall j\in\N$, $s_j\in f^*(\{\sigma_j\})$.\\
Since $X$ is compact, $s$ is subconvergent in $X$.\\
Choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
By \tref{thm-im-conv-is-conv}, $f\circ t$ is convergent in $Y$.\\
By \tref{thm-im-ssq-is-ssq-im}, $f\circ t$ is a subsequence of $f\circ s$.\\
Then $f\circ s$ is subconvergent in $Y$.\\
It therefore suffices to show: $f\circ s=\sigma$.\\
Want: $\forall j\in\N$, $(f\circ s)_j=\sigma_j$.\\
Given $j\in\N$. \qquad
Want: $(f\circ s)_j=\sigma_j$.\\
We have $s_j\in f^*(\{\sigma_j\})$, so $f(s_j)\in\{\sigma_j\}$, so $f(s_j)=\sigma_j$.\\
Then $(f\circ s)_j=f(s_j)=\sigma_j$, as desired.\\
\end{proof}

We finish goal (2):

\begin{thm}
Let $X$ and $Y$ be metric spaces.\\
Assume that $X$ is compact and that $X$ is homeomorphic to $Y$.\\
Then $Y$ is compact.
\end{thm}

\begin{proof}
Since $X$ is homeomorphic to $Y$,\\
\phx\qquad\qquad choose $f$ s.t.~$f$ is a homeomorphism from $X$ onto $Y$.\\
Then $f$ is continuous from $X$ to $Y$ and $f:X\to>Y$.\\
So, since $X$ is compact, by \tref{thm-contin-im-cpt-is-cpt}, we get: $Y$ is compact.
\end{proof}

\section{Some topology}

Our remaining goal:\\
\phantom{xxxxx}(1) $[-1;1]$ and $S_{\R^2}(0_2,1)$ are both compact.\\

FOR NEXT YEAR: Define $\partial_XA$ as points approached from inside and outside $A$.
Then define $\Int_XA$ as $A\backslash(\partial_XA)$ and $\Cl_XA$ as $A\cup(\partial_XA)$.
Then the definitions below will become theorems.

\begin{defn}\wrlab{defn-int-closure}
Let $X$ be a metric space and let $A\subseteq X$.\\
Then $\Int_XA:=\{p\in X\,|\,\exists B\in\scrb_X(p)~\hbox{s.t.}~B\subseteq A\}$.\\
Also, $\Cl_XA:=\{p\in X\,|\,\exists s\in A^\N~\hbox{s.t.}~s_\bullet\to p\hbox{ in } X\}$.
\end{defn}

In \dref{defn-int-closure}, $\Int_XA$ is called the \bfindex[interior] in $X$ of $A$,
and $\Cl_XA$ is called the \bfindex[closure] in $X$ of $A$.
When $X$ is clear, we simply say the interior of $A$ and the closure of $A$, and we
simply write $\Int\,A$ and $\Cl\,A$.

\begin{thm}
Let $I:=(-1;1)$, $J:=(-1;1]$, $K:=[-1;1]$.\\
Then $\Int_\R J=I$ and $\Cl_\R J=K$ and
$\Int_{\R^2}J^2=I^2$ and $\Cl_{\R^2}J^2=K^2$.\\
\end{thm}

\begin{thm}
Let $X$ be a metric space and let $A\subseteq X$.
Then:\\
\phx\qquad\qquad $[\,\,\Int_XA\subseteq A\subseteq\Cl_XA\,\,]$ \qquad $\&$\\
\phx\qquad\qquad $[\,\,\Int_X(\Int_XA)=\Int_XA\,\,]$ \qquad $\&$\\
\phx\qquad\qquad $[\,\,\Cl_X(\Cl_XA)=\Cl_XA\,\,]$ \qquad $\&$\\
\phx\qquad\qquad $[\,\,\Int_X(X\backslash A)=X\backslash(\Cl_XA)\,\,] $ \qquad $\&$\\
\phx\qquad\qquad $[\,\,\Cl_X(X\backslash A)=X\backslash(\Int_XA)\,\,] $.
\end{thm}

\begin{defn}\wrlab{defn-open-closed-subseteq-MS}
Let $X$ be a metric space and let $A\subseteq X$.\\
By $A$ is \bfindex[open] in $X$, we mean: $\Int_XA=A$.\\
By $A$ is \bfindex[closed] in $X$, we mean: $\Cl_XA=A$.
\end{defn}

In \dref{defn-open-closed-subseteq-MS},
when $X$ is clear, we omit ``in $X$''.

\begin{defn}\wrlab{defn-top-topcomplements}
Let $X$ be a metric space.\\
\phx\qquad\qquad
Then $\scrt_X:=\{U\subseteq X\,|\,U\hbox{ is open in }X\}$.\\
\phx\qquad\qquad
Also, $\scrt'_X:=\{C\subseteq X\,|\,C\hbox{ is closed in }X\}$.
\end{defn}

In \dref{defn-top-topcomplements},
$\scrt_X$ is called the \bfindex[topology] on $X$.

The following theorem gives quantified equivalences
for open and closed subsets of a metric space.

\begin{thm}
Let $X$ be a metric space and let $A\subseteq X$.\\
Then: $(A\in\scrt_X)\Leftrightarrow(\forall p\in A,\exists B\in\scrb_X(p)~\hbox{s.t.}~B\subseteq A)$.\\
Also: $(A\in\scrt'_X)\Leftrightarrow(\forall s\in A^\N,\forall p\in X,[(s_\bullet\to p\hbox{ in }X)\Rightarrow(p\in A)])$.
\end{thm}

\begin{thm}\wrlab{thm-eg1-open-closed-sets}
Let $A:=(-1;1)$, $B:=(-1;\infty)$,\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $C:=[-1;1]$, $D:=[-1;\infty)$.\\
Then $A,B\in\scrt_\R$ and $C,D\in\scrt'_\R$ and $A^2,B^2\in\scrt_{\R^2}$ and $C^2,D^2\in\scrt'_{\R^2}$.
\end{thm}

Recall: $\R^*=\R\cup\{-\infty,\infty\}$.
Define a function $f:(-1;1)\to\R$ by $f(x)=x/\sqrt{1-x^2}$.
Then $f$ is a homeomorphism from $(-1;1)$ onto $\R$.
Let $g:=\adj_{-1}^{-\infty}(\adj_1^\infty(f))$.
Then $g:[-1,1]\hookrightarrow>\R^*$.
Define $d_*\in\scrm(\R^*)$ by $d_*(p,q)=d_\R(g^{-1}(p),g^{-1}(q))$.
Then, for example, $d_*(-\infty,\infty)=d_\R(-1,1)=|(-1)-1|=2$.
It may seem strange that $-\infty$ should be a finite distance from $\infty$,
and, in fact, we will call $d_*$ the \bfindex[weirdo metric] on $\R^*$.
There are other metrics on $\R^*$, but for any ``reasonable'' $d\in\scrm(\R^*)$,
we have: $\scrt_{(\R^*,d)}=\scrt_{(\R^*,d_*)}$.
So, while there is no ``standard'' metric on $\R^*$,
we do have a standard topology on $\R^*$.
By \tref{thm-eg1-open-closed-sets}, $D\in\scrt'_\R$.
That is, $[-1;\infty)$ is closed in $\R$.
In fact, the closure $\Cl_\R B$ in $\R$ of $(-1;\infty)$ is $[-1;\infty)$.
It is {\it NOT} equal to $[-1;\infty]$.
This may seem strange, but keep in mind that, since $\infty\notin\R$,
we cannot have $\infty\in\Cl_\R B$.
The set $[-1;\infty)$ is ``as closed as it can be'', within $\R$.
Working in $(\R^*,d_*)$, things are very different.
In~fact, the closure $\Cl_{(\R^*,d_*)}B$ in $(\R^*,d_*)$ of $(-1;\infty)$ is equal to $[-1;\infty]$.

We drew a few amoeba-like subsets of $\R^2$ and discussed their interiors and closures.
Some were bounded, some unbounded.
We discussed open amoeba-like subsets of $\R^2$, both bounded and unbounded.
We discussed closed amoeba-like subsets of $\R^2$, both bounded and unbounded.

We noted that many subsets of $\R^2$ contain part, but not all, of their boundaries;
such sets are neither open nor closed.
It can also happen that a set is {\it both} open and closed:

\begin{defn}
Let $X$ be a metric space and let $A\subseteq X$.\\
Then $A$ is \bfindex[clopen] in $X$ means: \quad $A\,\,\in\,\,\scrt'_X\cap\scrt_X$.
\end{defn}

\begin{thm}
Let $X$ be a metric space.\\
\phx\qquad\qquad\qquad\qquad\quad Then: \quad $\emptyset\,,\,X\,\,\in\,\,\scrt'_X\cap\scrt_X$.
\end{thm}

\begin{thm}
Let $X:=[1;2]\cup[3;4]$.\\
Then $[1;2]\in\scrt'_X\cap\scrt_X$. \qquad
Also, $[3;4]\in\scrt'_X\cap\scrt_X$. \qquad
\end{thm}

\begin{defn}
Let $X$ be a metric space.\\
Then $X$ is \bfindex[connected] means:
$\scrt'_X\cap\scrt_X=\{\emptyset,X\}$.
\end{defn}

That is, a topological space is connected iff it has no clopen sets except for the obvious ones.

\begin{thm}\wrlab{thm-some-connectedness-results}
All of the following are true:\\
\phx\qquad\qquad (1) \quad $\R$ and $\R^2$ are both connected.\\
\phx\qquad\qquad (2) \quad  $[1;2]\cup[3;4]$ is not connected.\\
\phx\qquad\qquad (3) \quad  $\forall a\in\R$, $\R_a^\times$ is not connected.\\
\phx\qquad\qquad (4) \quad  $\forall v\in\R^2$, $(\R^2)_v^\times$ is connected.
\end{thm}

\begin{thm}
$\R$ and $\R^2$ are not homeomorphic.
\end{thm}

\begin{proof}
Assume that $\R$ and $\R^2$ are homeomorphic.\\
Want: Contradiction.\\
Choose $f$ such that $f$ is a homeomorphism from $\R$ onto $\R^2$.\\
Let $A:=\R_0^\times$. \qquad
Let $B:=(\R^2)_{f(0)}^\times$.\\
Then $f|A$ is a homeomorphism from $A$ onto $B$.\\
By (4) of \tref{thm-some-connectedness-results}, $B$ is connected.\\
So, since $A$ and $B$ are homeomorphic, $A$ is connected.\\
By (3) of \tref{thm-some-connectedness-results}, $A$ is not connected. \qquad
Contradiction.
\end{proof}

Thus connectedness becomes a topological tool for distinguishing between the Euclidean spaces $\R$ and $\R^2$.
There is another tool called ``simple connectedness'' that is used to distinguish between $\R^2$ and $\R^3$.
There are many other tools, but topology is not the focus of our course,
so we return to basics.

\begin{thm}
Let $X$ be a metric space and let $A\subseteq X$.\\
Then: $(\,\,A\in\scrt_X\,\,)\,\,\Leftrightarrow\,\,(\,\,X\backslash A\in\scrt'_X\,\,)$.\\
Also: $(\,\,A\in\scrt'_X\,\,)\,\,\Leftrightarrow\,\,(\,\,X\backslash A\in\scrt_X\,\,)$.
\end{thm}

That is, a set is open iff its complement is closed, and a set is closed iff its complement is open.
In any metric space, singletons are closed:

\begin{thm}\wrlab{thm-singletons-closed}
Let $X$ be a metric space and let $p\in X$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\{x\}\in\scrt'_X$.
\end{thm}

\begin{thm}
Let $a,b\in\R$. \qquad
Then $[a;b]\in\scrt'_\R$.
\end{thm}

\begin{proof}
Let $C:=[a;b]$. \qquad
Want: $C\in\scrt'_\R$.\\
Want: $\forall s\in C^\N$, $\forall p\in\R$,
$[\,\,(\,\,s_\bullet\to p\hbox{ in }\R\,\,)\,\,\Rightarrow\,\,(\,\,p\in C\,\,)\,\,]$.\\
Given $s\in C^\N$, $p\in\R$. \qquad
Want: $(\,\,s_\bullet\to p\hbox{ in }\R\,\,)\,\,\Rightarrow\,\,(\,\,p\in C\,\,)$.\\
Assume: $s_\bullet\to p\hbox{ in }\R$. \qquad
Want: $p\in C$.\\
Since $s\in C^\N=[a;b]^\N$, we conclude: $\forall j\in\N$, $a\le s_j\le b$.\\
So, since $s_\bullet\to p$, by HW\#8-4 and by unassigned HW, $a\le p\le b$.\\
Then $p\in[a;b]=C$, as desired.
\end{proof}

\begin{thm}
Let $a\in\R$. \qquad
Then $[a;\infty)\in\scrt'_\R$.
\end{thm}

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

\begin{thm}
Let $b\in\R$. \qquad
Then $(-\infty;b]\in\scrt'_\R$.
\end{thm}

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

Our only remaining goal is to show that $[-1;1]$ and $S_{\R^2}(0_2,1)$ are both compact.
We can now break this up into various subgoals:\\
\phantom{xxx} (A) $[-1,1]$ is closed and bounded in $\R$.\\
\phantom{xxx} (B) $S_{\R^2}(0_2,1)$ is closed and bounded in $\R^2$.\\
\phantom{xxx} (C) For any subset of a metric space,\\
\phantom{xxx}\qquad\qquad\qquad\qquad ( compact ) implies ( closed and bounded ).\\
\phantom{xxx} (D) For any subset of a {\it proper} metric space,\\
\phantom{xxx}\qquad\qquad\qquad\qquad ( closed and bounded ) implies  ( compact ).\\
\phantom{xxx} (E) $\R$ and $\R^2$ are both proper.\\
By (C), (D) and (E), we see that\\
\phx\qquad\qquad a subset of $\R$ is compact iff it is closed and bounded.\\
By (C), (D) and (E), we also see that\\
\phx\qquad\qquad a subset of $\R^2$ is compact iff it is closed and bounded.\\
Then, by (A) and (B), $[-1;1]$ and $S_{\R^2}(0_2,1)$ are both compact.\\
We next work on these five subgoals, (A) to (E).

\section{Subgoals (A)-(D)}

\begin{thm}\wrlab{thm-contin-implies-preim-closed-is-closed}
Let $X$ and $Y$ be metric spaces and let $f:X\to Y$.\\
Assume: $f$ is continuous from $X$ to $Y$.
Then: $\forall C\in\scrt'_Y,\,f^*(C)\in\scrt'_X$.
\end{thm}

\begin{proof}
Given $C\in\scrt'_Y$. \qquad
Want: $f^*(C)\in\scrt'_X$.\\
Let $A:=f^*(C)$. \qquad
Want: $A\in\scrt'_X$.\\
Want: $\forall s\in A^\N,\,\,\forall p\in X,\,\,[\,\,(\,\,s_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,p\in A\,\,)\,\,]$\\
Given $s\in A^\N,\,\,p\in X$. \qquad
Want: $(\,\,s_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,p\in A\,\,)$\\
Assume $s_\bullet\to p$ in $X$. \qquad
Want: $p\in A$.\\
Let $t:=f\circ s$ and let $q:=f(p)$.\\
Since $f$ is continuous at $p$ from $X$ to $Y$ and since $s_\bullet\to p$ in $X$,\\
\phx\qquad we conclude that $t_\bullet\to q$ in $Y$.\\
\\
{\it Claim 1:} $t\in C^\N$.\\
{\it Proof of Claim 1:}\\
Want: $\dom[t]=\N$ and $\im[t]\subseteq C$.\\
Since $A\subseteq X$, we get $A^\N\subseteq X^\N$.\\
We have $s\in A^\N\subseteq X^\N$, so $s:\N\to X$.\\
Since $s:\N\to X$ and $f:X\to Y$, we see that $t:\N\to Y$.\\
Then $\dom[t]=\N$. \qquad
Want: $\im[t]\subseteq C$.\\
Want: $\forall z\in\im[t],\,z\in C$.\\
Given $z\in\im[t]$. \qquad
Want: $z\in C$.\\
Since $z\in\im[t]$, choose $j\in\N$ s.t.~$z=t_j$.\\
Since $s\in A^\N$, we have $\im[s]\subseteq A$.\\
Then $s_j\in\im[s]\subseteq A=f^*(C)$, and so $f(s_j)\in C$.\\
Then $z=t_j=(f\circ s)_j=f(s_j)\in C$, as desired.\\
{\it End of proof of Claim 1.}\\
\\
Since $t\in C^\N$, since $t_\bullet\to q$ in $Y$ and since $C\in\scrt'_Y$,\\
\phx\qquad\qquad we conclude that $q\in C$.\\
Since $f(p)=q\in C$, we get $p\in f^*(C)$.\\
Then $p\in f^*(C)=A$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-preim-closed-is-closed-implies-contin}
Let $X$ and $Y$ be metric spaces and let $f:X\to Y$.\\
Assume: $\forall C\in\scrt'_Y,\,f^*(C)\in\scrt'_X$.
Then: $f$ is continuous from $X$ to $Y$.\\
\end{thm}

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

By \tref{thm-contin-implies-preim-closed-is-closed} and \tref{thm-preim-closed-is-closed-implies-contin},
a function is continuous iff\\
\phx\qquad\qquad\qquad\qquad the preimage of any closed set is closed.

\begin{thm}\wrlab{thm-contin-implies-preim-open-is-open}
Let $X$ and $Y$ be metric spaces and let $f:X\to Y$.\\
Assume: $f$ is continuous from $X$ to $Y$.
Then: $\forall U\in\scrt_Y,\,f^*(U)\in\scrt_X$.
\end{thm}

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

\begin{thm}\wrlab{thm-preim-open-is-open-implies-contin}
Let $X$ and $Y$ be metric spaces and let $f:X\to Y$.\\
Assume: $\forall U\in\scrt_Y,\,f^*(U)\in\scrt_X$.
Then: $f$ is continuous from $X$ to $Y$.\\
\end{thm}

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

By \tref{thm-contin-implies-preim-open-is-open} and \tref{thm-preim-open-is-open-implies-contin},
a function is continuous iff\\
\phx\qquad\qquad\qquad\qquad the preimage of any open set is open.

It may seem strange that, in\\
\phx\qquad\quad \tref{thm-contin-implies-preim-closed-is-closed}, \tref{thm-preim-closed-is-closed-implies-contin},\\
\phx\qquad\quad \tref{thm-contin-implies-preim-open-is-open} and \tref{thm-preim-open-is-open-implies-contin},\\
preimages are so important by contrast with forward images.
Part of~the explanation is that, {\it generally},\\
\phx\qquad\quad points want to go forward,\\
\phx\qquad\quad sets want to go backward \qquad\qquad and\\
\phx\qquad\quad sequences want to go forward.\\
Other mathematical objects have a similar propensity to move in one direction or another,
and the astute learner will start to track which ones want to do what.
Looking at open sets and closed sets, following this philosophy,
it makes sense that preimages come up a lot.
However, one does sometimes study maps such that the forward image of a closed set is closed,
or such that the forward image of an open set is open:

\begin{defn}
Let $X$ and $Y$ be metric spaces and $f:X\to Y$.\\
By $f$ is a \bfindex[closed mapping] from $X$ to $Y$, we mean:\\
\phx\qquad\qquad\qquad $\forall C\in\scrt'_X$, \quad $f_*(C)\in\scrt'_Y$.\\
By $f$ is an \bfindex[open mapping] from $X$ to $Y$, we mean:\\
\phx\qquad\qquad\qquad $\forall U\in\scrt_X$, \quad $f_*(U)\in\scrt_Y$.
\end{defn}

\begin{thm}\wrlab{thm-sum-squares-contin}
Let $f:\R^2\to\R$ be defined by $f(x,y)=x^2+y^2$.\\
Then $f$ is continuous from $\R^2$ to $\R$.
\end{thm}

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

We leave subgoal (A) as an unassigned exercise.
For subgoal (B), because $S_{\R^2}(0_2,1)\subseteq B_{\R^2}(0_2,2)$,
it follows that $S_{\R^2}(0_2,1)$ is bounded in $\R^2$.
To finish subgoal (B), we need only show:

\begin{thm}
$S_{\R^2}(0_2,1)\in\scrt'_{\R^2}$.
\end{thm}

\begin{proof}
Let $A:=S_{\R^2}(0_2,1)$. \qquad
Want: $A\in\scrt'_{\R^2}$.\\
Define $f:\R^2\to\R$ by $f(x,y)=x^2+y^2$. \qquad
Then $A=f^*(\{1\})$.\\
Also, by \tref{thm-sum-squares-contin}, we see that $f$ is continuous from $\R^2$ to $\R$.\\
By \tref{thm-singletons-closed}, we conclude that $\{1\}\in\scrt'_\R$.\\
So, since $f$ is continuous from $\R^2$ to $\R$,\\
\phx\qquad\qquad by \tref{thm-contin-implies-preim-closed-is-closed}, we get: $f^*(\{1\})\in\scrt'_{\R^2}$.\\
Then $A=f^*(\{1\})\in\scrt'_{\R^2}$, as desired.
\end{proof}

To do subgoal (C), we must show that any compact subset of a metric space is closed and bounded.
By HW\#10-5, any compact subset of a metric space is bounded.
The following shows that it's also closed:

\begin{thm}\wrlab{thm-cpt-implies-closed}
Let $X$ be a metric space and let $C\subseteq X$.\\
Assume that $C$ is compact. \qquad
Then $C\in\scrt'_X$.
\end{thm}

\begin{proof}
Want: $\forall s\in C^\N,\,\,\forall p\in X,\,\,[\,\,(\,\,s_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,p\in C\,\,)\,\,]$.\\
Given $s\in C^\N,\,\,p\in X$. \qquad
Want: $(\,\,s_\bullet\to p\hbox{ in }X\,\,)\,\,\Rightarrow\,\,(\,\,p\in C\,\,)$.\\
Assume $s_\bullet\to p\hbox{ in }X$. \qquad
Want: $p\in C$.\\
Since $C$ is compact and $s\in C^\N$, we get: $s$ is subconvergent in $C$.\\
Choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $C$.\\
Choose $q\in C$ s.t.~$t_\bullet\to q$ in $C$. \qquad\qquad
Then $t_\bullet\to q$ in $X$.\\
Since $s_\bullet\to p$ in $X$ and since $t$ is a subsequence of $s$,\\
\phx\qquad it follows, from \tref{thm-subseq-has-same-limit}, that $t_\bullet\to p$ in $X$.\\
Since $t_\bullet\to p$ in $X$ and $t_\bullet\to q$ in $X$,\\
\phx\qquad it follows, from \tref{thm-uniqueness-of-limit}, that $p=q$.\\
Then $p=q\in C$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-conv-in-subspace-implies-conv-in-ambient}
Let $X$ be a topological space, $A\subseteq X$ and $t\in A^\N$.\\
Then: $(\,t\hbox{ is convergent in }A\,)\,\Rightarrow\,(\,t\hbox{ is convergent in }X\,)$.
\end{thm}

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

\begin{thm}\wrlab{thm-subconv-in-subspace-implies-subconv-in-ambient}
Let $X$ be a topological space, $A\subseteq X$ and $s\in A^\N$.\\
Then: $(\,s\hbox{ is subconvergent in }A\,)\,\Rightarrow\,(\,s\hbox{ is subconvergent in }X\,)$.
\end{thm}

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

\begin{thm}\wrlab{thm-conv-in-ambient-implies-conv-in-closed-subspace}
Let $X$ be a topological space, $A\in\scrt'_X$ and $t\in A^\N$.\\
Then: $(\,t\hbox{ is convergent in }A\,)\,\Leftrightarrow\,(\,t\hbox{ is convergent in }X\,)$.
\end{thm}

\begin{proof}
By \tref{thm-conv-in-subspace-implies-conv-in-ambient}, we have:\\
\phx\qquad $(\,t\hbox{ is convergent in }A\,)\,\Rightarrow\,(\,t\hbox{ is convergent in }X\,)$.\\
Want: $(\,t\hbox{ is convergent in }X\,)\,\Rightarrow\,(\,t\hbox{ is convergent in }A\,)$.\\
Assume: $t$ is convergent in $X$. \qquad
Want: $t$ is convergent in $A$.\\
Choose $p\in X$ s.t.~$t_\bullet\to p$ in $X$.\\
Since $A\in\scrt'_X$ and $t\in A^\N$ and $t_\bullet\to p$ in $X$,
it follows that $p\in A$.\\
Since $t_\bullet\to p$ in $X$, since $t\in A^\N$ and since $p\in A$,\\
\phx\qquad it follows that $t_\bullet\to p$ in $A$.\\
Then $t$ is convergent in $A$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-subconv-in-ambient-implies-subconv-in-closed-subspace}
Let $X$ be a topological space, $A\in\scrt'_X$ and $s\in A^\N$.\\
Then: $(\,s\hbox{ is subconvergent in }A\,)\,\Leftrightarrow\,(\,s\hbox{ is subconvergent in }X\,)$.
\end{thm}

\begin{proof}
By \tref{thm-subconv-in-subspace-implies-subconv-in-ambient}, we have:\\
\phx\qquad $(\,s\hbox{ is subconvergent in }A\,)\,\Rightarrow\,(\,s\hbox{ is subconvergent in }X\,)$.\\
Want: $(\,s\hbox{ is subconvergent in }X\,)\,\Rightarrow\,(\,s\hbox{ is subconvergent in }A\,)$.\\
Assume: $s$ is subconvergent in $X$. \qquad
Want: $s$ is subconvergent in $A$.\\
Choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
Then, by $\Leftarrow$ of \tref{thm-conv-in-ambient-implies-conv-in-closed-subspace}, we see that $t$ is convergent in $A$.\\
So, since $t$ is a subsequence of $s$, $s$ is subconvergent in $A$, as desired.
\end{proof}

We now finish subgoal (D):

\begin{thm}
Let $X$ be a proper metric space and let $A\subseteq X$.\\
Assume: $(\,A\in\scrt'_X\,)\,\&\,(\,A\hbox{ is bounded in }X\,)$. \qquad
Then $A$ is compact.
\end{thm}

\begin{proof}
Want: $\forall s\in A^\N$, $s$ is subconvergent in $A$.\\
Given $s\in A^\N$. \qquad
Want: $s$ is subconvergent in $A$.\\
Since $\im[s]\subseteq A$ and since $A$ is bounded in $X$,\\
\phx\qquad we conclude that $\im[s]$ is bounded in $X$.\\
Then $s$ is bounded in $X$.\\
So, since $X$ is a proper metric space, $s$ is subconvergent in $X$.\\
By $\Leftarrow$ of \tref{thm-subconv-in-ambient-implies-subconv-in-closed-subspace},
$s$ is subconvergent in $A$, as desired.
\end{proof}

Our only remaining subgoal:\\
\phantom{xxx} (E) $\R$ and $\R^2$ are both proper.\\
This is addressed in \secref{sect-proper-complete-line} and \secref{sect-proper-complete-plane}.

\section{Properness and completeness of the line}\wrlab{sect-proper-complete-line}

\begin{thm}\wrlab{thm-le1elt-quant-equiv}
Let $S$ be a set.
Then:\\
\phx\qquad\qquad\qquad $(\,\,\#S\le1\,\,)\,\,\Leftrightarrow\,\,(\,\,\forall x,y\in S,\,\,x=y\,\,)$.
\end{thm}

\begin{thm}
Let $A\subseteq\R^*$.
Then $\#(A\cap[\LB(A)])\le1$
\end{thm}

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

\begin{proof}
Let $S:=A\cap[\LB(A)]$. \qquad
Want: $\#S\le1$.\\
By \tref{thm-le1elt-quant-equiv},
want: $\forall x,y\in S$, $x=y$.\\
Given $x,y\in S$. \qquad
Want: $x=y$.\\
Since $S=A\cap[\LB(A)]$, we get: $S\subseteq A$ and $S\subseteq\LB(A)$.\\
Since $x\in S\subseteq\LB(A)$, it follows that $x\le A$, so $A\ge x$.\\
Then $y\in S\subseteq A\ge x$, so $y\ge x$. \qquad
Want: $x\ge y$.\\
Since $y\in S\subseteq\LB(A)$, it follows that $y\le A$, so $A\ge y$.\\
Then $x\in S\subseteq A\ge y$, so $x\ge y$, as desired.
\end{proof}

\begin{thm}
$\forall$set $S$, $\forall x$,\\
\phx\qquad\qquad $[\,(\,\#S=1\,)\,\&\,(\,x\in S\,)\,]\Rightarrow[\,\UE(S)=x\,]$.
\end{thm}

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

\begin{thm}\wrlab{thm-closed-bdd-above-implies-has-max}
Let $A\subseteq\R$.
\qquad Assume:\\
\phx\qquad $(\,A\ne\emptyset\,)\,\&\,(\,A\hbox{ is closed in }\R\,)\,\&\,(\,A\hbox{ is bounded above in }\R\,)$.\\
Then $\max A\ne\frownie$.
\end{thm}

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

\begin{thm}\wrlab{thm-closed-bdd-below-implies-has-min}
Let $A\subseteq\R$.
\qquad Assume:\\
\phx\qquad $(\,A\ne\emptyset\,)\,\&\,(\,A\hbox{ is closed in }\R\,)\,\&\,(\,A\hbox{ is bounded below in }\R\,)$.\\
Then $\min A\ne\frownie$.
\end{thm}

\begin{proof}
Let $B:=-A$. \quad
Then $\min A=-(\max B)$. \qquad
Also,\\
\phantom{xxx} $(\,B\ne\emptyset\,)\,\&\,(\,B\hbox{ is closed in }\R\,)\,\&\,(\,B\hbox{ is bounded above in }\R\,)$,\\
so, by \tref{thm-closed-bdd-above-implies-has-max}, we see that $\max B\ne\frownie$.\\
Then $\max B\in B\subseteq\R$, so $-(\max B)\in\R$, so $-(\max B)\ne\frownie$.\\
Then $\min A=-(\max B)\ne\frownie$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-cpt-implies-has-max-min}
Let $A\subseteq\R$.
Assume: $(\,A\ne\emptyset\,)\,\&\,(\,A\hbox{ is compact}\,)$.\\
Then $\min A\ne\frownie\ne\max A$.
\end{thm}

\begin{proof}
By HW\#10-5, $A$ is bounded.\\
By \tref{thm-cpt-implies-closed}, $A\in\scrt'_\R$, so $A$ is closed in $\R$.\\
Then, by \tref{thm-closed-bdd-below-implies-has-min} and \tref{thm-closed-bdd-above-implies-has-max},
$\min A\ne\frownie\ne\max A$.
\end{proof}

We consider sequences in metric spaces:\\
\phantom{xxxx} According to HW\#6-4, convergent implies bounded.\\
\phantom{xxxx} According to HW\#9-5, convergent implies Cauchy.\\
\phantom{xxxx} According to HW\#11-4, Cauchy implies bounded.\\
So, HW\#9-5 and HW\#11-4, together, prove HW\#6-4.

Observe that, in the metric space $\Q$, Cauchy does not imply convergent:
Let $s:=(1,1.4,1.41,1.414,\ldots)$ be the sequence of decimal approximations to $\sqrt{2}$.
Then $s$ is Cauchy, but not convergent.

Observe that, in the metric space $\R$, bounded does not imply Cauchy:
The sequence $(-1,1,-1,1,-1,1,\ldots)$ is bounded, but not Cauchy.

\begin{defn}
Let $f:\R\drta\R$.\\
Then $f$ is \bfindex[strictly monotone] means:\\
\phx\qquad\qquad\qquad $(\,f\hbox{ is strictly increasing}\,)\,\vee\,(\,f\hbox{ is strictly decreasing}\,)$.\\
Also, $f$ is \bfindex[semi-monotone] means:\\
\phx\qquad\qquad\qquad $(\,f\hbox{ is semi-increasing}\,)\,\vee\,(\,f\hbox{ is semi-decreasing}\,)$.
\end{defn}

\begin{thm}\wrlab{thm-semiincr-bdd-above-implies-conv}
Let $a\in\R^\N$.\\
\phx\qquad Assume: $a$ is semi-increasing and bounded above in $\R$.\\
\phx\qquad Then: $a$ is convergent in $\R$.
\end{thm}

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

\begin{thm}\wrlab{thm-semidecr-bdd-below-implies-conv}
Let $a\in\R^\N$.\\
\phx\qquad Assume: $a$ is semi-decreasing and bounded below in $\R$.\\
\phx\qquad Then: $a$ is convergent in $\R$.
\end{thm}

\begin{proof}
Let $b:=-a$.
Then $a=-b$. \qquad
Want: $b$ is convergent in $\R$.\\
Since $b$ is semi-increasing and bounded above in $\R$,\\
it follows, from \tref{thm-semiincr-bdd-above-implies-conv}, that $b$ is convergent in $\R$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-semimonot-bdd-implies-conv}
Let $a\in\R^\N$.\\
\phx\qquad Assume: $a$ is semi-monotone and bounded in $\R$.\\
\phx\qquad Then: $a$ is convergent in $\R$.
\end{thm}

\begin{proof}
Since $a$ is semi-monotone, we know that at least one of the following is true:\\
\phantom{xxxx} (1) $a$ is semi-decreasing \qquad\qquad\qquad or\\
\phantom{xxxx} (2) $a$ is semi-increasing.\\
\\
{\it Case (1):}
Since $a$ is bounded, it follows that $a$ is bounded below.\\
Since $a$ is semi-decreasing and bounded below, by \tref{thm-semidecr-bdd-below-implies-conv},\\
$a$ is convergent, as desired.\\
{\it End of Case (1).}
\\
{\it Case (2):}
Since $a$ is bounded, it follows that $a$ is bounded above.\\
Since $a$ is semi-increasing and bounded above, by \tref{thm-semidecr-bdd-below-implies-conv},\\
$a$ is convergent, as desired.\\
{\it End of Case (2).}
\end{proof}

The next theorem is fundamental to the area of dynamical systems.

\begin{thm}
Let $X$ be a set, let $f:X\to X$ and let $z\in X$.\\
\phx\qquad\qquad\qquad\qquad\quad Then: \quad $\forall j\in\N_0$, \quad $f_\circ^j(z)\in X$.
\end{thm}

\begin{proof}
Unassigned HW. ({\it Hint:} Use induction on $j$.)
\end{proof}

\begin{thm}\wrlab{thm-over-max-implies-notin}
Let $P\subseteq\N$ and let $m:=\max(P_0^+)$.\\
Assume $m\ne\frownie$. \qquad
Then $\forall j\in(m..\infty)$, $j\notin P$.
\end{thm}

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

\begin{thm}\wrlab{thm-in-R-every-seq-has-semimonot-ssq}
Let $s\in\R^\N$.\\
\phx\qquad\qquad\qquad Then $\exists$subsequence $t$ of $s$ s.t.~$t$ is semi-monontone.
\end{thm}

\begin{proof}
Let $P:=\{j\in\N\,|\,\forall q\in(j..\infty),\,s_j\ge s_q\}$.\\
Then one of the following is true:\\
\phantom{xxxx} (1) $P$ is finite \qquad\qquad\qquad or\\
\phantom{xxxx} (2) $P$ is infinite.\\
\\
{\bf Case (1):}\\
Since $P\subseteq\N$, it follows that $P_0^+\subseteq\N_0$.\\
Since $P$ is finite, it follows that $P_0^+$ is finite.\\
Since $P_0^+\subseteq\R$ and since $P_0^+$ is finite, we get $\max(P_0^+)\in P_0^+$.\\
Let $m:=\max(P_0^+)$. \qquad
Then $m\in P_0^+$.\\
Then $m\in P_0^+\subseteq\N_0$, so $m\in\N_0$.\qquad
Also $m\ne\frownie$.\\
Define $A:\N\to2^\N$ by $A_j:=\{q\in(j..\infty)\,|\,s_j<s_q\}$.\\
Define $f:(m..\infty)\drta(m..\infty)$ by $f(j)=\min A_j$.\\
\\
{\it Claim A:} $\forall j\in(m..\infty)$, $f(j)\in A_j$.\\
{\it Proof of Claim A:}\\
Given $j\in(m..\infty)$. \qquad
Want: $f(j)\in A_j$.\\
By \tref{thm-over-max-implies-notin}, $j\notin P$.\\
Then, by definition of $P$, we get: $\neg(\forall q\in(j..\infty),\,s_j\ge s_q)$.\\
Then $\exists q\in(j..\infty)$ s.t.~$s_j<s_q$.
Choose $q\in(j..\infty)$ s.t.~$s_j<s_q$.\\
Then $q\in A_j$, so $A_j\ne\emptyset$.\\
So, since $A_j\subseteq\N$ and since $\N$ is well-ordered,\\
\phx\qquad we conclude that $\min A_j\ne\frownie$, and so $\min A_j\in A_j$.\\
Then $f(j)=\min A_j\in A_j$, as desired.\\
{\it End of proof of Claim A.}\\
\\
We have $f:(m..\infty)\drta(m..\infty)$.\\
Also, by Claim A, $\forall j\in(m..\infty)$, $f(j)\ne\frownie$.\\
Then $f:(m..\infty)\to(m..\infty$.\\
Then: $\forall j\in\N$, $f_\circ^j(m+1)\in(m..\infty)\subseteq\N$.\\
Define $\ell\in\N^\N$ by $\ell_j=f_\circ^j(m+1)$.\\
\\
{\it Claim B:} $\ell$ is strictly increasing.\\
{\it Proof of Claim B:}\\
Want: $\forall j\in\N$, $\ell_j<\ell_{j+1}$.\\
Given $j\in\N$. \qquad
Want: $\ell_j<\ell_{j+1}$.\\
Let $k:=\ell_j$. \qquad
Want: $k<\ell_{j+1}$.\\
We have $f(k)=f(\ell_j)=f(f_\circ^j(m+1))=f_\circ^{j+1}(m+1)=\ell_{j+1}$.\\
By Claim A, we have $f(k)\in A_k$.\\
Also, by defininition of $A$, we have $A_k\subseteq(k..\infty)$.\\
Then $\ell_{j+1}=f(k)\in A_k\subseteq(k..\infty)>k$.\\
Then $\ell_{j+1}>k$, so $k<\ell_{j+1}$, as desired.\\
{\it End of proof of Claim B.}\\
\\
Let $t:=s\circ\ell$.\\
By Claim B, $t$ is a subsequence of $s$.\\
Want: $t$ is semi-monotone. \qquad
Want: $t$ is strictly increasing.\\
Want: $\forall j\in\N$, $t_j<t_{j+1}$. \qquad
Given $j\in\N$. \qquad
Want: $t_j<t_{j+1}$.\\
Let $k:=\ell_j$. \qquad
By Claim A, we have $f(k)\in A_k$.\\
Let $q:=f(k)$. \qquad
Then $q\in A_k$.\\
So, by definition of $A$, we get $s_k<s_q$.\\
We have $q=f(k)=f(\ell_j)=f(f_\circ^j(m+1))=f_\circ^{j+1}(m+1)=\ell_{j+1}$.\\
Then $t_j=(s\circ\ell)_j=s_{\ell_j}=s_k<s_q=s_{\ell_{j+1}}=(s\circ\ell)_{j+1}=t_{j+1}$.\\
{\bf End of Case (1).}\\
\\
{\bf Case (2):}\\
Define $A:\N\to2^\N$ by $A_j=P\cap(j..\infty)$.\\
Define $f:\N\drta\N$ by $f(j)=\min A_j$.\\
\\
{\it Claim C:} $\forall j\in\N$, $f(j)\in A_j$.\\
{\it Proof of Claim C:}\\
Given $j\in\N$. \qquad
Want: $f(j)\in A_j$.\\
Since $P$ is infinite and $[1..j]$ is finite,\\
\phantom{xxxxx} we conclude that $P\not\subseteq[1..j]$.\\
So, since $P\subseteq\N=[1..\infty)$, we get $P\cap(j..\infty)\ne\emptyset$.\\
Then $A_j=P\cap(j..\infty)\ne\emptyset$.\\
So, since $A_j\subseteq\N$ and since $\N$ is well-ordered,\\
\phx\qquad we conclude that $\min A_j\ne\frownie$, and so $\min A_j\in A_j$.\\
Then $f(j)=\min A_j\in A_j$, as desired.\\
{\it End of proof of Claim C.}\\
\\
We have $f:\N\drta\N$.\\
Also, by Claim C, $\forall j\in(m..\infty)$, $f(j)\ne\frownie$.\\
Then $f:\N\to\N$.\\
Then: $\forall j\in\N$, $f_\circ^j(1)\in\N$.\\
Define $\ell\in\N^\N$ by $\ell_j=f_\circ^j(1)$.\\
\\
{\it Claim D:} $\ell$ is strictly increasing.\\
{\it Proof of Claim D:}\\
Want: $\forall j\in\N$, $\ell_j<\ell_{j+1}$.\\
Given $j\in\N$. \qquad
Want: $\ell_j<\ell_{j+1}$.\\
Let $k:=\ell_j$. \qquad
Want: $k<\ell_{j+1}$.\\
We have $f(k)=f(\ell_j)=f(f_\circ^j(m+1))=f_\circ^{j+1}(m+1)=\ell_{j+1}$.\\
By Claim C, we have $f(k)\in A_k$.\\
Also, by defininition of $A$, we have $A_k\subseteq(k..\infty)$.\\
Then $\ell_{j+1}=f(k)\in A_k\subseteq(k..\infty)>k$.\\
Then $\ell_{j+1}>k$, so $k<\ell_{j+1}$, as desired.\\
{\it End of proof of Claim D.}\\
\\
Let $t:=s\circ\ell$.\\
By Claim D, $t$ is a subsequence of $s$.\\
Want: $t$ is semi-monotone. \qquad
Want: $t$ is semi-decreasing.\\
Want: $\forall j\in\N$, $t_j\ge t_{j+1}$. \qquad
Given $j\in\N$. \qquad
Want: $t_j\ge t_{j+1}$.\\
Let $k:=\ell_j$ and let $i:=f_\circ^{j-1}(1)$.\\
Then $k=\ell_j=f_\circ^j(1)=f(f_\circ^{j-1}(1))=f(i)$.\\
By Claim C, $f(i)\in A_i$.\\
Then $k=f(i)\in A_i=P\cap(i..\infty)\subseteq P$, \qquad so $k\in P$.\\
Let $q:=f(k)$.
Then $q=f(k)=f(\ell_j)=f(f_\circ^j(1))=f_\circ^{j+1}(1)=\ell_{j+1}$.\\
By Claim D, $\ell_{j+1}>\ell_j$. \qquad
Then $q=\ell_{j+1}>\ell_j=k$, so $q\in(k..\infty)$.\\
So, since $k\in P$, by definition of $P$, we get: $s_k\ge s_q$.\\
Then $t_j=(s\circ\ell)_j=s_{\ell_j}=s_k\ge s_q=s_{\ell_{j+1}}=(s\circ\ell)_{j+1}=t_{j+1}$.\\
{\bf End of Case (2).}
\end{proof}

\begin{thm}\wrlab{thm-composition-image-in-image-of-second}
$\forall$functions $f$ and $g$, $\im[g\circ f]\subseteq\im[g]$.
\end{thm}

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

\begin{thm}\wrlab{thm-ssq-has-smaller-image}
$\forall$sequence $s$, $\forall$subsequence $t$ of $s$, $\im[t]\subseteq\im[s]$.
\end{thm}

\begin{proof}
Given a sequence $s$ and a subsequence $t$ of $s$.\\
Want: $\im[t]\subseteq\im[s]$.\\
Since $t$ is a subsequence of $s$,\\
\phx\qquad\qquad choose a strictly increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
By \tref{thm-composition-image-in-image-of-second},
$\im[s\circ\ell]\subseteq\im[s]$.\\
Then $\im[t]=\im[s\circ\ell]\subseteq\im[s]$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-ssq-bdd-is-bdd}
Let $X$ be a metric space and let $s,t\in X^\N$.\\
Assume: $(\,t\hbox{ is a subsequence of }s\,)\,\&\,(\,s\hbox{ is bounded in }X\,)$.\\
Then $t$ is bounded in $X$.
\end{thm}

\begin{proof}
Since $s$ is bounded in $X$, we get: $\im[s]$ is bounded in $X$.\\
Then choose $B\in\scrb_X$ s.t.~$\im[s]\subseteq B$.\\
By \tref{thm-ssq-has-smaller-image}, $\im[t]\subseteq\im[s]$.\\
Then $\im[t]\subseteq\im[s]\subseteq B$, so $\im[t]\subseteq B$.\\
So, since $B\in\scrb_X$, we conclude that $\im[t]$ is bounded in $X$.\\
Then $t$ is bounded in $X$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-R-is-proper}
$\R$ is a proper metric space.
\end{thm}

\begin{proof}
Want: $\forall$ bounded $s\in\R^\N$, $s$ is subconvergent in $\R$.\\
Given a bounded $s\in\R^\N$. \qquad
Want: $s$ is subconvergent in $\R$.\\
By \tref{thm-in-R-every-seq-has-semimonot-ssq}, choose a subsequence $t$ of $s$ s.t.~$t$ is semi-monotone.\\
Since $s$ is bounded in $\R$ and $t$ is a subsequence of $s$,\\
\phx\qquad it follows, from \tref{thm-ssq-bdd-is-bdd}, that $t$ is bounded in $\R$.\\
Since $t$ is semi-monotone and bounded in $\R$, by \tref{thm-semimonot-bdd-implies-conv},\\
\phx\qquad we conclude that $t$ is convergent in $\R$.\\
So, since $t$ is a subsequence of $s$,\\
\phx\qquad we see that $s$ is subconvergent in $\R$, as desired.
\end{proof}

\begin{defn}
Let $X$ be a metric space, $S\subseteq X$, $\varepsilon>0$.
Then\\
\phx\qquad\qquad $N_X^\varepsilon(S)\quad:=\quad\{\,\,z\in X\,\,|\,\,\exists y\in S~\hbox{s.t.}~d_X(y,z)\,<\,\varepsilon\,\,\}$\\
is called the {\bf$\varepsilon$-neighborhood} of $S$\index[terms]{neighborhood of a set}.
\end{defn}

We drew a coordinate plane with a short curve $S$, picked a small distance $\varepsilon$ and drew the
$\varepsilon$-neighborhood of $S$.

\begin{thm}
Let $X$ be a metric space, $S\subseteq X$, $\varepsilon>0$.\\
Then $N_X^\varepsilon(S)\subseteq X$.
\end{thm}

\begin{thm}
Let $X$ be a metric space, $S,T\subseteq X$, $\delta,\varepsilon>0$.\\
Assume $S\subseteq T$ and $\delta\le\varepsilon$.\\
Then $N_X^\delta(S)\subseteq N_X^\varepsilon(T)$.
\end{thm}

\begin{defn}
Let $X$ be a metric space, $S\subseteq X$, $\varepsilon>0$.\\
By $S$ is $\varepsilon$-\bfindex[dense] in $X$, we mean: $N_X^\varepsilon(S)=X$.
\end{defn}

We noted that $\Z$ is almost $1/2$-dense in $\R$, but not quite.
In fact, we have: $\forall a>1/2$, $\Z$ is $a$-dense in $\R$.
Therefore: $\Z$ is $1$-dense in $\R$.
Similarly, $(1/2)\cdot\Z$ is $(1/2)$-dense in $\R$.
Generally:

\begin{thm}\wrlab{thm-epsilon-density-examples}
$\forall j\in\N$, $(1/j)\cdot\Z$ is $(1/j)$-dense in $\R$.
\end{thm}

\begin{thm}\wrlab{thm-Q-is-epsilon-dense}
$\forall\varepsilon>0$, $\Q$ is $\varepsilon$-dense in $\R$.
\end{thm}

\begin{proof}
Given $\varepsilon>0$. \quad
Want: $\Q$ is $\varepsilon$-dense in $\R$. \quad
Want: $N_\R^\varepsilon(\Q)=\R$.\\
Since $N_\R^\varepsilon(\Q)\subseteq\R$, we want: $\R\subseteq N_\R^\varepsilon(\Q)$.\\
By the Archimedean Principle, choose $j\in\N$ s.t.~$j>1/\varepsilon$.\\
Since $j>1/\varepsilon>0$, we get $1/j<\varepsilon$.\\
So, since $(1/j)\cdot\Z\subseteq\Q$, we get $N_\R^{1/j}((1/j)\cdot\Z)\subseteq N_\R^\varepsilon(\Q)$.\\
By \tref{thm-epsilon-density-examples}, we have $N_\R^{1/j}((1/j)\cdot\Z)=\R$.\\
Then $\R=N_\R^{1/j}((1/j)\cdot\Z)\subseteq N_\R^\varepsilon(\Q)$, as desired.
\end{proof}

\begin{defn}
Let $X$ be a metric space and let $S\subseteq X$.\\
By $S$ is \bfindex[dense] in $X$, we mean: $\Cl_XS=X$. 
\end{defn}

\begin{thm}\wrlab{thm-ellepsilon-dense-implies-dense}
Let $X$ be a metric space and let $S\subseteq X$.\\
Assume: $\forall\varepsilon>0$, $S$ is $\varepsilon$-dense in $X$.\\
Then: $S$ is dense in $X$.
\end{thm}

\begin{proof}
This is HW\#12-1.
\end{proof}

\begin{thm}\wrlab{thm-Q-dense-in-R}
$\Q$ is dense in $\R$.
\end{thm}

\begin{proof}
By \tref{thm-Q-is-epsilon-dense}, $\forall\varepsilon>0$, $\Q$ is $\varepsilon$-dense in $\R$.\\
Then, by \tref{thm-ellepsilon-dense-implies-dense}, $\Q$ is dense in $\R$.
\end{proof}

\begin{defn}
Let $X$ be a metric space.\\
By $X$ is \bfindex[complete], we mean: $\forall s\in X^\N$,\\
\phx\qquad\qquad $(\,s\hbox{ is Cauchy in }X\,)\,\Rightarrow\,(\,s\hbox{ is convergent in }X\,)$.
\end{defn}

By HW\#9-5, we know, for {\it ANY} metric space $X$, for any $s\in X^\N$,
\phx\qquad\qquad $(\,s\hbox{ is convergent in }X\,)\,\Rightarrow\,(\,s\hbox{ is Cauchy in }X\,)$.

A metric space that is not proper is said to be \bfindex[nonproper].

A metric space that is not complete is said to be \bfindex[incomplete].

The intuition behind completeness: Complete means ``has no holes'', or,
equivalently, incomplete means ``has holes''.

For example, define $X:=\R_0^\times$.
Then the ``hole'' at~$0$
allows us to~construct Cauchy sequences in $X$ that are not convergent in~$X$.
For example, the sequence\\
\phx\qquad\qquad $(\,\,1\,\,,\,\,1/2\,\,,\,\,1/3\,\,,\,\,1/4\,\,,\,\,\ldots\,\,)$\\
is Cauchy in $X$,
but is not convergent in $X$.
Consequently, $X$ is an incomplete metric space.
The sequence\\
\phx\qquad\qquad $(\,\,1\,\,,\,\,1.4\,\,,\,\,1.41\,\,,\,\,1.414\,\,,\,\,\ldots\,\,)$\\
of decimal approximations to $\sqrt{2}$ is Cauchy in $\Q$, but not convergent in $\Q$.
Consequently, $\Q$ is an incomplete metric space.
Speaking intuitively, $X$ is only slightly incomplete, because there is only one hole.
By contrast, $\Q$ is ``very'' incomplete, with a hole at every irrational.

\begin{thm}\wrlab{thm-Rpunct-Q-both-imcomplete}
$\R_0^\times$ and $\Q$ are both incomplete.
\end{thm}

\begin{proof}
Let $s:=(1,1/2,1/3,\ldots)$.\\
Then $s$ is Cauchy in $\R_0^\times$, but not convergent in $\R_0^\times$,\\
\phx\qquad\qquad so $\R_0^\times$ is incomplete. \qquad\qquad
Want: $\Q$ is incomplete.\\
Let $\sigma:=(1,1.4,1.41,\ldots)$ denote the sequence\\
\phx\qquad\qquad of decimal approximations to $\sqrt{2}$.\\
Then $\sigma$ is Cauchy in $\Q$, but not convergent in $\Q$,\\
\phx\qquad\qquad so $\Q$ is incomplete, as desired.
\end{proof}

For any metric space $X$, we can ``fill in all the holes'',
and obtain a~complete metric space $\barX$:

\begin{thm}\wrlab{thm-completion}
Let $X$ be a metric space.\\
Then there exists a metric space $\barX$ s.t.\\
\phx\qquad $(\,\,\barX\hbox{ is complete }\,\,)$ $\&$
$(\,\,X_{\hbox{\rm set}}\,\subseteq\barX_{\hbox{\rm set}}\,\,)$ $\&$
$(\,\,X_{\hbox{\rm set}}\hbox{ is dense in }\barX\,\,)$.
\end{thm}

\begin{proof}
Omitted.
\end{proof}

\begin{thm}\wrlab{thm-proper-implies-complete}
Let $X$ be a proper metric space.\\
Then $X$ is complete.
\end{thm}

\begin{proof}
Want: $\forall s\in X^\N$,\\
\phx\qquad\qquad $(\,s\hbox{ is Cauchy in }X\,)\,\Rightarrow\,(\,s\hbox{ is convergent in }X\,)$.\\
Given $s\in X^\N$.
Want: $(\,s\hbox{ is Cauchy in }X\,)\,\Rightarrow\,(\,s\hbox{ is convergent in }X\,)$.\\
Assume $s$ is Cauchy in $X$. \qquad
Want: $s$ is convergent in $X$.\\
Since $s$ is Cauchy in $X$, by HW\#11-4, we get: $s$ is bounded in $X$.\\
So, since $X$ is proper, we see that $s$ is subconvergent in $X$.\\
So, since $s$ is Cauchy in $X$, by HW\#11-5,\\
\phx\qquad\qquad we conclude that $s$ is convergent in $X$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-R-complete}
$\R$ is a complete metric space.
\end{thm}

\begin{proof}
By \tref{thm-R-is-proper}, $\R$ is proper.\\
Then, by \tref{thm-proper-implies-complete}, $\R$ is complete, as desired.
\end{proof}

\begin{thm}
$\R_0^\times$ and $\Q$ are nonproper metric spaces.
\end{thm}

\begin{proof}
By \tref{thm-Rpunct-Q-both-imcomplete}, $\R_0^\times$ and $\Q$ are both incomplete.\\
Then, by \tref{thm-proper-implies-complete}, $\R_0^\times$ and $\Q$ are both nonproper, as desired.
\end{proof}

By \tref{thm-proper-implies-complete}, proper implies complete.
In the next section, we address why the converse fails.

\section{Complete does not imply proper}

By \tref{thm-completion}, any metric space $X$ has a ``completion'' $\barX$.
For example, one completion of $\R_0^\times$ is $\R$.
Intuitively, we have ``filled in the hole at $0$'' to go from $\R_0^\times$ to $\R$.
For another example, one completion of $\Q$ is $\R$.
Intuitively, we have ``filled in the all holes at all of the irrationals'' to go from $\Q$ to $\R$.
In some sense, a metric space with holes is unnatural and,
if we encounter such an object, we simply ignore it, and focus on one of its completions.

With experience as my guide, any natural finite dimensional metric space
should not just be complete, but proper.
For example, the metric spaces $\R$ and $\R^2$ are both proper.
On the other hand, with experience as my guide,
any natural infinite dimensional metric space is nonproper.
Based on this, since we seek a metric space that is complete but nonproper,
we should look for some ``natural'' infinite dimensional metric space.
This works, and there are many examples,
but the problem is that, in an undergraduate course,
it is typical only to look at finite dimenional examples,
and to leave infinite dimensions to a graduate course in
an area of mathematics called ``Functional Analysis''.

We therefore turn to ``unnatural'' finite dimensional metric spaces.
We will describe a metric space called $\R_{\le1}$, and,
in \tref{thm-Rle1-complete-nonpr} below, we will argue that
$\R_{\le1}$ is complete an nonproper.

Recall that the underlying set of a metric space $X$ is denoted $X_{\hbox{\rm set}}$.
We typically omit the subscript ``set'', but sometimes keep it:

\begin{defn}
Let $X$ be a metric space.\\
Define $d\in\scrm(X_{\hbox{\rm set}})$ by $d(p,q)=\min\{d(p,q),1\}$.\\
Then $X_{\le1}:=(X_{\hbox{\rm set}},d)$.
\end{defn}

\begin{thm}
Let $Y:=\R_{\le1}$.\\
Then $d_Y(2.7,2.8)=0.1$ and $d_Y(3,5000)=1$.
\end{thm}

\begin{thm}
Let $X$ be a metric space, $Y:=X_{\le1}$ and $p\in Y$.\\
Then $B_Y(p,2)=Y$.
\end{thm}

\begin{thm}
Let $X$ be a nonempty metric space, $Y:=X_{\le1}$.\\
Then $Y$ is geometrically bounded.
\end{thm}

\begin{thm}
Let $X$ be a metric space, $Y:=X_{\le1}$, $s\in Y^\N$.\\
Then $s$ is bounded.
\end{thm}

\begin{thm}
Let $X$ be a metric space and let $s\in X^\N$.\\
Then: $(\,s\hbox{ is subconvergent in }X\,)\,\Leftrightarrow\,(\,s\hbox{ is subconvergent in }X_{\le1}\,)$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}\\
Assume: $s\hbox{ is subconvergent in }X$.
Want: $s\hbox{ is subconvergent in }X_{\le1}$.\\
Since $s\hbox{ is subconvergent in }X$,\\
\phx\qquad\qquad choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
Then, by $\Rightarrow$ of HW\#12-3, we see that $t$ is convergent in $X_{\le1}$.\\
So, since $t$ is a subsequence of $s$,\\
\phx\qquad\qquad we see that $s$ is subconvergent in $X_{\le1}$, as desired.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume: $s\hbox{ is subconvergent in }X_{\le1}$.
Want: $s\hbox{ is subconvergent in }X$.\\
Since $s\hbox{ is subconvergent in }X_{\le1}$,\\
\phx\qquad\qquad choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X_{\le1}$.\\
Then, by $\Leftarrow$ of HW\#12-3, we see that $t$ is convergent in $X$.\\
So, since $t$ is a subsequence of $s$,\\
\phx\qquad\qquad we see that $s$ is subconvergent in $X$, as desired.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{thm}\wrlab{thm-Rle1-complete-nonpr}
$\R_{\le1}$ is complete and nonproper.
\end{thm}

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

\section{Properness and completeness of the plane}\wrlab{sect-proper-complete-plane}

\begin{thm}\wrlab{thm-ssq-of-ssq-is-ssq}
Let $s$, $t$ and $u$ be sequences.\\
Assume that $s$ is a subsequence of $t$ and that $t$ is a subsequence of $u$.\\
Then $s$ is a subsequence of $u$.
\end{thm}

\begin{proof}
Since $s$ is a subsequence of $t$,\\
\phx\qquad\qquad choose a strictly increasing $\ell\in\N^\N$ s.t.~$s=t\circ\ell$.\\
Since $t$ is a subsequence of $u$,\\
\phx\qquad\qquad choose a strictly increasing $m\in\N^\N$ s.t.~$t=u\circ m$.\\
Then $s=t\circ\ell=u\circ m\circ\ell$.\\
Since $\ell,m\in\N^\N$, we see that $m\circ\ell\in\N^\N$.\\
Since $\ell$ and $m$ are strictly increasing,\\
\phx\qquad\qquad we see that $m\circ\ell$ is strictly increasing.\\
So, since $s=u\circ m\circ\ell$,\\
\phx\qquad\qquad we conclude that $s$ is a subsequence of $u$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-ssq-subconv-implies-seq-subconv}
Let $X$ be a metric space and let $\sigma,s\in X^\N$.\\
Assume that $\sigma$ is a subsequence of $s$ and that $\sigma$ is subconvergent in $X$.\\
Then $s$ is subconvergent in $X$.
\end{thm}

\begin{proof}
Since $\sigma$ is subconvergent in $X$,\\
\phx\qquad\qquad choose a subsequence $t$ of $\sigma$ s.t.~$t$ is convergent in $X$.\\
Since $t$ is a subsequence of $\sigma$ and since $\sigma$ is a subsequence of $s$,\\
\phx\qquad\qquad by \tref{thm-ssq-of-ssq-is-ssq}, $t$ is a subsequence of $s$.\\
So, since $t$ is convergent in $X$,\\
\phx\qquad\qquad we conclude that $s$ is subconvergent in $X$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-go-straight-to-ell}
Let $X$ be a metric space and let $s\in X^\N$.\\
Assume that $s$ is subconvergent in $X$.\\
Then $\exists$strictly increasing $\ell\in\N^\N$ s.t.~$s\circ\ell$ is convergent in $X$.
\end{thm}

\begin{proof}
Since $s$ is subconvergent in $X$,\\
\phx\qquad\qquad choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
Since $t$ is a subsequence of $s$,\\
\phx\qquad\qquad choose a strictly increasing $\ell\in\N^\N$ s.t.~$t=s\circ\ell$.\\
Want: $s\circ\ell$ is convergent in $X$.\\
Since $t$ is convergent in $X$ and since $t=s\circ\ell$,\\
\phx\qquad\qquad we conclude that $s\circ\ell$ is convergent in $X$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-ssq-bdd-is-bdd-redux}
Let $X$ be a metric space and let $s\in X^\N$.\\
Let $t$ be a subsequence of $s$.\\
Assume: $s$ is bounded in $X$.\\
Then: $t$ is bounded in $X$.
\end{thm}

\begin{proof}
This is \tref{thm-ssq-bdd-is-bdd}.
\end{proof}

\begin{thm}\wrlab{thm-ssq-conv-is-conv}
Let $X$ be a metric space and let $s\in X^\N$.\\
Let $t$ be a subsequence of $s$.\\
Assume: $s$ is convergent in $X$.\\
Then: $t$ is convergent in $X$.
\end{thm}

\begin{proof}
Since $s$ is convergent in $X$, choose $p\in X$ s.t.~$s_\bullet\to p$ in $X$.\\
Then, by \tref{thm-subseq-has-same-limit}, we have: $t_\bullet\to p$ in $X$.\\
Then $t$ is convergent in $X$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-bdd-R2-iff-components-bdd}
Let $s\in(\R^2)^\N$.\\
Define $p,q:\R^2\to\R$ by $p(x,y)=x$ and $q(x,y)=y$.\\
Then: $[\,\,(\,\,s\hbox{ is bounded in }\R^2\,\,)\,\,\Leftrightarrow$\\
\phx\qquad\qquad\qquad$\,\,(\,\,p\circ s\hbox{ and }q\circ s\hbox{ are both bounded in }\R\,\,)\,\,]$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}\\
Unassigned HW.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume that $p\circ s\hbox{ and }q\circ s\hbox{ are both bounded in }\R$.\\
Want: $s\hbox{ is bounded in }\R^2$. \qquad
Want: $\im[s]\hbox{ is bounded in }\R^2$.\\
Want: $\exists C\in\scrb_{\R^2}$ s.t. $\im[s]\subseteq C$.\\
Since $p\circ s\hbox{ and }q\circ s\hbox{ are both bounded in }\R$,\\
\phx\qquad $\im[p\circ s]$ and $\im[q\circ s]$ are both bounded in $\R$,\\
\phx\qquad so choose $A,B\in\scrb_\R$ s.t.~$\im[p\circ s]\subseteq A$ and $\im[q\circ s]\subseteq B$.\\
Since $A\in\scrb_\R$, choose $a\in\R$ and $\alpha>0$ s.t.~$A=B_\R(a,\alpha)$.\\
Since $B\in\scrb_\R$, choose $b\in\R$ and $\beta>0$ s.t.~$B=B_\R(b,\beta)$.\\
Let $c:=(a,b)$ and let $\gamma:=\sqrt{\alpha^2+\beta^2}$.\\
Let $C:=B_{\R^2}(c,\gamma)$. \qquad
Then $C\in\scrb_{\R^2}$.\\
Want: $\im[s]\subseteq C$. \qquad
Want: $\forall z\in\im[s]$, $z\in C$.\\
Given $z\in\im[s]$. \qquad
Want: $z\in C$.\\
Choose $x,y\in\R$ s.t.~$z=(x,y)$. \qquad
Then $p(z)=x$ and $q(z)=y$.\\
Since $z\in\im[s]$, choose $j\in\N$ s.t.~$z=s_j$.\\
Then $(p\circ s)_j=p(s_j)=p(z)=x$ and $(q\circ s)_j=q(s_j)=q(z)=y$.\\
Then $x=(p\circ s)_j\in\im[p\circ s]\subseteq A=B_\R(a,\alpha)$, so $d_\R(x,a)<\alpha$.\\
Also, $y=(q\circ s)_j\in\im[q\circ s]\subseteq B=B_\R(b,\beta)$, so $d_\R(y,b)<\beta$.\\
Then $|x-a|=d_\R(x,a)<\alpha$ and $|y-b|=d_\R(y,b)<\beta$.\\
Then $0\le|x-a|<\alpha$ and $0\le|y-b|<\beta$,\\
\phx\qquad\qquad so $|x-a|^2<\alpha^2$ and $|y-b|^2<\beta^2$.\\
We have $|x-a|^2=|(x-a)^2|=(x-a)^2$\\
\phantom{xx}\quad and $|y-b|^2=|(y-b)^2|=(y-b)^2$.\\
Then $(x-a)^2+(y-b)^2=|x-a|^2+|y-b|^2<\alpha^2+\beta^2$.\\
Since $0<(x-a)^2+(y-b)^2<\alpha^2+\beta^2$,\\
\phx\qquad\qquad we get: $\sqrt{(x-a)^2+(y-b)^2}<\sqrt{\alpha^2+\beta^2}$.\\
Then $d_{\R^2}(z,c))=|z-c|_2=|(x-a,y-b)|_2$\\
\phx\qquad\qquad $=\sqrt{(x-a)^2+(y-b)^2}<\sqrt{\alpha^2+\beta^2}=\gamma$.\\
Then $z\in B_{\R^2}(c,\gamma)=C$, as desired.
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{thm}\wrlab{thm-conv-R2-iff-components-conv}
Let $s\in(\R^2)^\N$.\\
Define $p,q:\R^2\to\R$ by $p(x,y)=x$ and $q(x,y)=y$.\\
Then: $[\,\,(\,\,s\hbox{ is convergent in }\R^2\,\,)\,\,\Leftrightarrow$\\
\phx\qquad\qquad\qquad$\,\,(\,\,p\circ s\hbox{ and }q\circ s\hbox{ are both convergent in }\R\,\,)\,\,]$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}\\
Unassigned HW.\\
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
This is \tref{thm-each-converges-implies-pair-converges}.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{thm}\wrlab{thm-R2-is-proper}
$\R^2$ is a proper metric space.
\end{thm}

\begin{proof}
Want: $\forall s\in(\R^2)^\N$,\\
\phx\qquad\qquad $(\,s\hbox{ is bounded in }\R^2\,)\,\Rightarrow\,(\,s\hbox{ is subconvergent in }\R^2\,)$.\\
Given $s\in(\R^2)^\N$.\\
Want: $(\,s\hbox{ is bounded in }\R^2\,)\,\Rightarrow\,(\,s\hbox{ is subconvergent in }\R^2\,)$.\\
Assume $s$ is bounded in $\R^2$. \qquad
Want: $s$ is subconvergent in $\R^2$.\\
By \tref{thm-R-is-proper}, $\R$ is proper.\\
Define $p,q:\R^2\to\R$ by $p(x,y)=x$ and $q(x,y)=y$.\\
Since $s$ is bounded in $\R^2$, by $\Rightarrow$ of \tref{thm-bdd-R2-iff-components-bdd},\\
\phx\qquad\qquad $p\circ s$ and $q\circ s$ are both bounded in $\R$.\\
Since $p\circ s$ is bounded in $\R$ and since $\R$ is proper,\\
\phx\qquad\qquad $p\circ s$ is subconvergent in $\R$.\\
Then, by \tref{thm-go-straight-to-ell}, choose a strictly increasing $\ell\in\N^\N$\\
\phx\qquad\qquad s.t.~$p\circ s\circ\ell$ is convergent in $\R$.\\
Let $\sigma:=s\circ\ell$. \qquad
Then $p\circ\sigma$ is convergent in $\R$.\\
Since $\sigma$ is a subsequence of $s$ and since $s$ is bounded in $\R^2$,\\
\phx\qquad\qquad by \tref{thm-ssq-bdd-is-bdd}, $\sigma$ is bounded in $\R^2$.\\
By \tref{thm-ssq-subconv-implies-seq-subconv}, it suffices to show: $\sigma$ is subconvergent in $\R^2$.\\
Since $\sigma$ is bounded in $\R^2$, by $\Rightarrow$ of \tref{thm-bdd-R2-iff-components-bdd},\\
\phx\qquad\qquad $p\circ\sigma$ and $q\circ\sigma$ are both bounded in $\R$.\\
Since $q\circ\sigma$ is bounded in $\R$ and since $\R$ is proper,\\
\phx\qquad\qquad $q\circ\sigma$ is subconvergent in $\R$.\\
Then, by \tref{thm-go-straight-to-ell}, choose a strictly increasing $m\in\N^\N$\\
\phx\qquad\qquad s.t.~$q\circ\sigma\circ m$ is convergent in $\R$.\\
Since $p\circ\sigma$ is convergent in $\R$\\
\phx\qquad\qquad and since $p\circ\sigma\circ m$ is a subsequence of $p\circ\sigma$,\\
it follows, from \tref{thm-ssq-conv-is-conv}, that $p\circ\sigma\circ m$ is convergent in $\R$.\\
Since $p\circ\sigma\circ m$ and $q\circ\sigma\circ m$ are both convergent in $\R$,\\
\phx\qquad\qquad by $\Leftarrow$ of \tref{thm-conv-R2-iff-components-conv}, $\sigma\circ m$ is convergent in $\R^2$.\\
So, since $\sigma\circ m$ is a subsequence of $\sigma$,\\
\phx\qquad\qquad we see that $\sigma$ is subconvergent in $\R^2$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-R2-is-complete}
$\R^2$ is a complete metric space.
\end{thm}

\begin{proof}
By \tref{thm-R2-is-proper}, $\R^2$ is proper.\\
Then, by \tref{thm-proper-implies-complete}, $\R^2$ is complete, as desired.
\end{proof}

\begin{thm}\wrlab{thm-Rm-is-proper}
$\forall m\in\N$, $\R^m$ is a proper metric space.
\end{thm}

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

\section{The Extreme Value Theorem}

\begin{defn}\wrlab{defn-max-min-fn}
$\forall$functional $f$,\\
\phx\qquad\qquad $\max f:=\max(\im[f])$ \quad and \quad $\min f:=\min(\im[f])$.
\end{defn}

\tref{thm-EVT}, below, is the \bfindex[Extreme Value Theorem].

\begin{thm}\wrlab{thm-EVT}
Let $X$ be a nonempty compact metric space.\\
Let $f:X\to\R$. \qquad
Assume $f$ is continuous from $X$ to $\R$.\\
Then $\min f\ne\frownie\ne\max f$.
\end{thm}

\begin{proof}
Let $A:=\im[f]$. \qquad
Want: $\min A\ne\frownie\ne\max A$.\\
By HW\#12-2, we see that $f$ is continuous from $X$ to $A$.\\
So, since $X$ is compact and since $f:X\to>A$,\\
\phx\qquad by \tref{thm-contin-im-cpt-is-cpt},
we conclude: $A$ is compact.\\
Since $X\ne\emptyset$ and $f:X\to A$, we get:
$A\ne\emptyset$.\\
Then, by \tref{thm-cpt-implies-has-max-min},
$\min A\ne\frownie\ne\max A$, as desired.
\end{proof}

\section{The Topological Inverse Function Theorem}

\begin{thm}\wrlab{thm-conv-in-space-iff-conv-in-closed-subspace}
Let $X$ be a metric space, $C\in\scrt'_X$ and $t\in\C^\N$.\\
Assume that $t$ is convergent in $X$.\\
Then $t$ is convergent in $C$.
\end{thm}

\begin{proof}
Since $t$ is convergent in $X$,
choose $q\in X$ s.t.~$t_\bullet\to q$ in $X$.\\
Since $t\in C^\N$, since $t_\bullet\to q$ in $X$ and since $C\in\scrt'_X$,\\
\phx\qquad it follows that $q\in C$.\\
Then, by \tref{thm-approaches-in-ambient-implies-approaches-in-subsp},
$t_\bullet\to q$ in $C$.\\
Then $t$ is convergent in $C$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-subconv-in-space-iff-subconv-in-closed-subspace}
Let $X$ be a metric space, $C\in\scrt'_X$ and $s\in\C^\N$.\\
Assume that $s$ is subconvergent in $X$.\\
Then $s$ is subconvergent in $C$.
\end{thm}

\begin{proof}
Since $s$ is subconvergent in $X$,\\
\phx\qquad choose a subsequence $t$ of $s$ s.t.~$t$ is convergent in $X$.\\
By \tref{thm-conv-in-space-iff-conv-in-closed-subspace},
$t$ is convergent in $C$.\\
So, since $t$ is a subsequence of $s$,\\
\phx\qquad we conclude that $s$ is subconvergent in $C$.
\end{proof}

\begin{thm}\wrlab{thm-closed-in-cpt-is-cpt}
Let $X$ be a compact metric space and let $C\in\scrt'_X$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $C$ is compact.
\end{thm}

\begin{proof}
Want: $\forall s\in C^\N$, $s$ is subconvergent in $C$.\\
Given $s\in C^\N$. \qquad
Want: $s$ is subconvergent in $C$.\\
Since $C\in\scrt'_X$, we get $C\subseteq X$, and so $C^\N\subseteq X^\N$.\\
Since $s\in C^\N\subseteq X^\N$ and since $X$ is compact,\\
\phx\qquad $s$ is subconvergent in $X$.\\
So, since $C\in\scrt'_X$, by \tref{thm-subconv-in-space-iff-subconv-in-closed-subspace},\\
\phx\qquad we see that $s$ is subconvergent in $C$.
\end{proof}

\begin{thm}\wrlab{thm-restr-maintains-continuity-ewh}
Let $X$ and $Y$ be metric spaces.\\
Let \quad $f:X\to Y$, \quad $S\subseteq X$, \quad $A:=f_*(S)$.\\
Assume that $f$ is continuous from $X$ to $Y$.\\
Then $f|S$ is continuous from $S$ to $A$.
\end{thm}

\begin{proof}
Since $\im[f|S]=f_*(S)=A$, by HW\#12-2,\\
\phx\qquad it suffices to show: $f|S$ is continuous from $S$ to $Y$.\\
Want: $\forall p\in S$, $f|S$ is continuous at $p$ from $S$ to $Y$.\\
Since $f$ is continuous from $X$ to $Y$,\\
\phx\qquad it follows that $f$ is continuous at $p$ from $X$ to $Y$.\\
Then, by \tref{thm-restr-maintains-continuity},
$f$ is continuous at $p$ from $S$ to $Y$.
\end{proof}

\begin{thm}\wrlab{thm-contin-im-cpt-subset-is-cpt}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\to Y$ and let $C\subseteq X$.\\
Assume that $f$ is continuous from $X$ to $Y$.\\
Assume that $C$ is compact. \qquad
Then $f_*(C)$ is compact.
\end{thm}

\begin{proof}
Let $A:=f_*(C)$. $\,\,$
Then $f|C:C\to>A$. $\,\,$
Want: $A$ is compact.\\
By \tref{thm-restr-maintains-continuity-ewh}, $f|C$ is continuous from $C$ to $A$.\\
So, since $C$ is compact, by \tref{thm-contin-im-cpt-is-cpt}, $A$ is compact.
\end{proof}

\begin{thm}\wrlab{thm-im-is-preim-under-inverse}
Let $X$ and $Y$ be sets and let $S\subseteq X$.\\
Let $f:X\hookrightarrow>Y$. \qquad
Then $f_*(S)=(f^{-1})^*(S)$.
\end{thm}

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

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

\begin{thm}\wrlab{thm-preim-is-im-under-inverse}
Let $X$ and $Y$ be sets and let $S\subseteq Y$.\\
Let $f:X\hookrightarrow>Y$. \qquad
Then $f^*(S)=(f^{-1})_*(S)$.
\end{thm}

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

\begin{thm}\wrlab{thm-eg-contin-bij-not-homeom}
Let $X:=[1;2]\cup(3;4]$ and $Y:=[5;7]$.\\
Define $f:X\to Y$ by $\ds{f(x)=\begin{cases}x+4,&\hbox{if }1\le x\le2\\x+3,&\hbox{if }3<x\le4.\end{cases}}$\\
Then $f:X\hookrightarrow>Y$ and $f$ is continuous from $X$ to $Y$.\\
Also, $f^{-1}$ is not continuous at $6$ from $Y$ to $X$.
\end{thm}

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

\tref{thm-eg-contin-bij-not-homeom} presents us with a problem.
Frequently, we will be given a bijection $f$ between metric spaces,
and suppose we want to show that $f$ is a homeomorphism.
Say $f$ is given by some formula for $f(x)$ in terms of $x$.
By using continuity of basic functions, together with properties of continuity,
we can often verify continuity of $f$.
However, in order to see continuity of $f^{-1}$,
we would need to compute a formula for $f^{-1}(y)$ in terms of $y$, which may be very difficult.

For example, define $f:[1;2]\to[2;10]$ by $f(x)=x+x^3$.
Then it is possible to show that $f$ is a bijection from $[1;2]$ onto $[2;10]$.
Also, it is not hard to show that $f$ is continuous from $[1;2]$ to $[2;10]$.
However, there is no obvious formula for $f^{-1}(y)$ in terms of $y$.
Even computing $f^{-1}(5)$ involves solving $x+x^3=5$ for $x$, which is difficult.
However, the next theorem guarantees that $f^{-1}$ is continuous from $[2;10]$ to $[1;2]$.

The next theorem is the \bfindex[Topological Inverse Function Theorem].

\begin{thm}\wrlab{thm-top-IFT-cpt-dom}
Let $X$ and $Y$ be metric spaces.
Let $f:X\hookrightarrow>Y$.\\
Assume: \quad $f$ is continuous from $X$ to $Y$ \quad and \quad $X$ is compact.\\
Then: \quad $f^{-1}$ is continuous from $Y$ to $X$.
\end{thm}

\begin{proof}
By \tref{thm-preim-closed-is-closed-implies-contin},
we want: $\forall C\in\scrt'_X$, $(f^{-1})^*(C)\in\scrt'_Y$.\\
Given $C\in\scrt'_X$. \qquad
Want: $(f^{-1})^*(C)\in\scrt'_Y$.\\
By \tref{thm-im-is-preim-under-inverse}, $f_*(C)=(f^{-1})^*(C)$. \quad
Want: $f_*(C)\in\scrt'_Y$.\\
Since $X$ is compact and $C\in\scrt'_X$, by \tref{thm-closed-in-cpt-is-cpt},\\
\phx\qquad we see that $C$ is compact.\\
Then, by \tref{thm-contin-im-cpt-subset-is-cpt}, $f_*(C)$ is compact.\\
Then, by \tref{thm-cpt-implies-closed}, $f_*(C)\in\scrt'_Y$, as desired.
\end{proof}

\section{Limits of functions}

\begin{defn}
Let $Y$ be a metric space, $p\in Y$ and $r>0$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $B_Y^\times(p,r):=[B_Y(p,r)]_p^\times$.
\end{defn}

\begin{defn}
Let $Y$ be a metric space and let $p\in Y$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $\scrb_Y^\times(p):=\{B_Y^\times(p,r)\,|\,r>0\}$.
\end{defn}

\begin{defn}
Let $Y$ be a metric space and let $p\in Y$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $\scrb_Y^\times:=\{B_Y^\times(p,r)\,|\,p\in Y,\,r>0\}$.
\end{defn}

\begin{defn}\wrlab{defn-lim-fn}
Let $Y$ and $Z$ be metric spaces.\\
Let $f:Y\drta Z$, let $p\in Y$ and let $q\in Z$.\\
Then $f\to q$ near $p$ from $Y$ to $Z$ means:\\
\phx\qquad $\adj_p^q\,f$ is continuous at $p$ from $Y$ to $Z$.
\end{defn}

\begin{thm}
Let $Y$ and $Z$ be metric spaces.\\
Let $f:Y\drta Z$ and let $p\in Y$.\\
Then: $[\,f\hbox{ is continuous at }p\hbox{ from }\dom[f]\hbox{ to }Z\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall\varepsilon>0,\,\exists\delta>0~\hbox{s.t.},\,\forall x\in\dom[f],$\\
\phx\qquad\qquad\qquad $(\,d_Y(x,p)<\delta\,)\,\Rightarrow\,(\,d_Z(f(x),f(p))<\varepsilon\,)\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall B\in\scrb_Z(f(p)),\,\exists A\in\scrb_Y(p)~\hbox{s.t.}~f_*(A)\subseteq B,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall s\in(\dom[f])^\N,\,(\,[\,s_\bullet\to p\hbox{ in }Y\,]\,\Rightarrow\,[\,(f\circ s)_\bullet\to f(p)\hbox{ in }Z\,]\,)\,]$.
\end{thm}

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

\begin{thm}\wrlab{thm-quant-equiv-for-limit-fn}
Let $Y$ and $Z$ be metric spaces.\\
Let $f:Y\drta Z$, let $p\in Y$ and let $q\in Z$.\\
Then: $[\,f\to q\hbox{ near }p\hbox{ from }Y\hbox{ to }Z\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall\varepsilon>0,\,\exists\delta>0~\hbox{s.t.},\,\forall x\in\dom[f],$\\
\phx\qquad\qquad\qquad $(\,0<d_Y(x,p)<\delta\,)\,\Rightarrow\,(\,d_Z(f(x),q)<\varepsilon\,)\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall B\in\scrb_Z(q),\,\exists A\in\scrb_Y^\times(p)~\hbox{s.t.}~f_*(A)\subseteq B,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall s\in((\dom[f])_p^\times)^\N,\,(\,[\,s_\bullet\to p\hbox{ in }Y\,]\,\Rightarrow\,[\,(f\circ s)_\bullet\to q\hbox{ in }Z\,]\,)\,]$.
\end{thm}

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

\begin{thm}\wrlab{thm-repl-sometimes-does-nothing}
Let $f$ be a function and let $p\in\dom[f]$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\adj_p^{f(p)}\,f=f$.
\end{thm}

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

\begin{thm}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\drta Y$ and let $p\in\dom[f]$.\\
Then: $[\,f\to f(p)\hbox{ near }p\hbox{ from }X\hbox{ to }Y\,]$\\
\phx\quad $\Leftrightarrow\,[\,f\hbox{ is continuous at }p\hbox{ from }\dom[f]\hbox{ to }Y\,]$.
\end{thm}

\begin{proof}
Let $g:=\adj_p^{f(p)}\,f$.\\
By \dref{defn-lim-fn}, we  have:\\
\phantom{xx}\qquad $[\,f\to f(p)\hbox{ near }p\hbox{ from }X\hbox{ to }Y\,]$\\
\phx\quad$\Leftrightarrow\,[\,g\hbox{ is continuous at }p\hbox{ from }\dom[f]\hbox{ to }Y\,]$.\\
By \tref{thm-repl-sometimes-does-nothing}, $g=f$.\\
Then: $[\,f\to f(p)\hbox{ near }p\hbox{ from }X\hbox{ to }Y\,]$\\
\phx\quad $\Leftrightarrow\,[\,g\hbox{ is continuous at }p\hbox{ from }\dom[f]\hbox{ to }Y\,]$\\
\phx\quad $\Leftrightarrow\,[\,f\hbox{ is continuous at }p\hbox{ from }\dom[f]\hbox{ to }Y\,]$.
\end{proof}

\section{Isolated points and limit points}

\begin{defn}
Let $T$ be a metric space.\\
\phx\qquad Then \quad $\Isol\,T\,\,:=\,\,\{q\in T\,|\,\exists B\in\scrb_T(q)~\hbox{s.t.}~B=\{q\}\}$.
\end{defn}

An element of $\Isol\,T$ is called an \bfindex[isolated point] of $T$.

We drew a picture on the board of a subset $T$ of the plane that had
two singleton connected components, and
two uncountable connected components, each a partial closure of a connected amoeba-like open set.
We computed $\Isol\,T$ as the union of the two singleton components.

\begin{thm}
Let $T:=[1;2)\cup\{3,4\}$.
Then $\Isol\,T=\{3,4\}$.
\end{thm}

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

\begin{thm}
Let $T:=\{1,1/2,1/3,\ldots\}$.
Then $\Isol\,T=T$.
\end{thm}

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

\begin{thm}
Let $A:=\{1,1/2,1/3,\ldots\}$ and let $T:=A_0^+$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\Isol\,T=A$.
\end{thm}

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

\begin{defn}
Let $Y$ be a metric space and let $T\subseteq Y$.\\
\phx\qquad Then \quad $\LP_YT\,\,:=\,\,(\,\Cl_YT\,)\,\backslash\,(\,\Isol\,T\,)$.
\end{defn}

An element of $\LP_YT$ is called a \bfindex[limit point] in $Y$ of $T$.

Note: In~$\Cl_YT$, we think of $T$ as a subset of the metric space $Y$.
On the other hand, in $\Isol\,T$, we think of $T$ as a metric space with the relative metric inherited from $Y$.

We went back to the picture on the board of a subset $T$ of the plane
that had two singleton connected components,
and two uncountable connected components, each a partial closure of a connected amoeba-like open set.
We computed $\LP_{\R^2}T$ as the union of the closures of the two singleton components.

\begin{thm}
Let $T:=[1;2)\cup\{3,4\}$.
Then $\LP_\R T=[1;2]$.
\end{thm}

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

\begin{thm}
Let $T:=\{1,1/2,1/3,\ldots\}$.
Then $\LP_\R T=\{0\}$.
\end{thm}

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

\begin{thm}
Let $A:=\{1,1/2,1/3,\ldots\}$ and let $T:=A_0^+$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\LP_\R T=\{0\}$.
\end{thm}

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

\begin{thm}\wrlab{thm-qe-for-closurept}
Let $Y$ be a metric space, $T\subseteq Y$ and $q\in Y$.\\
Then: $[\,q\in\Cl_YT\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall\delta>0,\,(\,[B_Y(q,\delta)]\cap T\ne\emptyset\,)\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall B\in\scrb_Y(q),\,B\cap T\ne\emptyset,]$\\
\phx\quad $\Leftrightarrow\,[\,\exists s\in T^\N~\hbox{s.t.}~s_\bullet\to q\hbox{ in }Y\,]$.
\end{thm}

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

\begin{thm}\wrlab{thm-qe-for-limitpt}
Let $Y$ be a metric space, $T\subseteq Y$ and $q\in Y$.\\
Then: $[\,q\in\LP_YT\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall\delta>0,\,(\,[B_Y^\times(q,\delta)]\cap T\ne\emptyset\,)\,]$\\
\phx\quad $\Leftrightarrow\,[\,\forall B\in\scrb_Y^\times(q),\,B\cap T\ne\emptyset,]$\\
\phx\quad $\Leftrightarrow\,[\,\exists s\in(T_q^\times)^\N~\hbox{s.t.}~s_\bullet\to q\hbox{ in }Y\,]$.
\end{thm}

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

\begin{defn}\wrlab{defn-lpd}
Let $Y$ be a metric space, $Z$ a set, $f:Y\drta Z$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $\LPD_Yf:=\LP_Y(\dom[f])$.
\end{defn}

In \dref{defn-lpd}, $\LPD$ stands for ``limit points of the domain''.

\begin{thm}
Let $Y$ and $Z$ be metric spaces.\\
Let $f:Y\drta Z$, $q\in Y$ and $a,b\in Z$.\\
Assume $f\to a$ and $f\to b$ near $q$ from $Y$ to $Z$.\\
\phx\qquad\qquad Then $a=b$.
\end{thm}

\begin{proof}
Let $D:=\dom[f]$.\\
Since $q\in\LP_YD$, by \tref{thm-qe-for-limitpt},\\
\phx\qquad choose $s\in(D_q^\times)^\N$ s.t.~$s_\bullet\to q$ in $Y$.\\
Since $D_q^\times\subseteq D_q^+$, it follows that $(D_q^\times)^\N\subseteq(D_q^+)^\N$.\\
Then $s\in(D_q^\times)^\N\subseteq(D_q^+)^\N$.\\
So, since $q\in D_q^+$ and since $s_\bullet\to q$ in $Y$,\\
\phx\qquad it follows that $s_\bullet\to q$ in $D_q^+$.\\
Let \quad $g:=\adj_q^af$ \quad and \quad $h:=\adj_q^bf$.\\
Then $g(q)=a$ and $h(q)=b$.\\
Also, $\dom[g]=D_q^+=\dom[h]$.\\
We have: $\forall j\in\N$, $s_j\ne q$.\\
It follows that: $\forall j\in\N$, $g(s_j)=f(s_j)$ and $h(s_j)=f(s_j)$.\\
That is, we have: $\forall j\in\N$, $(g\circ s)_j=(f\circ s)_j$ and $(h\circ s)_j=(f\circ s)_j$.\\
Then $g\circ s=f\circ s$ and $h\circ s=f\circ s$.\\
Since $f\to a$ and $f\to b$ near $q$ from $Y$ to $Z$, by \dref{defn-lim-fn},\\
\phx\qquad it follows that $g$ and $h$ are both continuous at $q$ from $D_q^+$ to $Z$.\\
So, since $s_\bullet\to q$ in $D_q^+$,\\
\phx\qquad $(g\circ s)_\bullet\to g(q)$ and $(h\circ s)_\bullet\to h(q)$ in $Z$.\\
So, since $g\circ s=f\circ s$ and $g(q)=a$ and $h\circ s=f\circ s$ and $h(q)=b$,\\
\phx\qquad $(f\circ s)_\bullet\to a$ and $(f\circ s)_\bullet\to b$ in $Z$.\\
Then, by \tref{thm-uniqueness-of-limit}, $a=b$, as desired.
\end{proof}

\begin{defn}
Let $\phi$ and $\psi$ be functions. Let $S$ be a set.\\
Then, by $\phi=\psi$ on $S$, we mean: $\forall x\in S$, $\phi(x)=\psi(x)$.
\end{defn}

\begin{thm}
Let $Y$ and $Z$ be metric spaces.\\
Let $\phi,\psi:Y\drta Z$, $p\in Y$ and $q\in Z$.\\
Assume $\exists B\in\scrb_Y^\times(p)$ s.t.~$\phi=\psi$ on $B$.\\
Assume $\phi\to q$ near $p$ from $Y$ to $Z$.\\
Then $\psi\to q$ near $p$ from $Y$ to $Z$.
\end{thm}

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

Let $f$ be a functional and let $k\in\N_0$.
Define $p:\R\to\R$ by $p(x)=x^k$.
Recall that $f^k$ is defined to be $p\circ f$.

Let $f:=3\cdot\id_\R^7$.
Then, for all $x\in\R$, we have $f(x)=3x^7$.

\begin{defn}
The function $|\bullet|:\R\to\R$ is defined by\\
\phantom{xx}\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad $\,(|\bullet|)(x)=|x|$.
\end{defn}

\begin{thm}
$|\bullet|$ is continuous at $0$ from $\R$ to $\R$.
\end{thm}

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

\begin{thm}
$|\bullet|\to0$ near $0$ from $\R$ to $\R$.
\end{thm}

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

\begin{defn}
Let $f$ be a functional.
Then $|f|:=(|\bullet|)\circ f$.
\end{defn}

\begin{thm}
Let $X$ be a metric space, $f:X\drta\R$, $p\in X$.\\
Then: $[\,\,f\to0\hbox{ near }p\hbox{ from }X\hbox{ to }\R\,\,]$\\
\phx\qquad$\Leftrightarrow\,\,[\,\,|f|\to0\hbox{ near }p\hbox{ from }X\hbox{ to }\R\,\,]$.
\end{thm}

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

\section{Some sets of functions}

\begin{defn}\wrlab{defn-defined-near}
Let $f$ be a function, $X$ a metric space and $p\in X$.
By $f$ is \bfindex[defined near] $p$ in $X$,
we mean: $\exists B\in\scrb_X(p)$ s.t.~$B\in\dom[f]$.
\end{defn}

NEXT YEAR, just define $\scrlito_j$ as $(\CVZ)\cdot(|\bullet|^j)$.
See \tref{thm-oj-is-cvz-times-bullettoj}

\begin{defn}\wrlab{defn-dnz}
$\DNZ:=\{\alpha:\R\drta\R\,|\,\alpha\hbox{ is defined near }0\hbox{ in }\R\}$.
\end{defn}

\begin{thm}
Both of the following are true:\\
\phx\qquad (1) $[\,\forall\alpha,\beta\in\DNZ$,\,\,$\alpha+\beta,\alpha\cdot\beta\in\DNZ\,]$ \qquad and\\
\phx\qquad (2) $[\,\forall c\in\R,\forall\beta\in\DNZ$,\,\,$c\cdot\alpha\in\DNZ\,]$.
\end{thm}

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

\begin{defn}\wrlab{defn-scrlito}
Define $\scrlito:\N_0\to2^\DNZ$ by\\
\phx\qquad $\ds{\scrlito_j\,=\,\bigg\{\,\alpha\in\DNZ\,\bigg|\,(\,\alpha(0)=0\,)\,\&}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{\left(\,\frac{\alpha}{|\bullet|^j}\to0\hbox{ near }0\hbox{ from }\R\hbox{ to }\R\,\right)\,\bigg\}}$.
\end{defn}

We argued that $\scrlito_0\supseteq\scrlito_1\supseteq\scrlito_2\supseteq\scrlito_3\supseteq\cdots$.

We argued (using HW\#13-5) that $\id_\R^3\in\scrlito_2$.
We also argued that $\id_\R^3\notin\scrlito_3$.
This proves that $\scrlito_2\ne\scrlito_3$.

More generally, we have: $\forall j\in\N$, $\id_\R^j\in\scrlito_{j-1}$ and $\id_\R^j\notin\scrlito_j$,
and so $\scrlito_{j-1}\ne\scrlito_j$.
That is, $\scrlito_0\neq\scrlito_1\neq\scrlito_2\neq\scrlito_3\neq\cdots$.

Then $\scrlito_0\supsetneq\scrlito_1\supsetneq\scrlito_2\supsetneq\scrlito_3\supsetneq\cdots$.

\begin{thm}
All of the following are true:\\
\phx\qquad (1) $[\,\forall j\in\N,\forall\alpha,\beta\in\scrlito_j,\,\,\alpha+\beta\in\scrlito_j\,]$ \qquad and\\
\phx\qquad (2) $[\,\forall j,k\in\N,\forall\alpha\in\scrlito_j,\forall\beta\in\scrlito_k,\,\,\alpha\cdot\beta\in\scrlito_{j+k}\,]$ \qquad and\\
\phx\qquad (3) $[\,\forall j\in\N,\forall c\in\R,\forall\alpha\in\scrlito_j,\,\,c\cdot\alpha\in\scrlito_j\,]$.
\end{thm}

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

\begin{defn}
Let $f$ and $g$ be functions.\\
Let $X$ be a metric space and let $p\in X$.\\
Then $f=g$ near $p$ in $X$ means: $\exists B\in\scrb_X(p)$ s.t.~$f=g$ on $B$.
\end{defn}

\begin{thm}\wrlab{thm-agree-near-p-one-contin-implies-other-contin}
Let $X$ and $Y$ be metric spaces.\\
Let $\alpha,\beta:X\drta Y$, $p\in X$. \qquad
Assume: $\alpha=\beta$ near $p$ in $X$.\\
Assume: $\alpha$ is continuous at $p$. \qquad
Then $\beta$ is continuous at $p$.
\end{thm}

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

\begin{thm}\wrlab{thm-agree-near-zero-with-litoj-implies-litoj}
Let $j\in\N_0$ and let $\alpha,\beta:\R\to\R$.\\
Assume $\alpha=\beta$ near $0$ in $\R$. \qquad
Assume $\alpha\in\scrlito_j$. \qquad
Then $\beta\in\scrlito_j$.
\end{thm}

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

\begin{defn}
Define $\scrh:\N_0\to2^{\R^\R}$ by
$\scrh_J=\{a\cdot\id_\R^j\,|\,a\in\R\}$.\\
\end{defn}

\begin{thm}
Define $C,L,Q,K:\R\to\R$ by\\
\phx\qquad\qquad $C(x)=3$, \quad $L(x)=7x$, \quad $Q(x)=4x^2$, \quad $K(x)=9x^3$.\\
Then \qquad $C=3\cdot\id_\R^0\in\scrh_0$ \qquad and \qquad $L=7\cdot\id_\R^1\in\scrh_1$\\
\phx  and \qquad $Q=4\cdot\id_\R^2\in\scrh_2$ \qquad and \qquad $K=9\cdot\id_\R^3\in\scrh_3$.
\end{thm}

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

\begin{thm}
$\forall j\in\N_0$, $\forall f\in\scrh_j$, $\exists a\in\R$ s.t.,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\forall x\in\R$, \quad $f(x)=ax^j$.
\end{thm}

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

\begin{defn}
$\bfzero:=C_\R^0$.
\end{defn}

\begin{thm}
$\forall j,k\in\N_0$, $[\,(\,j\ne k\,)\,\Rightarrow(\,\scrh_j\cap\scrh_k=\{\bfzero\}\,)\,]$.
\end{thm}

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

\begin{thm}
All of the following are true:\\
\phx\qquad (1) $[\,\forall j\in\N,\forall\alpha,\beta\in\scrh_j,\,\,\alpha+\beta\in\scrh_j\,]$ \qquad and\\
\phx\qquad (2) $[\,\forall j,k\in\N,\forall\alpha\in\scrh_j,\forall\beta\in\scrh_k,\,\,\alpha\cdot\beta\in\scrh_{j+k}\,]$ \qquad and\\
\phx\qquad (3) $[\,\forall j\in\N,\forall c\in\R,\forall\alpha\in\scrh_j,\,\,c\cdot\alpha\in\scrh_j\,]$.
\end{thm}

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

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

\begin{defn}
$\scrc:=\scrh_0$, $\scrl:=\scrh_1$, $\scrq:=\scrh_2$, $\scrk:=\scrh_3$.
\end{defn}

\begin{thm}
Define $C,L,Q,K:\R\to\R$ by\\
\phx\qquad $C(x)=3$, \quad $L(x)=7x$, \quad $Q(x)=4x^2$, \quad $K(x)=9x^3$.\\
Then \qquad $C\in\scrc$ \quad and \quad $L\in\scrl$ \quad and \quad $Q\in\scrq$ \quad and \quad $K\in\scrk$\\
\phx  and \qquad $C\notin\scrlito_0\supseteq\scrlito_1\supseteq\scrlito_2\supseteq\cdots$\\
\phx  and \qquad $L\in\scrlito_0$ \qquad and \qquad $L\notin\scrlito_1\supseteq\scrlito_2\supseteq\scrlito_3\supseteq\cdots$\\
\phx  and \qquad $Q\in\scrlito_1\subseteq\scrlito_0$ \qquad and \qquad $Q\notin\scrlito_2\supseteq\scrlito_3\supseteq\scrlito_4\supseteq\cdots$\\
\phx  and \qquad $K\in\scrlito_2\subseteq\scrlito_1\subseteq\scrlito_0$ \qquad and \qquad $K\notin\scrlito_3\supseteq\scrlito_4\supseteq\scrlito_5\supseteq\cdots$\\
\phx  and \qquad $C+Q+L+K\notin\scrlito_0\supseteq\scrlito_1\supseteq\scrlito_2\supseteq\cdots$\\
\phx  and \qquad $C+Q+L\notin\scrlito_0\supseteq\scrlito_1\supseteq\scrlito_2\supseteq\cdots$\\
\phx  and \qquad $L+Q+K\in\scrlito_0$ \qquad and \qquad $L+Q+K\notin\scrlito_1\supseteq\scrlito_2\supseteq\scrlito_3\supseteq\cdots$\\
\phx  and \qquad $Q+K\in\scrlito_1\subseteq\scrlito_0$ \qquad and \qquad $Q+K\notin\scrlito_2\supseteq\scrlito_3\supseteq\scrlito_4\supseteq\cdots$.
\end{thm}

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

\begin{thm}\wrlab{thm-degreek-implies-not-subk}
We have: \quad $\,\,\,\,\,\scrc\cap\scrlito_0=\{\bfzero\}$\\
\phx\qquad\qquad and \qquad $\scrl\subseteq\scrlito_0$ \quad and \quad $\,\scrl\cap\scrlito_1=\{\bfzero\}$\\
\phx\qquad\qquad and \qquad $\scrq\subseteq\scrlito_1$ \quad and \quad $\scrq\cap\scrlito_2=\{\bfzero\}$\\
\phx\qquad\qquad and \qquad $\scrk\subseteq\scrlito_2$ \quad and \quad $\scrk\cap\scrlito_3=\{\bfzero\}$.
\end{thm}

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

More generally:

\begin{thm}
We have: \quad $\,\forall j\in\N$, \quad $\,\scrh_j\subseteq\scrlito_{j-1}$.\\
\phx\qquad\qquad\qquad\quad Also, we have: \quad $\forall j\in\N_0$, \quad $\scrh_j\cap\scrlito_j=\{\bfzero\}$.
\end{thm}

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

\section{Translations, linearizations and derivatives of functions}

\begin{defn}
Let $S$ be a set, $f:\R\drta S$, $p\in\R$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $f(p+\bullet):\R\drta S$ is defined by:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(f(p+\bullet))(h)=f(p+h)$.
\end{defn}

The function $f(p+\bullet)$ is called the \bfindex[horizontal translate] of $f$ by $p$.

\begin{defn}\wrlab{defn-ftp}
Let $f:\R\drta\R$, $p\in\R$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $f_p^T:\R\drta\R$ is defined by:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $f_p^T(h)=[f(p+h)]-[f(p)]$.
\end{defn}

The function $f_p^T$ is called the \bfindex[double translate] of $f$ based at $p$.
Note that, if $p\in\R\backslash(\dom[f])$, then $f_p^T=\emptyset$ is the empty function.

\begin{defn}
Let $f$ be a function.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $f(\frownie+\bullet):=\frownie$ and $f_{\frownie}^T=\frownie$.
\end{defn}

We drew the graph of a partial function $f:\R\drta\R$ whose domain was a half-open interval, and which had
an interval of decrease, then one of increase, then one of decrease. We picked a point $p$ on the first
interval of decrease.
We displayed graphs of $f(p+\bullet)$ and $f_p^T$.

\begin{thm}
Let $f:\R\drta\R$, $p\in\dom[f]$.
Then $f_p^T(0)=0$.
\end{thm}

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

The analytic properties of $f$ at/near $p$ are preserved and reflected in~the analytic properties of $f(p+\bullet)$
and $f_p^T$ at/near $0$.
For example:

\begin{thm}\wrlab{thm-f-near-p-and-fpT-near-zero}
Let $f:\R\to\R$, $p\in\R$.\\
Then: $(\,f\hbox{ is defined near }p\,)$\\
\phantom{xx} $\Leftrightarrow\,\,(\,f(p+\bullet)\hbox{ is defined near }0\,)$\\
\phantom{xx} $\Leftrightarrow\,\,(\,f_p^T\hbox{ is defined near }0\,)$.\\
Also: $(\,f\hbox{ is continuous at }p\,)$\\
\phantom{xx} $\Leftrightarrow\,\,(\,f(p+\bullet)\hbox{ is continuous at }0\,)$\\
\phantom{xx} $\Leftrightarrow\,\,(\,f_p^T\hbox{ is continuous at }0\,)$.
\end{thm}

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

\begin{defn}\wrlab{defn-LINS}
Let $f:\R\drta\R$ and $p\in\R$.\\
Then $\LINS_pf:=\{L\in\scrl\,|\,f_p^T-L\in\scrlito_1\}$.
\end{defn}

An element of $\LINS_pf$ is called a \bfindex[linearization] of $f$ at $p$.
Note that, if $p\in\R\backslash(\dom[f])$, then $\LINS_pf=\emptyset$.

Let $f:\R\drta\R$, let $p\in\dom[f]$ and let $L\in\LINS_pf$.
Assume that the graph of $f$ has a tangent line at a point $(p,f(p))$.
Note that the graph of $L$ is typically {\it NOT} tangent to the graph of $f$ at $(p,f(p))$.
Instead, the graph of $L$ is tangent to the graph of $f_p^T$ at $(0,0)$.

\begin{thm}\wrlab{thm-eg-lin-of-xsquared}
Define $f:\R\to\R$ by $f(x)=x^2$.\\
Define $L\in\scrl$ by $L(h)=6h$. \qquad
Then $L\in\LINS_3f$.
\end{thm}

\begin{proof}
Define $Q\in\scrq$ by $Q(h)=h^2$.\\
We have: $\forall h\in\R$, $f_3^T(h)=[f(3+h)]-[f(3)]=(3+h)^2-3^2$\\
\phx\qquad $=9+6h+h^2-9=6h+h^2=[L(h)]+[Q(h)]=(L+Q)(h)$.\\
Then $f_3^T=L+Q$. \qquad
Also $L-L=\bfzero$.\\
Then $f_3^T-L=L+Q-L=\bfzero+Q=Q\in\scrq\subseteq\scrlito_1$.\\
Since $L\in\scrl$ and $f_3^T-L\in\scrlito_1$,
we get: $L\in\LINS_3f$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-never-two-lins}
Let $f:\R\drta\R$ and let $p\in\R$.\\
Then $\#(\LINS_pf)\le1$.
\end{thm}

\begin{proof}
Want: $\forall L,M\in\LINS_pf$, $L=M$.\\
Given $L,M\in\LINS_pf$.\qquad
Want: $L=M$.\\
Since $L,M\in\LINS_pf$, we get $f_p^T-L\in\scrlito_1$ and $f_p^T-M\in\scrlito_1$.\\
Then $(f_p^T-M)-(f_p^T-L)\in\scrlito_1$.\\
Since $f_p^T-L\in\scrlito_1\subseteq\DNZ$,
choose $B\in\scrb_\R(0)$ s.t.~$B\subseteq\dom[f_p^T-L]$.
We have $L,M\in\LINS_pf\subseteq\scrl$.\\
Since $L,M\in\scrl$, we get $\dom[L]=\R=\dom[M]$.\\
Since $L,M\in\scrl$, we get $L-M\in\scrl$.\\
Let $D:=\dom[f_p^T]$.\\
Then, as $\dom[L]=\R=\dom[M]$, we get:\\
\phx\qquad $\dom[f_p^T-L]=D=\dom[f_p^T-M]$.\\
Then $(f_p^T-M)-(f_p^T-L)=L-M$ on $D$.\\
So, since $B\subseteq\dom[f_p^T-L]=D$, it follows that:\\
\phx\qquad $(f_p^T-M)-(f_p^T-L)=L-M$ on $B$.\\
So, since $B\in\scrb_\R(0)$, we conclude that:\\
\phx\qquad $(f_p^T-M)-(f_p^T-L)=L-M$ near $0$ in $\R$.\\
So, since $(f_p^T-M)-(f_p^T-L)\in\scrlito_1$,\\
\phx\qquad by \tref{thm-agree-near-zero-with-litoj-implies-litoj}, we see that $L-M\in\scrlito_1$.\\
So, since $L-M\in\scrl$, we get $L-M\in\scrl\cap\scrlito_1=\{\bfzero\}$.\\
Then $L-M=\bfzero$, so $L=M$, as desired.
\end{proof}

\begin{defn}
Let $L\in\scrl$.\\
\phx\qquad\qquad\qquad
Then $\sl_L:=\UE\{a\in\R\,|\,L=a\cdot\id_R\}$.
\end{defn}

NEXT YEAR: Easier to define $\sl_L:=L(1)$.
Define $\sl_{\frownie}=\frownie$.

\begin{thm}\wrlab{thm-eg-slope-line}
Define $L\in\scrl$ by $L(h)=6h$.
Then $\sl_L=6$.
\end{thm}

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

\begin{defn}\wrlab{defn-one-var-derivative}
Let $f:\R\drta\R$.\\
Then $f':\R\drta\R$ is defined by: $f'(p)=\UE\{\sl_L\,|\,L\in\LINS_pf\}$.
\end{defn}

The function $f':\R\drta\R$ is called the \bfindex[derivative] of $f$.
Note that, if $p\in\R\backslash(\dom[f])$, then $f'_p=\frownie$.

NEXT YEAR: Define $D_pf:=\UE(\LINS_pf)$ and $f'_p=\sl_{D_pf}$.
Also, note that, if $p\in\R\backslash(\dom[f])$, then $D_pf=\frownie$.
Also, define $\sl_{\frownie}:=\frownie$.

\begin{thm}
Define $f:\R\to\R$ by $f(x)=x^2$.
Then $f'(3)=6$.
\end{thm}

\begin{proof}
Define $L\in\scrl$ by $L(h)=6h$.\\
By \tref{thm-eg-slope-line}, we have: $\sl_L=6$.\\
Let $S:=\{\sl_M\,|\,M\in\LINS_3f\}$.\\
By \dref{defn-one-var-derivative}, $f'(3)=\UE\,S$.\\
By \tref{thm-never-two-lins}, $\#(\LINS_3f)\le1$.\\
By \tref{thm-eg-lin-of-xsquared}, $L\in\LINS_3f$.\\
Then $\LINS_3f=\{L\}$.\\
Then $S=\{\sl_M\,|\,M\in\{L\}\}=\{\sl_L\}=\{6\}$.\\
Then $f'(3)=\UE\,S=\UE\,\{6\}=6$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-remainder-lito1-implies-deriv-is-slope}
Let $f:\R\drta\R$, $p\in\R$, $L\in\scrl$.\\
Assume that $f_p^T-L\in\scrlito_1$. \qquad
Then $f'(p)=\sl_L$.
\end{thm}

\begin{proof}
Let $S:=\{\sl_M\,|\,M\in\LINS_pf\}$.\\
By \dref{defn-one-var-derivative}, $f'(p)=\UE\,S$.\\
By \tref{thm-never-two-lins}, $\#(\LINS_pf)\le1$.\\
By \dref{defn-LINS}, $L\in\LINS_pf$.\\
Then $\LINS_pf=\{L\}$.\\
Then $S=\{\sl_M\,|\,M\in\{L\}\}=\{\sl_L\}$.\\
Then $f'(p)=\UE\,S=\UE\,\{\sl_L\}=\sl_L$, as desired.
\end{proof}

\begin{thm}
Define $f:\R\to\R$ by $f(x)=x^3$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $f'(2)=3\cdot2^2$.
\end{thm}

\begin{proof}
Define $L\in\scrl$, $Q\in\scrq$, $K\in\scrk$ by\\
\phx\qquad $L(h)=3\cdot2^2\cdot h$, \quad $Q(h)=3\cdot2\cdot h^2$, \quad $K(h)=h^3$.\\
Then $L=3\cdot2^2\cdot\id_\R$, so $\sl_L=3\cdot2^2$.\\
Also, since $Q\in\scrq\subseteq\scrlito_1$ and since $K\in\scrk\subseteq\scrlito_2\subseteq\scrlito_1$,\\
\phx\qquad we conclude that $Q+K\in\scrlito_1$.\\
We have: $\forall h\in\R$, $f_2^T(h)=[f(2+h)]-[f(2)]=(2+h)^3-2^3$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=2^3+3\cdot2^2\cdot h+3\cdot2\cdot h^2+h^3-2^3$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=3\cdot2^2\cdot h+3\cdot2\cdot h^2+h^3$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=[L(h)]+[Q(h)]+[K(h)]$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=(L+Q+K)(h)$.\\
Then $f_2^T=L+Q+K$. \qquad
Also $L-L=\bfzero$.\\
Then $f_2^T-L=L+Q+K-L=\bfzero+Q+K=Q+K\in\scrlito_1$.\\
Then, by \tref{thm-remainder-lito1-implies-deriv-is-slope},
we get: $f'(2)=\sl_L$.\\
Then $f'(2)=\sl_L=3\cdot2^2$, as desired.
\end{proof}

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

\begin{proof}
Given $x\in\R$. \qquad
Want: $f'(x)=3x^2$.\\
Define $L\in\scrl$, $Q\in\scrq$, $K\in\scrk$ by\\
\phx\qquad $L(h)=3x^2h$, \quad $Q(h)=3xh^2$, \quad $K(h)=h^3$.\\
Then $L=3x^2\cdot\id_\R$, so $\sl_L=3x^2$.\\
Also, since $Q\in\scrq\subseteq\scrlito_1$ and since $K\in\scrk\subseteq\scrlito_2\subseteq\scrlito_1$,\\
\phx\qquad we conclude that $Q+K\in\scrlito_1$.\\
We have: $\forall h\in\R$, $f_x^T(h)=[f(x+h)]-[f(x)]=(x+h)^3-x^3$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=x^3+3x^2h+3xh^2+h^3-x^3$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=3x^2h+3xh^2+h^3$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=[L(h)]+[Q(h)]+[K(h)]$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,=(L+Q+K)(h)$.\\
Then $f_x^T=L+Q+K$. \qquad
Also $L-L=\bfzero$.\\
Then $f_x^T-L=L+Q+K-L=\bfzero+Q+K=Q+K\in\scrlito_1$.\\
Then, by \tref{thm-remainder-lito1-implies-deriv-is-slope},
we get: $f'(x)=\sl_L$.\\
Then $f'(x)=\sl_L=3x^2$, as desired.
\end{proof}

\section{Basic facts about differentiation}

\begin{thm}
\quad $\forall C\in\scrc$, \quad $C'=\bfzero$.
\end{thm}

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

\begin{thm}
\quad $\forall L\in\scrl$, \quad $L'=C_\R^{\sl_L}$.
\end{thm}

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

\begin{defn}
Let $f:\R\drta\R$, $p\in\R$.\\
By $f$ is \bfindex[differentiable at] $p$, we mean: $p\in\dom[f]$.
\end{defn}

\begin{thm}\wrlab{thm-diff-at-p-gives-fpT-decomposition}
Let $f:\R\drta\R$, $p\in\dom[f']$.\\
Then $\exists L\in\scrl$, $\exists R\in\scrlito_1$ s.t.~$f_p^T=L+R$.
\end{thm}

\begin{proof}
Let $S:=\{\sl_L\,|\,L\in\LINS_pf\}$.\\
Then $f'(p)=\UE(S)$.\\
Since $p\in\dom[f']$, we get $\frownie\ne f'(p)$.\\
Then $\UE(S)=f'(p)\ne\frownie=\UE(\emptyset)$, so $S\ne\emptyset$.\\
By \tref{thm-never-two-lins}, $\#(\LINS_pf)\le1$.\\
Since $\{\sl_L\,|\,L\in\LINS_pf\}=S\ne\emptyset$, we conclude that $\LINS_p\ne\emptyset$.\\
Then $\#(\LINS_pf)=1$.\\
Let $L:=\UE(\LINS_pf)$. \quad
Then $\LINS_pf=\{L\}$. \quad
Then $L\in\LINS_pf$.\\
Then $L\in\LINS_pf\subseteq\scrl$.\\
Since $L\in\{L\}=\LINS_pf$, we see that $f_p^T-L\in\scrlito_1$.\\
Let $R:=f_p^T-L$. \qquad
Then $R\in\scrlito_1$.\\
Then $L\in\scrl$ and $R\in\scrlito_1$. \qquad
Want: $f_p^T=R+L$.\\
Since $R=f_p^T-L$,
we get: $R+L=f_p^T-L+L=f_p^T+\bfzero=f_p^T$,\\
\phx\qquad and so $f_p^T=R+L=L+R$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-decomp-lin-sublin-implies-deriv-is-slope-lin}
Let $f:\R\drta\R$, $p\in\R$, $L\in\scrl$, $R\in\scrlito_1$.\\
Assume that $f_p^T=L+R$. \qquad
Then $f'(p)=\sl_L$.
\end{thm}

\begin{proof}
Since $f_p^T-L=R\in\scrlito_1$, it follows,
from \tref{thm-remainder-lito1-implies-deriv-is-slope},\\
\phx\qquad\qquad that $f'(p)=\sl_L$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-diffat-implies-definednear-continat}
Let $f:\R\drta\R$, $p\in\dom[f']$.\\
Then: $(\,f\hbox{ is defined near }p\,)\,\&\,(\,f\hbox{ is continuous at }p\,)$.
\end{thm}

\begin{proof}
By \tref{thm-diff-at-p-gives-fpT-decomposition},
choose $L\in\scrl$ and $R\in\scrlito_1$
s.t.~$f_p^T=L+R$.\\
Since $L$ and $R$ are defined near $0$,
we get: $L+R$ is defined near $0$.\\
Then $f_p^T$ is defined near $0$.\\
Since $L$ and $R$ are continuous at $0$,
we get: $L+R$ is continuous at $0$.\\
Then $f_p^T$ is continuous at $0$.\\
Since $f_p^T$ is defined near $0$ and $f_p^T$ is continuous at $0$, by \tref{thm-f-near-p-and-fpT-near-zero},\\
we get:
\qquad\qquad $(\,f\hbox{ is defined near }p\,)\,\&\,(\,f\hbox{ is continuous at }p\,)$.
\end{proof}

\begin{thm}\wrlab{thm-diff-implies-defined}
Let $f:\R\drta\R$.
Then $\dom[f']\subseteq\dom[f]$.
\end{thm}

\begin{proof}
Want: $\forall p\in\dom[f'],\,p\in\dom[f]$.\\
Given $p\in\dom[f']$. \qquad
Want: $p\in\dom[f]$.\\
By \tref{thm-diffat-implies-definednear-continat},
$f$ is defined near $p$.\\
So, by \dref{defn-defined-near},
choose $B\in\scrb_X(p)$ s.t.~$B\subseteq\dom[f]$.\\
Since $B\in\scrb_X(p)$, we get: $p\in B$.\\
Then $p\in B\subseteq\dom[f]$, as desired.
\end{proof}

\begin{defn}
Let $f:\R\drta\R$ and let $p\in\R$.\\
Then $\SS_f^p:\R\drta\R$ is defined by\\
\phx\qquad\qquad $(SS_f^p)(h)=(DQ_f)(p,p+h)$.
\end{defn}

We call $\SS_f^p$ the \bfindex[secant slope function] of $f$ based at $p$.
The limit of the secant slope is not always the value of the derivative:

\begin{thm}
Let $A:=\{1,1/2,1/3,1/4,\ldots\}\cup\{0\}$.\\
Let $f:=(\id_\R^2)|(A+3)$.\\
Then: \qquad $f'(3)=\frownie$ \quad and \quad $\SS_f^3\to6$ near $0$ from $\R$ to $\R$.
\end{thm}

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

The limit of the secant slope is typically the value of the derivative:

\begin{thm}
Let $f:\R\drta\R$ and let $p,m\in\R$.\\
Assume that $f$ is defined near $p$.\\
Then: $[\,f'(p)=m\,]\,\Leftrightarrow\,[\,\SS_f^p\to m\hbox{ near }0\hbox{ from }\R\hbox{ to }\R\,]$.
\end{thm}

\begin{proof}
Omitted.
\end{proof}

\begin{thm}\wrlab{thm-abs-value-minus-mult-id-not-sublin}
Let $a\in\R$.
Then $|\bullet|-a\cdot[\id_\R]\notin\scrlito_1$.
\end{thm}

\begin{proof}
Let $f:=|\bullet|-a\cdot[\id_\R]$. \quad
Want: $f\notin\scrlito_1$.\\
Assuume $f\in\scrlito_1$. \qquad
Want: Contradiction.\\
Since $f\in\scrlito_1$, we get: $f/[|\bullet|]\to0$ near $0$ from $\R$ to $\R$.\\
So, by \tref{thm-quant-equiv-for-limit-fn}, choose $\delta>0$ s.t., $\forall h\in\R$,\\
\phx\qquad\qquad $\ds{(\,0<d_\R(h,0)<\delta\,)\,\Rightarrow\,\left(\,d_\R\left(\left(\frac{f}{|\bullet|}\right)(h),0\right)<1\,\right)}$.\\
Then, $\forall h\in\R$, $\ds{\left[\,(\,0<|h|<\delta\,)\,\Rightarrow\,\left(\,\left|\left(\frac{f}{|\bullet|}\right)(h)\right|<1\,\right)\,\right]}$.\\
At least one of the following must be true:\\
\phx\qquad (1) $a\ge0$ \qquad or \qquad (2) $a\le0$.\\
\\
{\it Case (1):}\\
Let $h:=-\delta/2$. \quad
Since $h<0$, we get $|h|=-h$.\\
Since $|h|=\delta/2$ and since $0<\delta/2<\delta$, we get: $0<|h|<\delta$.\\
Then, by the choice of $\delta$, we have: $\ds{\left|\left(\frac{f}{|\bullet|}\right)(h)\right|<1}$.\\
Let $\ds{y:=\left(\frac{f}{|\bullet|}\right)(h)}$. \qquad
Then $|y|<1$. \qquad
Then $1>|y|$.\\
We calculate:
$\ds{y=\left(\frac{f}{|\bullet|}\right)(h)=\frac{f(h)}{|h|}=\frac{|h|-ah}{|h|}}$\\
\phx\qquad\qquad\qquad\qquad $\ds{=\frac{-h-ah}{-h}=\frac{h+ah}{h}=1+a}$.\\
Since $a\ge0$, we get: $1+a\ge1$.\\
So, since $y=1+a$, we get: $y\ge1$.\\
Since $y\ge1>0$, we conclude that $y>0$, and so $|y|=y$.\\
Then $1>|y|=y\ge1$, so $1>1$. \qquad
Contradiction.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Let $h:=\delta/2$. \quad
Since $h>0$, we get $|h|=h$.\\
Since $|h|=\delta/2$ and since $0<\delta/2<\delta$, we get: $0<|h|<\delta$.\\
Then, by the choice of $\delta$, we have: $\ds{\left|\left(\frac{f}{|\bullet|}\right)(h)\right|<1}$.\\
Let $\ds{y:=\left(\frac{f}{|\bullet|}\right)(h)}$. \qquad
Then $|y|<1$. \qquad
Then $1>|y|$.\\
We calculate:
$\ds{y=\left(\frac{f}{|\bullet|}\right)(h)=\frac{f(h)}{|h|}=\frac{|h|-ah}{|h|}=\frac{h-ah}{h}=1-a}$.\\
Since $a\le0$, we get: $1-a\ge1$.\\
So, since $y=1-a$, we get: $y\ge1$.\\
Since $y\ge1>0$, we conclude that $y>0$, and so $|y|=y$.\\
Then $1>|y|=y\ge1$, so $1>1$. \qquad
Contradiction.\\
{\it End of Case (2).}
\end{proof}

\begin{thm}\wrlab{thm-slope-is-the-coeff}
Let $L\in\scrl$ and let $a:=\sl_L$.\\
Then $L=a\cdot\id_\R$.
\end{thm}

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

\begin{thm}\wrlab{thm-0to0-implies-dbltranslate-does-nothing}
Let $f:\R\drta\R$.\\
Assume $f(0)=0$. \qquad
Then $f_0^T=f$.
\end{thm}

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

\begin{thm}\wrlab{thm-absprime-zero}
$0\notin\dom[|\bullet|']$.
\end{thm}

\begin{proof}
Assume $0\in\dom[|\bullet|']$. \qquad
Want: Contradiction.\\
By \tref{thm-diff-at-p-gives-fpT-decomposition},
choose $L\in\scrl$ and $R\in\scrlito_1$ s.t.~$|\bullet|_0^T=L+R$.\\
By \tref{thm-0to0-implies-dbltranslate-does-nothing}, we have: $|\bullet|_0^T=|\bullet|$.\\
Then $|\bullet|-L=|\bullet|_0^T-L=L+R-L=R+\bfzero=R\in\scrlito_1$.\\
Let $a:=\sl_L$. \qquad
By \tref{thm-slope-is-the-coeff}, we have: $L=a\cdot[\id_R]$.\\
Then $|\bullet|-a\cdot[\id_\R]=|\bullet|-L\in\scrlito_1$. \quad
Then $|\bullet|-a\cdot[\id_\R]\in\scrlito_1$.\\
However, by \tref{thm-abs-value-minus-mult-id-not-sublin}, we have:
$|\bullet|-a\cdot[\id_\R]\notin\scrlito_1$.\\
Contradiction.
\end{proof}

\begin{thm}\wrlab{thm-zero-near-zero-implies-little-oh}
Let $\alpha:\R\drta\R$.\\
Assume that $\alpha=\bfzero$ near $0$ in $\R$. \quad
Then: $\forall j\in\N_0$, $\alpha\in\scrlito_j$.
\end{thm}

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

\begin{thm}
$(|\bullet|')(2)=1$.
\end{thm}

\begin{proof}
Let $m:=1$. \quad
Let $L:=m\cdot[\id_\R]$. \quad
Then $\sl_L=m$.\\
We calculate: $\forall h\in(-2;2)$,\\
\phx\quad $(|\bullet|_2^T-L)(h)=|2+h|-|2|-m\cdot h$\\
\phx\qquad\qquad\qquad\qquad $=2+h-2-1\cdot h=0=\bfzero(h)$.\\
Then $|\bullet|_2^T-L=\bfzero$ on $(-2;2)$.\\
Then $|\bullet|_2^T-L=\bfzero$ near $0$ in $\R$.\\
Then, by \tref{thm-zero-near-zero-implies-little-oh}, $|\bullet|_2^T-L\in\scrlito_1$.\\
Then, by \tref{thm-remainder-lito1-implies-deriv-is-slope}, $(|\bullet|')(2)=\sl_L$.\\
Then $(|\bullet|')(2)=\sl_L=m=1$, as desired.\\
\end{proof}

\begin{thm}
$(|\bullet|')(-2)=-1$.
\end{thm}

\begin{proof}
Let $m:=-1$. \quad
Let $L:=m\cdot[\id_\R]$. \quad
Then $\sl_L=m$.\\
We calculate: $\forall h\in(-2;2)$,\\
\phx\quad $(|\bullet|_{-2}^T-L)(h)=|-2+h|-|-2|-m\cdot h$\\
\phx\qquad\qquad\qquad\qquad $=-(-2+h)-2-(-1)\cdot h=0=\bfzero(h)$.\\
Then $|\bullet|_{-2}^T-L=\bfzero$ on $(-2;2)$.\\
Then $|\bullet|_{-2}^T-L=\bfzero$ near $0$ in $\R$.\\
Then, by \tref{thm-zero-near-zero-implies-little-oh}, $|\bullet|_{-2}^T-L\in\scrlito_1$.\\
Then, by \tref{thm-remainder-lito1-implies-deriv-is-slope}, $(|\bullet|')(-2)=\sl_L$.\\
Then $(|\bullet|')(-2)=\sl_L=m=-1$, as desired.\\
\end{proof}

\begin{thm}\wrlab{thm-absprime-pos}
$\forall x>0$, $(|\bullet|')(x)=1$.
\end{thm}

\begin{proof}
Let $m:=1$. \quad
Let $L:=m\cdot[\id_\R]$. \quad
Then $\sl_L=m$.\\
We calculate: $\forall h\in(-x;x)$,\\
\phx\quad $(|\bullet|_x^T-L)(h)=|x+h|-|x|-m\cdot h$\\
\phx\qquad\qquad\qquad\qquad $=x+h-x-1\cdot h=0=\bfzero(h)$.\\
Then $|\bullet|_x^T-L=\bfzero$ on $(-x;x)$.\\
Then $|\bullet|_x^T-L=\bfzero$ near $0$ in $\R$.\\
Then, by \tref{thm-zero-near-zero-implies-little-oh}, $|\bullet|_x^T-L\in\scrlito_1$.\\
Then, by \tref{thm-remainder-lito1-implies-deriv-is-slope}, $(|\bullet|')(x)=\sl_L$.\\
Then $(|\bullet|')(x)=\sl_L=m=1$, as desired.\\
\end{proof}

\begin{thm}\wrlab{thm-absprime-neg}
$\forall x<0$, $(|\bullet|')(x)=-1$.
\end{thm}

\begin{proof}
Let $m:=-1$. \quad
Let $L:=m\cdot[\id_\R]$. \quad
Then $\sl_L=m$.\\
We calculate: $\forall h\in(x;-x)$,\\
\phx\quad $(|\bullet|_x^T-L)(h)=|x+h|-|x|-m\cdot h$\\
\phx\qquad\qquad\qquad\qquad $=-(x+h)-(-x)-(-1)\cdot h=0=\bfzero(h)$.\\
Then $|\bullet|_x^T-L=\bfzero$ on $(x;-x)$.\\
Then $|\bullet|_x^T-L=\bfzero$ near $0$ in $\R$.\\
Then, by \tref{thm-zero-near-zero-implies-little-oh}, $|\bullet|_x^T-L\in\scrlito_1$.\\
Then, by \tref{thm-remainder-lito1-implies-deriv-is-slope}, $(|\bullet|')(x)=\sl_L$.\\
Then $(|\bullet|')(x)=\sl_L=m=-1$, as desired.\\
\end{proof}

Since $\dom[|\bullet|]=\R$,
the next result follows from
\tref{thm-absprime-zero},
\tref{thm-absprime-pos} and
\tref{thm-absprime-dom}:

\begin{thm}\wrlab{thm-absprime-dom}
$\dom[|\bullet|']=\R_0^\times\subsetneq\R=\dom[|\bullet|]$.
\end{thm}

According to \tref{thm-diff-implies-defined},
$\forall f:\R\drta\R$, $\dom[f']\subseteq\dom[f]$.
By~\tref{thm-absprime-dom}, we see that the inclusion
is sometimes proper.

\begin{defn}
Let $f:\R\drta\R$ and let $S\subseteq\R$.\\
Then $f$ is \bfindex[differentiable on] $S$ means: $S\subseteq\dom[f']$.
\end{defn}

\begin{defn}
Let $f:\R\drta\R$.\\
Then $f$ is \bfindex[differentiable] means: $\dom[f']=\dom[f]$.
\end{defn}

Unassigned HW: $\forall f,g:\R\drta\R$, $\forall p\in\R$,
$(f+g)_p^T=[f_p^T]+[g_p^T]$.

Unassigned HW: $\forall c\in\R$, $\forall f:\R\drta\R$, $\forall p\in\R$,
$(c\cdot f)_p^T=c\cdot[f_p^T]$.

To express these last two unassigned HWs, we sometimes say,\\
\phx\qquad\qquad\qquad\qquad ``Double translation is linear.''

Unassigned HW: $\forall L,M\in\scrl$,
$\sl_{L+M}=[\sl_L]+[\sl_M]$.

Unassigned HW: $\forall c\in\R$, $\forall L\in\scrl$,
$\sl_{c\cdot L}=c\cdot[\sl_L]$.

To express these last two unassigned HWs, we sometimes say,\\
\phx\qquad\qquad\qquad\qquad ``Computation of slope is linear.''

Unassigned HW: $\bfzero'=\bfzero$.

We will sometimes use $f'_p$ instead of $f'(p)$.

According to \tref{thm-absprime-zero}, $(|\bullet|)'_0=\frownie$.

Unassigned HW: $(-|\bullet|)'_0=\frownie$.

Let $f:=|\bullet|$ and $g:=-|\bullet|$.
Then we have: $f'_0=\frownie$ and $g'_0=\frownie$.
Also, $f+g=\bfzero$.
Then $(f+g)'=\bfzero$.
It follows that $(f+g)'_0=\bfzero_0=0$.
Also, $[f'_0]+[g'_0]=\frownie+\frownie=\frownie$.
Let $p:=0$.
Then\\
\phx\qquad\quad $(f+g)'_p=(f+g)'_0=0\ne\frownie=[f'_0]+[g'_0]=[f'_p]+[g'_p]$,\\
and so $(f+g)'_p\ne[f'_p]+[g'_p]$.
On the other hand:

\begin{thm}\wrlab{thm-deriv-additive}
Let $f,g:\R\drta\R$ and let $p\in\R$.\\
Then: $(f+g)'_p\,\,=^*\,\,[f'_p]+[g'_p]$.
\end{thm}

\begin{proof}
Want: $(\,[f'_p]+[g'_p]\ne\frownie\,)\,\Rightarrow\,(\,(f+g)'_p=[f'_p]+[g'_p]\,)$.\\
Assume $[f'_p]+[g'_p]\ne\frownie$. \quad
Want: $(f+g)'_p=[f'_p]+[g'_p]$.\\
Since $[f'_p]+[g'_p]\ne\frownie$, we conclude that $f'_p\ne\frownie\ne g'_p$.\\
Then $p\in\dom[f']$ and $p\in\dom[g']$.\\
Then, by \tref{thm-diff-at-p-gives-fpT-decomposition},
choose $L,M\in\scrl$ and $R,S\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $f_p^T=L+R$ \quad and \quad $g_p^T=M+S$.\\
By \tref{thm-decomp-lin-sublin-implies-deriv-is-slope-lin}, we have:
\qquad $f'_p=\sl_L$ \quad and \quad $g'_p=\sl_M$.\\
Since $L,M\in\scrl$, we get: $L+M\in\scrl$.\\
Since $R,S\in\scrlito_1$, we get: $R+S\in\scrlito_1$.\\
Also, $(f+g)_p^T=[f_p^T]+[g_p^T]=[L+R]+[M+S]=[L+M]+[R+S]$.\\
Then, by \tref{thm-decomp-lin-sublin-implies-deriv-is-slope-lin},
$(f+g)'_p=\sl_{L+M}$.\\
Then $(f+g)'_p=\sl_{L+M}=[\sl_L]+[\sl_M]=[f'_p]+[g'_p]$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-deriv-commutes-with-scalar-mult-contingent}
Let $c\in\R$, let $f:\R\drta\R$ and let $p\in\R$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $(c\cdot f)'_p\,\,=^*\,\,c\cdot[f'_p]$.
\end{thm}

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

Unassigned HW: $\forall a,b$, $(\,[\,(\,a\,\,=^*\,\,b\,)\,\&\,(\,b\,\,=^*\,\,a\,)\,]\,\Rightarrow\,[\,a=b\,]\,)$.

Unassigned HW: $\forall a$, $\forall b\,\,{}^\frown\!\!\in\R$, $\forall c\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $[\,a\,\,=^*\,\,b\,]\,\Rightarrow\,[\,c\cdot a\,\,=^*\,\,c\cdot b\,]$.

\begin{thm}\wrlab{thm-deriv-commutes-with-nonzero-scalar-mult}
Let $c\in\R_0^\times$, let $f:\R\drta\R$ and let $p\in\R$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $(c\cdot f)'_p\,\,=\,\,c\cdot[f'_p]$.
\end{thm}

\begin{proof}
By \tref{thm-deriv-commutes-with-scalar-mult-contingent}, $(c\cdot f)'_p\,\,=^*\,\,c\cdot[f'_p]$.\\
\phx\qquad\qquad\qquad\qquad $\,\,$Want: $c\cdot[f'_p]\,\,=^*\,\,(c\cdot f)'_p$.\\
Let $\phi:=c\cdot f$ and let $\gamma:=1/c$.\\
By \tref{thm-deriv-commutes-with-scalar-mult-contingent}, $(\gamma\cdot\phi)'_p\,\,=^*\,\,\gamma\cdot[\phi'_p]$.\\
So, since $\gamma\cdot\phi=f$ and since $\phi=c\cdot f$, this gives:
$f'_p\,\,=^*\,\,\gamma\cdot[(c\cdot f)'_p]$.\\
Multiplying by $c$, we get: $c\cdot[f'_p]\,\,=^*\,\,c\cdot\gamma\cdot[(c\cdot f)'_p]$.\\
So, since $c\cdot\gamma=1$, we conclude: $c\cdot[f'_p]\,\,=^*\,\,(c\cdot f)'_p$, as desired.
\end{proof}

\section{Basic results about big O and little o}

\begin{defn}
$\forall$sets $X$ and $Y$, \quad $\scrpf_{XY}:=\bigcup\{Y^D\,|\,D\subseteq X\}$.
\end{defn}

\begin{thm}
$\forall$sets $X$ and $Y$, $\forall f$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\,\,f\in\scrpf_{XY}\,\,)\,\,\Leftrightarrow\,\,(\,\,f:X\drta Y\,\,)$.
\end{thm}

\begin{defn}
$\forall$set $X$, $\forall\scrs,\scrt\subseteq\scrpf_{X\R}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\scrs+\scrt:=\{f+g\,|\,f\in\scrs,g\in\scrt\}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\scrs\cdot\scrt:=\{f\cdot g\,|\,f\in\scrs,g\in\scrt\}$.
\end{defn}

\begin{defn}
$\forall$set $X$, $\forall f:X\drta\R$, $\forall\scrs\subseteq\scrpf_{X\R}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $f+\scrs:=\{f\}+\scrs=:\scrs+f$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $f\cdot\scrs:=\{f\}\cdot\scrs=:\scrs\cdot f$.
\end{defn}

\begin{defn}
$\forall$set $X$, $\forall A\subseteq\R$, $\forall\scrs\subseteq\scrpf_{X\R}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $A\cdot\scrs:=\{c\cdot f\,|\,c\in A,\,f\in\scrs\}=:\scrs\cdot A$.
\end{defn}

\begin{defn}
$\forall$set $X$, $\forall A\subseteq\R$, $\forall f:X\drta\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $A\cdot f:=A\cdot\{f\}=:f\cdot A$.
\end{defn}

\begin{defn}
$\forall$set $X$, $\forall a\in\R$, $\forall\scrs\subseteq\scrpf_{X\R}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $a\cdot\scrs:=\{a\}\cdot\scrs=:\scrs\cdot a$.
\end{defn}

Recall \dref{defn-dnz} and \dref{defn-scrlito}.

\begin{defn}
\ \\
\phx\qquad
$\CVZ\quad:=\quad\{\alpha\in\DNZ\,|\,(\,\alpha\hbox{ is continuous at }0\,)\,\&\,(\,\alpha(0)=0\,)\}$.
\end{defn}

\begin{thm}\wrlab{thm-oj-is-cvz-times-bullettoj}
Let $j\in\N_0$.
Then $\scrlito_j=(\CVZ)\cdot(|\bullet|^j)$.
\end{thm}

\begin{proof}
By HW\#1-1, it suffices to show: $\scrlito_j\subseteq(\CVZ)\cdot(|\bullet|^j)$.\\
Want: $\forall\alpha\in\scrlito_j$, $\alpha\in(\CVZ)\cdot(|\bullet|^j)$.\\
Given $\alpha\in\scrlito_j$. \qquad
Want: $\alpha\in(\CVZ)\cdot(|\bullet|^j)$.\\
Let $\ds{\beta:=\adj_0^0\left(\frac{\alpha}{|\bullet|^j}\right)}$. \quad
Want: $(\,\beta\in\CVZ\,)\,\&\,(\,\alpha=\beta\cdot(|\bullet|^j)\,)$.\\
Since $\alpha\in\scrlito_j$, we know:\\
\phx\qquad $\ds{(\,\alpha\in\DNZ\,)\,\&\,(\,\alpha(0)=0\,)\,\&\,\left(\,\frac{\alpha}{|\bullet|^j}\to0\hbox{ near }0\hbox{ from }\R\hbox{ to }\R\,\right)}$.\\
We have $\dom[\beta]=((\dom[\alpha])_0^\times)_0^+\supseteq\dom[\alpha]$,\\
\phx\qquad so, since $\alpha\in\DNZ$, we get: $\beta\in\DNZ$.\\
Since $\ds{\frac{\alpha}{|\bullet|^j}\to0\hbox{ near }0\hbox{ from }\R\hbox{ to }\R}$,
we see that $\beta$ is continuous at $0$.\\
So, since $\beta\in\DNZ$, it follows that $\beta\in\CVZ$.\\
Want: $\alpha=\beta\cdot(|\bullet|^j)$.\\
Want: $\forall x\in\R$, $\alpha(x)=(\beta\cdot(|\bullet|^j))(x)$.\\
Given $x\in\R$. \qquad
Want: $\alpha(x)=(\beta\cdot(|\bullet|^j))(x)$.\\
Want: $[\beta(x)]\cdot[|x|^j]=\alpha(x)$.\\
Exactly one of the following is true:\\
\phx\qquad(1) $x=0$ \quad or\\
\phx\qquad(2) $x\ne0$.\\
\\
{\it Case (1):}\\
We have $\alpha(x)=\alpha(0)=0$.\\
Then $[\beta(x)]\cdot[|x|^j]=[\beta(0)]\cdot[|0|^j]=0\cdot0^j=0=\alpha(x)$, as desired.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
We have $\ds{[\beta(x)]\cdot[|x|^j]=\left[\left(\frac{\alpha}{|\bullet|^j}\right)(x)\right]\cdot[|x|^j]}$\\
\phx\qquad\qquad\qquad\qquad\quad $\,\,\ds{=\left[\frac{\alpha(x)}{|x|^j}\right]\cdot[|x|^j]=\alpha(x)}$, as desired.\\
{\it End of Case (2).}
\end{proof}

\begin{thm}\wrlab{thm-littleo0-is-CVZ}
\qquad $\scrlito_0=\CVZ$.
\end{thm}

\begin{proof}
By \tref{thm-oj-is-cvz-times-bullettoj}, $\scrlito_0=(\CVZ)\cdot(|\bullet|^0)$.\\
So, as $|\bullet|^0=C_\R^1$, we get $\scrlito_0=\CVZ$, as desired.
\end{proof}

NEXT YEAR, just define $\scrlito_j$ as $(\CVZ)\cdot(|\bullet|^j)$.

\begin{defn}\ \\
\phx\qquad $\BNZ:=\{\alpha\in\DNZ\,|\,\exists C\in\scrb_\R(0)~\hbox{s.t.}~\alpha_*(C)\hbox{ is bounded in }\R\}$.
\end{defn}

We graphed $x\mapsto x^{-2}:\R\drta\R$.
This is in $\DNZ$, but not in $\CVZ$ and not in $\BNZ$.

We graphed $x\mapsto (x-1)^{-2}:\R\drta\R$.
This is in $\DNZ$ and in $\BNZ$, but not in $\CVZ$.

We graphed $\ds{\left(x\mapsto\begin{cases}1,&\hbox{if }x<0\\x,&\hbox{if }x\ge0\end{cases}\right):\R\to\R}$.
This is in $\DNZ$ and in~$\BNZ$, but not in $\CVZ$.

By definition of $\CVZ$, we have $\DNZ\subseteq\CVZ$.

According to HW\#1-2, we have $\CVZ\subseteq\BNZ$.

\begin{thm}
\qquad $(\CVZ)\cdot(\CVZ)\subseteq\CVZ$.
\end{thm}

\begin{proof}
By HW\#1-2, $\CVZ\subseteq\BNZ$,
so $(\CVZ)\cdot(\CVZ)\subseteq(\BNZ)\cdot(\CVZ)$.\\
According to HW\#1-4, we have $(\BNZ)\cdot(\CVZ)\subseteq\CVZ$.\\
Then $(\CVZ)\cdot(\CVZ)\subseteq(\BNZ)\cdot(\CVZ)\subseteq\CVZ$, as desired.
\end{proof}

\begin{defn}\wrlab{defn-scrbigo}
Define $\scrbigo:\N_0\to2^\DNZ$ by $\scrbigo_j=(\BNZ)(|\bullet|^j)$.
\end{defn}

\begin{thm}
\qquad $\scrbigo_0=\BNZ$.
\end{thm}

\begin{proof}
By \tref{defn-scrbigo}, $\scrbigo_0=(\BNZ)\cdot(|\bullet|^0)$.\\
So, as $|\bullet|^0=C_\R^1$, we get $\scrbigo_0=\BNZ$, as desired.
\end{proof}

\begin{thm}
$\forall j\in\N_0$, \quad $\R\cdot\scrbigo_j\subseteq\scrbigo_j$.\\
\phx\qquad\qquad\qquad$\,\,$ Also, $\forall j\in\N_0$, \quad $\scrbigo_j+\scrbigo_j\subseteq\scrbigo_j$.\\
\phx\qquad\qquad\quad$\,\,\,$ Also, $\forall j,k\in\N_0$, \quad $\scrbigo_j\cdot\scrbigo_k\subseteq\scrbigo_{j+k}$.
\end{thm}

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

\begin{thm}\wrlab{thm-bigO-subset-littleo}
Let $j\in\N$.
Then $\scrbigo_j\subseteq\scrlito_{j-1}$.
\end{thm}

\begin{proof}
Since $|\bullet|\in\CVZ$,\\
\phx\qquad we get $(\BNZ)\cdot(|\bullet|)\cdot(|\cdot|^{j-1})\in(\BNZ)\cdot(\CVZ)\cdot(|\cdot|^{j-1})$.\\
By HW\#1-4, we have $(\BNZ)\cdot(\CVZ)\subseteq\CVZ$,\\
\phx\qquad and so $(\BNZ)\cdot(\CVZ)\cdot(|\bullet|^{j-1})\subseteq(\CVZ)\cdot(|\bullet|^{j-1})$.\\
Then $\scrbigo_j=(\BNZ)\cdot(|\bullet|^j)$\\
\phx\qquad\quad $\,\,\,\,=(\BNZ)\cdot(|\bullet|)\cdot(|\bullet|^{j-1})$\\
\phx\qquad\quad $\,\,\,\,\,\in\,(\BNZ)\cdot(\CVZ)\cdot(|\bullet|^{j-1})$\\
\phx\qquad\quad $\,\,\,\,\subseteq(\CVZ)\cdot(|\bullet|^{j-1})=\scrlito_{j-1}$,
as desired.
\end{proof}

We define $0.5=1/2$.
For any $f:\R\drta\R$, for any $j\in\N_0$,
we define $f^{n+0.5}:\R\drta\R$ by
$f^{n+0.5}(x)=[f^n(x)]\cdot[\sqrt{f(x)}]$.

We displayed all the $\scrbigo_j$s and all the $\scrlito_j$s in a chain:\\
\phx\qquad $\scrbigo_0\supseteq\scrlito_0\supseteq\scrbigo_1\supseteq\scrlito_1\supseteq\scrbigo_2\supseteq\scrlito_2\supseteq\scrbigo_3\supseteq\scrlito_3\supseteq\scrbigo_4\supseteq\scrlito_4\supseteq\cdots$.\\

Elements of $\scrbigo_0$ are said to have \bfindex[constant order].

Elements of $\scrlito_0$ are said to be \bfindex[subconstant].

Elements of $\scrbigo_1$ are said to have \bfindex[linear order].

Elements of $\scrlito_1$ are said to be \bfindex[sublinear].

Elements of $\scrbigo_2$ are said to have \bfindex[quadratic order].

Elements of $\scrlito_2$ are said to be \bfindex[subquadratic].

Elements of $\scrbigo_3$ are said to have \bfindex[cubic order].

Elements of $\scrlito_3$ are said to be \bfindex[subcubic].

Elements of $\scrbigo_4$ are said to have \bfindex[quartic order].

Elements of $\scrlito_4$ are said to be \bfindex[subquartic].

\vskip.1in

We have: $|\bullet|^0$ has constant order, but is not subconstant.

We have: $|\bullet|^{0.5}$ is subconstant, but is not of linear order.

We have: $|\bullet|^1$ has linear order, but is not sublinear.

We have: $|\bullet|^{1.5}$ is sublinear, but is not of quadratic order.

We have: $|\bullet|^2$ has quadratic order, but is not subquadratic.

We have: $|\bullet|^{2.5}$ is subquadratic, but is not of cubic order.

We have: $|\bullet|^3$ has cubic order, but is not subcubic.

We have: $|\bullet|^{3.5}$ is subcubic, but is not of quartic order.

We have: $|\bullet|^4$ has quartic order, but is not subquartic.

\begin{thm}\wrlab{thm-bigoj-litok-in-litojplusk}
Let $j,k\in\N_0$.
Then $\scrlito_k\cdot\scrbigo_j=\scrbigo_j\cdot\scrlito_k\subseteq\scrlito_{j+k}$.
\end{thm}

\begin{proof}
By commutativity of multiplication, $\scrlito_k\cdot\scrbigo_j=\scrbigo_j\cdot\scrlito_k$.\\
It remains to show: $\scrbigo_j\cdot\scrlito_k\subseteq\scrlito_{j+k}$.\\
By HW\#1-4, we have $(\BNZ)\cdot(\CVZ)\subseteq\CVZ$.\\
Then $\scrbigo_j\cdot\scrlito_k=(\BNZ)\cdot(|\bullet|^j)\cdot(\CVZ)\cdot(|\bullet|^k)$\\
\phx\qquad\qquad\quad $\,\,\subseteq(\CVZ)\cdot(|\bullet|^{j+k})=\scrlito_{j+k}$, as desired.
\end{proof}

\begin{thm}
Let $j,k\in\N_0$.
Then $\scrlito_j\cdot\scrlito_k\subseteq\scrlito_{j+k}$.
\end{thm}

\begin{proof}
By HW\#1-5, we have $\scrlito_j\subseteq\scrbigo_j$. \quad
Then $\scrlito_j\cdot\scrlito_k\subseteq\scrbigo_j\cdot\scrlito_k$.\\
By \tref{thm-bigoj-litok-in-litojplusk}, we have $\scrbigo_j\cdot\scrlito_k\subseteq\scrlito_{j+k}$.\\
Then $\scrlito_j\cdot\scrlito_k\subseteq\scrbigo_j\cdot\scrlito_k\subseteq\scrlito_{j+k}$, as desired.
\end{proof}

\begin{thm}
Let $j,k\in\N_0$.
Then $\scrbigo_j\cdot\scrbigo_k\subseteq\scrbigo_{j+k}$.
\end{thm}

\begin{proof}
By HW\#1-3, we have $(\BNZ)\cdot(\BNZ)\subseteq\BNZ$.\\
Then $\scrbigo_j\cdot\scrbigo_k=(\BNZ)\cdot(|\bullet|^j)\cdot(\BNZ)\cdot(|\bullet|^k)$\\
\phx\qquad\qquad\quad $\,\,\,\subseteq(\BNZ)\cdot(|\bullet|^{j+k})=\scrbigo_{j+k}$, as desired.
\end{proof}

Recall: $\forall j\in\N$, $\forall P\in\scrh_j$, $\exists c\in\R$ s.t., $\forall x\in\R$, $P(x)=cx^j$.

Also, $\forall j\in\N$, elements of $\scrh_j$ are said to be homogeneous polynomials of degree $j$.

Recall: $\scrc=\scrh_0$, $\scrl=\scrh_1$, $\scrq=\scrh_2$, $\scrk=\scrh_3$.

Elements of $\scrc$ are said to be {\bf constant}.

Elements of $\scrl$ are said to be {\bf (homogeneous) linear}.

Elements of $\scrq$ are said to be {\bf (homogeneous) quadratic}.

Elements of $\scrk$ are said to be {\bf (homogeneous) cubic}.

\begin{thm}
Let $L\in\scrl$. \qquad
Then $L(1)=\sl_L$.
\end{thm}

\begin{proof}
Since $L\in\scrl$, choose $m\in\R$ s.t., $\forall x\in\R$, $L(x)=mx$.\\
Then $\sl_L=m$. \qquad
Then $L(1)=m\cdot1=m=\sl_l$, as desired.
\end{proof}

NOTE: Next year, we'll just use $L(1)$ as the definition of $\sl_L$.

We recalled the definition of $f_p^T$, see \dref{defn-ftp}.

We recalled the definition of $\LINS_pf$, see \dref{defn-LINS}.

We recalled the definition of $f'$, see \dref{defn-one-var-derivative}.

The next theorem asserts: ``Any linear function $\R\to\R$ has linear order.''

\begin{thm}
\qquad $\scrl\subseteq\scrbigo_1$.
\end{thm}

\begin{proof}
Want: $\forall L\in\scrl$, $L\in\scrbigo_1$.\\
Given $L\in\scrl$. \qquad
Want: $L\in\scrbigo_1$. \qquad
Want: $L\in(\BNZ)\cdot(|\bullet|)$.\\
Let $\ds{\gamma:=\adj_0^j\left(\frac{L}{|\bullet|}\right)}$. \qquad
Want: $\gamma\in\BNZ$ and $L=\gamma\cdot(|\bullet|)$.\\
Know: $\forall x\in\R_0^\times$, $\ds{\gamma(x)=\left(\frac{L}{|\bullet}\right)(x)}$. \qquad
Also, $\gamma(0)=0$.\\
Also, $\dom[\gamma]=((\dom[L])_0^\times)_0^+=(\R_0^\times)_0^+=\R$,
so $B_\R(0,1)\subseteq\dom[\gamma]$, so $\gamma\in\DNZ$.\\
Since $L\in\scrl$, choose $m\in\R$ s.t., $\forall x\in\R$, $L(x)=mx$.\\
Let $a:=|m|$. \qquad
Then $0\le a$.\\
Know: $\forall x\in\R_0^\times$, \quad
$\ds{|\gamma(x)|=\left|\left(\frac{L}{|\bullet|}\right)(x)\right|=\left|\frac{L(x)}{|x|}\right|=\frac{|L(x)|}{|x|}}$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\ds{=\frac{|m|\cdot|x|}{|x|}=|m|=a}$.\\
So, since $|\gamma(0)|=|0|=0\le a$, we conclude: $\forall x\in\R$, $|\gamma(x)|\le a$.\\
Then, $\forall x\in\R$, we have: $\gamma(x)\in[-a;a]$.\\
Then $\im[\gamma]\subseteq[-a;a]$.\\
Since $\gamma_*(B_\R(0,1))\subseteq\im[\gamma]\subseteq[-a;a]$,\\
\phx\qquad and since $[-a;a]$ is bounded in $\R$,\\
\phx\qquad we conclude that $\gamma_*(B_\R(0,1))$ is bounded in $\R$.\\
So, since $\gamma\in\DNZ$, we get $\gamma\in\BNZ$.\\
Want: $L=\gamma\cdot(|\bullet|)$. \qquad
Want: $\forall x\in\R$, $L(x)=(\gamma\cdot(|\bullet|))(x)$.\\
Given $x\in\R$. \qquad
Want: $L(x)=(\gamma\cdot(|\bullet|))(x)$.\\
Want: $[\gamma(x)]\cdot[|x|]=L(x)$.\\
One of the following is true:\\
\phx\qquad (1) $x=0$ \qquad\qquad or \qquad\qquad (2) $x\ne0$.\\
\\
{\it Case (1):}\\
We have $[\gamma(x)]\cdot[|x|]=[\alpha(0)]\cdot[|0|]=0\cdot0=0=m\cdot0=L(0)=L(x)$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
We have $\ds{[\gamma(x)]\cdot[|x|]=\left[\left(\frac{L}{|\bullet|}\right)(x)\right]\cdot[|x|]=\frac{L(x)}{|x|}\cdot|x|=L(x)}$.\\
{\it End of Case (2).}
\end{proof}

\begin{thm}
\qquad $\forall k\in\N_0$, $\scrh_k\subseteq\scrbigo_k$.
\end{thm}

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

\begin{thm}
$(\scrc\subseteq\scrbigo_0)\,\,\&\,\,(\scrl\subseteq\scrbigo_1\subseteq\scrlito_0)$\\
\phx\qquad\qquad\qquad\qquad $\,\,\&\,\,(\scrq\subseteq\scrbigo_2\subseteq\scrlito_1)\,\,\&\,\,(\scrk\subseteq\scrbigo_3\subseteq\scrlito_2)$\\
\phx\qquad\qquad\qquad\qquad $\,\,\&\,\,(\forall k\in\N,\,\,\scrh_k\subseteq\scrbigo_k\subseteq\scrlito_{k-1})$.
\end{thm}

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

We recalled \tref{thm-degreek-implies-not-subk}.

To summarize the preceding discussion:\\
\phx\qquad Any constant has constant order.\\
\phx\qquad\qquad However, any nonzero constant is not subconstant.\\
\phx\qquad Any linear function has linear order (hence is subconstant).\\
\phx\qquad\qquad However, any nonzero linear function is not sublinear.\\
\phx\qquad Any quadratic function has quadratic order (hence is sublinear).\\
\phx\qquad\qquad However, any nonzero quadratic function is not subquadratic.\\
\phx\qquad Any cubic function has cubic order (hence is subquadratic).\\
\phx\qquad\qquad However, any nonzero cubic function is not subcubic.\\
\phx\qquad {\it Etc.}\\

\begin{thm}
Let $f:\R\drta\R$, $p\in\dom[f']$.\\
Then $\exists L\in\LINS_pf$, $\exists R\in\scrlito_1$ s.t.~$(L+R=f_p^T)\,\&\,(f'_p=\sl_L)$.
\end{thm}

\begin{proof}
Since $p\in\dom[f']$, we get $f'_p\ne\frownie$.\\
So, since $f'_p=\UE\{\sl_M\,|\,M\in\LINS_pf\}$,
we get: $\LINS_pf\ne\frownie$.\\
Choose $L\in\LINS_pf$. \qquad
Then, by \tref{thm-never-two-lins}, $\LINS_pf=\{L\}$.\\
Then $f'_p=\UE\{\sl_L\}=\sl_L$. \qquad
Want: $L+R=f_p^T$.\\
Since $L\in\scrl$, we see that $L-L=\bfzero$.\\
Then $L+R=L+f_p^T-L=f_p^T+\bfzero=f_p^T$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-diffatp-implies-doubletranslate-decomp}
Let $f:\R\drta\R$, $p\in\dom[f']$.\\
Then $\exists L\in\LINS_pf$, $\exists R\in\scrlito_1$ s.t.~$[\,(\,L+R=f_p^T\,)\,\&\,(\,f'_p=\sl_L\,)\,]$.
\end{thm}

\begin{proof}
Since $p\in\dom[f']$, we get $f'_p\ne\frownie$.\\
Then $\UE\{\sl_M\,|\,M\in\LINS_pf\}=f'_p\ne\frownie$, and so $\LINS_pf\ne\emptyset$.\\
Choose $L\in\LINS_pf$. \qquad
Let $R:=f_p^T-L$.\\
Then, by definition of $\LINS_pf$, we have: $R\in\scrlito_1$.\\
Want: $(\,L+R=f_p^T\,)\,\&\,(\,f'_p=\sl_L\,)$.\\
By \tref{thm-never-two-lins}, $\LINS_pf=\{L\}$.\\
Then $\{\sl_M\,|\,M\in\LINS_pf\}=\{\sl_L\}$.\\
Then $f'_p=\UE\{\sl_M\,|\,M\in\LINS_pf\}=\UE\{\sl_L\}=\sl_L$.\\
Want: $L+R=f_p^T$.\\
Since $L\in\LINS_pf\subseteq\scrl$, we get $L-L=\bfzero$.\\
Then $L+R=L+(f_p^T-L)=f_p^T+\bfzero=f_p^T$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-lin-implies-contin}
Let $L\in\scrl$. \qquad
Then $L$ is continuous.
\end{thm}

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

\begin{thm}\wrlab{thm-litok-implies-contin-at-zero}
Let $k\in\N_0$, $R\in\scrlito_k$. \qquad
Then $R$ is continuous at $0$.
\end{thm}

\begin{proof}
By \tref{thm-littleo0-is-CVZ}, $\scrlito_0=\CVZ$.\\
We have $R\in\scrlito_k\subseteq\scrlito_0=\CVZ$,\\
\phx\qquad and so $R$ is continuous at $0$.
\end{proof}

\begin{thm}\wrlab{thm-doubletranslate-of-continuity}
Let $f:\R\drta\R$, $p\in\R$. \qquad
Then\\
\phx\qquad\qquad\qquad $(\,f\hbox{ is continuous at }p\,)\,\Leftrightarrow\,(\,f_p^T\hbox{ is continuous at }0\,)$.
\end{thm}

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

\begin{thm}
Let $f:\R\drta\R$, $p\in\dom[f']$. \qquad
Then $f$ is continuous at $p$.
\end{thm}

\begin{proof}
By \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $L\in\scrl$ and $R\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $(\,f_p^T=L+R\,)\,\&\,(\,f'_p=\sl_L\,)$.\\
By \tref{thm-lin-implies-contin}, $L$ is continuous at $0$.\\
By \tref{thm-litok-implies-contin-at-zero}, $R$ is continuous at $0$.\\
Then by \tref{thm-sum-contin-is-contin}, $L+R$ is continuous at $0$.\\
So, since $f_p^T=L+R$, we conclude that $f_p^T$ is continuous at $0$.\\
Then, by $\Leftarrow$ of \tref{thm-doubletranslate-of-continuity}, $f$ is continuous at $p$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-slope-of-linearization-is-value-of-deriv}
Let $f:\R\to\R$, $p\in\R$ and $L\in\LINS_pf$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $f'_p=\sl_L$.
\end{thm}

\begin{proof}
By \tref{thm-uniqueness-of-limit}, $\LINS_pf=\{L\}$.\\
Then $f'_p=\UE\{\sl_M\,|\,M\in\LINS_pf\}=\UE\{\sl_L\}=\sl_L$.
\end{proof}

\section{The Product and Chain Rules}

\begin{thm}
Let $L\in\scrl$, $b\in\R$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\sl_{Lb}=(\sl_l)\cdot b$.
\end{thm}

\begin{proof}
We have $\sl_{Lb}=(Lb)(1)=[L(1)]\cdot b=(\sl_l)\cdot b$, as desired.
\end{proof}

\begin{thm}
Let $L,M\in\scrl$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\sl_{L+M}=(\sl_l)+(\sl_M)$.
\end{thm}

\begin{proof}
We have $\sl_{L+M}=(L+M)(1)$.\\
\phx\qquad\qquad\qquad\qquad $=[L(1)]+[M(1)]=(\sl_l)+(\sl_M)$, as desired.
\end{proof}

\tref{thm-HS-prod-rule}, below, is the {\bf High School Product Rule}\index[terms]{Product Rule, High School}.

\begin{thm}\wrlab{thm-HS-prod-rule}
Let $a,A,b,B\,\,\,\,{}^\frown\!\!\in\,\,\R$.\\
Then $AB-ab\,\,=\,\,a\cdot[B-b]\,+\,b\cdot[A-a]\,+\,[A-a]\cdot[B-b]$.
\end{thm}

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

\tref{thm-precalc-prod-rule}, below, is the \bfindex[Precalculus Product Rule].

\begin{thm}\wrlab{thm-precalc-prod-rule}
Let $f,g:\R\drta\R$, $p\in\R$, $a:=f_p$, $b:=g_p$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $(fg)_p^T=a\cdot[g_p^T]+b\cdot[f_p^T]+[f_p^T]\cdot[g_p^T]$.
\end{thm}

\begin{proof}
Want: $\forall h\in\R$,\\
\phx\qquad\qquad\qquad $(fg)_p^T(h)=((f_p^T)\cdot(g_p)+(f_p)\cdot(g_p^T)+(f_p^T)\cdot(g_p^T))(h)$.\\
Given $h\in\R$.\\
Want: $(fg)_p^T(h)=((f_p^T)\cdot(g_p)+(f_p)\cdot(g_p^T)+(f_p^T)\cdot(g_p^T))(h)$.\\
Let $A:=f_{p+h}$, $B:=g_{p+h}$.\\
Then $A-a=f_{p+h}-f_p=f_p^T(h)$.\\
Also, $B-b=g_{p+h}-g_p=g_p^T(h)$.\\
By \tref{thm-HS-prod-rule}, $AB-ab\,\,=\,\,a\cdot[B-b]\,+\,b\cdot[A-a]\,+\,[A-a]\cdot[B-b]$.\\
Then
$(fg)_p^T(h)=[(fg)_{p+h}]-[(fg)_p]=f_{p+h}\cdot g_{p+h}-f_p\cdot g_p$\\
\phantom{xxxx}$=AB-ab=(A-a)b+a(B-b)+(A-a)(B-b)$\\
\phantom{xxxx}$=[f_p^T(h)]\cdot[g(p)]+[f(p)]\cdot[g_p^T(h)]+[f_p^T(h)]\cdot[g_p^T(h)]$\\
\phantom{xxxx}$=((f_p^T)\cdot(g_p)+(f_p)\cdot(g_p^T)+(f_p^T)\cdot(g_p^T))(h)$,\\
as desired.
\end{proof}

\tref{thm-prod-rule}, below, is the \bfindex[Product Rule].

\begin{thm}\wrlab{thm-prod-rule}
Let $f,g\in\R\drta\R$, $p\in\R$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $(fg)'_p\,\,=^*\,\,(f'_p)\cdot(g_p)+(f_p)\cdot(g'_p)$.
\end{thm}

\begin{proof}
Want: $[(f'_p)\!\cdot\!(g_p)\!+\!(f_p)\!\cdot\!(g'_p)\!\ne\!\frownie]\!\Rightarrow\![(fg)'_p\!=\!(f'_p)\!\cdot\!(g_p)\!+\!(f_p)\!\cdot\!(g'_p)]$.\\
Assume: $(f'_p)\cdot(g_p)+(f_p)\cdot(g'_p)\ne\frownie$.\\
Want: $(fg)'_p=(f'_p)\cdot(g_p)+(f_p)\cdot(g'_p)$.\\
Since $[(f'_p)\cdot(g_p)+(f_p)\cdot(g'_p)\ne\frownie]$,\\
\phx\qquad\qquad we get: \qquad $f_p\ne\frownie\ne g_p$ \qquad and \qquad $f'_p\ne\frownie\ne g'_p$.\\
Since $f'_p\ne\frownie$, we see that $p\in\dom[f']$.\\
Then, by \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $L\in\LINS_pf$ and $R\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $f_p^T=L+R$ \qquad and \qquad $f'_p=\sl_L$.\\
Since $g'_p\ne\frownie$, we see that $p\in\dom[g']$.\\
Then, by \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $M\in\LINS_pf$ and $S\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $g_p^T=M+S$ \qquad and \qquad $g'_p=\sl_M$.\\
Let $a:=f_p$ and $b:=g_p$.\\
By the Precalculus Product Rule (\tref{thm-precalc-prod-rule}),\\
\phx\qquad we have: $(fg)_p^T=a\cdot[g_p^T]+b\cdot[f_p^T]+[f_p^T]\cdot[g_p^T]$.\\
Then $(fg)_p^T=a\cdot[M+S]+b\cdot[L+R]+[L+R]\cdot[M+S]$\\
\phx\qquad $=(b\cdot L+a\cdot M)+(a\cdot S+b\cdot R+[L+R]\cdot[M+S])$.\\
We have $b\cdot L+a\cdot M\in\scrl$. \quad
Then $(b\cdot L+a\cdot M)-(b\cdot L+a\cdot M)=\bfzero$.\\
Then $(fg)_p^T-(b\cdot L+a\cdot M)=a\cdot S+b\cdot R+[L+R]\cdot[M+S]$.\\
Since $L+R,M+S\in\scrl+\scrlito_1\subseteq\scrbigo_1+\scrbigo_1\subseteq\scrbigo_1$,\\
\phx\qquad we get: $[L+R]\cdot[M+S]\in\scrbigo_1\cdot\scrbigo_1\subseteq\scrbigo_2$.\\
Then $(fg)_p^T-(b\cdot L+a\cdot M)\in\R\cdot\scrlito_1+\R\cdot\scrlito_1+\scrbigo_2$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\subseteq\scrlito_1+\scrlito_1+\scrlito_1\subseteq\scrlito_1$.\\
So, since $b\cdot L+a\cdot M\in\scrl$, we see that $b\cdot L+a\cdot M\in\LINS_p(fg)$.\\
Then: $(fg)'_p=\sl_{b\cdot L+a\cdot M}=b\cdot(\sl_L)+a\cdot(\sl_M)$\\
\phx\qquad\qquad\quad $=(\sl_L)\cdot b+a\cdot(\sl_M)=(f'_p)\cdot(g_p)+(f_p)\cdot(g'_p)$, as desired.
\end{proof}

\begin{defn}
Let $X$, $Y$ and $Z$ be sets.\\
Let $\scrs\subseteq\scrpf_{XY}$, $\scrt\subseteq\scrpf_{YZ}$. \quad
Then $\scrt\circ\scrs:=\{g\circ f\,|\,g\in\scrt,\,f\in\scrs\}$.
\end{defn}

\begin{defn}
Let $X$, $Y$ and $Z$ be sets.\\
Let $f\in\scrpf_{XY}$, $\scrt\subseteq\scrpf_{YZ}$. \quad
Then $\scrt\circ f:=\scrt\circ(\{f\})$.
\end{defn}

\begin{defn}
Let $X$, $Y$ and $Z$ be sets.\\
Let $\scrs\subseteq\scrpf_{XY}$, $g\in\scrpf_{YZ}$. \quad
Then $g\circ\scrs:=(\{g\})\circ\scrs$.
\end{defn}

\begin{thm}\wrlab{thm-composites-CVZ-BNZ}
$(\CVZ)\circ(\CVZ)\subseteq\CVZ$\\
\phx\qquad\qquad\quad$\,\,$ and \quad $(\BNZ)\circ(\CVZ)\subseteq\BNZ$.
\end{thm}

\begin{proof}
Unassigned HW: $(\CVZ)\circ(\CVZ)\subseteq\CVZ$.\\
\phx\qquad\qquad\qquad\quad Want: $(\BNZ)\circ(\CVZ)\subseteq\BNZ$.\\
\phx\qquad\qquad By HW\#2-2, $(\BNZ)\circ(\CVZ)\subseteq\BNZ$, as desired.
\end{proof}

\begin{defn}
Let $X$ be a set and let $f:X\drta\R$.\\
Then $|f|:X\drta\R$ is defined by $(|f|)(x)=|f(x)|$.
\end{defn}

\begin{defn}
Let $X$ be a set and let $\scrs\subseteq\scrpf_{X\R}$.\\
Then $|\scrs|:=\{|f|~\hbox{s.t.}~f\in\scrs\}$.
\end{defn}

\begin{thm}
$|\BNZ|\subseteq\BNZ$ and $|\CVZ|\subseteq\CVZ$.
\end{thm}

\begin{proof}
Unassigned HW: $|\BNZ|\subseteq\BNZ$.\\
Want: $|\CVZ|\subseteq\CVZ$.\\
Unassigned HW: $|\bullet|\in\CVZ$.
By \tref{thm-composites-CVZ-BNZ}, $(\CVZ)\circ(\CVZ)\subseteq\CVZ$.\\
Then $|\CVZ|=(|\bullet|)\circ(\CVZ)\subseteq(\CVZ)\circ(\CVZ)\subseteq\CVZ$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-comp-prod-prod}
Let $\psi,\psi:\R\drta\R$ and let $j,k\in\N_0$.\\
Let $\beta:=\phi\cdot(|\bullet|^j)$ and let $\gamma:=\psi\cdot(|\bullet|^k)$.\\
Then $\beta\circ\gamma=(\phi\circ\gamma)\cdot(|\psi|^j)\cdot(|\bullet|^{jk})$.
\end{thm}

\begin{proof}
Want: $\forall x\in\R$, $(\beta\circ\gamma)(x)=((\phi\circ\gamma)\cdot(|\psi|^j)\cdot(|\bullet|^{jk}))(x)$.\\
Given $x\in\R$. \quad
Want: $(\beta\circ\gamma)(x)=((\phi\circ\gamma)\cdot(|\psi|^j)\cdot(|\bullet|^{jk}))(x)$.\\
We compute: $(\beta\circ\gamma)(x)=(\beta(\gamma(x))=(\phi\cdot(|\bullet|^j))(\gamma(x))$\\
\phx\qquad\qquad\qquad\qquad $=[\phi(\gamma(x))]\cdot[|\,\,\gamma(x)\,\,|^j]$\\
\phx\qquad\qquad\qquad\qquad $=[(\phi\circ\gamma)(x)]\cdot[|\,\,(\psi\cdot(|\bullet|^k))(x)\,\,|^j]$\\
\phx\qquad\qquad\qquad\qquad $=[(\phi\circ\gamma)(x)]\cdot[|\,\,[\psi(x)]\cdot[|x|^k]\,\,|^j]$\\
\phx\qquad\qquad\qquad\qquad $=[(\phi\circ\gamma)(x)]\cdot[|\psi(x)|]\cdot[|x|^{jk}]$\\
\phx\qquad\qquad\qquad\qquad $=((\phi\circ\gamma)\cdot(|\psi|^j)\cdot(|\bullet|^{jk}))(x)$, as desired.
\end{proof}

\begin{thm}\wrlab{powers-of-BNZ-in-BNZ}
Let $\alpha\in\BNZ$, $j\in\N_0$. \qquad
Then $\alpha^j\in\BNZ$.
\end{thm}

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

\begin{thm}\wrlab{powers-of-CVZ-in-CVZ}
Let $\alpha\in\CVZ$, $j\in\N$. \qquad
Then $\alpha^j\in\CVZ$.
\end{thm}

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

\begin{thm}\wrlab{thm-comp-oj-Ok}
Let $j,k\in\N$.\\
Then $\scrlito_j\circ\scrbigo_k\subseteq\scrlito_{jk}$.
\end{thm}

\begin{proof}
Want: $\forall\alpha\in\scrlito_j\circ\scrbigo_k$, $\alpha\in\scrlito_{jk}$.\\
Given $\alpha\in\scrlito_j\circ\scrbigo_k$. \quad
Want: $\alpha\in\scrlito_{jk}$.\\
Since $\alpha\in\scrlito_j\circ\scrbigo_k$,
choose $\beta\in\scrlito_j$, $\gamma\in\scrbigo_k$ s.t.~$\alpha=\beta\circ\gamma$.\\
Want: $\beta\circ\gamma\in\scrlito_{jk}$.\\
Since $\beta\in\scrlito_j=(\CVZ)\cdot(|\bullet|^j)$,
choose $\phi\in\CVZ$ s.t.~$\beta=\phi\cdot(|\bullet|^j)$.\\
Since $\gamma\in\scrbigo_k=(\BNZ)\cdot(|\bullet|^k)$,
choose $\psi\in\BNZ$ s.t.~$\gamma=\psi\cdot(|\bullet|^k)$.\\
By \tref{thm-comp-prod-prod}, $\beta\circ\gamma=(\phi\circ\gamma)\cdot(|\psi|^j)\cdot(|\bullet|^{jk})$.\\
Want: $\beta\circ\gamma\in(\CVZ)\cdot(|\bullet|^{jk})$. \qquad
Want: $(\phi\circ\gamma)\cdot(|\psi|^j)\in\CVZ$.\\
Since $k\in\N$, we get $\scrbigo_k\subseteq\scrbigo_1$. \qquad
By \tref{thm-bigO-subset-littleo}, $\scrbigo_1\subseteq\scrlito_0$.\\
By \tref{thm-littleo0-is-CVZ}, $\scrlito_0=\CVZ$. \qquad
Then $\gamma\in\scrbigo_k\subseteq\scrbigo_1\subseteq\scrlito_0=\CVZ$.\\
By \tref{thm-composites-CVZ-BNZ}, $(\CVZ)\circ(\CVZ)\subseteq\CVZ$.\\
Then $\phi\circ\gamma\in(\CVZ)\circ(\CVZ)\subseteq\CVZ$.\\
Also, $|\psi|\in|\BNZ|\subseteq\BNZ$, so, by \tref{powers-of-BNZ-in-BNZ}, $|\psi|^j\in\BNZ$.\\
By HW\#1-4, $(\BNZ)\cdot(\CVZ)\subseteq\CVZ$.\\
Then $(\phi\circ\gamma)\cdot(|\psi|^j)\in(\CVZ)\cdot(\BNZ)=(\BNZ)\cdot(\CVZ)\subseteq\BNZ$.
\end{proof}

\begin{thm}\wrlab{thm-comp-Oj-ok}
Let $j,k\in\N$.\\
Then $\scrbigo_j\circ\scrlito_k\subseteq\scrlito_{jk}$.
\end{thm}

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

\begin{thm}\wrlab{thm-comp-oj-ok}
Let $j,k\in\N$.\\
Then $\scrlito_j\circ\scrlito_k\subseteq\scrlito_{jk}$.
\end{thm}

\begin{proof}
By \tref{thm-comp-oj-Ok}, $\scrlito_j\circ\scrbigo_k\subseteq\scrlito_{jk}$.\\
Also, $\scrlito_k\subseteq\scrbigo_k$.\\
Then $\scrlito_j\circ\scrlito_k\subseteq\scrlito_j\circ\scrbigo_k\subseteq\scrlito_{jk}$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-comp-Oj-Ok}
Let $j,k\in\N$.\\
Then $\scrbigo_j\circ\scrbigo_k\subseteq\scrbigo_{jk}$.
\end{thm}

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

\tref{thm-precalc-chain-rule}, below, is the \bfindex[Precalculus Chain Rule].

\begin{thm}\wrlab{thm-precalc-chain-rule}
Let $f,g:\R\drta\R$, $p\in\R$, $q:=f_p$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $(g\circ f)_p^T=(g_q^T)\circ(f_p^T)$.
\end{thm}

\begin{proof}
Want: $\forall h\in\R$, $((g\circ f)_p^T)(h)=((g_q^T)\circ(f_p^T))(h)$.\\
Given $h\in\R$. \qquad
Want: $((g\circ f)_p^T)(h)=((g_q^T)\circ(f_p^T))(h)$.\\
We compute $((g\circ f)_p^T)(h)=[(g\circ f)(p+h)]-[(g\circ f)(p)]$\\
\phx\qquad\qquad\qquad\qquad\quad $=[g(f_{p+h})]-[g(f_p)]=[g(f_{p+h})]-[g(q)]$.\\
Exactly one of the following is true:\\
\phx\qquad (1) $q=\frownie$ \qquad\qquad or \qquad\qquad (2) $q\ne\frownie$.\\
\\
{\it Case (1):}\\
Since $q=\frownie$, we get:\\
\phx\qquad both \quad $[g(f_{p+h})]-[g(q)]=\frownie$ \quad and \quad $((g_q^T)\circ(f_p^T))(h)=\frownie$.\\
Then $((g\circ f)_p^T)(h)=[g(f_{p+h})]-[g(q)]=\frownie=((g_q^T)\circ(f_p^T))(h)$.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Since $f_p=q\ne\frownie$, we get $f_p\in\im[f]\subseteq\R$.\\
Then $q=f_p\in\R$, so $q-q=0$.\\
Let $k:=(f_p^T)(h)$. \qquad
Then $k=f_{p+h}-f_p=f_{p+h}-q$.\\
Then $q+k=q+(f_{p+h}-q)=f_{p+h}+(q-q)=f_{p+h}+0=f_{p+h}$.\\
Then $((g\circ f)_p^T)(h)=[g(f_{p+h})]-[g(q)]=[g(q+k)]-[g(q)]$\\
\phx\qquad\qquad\qquad\qquad $=g_q^T(k)=(g_q^T)((f_p^T)(h))=((g_q^T)\circ(f_p^T))(h)$,\\
as desired.
{\it End of Case (2).}
\end{proof}

\begin{thm}\wrlab{thm-Mx-is-slM-times-x}
Let $M\in\scrl$, $x\in\R$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $M(x)=(\sl_M)\cdot x$.
\end{thm}

\begin{proof}
Since $M\in\scrl$, we get $M(x\cdot 1)=x\cdot[M(1)]$.\\
Then $M(x)=M(x\cdot 1)=x\cdot[M(1)]=x\cdot(\sl_M)=(\sl_M)\cdot x$.
\end{proof}

\begin{thm}
Let $L,M\in\scrl$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\sl_{M\circ L}=(\sl_M)\cdot(\sl_L)$.
\end{thm}

\begin{proof}
Let $x:=\sl_L$. \qquad
Then $x=L(1)$.\\
Also, by \tref{thm-Mx-is-slM-times-x}, we have $M(x)=(\sl_M)\cdot x$.\\
Then $\sl_{M\circ L}=(M\circ L)(1)=M(L(1))$\\
\phx\qquad\qquad $=M(x)=(\sl_M)\cdot x=(\sl_M)\cdot(\sl_L)$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-circ-additive-on-left}
Let $f$ and $g$ be functionals and let $h$ be a function.\\
\phx\qquad\qquad\qquad\qquad\quad Then $(f+g)\circ h=(f\circ h)+(g\circ h)$.
\end{thm}

\begin{proof}
Want: $\forall x$, $((f+g)\circ h)(x)=((f\circ h)+(g\circ h))(x)$.\\
Given $x$. \qquad
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 $=[(f\circ h)(x)]+[(g\circ h)(x)]=((f\circ h)+(g\circ h))(x)$.
\end{proof}

\tref{thm-circ-additive-on-left} asserts: ``$\circ$ is additive on the left.''

WARNING: $\circ$ is not additive on the right.\\
Let $f:=\id_\R$, $g:=\id_\R$ and $h:=(\id_\R)^2$.\\
Then $h\circ(f+g)=(f+g)^2=f^2+2fg+g^2\ne f^2+g^2=(h\circ f)+(h\circ g)$.

However, if we replace $h$ by a homogeneous linear function, then we do get
additivity on the right:

\begin{thm}\wrlab{thm-circ-sometimes-additive-on-rt}
Let $L\in\scrl$.
Let $f$ and $g$ be functionals.\\
\phx\qquad\qquad\qquad\qquad\quad Then $L\circ(f+g)=(L\circ f)+(L\circ g)$.
\end{thm}

\begin{proof}
Want: $\forall x$, $(L\circ(f+g))(x)=((L\circ f)+(L\circ g))(x)$.\\
Given $x$. \qquad
Want: $(L\circ(f+g))(x)=((L\circ f)+(L\circ g))(x)$.\\
Since $L\in\scrl$, we get: $L(f_x+g_x)=[L(f_x)]+[L(g_x)]$.\\
We have $(L\circ(f+g))(x)=L((f+g)_x)=L(f_x+g_x)=[L(f_x)]+[L(g_x)]$\\
\phx\qquad\qquad\qquad $=[(L\circ f)(x)]+[(L\circ g)(x)]=((L\circ f)+(L\circ g))(x)$.
\end{proof}

\tref{thm-chain-rule}, below, is the \bfindex[Chain Rule].

\begin{thm}\wrlab{thm-chain-rule}
Let $f,g:\R\drta\R$, $p\in\R$, $q:=f_p$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $(g\circ f)'_p\,\,=^*\,\,(g'_q)\cdot(f'_p)$.
\end{thm}

\begin{proof}
Want: $[(g'_q)\cdot(f'_p)\ne\frownie]\Rightarrow[(g\circ f)'_p=(g'_q)\cdot(f'_p)]$.\\
Assume: $(g'_q)\cdot(f'_p)\ne\frownie$. \qquad
Want: $(g\circ f)'_p=(g'_q)\cdot(f'_p)$.\\
Since $(g'_q)\cdot(f'_p)\ne\frownie$, we see:\\
\phx\qquad both \qquad $g'_q\ne\frownie$ \qquad and \qquad $f'_p\ne\frownie$.\\
Since $f'_p\ne\frownie$, we get $p\in\dom[f']$.\\
Then, by \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $L\in\LINS_pf$ and $R\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $f_p^T=L+R$ \qquad and \qquad $f'_p=\sl_L$.\\
Since $g'_q\ne\frownie$, we get $q\in\dom[g']$.\\
Then, by \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $M\in\LINS_qg$ and $S\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $g_q^T=M+S$ \qquad and \qquad $g'_q=\sl_M$.\\
By the Precalculus Chain Rule (\tref{thm-precalc-chain-rule}), $(g\circ f)_p^T=(g_q^T)\circ(f_p^T)$.\\
Then $(g\circ f)_p^T=(g_q^T)\circ(f_p^T)=(M+S)\circ(L+R)$\\
\phx\qquad\qquad\qquad $=[M\circ(L+R)]+[S\circ(L+R)]$\\
\phx\qquad\qquad\qquad $=[M\circ L]+[M\circ R]+[S\circ(L+R)]$.\\
Since $L,M\in\scrl$, we get $M\circ L\in\scrl$.\\
Then $(M\circ L)-(M\circ L)=\bfzero$.\\
Then $(g\circ f)_p^T-(M\circ L)=[M\circ R]+[S\circ(L+R)]$.\\
We have $L+R\in\scrl+\scrlito_1\subseteq\scrbigo_1+\scrbigo_1\subseteq\scrbigo_1$. \qquad
Also, $M\in\scrl\subseteq\scrbigo_1$.\\
Then $(g\circ f)_p^T-(M\circ L)\in[\scrbigo_1\circ\scrlito_1]+[\scrlito_1\circ\scrbigo_1]\subseteq\scrlito_1+\scrlito_1\subseteq\scrlito_1$.\\
Then $M\circ L\in\LINS_p(g\circ f)$.\\
Then $(g\circ f)'_p=\sl_{M\circ L}=(\sl_M)\cdot(\sl_L)=(g'_q)\cdot(f'_p)$, as desired.
\end{proof}

\section{The Quotient Rule}

\begin{thm}\wrlab{thm-deriv-of-recip}
Define $r:\R\to\R$ by $r_x=1/x$.\\
Then, $\forall x\in\R$, $r'_x=-1/(x^2)$.
\end{thm}

\begin{proof}
Unassigned HW. See HW\#3-2.
\end{proof}

\tref{thm-quot-rule}, below, is the \bfindex[Quotient Rule].

\begin{thm}\wrlab{thm-quot-rule}
Let $f,g:\R\to\R$ and let $x\in\R$.\\
Then $\ds{\left(\frac{f}{g}\right)'_x\,\,=^*\,\,\frac{(g_x)\cdot(f'_x)-(f_x)\cdot(g'_x)}{(g_x)^2}}$.
\end{thm}

\begin{proof}
Define $r:\R\to\R$ by $r_x=1/x$. \qquad
Let $y:=g_x$.\\
By \tref{thm-chain-rule}, we have: $(r\circ g)'_x\,=^*\,(r'_y)\cdot(g'_x)$.\\
By \tref{thm-deriv-of-recip}, we have: $r'_y=-1/(y^2)$.\\
Then $\ds{\left(\frac{1}{g}\right)'_x\,=\,(r\circ g)'_x\,=^*\,(r'_y)\cdot(g'_x)}$\\
\phx\qquad\qquad\qquad $\ds{=\left(-\frac{1}{y^2}\right)\cdot(g'_x)=-\frac{g'_x}{y^2}=-\frac{g'_x}{(g_x)^2}}$.\\
By \tref{thm-prod-rule}, $\ds{\left(f\cdot\left(\frac{1}{g}\right)\right)'_x\,=^*\,(f'_x)\cdot\left(\left(\frac{1}{g}\right)_x\right)+(f_x)\cdot\left(\left(\frac{1}{g}\right)'_x\right)}$.\\
Then $\ds{\left(\frac{f}{g}\right)'_x=\left(f\cdot\left(\frac{1}{g}\right)\right)'_x\,=^*\,(f'_x)\cdot\left(\left(\frac{1}{g}\right)_x\right)+(f_x)\cdot\left(\left(\frac{1}{g}\right)'_x\right)}$\\
\phx\qquad\qquad $\ds{=^*\,\frac{f'_x}{g_x}+(f_x)\cdot\left(-\frac{g'_x}{(g_x)^2}\right)\,=\,\frac{(g_x)\cdot(f'_x)-(f_x)\cdot(g'_x)}{(g_x)^2}}$.
\end{proof}

\section{Fermat's Theorem}

\begin{defn}
Let $f$ and $g$ be functionals and let $S$ be a set.\\
Then $f<g$ on $S$ means: $\forall x\in S$, $f(x)<g(x)$.\\
Also, $f\le g$ on $S$ means: $\forall x\in S$, $f(x)\le g(x)$.\\
Then $f>g$ on $S$ means: $\forall x\in S$, $f(x)>g(x)$.\\
Also, $f\ge g$ on $S$ means: $\forall x\in S$, $f(x)\ge g(x)$.\\
Then $f=g$ on $S$ means: $\forall x\in S$, $f(x)=g(x)$.\\
\end{defn}

Keep in mind \aref{axiom-frownie-incomparable}.
From that axiom,\\
we get: $\forall y$, $\neg(\frownie<y)$. \qquad
Also, $\forall y$, $\neg(y<\frownie)$.\\
Also, $\forall y$, $\neg(\frownie<y)$. \qquad
Also, $\forall y$, $\neg(\frownie>y)$.\\
However, $\frownie=\frownie$, so both $\frownie\le\frownie$ and $\frownie\ge\frownie$.

\begin{defn}
Let $f$ be a functional, $a\in\R$, $S$ a set.\\
Then $f<a$ on $S$ means: $f<C_S^a$ on $S$.\\
Also, $f\le a$ on $S$ means: $f\le C_S^a$ on $S$.\\
Then $f>a$ on $S$ means: $f>C_S^a$ on $S$.\\
Also, $f\ge a$ on $S$ means: $f\ge C_S^a$ on $S$.\\
Also, $f=a$ on $S$ means: $f=C_S^a$ on $S$.\\
Then $a<f$ on $S$ means: $C_S^a<f$ on $S$.\\
Also, $a\le f$ on $S$ means: $C_S^a\le f$ on $S$.\\
Then $a>f$ on $S$ means: $C_S^a>f$ on $S$.\\
Also, $a\ge f$ on $S$ means: $C_S^a\ge f$ on $S$.\\
Also, $a=f$ on $S$ means: $C_S^a=f$ on $S$.\\
\end{defn}

\begin{thm}\wrlab{thm-deriv-commutes-with-scmult-exactly-if-scalar-nonzero}
Let $f:\R\drta\R$ and let $a\in\R_0^\times$.\\
Then $(af)'=a\cdot[f']$.
\end{thm}

\begin{proof}
Want: $\forall p\in\R$, $(af)'_p=(a\cdot[f'])_p$.\\
Given $p\in\R$. \qquad
Want: $(af)'_p=(a\cdot[f'])_p$. \qquad
Want: $(af)'_p=a\cdot[f'_p]$.\\
By \tref{thm-deriv-commutes-with-scalar-mult-contingent},
we have: $(af)'_p\,\,=^*\,\,a\cdot[f'_p]$.\\
It suffices to show: $(af)'_p\,\,\,\,{}^*\!\!=\,\,a\cdot[f'_p]$.\\
Let $g:=af$ and $b:=1/a$. \qquad
Then $ba=1$ and $bg=f$.\\
By \tref{thm-deriv-commutes-with-scalar-mult-contingent},
we have: $(bg)'_p\,\,=^*\,\,b\cdot[g'_p]$.\\
Reversing this, we get: $b\cdot[g'_p]\,\,\,\,{}^*\!\!=\,\,(bg)'_p$.\\
Multiplying by $a$, we get: $ab\cdot[g'_p]\,\,\,\,{}^*\!\!=\,\,a\cdot[(bg)'_p]$.\\
So, since $ab=1$ and since $bg=f$, we get: $[g'_p]\,\,\,\,{}^*\!\!=\,\,a\cdot[f'_p]$.\\
So, since $g=af$, we get: $[(af)'_p]\,\,\,\,{}^*\!\!=\,\,a\cdot[f'_p]$, as desired.\\
\end{proof}

\begin{thm}\wrlab{thm-deriv-pos-implies-behavior-near-pt}
Let $f:\R\drta\R$, $p\in\dom[f']$. \quad
Assume $f'_p>0$.\\
Then $\exists\delta>0$ s.t. \quad
\phx\qquad (1) $f>f_p$ on $(p;p+\delta)$ \qquad\qquad and\\
\phantom{gx}\qquad\qquad\qquad\qquad\qquad (2) $f<f_p$ on $(p-\delta;p)$.
\end{thm}

\begin{proof}
Since $p\in\dom[f']$, by \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $L\in\LINS_pf$ and $R\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $f_p^T=L+R$ \qquad and \qquad $f'_p=\sl_L$.\\
Since $R\in\scrlito_1$ and $L/2\in\scrl$, by HW\#2-5,\\
\phx\qquad choose $B\in\scrb_\R(0)$ s.t.~$|R|\le|L/2|$ on $B$.\\
Since $B\in\scrb_\R(0)$, choose $\delta>0$ s.t.~$B=B_\R(0,\delta)$.\\
Want: (1) and (2).\\
\\
{\it Proof of (1):}\\
By HW-2-1, \quad Want: $f_p^T>0$ on $(0;\delta)$.\\
We have $\sl_L=f'_p>0$.\\
Then, $\forall x>0$, we have $L(x)=(\sl_L)\cdot x>0$.\\
That is, $L>0$ on $(0;\infty)$. \qquad
Then $L>0$ on $(0;\delta)$.\\
Then $L/2>0$ on $(0;\delta)$. \qquad
Also, $|L/2|=L/2$ on $(0;\delta)$.\\
Since $(0;\delta)\subseteq(-\delta;\delta)=B_\R(0,\delta)=B$
and since $|R|\le|L/2|$ on $B$,\\
\phx\qquad we get: $|R|\le|L/2|$ on $(0;\delta)$.\\
So, as $|L/2|=L/2$ on $(0;\delta)$, we conclude:
$|R|\le L/2$ on $(0;\delta)$.\\
Then $-L/2\le R\le L/2$ on $(0;\delta)$.\\
Adding $L$, this yields: \quad
$L/2\le L+R\le3L/2$ on $(0;\delta)$.\\
So, since $L+R=f_p^T$, we get:
$L/2\le f_p^T\le3L/2$ on $(0;\delta)$.\\
Then $f_p^T\ge L/2>0$ on $(0;\delta)$, as desired.
{\it End of proof of (1).}\\
\\
{\it Proof of (2):} Unassigned HW.
{\it End of proof of (2).}
\end{proof}

\begin{thm}\wrlab{thm-neg-tansl-implies-neg-sec-slopes}
Let $f:\R\drta\R$, $p\in\dom[f']$. \quad
Assume $f'_p<0$.\\
Then $\exists\delta>0$ s.t. \quad
\phx\qquad (1) $f<f_p$ on $(p;p+\delta)$ \qquad\qquad and\\
\phantom{gx}\qquad\qquad\qquad\qquad\qquad (2) $f>f_p$ on $(p-\delta;p)$.
\end{thm}

\begin{proof}
Let $g:=-f$. \qquad
By \tref{thm-deriv-commutes-with-scmult-exactly-if-scalar-nonzero}, $g'=-f'$, so $g'_p=-f'_p$.\\
By \tref{thm-deriv-pos-implies-behavior-near-pt},
choose $\delta>0$ s.t.\\
\phx\qquad $g>g_p$ on $(p;p+\delta)$ \qquad\qquad and\\
\phx\qquad $g<g_p$ on $(p-\delta;p)$.\\
Want: (1) and (2).\\
From the choice of $\delta$, we get:\\
\phx\qquad $-g<-g_p$ on $(p;p+\delta)$ \qquad\qquad and\\
\phx\qquad $-g>-g_p$ on $(p-\delta;p)$.\\
So, since $-g=f$ and $-g_p=f_p$, we get: (1) and (2), as desired.
\end{proof}

\begin{defn}
Let $X$ be a metric space.\\
Let $f:X\drta\R$ and let $p\in\dom[f]$.\\
Then $f$ has a \bfindex[local minimum] at $p$ in $X$ means:\\
\phx\qquad $\exists B\in\scrb_\R(p)$ s.t.~$f\ge f_p$ on $B$.\\
Also, $f$ has a \bfindex[local maximum] at $p$ in $X$ means:\\
\phx\qquad $\exists B\in\scrb_\R(p)$ s.t.~$f\le f_p$ on $B$.
\end{defn}

\begin{thm}\wrlab{thm-neg-changes-local-maxmin}
Let $X$ be a metric space.\\
Let $f:X\drta\R$ and let $p\in\dom[f]$.\\
Then: \qquad\qquad $(\,\,f\hbox{ has a local maximum at }p\hbox{ in }\R\,\,)$\\
\phx\qquad\quad $\Leftrightarrow\qquad\,(\,\,-f\hbox{ has a local minimum at }p\hbox{ in }\R\,\,)$.\\
Also: \qquad\qquad $\,(\,\,f\hbox{ has a local minimum at }p\hbox{ in }\R\,\,)$\\
\phx\qquad\quad $\Leftrightarrow\qquad\,(\,\,-f\hbox{ has a local maximum at }p\hbox{ in }\R\,\,)$.\\
\end{thm}

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

\begin{defn}
Let $X$ be a metric space.\\
Let $f:X\drta\R$ and let $p\in\dom[f]$.\\
Then $f$ has a \bfindex[local extremum] at $p$ in $X$ means:\\
\phx\qquad either \qquad $f$ has a local minimum at $p$ in $X$\\
\phx\qquad\quad$\,\,$ or \qquad $f$ has a local maximum at $p$ in $X$.
\end{defn}

\begin{thm}\wrlab{thm-from-extr-to-max}
Let $X$ be a metric space.\\
Let $f:X\drta\R$ and let $p\in\dom[f]$.\\
Assume that $f$ has a local extremum at $p$ in $X$.\\
Then $\exists g\in\{f,-f\}$ s.t.~$g$ has a local maximum at $p$ in $X$.
\end{thm}

\begin{proof}
Follows from \tref{thm-neg-changes-local-maxmin}. Unassigned HW.
\end{proof}

\begin{thm}\wrlab{thm-balls-meet-left-right-nbds}
Let $p\in\R$, let $\delta>0$ and let $B\in\scrb_\R(p)$.\\
\phx\qquad\qquad Then: \quad $B\cap(p-\delta;p)\,\,\ne\,\,\emptyset\,\,\ne\,\,B\cap(p;p+\delta)$.
\end{thm}

\begin{proof}
Since $B\in\scrb_\R(p)$, choose $r>0$ s.t.~$B=B_\R(p,r)$.\\
Let $\alpha:=\min\{r,\delta\}$. \quad
Then $\alpha>0$.\\
Let $y:=p-(\alpha/2)$ and $z:=p+(\alpha/2)$.\\
Then $y,z\in B_\R(p,\alpha)$ and $y\in(p-\alpha;p)$ and $z\in(p;p+\alpha)$.\\
Also, since $\alpha<r$, we have $B_\R(p,\alpha)\subseteq B_\R(p,r)$.\\
Then $y,z\in B_\R(p,\alpha)\subseteq B_\R(p,r)=B$.\\
Also, since $\alpha<\delta$, we have $(p-\alpha;p)\subseteq(p-\delta;p)$.\\
Then $y\in(p-\alpha;p)\subseteq(p-\delta;p)$.\\
Also, since $\alpha<\delta$, we have $(p;p+\alpha)\subseteq(p;p+\delta)$.\\
Then $z\in(p;p+\alpha)\subseteq(p;p+\delta)$.\\
Since $y\in B$ and $y\in(p-\delta;p)$, we get $y\in B\cap(p-\delta;p)$.\\
Then $B\cap(p-\delta;p)\ne\emptyset$. \qquad
Want: $B\cap(p;p+\delta)\ne\emptyset$.\\
Since $z\in B$ and $z\in(p;p+\delta)$, we get $z\in B\cap(p;p+\delta)$.\\
Then $B\cap(p,p+\delta)\ne\emptyset$, as desired.
\end{proof}

\tref{thm-Fermat}, below, is called \bfindex[Fermat's Theorem].

\begin{thm}\wrlab{thm-Fermat}
Let $f:\R\drta\R$ and let $p\in\dom[f']$.\\
Assume that $f$ has a local extremum at $p$ in $\R$. \qquad
Then $f'_p=0$.
\end{thm}

\begin{proof}
By \tref{thm-from-extr-to-max}, choose $g\in\{f,-f\}$ s.t.\\
\phx\qquad $g$ has a local maximum at $p$ in $\R$.\\
Since $g\in\{f,-f\}$, it follows that $f\in\{g,-g\}$.\\
Then, by \tref{thm-deriv-commutes-with-scmult-exactly-if-scalar-nonzero}, $f'\in\{g',-g'\}$.\\
Then $f'_p\in\{g'_p,-g'_p\}$. \qquad
Want: $g'_p=0$.\\
Assume that $g'_p\ne0$. \qquad
Want: Contradiction.\\
Since $g$ has a local maximum at $p$ in $\R$,\\
\phx\qquad choose $B\in\scrb_\R(p)$ s.t.~$g\le g_p$ on $B$.\\
Since $g'_p\ne0$, exactly one of the following must be true:\\
\phx\qquad (1) $g'_p>0$ \qquad\qquad or \qquad\qquad (2) $g'_p<0$.\\
\\
{\it Case (1):}\\
By \tref{thm-deriv-pos-implies-behavior-near-pt}, choose $\delta>0$ s.t.\\
\phx\qquad $g>g_p$ on $(p;p+\delta)$ \qquad\qquad and\\
\phx\qquad $g<g_p$ on $(p-\delta;p)$.\\
By \tref{thm-balls-meet-left-right-nbds}, $B\cap(p;p+\delta)\ne\emptyset$.\\
Choose $x\in B\cap(p;p+\delta)\ne\emptyset$. \qquad
Then $x\in B$ and $x\in(p;p+\delta)$.\\
Since $x\in B$, by choice of $B$, we get $g_x\le g_p$.\\
Since $x\in(p;p+\delta)$, by choice of $\delta$, we get $g_x>g_p$. \qquad
Then $g_p<g_x$.\\
Then $g_p<g_x\le g_p$, so $g_p<g_p$. \qquad
Contradiction.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}
Unsassigned HW.
{\it End of Case (2).}
\end{proof}

\section{The Mean Value Theorem}

\begin{defn}
Let $X$ be a metric space and let $Y$ be a set.\\
Let $\lambda,\mu:X\drta Y$ and let $p\in X$.\\
Then $\lambda=\mu$ near $p$ means:
\quad $\exists B\in\scrb_X(p)$ s.t.~$\lambda=\mu$ on $B$.\\
Also, $\lambda<\mu$ near $p$ means:
\quad $\exists B\in\scrb_X(p)$ s.t.~$\lambda<\mu$ on $B$.\\
Also, $\lambda\le\mu$ near $p$ means:
\quad $\exists B\in\scrb_X(p)$ s.t.~$\lambda\le\mu$ on $B$.\\
Also, $\lambda>\mu$ near $p$ means:
\quad $\exists B\in\scrb_X(p)$ s.t.~$\lambda>\mu$ on $B$.\\
Also, $\lambda\ge\mu$ near $p$ means:
\quad $\exists B\in\scrb_X(p)$ s.t.~$\lambda\ge\mu$ on $B$.\\
\end{defn}

\begin{thm}
Let $\lambda,\mu:\R\drta\R$.\\
Assume $\mu\in\DNZ$. \quad
Assume $\lambda=\mu$ near $0$.\\
Then $\lambda\in\DNZ$.
\end{thm}

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

\begin{thm}
Let $\lambda,\mu:\R\drta\R$.\\
Assume $\mu\in\BNZ$. \quad
Assume $\lambda=\mu$ near $0$.\\
Then $\lambda\in\BNZ$.
\end{thm}

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

\begin{thm}\wrlab{thm-agrees-with-cvz-nearzero-in-cvz}
Let $\lambda,\mu:\R\drta\R$.\\
Assume $\mu\in\CVZ$. \quad
Assume $\lambda=\mu$ near $0$.\\
Then $\lambda\in\CVZ$.
\end{thm}

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

\begin{thm}\wrlab{thm-factorization-if-zeroatzero}
Let $\alpha:\R\drta\R$, $k\in\N_0$ and $\ds{\lambda:=\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)}$.\\
Assume $\alpha_0=0$. \quad
Then $\alpha=\lambda\cdot(|\bullet|^k)$.
\end{thm}

\begin{proof}
Want: $\forall x\in\R$, $\alpha_x=(\lambda\cdot(|\bullet|^k))_x$.\\
Given $x\in\R$. \quad
Want: $\alpha_x=(\lambda\cdot(|\bullet|^k))_x$. \quad
Want: $\alpha_x=(\lambda_x)\cdot(|x|^k)$.\\
Exactly one of the following is true:\\
\phx\qquad (1) $x=0$ \qquad\qquad or \qquad\qquad (2) $x\ne0$.\\
\\
{\it Case (1):}\\
We have $\ds{\lambda_x=\lambda_0=\left(\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)\right)_0=0}$. \qquad
Also, $|x|^k=|0|^k=0$.\\
Then $\alpha_x=\alpha_0=0=0\cdot0=(\lambda_x)\cdot(|x|^k)$, as desired.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
We have $\ds{\lambda_x=\left(\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)\right)_x=\left(\frac{\alpha}{|\bullet|^k}\right)_x=\frac{\alpha_x}{|x|^k}}$.\\
Then $\ds{\alpha_x=\left(\frac{\alpha_x}{|x|^k}\right)\cdot(|x|^k)=(\lambda_x)\cdot(|x|^k)}$, as desired.
{\it End of Case (2).}
\end{proof}

\begin{thm}\wrlab{thm-dnz-adjusted-is-dnz}
Let $k\in\N_0$, $\alpha\in\DNZ$ and $\ds{\lambda:=\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)}$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: $\dom[\lambda]=\dom[\alpha]$ and $\lambda\in\DNZ$.
\end{thm}

\begin{proof}
Since $\alpha\in\scrlito_k\subseteq\DNZ$, we see that $\alpha\in\DNZ$. \quad
Then $0\in\dom[\alpha]$.\\
It follows that $((\dom[\alpha])_0^\times)_0^+=\dom[\alpha]$.\\
Then $\ds{\dom[\lambda]=\left(\dom\left[\frac{\alpha}{|\bullet|^k}\right]\right)_0^+=((\dom[\alpha])_0^\times)_0^+=\dom[\alpha]}$.\\
It remains to show: $\lambda\in\DNZ$.\\
Since $\alpha\in\DNZ$ and since $\dom[\lambda]=\dom[\alpha]$, we see that $\lambda\in\DNZ$, as desired.\\
\end{proof}

\begin{thm}\wrlab{thm-litok-over-normtok-in-cvz}
Let $k\in\N_0$, $\alpha\in\scrlito_k$ and $\ds{\lambda:=\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)}$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\lambda\in\CVZ$.
\end{thm}

\begin{proof}
By \tref{thm-dnz-adjusted-is-dnz}, we see that $\lambda\in\DNZ$.\\
Want: $(\lambda_0=0)\,\&\,(\lambda\hbox{ is continuous at }0)$.\\
We have $\ds{\lambda_0=\left(\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)\right)_0=0}$. \qquad
Want: $\lambda\hbox{ is continuous at }0$.\\
Since $\alpha\in\scrlito_k$, we see that $\ds{\frac{\alpha}{|\bullet|^k}\to0}$ near $0$.\\
Then $\ds{\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)}$ is continuous at $0$.\\
Then $\lambda$ is continuous at $0$, as desired.
\end{proof}

\begin{thm}
Let $k\in\N_0$, $\alpha\in\scrbigo_k$ and $\ds{\lambda:=\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)}$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\lambda\in\BNZ$.
\end{thm}

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

\begin{thm}\wrlab{thm-agrees-near-zero-with-littleohone-implies-in-littleoone}
Let $\alpha,\beta:\R\drta\R$ and let $k\in\N_0$.\\
Assume: $(\,\beta\in\scrlito_k\,)\,\&\,(\,\alpha=\beta\hbox{ near }0\,)$. \qquad
Then $\alpha\in\scrlito_k$.
\end{thm}

\begin{proof}
Since $\beta\in\scrlito_k\subseteq\scrlito_0=\CVZ$, we get: $\beta_0=0$.\\
Since $\alpha=\beta$ near $0$, we get $\alpha_0=\beta_0$.\\
Let $\ds{\lambda:=\adj_0^0\left(\frac{\alpha}{|\bullet|^k}\right)}$ and $\ds{\mu:=\adj_0^0\left(\frac{\beta}{|\bullet|^k}\right)}$.\\
Since $\alpha=\beta$ near $0$, it follows that $\lambda=\mu$ near $0$.\\
Since $\alpha_0=\beta_0=0$, by \tref{thm-factorization-if-zeroatzero}, we see that $\alpha=\lambda\cdot(|\bullet|^k)$.\\
Since $\beta\in\scrlito_k$, by \tref{thm-litok-over-normtok-in-cvz}, we see that $\mu\in\CVZ$.\\
So, since $\lambda=\mu$ near $0$, by \tref{thm-agrees-with-cvz-nearzero-in-cvz}, we see that $\lambda\in\CVZ$.\\
Then $\alpha=\lambda\cdot(|\bullet|^k)\in(\CVZ)\cdot(|\bullet|^k)=\scrlito_k$, as desired.
\end{proof}

\begin{defn}
Let $f:\R\to\R$ and let $S\subseteq\dom[f]$.\\
Then \bf$f$ is \bfindex[constant] on $S$ means: \qquad $\forall x,y\in S$, $f_x=f_y$.\\
\end{defn}

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

Recall \dref{defn-incr-decr-variants}:

\begin{defn}
Let $f:\R\drta\R$ and let $S\subseteq\dom[f]$.\\
By $f$ is \bfindex[strictly increasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t<u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)<f(u)\,\,)\,\,]$.\\
By $f$ is \bfindex[strictly decreasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t<u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)>f(u)\,\,)\,\,]$.\\
By $f$ is \bfindex[semi-increasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t\le u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)\le f(u)\,\,)\,\,]$.\\
By $f$ is \bfindex[semi-decreasing] on $S$, we mean:\\
\phx\qquad\qquad $\forall t,u\in S$, $[\,\,(\,\,t\le u\,\,)\,\,\Rightarrow\,\,(\,\,f(t)\ge f(u)\,\,)\,\,]$.
\end{defn}

\begin{thm}\wrlab{thm-deriv-of-linear-is-const}
Let $m\in\R$. \quad
Define $L\in\scrl$ by $L_x=mx$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $L'=C_\R^m$.
\end{thm}

\begin{proof}
Unassigned HW. See HW\#3-3.
\end{proof}

Let $X$ be a metric space and let $S\subseteq X$.
Recall:\\
\phx\qquad\qquad\qquad\qquad $\Int_XS=\{p\in X\,|\,\exists B\in\scrb_X(p)~\hbox{s.t.}~B\subseteq S\}$\\
\phx\qquad\qquad and \qquad $\Cl_XS=\{p\in X\,|\,\exists q\in X^\N~\hbox{s.t.}~q_\bullet\to p\hbox{ in } X\}$\\
\phx\qquad\qquad and \qquad $(\,S\hbox{ is open in X}\,)\,\Leftrightarrow\,(\,\Int_XS=S\,)$\\
\phx\qquad\qquad and \qquad $(\,S\hbox{ is closed in X}\,)\,\Leftrightarrow\,(\,\Cl_XS=S\,)$.\\

\begin{thm}\wrlab{thm-equality-for-fn-vs-double-translate}
Let $f:\R\drta\R$, $a\in\R$, $p\in\dom[f]$, $S\subseteq\R$ and $q:=f_p$.\\
Show: $(\,f=a\hbox{ on }S\,)\,\Leftrightarrow\,(\,f_p^T=a-q\hbox{ on }S-p\,)$.
\end{thm}

\begin{proof}
Unassigned HW. See HW\#2-1.
\end{proof}

We drew a graph of a function on the board to show that, in the next theorem,
the assumption that $S$ is open in $\R$ is needed.

\begin{thm}\wrlab{thm-const-on-open-implies-deriv-vanishes}
Let $f:\R\drta\R$ and let $S\subseteq\dom[f]$.\\
Assume: $(\,S\hbox{ is open in }\R\,)\,\&\,(\,f\hbox{ is constant on S}\,)$.
Then $f'=0$ on $S$.
\end{thm}

\begin{proof}
Want: $\forall p\in S$, $f'_p=0$. \qquad
Given $p\in S$. \qquad
Want: $f'_p=0$.\\
Since $f$ is constant on $S$ and $p\in S\subseteq\dom[f]$,
we get: $f=f_p$ on $S$.\\
Let $q:=f_p$. \qquad
Then $f=q$ on $S$.\\
Since $S$ is open in $\R$, we get: $S=\Int_\R S$.\\
Since $p\in S=\Int_\R S$, choose $B\in\scrb_\R(p)$ s.t.~$B\subseteq S$.\\
Since $B\in\scrb_\R(p)$, we get: $B-p\in\scrb_\R(0)$.\\
Since $f=q$ on $S$ and since $B\subseteq S$, we get: $f=q$ on $B$.\\
By \tref{thm-equality-for-fn-vs-double-translate}, $f_p^T=q-q$ on $B-p$.\\
Then $f_p^T=0$ on $B-p$. \qquad
Then $f_p^T=\bfzero$ on $B-p$.\\
So, since $B-p\in\scrb_\R(0)$, we get: $f_p^T=\bfzero$ near $0$.\\
So, since $\bfzero\in\scrlito_1$, by \tref{thm-agrees-near-zero-with-littleohone-implies-in-littleoone},
we get: $f_p^T\in\scrlito_1$.\\
Since $f_p^T-\bfzero=f_p^T\in\scrlito_1$ and $\bfzero\in\scrl$,
it follows that $\bfzero\in\LINS_pf$.\\
Then, by \tref{thm-slope-of-linearization-is-value-of-deriv}, we conclude that $f'_p=\sl_\bfzero$.\\
Then $f'_p=\sl_\bfzero=\bfzero(1)=0$, as desired.
\end{proof}

\begin{defn}
Let $f:\R\drta\R$ and let $S\subseteq\R$.\\
Then $f$ is \bfindex[c/d] on $S$ means:\\
\phx\qquad\qquad
$(\,f\hbox{ is continuous on }S\,)\quad\&\quad(\,\Int_\R S\subseteq\dom[f']\,)$.
\end{defn}

That is, $f$ is c/d on $S$ means:\\
\phx\qquad $f$ is continuous on $S$ and differentiable on the interior of $S$.\\

\tref{thm-Rolle}, below, is called \bfindex[Rolle's Theorem].

\begin{thm}\wrlab{thm-Rolle}
Let $a,b\in\R$ and let $f:\R\drta\R$.\\
Assume $a<b$. \quad
Let $I:=(a;b)$ and let $J:=[a;b]$.\\
Assume $f$ is c/d on $J$ and $f_a=f_b$. \qquad
Then $\exists c\in I$ s.t.~$f'_c=0$.
\end{thm}

\begin{proof}
Let $g:=f|J$. \qquad
By \tref{thm-restr-maintains-continuity-ewh}, $g$ is continuous.\\
Then, by the Extreme Value Theorem (\tref{thm-EVT}),\\
\phx\qquad $\min\,g\ne\frownie\ne\max\,g$.\\
Let $y:=\min\,g$ and $z:=\max\,g$. \qquad
Then $y\ne\frownie\ne z$.\\
Also, $y\le f\le z$ on $J$.\\
Exactly one of the following is true:\\
\phx\qquad (1) $y=z$ \qquad\qquad or \qquad\qquad (2) $y\ne z$.\\
\\
{\it Case (1):}\\
Let $c:=(a+b)/2$. \qquad
Since $a<b$, we get $c\in(a;b)$.\\
Then $c\in(a;b)=I$. \qquad
Want: $f'_c=0$.\\
Since $I=\Int_\R J$, it follows that $I$ is open in $\R$.\\
Since $y\le f\le z$ on $J$ and since $y=z$,\\
\phantom{s}\qquad it follows that $f$ is constant on $J$.\\
So, since $I=(a;b)\subseteq[a;b]=J$, we see that $f$ is constant on $I$.\\
So, since $I$ is open in $\R$, by \tref{thm-const-on-open-implies-deriv-vanishes}, $f'=0$ on $I$.\\
So, since $c\in I$, we get $f'_c=0$, as desired.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Let $u:=f_a$. \qquad
Since $y\ne z$, we get: $(\,u\ne y\,)\,\vee\,(\,u\ne z\,)$.\\
Choose $v\in\{y,z\}$ s.t.~$u\ne v$. \qquad
Let $Q:=\im[g]$.\\
Then $y=\min\,g=\min\,Q$ and $z=\max\,g=\max\,Q$.
Since $\min\,Q=y\ne\frownie$, we get $\min\,Q\in Q$.\\
Since $\max\,Q=z\ne\frownie$, we get $\max\,Q\in Q$.\\
Then $y,z\in Q$. \qquad
Then $v\in\{y,z\}\subseteq Q$.\\
Since $f$ is c/d on $J$, we see that $f$ is continuous on $J$,
and so $J\in\dom[f]$.\\
So, since $g=f|J$, we get $\dom[g]=J$.\\
So, since $v\in Q=\im[g]$, choose $c\in J$ s.t.~$v=g_c$.\\
Since $c\in J$, we get $(f|J)_c=f_c$. \qquad
Then $g_c=(f|J)_c=f_c$.\\
Since $f_a=u\ne v=f_c$, we get $f_a\ne f_c$, and so $a\ne c$.\\
Since $f_b=f_a\ne f_c$, we get $f_b\ne f_c$, and so $b\ne c$.\\
Then $c\in J\backslash\{a,b\}=[a;b]\backslash\{a,b\}=(a;b)=I$. \qquad
Want: $f'_c=0$.\\
By Fermat's Theorem (\tref{thm-Fermat}),\\
\phx\qquad it suffices to show: $f$ has a local extremum at $c$ in $\R$.\\
Since $I$ is open in $\R$, we have $I=\Int_\R I$.\\
Since $c\in I=\Int_\R I$, choose $S\in\scrb_\R(c)$ s.t.~$S\subseteq I$.\\
Then $S\subseteq I=(a;b)\subseteq[a;b]=J$.\\
Recall that $y\le f\le z$ on $J$.\\
So, since $S\subseteq J$, we see that $y\le f\le z$ on $S$.\\
So, since $v\in\{y,z\}$, at least one of the following must be true:\\
\phx\qquad\qquad $(\,v\le f\le z\hbox{ on }S\,)$ \qquad\qquad or \qquad\qquad $(\,y\le f\le v\hbox{ on }S\,)$.\\
So, since $v=f_c$, at least one of the following must be true:\\
\phx\qquad\qquad $(\,f_c\le f\le z\hbox{ on }S\,)$ \qquad\qquad or \qquad\qquad $(\,y\le f\le f_c\hbox{ on }S\,)$.\\
Then at least one of the following must be true:\\
\phx\qquad\qquad $(\,f_c\le f\hbox{ on }S\,)$ \qquad\qquad or \qquad\qquad $(\,f\le f_c\hbox{ on }S\,)$.\\
So, since $S\in\scrb_\R(c)$, at least one of the following must be true:\\
\phx\qquad\qquad $f$ has a local minimum at $c$ in $\R$ \qquad\qquad or\\
\phx\qquad\qquad $f$ has a local maximum at $c$ in $\R$.\\
Then $f$ has a local extremum at $c$ in $\R$, as desired.
{\it End of Case (2).}
\end{proof}

\tref{thm-MVT}, below, is called the \bfindex[Mean Value Theorem].

\begin{thm}\wrlab{thm-MVT}
Let $a,b\in\R$ and let $f:\R\drta\R$.\\
Assume $a<b$. \quad
Let $I:=(a;b)$ and let $J:=[a;b]$.\\
Assume $f$ is c/d on $J$. \qquad
Then $\exists c\in I$ s.t.~$f'_c=\DQ_f(a,b)$.
\end{thm}

\begin{proof}
Let $m:=\DQ_f(a,b)$.
Then $\ds{m=\frac{f_b-f_a}{b-a}}$, so $m\cdot(b-a)=f_b-f_a$.\\
Define $L\in\scrl$ by $L(x)=mx$. \qquad
By \tref{thm-deriv-of-linear-is-const}, $L'=C_\R^m$.\\
Then $\dom[L']=\dom[C_\R^m]=\R$. \qquad Then $L$ is continuous on $\R$.\\
Then $L$ is continuous on $J$ and $I\subseteq\dom[L']$.\\
By assumption, $f$ is c/d on $J$.\\
Then $f$ is continuous on $J$ and $I\subseteq\dom[f']$.\\
So, since $L$ is continuous on $J$ and $I\subseteq\dom[L']$,\\
\phx\quad we see that $f-L$ is continuous on $J$ and that $I\subseteq\dom[(f-L)']$.
Let $g:=f-L$. \qquad
Then $g$ is continuous on $J$ and $I\subseteq\dom[g']$.\\
It follows that $g$ is c/d on $J$.\\
Also, \quad $g_b=f_b-L_b=f_b-mb$ \quad and \quad $g_a=f_a-L_a=f_a-ma$.\\
Then $g_b-g_a=(f_b-mb)-(f_a-ma)=(f_b-f_a)-m\cdot(b-a)$.\\
So, since $m\cdot(b-a)=f_b-f_a$, we see that $g_b-g_a=0$, and so $g_a=g_b$.\\
So, since $g$ is c/d on $J$, by \tref{thm-Rolle}, choose $c\in I$ s.t.~$g'_c=0$.\\
Want: $f'_c=\DQ_f(a,b)$. \qquad
Since $g=f-L$, we see that $g'_c\,=^*\,f'_c-L'_c$.\\
Since $c\in I\subseteq\dom[f']$, we get: $f'_c\in\im[f]\subseteq\R$.\\
So, as $L'_c=C_\R^m(c)=m\in\R$, we have $f'_c-L'_c\in\R$, and so $f'_c-L'_c\ne\frownie$.\\
Since $g'_c\,=^*\,f'_c-L'_c\ne\frownie$, we get: $g'_c=f'_c-L'_c$.\\
Then $0=g'_c=f'_c-L'_c$, so $f'_c=L'_c$.\\
So, since $L'_c=m=\DQ_f(a,b)$, we get $f'_c=\DQ_f(a,b)$, as desired.
\end{proof}

Recall: $\forall a,b\in\R$, $[a|b]=[a;b]\cup[b;a]=[\,\,\min\{a,b\}\,,\,\max\{a,b\}\,]$.

\begin{defn}
Let $J\subseteq\R$. \quad
By $J$ is an \bfindex[interval], we mean:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\forall a,b\in J$, \quad $[a|b]\subseteq J$.
\end{defn}

The bounded intervals come in four flavors:\\
\phx\qquad $\emptyset$, \quad open bounded nonempty,\\
\phx\qquad half-open bounded nonempty, \quad closed bounded nonempty.\\
The unbounded intevals come in three flavors:\\
\phx\qquad open nonclosed unbounded, \quad closed nonopen unbounded, \quad $\R$.\\
The set of open bounded nonempty intervals is\\
\phx\qquad\qquad\qquad $\{(a;b)\,|\,a,b\in\R,a<b\}$.\\
The set of half-open bounded nonempty intervals is\\
\phx\qquad\qquad\qquad $\{[a;b)\,|\,a,b\in\R,a<b\}\cup\{(a;b]\,|\,a,b\in\R,a<b\}$.\\
The set of closed bounded nonempty intervals is\\
\phx\qquad\qquad\qquad $\{[a;b]\,|\,a,b\in\R,a\le b\}$.\\
The set of open nonclosed unbounded intervals is\\
\phx\qquad\qquad\qquad $\{(a,\infty)\,|\,a\in\R\}\cup\{(-\infty,b)\,|\,b\in\R\}$.\\
The set of closed nonopen unbounded intervals is\\
\phx\qquad\qquad\qquad $\{[a,\infty)\,|\,a\in\R\}\cup\{(-\infty,b)\,|\,b\in\R\}$.\\

\begin{thm}\wrlab{thm-DQ-symmetric}
Let $f:\R\drta\R$ and $a,b\in\R$.\\
Then $\DQ_f(a,b)=\DQ_f(b,a)$.
\end{thm}

\begin{proof}
We have $\ds{\DQ_f(a,b)=\frac{f_b-f_a}{b-a}=\frac{f_a-f_b}{a-b}=\DQ_f(b,a)}$.
\end{proof}

\begin{thm}\wrlab{thm-DQ-same-for-ab-and-alphabeta}
Let $f:\R\drta\R$ and $a,b\in\R$.\\
Let $\alpha:=\min\{a,b\}$ and $\beta:=\max\{a,b\}$.\\
Then $\DQ_f(\alpha,\beta)=\DQ_f(a,b)$.
\end{thm}

\begin{proof}
By \tref{thm-DQ-symmetric}, we have $\DQ_f(\alpha,\beta)=\DQ_f(a,b)$.\\
Then $\{\,\DQ_f(a,b)\,,\,\DQ_f(b,a)\,\}\,=\,\{\,\DQ_f(a,b)\,\}$.\\
As $(\alpha,\beta)\in\{(a,b),(b,a)\}$, we get
$\DQ_f(\alpha,\beta)\,\in\,\{\,\DQ_f(a,b)\,,\,\DQ_f(b,a)\}\,$.\\
Then $\DQ_f(\alpha,\beta)\in\{\,\DQ_f(a,b)\,,\,\DQ_f(b,a)\,\}\,=\,\{\,\DQ_f(a,b)\,\}$,\\
\phx\qquad so $\DQ_f(\alpha,\beta)=\DQ_f(a,b)$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-every-sec-slope-is-a-tan-slope}
Let $f:\R\drta\R$ and let $J$ be an interval.\\
Let $a,b\in J$ and let $I:=\Int_\R J$.\\
Assume that $a\ne b$ and that $f$ is c/d on $J$.\\
Then $\DQ_f(a,b)\in f'_*(I)$.
\end{thm}

\begin{proof}
Since $a,b\in J$ and since $J$ is an interval, we get: $[a|b]\subseteq J$.\\
Let $\alpha:=\min\{a,b\}$ and $\beta:=\max\{a,b\}$. \qquad
Then $[a|b]=[\alpha;\beta]$.\\
Since $a\ne b$, we get $\alpha<\beta$.\\
Let $P:=(\alpha;\beta)$ and $Q:=[\alpha;\beta]$. \quad
Then $Q=[\alpha;\beta]=[a|b]\subseteq J$.\\
By HW\#3-4, we see that $P=\Int_\R Q$.\\
By \tref{thm-DQ-same-for-ab-and-alphabeta}, we have: $\DQ_f(\alpha,\beta)=\DQ_f(a,b)$.\\
Since $Q\subseteq J$, we see that $\Int_\R Q\subseteq\Int_\R J$, so $P\subseteq I$.\\
Since $f$ is c/d on $J$, we get: $f$ is continuous on $J$ and $I\subseteq\dom[f']$.\\
So, since $Q\subseteq J$ and $P\subseteq I$, we conclude:\\
\phx\qquad $f$ is continuous on $Q$ \quad and \quad $P\subseteq\dom[f']$.\\
Then $f$ is c/d on $Q$.\\
So, by the Mean Value Theorem (\tref{thm-MVT}),\\
\phx\qquad choose $c\in P$ s.t.~$f'_c=\DQ_f(\alpha,\beta)$.\\
As $c\in P\subseteq I\subseteq\dom[f']$,
we get $c\in\dom[f']$ and $c\in I$, so $f'_c\in f'_*(I)$.\\
Then $\DQ_f(a,b)=\DQ_f(\alpha,\beta)=f'_c\in f'_*(I)$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-MVT-applications}
Let $f:\R\drta\R$ and let $J$ be an interval.\\
Assume $f$ is c/d on $J$. \qquad
Let $I:=\Int_\R J$, $T:=f'_*(I)$. \qquad
Then\\
\phx\qquad\qquad (1) $(\,0\notin T\,)\,\Rightarrow\,(\,f|J\hbox{ is }1-1\,)$\\
\phx\qquad and (2) $(\,T>0\,)\,\Rightarrow\,(\,f\hbox{ is strictly increasing on }J\,)$\\
\phx\qquad and (3) $(\,T<0\,)\,\Rightarrow\,(\,f\hbox{ is strictly decreasing on }J\,)$\\
\phx\qquad and (4) $(\,T=\{0\}\,)\,\Leftrightarrow\,(\,f\hbox{ is constant on }J\,)$\\
\phx\qquad and (5) $(\,T\ge0\,)\,\Leftrightarrow\,(\,f\hbox{ is semi-increasing on }J\,)$\\
\phx\qquad and (6) $(\,T\le0\,)\,\Leftrightarrow\,(\,f\hbox{ is semi-decreasing on }J\,)$.\\
\end{thm}

\begin{proof}
{\it Proof of (1):}\\
Assume $0\notin T$. \qquad
Want: $f|T$ is 1-1.\\
Want: $\forall a,b\in J$, $[\,(\,f_a=f_b\,)\,\Rightarrow\,(\,a=b\,)\,]$.\\
Given $a,b\in J$. \qquad
Want: $(\,f_a=f_b\,)\,\Rightarrow\,(\,a=b\,)$.\\
Assume that $f_a=f_b$. \qquad
Want $a=b$.\\
Assume $a\ne b$. \qquad
Want: Contradiction.\\
Since $a\ne b$ and $f_a=f_b$, we get $\ds{\frac{f_b-f_a}{b-a}=0}$.\\
By \tref{thm-every-sec-slope-is-a-tan-slope}, $\DQ_f(a,b)\in f'_*(I)$.\\
Then $\ds{0=\frac{f_b-f_a}{b-a}=\DQ_f(a,b)\in f'_*(I)=T}$, so $0\in T$.\\
However, by assumption, $0\notin T$. \quad
Contradiction.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2)-(6):} Unassigned HW.
{\it End of proof of (2)-(6).}
\end{proof}

\section{Taylor's Formula to order 2}

\begin{thm}
Let $X$ be a metric space. \quad
Then $\scrb_X\subseteq\scrt_X$.
\end{thm}

\begin{proof}
Want: $\forall B\in\scrb_X$, $B\in\scrt_X$.\\
Given $B\in\scrb_X$. \qquad
Want: $B\in\scrt_X$. \qquad
Want: $\Int_XB=B$.\\
Since $\Int_XB\subseteq B$, it suffices to prove: $B\subseteq\Int_XB$.\\
Want: $\forall p\in B$, $p\in\Int_XB$. \qquad
Given $p\in B$. \qquad
Want: $p\in\Int_XB$.\\
Want: $\exists A\in\scrb_X(p)$ s.t.~$A\subseteq B$.\\
By \tref{thm-subset-recentering}, $\exists A\in\scrb_X(p)$ s.t.~$A\subseteq B$, as desired.
\end{proof}

\begin{defn}
Let $X$ be a metric space and let $f$ be a function.\\
Assume $\dom[f]\subseteq X$.\\
Then $\IntD_Xf:=\Int_X(\dom[f])$.
\end{defn}

\begin{thm}\wrlab{thm-diff-implies-dbltranslate-defdnearzero}
Let $f:\R\drta\R$ and let $p\in\dom[f']$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $0\in\IntD_\R(f_P^T)$.\\
\end{thm}

\begin{proof}
Want: $0\in\Int_\R(\dom[f_P^T])$.\\
Want: $\exists B\in\scrb_\R(0)$ s.t.~$B\subseteq\dom[f_p^T]$.\\
By \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $L\in\LINS_pf$ and $R\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $f_p^T=L+R$ \qquad and \qquad $f'_p=\sl_L$.\\
Since $f_p^T=L+R$, we get: $\dom[f_p^T]=(\dom[L])\cap(\dom[R])$.\\
Since $R\in\scrlito_1\subseteq\DNZ$, choose $B\in\scrb_\R(0)$ s.t.~$B\subseteq\dom[R]$.\\
Want: $B\subseteq\dom[f_p^T]$.\\
Since $L\in\scrl$, we have: $\dom[L]=\R$.\\
Since $\dom[R]\subseteq\R$, we get $\R\cap(\dom[R])=\dom[R]$.\\
Then $\dom[f_p^T]=(\dom[L])\cap(\dom[R])=\R\cap(\dom[R])=\dom[R]$.\\
Then $B\subseteq\dom[R]=\dom[f_p^T]$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-MVT-clear-denom}
Let $f:\R\drta\R$ and let $a,b\in\R$.\\
Assume that $[a|b]\subseteq\dom[f']$.\\
Then $\exists c\in[a|b]$ s.t.~$[f'_c]\cdot[b-a]=f_b-f_a$.
\end{thm}

\begin{proof}
Exactly one of the following is true:\\
\phx\qquad (1) $a=b$ \qquad\qquad or \qquad\qquad (2) $a\ne b$.\\
\\
{\it Case (1):}\\
Let $c:=a$. \qquad
Then $c\in[a|b]$.\\
Want: $[f'_c]\cdot[b-a]=f_b-f_a$.\\
Since $a=b$, we get $b-a=0$ and $f_b-f_a=0$.\\
Since $c\in[a|b]\subseteq\dom[f']\subseteq\dom[f]$, we get $f'_c\in\im[f]$.\\
Since $f'_c\in\im[f]\subseteq\R$ and since $b-a=0$, we get $[f'_c]\cdot[b-a]=0$.\\
Then $[f'_c]\cdot[b-a]=0=f_b-f_a$, as desired..\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Let $\alpha:=\min\{a,b\}$ and $\beta:=\max\{a,b\}$. \qquad
Then $[a|b]=[\alpha;\beta]$.\\
Then $[\alpha;\beta]=[a|b]\subseteq\dom[f']$. \qquad
Then $f$ is c/d on $[\alpha;\beta]$.\\
By the MVT (\tref{thm-MVT}), choose $c\in(\alpha;\beta)$ s.t.~$f'_c=\DQ_f(\alpha,\beta)$.\\
Then $c\in(\alpha;\beta)\subseteq[\alpha;\beta]=[a|b]$. \qquad
Want: $[f'_c]\cdot[b-a]=f_b-f_a$.\\
By \tref{thm-DQ-same-for-ab-and-alphabeta}, $\DQ_f(\alpha,\beta)=\DQ_f(a,b)$.\\
Then $\ds{f'_c=\DQ_f(\alpha,\beta)=\DQ_f(a,b)=\frac{f_b-f_a}{b-a}}$.\\
Then $\ds{[f'_c]\cdot[b-a]=\left[\frac{f_b-f_a}{b-a}\right]\cdot[b-a]=f_b-f_a}$, as desired.\\
{\it End of Case (2).}
\end{proof}

\begin{thm}
Let $x\in\R$ and let $w\in[0|x]$.\\
\phantom{xx}\qquad\qquad\qquad\qquad Then $\exists t\in[0;1]$ s.t.~$tx=w$.
\end{thm}

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

\begin{thm}
Let $B\in\scrb_\R$. \qquad
Then $B$ is an interval.
\end{thm}

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

\tref{thm-chMVT}, below, is called the \bfindex[Choice MVT].

\begin{thm}\wrlab{thm-chMVT}
Let $f:\R\drta\R$ and let $B\in\scrb_\R(0)$.\\
Assume that $f_0=0$ and that $B\subseteq\dom[f']$.\\
Then $\exists\alpha:B\to[0;1]$ s.t., $\forall x\in B$, \quad $f_x\,\,=\,\,[f'(\alpha_x\cdot x)]\,\cdot\,x$.
\end{thm}

\begin{proof}
Define $S:B\to2^{[0;1]}$ by $S_x=\{t\in[0;1]\,|\,f_x=[f'(\alpha_x\cdot x)]\cdot x\}$.\\
\\
{\it Claim:} $\forall x\in B$, $S_x\ne\emptyset$.\\
{\it Proof of Claim:}\\
Given $x\in B$. \qquad
Want: $S_x\ne\emptyset$.\\
Since $B$ is an interval and since $0,x\in B$, we get: $[0|x]\subseteq B$.\\
Then $[0|x]\subseteq B\subseteq\dom[f']$, so, by \tref{thm-MVT-clear-denom},
choose $w\in[0|x]$ s.t.~$[f'_w]\cdot[x-0]=f_x-f_0$.\\
Since $w\in[0|x]$, choose $t\in[0;1]$ s.t.~$tx=w$.\\
Since $f_x=f_x-f_0=[f'_w]\cdot[x-0]=[f'(tx)]\cdot x$, we get: $t\in S_x$.\\
Then $S_x\ne\emptyset$, as desired.\\
{\it End of proof of Claim.}\\
\\
Define $\alpha:B\to[0;1]$ by $\alpha_x=\CH(S_x)$.\\
Want: $\forall x\in B$, \quad $f_x\,\,=\,\,[f'(\alpha_x\cdot x)]\,\cdot\,x$.\\
Given $x\in B$. \qquad
Want: $f_x\,\,=\,\,[f'(\alpha_x\cdot x)]\,\cdot\,x$.\\
By the Claim, $S_x\ne\emptyset$, and so $\CH(S_x)\in S_x$.\\
Since $\alpha_x=\CH(S_x)\in S_x$, we get $f_x\,\,=\,\,[f'(\alpha_x\cdot x)]\,\cdot\,x$, as desired.
\end{proof}

\begin{thm}
Let $g:\R\drta\R$.
Assume $0=g_0$.
Then $g_0^T=g$.
\end{thm}

\begin{proof}
Want: $\forall h\in\R$, $(g_0^T)(h)=g(h)$.\\
Given $h\in\R$. \qquad
Want: $(g_0^T)(h)=g(h)$.\\
We have $(g_0^T)(h)=g_{0+h}-g_0=g_h-0=g_h$, as desired.
\end{proof}

\begin{thm}
Let $L\in\scrl$.
Assume $\sl_L=0$.
Then $L=\bfzero$.
\end{thm}

\begin{proof}
Want: $\forall h\in\R$, $L_h=\bfzero_h$.\\
Given $h\in\R$. \qquad
Want: $L_h=\bfzero_h$.\\
We have $L_h=(\sl_L)\cdot h=0\cdot h=0=\bfzero_h$, as desired.
\end{proof}

The next result asserts that any partial function $\R\drta\R$
that vanishes to order one at $0$ is necessarily sublinear.

\begin{thm}\wrlab{van-ord-one-implies-sublin}
Let $g:\R\drta\R$. \qquad
Assume that $0=g_0=g'_0$.\\
\phantom{xxx}\qquad\qquad\qquad\qquad Then $g\in\scrlito_1$.
\end{thm}

\begin{proof}
Since $g'_0=0$, we conclude that $0\in\dom[g']$.\\
By \tref{thm-diffatp-implies-doubletranslate-decomp}, choose $L\in\LINS_0g$ and $R\in\scrlito_1$ s.t.\\
\phx\qquad\qquad $g_0^T=L+R$ \qquad and \qquad $g'_0=\sl_L$.\\
By assumption, $g'_0=0$. \qquad
Then $\sl_L=g'_0=0$, and so $L=\bfzero$.\\
By assumption $0=g_0$. \qquad
Then $g_0^T=g$.\\
Then $g=g_0^T=L+R=\bfzero+R=R\in\scrlito_1$, as desired.
\end{proof}

\begin{thm}
Let $B\in\scrb_\R(0)$, $\alpha:B\to[0;1]$.
Then $\alpha\in\BNZ$.
\end{thm}

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

The next result asserts that any partial function $\R\drta\R$
that vanishes to order two at $0$ is necessarily subquadratic.

It is an unassigned induction exercise to show: $\forall k\in\N_0$,
any partial function $\R\drta\R$
that vanishes to order $k$ at $0$ is necessarily ``$\scrlito_k$''.

\begin{thm}\wrlab{van-ord-two-implies-subquadr}
Let $f:\R\drta\R$. \quad
Assume $0=f_0=f'_0=f''_0$.\\
\phantom{xxx}\qquad\qquad\qquad\qquad Then $f\in\scrlito_2$.
\end{thm}

\begin{proof}
Let $g:=f'$.
Then $0=g_0=g'_0$, so, by \tref{van-ord-one-implies-sublin}, $g\in\scrlito_1$.\\
Since $0=g_0$, we see that $g_0^T=g$.\\
Since $g'_0=0$, we conclude that $0\in\dom[g']$.\\
Then, by \tref{thm-diff-implies-dbltranslate-defdnearzero},
we get: $0\in\IntD_\R g$.\\
Since $0\in\IntD_\R g=\Int_\R(\dom[g])$, choose $B\in\scrb_\R(0)$ s.t.~$B\subseteq\dom[g]$.\\
Then by the Choice MVT (\tref{thm-chMVT}),\\
\phx\qquad\qquad choose $\alpha:B\to[0;1]$ s.t., $\forall x\in B$, $f_x=[f'(\alpha_x\cdot x]\cdot x$.\\
Let $i:=\id_\R$. \qquad
Then $i\in\scrl\subseteq\scrbigo_1$.\\
Since, $\forall x\in B$, we have $f_x=[f'(\alpha_x\cdot x]\cdot x=([f'\circ(\alpha\cdot i]\cdot i)_x$,\\
\phx\qquad\qquad it follows that $f=[f\circ(\alpha\cdot i)]\cdot i$ on $B$.\\
So, since $B\in\scrb_\R(0)$, we get: $f=[f\circ(\alpha\cdot i)]\cdot i$ near $0$.\\
Since $B\in\scrb_\R(0)$ and $\alpha:B\to[0;1]$, we see that $\alpha\in\BNZ$.\\
Since $\alpha\in\BNZ=\scrbigo_0$ and $i\in\scrbigo_1$,
we see that $\alpha\cdot i\in\scrbigo_0\cdot\scrbigo_1$.\\
Since $\alpha\cdot i\in\scrbigo_0\cdot\scrbigo_1\subseteq\scrbigo_{0+1}=\scrbigo_1$ and $f'=g\in\scrlito_1$,\\
\phx\qquad\qquad we see that $f'\circ(\alpha\cdot i)\in\scrlito_1\circ\scrbigo_1$.\\ 
Since $f'\circ(\alpha\cdot i)\in\scrlito_1\circ\scrbigo_1\subseteq\scrlito_{1\cdot1}=\scrlito_1$ and $i\in\scrbigo_1$,\\
\phx\qquad\qquad we see that $[f\circ(\alpha\cdot i)]\cdot i\in\scrlito_1\cdot\scrbigo_1$.\\
Then $[f\circ(\alpha\cdot i)]\cdot i\in\scrlito_1\cdot\scrbigo_1\subseteq\scrlito_{1+1}=\scrlito_2$.\\
So, since $f=[f\circ(\alpha\cdot i)]\cdot i$ near $0$, we get $f\in\scrlito_2$, as desired.
\end{proof}

\begin{thm}
Let $L:\R\to\R$ and let $m\in\R$.\\
Assume: $\forall h\in\R$, $L_h=mh$.\\
Then, $\forall h\in\R$, $L'_h=m$. \qquad
Also, $\forall h\in\R$, $L''_h=0$.
\end{thm}

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

\begin{thm}
Let $Q:\R\to\R$ and let $a\in\R$.\\
Assume: $\forall h\in\R$, $Q_h=ah^2/2$.\\
Then, $\forall h\in\R$, $Q'_h=ah$. \qquad
Also, $\forall h\in\R$, $Q''_h=a$.
\end{thm}

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

\tref{thm-Taylorto2}, below, is \bfindex[Taylor's Theorem to order 2].

\begin{thm}\wrlab{thm-Taylorto2}
Let $f:\R\drta\R$ and let $p\in\dom[f'']$.\\
Let $m:=f'_p$ and let $a:=f''_p$.\\
Deinfe $L\in\scrl$ and $Q\in\scrq$ by $L_h=mh$ and $Q_h=ah^2/2$.\\
Let $R:=f_p^T-(L+Q)$. \qquad
Then $R\in\scrlito_2$.
\end{thm}

\begin{proof}
By \tref{van-ord-two-implies-subquadr}, it suffices to show: $0=R_0=R'_0=R''_0$.\\
We have: $\forall h\in\R$, \quad $L_h=mh$ and $Q_h=ah^2/2$.\\
Then, $\forall h\in\R$, \quad $L'_h=m$ and $Q'_h=ah$.\\
Also, $\forall h\in\R$, \quad $L''_h=0$ and $Q''_h=a$.\\
Then $R_0=f_p-(a+0)=0-0=0$.\\
Also, $R'_0\,=^*\,f'_p-(m+0)=m-m=0\ne\frownie$, so $R'_0=0$.\\
Also, $R''_0\,=^*\,f''_p-(0+a)=a-a=0\ne\frownie$, so $R''_0=0$.\\
Then $0=R_0=R'_0=\R''_0$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-subquadratic-comparedto-quadraticorder}
Let $R\in\scrlito_2$ and $Q\in\scrq\backslash\{\bfzero\}$.\\
Then $\exists B\in\scrb_\R(0)$ s.t.~$|R|\le|Q|$ on $B$.
\end{thm}

\begin{proof}
Since $Q\in\scrq$, choose $a\in\R$ s.t., $\forall h\in\R$, $Q_h=ah^2$.\\
Since $Q\ne\bfzero$, we conclude that $a\ne0$.\\
Let $\varepsilon:=|a|$. \qquad
Then $\varepsilon>0$.\\
Since $R\in\scrlito_2=(\CVZ)\cdot(|\bullet|^2)$,
choose $\phi\in\CVZ$ s.t.~$R=\phi\cdot(|\bullet|^2)$.\\
Since $\phi\in\CVZ\subseteq\DNZ$, choose $C\in\scrb_\R(0)$ s.t.~$C\subseteq\dom[\phi]$.\\
Since $\phi\in\CVZ$, we see that $\phi$ is continuous at $0$,\\
\phx\qquad so choose $D\in\scrb_\R(0)$ s.t.~$\phi_*(D)\subseteq B_\R(\phi_0,\varepsilon)$.\\
Since $\phi\in\CVZ$, we get $\phi_0=0$. \quad
Then $\phi_*(D)\subseteq B_\R(\phi_0,\varepsilon)=B_\R(0,\varepsilon)$.\\
Let $B:=C\cap D$. \qquad
Then $B\in\{C,D\}\subseteq\scrb_\R(0)$.\\
Want: $|R|\le|Q|$ on $B$. \qquad
Want: $\forall h\in B$, $|R|_h\le|Q|_h$.\\
Given $h\in B$. \qquad
Want: $|R|_h\le|Q|_h$.\\
We have $h\in B=C\cap D$, so $h\in C$ and $h\in D$.\\
By the choice of $C$, $C\subseteq\dom[\phi]$.\\
Since $h\in C\subseteq\dom[\phi]$ and since $h\in D$, we get $\phi_h\in\phi_*(D)$.\\
Since $\phi_h\in\phi_*(D)\subseteq B_\R(0,\varepsilon)$, we get $d_\R(\phi_h,0)<\varepsilon$.\\
Then $|\phi_h|=|\phi_h-0|=d_\R(\phi_h,0)<\varepsilon$.\\
Since $|\phi_h|<\varepsilon$ and $h^2\ge0$, we get $|\phi_h|\cdot h^2\le\varepsilon\cdot h^2$.\\
Since $|h|^2\ge0$, it follows that $|\,|h|^2\,|=|h|^2$.\\
Since $R=\phi\cdot(|\bullet|^2)$, we conclude that $R_h=(\phi_h)\cdot(|h|^2)$.\\
Then $|R|_h=|R_h|=|\,(\phi_h)\cdot(|h|^2)\,|=|\phi_h|\cdot|\,|h|^2\,|=|\phi_h|\cdot|h|^2$\\
\phx\qquad\qquad $\,\le\varepsilon\cdot|h|^2=|a|\cdot|h|^2=|ah^2|=|Q_h|=|Q|_h$, as desired.
\end{proof}

The logic of \tref{thm-subquadratic-comparedto-quadraticorder} shows:
Any subquadratic is dominated, near $0$, by any nonzero quadratic polynomial, even inhomogeneous.

In the notation of \tref{thm-Taylorto2},
we showed that, $\forall x\in\R$,\\
\phx\qquad $f_x=f_p+(f'_p)\cdot(x-p)+(f''_p/2)\cdot(x-p)^2+R_{x-p}$.\\
The remainder term $R_{x-p}$ is subquadratic in $x-p$.\\
Also, the rest, $f_p+(f'_p)\cdot(x-p)+(f''_p/2)\cdot(x-p)^2$,\\
\phx\qquad is a quadratic polynomial in $x-p$.\\
Consequently, unless $0=f_p=f'_p=f''_p$,\\
\phx\qquad the remainder is negligible (for $x\approx p$) compared to the rest.

\section{The Second Derivative Test}

\begin{thm}\wrlab{thm-double-translate-derivs-at-0}
Let $f:\R\drta\R$ and let $p\in\R$.\\
Then: \quad $[\,\,(f_p^T)'_0=f'_p\,\,]\,\,\&\,\,[\,\,(f_p^T)''_0=f''_p\,\,]$.
\end{thm}

\begin{proof}
Let $q:=f_p$. \qquad
Then $f_p^T=[f(p+\bullet)]-[C_\R^q]$.\\
Differentiating this, we get: $(f_p^T)'=([f(p+\bullet)]-[C_\R^q])'$.\\
By HW\#4-5, we have: $([f(p+\bullet)]-[C_\R^q])'=(f(p+\bullet))'$.\\
By HW\#4-4, we have: $(f(p+\bullet))'=f'(p+\bullet)$.\\
Then $(f_p^T)'=([f(p+\bullet)]-[C_\R^q])'=(f(p+\bullet))'=f'(p+\bullet)$.\\
Contracting this, we get: $(f_p^T)'=f'(p+\bullet)$.\\
Evaluating this at $0$, we get: $(f_p^T)'_0=(f'(p+\bullet))_0$.\\
Then $(f_p^T)'_0=(f'(p+\bullet))_0=f'(p+0)=f'(p)=f'_p$.\\
It remains to show: $(f_p^T)''_0=f''_p$.\\
Differentiating $(f_p^T)'=f'(p+\bullet)$, we get: $(f_p^T)''=(f'(p+\bullet))'$.\\
By HW\#4-4 (with $f$ replaced by $f'$),\\
\phx\qquad\qquad\qquad\qquad we have: $(f'(p+\bullet))'=f''(p+\bullet)$.\\
Then $(f_p^T)''=(f'(p+\bullet))'=f''(p+\bullet)$.\\
Evaluating this at $0$, we get: $(f_p^T)_0''=(f''(p+\bullet))_0$.\\
Then $(f_p^T)''_0=(f''(p+\bullet))_0=f''(p+0)=f''(p)=f''_p$, as desired.
\end{proof}

\begin{defn}
Let $X$ be a metric space.\\
Let $f:X\drta\R$ and let $p\in\dom[f]$.\\
By $f$ has a \bfindex[strict local minimum] at $p$ in $X$, we mean:\\
\phx\qquad\qquad $\exists B\in\scrb_X(p)$ s.t.~$f>f_p$ on $B_p^\times$.\\
By $f$ has a \bfindex[strict local maximum] at $p$ in $X$, we mean:\\
\phx\qquad\qquad $\exists B\in\scrb_X(p)$ s.t.~$f<f_p$ on $B_p^\times$.\\
\end{defn}

Recall \tref{thm-double-translate-derivs-at-0}.

\begin{thm}\wrlab{thm-second-deriv-test-loc-min}
Let $f:\R\drta\R$ and let $p\in\R$.\\
Assume $f'_p=0$ and $f''_p>0$.\\
Then $f$ has a strict local minimum at $p$ in $\R$.
\end{thm}

\begin{proof}
By HW\#4-5, it suffices to show:\\
\phx\qquad\qquad $f_p^T$ has a strict local minimum at $0$ in $\R$.\\
Let $g:=f_p^T$. \qquad
Want: $g$ has a strict local minimum at $0$ in $\R$.\\
Want: $\exists B\in\scrb_\R(0)$ s.t.~$g>g_0$ on $B_0^\times$.\\
By assumption $f'_p=0$ and $f''_p>0$.\\
Let $m:=f'_p$ and let $a:=f''_p$. \qquad
Then $m=0$ and $a>0$.\\
Define $L\in\scrl$ and $Q\in\scrq$ by $L_h=mh$ and $Q_h=ah^2/2$.\\
Then $(\,L=\bfzero\,)$ and $(\,Q>\bfzero\hbox{ on }\R_0^\times\,)$.\\
By \tref{thm-Taylorto2}, $f_p^T-(L+Q)\in\scrlito_2$. \qquad
Let $R:=f_p^T-(L+Q)$.\\
Then $R\in\scrlito_2$. \qquad
Also, $R=f_p^T-(L+Q)=g-(\bfzero+Q)=g-Q$.\\
Since $Q>\bfzero$ on $\R_0^\times$,
we get: $Q/2>\bfzero$ on $\R_0^\times$.\\
Then $Q/2\ne\bfzero$. \qquad
So, as $Q/2\in\scrq$, we get: $Q/2\in\scrq\backslash\{\bfzero\}$.\\
Then, by \tref{thm-subquadratic-comparedto-quadraticorder},
choose $B\in\scrb_\R(0)$ s.t.~$|R|\le|Q/2|$ on $B$.\\
Want: $g>g_0$ on $B_0^\times$.\\
Since $f'_p=0\ne\frownie$, we get: $p\in\dom[f']$.\\
So, since $\dom[f']\subseteq\dom[f]$, we see that $p\in\dom[f]$.\\
Then $(f_p^T)_0=0$. \qquad
Then $g_0=(f_p^T)_0=0$.\\
Want: $g>0$ on $B_0^\times$.\\
Since $Q\in\scrq$, we get: $Q-Q=\bfzero$.\\
Then $Q+R=Q+(g-Q)=g+\bfzero=g$.\\
Want: $Q+R>0$ on $B_0^\times$.\\
Since $Q/2>\bfzero=0$ on $\R_0^\times$, we get: $Q/2>0$ on $\R$.\\
We have $(Q/2)_0=Q_0/2=(a\cdot 0^2/2)/2=0$.\\
Since $Q/2>0$ on $\R_0^\times$ and since $(Q/2)_0=0$,\\
\phx\qquad\qquad we get: $Q/2\ge0$ on $\R$.\\
Then $|Q/2|=Q/2$ on $\R$. \qquad
Then $|R|\le|Q/2|=Q/2$ on $B$.\\
Since $|R|\le Q/2$ on $B$, we get: $-Q/2\le R\le Q/2$ on $B$.\\
Since $R\ge-Q/2$ on $B$, we get: $Q+R\ge Q-(Q/2)$ on $B$.\\
So, since $Q-(Q/2)=Q/2$, we get: $Q+R\ge Q/2$ on $B$.\\
So, since $B_0^\times\subseteq B$, we get: $Q+R\ge Q/2$ on $B_0^\times$.\\
So, since $Q/2>0$ on $B_0^\times$, we get: $Q+R>0$ on $B_0^\times$, as desired.
\end{proof}

\tref{thm-second-deriv-test-loc-min} is the \bfindex[Second Derivative Test for Local Minima].

\begin{thm}\wrlab{thm-second-deriv-test-loc-max}
Let $f:\R\drta\R$ and let $p\in\R$.\\
Assume $f'_p=0$ and $f''_p<0$.\\
Then $f$ has a strict local maximum at $p$ in $\R$.
\end{thm}

\begin{proof}
Unassigned HW. ({\it Hint:} Let $g:=-f$ and use \tref{thm-second-deriv-test-loc-min}.)
\end{proof}

\tref{thm-second-deriv-test-loc-max} is the \bfindex[Second Derivative Test for Local Maxima].

\section{Tensors, sets of tensors and tensor spaces}

NOTE TO SELF:\\
Next year, define $\scri_\R:=\{\emptyset\}$.\\
Keep in mind that $\R\ne\R^{\scri_\R}$,\\
\phx\qquad so we only have: $\forall V\in\TNSR$, $V=\R^{\scri_V}$;\\
\phx\qquad this does not extend to $\TNSR^+$.\\
Also, $\forall x\in\R$, define $x_\emptyset:=x$.\\
Also, define $\varepsilon_\emptyset^\R:=1$.\\
Also, define $\pi_\emptyset^\R=\id_\R$.\\
Also, $\forall V\in\TNSR^+$, $\forall f:\R\drta V$, define $\partial_\emptyset^{\R V}f=f'$.
Also, $\forall\sigma\in\N$, $\forall k\in\N^\sigma$, define $k\|\emptyset:=k$ and $\emptyset\|k:=k$.\\
Also, define $\emptyset\|\emptyset:=\emptyset$.\\

Recall: Let $X$ be a set.
Then, $\forall m\in\N$, we defined $X^m=X^{[1..m]}$,\\
\phx\qquad so $X^m$ denotes the set of all functions $\{1,\ldots,m\}\to X$.\\
Moreover, $\forall a,b\in X$, $(a,b)\in X^2=X^{[1..2]}=X^{\{1,2\}}$,\\
\phx\qquad $(a,b)_1=a$ \qquad and \qquad $(a,b)_2=b$.\\
There are simliar definitions for $(a,b,c)$, {\it etc.}

\begin{defn}
$\EUCL:=\{\R^m\,|\,m\in\N\}$.
\end{defn}

We have: $\EUCL:=\{\R^1,\R^2,\R^3,\ldots\}$.

WARNING: $(5)\in\R^1=\R^{[1..1]}=\R^{\{1\}}$ and $(5)_1=5$.\\
However, $(5)\ne5$ and, in fact, $5\notin\R^1$.\\
Thus, $\R\ne\R^1$, and, in fact, $\R\notin\EUCL$.

In \dref{defn-shapes} below, any element of $\N^\rho$ is called a $\rho$-\bfindex[shape].\index[terms]{tensor shape}\\
Then $m$ is a $\rho$-shape. \quad
Also, any element of $[m]$ is called a $\rho$-\bfindex[index].\index[terms]{tensor index}

\begin{defn}\wrlab{defn-shapes}
Let $\rho\in\N$ and let $m\in\N^\rho$.\\
Then $[m]:=[1..m_1]\times\cdots\times[1..m_\rho]$.\\
Also, we define $m_1\times\cdots\times m_\rho:=m$.
\end{defn}

Following \dref{defn-shapes}, we see, $\forall\rho\in\N$, $\forall m\in\N^\rho$,\\
\phx\qquad\qquad\qquad\qquad\qquad $m_1\,\times\,\cdots\,\times\,m_\rho\quad=\quad(\,m_1\,,\,\ldots\,,\,m_\rho\,)$.

\begin{thm}\wrlab{thm-eg-shapes-indices}
We have $2\times3=(2,3)$.\\
Also, $[2\times3]=[1..2]\times[1..3]=\{1,2\}\times\{1,2,3\}$.\\
Also, $[2\times3]=\{(1,1),(1,2),(1,3),(2,1),(2,2),(2,3)\}$.\\
\end{thm}

Here are some $2$-shapes: $5\times7$, $6\times4$, $2\times3$, $1\times9$, $1\times1$.

Here are all of the $(2\times3)$-indices:\\
\phx\qquad\qquad $(1,1)\,\,,\,\,(1,2)\,\,,\,\,(1,3)\,\,,\,\,(2,1)\,\,,\,\,(2,2)\,\,,\,\,(2,3)$.

\begin{defn}\wrlab{defn-tensor-set}
Let $X$ be a set, $\rho\in\N$, $m\in\N^\rho$.\\
\phx\qquad\qquad\qquad\qquad Then $X^m:=X^{[m]}$.
\end{defn}

In \dref{defn-tensor-set}, the elements of $X^m$ are called\\
\phx\qquad $m$-shaped $\rho$-\bfindex[tensors] with entries in $X$.
A $1$-tensor is sometimes called a \bfindex[tuple].\\
A $2$-tensor is sometimes called a \bfindex[matrix].

\begin{thm}
$\forall$set $X$, we have\\
\phx\qquad\qquad\qquad $X^{2\times3}=X^{[2\times3]}=X^{\{(1,1),(1,2),(1,3),(2,1),(2,2),(2,3)\}}$.
\end{thm}

Some notation: 
Let $X$ be a set and let $a,b,c,d,e,f\in X$.
Then\\
\phx\qquad\qquad\qquad\qquad\qquad $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]\quad\in\quad X^{2\times3}$\\
is defined by\\
\phx $\,\,$ $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]_{(1,1)}=a,$
$\,\,$ $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]_{(1,2)}=b,$
$\,\,$ $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]_{(1,3)}=c,$\\
\phx $\,\,$ $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]_{(2,1)}=d,$
$\,\,$ $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]_{(2,2)}=e,$
$\,\,$ $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]_{(2,3)}=f.$\\
The index subscripts\\
\phx\qquad\qquad\qquad $(1,1)\,\,,\,\,(1,2)\,\,,\,\,(1,3)\,\,,\,\,(2,1)\,\,,\,\,(2,2)\,\,,\,\,(2,3)$\\
are generally abbreviated: \qquad $11\,,\,12\,,\,13\,,\,21\,,\,22\,,\,23$.\\
This notation is for $(2\times3)$-shaped matrices, but,
$\forall p,q\in\N$, we have a similar notation for $(p\times q)$-shaped matrices.

\begin{defn}
Let $X$ be a set, $\rho\in\N$, $m\in\N^\rho$, $Y:=X^m$, $j\in[m]$.\\
Then $\pi_j^Y:Y\to X$ is defined by: $\pi_j^Y(z)\,\,=\,\,z_j$.
\end{defn}

\begin{thm}
Let $S:=\R^{2\time3}$ and let $z:=\left[\begin{array}{ccc}1&2&3\\4&5&6\end{array}\right]$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $\pi_{22}^S(z)=z_{22}=5$.
\end{thm}

WARNING: $\R^{2\times3}\ne\R^2\times\R^3$.\\
In fact, $\forall a,b,c,d,e,f\in\R$, \qquad $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]\,\,\in\,\,\R^{2\times3}$.\\
Also, $\forall a,b,c,d,e\in\R$, \qquad  $((a,b),(c,d,e))\,\,\in\,\,\R^2\times\R^3$.\\
Also, $\forall a,b,c,d,e,f\in\R$, \qquad  $\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]\,\,\notin\,\,\R^2\times\R^3$.\\
Also, $\forall a,b,c,d,e\in\R$, \qquad  $((a,b),(c,d,e))\,\,\notin\,\,\R^{2\times3}$.

\vskip.1in

WARNING: The sets\\
\phx\qquad\qquad $\R$, \quad $\R^1$, \quad $\R^{1\times1}$, \quad $\R^{1\times1\times1}$, \quad \ldots\\
are all distinct; no two are equal.
However, as vector spaces (if you know what that means), they are all one-dimesional, and so are all vector space isomorphic to one another.
Keep in mind, though, that $\R^{2\times3}$ and $\R^2\times\R^3$ are not even vector space isomorphic;
in fact, the vector space $\R^{2\times3}$ is six dimensional, while $\R^2\times\R^3$ is only five-dimensional.

\begin{thm}
We have $\R^3=\R^{\{1,2,3\}}$.\\
\phx\qquad\qquad\qquad\qquad\qquad Also, $\,\R^{1\times3\times1}=\R^{\{(1,1,1),(1,2,1),(1,3,1)\}}$.
\end{thm}

WARNING: Let $m\in\N$.
Then\\
\phx\qquad\qquad\qquad\qquad $\R^m$,\\
\phx\qquad\qquad\qquad\qquad $\R^{1\times m}$, \quad\quad $\,\,\,\,\,\R^{m\times1}$,\\
\phx\qquad\qquad\qquad\qquad $\R^{1\times1\times m}$, \qquad $\R^{1\times m\times1}$, \qquad $\R^{m\times1\times1}$\\
are all distinct sets, but are all vector space isomorphic to one another.

\begin{defn}
Let $\rho\in\N$ and $m\in\N^\rho$.
Then\\
\phx\quad\qquad\qquad $\forall j\in\N$, \quad $j\times m:=(j,m_1,\ldots,m_\rho)$ \qquad and\\
\phantom{xx}\quad\qquad\qquad\qquad\qquad $m\times j:=(m_1,\ldots,m_\rho,j)$.\\
Also,
\qquad $\forall j,k\in\N$, \quad $j\times k\times m:=(j,k,m_1,\ldots,m_\rho)$ \qquad and\\
\phantom{xxxx}\qquad\qquad\qquad\qquad $j\times m\times k:=(j,m_1,\ldots,m_\rho,k)$ \qquad and\\
\phantom{xxxx}\qquad\qquad\qquad\qquad $m\times j\times k:=(m_1,\ldots,m_\rho,j,,k)$.
\end{defn}

WARNING: Let $\rho\in\N$ and $m\in\N^\rho$.
Then\\
\phx\qquad\qquad\qquad\qquad $\R^m$,\\
\phx\qquad\qquad\qquad\qquad $\R^{1\times m}$, \quad\quad $\,\,\,\,\,\R^{m\times1}$,\\
\phx\qquad\qquad\qquad\qquad $\R^{1\times1\times m}$, \qquad $\R^{1\times m\times1}$, \qquad $\R^{m\times1\times1}$\\
are all distinct sets, but are all vector space isomorphic to one another.

\vskip.1in

Let $k,\ell,m\in\N$.
Then $[(k,\ell,m)]=[1..k]\times[1..\ell]\times[1..m]$.

Let $\ell,m\in\N$.
Then $[(\ell,m)]=[1..\ell]\times[1..m]$.

Let $m\in\N$.
Then $[(m)]=[1..m]$.
Also, we have\\
\phx\qquad\qquad\qquad $(m)\in\N^1=\N^{\{1\}}$ \quad and \quad $(m)_1=m$.\\
While $(m)\ne m$, in the next theorem, we will prove:\\
\phx\qquad\qquad\qquad\qquad $\forall$set $X$, \qquad $X^{(m)}=X^m$. 

\begin{thm}\wrlab{thm-Xm-has-only-one-meaning}
Let $X$ be a set and let $m\in\N$.
Then $X^{(m)}=X^m$.
\end{thm}

\begin{proof}
We have $X^{(m)}=X^{[(m)]}=X^{[1..m]}=X^m$.
\end{proof}

\begin{defn}
$\forall\rho\in\N$, \quad $\TNSR_\rho:=\{\R^m\,|\,m\in\N^\rho\}$.\\
\phx\qquad Also, $\TNSR\quad:=\quad\TNSR_1\,\,\cup\,\,\TNSR_2\,\,\cup\,\,\TNSR_3\,\,\cup\,\,\cdots$.
\end{defn}

An element of $\TNSR$ will be called a \bfindex[tensor space].

For any $\rho\in\N$, 
an element of $\TNSR_\rho$ will be called a $\rho$-{\bf tensor space}.

\begin{thm}
We have $\TNSR_1=\EUCL$.
\end{thm}

\begin{proof}
By \tref{thm-Xm-has-only-one-meaning},\\
\phx\qquad $\R^{(1)}=\R^1$ \quad and\quad $\R^{(2)}=\R^2$\quad and\quad $\R^{(3)}=\R^3$\quad and\quad $\cdots$.\\
Then $\TNSR_1=\{\R^{(1)},\R^{(2)},\R^{(3)},\ldots\}=\{\R^1,\R^2,\R^3,\ldots\}=\EUCL$.
\end{proof}

We have $\R^{2\times3},\R^{5\times7},\R^{7\times9\times4},\R^{2\times2\times2},\R^{2\times2\times2\times2}\in\TNSR$.\\
Also, $\forall v\in\R^{2\times3}$, $\exists a,b,c,d,e,f\in\R$ s.t.~$v=\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]$.\\
That is, each element of $\R^{2\times3}$, as a $2$-tensor,\\
\phx\qquad is pictured as a $2$-dimensional array, fitting nicely on the page.\\
Picturing elements of $\R^{5\times7}$ is slightly harder,\\
\phx\qquad requiring room for a $5\times7$ array, but is still $2$-dimensional.\\
By contrast, the elements of $\R^{7\times9\times4}$ are all $3$-tensors,\\
\phx\qquad and it's hard to put a $3$-dimensional array onto a page.\\
The tensor space $\R^{2\times2\times2}$ is only $8$-dimensional,\\
\phx\qquad but is still difficult to picture its elements on a page.\\
Nevertheless, we can at least imagine each element of $\R^{2\times2\times2}$,\\
\phx\qquad because we live in a three-dimensional world.\\
By contrast, elements of $\R^{2\times2\times2\times2}$ are hard even to imagine,\\
\phx\qquad without living in a four-dimensional space.

\begin{thm}
Let $S\in\TNSR$.
\qquad Then\\
\phx\qquad\qquad\qquad $\forall v\in S$, \quad $v$ is a functional \qquad\qquad\qquad and\\
\phx\qquad\qquad\qquad $\forall v,w\in S$, \quad $v+w\in S$ \qquad\qquad\qquad\quad $\,\,$ and\\
\phx\qquad\qquad\qquad $\forall c\in\R$, $\forall v\in S$, \quad $cv\in S$.
\end{thm}

\begin{defn}\wrlab{defn-index-set-notation}
Let $X$ be a set, $\rho\in\N$, $m\in\N^\rho$, $Y:=X^m$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\scri_Y:=[m]$.
\end{defn}

Following \dref{defn-index-set-notation},
we have $Y=X^m=X^{[m]}=X^{\scri_Y}$.


\begin{thm}
Let $S:=\R^{2\times3\times4}$.\\
Then $\scri_S=[2\times3\times4]=[1..2]\times[1..3]\times[1..4]$\\
\phx\qquad\qquad$=\{1,2\}\times\{1,2,3\}\times\{,1,2,3,4\}$.\\
\end{thm}

Let $S:=\R^{2\times3\times4}$.
Then $S=\R^{[2\times3\times4]}=\R^{\scri_S}$.
More generally:

\begin{thm}
Let $S\in\TNSR$.
Then $S=\R^{\scri_S}$.
\end{thm}

\begin{defn}\wrlab{defn-dot-prod-norm-in-tensor-spaces}
Let $S\in\TNSR$.
Then\\
\phx\qquad\qquad $\forall v,w\in S$, \qquad $\ds{v\,\,\sbullet_S\,\,w\,\,:=\,\,\sum_{j\in\scri_S}\,v_jw_j}$.\\
Also, \quad\quad $\,\,\,\forall v\in S$, \qquad\quad $\,|v|_S\,\,:=\,\,\sqrt{v\,\,\sbullet_S\,\,v}$.
\end{defn}

Following \dref{defn-dot-prod-norm-in-tensor-spaces}, if $S$ is obvious,\\
\phx\qquad we may sometimes omit ``$S$'' from the subscript in $v\,\,\sbullet_S\,\,w$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\,\,$ and simply write $v\sbullet w$.\\
Also, following \dref{defn-dot-prod-norm-in-tensor-spaces}, if $S$ is obvious,\\
\phx\qquad we may sometimes omit ``$S$'' from the subscript in $|v|_S$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\,\,$ and simply write $|v|$.

\begin{thm}
We have\\
\vskip.01in\noindent
\phx\qquad\qquad $\left[\begin{array}{ccc}1&2&3\\4&5&6\end{array}\right]\sbullet\left[\begin{array}{ccc}7&8&9\\10&11&12\end{array}\right]$\\
\vskip.01in\noindent
\phx\qquad\qquad\qquad $=\quad1\cdot7+2\cdot8+3\cdot9+4\cdot10+5\cdot11+6\cdot12$.\\
\vskip.01in\noindent
Also, \qquad $\left|\,\,\left[\begin{array}{ccc}1&2&3\\4&5&6\end{array}\right]\,\,\right|\quad=\quad\sqrt{1^2+2^2+3^2+4^2+5^2+6^2}$.
\end{thm}

\begin{defn}\wrlab{defn-tensor-space-as-metric-space}
Let $S\in\TNSR$.\\
\phx\qquad\qquad Define $\delta\in\scrm(S)$ by $\delta(v,w)=|w-v|_S$.\\
\phx\qquad\qquad Then $\delta$ is called the \bfindex[standard metric] on $S$.\\
\phx\qquad\qquad Also, the metric space $(S,\delta)$ is denoted $S$.
\end{defn}

Let $S\in\TNSR$ and let $\delta$ be the standard metric on $S$.
Then $d_S=\delta$.

\begin{thm}
Let $S:=\R^{2\times3}$.\\
\phx\qquad Then \qquad\qquad $d_S\left(\left[\begin{array}{ccc}1&2&3\\4&5&6\end{array}\right],\left[\begin{array}{ccc}0&1&3\\9&8&2\end{array}\right]\right)\quad=$\\
\phx\quad $\sqrt{(1-0)^2+(2-1)^2+(3-3)^2+(4-9)^2+(5-8)^2+(6-2)^2}$.
\end{thm}

\begin{defn}
Let $X$ be a set, $\rho\in\N$, $m\in\N^\rho$, $Y:=X^m$.\\
\phx\qquad\qquad\qquad\qquad\qquad$\,$ Then $\Pi_Y:=\{\pi_i^Y\,|\,i\in[m]\}$.
\end{defn}

\begin{defn}
We define $\Pi_\R:=\{\id_\R\}$.
\end{defn}

Let $S\in\TNSR^+$ and let $p\in\Pi_S$.\\
Then $p:S\to\R$ is distance semi-decreasing, {\it i.e.}, Lipschitz-1.\\
It follows that $p$ is continuous from $S$ to $\R$.

\begin{thm}
Let $S:=\R^{2\times3}$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\Pi_S=\{\pi_{11}^S,\pi_{12}^S,\pi_{13}^S,\pi_{21}^S,\pi_{22}^S,\pi_{23}^S\}$.
\end{thm}

\begin{defn}
We define: $\EUCL^+:=\{\R\}\cup\EUCL$.\\
\phx\qquad\qquad\qquad\quad$\,\,\,\,\,$ We also define: $\TNSR^+:=\{\R\}\cup\TNSR$.
\end{defn}

\begin{defn}
Let $S\in\TNSR^+$.\\
\phx\qquad\qquad\qquad\qquad\quad$\,$ Then $\scrm_0^S:=\{C_S^1\}$.\\
\phx\qquad\qquad\qquad Also, $\forall j\in\N$, $\scrm_j^S:=\{p_1\cdots p_j\,|\,p_1,\ldots,p_j\in\Pi_S\}$.
\end{defn}

For any $S\in\TNSR^+$, for any $j\in\N$, the elements of $\scrm_j^S$ are called
\bfindex[monomials] of degree $j$ on $S$.
Note that, $\forall j\in\N$, $\scrm_j^\R=\{\id_\R^j\}$, so there is only
one monomial of degree $j$ on $\R$, namely $\id_\R^j$.

Since every projection is continuous, it follows that every monomial is continuous.

\begin{defn}
Let $S\in\TNSR$ and let $j\in\N$.\\
Then $\,\,\scrh_j^S\,\,:=\,\,\{\,\,a_1\mu_1+\cdots+a_\ell\mu_\ell\,\,|\,\,\ell\in\N,$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad $a_1,\ldots,a_\ell\in\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad $\mu_1,\ldots,\mu_\ell\in\scrm_j^S\}$.
\end{defn}

For any $S\in\TNSR^+$, for any $j\in\N$, the elements of $\scrh_j^S$ are called
\bfindex[homogeneous polynomial functionals] of degree $j$ on $S$.
Thus, a homogeneous polynomial of degree $j$ is a finite linear combination of monomials, all of degree $j$.
The  word ``homogeneous'' expresses the idea that the monomials being used all have the same degree.

Since every monomial is continuous, it follows that every homogeneous polynomial functional is continuous.

\begin{thm}
$\forall j\in\N_0$, \quad $\scrh_j^\R=\scrh_j$.
\end{thm}

\begin{thm}
Let $S:=\R^{2\times3}$.
Define $P,Q:S\to\R$ by\\
\phx\quad $\ds{P\left(\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]\right)=bcde\,\,}$ and
$\ds{\,\,Q\left(\left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]\right)=4bcde-\sqrt{2}f^4}$.\\
Then $P=(\pi_{12}^S)\cdot(\pi_{13}^S)\cdot(\pi_{21}^S)\cdot(\pi_{22}^S)\in\scrm_4^S\subseteq\scrh_4^S$. \qquad
Also, $Q\in\scrh_4^S$.\\
\end{thm}

\begin{defn}
Let $S,T\in\TNSR^+$ and $j\in\N_0$.\\
\phx\qquad\qquad Then: \quad $\scrh_j^{ST}\,\,:=\,\,\{\,\,f:S\to T\,\,|\,\,\forall p\in\Pi_T,\,\,p\circ f\in\scrh_j^S\,\,\}$.
\end{defn}

For any $S,T\in\TNSR^+$, for any $j\in\N$, the elements of $\scrh_j^{ST}$ are called
\bfindex[homogeneous polynomials] of degree $j$ on $S$.

Let $S,T\in\TNSR^+$ and $f:S\to T$.\\
Then $(\,f\hbox{ is continuous}\,)\,\Leftrightarrow\,(\,\forall p\in\Pi_T, p\circ f\hbox{ is continuous}\,)$.\\
So, since every homogeneous polynomial functional is continuous,\\
\phx\qquad it follows that every homogeneous polynomial is continuous.

\begin{thm}
Let $S\in\TNSR^+$ and $j\in\N_0$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\scrh_j^{S\R}=\scrh_j^S$.
\end{thm}

\begin{defn}
Let $S,T\in\TNSR^+$.\\
Then $\scrc_{ST}:=\scrh_0^{ST}$ and $\scrl_{ST}:=\scrh_1^{ST}$ and $\scrq_{ST}:=\scrh_2^{ST}$ and $\scrk_{ST}:=\scrh_3^{ST}$.
\end{defn}

\begin{thm}
Let $S\in\TNSR^+$ and $k\in\N_0$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $H_k^{S\R}=\scrh_k^S$.
\end{thm}

\begin{thm}
Let $k\in\N_0$. \qquad
Then $H_k^{\R\R}=\scrh_k$.
\end{thm}

\begin{defn}\wrlab{defn-zeros-and-bfzeros}
Let $S\in\TNSR$.\\
\phx\qquad\qquad\qquad Then $0_S:=C_{\scri_S}^0$. \quad
Also $\bfzero_S:=C_S^0$.
\end{defn}

In \dref{defn-zeros-and-bfzeros},
we have $0_S\in\R^{\scri_S}=S$ and $\bfzero_S:S\to\R$.

\begin{defn}
We define: \quad $0_\R:=0$ \quad and \quad $\bfzero_\R:=\bfzero$.
\end{defn}

\begin{defn}\wrlab{defn-norm-on-S}
Let $S\in\TNSR^+$.\\
Then $|\bullet|_S:S\to[0;\infty)$ is defined by $|v|_S=\sqrt{v\sbullet v}$.
\end{defn}

In \dref{defn-norm-on-S}, comparing with \dref{defn-dot-prod-norm-in-tensor-spaces},
we see: $\forall v\in S$, we have $|v|_S=|v|$.

\section{Some function spaces between tensor spaces}

Let $S\in\TNSR$.
Recall, from \dref{defn-tensor-space-as-metric-space}, that, $\forall v,w\in S$,\\
\phx\qquad $\ds{d_S(v,w)\quad=\quad|v-w|_S\quad=\quad\sqrt{\sum_{i\in\scri_s}\,(v_i-w_i)^2}}$.

\begin{defn}
Let $S,T\in\TNSR^+$. \quad
Then\\
\phx\quad $\DNZ_{ST}:=\{\alpha:S\drta T\,|\,\alpha\hbox{ is defined near }0\}$,\\
\phx\quad $\BNZ_{ST}:=\{\alpha\in\DNZ_{ST}\,|\,\exists B\in\scrb_S(0_S)~\hbox{s.t.}~\alpha_*(B)\hbox{ is bounded in }T\}$,\\
\phx\quad $\CVZ_{ST}:=\{\alpha\in\DNZ_{ST}\,|\,[\,\alpha(0_S)=0_T\,]\,\&\,[\,\alpha\hbox{ is continuous at }0_S\,]\}$.\\
\end{defn}

\begin{defn}
Let $X$ be a set, $T\in\TNSR$, $f,g:X\drta T$.\\
Then $f+g:X\drta T$ is defined by $(f+g)_z\,=\,(f_z)+(g_z)$.
\end{defn}

\begin{defn}
Let $X$ be a set, $T\in\TNSR$, $c\in\R$, $f:X\drta T$.\\
Then $c\cdot f:X\drta T$ is defined by $(c\cdot f)_z\,=\,c\cdot(f_z)$.
\end{defn}

\begin{defn}
Let $X$ be a set, $T\in\TNSR$.\\
Let $f:X\drta\R$, $g:X\drta T$.\\
Then $f\cdot g:X\drta T$ is defined by $(f\cdot g)_z\,=\,(f_z)\cdot(g_z)$.\\
Also, $g\cdot f:=f\cdot g$.
\end{defn}

\begin{defn}
Let $S,T\in\TNSR^+$ and $j\in\N_0$. \quad
Then:\\
\phx\quad $\ds{\scrlito_j^{ST}\,\,:=\,\,\left\{\,\,\alpha\in\DNZ\,\,\bigg|\,\,[\,\,\alpha(0_S)=0_T\,\,]\,\,\&\,\,\left[\,\,\frac{\alpha}{|\bullet|_S^j}\to0_T\hbox{ near }0_S\,\,\right]\right\}}$\\
\phx\qquad\qquad and \qquad $\scrbigo_j^{ST}\,\,:=\,\,(\BNZ_{ST})\,\cdot\,(|\bullet|_S^j)$.
\end{defn}

\begin{thm}
Let $S,T\in\TNSR^+$ and let $j\in\N_0$. \quad
Then\\
\phx\qquad\qquad\qquad\qquad $\,\,\scrlito_j^{ST}\,\,=\,\,(\CVZ_{ST})\,\cdot\,(|\bullet|_S^j)$.
\end{thm}

\begin{thm}
We have: \qquad $\DNZ_{\R\R}\,\,=\,\,\DNZ$,\\
\phx\qquad\qquad\qquad\qquad $\BNZ_{\R\R}\,\,=\,\,\BNZ$ \qquad and \qquad $\CVZ_{\R\R}\,\,=\,\,\CVZ$.
\end{thm}

\section{Basic properties of tensor spaces}

\begin{defn}\wrlab{defn-dot-norm-inR}
$\forall x,y\in\R$, \quad $x\,\,\sbullet_\R\,\,y\,\,\,\,:=\,\,\,\,xy$.\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall x\in\R$, \qquad $|x|_\R\,\,:=\,\,|x|$.
\end{defn}

Following \dref{defn-dot-norm-inR},\\
\phx\qquad we may sometimes omit ``$\R$'' from the subscript in $x\,\,\sbullet_\R\,\,y$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\,\,$ and simply write $x\sbullet y$.\\

\begin{thm}
Let $S\in\TNSR^+$. \quad
Then\\
\phx\qquad $\forall v,w\in S$, \quad $|v\,\sbullet_S\,w|_\R\,\,\le\,\,|v|_S\,\cdot\,|w|_S$ \qquad\qquad and\\
\phx\qquad $\forall v,w\in S$, \quad $|v\,+\,w|_S\,\,\le\,\,|v|_S\,+\,|w|_S$ \qquad\qquad and\\
\phx\qquad $\forall v,w\in S$, \quad $|\,|v|_S\,-\,|w|_S\,|_\R\,\,\le\,\,|\,v\,-\,w\,|_S$.
\end{thm}

Let $S\in\TNSR^+$ and let $v,w\in S$. Then\\
\phx\qquad\qquad $d_\R(|v|_S,|w|_S)\,\,=\,\,|\,|v|_S\,-\,|w|_S\,|_\R\,\,\le\,\,|\,v\,-\,w\,|_S=d_S(v,w)$.\\
That is, $|\bullet|_S:S\to\R$ is distance-semidecreasing, {\it i.e.}, Lipschitz-1.\\
It follows that $|\bullet|_S:S\to\R$ is continuous.

\begin{thm}
Let $S,T\in\TNSR^+$, $f:S\drta T$.\\
\phx  Then: \quad $(\,f\in\scrl_{ST}\,)\quad\,\Leftrightarrow\,\quad(\,\,\,[\,\forall v,w\in S,\,\,f_{v+w}=f_v+f_w\,]$\\
\phx\quad\qquad\qquad\qquad\qquad\qquad $\,\&\,\quad\,\,[\,\forall c\in\R,\,\forall v\in S,\,\,f_{cv}=c\cdot(f_v)\,]\,\,\,)$.\\
\end{thm}

That is, $f$ is linear iff $f$ is ``algebraically linear''.

\begin{defn}
$\forall S,T\in\TNSR^+$, \quad $\bfzero_{ST}\,\,:=\,\,C_S^{0_T}$.
\end{defn}

\begin{thm}
Let $S,T\in\TNSR^+$, let $j\in\N_0$ and let $f\in\scrh_j^{ST}$.\\
Let $c\in\R$ and $v\in S$. \qquad
Then $f(cv)=c^j\cdot[f(v)]$.
\end{thm}

\begin{thm}
Let $S,T\in\TNSR^+$.\\
\phx\qquad Then: $(\,\scrq_{ST}\subseteq\scrbigo_2^{ST}\,)\,\&\,(\,\scrq_{ST}\cap\scrlito_2^{ST}=\{\bfzero_{ST}\}\,)$.
\end{thm}

\begin{thm}
Let $S,T\in\TNSR^+$ and let $j\in\N_0$.\\
\phx\qquad Then: $(\,\scrh_j^{ST}\subseteq\scrbigo_j^{ST}\,)\,\&\,(\,\scrh_j^{ST}\cap\scrlito_j^{ST}=\{\bfzero_{ST}\}\,)$.
\end{thm}

\begin{thm}
$\forall S,T\in\TNSR^+$, \quad $\CVZ_{ST}\subseteq\BNZ_{ST}$.
\end{thm}

\begin{thm}
Let $S,T\in\TNSR^+$ and let $j\in\N_0$.\\
\phx\qquad\qquad\qquad Then $\scrbigo_{j+1}^{ST}\subseteq\scrlito_j^{ST}\subseteq\scrbigo_j^{ST}$.
\end{thm}
          
\begin{proof}
We have: $\scrbigo_{j+1}^{ST}=(\BNZ_{ST})\cdot(|\bullet|_S^{j+1})$\\
\phantom{xt}\qquad\qquad\qquad\qquad\quad $=(\BNZ_{ST})\cdot(|\bullet|_S)\cdot(|\bullet|_S^j)$\\
\phantom{xt}\qquad\qquad\qquad\qquad\quad $\subseteq(\BNZ_{ST})\cdot(\CVZ_{ST})\cdot(|\bullet|_S^j)$\\
\phantom{xt}\qquad\qquad\qquad\qquad\quad $\subseteq(\CVZ_{ST})\cdot(|\bullet|_S^j)=\scrlito_j^{ST}$.\\
\phantom{xt}\qquad\qquad Want: $\scrlito_j^{ST}\subseteq\scrbigo_j^{ST}$.\\
We have: $\scrlito_j^{ST}=(\CVZ_{ST})\cdot(|\bullet|_S^j)\subseteq(\BNZ_{ST})\cdot(|\bullet|_S^j)=\scrbigo_j^{ST}$.
\end{proof}

\begin{thm}
$\forall S\in\TNSR^+$, \qquad $|\bullet|_S\in\CVZ$.
\end{thm}

\section{Double translation}

\begin{defn}\wrlab{defn-dbl-translate-RS}
Let $R,S\in\TNSR^+$, $f:R\drta S$.\\
Then, $\forall p\in\R$, \quad ${}_{RS}f_p^T:R\drta S$ is defined by $({}_{RS}f_p^T)(h)=f_{p+h}-f_p$.\\
\phx\qquad\qquad Also, \quad ${}_{RS}f_{\frownie}^T\quad:=\quad\frownie$.\\
\end{defn}

In \dref{defn-dbl-translate-RS}, we will almost always omit the pre-subscript $RS$,\\
\phx\qquad\qquad and write $f_p^T$ instead of ${}_{RS}f_p^T$,\\
\phx\qquad\qquad and, also, $f_{\frownie}^T$ instead of ${}_{RS}f_{\frownie}^T$.

We have: $\forall R,S\in\TNSR$, $\forall f:R\drta S$, $\forall p\in R\backslash(\dom[f])$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $f_p^T\,\,=\,\,\emptyset\,\,\ne\,\,\frownie$.

\begin{defn}
Let $X$ be a set and let $S\in\TNSR^+$. \quad
Then\\
\phx\qquad $\forall f,g:X\drta S$, \quad $f\sbullet_S g:X\drta\R$ \quad is defined\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad by \quad $(f\sbullet_S g)_p=(f_p)\sbullet_S(g_p)$\\
\phx\qquad\qquad and \qquad $\forall v\in S$, \quad $\forall g:X\drta S$, \quad $v\sbullet_S g:=(C_X^v)\sbullet_S g$\\
\phx\qquad\qquad and \qquad $\forall f:X\drta S$, \quad $\forall w\in S$, \quad $f\sbullet_S w:=f\sbullet_S(C_X^w)$.
\end{defn}

\begin{defn}
Let $S,T\in\TNSR^+$, $f:S\drta T$ and $p\in S$.\\
\phx\qquad Then \quad $\LINS_p^{ST}\,\,:=\,\,\{\,L\in\scrl_{ST}\,|\,f_p^T-L\in\scrlito_1^{ST}\,\}$\\
\phx\qquad and \quad $D_p^{ST}f\,\,:=\,\,\UE(\LINS_p^{ST}f)$.\\
\end{defn}

\begin{thm}
Let $S,T\in\TNSR^+$, $f:S\drta T$ and $p\in S$.\\
\phx\qquad Then \quad $\#(\LINS_p^{ST})\le1$.
\end{thm}

\section{Tensor products of tensor spaces}

\begin{defn}
Let $\sigma,\tau\in\N$, let $m\in\N^\sigma$ and let $n\in\N^\tau$.\\
\phx\qquad Then $m\|n:=(m_1,\ldots,m_\sigma,n_1,\ldots,n_\tau)$.
\end{defn}

\begin{defn}
Let $\sigma\in\N$, let $m\in\N^\sigma$ and let $n\in\N$.\\
\phx\qquad Then $m\|n:=m\|(n)$ and $n\|m:=(n)\|m$.
\end{defn}

\begin{defn}
$\forall m,n\in\N$, \quad $m\|n:=(m)\|(n)$.
\end{defn}

\begin{defn}
Let $\sigma,\tau\in\N$, let $m\in\N^\sigma$ and let $n\in\N^\tau$.\\
\phx\qquad Then $\R^m\otimes\R^n\,\,:=\,\,\R^{m\|n}$.
\end{defn}

\begin{defn}
$\forall S\in\TNSR$, \quad $S\otimes\R:=S$ and $\R\otimes S:=S$.
\end{defn}

\begin{defn}
We define: $\R\otimes\R:=\R$.
\end{defn}

Recall that $\R^{2\times3}\ne\R^2\times\R^3$.
On the other hand, we have:

\begin{thm}
$\R^2\otimes\R^3=\R^{(2)}\otimes\R^{(3)}=\R^{(2,3)}=\R^{2\times3}$.
\end{thm}

\begin{thm}
We have:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\R^1\otimes\R^{3\times5}=\R^{1\times3\times5}\ne\R^{3\times5}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\R\otimes\R^{3\times5}=\R^{3\times5}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\R^{6\times8\times2}\otimes\R=\R^{6\times8\times2}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\R^{6\times8\times2}\otimes\R^{3\times5}=\R^{6\times8\times2\times3\times5}$.
\end{thm}

\section{Slopes of linear maps between tensor spaces}

Let $S,T\in\TNSR$.
According to HW\#5-5, $\forall i\in\scri_S$, $\forall j\in\scri_T$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad we have $i\|j\in\scri_{S\otimes T}$.\\
Also, we have the following:

\begin{thm}
Let $S,T\in\TNSR$, $k\in\scri_{S\otimes T}$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $\exists1\,\,i\in\scri_S$, $\exists1\,\,j\in\scri_T$ s.t.~$k=i\|j$.
\end{thm}

\begin{defn}
Let $\sigma,\tau\in\N$.\\
Let $m\in\N^\sigma$, $n\in\N^\tau$. \qquad
Let $S:=\R^m$, $T:=\R^n$. \qquad
Let $k\in\scri_{S\otimes T}$.\\
\phx\qquad Then \quad $k_S:=(k_1,\ldots,k_\sigma)$ \quad and \quad $k_T:=(k_{\sigma+1},\ldots,k_{\sigma+\tau})$.
\end{defn}

\begin{defn}
Let $S,T\in\TNSR$ and let $L\in\scrl_{ST}$.\\
\phx\qquad Then $\sl_L^{ST}\in\R^{\scri_{T\otimes S}}$ is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\sl_L^{ST})_k\quad=\quad\pi_{k_T}^T\,(\,L\,(\,\varepsilon_{k_S}^S\,)\,)$.
\end{defn}

We have: \qquad $\forall S,T\in\TNSR$, $\forall L\in\scrl_{ST}$, \quad $\sl_L^{ST}\in\R^{\scri_{T\otimes S}}=T\otimes S$.

\begin{thm}
Let $\sigma:=1$, $\tau=1$, $m=(3)$, $n=(2)$.\\
Let $S:=\R^3$ and $T:=\R^2$.\\
Define $L\in\scrl_{ST}$ by\\
\phantom{xx}\qquad $L(x,y,z)=(\,\,3x-2y+4z\,\,,$\\
\phx\qquad\qquad\qquad\qquad $\,\,7x+\phx y-5z\,\,)$.\\
Then: \quad (1) $(\sl_L^{ST})_{21}=7$ \quad and \quad (2) $\ds{\sl_L^{ST}=\left[\begin{array}{ccc}3&-2&4\\7&1&-5\end{array}\right]}$.
\end{thm}

\begin{proof}
{\it Proof of (1):}\\
We calculate $(\sl_L^{ST})_{21}=\pi_2^T(L(\varepsilon_1^S))=\pi_2^T(L(1,0,0))=\pi_2^T(3,7)=7$.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}
Unassigned HW.
{\it End of proof of (2).}
\end{proof}

\begin{defn}\wrlab{defn-slope-when-target-R}
Let $S\in\TNSR$ and let $L\in\scrl_{S\R}$.\\
\phx\qquad Then $\sl_L^{S\R}\in\R^{\scri_S}$ is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $(\sl_L^{S\R})_k\quad=\quad L\,(\,\varepsilon_k^S\,)$.
\end{defn}

We have: \qquad $\forall S\in\TNSR$, $\forall L\in\scrl_{S\R}$, \quad $\sl_L^{S\R}\in\R^{\scri_S}=S=\R\otimes S$.

\begin{defn}\wrlab{defn-sl-when-dom-is-R}
Let $T\in\TNSR^+$ and let $L\in\scrl_{\R T}$.\\
\phx\qquad Then $\sl_L^{\R T}:=L(1)$.
\end{defn}

We have: \qquad $\forall T\in\TNSR$, $\forall L\in\scrl_{\R T}$, \quad $\sl_L^{\R T}\in T=T\otimes\R$.

Also, $\forall L\in\scrl$, \quad both \quad $L\in\scrl_{\R\R}$ and $\sl_L^{\R\R}=\sl_L$.\\

\begin{thm}
Let $S,T\in\TNSR^+$ and let $L\in\scrl_{ST}$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\sl_L^{ST}\in T\otimes S$.
\end{thm}

\begin{defn}
Let $S,T\in\TNSR^+$. \quad
Then $\sl_{\frownie}^{ST}=\frownie$.
\end{defn}

\begin{defn}
Let $S,T\in\TNSR^+$. \quad
Then $\sl_\bullet^{ST}:\scrl_{ST}\to T\otimes S$ is defined by
$(\sl_\bullet^{ST})(L)=\sl_L^{ST}$.
\end{defn}

\begin{defn}\wrlab{defn-tensor-deriv}
Let $S,T\in\TNSR^+$ and let $f:S\drta T$.\\
Then ${}_{ST}f':S\drta T\otimes S$ is defined by ${}_{ST}f'_p=\sl_\bullet^{ST}(D_p^{ST}f)$.
\end{defn}

In \dref{defn-tensor-deriv}, we will almost always omit the pre-subscript $ST$,\\
\phx\qquad\qquad and write $f'_p$ instead of ${}_{ST}f'_p$.\\

\begin{thm}
Let $f:\R^{3\times2}\drta\R^{5\times7}$.\\
\phx\qquad\qquad\qquad\qquad Then $f':\R^{3\times2}\drta\R^{5\times7\times3\times2}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f'':\R^{3\times2}\drta\R^{5\times7\times3\times2\times3\times2}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f''':\R^{3\times2}\drta\R^{5\times7\times3\times2\times3\times2\times3\times2}$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R^{5\times7}$.\\
\phx\qquad\qquad\qquad\qquad Then $f':\R\drta\R^{5\times7}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f'':\R\drta\R^{5\times7}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f''':\R\drta\R^{5\times7}$.
\end{thm}

\begin{thm}
Let $f:\R^1\drta\R^{5\times7}$.\\
\phx\qquad\qquad\qquad\qquad Then $f':\R^1\drta\R^{5\times7\times1}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f'':\R^1\drta\R^{5\times7\times1\times1}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f''':\R^1\drta\R^{5\times7\times1\times1\times1}$.
\end{thm}

\begin{thm}
Let $f:\R^{3\times2}\drta\R$.\\
\phx\qquad\qquad\qquad\qquad Then $f':\R^{3\times2}\drta\R^{3\times2}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f'':\R^{3\times2}\drta\R^{3\times2\times3\times2}$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,f''':\R^{3\times2}\drta\R^{3\times2\times3\times2\times3\times2}$.
\end{thm}

\section{Linearity of multivariable differentiation}

\begin{thm}\wrlab{thm-additivity-of-multivar-diff}
Let $S,T\in\TNSR^+$, $f,g:S\drta T$ and $p\in S$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $D_p^{ST}(f+g)\,=^*\,D_p^{ST}f\,+\,D_p^{ST}g$.
\end{thm}

\begin{thm}\wrlab{thm-multivar-diff-comm-with-scalarmult}
Let $S,T\in\TNSR^+$, $c\in\R$, $f:S\drta T$ and $p\in S$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $D_p^{ST}(c\cdot f)\,=^*\,c\,\cdot\,D_p^{ST}f$.
\end{thm}

\begin{thm}\wrlab{thm-deriv-distribs-over-addn}
Let $S,T\in\TNSR^+$, $f,g:S\drta T$ and $p\in S$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $(f+g)'_p\,=^*\,f'_p\,+\,g'_p$.
\end{thm}

\begin{thm}\wrlab{thm-deriv-commutes-with-scalar-mult-multivariable}
Let $S,T\in\TNSR^+$, $c\in\R$, $f:S\drta T$ and $p\in S$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $(c\cdot f)'_p\,=^*\,c\,\cdot\,f'_p$.
\end{thm}

\section{The multivariable product rule}

\begin{defn}
Let $X$, $Y$ and $Z$ be sets.
Let $f:X\times Y\drta Z$.\\
Then, $\forall a\in X$, $f(a,\bullet):Y\drta Z$ is defined by $(f(a,\bullet))(b)=f(a,b)$.\\
Also, $\forall b\in Y$, $f(\bullet,b):X\drta Z$ is defined by $(f(\bullet,b))(a)=f(a,b)$.
\end{defn}

\begin{defn}\wrlab{defn-scrb-for-bilinear}
Let $S,T,U\in\TNSR^+$.\\
Then $\scrb_{ST}^U\,\,:=\,\,\{\,\,B:S\times T\to U\qquad|\qquad(\,\forall v\in S,\,B(v,\bullet)\in\scrl_{TU}\,)$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\,\,\,\&\,(\,\forall w\in T,\,B(\bullet,w)\in\scrl_{SU}\,)\,\,\}$.
\end{defn}

Elements of $\scrb_{ST}^U$ are called \bfindex[bilinear] functions from $S$ times $T$ to $U$.

NOTE TO SELF: We need to establish that every bilinear is bounded, which we plan to make HW\#7-4.
This is needed to prove $\scrbigo*\scrbigo\subseteq\scrbigo$, etc., which, in turn is needed for the Product Rule
(\tref{thm-multi-variable-linearization-prod-rule}).

\begin{defn}
Let $X$, $Y$ and $Z$ be sets.\\
\phx\qquad\qquad\qquad\qquad\qquad Let $*:X\times Y\drta Z$, \quad $a\in X$ \quad and \quad $b\in Y$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad Then \quad $a*b\,\,:=\,\,*(a,b)$.
\end{defn}

Every dot product is bilinear:

\begin{thm}
Let $S\in\TNSR^+$.\\
Define $*:S\times S\to\R$ by $v*w=v\sbullet_Sw$. \qquad
Then $*\in\scrb_{SS}^\R$.
\end{thm}

\begin{defn}
Let $R,S,T,U\in\TNSR^+$ and let $*\in\scrb_{ST}^U$.\\
Then: \qquad $\forall f:R\drta S$, \quad $\forall g:R\drta T$,\\
\phx\qquad\qquad\qquad\qquad\qquad $f*g:R\drta U$ is defined by $(f*g)_p=f_p*g_p$.\\
Also, \qquad $\forall v\in S$, \quad $\,\,\forall g:R\drta T$, \qquad $\,v*g:=C_R^v*g$.\\
Also, \qquad $\forall f:R\drta S$, \quad $\forall w\in T$, \qquad $f*w:=f*C_R^w$.\\
\end{defn}

NOTE TO SELF: Need to define bilinear products of sets of functions,
and, also, compositions of sets of functions.

The following is proved in the same was as for functions $\R\drta\R$.
Needed: Boundedness of bilinear maps between tensor spaces, which we plan to make
HW\#7-4.

\begin{thm}
Let $U,W,X,Z\in\TNSR^+$, $*\in\scrb_{WX}^Z$, $j,k\in\N_0$.\\
Then $\scrbigo_j^{UW}*\scrlito_k^{UX}\subseteq\scrlito_{j+k}^{UZ}$.\\
Also, $\scrlito_j^{UW}*\scrbigo_k^{UX}\subseteq\scrlito_{j+k}^{UZ}$.\\
Also, $\scrbigo_j^{UW}*\scrbigo_k^{UX}\subseteq\scrbigo_{j+k}^{UZ}$.\\
\end{thm}

The following is proved in the same was as for functions $\R\drta\R$.

\begin{thm}
Let $V,W,X\in\TNSR^+$, $j,k\in\N$.\\
Then $\scrbigo_j^{WX}\circ\scrlito_k^{VW}\subseteq\scrlito_{jk}^{VX}$.\\
Also, $\scrlito_j^{WX}\circ\scrbigo_k^{VW}\subseteq\scrlito_{jk}^{VX}$.\\
Also, $\scrbigo_j^{WX}\circ\scrbigo_k^{VW}\subseteq\scrbigo_{jk}^{VX}$.\\
\end{thm}

\tref{thm-multi-variable-precalc-prod-rule}, below, is called the \bfindex[Multivariable Precalculus Product Rule].
\index[terms]{Precalculus Product Rule, Multivariable}

\begin{thm}\wrlab{thm-multi-variable-precalc-prod-rule}
Let $R,S,T,U\in\TNSR^+$ and let $*\in\scrb_{ST}^U$.\\
\phx\qquad\qquad Let \quad $f:R\drta S$, \quad $g:R\drta T$ \quad and \quad $p\in R$.\\
\phx\qquad Then \qquad $(f*g)_p^T\,\,\,=\,\,\,(f_p^T)*g_p\,\,+\,\,f_p*(g_p^T)\,\,+\,\,(f_p^T)*(g_p^T)$.
\end{thm}

\begin{proof}
It is an unassigned HW problem to modify the proof of \tref{thm-precalc-prod-rule}
to prove this theorem.
\end{proof}

\begin{thm}
Let $R,S,T,U\in\TNSR^+$ and let $*\in\scrb_{ST}^U$.\\
\phx\qquad Then: \qquad\qquad $\forall L\in\scrl_{RS}$, \quad $\forall w\in T$, \quad $\,L*w\in\scrl_{RU}$.\\
\phx\qquad Also, \qquad\qquad $\forall v\in S$, \quad $\,\,\forall M\in\scrl_{RT}$, \quad $v*M\in\scrl_{RU}$.\\
\end{thm}

\tref{thm-multi-variable-linearization-prod-rule}, below, is called the \bfindex[Linearization Product Rule].
\index[terms]{Product Rule, Linearization}

\begin{thm}\wrlab{thm-multi-variable-linearization-prod-rule}
Let $R,S,T,U\in\TNSR^+$ and let $*\in\scrb_{ST}^U$.\\
\phx\qquad\qquad Let \quad $f:R\drta S$, \quad $g:R\drta T$ \quad and \quad $p\in R$.\\
\phx\qquad Then \qquad $D_p^{RU}(f*g)\,\,\,=^*\,\,\,(D_p^{RS}f)*g_p\,\,+\,\,f_p*(D_p^{RT}g)$.
\end{thm}

\begin{proof}
It is an unassigned HW problem to modify the proof of \tref{thm-prod-rule}
to prove this theorem.
Needed: Boundedness of bilinear maps between tensor spaces, which we plan to make
HW\#7-4.
\end{proof}

\tref{thm-multi-variable-tensorial-prod-rule}, below, is called the \bfindex[Tensorial Product Rule].
\index[terms]{Product Rule, Tensorial}

\begin{thm}\wrlab{thm-multi-variable-tensorial-prod-rule}
Let $R,S,T,U\in\TNSR^+$ and let $*\in\scrb_{ST}^U$.\\
\phx\qquad\qquad Let \quad $f:R\drta S$, \quad $g:R\drta T$ \quad and \quad $p\in R$.\\
\phx\qquad\qquad Let $S':=S\otimes R$ and $T':=T\otimes R$ and $U':=U\otimes R$.\\
\phx\qquad\qquad Define $*_L\in\scrb_{S'T}^{U'}$ by $A\,\,*_L\,\,b=\sl_\bullet^{RU}(\Lin_A^{RS}*b)$.\\
\phx\qquad\qquad Define $*_R\in\scrb_{ST'}^{U'}$ by $a\,\,*_R\,\,B=\sl_\bullet^{RU}(a*\Lin_B^{RS})$.\\
\phx\qquad\qquad Then \qquad $(f*g)'_p\,\,\,=^*\,\,\,f'_p\,\,*_L\,\,g_p\,\,+\,\,f_p\,\,*_R\,\,g'_p$.
\end{thm}

\begin{proof}
It is an unassigned HW problem to modify the proof of \tref{thm-prod-rule}
to prove this theorem.
Needed: Boundedness of bilinear maps between tensor spaces, which we plan to make
HW\#7-4.
\end{proof}

\begin{defn}
Let $S,T\in\TNSR^+$.\\
\phx\qquad Then $\sl_\bullet^{ST}:\scrl_{ST}\to T\otimes S$ is defined by
$(\sl_\bullet^{ST})_L=\sl_L^{ST}$.
\end{defn}

\begin{thm}
Let $S,T\in\TNSR^+$.\\
\phx\qquad Then $\sl_\bullet^{ST}:\scrl_{ST}\hookrightarrow> T\otimes S$.
\end{thm}

In fact, not only is $\sl_\bullet^{ST}:\scrl_{ST}\to T\otimes S$ bijective, but, also,
it is algebraically linear, and its inverse is algebraically linear, too.
We discussed all this in class.

\begin{defn}
Let $S,T\in\TNSR^+$.\\
\phx\qquad Then, $\forall L\in\scrl_{ST}$, \qquad $[L]_{ST}:=\sl_L^{ST}$.\\
\phx\qquad Also, $\forall A\in T\otimes S$, \quad $\,\,\Lin_A^{ST}:=(\sl_\bullet^{ST})_A^{-1}$.\\
\end{defn}

\begin{thm}
Let $S,T\in\TNSR^+$.\\
\phx\qquad Then, $\forall A\in T\otimes S$, \quad $[\Lin_A^{ST}]_{ST}=A$.\\
\phx\qquad Also, $\forall L\in\scrl_{ST}$, \qquad\quad $\Lin_{[L]_{ST}}^{ST}=L$.
\end{thm}

\begin{thm}
Let $S,T\in\TNSR^+$.\\
\phx\qquad Then, $\forall L,M\in\scrl_{ST}$, \quad $\,\,\,[L+M]_{ST}=[L]_{ST}+[M]_{ST}$.\\
\phx\qquad Also, $\forall c\in\R$, $\forall L\in\scrl_{ST}$, \quad $[c\cdot L]_{ST}=c\cdot([L]_{ST})$.\\
\phx\qquad Also, $\forall A,B\in T\otimes S$, \qquad $\,\,\,\,\Lin_{A+B}=\Lin_A+\Lin_B$.\\
\phx\qquad Also, $\forall c\in\R$, $\forall A\in T\otimes S$, \quad $\Lin_{c\cdot A}=c\cdot(\Lin_A)$.\\
\end{thm}

\begin{defn}
Let $R,S,T,U\in\TNSR^+$, $*\in\scrb_{ST}^U$.\\
\phx\qquad Then, $\forall A\in S\otimes R$, $\forall y\in T$, \quad $A*y:=[L_A^{RS}*y]_{RU}$.\\
\phx\qquad Also, $\forall x\in S$, $\forall B\in T\otimes R$, \quad $\,x*B:=[x*L_B^{RT}]_{RU}$.
\end{defn}

\begin{thm}
Let $R,S,T,U\in\TNSR^+$, $*\in\scrb_{ST}^U$.\\
\phx\qquad Let $f:R\drta S$, \quad $g:R\drta T$, \quad $p\in R$.\\
\phx\qquad\qquad Then: \quad $f'_p\,\,=^*\,\,f'_p\,*\,g_p\,\,+\,\,f_p\,*\,g'_p$.
\end{thm}

\section{The multivariable Chain Rule}

\tref{thm-multi-variable-linearization-chain-rule}, below, is called the \bfindex[Linearization Chain Rule].
\index[terms]{Chain Rule, Linearization}

\begin{thm}\wrlab{thm-multi-variable-linearization-chain-rule}
Let $S,T,U\in\TNSR^+$.\\
\phx\qquad Let $f:S\drta T$, \quad $g:T\drta U$, \quad $p\in S$, \quad $q:=f_p$.\\
\phx\qquad\qquad Then: \quad $D_p^{SU}(g\circ f)\,\,=^*\,\,(D_q^{TU}g)\,\circ\,(D_p^{ST}f)$.
\end{thm}

\begin{proof}
It is an unassigned HW problem to modify the proof of \tref{thm-chain-rule}
to prove this theorem.
\end{proof}

\begin{defn}\wrlab{defn-composition-mult-of-tensors}
Let $S,T,U\in\TNSR^+$.\\
\phx\qquad Then \quad $*_{STU}\,\,\,\in\,\,\,\scrb_{U\otimes T\,,\,T\otimes S}^{U\otimes S}$ \quad is defined by\\
\phx\qquad\qquad $B\,\,\,*_{STU}\,\,\,A\qquad=\qquad[\,\,(\Lin_B^{TU})\,\,\circ\,\,(\Lin_A^{ST})\,\,]_{SU}$.
\end{defn}

\tref{thm-multi-variable-tensorial-chain-rule}, below, is called the \bfindex[Tensorial Chain Rule].
\index[terms]{Chain Rule, Tensorial}

\begin{thm}\wrlab{thm-multi-variable-tensorial-chain-rule}
Let $S,T,U\in\TNSR^+$.\\
\phx\qquad Let $f:S\drta T$, \quad $g:T\drta U$, \quad $p\in S$, \quad $q:=f_p$.\\
\phx\qquad\qquad Then: \quad $(g\circ f)'_p\quad=^*\quad g'_q\,\,\,*_{STU}\,\,\,f'_p$.
\end{thm}

\begin{thm}
Let $T\in\TNSR$, $v\in T$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: \quad $\ds{v\quad=\quad\sum_{j\in\scri_T}\,\,v_j\varepsilon_j^T}$.
\end{thm}

\begin{proof}
This is HW\#6-1.
\end{proof}

\begin{thm}\wrlab{thm-ji-component-of-tensor-of-L}
Let $S,T,U\in\TNSR$, $A\in T\otimes S$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $L:=\Lin_A^{ST}$, $i\in\scri_S$, $j\in\scri_T$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $A_{j\|i}=(L(\varepsilon_i^S))_j$.
\end{thm}

\begin{proof}
Let $k:=j\|i$. \qquad
Then $k_T=j$ and $k_S=i$.\\
Since $L=\Lin_A^{ST}$, we get: $[L]_{ST}=A$. \quad
Then $A=[L]_{ST}=\sl_L^{ST}$.\\
Then $A_{j\|i}=A_k=(\sl_L^{ST})_k=\pi_{k_T}^T(L(\varepsilon_{k_S}^S))=\pi_j^T(L(\varepsilon_i^S))=(L(\varepsilon_i^S))_j$.
\end{proof}

\begin{thm}\wrlab{thm-tensor-multiplication-formula}
Let $S,T,U\in\TNSR$.\\
\phx\qquad Let \quad $B\in U\otimes T$,\quad $A\in T\otimes S$, \quad $k\in\scri_U$ \quad and \quad $i\in\scri_S$.\\
\phx\qquad\qquad Then: \quad $\ds{(B\,\,*_{STU}\,\,A)_{k\|i}\quad=\quad\sum_{j\in\scri_T}\,\,(\,B_{k\|j}\,)\,\cdot\,(\,A_{j\|i}\,)}$.
\end{thm}

\begin{proof}
Let $L:=\Lin_A^{ST}$ and let $M:=\Lin_B^{TU}$.\\
Then $L\in\scrl_{ST}$ and $M\in\scrl_{TU}$, so $M\circ L\in\scrl_{SU}$.
Let $C\,\,:=\,\,B\,\,*_{STU}\,\,A$.\\
Then, by \dref{defn-composition-mult-of-tensors}, we have $C=[M\circ L]_{SU}$.\\
Let $N:=\Lin_C^{SU}$. \quad
By \tref{thm-ji-component-of-tensor-of-L}, we have: \quad $C_{k\|i}=(N(\varepsilon_i^S))_k$.\\
Also, by \tref{thm-ji-component-of-tensor-of-L}, we have: \qquad $\forall j\in\scri_T$, \quad $\,B_{k\|j}=(M(\varepsilon_j^T))_k$.\\
By HW\#6-2, we have: $\ds{L(\varepsilon_i^S)\,=\,\sum_{j\in\scri_T}\,(\,A_{j\|i}\,)\,\cdot\,(\,\varepsilon_j^T\,)}$.\\
Since $C=[M\circ L]_{SU}$, we get $\Lin_C^{SU}=M\circ L$. \qquad
Then $N=M\circ L$.\\
Then $(B\,\,*_{STU}\,\,A)_{k\|i}\,\,=\,\,C_{k\|i}\,\,=\,\,(N(\varepsilon_i^S))_k\,\,=\,\,((M\circ L)(\varepsilon_i^S))_k$\\
\phx\qquad\qquad $\ds{=\,\,(M(L(\varepsilon_i^S)))_k\,\,=\,\,\left(M\left(\sum_{j\in\scri_T}\,(\,A_{j\|i}\,)\,\cdot\,(\,\varepsilon_j^T\,)\right)\right)_k}$\\
\phx\qquad\qquad $\ds{=\,\,\left(\sum_{j\in\scri_T}\,(\,A_{j\|i}\,)\,\cdot\,[\,M(\varepsilon_j^T)\,]\right)_k\,\,=\,\,\sum_{j\in\scri_T}\,(\,A_{j\|i}\,)\,\cdot\,[\,(\,M(\varepsilon_j^T)\,)_k\,]}$\\
\phx\qquad\qquad $\ds{=\,\,\sum_{j\in\scri_T}\,(\,A_{j\|i}\,)\,\cdot\,(\,B_{k\|j}\,)\,\,=\,\,\sum_{j\in\scri_T}\,\,(\,B_{k\|j}\,)\cdot\,(\,A_{j\|i}\,)}$,\\
as desired.
\end{proof}

\begin{thm}\wrlab{thm-tensor-multiplication-is-mat-mult}
Let $\ell,m,n\in\N$, $B\in\R^{n\times m}$, $A\in\R^{m\times\ell}$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $S:=\R^\ell$, $T:=\R^m$, $U:=\R^n$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $B\,\,*_{STU}\,\,A\,\,\,=\,\,\,BA$.
\end{thm}

\begin{proof}
We have $B\,\,*_{STU}\,\,A\,\,\,,\,\,\,BA\,\,\,\in\,\,\,\R^{[1..n]\times[1..\ell]}$.\\
Want: \qquad $\forall k\in[1..n]$, $\forall i\in[1..\ell]$, \qquad $(\,\,B\,\,*_{STU}\,\,A\,\,)_{ki}\,\,\,=\,\,\,(\,\,BA\,\,)_{ki}$.\\
Given $k\in[1..n]$, $i\in[1..\ell]$. \qquad
Want: $(\,\,B\,\,*_{STU}\,\,A\,\,)_{ki}\,\,\,=\,\,\,(\,\,BA\,\,)_{ki}$.\\
We have $T=\R^m=\R^{(m)}$, so $\scri_T=[(m)]=[1..m]$.\\
By \tref{thm-tensor-multiplication-formula},
$\ds{(\,\,B\,\,*_{STU}\,\,A\,\,)_{ki}\,\,\,=\,\,\,\sum_{j\in\scri_T}\,B_{k\|j}\cdot A_{j\|i}}$.\\
Then $\ds{(\,\,B\,\,*_{STU}\,\,A\,\,)_{ki}\,\,\,=\,\,\,\sum_{j\in\scri_T}\,B_{k\|j}\cdot A_{j\|i}}$\\
\phx\qquad\qquad\quad\qquad\qquad $\ds{\,\,=\,\,\,\sum_{j\in[1..m]}\,B_{kj}\cdot A_{ji}\,\,\,=\,\,\,(\,\,BA\,\,)_{ki}}$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-Euclidean-space-chain-rule}
Let $\ell,m,n\in\N$, $f:\R^\ell\to\R^m$ and $g:\R^m\to\R^n$.\\
Let $p\in\R^\ell$ and $q:=f_p$. \qquad
Then $(g\circ f)'_p\,\,=^*\,\,(g'_q)\,\cdot\,(f'_p)$.
\end{thm}

\begin{proof}
Let \quad $S:=\R^\ell$, \quad $T:=\R^m$ \quad and \quad $U:=\R^n$.\\
Want: $(\,\,(g'_q)\,\cdot\,(f'_p)\,\,\ne\,\,\frownie\,\,)\,\,\Rightarrow\,\,(\,\,(g\circ f)'_p\,\,=\,\,(g'_q)\,\cdot\,(f'_p)\,\,)$.\\
Assume: $(g'_q)\,\cdot\,(f'_p)\,\,\ne\,\,\frownie$ \qquad
Want: $(g\circ f)'_p\,\,=\,\,(g'_q)\,\cdot\,(f'_p)$.\\
Since $(g'_q)\,\cdot\,(f'_p)\,\,\ne\,\,\frownie$, we get $g'_q\in\R^{n\times m}$ and $f'_p\in\R^{m\times\ell}$,\\
Then, by \tref{thm-tensor-multiplication-is-mat-mult}, $(g'_q)\,\,*_{STU}\,\,(f'_p)\,\,\,=\,\,\,(g'_q)\,\cdot\,(f'_p)$.\\
By \tref{thm-multi-variable-tensorial-chain-rule},
we have $(g\circ f)'_p\quad=^*\quad g'_q\,\,\,*_{STU}\,\,\,f'_p$.\\
So, since $(g'_q)\,\,*_{STU}\,\,(f'_p)\,\,\,=\,\,\,(g'_q)\,\cdot\,(f'_p)\,\,\,\ne\,\,\,\frownie$,\\
\phx\qquad\qquad\qquad we get: $(g\circ f)'_p\quad=\quad g'_q\,\,\,*_{STU}\,\,\,f'_p$.\\
Then: \qquad $(g\circ f)'_p\quad=\quad g'_q\,\,\,*_{STU}\,\,\,f'_p\quad=\quad(g'_q)\,\cdot\,(f'_p)$.
\end{proof}

\section{Basic results in tensor algebra}

\begin{defn}
Let $S,T\in\TNSR^+$.\\
Then \qquad $\scrc_S^T\,\,:=\,\,\scrc_{ST}$ \qquad and\\
\phx\qquad\qquad $\scrl_S^T\,\,:=\,\,\scrl_{ST}$ \qquad and\\
\phx\qquad\qquad $\scrq_S^T\,\,:=\,\,\scrq_{ST}$ \qquad and\\
\phx\qquad\qquad $\scrk_S^T\,\,:=\,\,\scrk_{ST}$ \qquad and\\
\phx\qquad\qquad $\bfzero_S^T\,\,:=\,\,\bfzero_{ST}$ \qquad and\\
\phx\qquad\qquad $\forall L\in\scrl_{ST},\qquad[L]_{ST}\,\,:=\,\,[L]_{ST}$.
\end{defn}

\begin{defn}
Let $X$, $Y$ and $Z$ be sets.\\
\phx\qquad\qquad\qquad\qquad\qquad Let $f:X\times Y\drta Z$.\\
Then $f(\bullet,\bullet):X\cap Y\drta Z$ is defined by $(f(\bullet,\bullet))(s)=f(s,s)$.
\end{defn}

\begin{defn}
Let $W$, $X$, $Y$ and $Z$ be sets.\\
\phx\qquad\qquad\qquad\qquad\qquad Let $f:W\times X\times Y\drta Z$.\\
Then $\forall a\in W$, $\forall b\in X$, \quad $f(a,b,\bullet):Y\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(f(a,b,\bullet))(s)=f(a,b,s)$.\\
Also, $\forall a\in W$, $\forall c\in Y$, \quad $f(a,\bullet,c):X\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(f(a,\bullet,c))(s)=f(a,s,c)$.\\
Also, $\forall b\in X$, $\forall c\in Y$, \quad $f(\bullet,b,c):W\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $(f(\bullet,b,c))(s)=f(s,b,c)$.\\
Also, $\forall a\in W$, \quad $f(a,\bullet,\bullet):X\cap Y\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad $(f(a,\bullet,\bullet))(s)=f(a,s,s)$.\\
Also, $\forall a\in W$, \quad $f(a,\bullet,\bullet\bullet):X\times Y\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad $(f(a,\bullet,\bullet\bullet))(s,t)=f(a,s,t)$.\\
Also, $\forall b\in X$, \quad $f(\bullet,b,\bullet):W\cap Y\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad $(f(\bullet,b,\bullet))(s)=f(s,b,s)$.\\
Also, $\forall b\in X$, \quad $f(\bullet,b,\bullet\bullet):W\times Y\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad $(f(\bullet,b,\bullet\bullet))(s,t)=f(s,b,t)$.\\
Also, $\forall c\in Y$, \quad $f(\bullet,\bullet,c):W\cap X\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad $(f(\bullet,\bullet,c))(s)=f(s,s,c)$.\\
Also, $\forall c\in Y$, \quad $f(\bullet,\bullet\bullet,c):W\times X\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad $(f(\bullet,\bullet\bullet,c))(s,t)=f(s,t,c)$.\\
Also, \qquad\qquad $\,\,f(\bullet,\bullet,\bullet):W\cap X\cap Y\drta Z$ \quad is defined by\\
\phx\qquad\qquad\qquad\qquad\qquad $(f(\bullet,\bullet,\bullet))(s)=f(s,s,s)$.\\
\end{defn}

Recall, from \dref{defn-scrb-for-bilinear}, that $\scrb_{TU}^V$ denotes the set of bilinear maps $T\times U\to V$.
We next introduce a notation for the set of symmetric bilinear maps $U\times U\to V$, as follows:

\begin{defn}
Let $U,V\in\TNSR^+$.\\
\phx\qquad Then $\scrs\scrb_U^V\,\,:=\,\,\{F\in\scrb_{UU}^V\,|\,\forall a,b\in U,\,F(a,b)=F(b,a)\}$.
\end{defn}

We next introduce trilinear and symmetric trilinear notation:

\begin{defn}
Let $V,W,X,Y\in\TNSR^+$.\\
Then $\scrt_{VWX}^Y\,\,:=\,\,\{\,\,F:V\times W\times X\to Y\,\,|$\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall a\in V,\,\forall b\in W,\quad f(a,b,\bullet)\in\scrl_X^Y$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall a\in V,\,\forall c\in X,\quad f(a,\bullet,c)\in\scrl_W^Y$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $\forall b\in W,\,\forall c\in X,\quad f(\bullet,b,c)\in\scrl_V^Y\,\,\}$.
\end{defn}

\begin{defn}
Let $X,Y\in\TNSR^+$.\\
Then $\scrs\scrt_X^Y\,\,:=\,\,\{\,\,F\in\scrt_{XXX}^Y\,\,|\,\,\forall a,b,c\in X,$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,F(a,b,c)=F(a,c,b)=F(b,a,c)$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $=F(b,c,a)=F(c,a,b)=F(c,b,a)\,\,\}$.
\end{defn}

\begin{thm}
Let $V,W\in\TNSR^+$ and let $B\in\scrb_{VV}^W$.\\
Then, $\forall x\in V,\,\,\,\,B(x,\bullet)\,,\,B(\bullet,x)\,\,\in\,\,\scrl_V^W$. \qquad
Also, $B(\bullet,\bullet)\in\scrq_V^W$.
\end{thm}

\begin{thm}
Let $V,W\in\TNSR^+$ and let $T\in\scrt_{VVV}^W$.\\
Then, \qquad $\forall x,y\in V,\qquad T(x,y,\bullet)\,,\,T(x,\bullet,y)\,,\,T(\bullet,x,y)\,\,\in\,\,\scrl_V^W$.\\
Also, \qquad $\forall x\in V,\qquad T(x,\bullet,\bullet)\,,\,T(\bullet,x,\bullet)\,,\,T(\bullet,\bullet,x)\,\,\in\,\,\scrq_V^W$.\\
Also, \qquad $\forall x\in V,\qquad T(x,\bullet,\bullet\bullet)\,,\,T(\bullet,x,\bullet\bullet)\,,\,T(\bullet,\bullet\bullet,x)\,\,\in\,\,\scrb_{VV}^W$.\\
Also, \qquad\qquad\quad\qquad $\,T(\bullet,\bullet,\bullet)\in\scrk_V^W$.
\end{thm}

\begin{thm}\wrlab{thm-linearization-of-homogeneous-cubic}
Let $V,W\in\TNSR^+$, $K\in\scrk_V^W$ and $F\in\scrs\scrt_V^W$.\\
Assume $K=F(\bullet,\bullet,\bullet)$. \qquad
Then, $\forall x\in V$, \quad $D_x^{VW}K=3\cdot(F(x,x,\bullet))$.
\end{thm}

\begin{proof}
Given $x\in V$. \qquad
Want: $D_xK=3\cdot(F(x,x,\bullet))$.\\
We have: $\forall h\in S$,\\
\phx\qquad $K_x^T(h)=(K(x+h))-(K(x))$\\
\phx\qquad\qquad $=(F(x+h,x+h,x+h))-(F(x,x,x))$\\
\phx\qquad\qquad $=(F(x,x,x))+3\cdot(F(x,x,h))+3\cdot(F(x,h,h))+(F(h,h,h))$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $-(F(x,x,x))$\\
\phx\qquad\qquad $=3\cdot(F(x,x,h))+3\cdot(F(x,h,h))+(F(h,h,h))$.\\
Then $K_x^T=3\cdot(F(x,x,\bullet))+3\cdot(F(x,\bullet,\bullet))+\cdot(F(\bullet,\bullet,\bullet))$.\\
Let $L:=3\cdot(F(x,x,\bullet))$ and let $R:=3\cdot(F(x,\bullet,\bullet))+\cdot(F(\bullet,\bullet,\bullet))$.\\
Then $K_x^T=L+R$ and $L\in\scrl_V^W$.\\
We have $F(x,\bullet,\bullet)\in\scrq_V^W\subseteq\scrbigo_2^{VW}\subseteq\scrlito_1^{VW}$.\\
Also, $F(\bullet,\bullet,\bullet)\in\scrk_V^W\subseteq\scrbigo_3^{VW}\subseteq\scrlito_2^{VW}\subseteq\scrlito_1^{VW}$.\\
Then $R=3\cdot(F(x,\bullet,\bullet))+\cdot(F(\bullet,\bullet,\bullet))\in\scrlito_1^{VW}$.\\
Then $K_x^T-L=L+R-L=R+\bfzero_V^W=R\in\scrlito_1^{VW}$.\\
Then $L\in\LINS_pK$, and so $D_p^{VW}K=L$.\\
Then $D_p^{VW}K=L=3\cdot(F(x,x,\bullet))$, as desired.
\end{proof}

\begin{thm}
Let $V,W\in\TNSR$, $L\in\scrl_V^W$, $A:=[L]_V^W$, $x\in V$.\\
\phx\qquad\qquad\qquad Then $\ds{L(x)=\sum_{i\in\scri_V}\,\sum_{j\in\scri_W}\,\,A_{j\|i}\cdot x_i\cdot\varepsilon_j^W}$.
\end{thm}

\begin{proof}
By HW\#6-2, we have: \quad $\forall i\in\scri_V$, \quad $\ds{L(\varepsilon_i^V)\,=\,\sum_{j\in\scri_W}\,A_{j\|i}\,\cdot\,\varepsilon_j^W}$.\\
We compute:\\
\phx\qquad $\ds{L(x)=L\left(\sum_{i\in\scri_V}\,x_i\varepsilon_i^V\right)=\sum_{i\in\scri_V}\,x_i\cdot(L(\varepsilon_i^V))}$\\
\phx\qquad\qquad\qquad $\ds{=\sum_{i\in\scri_V}\,x_i\cdot\left(\sum_{j\in\scri_W}\,A_{j\|i}\cdot\varepsilon_j^W\right)}$\\
\phx\qquad\qquad\qquad $\ds{=\sum_{i\in\scri_V}\,\sum_{j\in\scri_W}\,x_i\cdot A_{j\|i}\cdot\varepsilon_j^W}$\\
\phx\qquad\qquad\qquad $\ds{=\sum_{i\in\scri_V}\,\sum_{j\in\scri_W}\,A_{j\|i}\cdot x_i\cdot\varepsilon_j^W}$, \qquad\qquad as desired.
\end{proof}

The following theorem is the \bfindex[Cauchy-Schwarz inequality]:

\begin{thm}
Let $I$ be a finite set and let $x,y\in\R^I$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\ds{\sum_{j\in I}\,x_jy_j\,\,\le\,\,\sqrt{\sum_{j\in I}\,x_j^2}\,\cdot\,\sqrt{\sum_{j\in I}\,y_j^2}}$.
\end{thm}

\begin{proof}
Let \quad $\ds{a:=\sqrt{\sum_{j\in I}\,x_j^2}}$ \quad and let \quad $\ds{b:=\sqrt{\sum_{j\in I}\,y_j^2}}$.\\
Then \quad $\ds{a^2=\sum_{j\in I}\,x_j^2}$ \quad and \quad $\ds{b^2=\sum_{j\in I}\,y_j^2}$. \qquad
Want: $\ds{\sum_{j\in I}\,x_jy_j\,\,\le\,\,ab}$.\\
At least one of the following must be true:\\
\phx\quad (1) $a=0$ \quad\quad or \quad\quad (2) $b=0$ \quad\quad or \quad\quad (3) $a\ne0\ne b$.\\
\\
{\it Case (1):}\\
We have: $\ds{\sum_{j\in I}\,x_j^2=a^2=0^2=0}$. \qquad
Then: $\forall j\in I$, $x_j=0$.\\
Then $\ds{\sum_{j\in I}\,x_jy_j\,\,=\,\,\sum_{j\in I}\,0\cdot y_j\,\,=\,\,0\,\,\le\,\,0\,\,=\,\,0\,\cdot\,b\,\,=ab}$, as desired.\\
{\it End of Case (1).}\\
\\
{\it Case (2):}\\
We have $\ds{\sum_{j\in I}\,y_j^2=b^2=0^2=0}$. \qquad
Then: $\forall j\in I$, $y_j=0$.\\
Then $\ds{\sum_{j\in I}\,x_jy_j\,\,=\,\,\sum_{j\in I}\,x_j\cdot0\,\,=\,\,0\,\,\le\,\,0\,\,=\,\,a\,\cdot\,0\,\,=ab}$, as desired.\\
{\it End of Case (2).}\\
\\
{\it Case (3):}\\
Let $\ds{u:=\frac{x}{a}}$ and $\ds{v:=\frac{y}{b}}$.\\
Then, \quad $\forall j\in I$, \quad $\ds{u_j=\frac{x_j}{a}}$ \quad and \quad $\ds{v_j=\frac{y_j}{b}}$.\\
Then, \quad $\forall j\in I$, \quad $au_j=x_j$ \quad and \quad $bv_j=y_j$.\\
We have: \quad $\forall t\in\R$, $0\le t^2$.\\
Then \quad $\forall j\in I$, $0\le(u_j-v_j)^2$, \quad and so \quad $\ds{0\le\sum_{j\in I}\,(u_j-v_j)^2}$.\\
Then $\ds{0\,\,\le\,\,\sum_{j\in I}\,(u_j-v_j)^2\,\,=\,\,\sum_{j\in I}\,(u_j^2-2u_jv_j+v_j^2)}$\\
\phx\qquad\qquad $\ds{=\,\,\left(\sum_{j\in I}\,u_j^2\right)\,-\,2\cdot\left(\sum_{j\in I}\,u_jv_j\right)\,+\,\left(\sum_{j\in I}\,v_j^2\right)}$.\\
Then $\ds{2\cdot\left(\sum_{j\in I}\,u_jv_j\right)\,\,\le\,\,\left(\sum_{j\in I}\,u_j^2\right)\,+\,\left(\sum_{j\in I}\,v_j^2\right)}$\\
\phx\qquad\qquad\qquad\qquad\quad $\ds{=\,\,\left(\sum_{j\in I}\,\left(\frac{x_j}{a}\right)^2\right)\,+\,\left(\sum_{j\in I}\,\left(\frac{y_j}{b}\right)^2\right)}$\\
\phx\qquad\qquad\qquad\qquad\quad $\ds{=\,\,\left(\sum_{j\in I}\,\frac{x_i^2}{a^2}\right)\,+\,\left(\sum_{j\in I}\,\frac{y_j^2}{b^2}\right)}$\\
\phx\qquad\qquad\qquad\qquad\quad $\ds{=\,\,\left(\frac{1}{a^2}\right)\cdot\left(\sum_{j\in I}\,x_i^2\right)\,+\,\left(\frac{1}{b^2}\right)\cdot\left(\sum_{j\in I}\,y_j^2\right)}$\\
\phx\qquad\qquad\qquad\qquad\quad $\ds{=\,\,\left(\frac{1}{a^2}\right)\cdot a^2\,+\,\left(\frac{1}{b^2}\right)\cdot b^2\,\,=\,\,1\,+\,1\,\,=\,\,2}$.\\
Mulitplying this by $\ds{\frac{ab}{2}}$, we get: \quad $\ds{ab\cdot\sum_{j\in I}\,u_jv_j\,\,\le\,\,ab}$.\\
Then $\ds{\sum_{j\in I}\,x_jy_j\,\,=\,\,\sum_{j\in I}\,(au_j)\cdot(bv_j)\,\,=\,\,ab\cdot\sum_{j\in I}\,u_jv_j\,\,\le\,\,ab}$, as desired.\\
{\it End of Case (3).}
\end{proof}

\begin{thm}
Let $U,V,W,X\in\TNSR$ and let $T\in\scrt_{UVW}^X$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\exists C\ge0$ s.t., $\forall p\in U$, $\forall q\in V$, $\forall r\in W$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\quad $|T(p,q,r)|_X\,\,\le\,\,C\cdot|p|_U\cdot|q|_V\cdot|r|_W$.
\end{thm}

\begin{proof}
Unassigned HW, modeled on HW\#7-4.
\end{proof}

\begin{thm}
Let $U,V\in\TNSR$ and let $L\in\scrl_U^V$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\exists C\ge0$ s.t., $\forall p\in U$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad $|L(p)|_V\,\,\le\,\,C\cdot|p|_U$.
\end{thm}

\begin{proof}
Unassigned HW, modeled on HW\#7-4.
\end{proof}

\begin{defn}\wrlab{defn-tensor-of-a-bilin}
Let $V,W,X\in\TNSR$ and let $B\in\scrb_{VW}^X$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $[B]_{VW}^X\in X\otimes V\otimes W$ is defined by:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\forall i\in\scri_V$, $\forall j\in\scri_W$, $\forall k\in\scri_X$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $([B]_{VW}^X)_{k\|i\|j}=\pi_k^X(\,B(\varepsilon_i^V,\varepsilon_j^W)\,)$.
\end{defn}

Unassigned HW: Extend 
\dref{defn-tensor-of-a-bilin} to $V,W,X\in\TNSR^+$.

For example: Let $V,X\in\TNSR$, $W:=\R$ and let $B\in\scrb_{VW}^X$.
Then $[B]_{VW}^X\in X\otimes V$ is defined by:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\forall i\in\scri_V$, $\forall k\in\scri_X$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad $([B]_{VW}^X)_{k\|j}=\pi_k^X(\,B(\varepsilon_i^V,1)\,)$.\\
Note that $[B]_{VW}^X\in X\otimes V=X\otimes V\otimes\R=X\otimes V\otimes W$.

\begin{defn}\wrlab{defn-tensor-of-a-trilin}
Let $U,V,W,X\in\TNSR$ and let $T\in\scrt_{UVW}^X$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $[T]_{UVW}^X\in X\otimes U\otimes V\otimes W$ is defined by:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\forall i\in\scri_U$, $\forall j\in\scri_V$, $\forall k\in\scri_W$, $\forall\ell\in\scri_X$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\quad $([T]_{UVW}^X)_{\ell\|i\|j\|k}=\pi_\ell^X(\,T(\varepsilon_i^U,\varepsilon_j^V,\varepsilon_k^W)\,)$.
\end{defn}

Unassigned HW: Extend 
\dref{defn-tensor-of-a-trilin} to $U,V,W,X\in\TNSR^+$.

For example: Let $U,V,W\in\TNSR$, $X:=\R$ and let $T\in\scrt_{UVW}^X$.
Then $[T]_{UVW}^X\in U\otimes V\otimes W$ is defined by:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\forall i\in\scri_U$, $\forall j\in\scri_V$, $\forall k\in\scri_W$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\quad $([T]_{UVW}^X)_{i\|j\|k}=T(\varepsilon_i^U,\varepsilon_j^V,\varepsilon_k^W)$.\\
Note that $[T]_{UVW}^X\in U\otimes V\otimes W=\R\otimes U\otimes V\otimes W=X\otimes U\otimes V\otimes W$.

\vskip.1in\noindent
NOTE TO SELF:\\
Next year, define $\scri_\R:=\{\emptyset\}$.\\
Keep in mind that $\R\ne\R^{\scri_\R}$,\\
\phx\qquad so we only have: $\forall V\in\TNSR$, $V=\R^{\scri_V}$;\\
\phx\qquad this does not extend to $\TNSR^+$.\\
Also, $\forall x\in\R$, define $x_\emptyset:=x$.\\
Also, define $\varepsilon_\emptyset^\R:=1$.\\
Also, define $\pi_\emptyset^\R=\id_\R$.\\
Also, $\forall V\in\TNSR^+$, $\forall f:\R\drta V$, define $\partial_\emptyset^{\R V}f=f'$.
Also, $\forall\sigma\in\N$, $\forall k\in\N^\sigma$, define $k\|\emptyset:=k$ and $\emptyset\|k:=k$.\\
Also, define $\emptyset\|\emptyset:=\emptyset$.\\

\section{Derivatives of homogeneous cubics}

NOTE: The second midterm in Spring 2019 will cover everything up to and including (2) of the next result, \tref{thm-diff-homog-cubic}.

\begin{thm}\wrlab{thm-diff-homog-cubic}
Let $V,W\in\TNSR$, $K\in\scrk_V^W$, $F\in\scrs\scrt_V^W$.\\
Assume: $\forall x\in V$, $K(x)=F(x,x,x)$.\\
Define $Q\in\scrq_V^{W\otimes V}$, $L\in\scrl_V^{W\otimes V\otimes V}$, $C\in\scrc_V^{W\otimes V\otimes V\otimes V}$ by:\\
\phx\qquad $Q_x=[F(x,x,\bullet)]_V^W$, \quad $L_x=[F(x,\bullet,\bullet\bullet)]_{VV}^W$, \quad $C_x=[F]_{VVV}^W$.\\
Then: \qquad (1) $K'=3Q$, \qquad (2) $K''=6L$, \qquad (3) $K'''=6C$.
\end{thm}

\begin{proof}
{\it Proof of (1):}\\
Want: $\forall x\in V$, $K'_x=3\cdot Q_x$.\\
Given $x\in V$. \qquad
Want: $K'_x=3\cdot Q_x$.\\
By \tref{thm-linearization-of-homogeneous-cubic}, we have: \quad $D_xK=3\cdot(F(x,x,\bullet))$.\\
Then $K'_x=[D_xK]_V^W=3\cdot[F(x,x,\bullet)]_V^W=3\cdot Q_x$, as desired.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}\\
Want: $\forall x\in V$, $K''_x=6\cdot L_x$.\\
Given $x\in V$. \qquad
Want: $K''_x=6\cdot L_x$.\\
By (1) of \tref{thm-diff-homog-cubic}, we have: \quad $K'=3\cdot Q$.\\
Then, by \tref{thm-deriv-commutes-with-scalar-mult-multivariable}, we get: \quad $K''_x\,\,=^*\,\,3\cdot Q'_x$.\\
Want: $3\cdot Q'_x=6\cdot L_x$.\\
Define $B\in\scrs\scrb_V^{W\otimes V}$ by $B(x,y)=[F(x,y,\bullet)]_V^W$.\\
Then $Q=B(\bullet,\bullet)$, so, by HW\#6-5, we have: $D_x^{VW}Q=2\cdot(B(x,\bullet))$.\\
Since $D_x^{VW}Q=2\cdot(B(x,\bullet))\in\scrl_V^W$,\\
\phx\qquad we get: $Q'_x=2\cdot[B(x,\bullet)]_V^W\in W\otimes V\otimes V$.\\
Also, by definition of $L$, we have: $L_x=[F(x,\bullet,\bullet\bullet)]_{VV}^W$.\\
Then $L_x=[F(x,\bullet,\bullet\bullet)]_{VV}^W\in W\otimes V\otimes V$.\\
Want: $3\cdot2\cdot[B(x,\bullet)]_V^W=6\cdot[F(x,\bullet,\bullet\bullet)]_{VV}^W$.\\
Want: $[B(x,\bullet)]_V^W=[F(x,\bullet,\bullet\bullet)]_{VV}^W$.\\
Want: $\forall k\in\scri_W$, $\forall i,j\in\scri_V$, $(\,[B(x,\bullet)]_V^W\,)_{k\|i\|j}\,=\,(\,[F(x,\bullet,\bullet\bullet)]_{VV}^W\,)_{k\|i\|j}$.\\
Given $k\in\scri_W$, $i,j\in\scri_V$.\\
Want: $(\,\,[B(x,\bullet)]_V^W\,\,)_{k\|i\|j}\,\,=\,\,(\,\,[F(x,\bullet,\bullet\bullet)]_{VV}^W\,\,)_{k\|i\|j}$.\\
We have $(\,\,[F(x,\bullet,\bullet\bullet)]_{VV}^W\,\,)_{k\|i\|j}=\pi_k^W(F(x,\varepsilon_i^V,\varepsilon_j^V))$.\\
Also, $(\,\,[B(x,\bullet)]_V^W\,\,)_{k\|i\|j}\,\,=\,\,\pi_{k\|i}^{W\otimes V}(B(x,\varepsilon_j^V))$.\\
Also, $(\,\,[F(x,\varepsilon_j,\bullet)]_V^W\,\,)_{k\|i}=\pi_k^W(F(x,\varepsilon_j^V,\varepsilon_i^V))$.\\
By definition of $B$, we have: $B(x,\varepsilon_j^V)=[F(x,\varepsilon_j,\bullet)]_V^W$.\\
By symmetry of $F$, we have: $F(x,\varepsilon_j^V,\varepsilon_i^V)=F(x,\varepsilon_i^V,\varepsilon_j^V)$.\\
Then $(\,\,[B(x,\bullet)]_V^W\,\,)_{k\|i\|j}\,\,=\,\,\pi_{k\|i}^{W\otimes V}(B(x,\varepsilon_j^V))\,\,=\,\,(B(x,\varepsilon_j^V))_{k\|i}$\\
\phx\qquad\qquad $=\,\,(\,\,[F(x,\varepsilon_j,\bullet)]_V^W\,\,)_{k\|i}\,\,=\,\,\pi_k^W(F(x,\varepsilon_j^V,\varepsilon_i^V))$\\
\phx\qquad\qquad $=\,\,\pi_k^W(F(x,\varepsilon_i^V,\varepsilon_j^V))\,\,=\,\,(\,\,[F(x,\bullet,\bullet\bullet)]_{VV}^W\,\,)_{k\|i\|j}$, \quad as desired.\\
{\it End of proof of (2).}\\
\\
{\it Proof of (3):}\\
Want: $\forall x\in V$, $K'''_x=6\cdot C_x$.\\
Given $x\in V$. \qquad
Want: $K'''_x=6\cdot C_x$.\\
By (1) of \tref{thm-diff-homog-cubic}, we have: \quad $K''=6\cdot L$.\\
Then, by \tref{thm-deriv-commutes-with-scalar-mult-multivariable}, we get: \quad $K'''_x\,\,=^*\,\,6\cdot L'_x$.\\
Want: $6\cdot L'_x=6\cdot C_x$. \qquad
Want: $L'_x=C_x$.\\
By HW\#6-4, we have $D_xL=L$.\\
Since $D_xL=L\in\scrl_V^{W\otimes V\otimes V}$,\\
\phx\qquad we get: $L'_x=[L]_V^{W\otimes V\otimes V}\in W\otimes V\otimes V\otimes V$.\\
Also, by definition of $C$, we have: $C_x=[F]_{VVV}^W$.\\
Then $C_x=[F]_{VVV}^W\in W\otimes V\otimes V\otimes V$.\\
Want: $[L]_V^{W\otimes V\otimes V}=[F]_{VVV}^W$.\\
Want: $\forall i,j,k\in\scri_V$, $\forall\ell\in\scri_W$,\quad
$(\,\,[L]_V^{W\otimes V\otimes V}\,\,)_{\ell\|i\|j\|k}\,\,=\,\,(\,\,[F]_{VVV}^W\,\,)_{\ell\|i\|j\|k}$.\\
Given $i,j,k\in\scri_V$, $\ell\in\scri_W$.\\
Want: $(\,\,[L]_V^{W\otimes V\otimes V}\,\,)_{\ell\|i\|j\|k}\,\,=\,\,(\,\,[F]_{VVV}^W\,\,)_{\ell\|i\|j\|k}$.\\
We have: $(\,\,[F]_{VVV}^W\,\,)_{\ell\|i\|j\|k}\,\,=\,\,\pi_\ell^W(\,F(\varepsilon_i^V,\varepsilon_j^V,\varepsilon_k^V)\,)$.\\
Also, $(\,\,[L]_V^{W\otimes V\otimes V}\,\,)_{\ell\|i\|j\|k}\,\,=\,\,\pi_{\ell\|i\|j}^{W}(\,L(\varepsilon_k^V)\,)$.\\
Also, $(\,[\,F(\varepsilon_k^V,\bullet,\bullet\bullet)\,]_{VV}^W\,)_{\ell\|i\|j}\,\,=\,\,\pi_\ell^W(\,F(\varepsilon_k^V,\varepsilon_i^V,\varepsilon_j^V)\,)$.\\
By definition of $L$, we have $L(\varepsilon_k^V)\,\,=\,\,[\,F(\varepsilon_k^V,\bullet,\bullet\bullet)\,]_{VV}^W$.\\
By symmetry of $F$, we have $F(\varepsilon_k^V,\varepsilon_i^V,\varepsilon_j^V)=F(\varepsilon_i^V,\varepsilon_j^V,\varepsilon_k^V)$.\\
Then $(\,\,[L]_V^{W\otimes V\otimes V}\,\,)_{\ell\|i\|j\|k}\,\,=\,\,\pi_{\ell\|i\|j}^{W}(\,L(\varepsilon_k^V)\,)\,\,=\,\,(\,L(\varepsilon_k^V)\,)_{\ell\|i\|j}$\\
\phx\qquad\qquad $=\,\,(\,[\,F(\varepsilon_k^V,\bullet,\bullet\bullet)\,]_{VV}^W\,)_{\ell\|i\|j}\,\,=\,\,\pi_\ell^W(\,F(\varepsilon_k^V,\varepsilon_i^V,\varepsilon_j^V)\,)$\\
\phx\qquad\qquad $=\,\,\pi_\ell^W(\,F(\varepsilon_i^V,\varepsilon_j^V,\varepsilon_k^V)\,)\,\,=\,\,(\,\,[F]_{VVV}^W\,\,)_{\ell\|i\|j\|k}$, \quad as desired.\\
{\it End of proof of (3).}
\end{proof}

\begin{thm}\wrlab{thm-linear-for-a-tensor}
Let $S\in\TNSR^+$, $v\in S$, $t\in\R$, $M:=\Lin_v^{\R S}$.\\
\phx\qquad\qquad\qquad\qquad Then $M_t=tv$.
\end{thm}

\begin{proof}
Since $\Lin_\bullet^{\R S}$ and $[\bullet]_{\R S}$ are inverses, we get: $[\Lin_v^{\R S}]_{\R S}=v$.\\
By \dref{defn-sl-when-dom-is-R}, we have $\sl_M^{\R S}=M(1)$.\\
Then $M(1)=\sl_M^{\R S}=[M]_{\R S}=[\Lin_v^{\R S}]_{\R S}=v$.\\
Then $M_t=M(t)=M(t\cdot1)=t\cdot(M(1))=tv$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-linear-at-1-for-a-real}
Let $v\in\R$ and $L:=\Lin_x^{\R\R}$.\\
\phx\qquad\qquad\qquad\qquad Then $L_1=v$.
\end{thm}

\begin{proof}
Replace $S$ by $\R$ and $t$ by $1$ in \tref{thm-linear-for-a-tensor}.
\end{proof}

\begin{thm}\wrlab{thm-tensor-mult-for-scalars-is-scalar-mult}
Let $S\in\TNSR^+$, $v\in S$, $t\in\R$.\\
\phx\qquad\qquad\qquad\qquad Then $v\,\,*_{\R\R S}\,\,t\,\,=\,\,tv$.
\end{thm}

\begin{proof}
Let $L:=\Lin_t^{\R\R}$ and $M:=\Lin_v^{\R S}$.\\
By \tref{thm-linear-at-1-for-a-real} (with $v$ replaced by $t$), we have $L_1=t$.\\
By \tref{thm-linear-for-a-tensor}, we have $M_t=tv$.\\
By \dref{defn-composition-mult-of-tensors}, we have $v\,\,*_{\R\R S}\,\,t\,\,=\,\,[M\circ L]_{\R S}$.\\
By \dref{defn-sl-when-dom-is-R}, we have $\sl_{L\circ M}^{\R S}=(L\circ M)(1)$.\\
Then $v\,\,*_{\R\R S}\,\,t\,\,=\,\,[M\circ L]_{\R S}\,\,=\,\,\sl_{M\circ L}^{\R S}\,\,=\,\,(M\circ L)(1)$\\
\phx\qquad\qquad\quad\quad $\,\,\,\,=\,\,M(L_1)\,\,=\,\,M(t)\,\,=\,\,M_t\,\,=\,\,tv$, \quad as desired.
\end{proof}

\begin{thm}
Let $x,y\in\R$.\\
\phx\qquad\qquad\qquad\qquad Then $x\,\,*_{\R\R\R}\,\,y\,\,=\,\,xy$.
\end{thm}

\begin{proof}
Replacing $S$ by $\R$ and $v$ by $x$ and $t$ by $y$, we get: $x\,\,*_{\R\R\R}\,\,y\,\,=\,\,yx$.\\
Then $x\,\,*_{\R\R\R}\,\,y\,\,=\,\,yx\,\,=\,\,xy$, as desired.\\
\end{proof}

Recall: Let $L\in\scrl$, $m:=\sl_L$, $x\in\R$.
Then $L_x=mx$.\\
Then next result is the tensor analogue for that statement:

\begin{thm}\wrlab{thm-linear-at-x-is-tensor-times-x}
Let $S,T\in\TNSR^+$, $L\in\scrl_S^T$, $A:=\sl_L^{ST}$, $x\in S$.\\
\phx\qquad\qquad\qquad\qquad Then $L(x)\,\,=\,\,A\,\,*_{\R ST}\,\,x$.
\end{thm}

\begin{proof}
Let $F:=\Lin_x^{\R S}$ and $G:=\Lin_A^{ST}$.\\
By \dref{defn-composition-mult-of-tensors}, we have $A\,\,*_{\R ST}\,\,x\,\,=\,\,[G\circ F]_{\R T}$.\\
By \dref{defn-sl-when-dom-is-R}, we have $\sl_{G\circ F}^{\R T}=(G\circ F)(1)$.\\
Then $A\,\,*_{\R ST}\,\,x\,\,=\,\,[G\circ F]_{\R T}\,\,=\,\,\sl_{G\circ F}^{\R T}\,\,=\,\,(G\circ F)(1)\,\,=\,\,G(F_1)$.\\
By \tref{thm-linear-for-a-tensor}, $\forall t\in\R$, $F_t=tx$. \qquad
Then $F_1=1\cdot x=x$.\\
We have $A=\sl_L^{ST}=[L]_{ST}$.\\
So, since $\Lin_\bullet^{ST}$ and $[\bullet]_{ST}$ are inverses, we get: $\Lin_A^{ST}=L$.\\
Then $G=\Lin_A^{ST}=L$.\\
Then $L(x)\,\,=\,\,G(x)\,\,=\,\,G(F_1)\,\,=\,\,A\,\,*_{\R ST}\,\,x$, \quad as desired.
\end{proof}

\section{Tensor products of tensors}

\begin{defn}
Let $V,W\in\TNSR^+$, $x\in V$, $y\in W$.\\
Then $y\otimes x\,\,:=\,\,y\,\,*_{V\R W}\,\,x$.
\end{defn}

\begin{thm}\wrlab{comps-of-tnsrprod-of-vects}.
Let $V,W\in\TNSR^+$, $x\in V$, $y\in W$.\\
Let $i\in\scri_V$, $j\in\scri_W$. \qquad
Then $\pi_{j\|i}^{W\otimes V}(y\otimes x)=y_jx_i$.
\end{thm}

\begin{proof}
Let $L:=\Lin_x^{V\R}$ and let $M:=\Lin_y^{\R W}$.\\
Then $y\otimes x=[M\circ L]_{VW}$. \qquad
Also $[L]_{V\R}=x$.\\
Then $\pi_{j\|i}^{W\otimes V}(y\otimes x)=\pi_{j\|i}^{W\otimes V}([M\circ L]_{VW})=\pi_j^W((M\circ L)(\varepsilon_i^V))$.\\
By \dref{defn-slope-when-target-R}, $(\sl_L^{V\R})_i\quad=\quad L\,(\,\varepsilon_i^V\,)$.\\
Then $x_i=([L]_{V\R})_i=(\sl_L^{V\R})_i=L\,(\,\varepsilon_i^V\,)$.\\
Then $(M\circ L)(\varepsilon_i^V)=M(L(\varepsilon_i^V))=M(x_i)$.\\
By \tref{thm-linear-for-a-tensor}, we have: \quad $\forall t\in\R$, $M_t=ty$.\\
Then $M(x_i)=M_{x_i}=x_iy$, so $\pi_j^W(M(x_i))=x_i\cdot(\pi_j^W(y))=x_iy_j$.\\
Then $\pi_{j\|i}^{W\otimes V}(y\otimes x)=\pi_j^W((M\circ L)(\varepsilon_i^V))=\pi_j^W(M(x_i))=x_iy_j=y_jx_i$.
\end{proof}

\begin{thm}
Let $V:=\R^3$, $W:=\R^2$.\\
Let $x:=(2,3,4)$, $y:=(10,20)$. \qquad
Then $y\otimes x=\left[\begin{array}{ccc}20&30&40\\40&60&80\end{array}\right]$.
\end{thm}

\begin{proof}
This follows from \tref{comps-of-tnsrprod-of-vects}.
\end{proof}

\section{Polarizing polynomials and linearizing multilinears}

In the next result, students provided the coefficients on $Q$,
and, after hearing them, I found the coefficients on $F$.

\begin{thm}
Let $V:=\R^2$ and $X:=\R$.\\
Define $Q\in\scrq_V^X$ by $Q(t,u)=8t2+3tu+4u^2$.\\
Define $F\in\scrb_{VV}^X$ by $F((r,s),(t,u))=8rt+(3/2)ru+(3/2)st+4su$.\\
Then $F(\bullet,\bullet)=Q$.
\end{thm}

\begin{proof}
Want: $\forall t,u\in\R$, $F((t,u),(t,u))=Q(t,u)$.\\
Given $t,u\in\R$. \qquad
Want: $F((t,u),(t,u))=Q(t,u)$.\\
We have $F((t,u),(t,u))=8tt+(3/2)tu+(3/2)ut+4uu$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,=8t^2+3tu+4u^2=Q(x,y)$, as desired.
\end{proof}

The technique of going from $Q$ to $F$ generalizes, yielding:

\begin{thm}\wrlab{thm-polarizations-exist}
Let $V,W\in\TNSR^+$, $Q\in\scrq_V^W$.\\
\phx\qquad\qquad\qquad\qquad Then $\exists1 F\in\scrs\scrb_V^W$ s.t.~$F(\bullet,\bullet)=Q$.
\end{thm}

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

\begin{thm}
Let $V,X\in\TNSR^+$.\\
Define $\Delta:\scrb_{VV}^X\to\scrq_V^X$ by $\Delta(B)=B(\bullet,\bullet)$. \quad
Let $\Phi:=\Delta|(\scrs\scrb_V^X)$.\\
Then $\Delta:\scrb_{VV}^X\to>\scrq_V^X$ and $\Phi:\scrs\scrb_V^X\hookrightarrow>\scrq_V^X$.
\end{thm}

\begin{proof}
The existence part of \tref{thm-polarizations-exist} shows:  $\Phi:\scrs\scrb_V^X\to>\scrq_V^X$.\\
It follows that: $\Delta:\scrb_{VV}^X\to>\scrq_V^X$. \qquad
Want: $\Phi:\scrs\scrb_V^X\hookrightarrow>\scrq_V^X$.\\
The uniqueness part of \tref{thm-polarizations-exist} shows: $\Phi:\scrs\scrb_V^X\hookrightarrow\scrq_V^X$.\\
Then $\Phi:\scrs\scrb_V^X\hookrightarrow>\scrq_V^X$, as desired.
\end{proof}

\begin{thm}
Let $V,W,X\in\TNSR^+$.\\
Define $\Psi:\scrb_{VW}^X\to X\otimes V\otimes W$ by $\Psi(B)=[B]_{VW}^X$.\\
Then $\Psi:\scrb_{VW}^X\hookrightarrow>X\otimes V\otimes W$.
\end{thm}

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

\begin{defn}
Let $V,W,X\in\TNSR^+$, $A\in X\otimes V\otimes W$.\\
Define $\Psi:\scrb_{VW}^X\hookrightarrow>X\otimes V\otimes W$ by $\Psi(B)=[B]_{VW}^X$.\\
Then $\Bilin_A^{VWX}:=\Psi^{-1}(A)$.
\end{defn}

\begin{thm}
Let $U,V,W,X\in\TNSR^+$.\\
Define $\Psi:\scrt_{UVW}^X\to X\otimes U\otimes V\otimes W$ by $\Psi(T)=[T]_{UVW}^X$.\\
Then $\Psi:\scrt_{UVW}^X\hookrightarrow> X\otimes U\otimes V\otimes W$.
\end{thm}

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

\begin{defn}
Let $U,V,W,X\in\TNSR^+$.\\
Define $\Psi:\scrt_{UVW}^X\hookrightarrow> X\otimes U\otimes V\otimes W$ by $\Psi(T)=[T]_{UVW}^X$.\\
Then $\Trilin_A^{UVWX}:=\Psi^{-1}(A)$.
\end{defn}

\noindent
Let $U,V,W\in\TNSR^+$ and let $B\in\scrb_{UV}^W$.\\
Then $[B]_{UV}^W\in W\otimes U\otimes V$.\\
So, since $\scrl_{U\otimes V}^W\hookrightarrow>W\otimes U\otimes V$,\\
\phx\qquad we can choose $L\in\scrl_{U\otimes V}^W$ s.t.~$[L]_{U\otimes V}^W=[B]_{UV}^W$.\\
We ``tensorize'' $B$ to get $[B]_{UV}^W$,\\
\phx\qquad and then ``linearize'' $[B]_{UV}^W$ to get $L$.

\vskip.1in\noindent
In this way,\\
\phx\qquad any bilinear map can be converted into a linear map,\\
\phx\qquad and so ``bilinear algebra'' is simply a part of linear algebra.

\vskip.1in\noindent
Let $U,V,W,X\in\TNSR^+$ and let $T\in\scrb_{UVW}^X$.\\
Then $[T]_{UVW}^X\in X\otimes U\otimes V\otimes W$.\\
So, since $\scrl_{U\otimes V\otimes W}^X\hookrightarrow>X\otimes U\otimes V\otimes W$,\\
\phx\qquad we can choose $L\in\scrl_{U\otimes V\otimes W}^X$ s.t.~$[L]_{U\otimes V\otimes W}^X=[T]_{UVW}^X$.\\
We ``tensorize'' $T$ to get $[T]_{UVW}^X$,\\
\phx\qquad and then ``linearize'' $[T]_{UVW}^X$ to get $L$.

\vskip.1in\noindent
In this way,\\
\phx\qquad any trilinear map can be converted into a linear map,\\
\phx\qquad and so ``trilinear algebra'' is simply a part of linear algebra.

\vskip.1in\noindent
Let $V,W\in\TNSR^+$ and let $Q\in\scrq_V^W$.\\
Then, since $\scrs\scrb_V^W\hookrightarrow>\scrq_V^W$,\\
\phx\qquad we can choose $B\in\scrs\scrb_V^W$ s.t.~$Q=B(\bullet,\bullet)$.\\
Then $[B]_{VV}^W\in W\otimes V\otimes V$.\\
So, since $\scrl_{V\otimes V}^W\hookrightarrow>W\otimes V\otimes V$,\\
\phx\qquad we can choose $L\in\scrl_{V\otimes V}^W$ s.t.~$[L]_{V\otimes V}^W=[B]_{VV}^W$.\\
We ``polarize'' $Q$ to get $B$,\\
\phx\qquad ``tensorize'' $B$ to get $[B]_{VV}^W$,\\
\phx\qquad and then ``linearize'' $[B]_{VV}^W$ to get $L$.

\vskip.1in\noindent
In this way,\\
\phx\qquad any homogeneous quadratic can be converted into a linear map,\\
\phx\qquad and so ``quadratic algebra'' is simply a part of linear algebra.

\vskip.1in\noindent
Let $V,W\in\TNSR^+$ and let $K\in\scrk_V^W$.\\
Then, since $\scrs\scrt_V^W\hookrightarrow>\scrk_V^W$,\\
\phx\qquad we can choose $T\in\scrs\scrt_V^W$ s.t.~$K=T(\bullet,\bullet,\bullet)$.\\
Then $[T]_{VVV}^W\in W\otimes V\otimes V\otimes V$.\\
So, since $\scrl_{V\otimes V\otimes V}^W\hookrightarrow>W\otimes V\otimes V\otimes V$,\\
\phx\qquad we can choose $L\in\scrl_{V\otimes V\otimes V}^W$ s.t.~$[L]_{V\otimes V\otimes V}^W=[T]_{VVV}^W$.\\
We ``polarize'' $K$ to get $T$,\\
\phx\qquad ``tensorize'' $T$ to get $[T]_{VVV}^W$,\\
\phx\qquad and then ``linearize'' $[T]_{VVV}^W$ to get $L$.\\

\vskip.1in\noindent
In this way,\\
\phx\qquad any homogeneous cubic can be converted into a linear map,\\
\phx\qquad and so ``cubic algebra'' is simply a part of linear algebra.

\vskip.1in\noindent
In \tref{thm-cubic-approximation} below, we will see that, with some hypotheses,\\
\phx\qquad any function can be approximated by a polynomial.\\
Any polynomial can be broken up into homogeneous parts,\\
\phx\qquad and each part can then be converted into a linear map.\\
So linear algebra is the study of EVERYTHING!

\section{Computing multilinear from the tensor}

\begin{thm}\wrlab{thm-linA-is-A-star}
Let $V,W\in\TNSR^+$, $A\in U\otimes V$.\\
\phx\qquad\qquad Then, $\forall x\in U$, \qquad $\Lin_A^{VW}(x)\,\,=\,\,A\,\,*_{\R VW}\,\,x$.
\end{thm}

\begin{proof}
This is a restatement of \tref{thm-linear-at-x-is-tensor-times-x}.
\end{proof}

\begin{thm}
Let $U,V,W\in\TNSR^+$, $A\in W\otimes U\otimes V$.\\
Let $S:=U\otimes V$. \qquad
Then, $\forall x\in U$, $\forall y\in V$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\Bilin_A^{UVW}(x,y)\,\,=\,\,A\,\,*_{\R SW}\,\,(x\otimes y)$.
\end{thm}

\begin{proof}
Unassigned HW.
Similar to proof of \tref{thm-linear-at-x-is-tensor-times-x}.
\end{proof}

\begin{thm}
Let $T,U,V,W\in\TNSR^+$, $A\in W\otimes T\otimes U\otimes V$.\\
Let $S:=T\otimes U\otimes V$. \qquad
Then, $\forall x\in T$, $\forall y\in U$, $\forall z\in V$,\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\Trilin_A^{TUVW}(x,y)\,\,=\,\,A\,\,*_{\R SW}\,\,(x\otimes y\otimes z)$.
\end{thm}

\begin{proof}
Unassigned HW.
Similar to proof of \tref{thm-linear-at-x-is-tensor-times-x}.
\end{proof}

\section{The cubic approximation theorem}

\begin{thm}\wrlab{thm-cubic-approximation}
Let $S,Z\in\TNSR^+$, $f:S\drta Z$, $p\in\dom[f''']$.\\
Let $L:=\Lin_{f'_p}^{SZ}$, $Q:=\Bilin_{f''_p}^{SSZ}(\bullet,\bullet)$, $K:=\Trilin_{f'''_p}^{SSSZ}(\bullet,\bullet,\bullet)$.\\
Then: \qquad $\ds{(\,f_p^T\,)\,\,-\,\,\left(\,L\,+\,\frac{Q}{2!}\,+\,\frac{K}{3!}\,\right)\,\,\in\,\,\scrlito_3^{SZ}}$.
\end{thm}

\begin{proof}
This proof is deferred until later.
\end{proof}

\noindent
Let $S,Z\in\TNSR^+$, $f:S\drta Z$, $p\in\dom[f''']$, $h\in S$.\\
Let $T:=S\otimes S$, $U:=S\otimes S\otimes S$.\\
Then $f':S\drta Z\otimes S$ and $f'':S\drta Z\otimes T$ and $f''':S\drta Z\otimes U$.\\
Then $f_p\in Z$, $f'_p\in Z\otimes S$ and $f''_p\in Z\otimes T$ and $f'''_p\in Z\otimes U$.\\
The idea of \tref{thm-cubic-approximation} is:\\
Up to a subcubic error (in $h$), we have:\\
\phx\qquad $\ds{f_{p+h}-f_p\,\,\approx\,\,L_h\,+\,\frac{Q_h}{2!}\,+\,\frac{K_h}{3!}}$,\\
so\\
\phx\qquad $\ds{f_{p+h}\,\,\approx\,\,f_p\,+\Lin_{f'_p}^{SZ}(h)\,+\,\frac{\Bilin_{f''_p}^{SSZ}(h,h)}{2!}\,+\,\frac{\Trilin_{f'''_p}^{SSSZ}(h,h,h)}{3!}}$,\\
so\\
\phx\qquad $\ds{f_{p+h}\qquad\approx\qquad f_p\quad+\quad[\,\,(f'_p)\,\,*_{\R SZ}\,\,h\,\,]}$\\ \\
\phx\qquad\qquad $\ds{+\qquad\frac{(f''_p)\,\,*_{\R TZ}\,\,(h\otimes h)}{2!}\quad+\quad\,\frac{(f'''_p)\,\,*_{\R UZ}\,\,(h\otimes h\otimes h)}{3!}}$.\\

\begin{defn}
Let $S\in\TNSR^+$.\\
Then $S^{\otimes0}:=\R$ and $S^{\otimes1}:=S$ and $S^{\otimes2}:=S\otimes S$ and $S^{\otimes3}:=S\otimes S\otimes S$.\\
Also, $\forall h\in S$, \qquad\qquad $h^{\otimes0}:=1$ and $h^{\otimes1}:=h$ and $h^{\otimes2}:=h\otimes h$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad and $h^{\otimes3}:=h\otimes h\otimes h$.
\end{defn}

\noindent
Let $S,Z\in\TNSR^+$, $f:S\drta Z$, $p\in\dom[f''']$, $x\in S$.\\
Let $T:=S^{\otimes2}$, $U:=S^{\otimes3}$.\\
Then $f':S\drta Z\otimes S$ and $f'':S\drta Z\otimes T$ and $f''':S\drta Z\otimes U$.\\
Then $f_p\in Z$, $f'_p\in Z\otimes S$ and $f''_p\in Z\otimes T$ and $f'''_p\in Z\otimes U$.\\
The idea of \tref{thm-cubic-approximation} is:\\
Up to a subcubic error (in $x-p$), we have:\\ \\
\phx\qquad $\ds{f_x\qquad\approx\qquad f_p\quad+\quad[\,\,(f'_p)\,\,*_{\R SZ}\,\,(x-p)\,\,]}$\\ \\
\phx\qquad\quad $\ds{+\qquad\frac{(f''_p)\,\,*_{\R TZ}\,\,((x-p)^{\otimes2})}{2!}\quad+\quad\,\frac{(f'''_p)\,\,*_{\R UZ}\,\,((x-p)^{\otimes3})}{3!}}$.\\

\section{Directional and partial derivatives}

\begin{thm}\wrlab{thm-lin-fprime-is-Dderiv}
Let $S,T\in\TNSR^+$, \quad $f:S\drta T$, \quad $p\in S$.\\
\phx\qquad\qquad\qquad\qquad Then \quad $\Lin_{f'_p}^{ST}\,\,=\,\,D_p^{ST}f$.
\end{thm}

\begin{proof}
Since $f'_p\,\,=\,\,(\sl_\bullet^{ST})(D_p^{ST}f)$, we get $(\sl_\bullet^{ST})^{-1}(f'_p)\,\,=\,\,D_p^{ST}f$.\\
\phx\qquad\qquad Then \quad $\Lin_{f'_p}^{ST}\,\,=\,\,(\sl_\bullet^{ST})^{-1}(f'_p)\,\,=\,\,D_p^{ST}f$, \quad as desired.
\end{proof}

\begin{thm}
Let $S,T\in\TNSR^+$, \quad $f:S\drta T$, \quad $p\in\dom[f']$.\\
\phx\qquad\qquad\qquad\qquad Then \quad $f_p^T-(D_p^{ST}f)\,\,\in\,\,\scrlito_1^{ST}$.
\end{thm}

\begin{proof}
Since $p\in\dom[f']$, we get $f'_p\ne\frownie$.\\
We have $(\sl_\bullet)(D_p^{ST}f)=f'_p\ne\frownie$, so $D_p^{ST}f\ne\frownie$.\\
Since $\frownie\ne D_p^{ST}f=\UE(\LINS_pf)$, we get $D_p^{ST}f\in\LINS_pf$.\\
Then $f_p^T-(D_p^{ST}f)\,\,\in\,\,\scrlito_1^{ST}$, as desired.
\end{proof}

\begin{thm}
Let $S,T\in\TNSR^+$, \quad $f:S\drta T$.\\
\phx\qquad\qquad Assume $f_{0_S}=0_T$. \qquad
Then $f_{0_S}^T=f$.
\end{thm}

\begin{proof}
Want: $\forall h\in S$, $f_{0_S}^T(h)=f(h)$.\\
Given $h\in S$. \qquad
Want: $f_{0_S}^T(h)=f(h)$.\\
We have $f_{0_S}^T(h)=f_{0_S+h}-f_{0_S}=f_h-0_T=f_h=f(h)$, as desired.
\end{proof}

\begin{thm}
Let $S,T\in\TNSR^+$, \quad $f:S\drta T$, \quad $p,q\in S$.\\
\phx\qquad\qquad Then $D_q^{ST}(f(p+\bullet))\,\,=\,\,D_{p+q}^{ST}f$.
\end{thm}

\begin{proof}
Want: $\LINS_q^{ST}(f(p+\bullet))=\LINS_{p+q}^{ST}f$.\\
Want: \quad $\forall L\in\scrl_S^T$, \quad $[\,\,(\,\,L\in\LINS_q^{ST}(f(p+\bullet))\,\,)\,\,\Leftrightarrow\,\,(\,\,L\in\LINS_{p+q}^{ST}f\,\,)\,\,]$.\\
Given $L\in\scrl_S^T$. \quad
Want: $(\,\,L\in\LINS_q^{ST}(f(p+\bullet))\,\,)\,\,\Leftrightarrow\,\,(\,\,L\in\LINS_{p+q}^{ST}f\,\,)$.\\
We have: $(\,\,L\in\LINS_q^{ST}(f(p+\bullet))\,\,)\,\,\Leftrightarrow\,\,(\,\,(f(p+\bullet))_q^T\,-\,L\,\in\,\scrlito_1^{ST}\,\,)$.\\
Also,  we have: $(\,\,L\in\LINS_{p+q}^{ST}f\,\,)\,\,\Leftrightarrow\,\,(\,\,f_{p+q}^T\,-L\,\in\,\scrlito_1^{ST}\,\,)$.\\
Want: $(\,f(p+\bullet)\,)_q^T\,=\,f_{p+q}^T$.\\
Want: $\forall h\in S$, $(\,f(p+\bullet)\,)_q^T(h)\,=\,f_{p+q}^T(h)$.\\
Given $h\in S$. \qquad
Want: $(\,f(p+\bullet)\,)_q^T(h)\,=\,f_{p+q}^T(h)$.\\
We have $(\,f(p+\bullet)\,)_q^T(h)\,=\,(\,(f(p+\bullet))_{q+h}\,)\,-\,(\,(f(p+\bullet))_q\,)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,=\,(\,f(p+q+h)\,)\,-\,(\,f(p+q\,)\,=\,f_{p+q}^T(h)$.
\end{proof}

\begin{thm}\wrlab{thm-tensor-dot-is-a-tensor-multiplication}
Let $S\in\TNSR^+$, \quad $u,v\in S$.\\
\phx\qquad\qquad\qquad\qquad Then \quad $u\,\,*_{\R S\R}\,\,v\,\,=\,\,u\,\,\sbullet_S\,\,v$.
\end{thm}

\begin{proof}
By \tref{thm-tensor-multiplication-formula}, \quad $\ds{u\,\,*_{\R S\R}\,\,v\,\,=\,\,\sum_{j\in\scri_S}\,u_jv_j}$.\\
By \dref{defn-dot-prod-norm-in-tensor-spaces}, \quad $\ds{u\,\,\sbullet_S\,\,v\,\,=\,\,\sum_{j\in\scri_S}\,u_jv_j}$.\\
Then \quad $\ds{u\,\,*_{\R S\R}\,\,v\,\,=\,\,\sum_{j\in\scri_S}\,u_jv_j\,\,=\,\,u\,\,\sbullet_S\,\,v}$.
\end{proof}

\begin{defn}
Let $S\in\TNSR^+$, \quad $p,v\in S$.\\
\phx\qquad\qquad\qquad Then $i_p^v:\R\to S$ is defined by $\i_p^v(t)=p+vt$.
\end{defn}

\begin{defn}
Let $S\in\TNSR^+$, \quad $v\in S$, \quad $f:S\drta T$.\\
\phx\qquad\qquad Then $\partial_v^{ST}f:S\drta T$ is defined by
$(\partial_v^{ST}f)_p=(f\circ(i_p^v))'_0$.

\end{defn}

\begin{thm}\wrlab{thm-fpr-relates-to-dir-deriv}
Let $S\in\TNSR^+$, \quad $f:S\drta\R$, \quad $p,v\in S$.\\
\phx\qquad\qquad\qquad\qquad Then $(\partial_v^{ST}f)_p\,\,=^*\,\,(f'_p)\,\sbullet_S\,v$.
\end{thm}

\begin{proof}
By HW\#8-4, \quad $(\partial_v^{ST}f)_p\,\,=^*\,\,(D_p^{ST}f)_v$.\\
By \tref{thm-lin-fprime-is-Dderiv}, \quad $(D_p^{ST}f)(v)\,\,\,=\,\,\,(\Lin_{f'_p}^{ST})(v)$.\\
By \tref{thm-linA-is-A-star}, \quad $(\Lin_{f'_p}^{ST})(v)\,\,\,=\,\,\,f'_p\,\,*_{\R S\R}\,\,v$.\\
By \tref{thm-tensor-dot-is-a-tensor-multiplication}, \quad $f'_p\,\,*_{\R S\R}\,\,v\,\,\,=\,\,\,(f'_p)\,\sbullet_S\,v$.\\
Then $(\partial_v^{ST}f)_p\,\,=^*\,\,(D_p^{ST}f)_v\,\,\,=\,\,\,(D_p^{ST}f)(v)\,\,\,=\,\,\,(\Lin_{f'_p}^{ST})(v)$\\
\phx\qquad\qquad\qquad $\,=\,\,\,f'_p\,\,*_{\R S\R}\,\,v\,\,\,=\,\,\,(f'_p)\,\sbullet_S\,v$.
\end{proof}

\begin{defn}
Let $S\in\TNSR$, \quad $T\in\TNSR^+$.\\
\phx\qquad\qquad Let $f:S\drta T$, \quad $j\in\scri_S$. \qquad\qquad
Then $\partial_j^{ST}f\,\,:=\,\,\partial_{\varepsilon_j^S}^{ST}f$.
\end{defn}

\begin{thm}
Let $S\in\TNSR$, \quad $v\in S$, \quad $j\in\scri_S$.\\
\phx\qquad\qquad\qquad\qquad Then $v\,\sbullet_S\varepsilon_j^S\,\,=\,\,v_j$.
\end{thm}

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

\begin{defn}
Let $S$ be a set, \quad $W\in\TNSR^+$.\\
\phx\qquad\qquad\qquad\qquad Let $f:S\drta W$, \quad $p,q\in S$.\\
\phx\qquad\qquad\qquad\qquad Then $f|_p^q\,\,:=\,\,f_q\,-\,f_p$.a
\end{defn}

\begin{thm}\wrlab{thm-MVT-clear-denom-redux}
Let $f:\R\drta\R$ and let $a,b\in\R$.\\
Assume that $[a|b]\subseteq\dom[f']$.\\
Then $\exists c\in[a|b]$ s.t.~$f|_a^b\,\,=\,\,(f'_c)\,\cdot\,(b-a)$.
\end{thm}

\begin{proof}
This is a restatement of \tref{thm-MVT-clear-denom}.
\end{proof}

\begin{thm}
Let $V:=\R^2$, \quad $W:=\R$, \quad $R:V\drta W$.\\
Let $\delta>0$, \quad $J:=(-\delta;\delta)$, \quad $x,y\in J$. \qquad\qquad
Assume $J^2\subseteq\dom[R']$.\\
Then \quad $\exists\beta\in[0|y]$ \quad s.t.~\quad $R|_{(x,0)}^{(x,y)}\,\,\,=\,\,\,(\,(\partial_2^{VW}R)(x,\beta)\,)\,\cdot y$.
\end{thm}

\begin{proof}
Let $i:=i_{(x,0)}^{(0,1)}$. \qquad\qquad By HW\#8-3, we have: $i'=C_\R^{(0,1)}$.\\
Also, we have: \quad $\forall t\in\R$, $i_t=(x,0)+t\cdot(0,1)=(x,t)$.\\
Let $f:=R\circ i$.\\
\\
{\it Claim:} $\forall t\in J$, $(\partial_2^{VW}R)_{i_t}\,\,=\,\,f'_t\,\,\ne\,\,\frownie$.\\
{\it Proof of Claim:}\\
Given $t\in J$. \quad
Want: $(\partial_2^{VW}R)_{i_t}\,\,=\,\,f'_t\,\,\ne\,\,\frownie$.\\
Since $f=R\circ i$, by the Chain Rule,\\
\phx\qquad we have: $D_t^{\R W}f\,\,=^*\,\,(D_{i_t}^{VW}R)\circ(D_t^{\R V}i)$.\\
We have $i_t=(x,t)\in J^2\subseteq\dom[R']$. \qquad\qquad
Then $D_{i_t}^{VW}R\in\scrl_V^W$.\\
We have $t\in\R=\dom[i']$. \qquad\qquad
Then $D_t^{\R V}i\in\scrl_\R^V$.\\
It follows that $(D_{i_t}^{VW}R)\circ(D_t^{\R V}i)\,\,\in\,\,\scrl_\R^W$,\\
\phx\qquad$\,\,\,$ and so $(D_{i_t}^{VW}R)\circ(D_t^{\R V}i)\,\,\ne\,\,\frownie$.\\
Since $D_t^{\R W}f\,\,=^*\,\,(D_{i_t}^{VW}R)\circ(D_t^{\R V}i)\,\,\ne\,\,\frownie$,\\
\phx\qquad we get: $D_t^{\R W}f\,\,=\,\,(D_{i_t}^{VW}R)\circ(D_t^{\R V}i)$.\\
Since $D_t^{\R W}f\,\,=\,\,(D_{i_t}^{VW}R)\circ(D_t^{\R V}i)\,\,\in\scrl_\R^W$,
we get $(D_t^{\R W}f)(1)\in W$.\\
Also, $f'_t\,\,=\,\,\sl_\bullet^{\R W}(D_t^{\R W}f)\,\,=\,\,(D_t^{\R W}f)(1)$,
so $f'_t\,\,=\,\,(D_t^{\R W}f)(1)$.\\
Then $f'_t\,\,=\,\,(D_t^{\R W}f)(1)\,\,\in\,\,W$.\\
Then $f'_t\,\,\ne\,\,\frownie$. \qquad\qquad\qquad
Want: $(\partial_2^{VW}R)_{i_t}\,\,=^*\,\,f'_t$.\\
By HW\#8-4, $(\partial_{\varepsilon_2^V}^{VW}R)_{i_t}\,\,=^*\,\,(D_{i_t}^{VW}R)_{\varepsilon_2^V}$.\\
So, since $(\partial_2^{VW}R)_{i_t}\,\,=\,\,(\partial_{\varepsilon_2^V}^{VW}R)_{i_t}$, we get $(\partial_2^{VW}R)_{i_t}\,\,=^*\,\,(D_{i_t}^{VW}R)_{\varepsilon_2^V}$.\\
Want: $f'_t\,\,=\,\,(D_{i_t}^{VW}R)_{\varepsilon_2^V}$.\\
We have $i'_t\,\,=\,\,\sl_\bullet^{\R V}(D_t^{\R V}i)\,\,=\,\,(D_t^{\R V}i)(1)$.\\
Since $D_t^{\R W}f\,\,=\,\,(D_{i_t}^{VW}R)\circ(D_t^{\R V}i)$ and since $(D_t^{\R V}i)(1)\,\,=\,\,i'_t$,\\
\phx\qquad we get $(D_t^{\R W}f)(1)\,\,=\,\,(D_{i_t}^{VW}R)(i'_t)$.\\
Recall that $f'_t\,\,=\,\,(D_t^{\R W}f)(1)$.\\
Also, $i'_t\,\,=\,\,i'(t)\,\,=\,\,(C_\R^{(0,1)})(t)\,\,=\,\,(0,1)\,\,=\,\,\varepsilon_2^V$.\\
Then $f'_t\,\,=\,\,(D_t^{\R W}f)(1)\,\,=\,\,(D_{i_t}^{VW}R)(i'_t)$\\
\phx\qquad\qquad $=\,\,(D_{i_t}^{VW}R)(\varepsilon_2^V)\,\,=\,\,(D_{i_t}^{VW}R)_{\varepsilon_2^V}$, \qquad as desired.\\
{\it End of proof of Claim.}\\
\\
By the Claim, $J\subseteq\dom[f']$.\\
Since $0,y\in J$ and since $J$ is an interval, we get $[0|y]\subseteq J$.\\
Then $[0|y]\subseteq J\subseteq\dom[f']$.\\
So, by \tref{thm-MVT-clear-denom-redux},
choose $\beta\in[0|y]$ s.t.~$f|_0^y\,\,=\,\,(f'_\beta)\,\cdot\,(y-0)$.\\
Want: $R|_{(x,0)}^{(x,y)}\,\,\,=\,\,\,(\,(\partial_2^{VW}R)(x,\beta)\,)\,\cdot y$.\\
We have $f_y=(R\circ i)_y=R(i_y)=R(x,y)$.\\
Also, $f_0=(R\circ i)_0=R(i_0)=R(x,0)$.\\
Then $f|_0^y=f_y-f_0=[R(x,y)]-[R(x,0)]=R|_{(x,0)}^{(x,y)}$.\\
By the Claim, $(\partial_2^{VW}R)_{i_\beta}\,\,=\,\,f'_\beta$. \qquad\qquad
Also, $i_\beta=(x,\beta)$.\\
Then $f'_\beta=(\partial_2^{VW}R)_{i_\beta}=(\partial_2^{VW}R)(i_\beta)=(\partial_2^{VW}R)(x,\beta)$.\\
Then $R|_{(x,0)}^{(x,y)}\,\,\,=\,\,\,f|_0^y\,\,\,=\,\,\,(f'_\beta)\,\cdot\,(y-0)$\\
\phx\quad\qquad\qquad $\,\,\,=\,\,\,(f'_\beta)\,\cdot\,y\,\,\,=\,\,\,(\partial_2^{VW}R)(x,\beta)$, \qquad
as desired.
\end{proof}

\begin{thm}
Let $V:=\R^2$ and $W:=\R$.
Define $f:V\to W$ by\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\ds{f(x,y)=\begin{cases}1,&\hbox{if }(x=0)\vee(y=0)\\0,&\hbox{if }x\ne0\ne y.\end{cases}}$\\
Then $0_2\in\dom[\partial_1f]$, $0_2\in\dom[\partial_2f]$, and $f$ is not continuous at $0_2$.
\end{thm}

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

\begin{thm}\wrlab{thm-extension-equivalents}
Let $f$ and $g$ be functions.
\qquad Then:\\
\phx\qquad $(\,\,\,g\supseteq f\,\,\,)\quad\Leftrightarrow\quad(\,\,\,(\,\dom[g]\supseteq\dom[f]\,)\,\,\,\&\,\,\,(\,g|(\dom[f])=f\,)\,\,\,)$\\
\phx\quad\qquad\qquad\qquad $\,\,\,\Leftrightarrow\quad(\,\,\,\forall p,\quad g_p\,\,=^*f_p\,\,\,)$.
\end{thm}

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

\begin{thm}\wrlab{thm-extension-more-equivalents}
Let $f$ and $g$ be functions and let $S$ be a set.\\
Assume that $S\supseteq\dom[f]$.
\qquad Then:\\
\phx\qquad $(\,\,\,g\supseteq f\,\,\,)\quad\Leftrightarrow\quad(\,\,\,\forall p\in S,\quad g_p\,\,=^*f_p\,\,\,)$.

\end{thm}

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

On the board, we graphed two partial functions $f,g:\R\drta\R$ s.t.~$g\supseteq f$,
and discussed \tref{thm-extension-equivalents} and \tref{thm-extension-more-equivalents} in the context of those two functions.

\begin{thm}
Let $S,T\in\TNSR^+$ and let $f,g:S\drta T$.\\
Assume that $g\supseteq f$. \qquad
Then:\\
\phx\qquad (1) $(\,\,\,f\in\DNZ_S^T\,\,\,)\,\,\,\Rightarrow\,\,\,(\,\,\,g\in\DNZ_S^T\,\,\,)$ \qquad\qquad\qquad and\\
\phx\qquad (2) $(\,\,\,f\in\scrlito_1\,\,\,)\,\,\,\Rightarrow\,\,\,(\,\,\,g\in\scrlito_1\,\,\,)$ \qquad\qquad\qquad\qquad and\\
\phx\qquad (3) $\forall p\in S$, $[\qquad g_p^T\supseteq f_p^T$ \quad and\\
\phx\qquad\qquad\qquad\qquad\quad $\,\,\LINS_p^{ST}g\supseteq\LINS_p^{ST}f$ \quad and\\
\phx\qquad\qquad\qquad\qquad\quad $\,\,D_p^{ST}g\,\,=^*\,\,D_p^{ST}f$  \quad and\\
\phx\qquad\qquad\qquad\qquad\quad $\,\,g'_p\,\,=^*\,\,f'_p\quad\qquad ]$ \qquad\qquad\qquad and\\
\phx\qquad (4) $g'\supseteq f'$ \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad$\,$ and\\
\phx\qquad (5) $\forall v\in S$, \quad $\partial_v^{ST}g\supseteq\partial_v^{ST}f$.
\end{thm}

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

\begin{thm}
Let $S,T\in\TNSR^+$ and let $f,g:S\drta T$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $(f+g)'\,\,\supseteq\,\,f'+g'$.
\end{thm}

\begin{proof}
This follows from \tref{thm-deriv-distribs-over-addn}.
\end{proof}

\begin{thm}
Let $S,T\in\TNSR^+$, let $c\in\R$ and let $f:S\drta T$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $(c\cdot f)'\,\,\supseteq\,\,c\cdot f'$.
\end{thm}

\begin{proof}
This follows from \tref{thm-deriv-commutes-with-scalar-mult-multivariable}.
\end{proof}

Let $S$ and $T$ be tensor spaces, let $f:S\drta T$ and let $k\in\N_0$.
Then the $k$th derivative of $f$ is denoted $f^{(k)}$.
Then $f^{(k)}:S\drta T\otimes(S^{\otimes k})$.

Let $S$ and $T$ be tensor spaces and let $f:S\drta T$.
Then $f^{(1)}=f'$ and $f^{(2)}=f''$ and $f^{(3)}=f''$.
By convention, $f^{(0)}=f$.

\begin{thm}\wrlab{thm-l-times-diff-for-one}
Let $S,T\in\TNSR^+$, $f,g:S\drta T$, $q\in S$, $\ell\in\N_0$.\\
Assume $q\in\dom[f^{(\ell)}]$ and $q\in\dom[g^{(\ell)}]$. \quad
Then $q\in\dom[(f+g)^{(\ell)}]$.
\end{thm}

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

\begin{thm}\wrlab{thm-l-times-diff-for-both}
Let $S,T\in\TNSR^+$, $\ell\in\N_0$, $f:S\drta T$, $q\in S$.\\
Let $c\in\R$. \quad
Assume $q\in\dom[f^{(\ell)}]$. \quad
Then $q\in\dom[(c\cdot f)^{(\ell)}]$.
\end{thm}

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

\begin{thm}\wrlab{thm-binomial-derivative-theorem}
Let $R,S,T,U\in\TNSR^+$, \quad $*\in\scrb_{ST}^U$,\\
\phx\qquad\qquad\qquad $f:R\drta S$ \quad and \quad $g:R\drta T$.\\
\phx\qquad Then: \quad $(f*g)'\,\,\supseteq\,\,(f'*g)\,\,+\,\,(f*g')$ \qquad\qquad and\\
\phx\qquad\qquad\qquad $(f*g)''\,\,\supseteq\,\,(f''*g)\,\,+\,\,2\cdot(f'*g')\,\,+\,\,(f*g'')$.
\end{thm}

\begin{proof}
This follows from \tref{thm-multi-variable-tensorial-prod-rule},
but requires careful definitions of the various bilinear multiplications, all of which are called $*$.
\end{proof}

We will not require \tref{thm-binomial-derivative-theorem},
so we have not carefully defined all the multiplications appearing in it,
and we omit a detailed proof.
Instead, more important to us is:

\begin{thm}\wrlab{thm-binomial-derivative-theorem-domains}
Let $R,S,T,U\in\TNSR^+$, \quad $*\in\scrb_{ST}^U$,\\
\phx\qquad\qquad\qquad $f:R\drta S$, \quad $g:R\drta T$, \quad $p\in R$ \quad and \quad $k\in\N_0$.\\
Assume that $p\in\dom[f^{(k)}]$ and that $p\in\dom[g^{(k)}]$.\\
Then $p\in\dom[(f*g)^{(k)}]$.
\end{thm}

\begin{proof}
We have: $p\in(\,\dom[f^{(k)}]\,)\,\cap\,(\,\dom[g^{(k)}]\,)$.\\
Want: $(\,\dom[f^{(k)}]\,)\,\cap\,(\,\dom[g^{(k)}]\,)\,\,\subseteq\,\,\dom[(f*g)^{(k)}]$.\\
Let $I$ denote the set of all $\ell\in\N_0$ s.t.\\
\phx\qquad\qquad $\forall V,W,X,Y\in\TNSR^+$, \quad $\forall\odot\in\scrb_{WX}^Y$,\\
\phx\qquad\qquad $\forall\phi:V\drta W$, \quad $\forall\psi:V\drta X$,\\
\phx\qquad\qquad\qquad\qquad $(\,\dom[\phi^{(\ell)}]\,)\,\cap\,(\,\dom[\psi^{(\ell)}]\,)\,\,\subseteq\,\,\dom[(\phi\odot\psi)^{(\ell)}]$.\\
Want: $k\in I$. \qquad\qquad\qquad
Want: $I=\N_0$.\\
We have: $\forall V,W,X,Y\in\TNSR^+$, \quad $\forall\odot\in\scrb_{WX}^Y$,\\
\phx\qquad\qquad $\forall\phi:V\drta W$, \quad $\forall\psi:V\drta X$,\\
\phx\qquad\qquad\qquad\qquad $(\,\dom[\phi]\,)\,\cap\,(\,\dom[\psi]\,)\,\,=\,\,\dom[\phi\odot\psi]$.\\
It follows that $0\in I$. \qquad\qquad
Want: $\forall\ell\in I$, $\ell+1\in I$.\\
Given $\ell\in I$. \qquad
Want: $\ell+1\in I$.\\
Know:\quad $\,\,\,\,\forall V,W,X,Y\in\TNSR^+$, \quad $\forall\odot\in\scrb_{WX}^Y$,\\
\phx\qquad\qquad $\forall\phi:V\drta W$, \quad $\forall\psi:V\drta X$,\\
\phx\qquad\qquad\qquad\qquad $(\,\dom[\phi^{(\ell)}]\,)\,\cap\,(\,\dom[\psi^{(\ell)}]\,)\,\,\subseteq\,\,\dom[(\phi\odot\psi)^{(\ell)}]$.\\
Want:\quad $\,\,\,\,\,\forall V,W,X,Y\in\TNSR^+$, \quad $\forall\odot\in\scrb_{WX}^Y$,\\
\phx\qquad\qquad $\forall\phi:V\drta W$, \quad $\forall\psi:V\drta X$,\\
\phx\qquad\qquad\qquad\qquad $(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\dom[\psi^{(\ell+1)}]\,)\,\,\subseteq\,\,\dom[(\phi\odot\psi)^{(\ell+1)}]$.\\
Given $V,W,X,Y\in\TNSR^+$, $\odot\in\scrb_{WX}^Y$, $\phi:V\drta W$, $\psi:V\drta X$.\\
Want: $(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\dom[\psi^{(\ell+1)}]\,)\,\,\subseteq\,\,\dom[(\phi\odot\psi)^{(\ell+1)}]$.\\
Want: $\forall q\in(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\dom[\psi^{(\ell+1)}]\,)$, \quad $q\in\dom[(\phi\odot\psi)^{(\ell+1)}]$.\\
Given $q\in(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\dom[\psi^{(\ell+1)}]\,)$.\\
Want: $q\in\dom[(\phi\odot\psi)^{(\ell+1)}]$.\\
Let \qquad $S':=S\otimes R$, \qquad $T':=T\otimes R$, \qquad $U':=U\otimes R$.\\
Define $\odot_L:S'\times T\to U'$ by $A\odot_Lb=\sl_\bullet^{RT}((\Lin_A^{RS})\odot b)$.\\
Define $\odot_R:S\times T'\to U'$ by $a\odot_RB=\sl_\bullet^{RT}(a\odot(\Lin_B^{RS}))$.\\
Then, by \tref{thm-multi-variable-tensorial-prod-rule}, \qquad $(\phi\odot\psi)'\supseteq(\phi'\odot_L\psi)+(\phi\odot_R\psi')$.\\
Then:\qquad $(\,(\phi\odot\psi)'\,)^{(\ell)}\quad\supseteq\quad(\,(\phi'\odot_L\psi)+(\phi\odot_R\psi')\,)^{(\ell)}$.\\
So, since \quad $(\,(\phi\odot\psi)'\,)^{(\ell)}\quad=\quad(\phi\odot\psi)^{(\ell+1)}$, \qquad we see that:\\
\phx\qquad\qquad $(\phi\odot\psi)^{(\ell+1)}\quad\supseteq\quad(\,(\phi'\odot_L\psi)+(\phi\odot_R\psi')\,)^{(\ell)}$.\\
Then: $\dom[\,(\phi\odot\psi)^{(\ell+1)}\,]\supseteq\dom[\,(\,(\phi'\odot_L\psi)+(\phi\odot_R\psi')\,)^{(\ell)}\,]$.\\
We have $q\in\dom[\phi^{(\ell+1)}]$ and $\phi^{(\ell+1)}=(\phi')^{(\ell)}$, so $q\in\dom[(\phi')^{(\ell)}]$.\\
Also, $q\in\dom[\psi^{(\ell+1)}]\subseteq\dom[\psi^{(\ell)}]$, so $q\in\dom[\psi^{(\ell)}]$.\\
Since \qquad $q\in\dom[(\phi')^{(\ell)}]$, \qquad since $q\in\dom[\psi^{(\ell)}]$,\\
\phx\qquad and \qquad since $\ell\in I$, \qquad we get: \qquad $q\in\dom[(\phi'\odot_L\psi)^{(\ell)}]$.\\
We have $q\in\dom[\phi^{(\ell+1)}]\subseteq\dom[\phi^{(\ell)}]$, so $q\in\dom[\phi^{(\ell)}]$.\\
Also, $q\in\dom[\psi^{(\ell+1)}]$ and $\psi^{(\ell+1)}=(\psi')^{(\ell)}$, so $q\in\dom[(\psi')^{(\ell)}]$.\\
Since \qquad $q\in\dom[\phi^{(\ell)}]$, \qquad since $q\in\dom[(\psi')^{(\ell)}]$,\\
\phx\qquad and \qquad since $\ell\in I$, \qquad we get: \qquad $q\in\dom[(\phi\odot_R\psi')^{(\ell)}]$.\\
Since \quad $q\in\dom[(\phi'\odot_L\psi)^{(\ell)}]$ \quad and \quad $q\in\dom[(\phi\odot_R\psi')^{(\ell)}]$,\\
\phx\qquad by \tref{thm-l-times-diff-for-both}, we get: $q\in\dom[(\phi'\odot_L\psi+\phi\odot_R\psi')^{(\ell)}]$.\\
Then: $q\quad\in\quad\dom[\,(\,(\phi'\odot_L\psi)+(\phi\odot_R\psi')\,)^{(\ell)}\,]$\\
\phx\qquad\qquad $\subseteq\quad\dom[\,(\phi\odot\psi)^{(\ell+1)}\,]$, \qquad as desired.
\end{proof}

\tref{thm-binomial-derivative-theorem-domains} above is called the \bfindex[Product Derivatives Domain Theorem].

\begin{thm}\wrlab{thm-faadibruno-derivative-theorem}
Let $S,T,U\in\TNSR^+$, $f:S\drta T$, $g:T\drta U$.\\
\phx\qquad Then: \quad $(g\circ f)'\,\,\supseteq\,\,(g'\circ f)*f'$ \qquad\qquad and\\
\phx\qquad\qquad\qquad $(g\circ f)''\,\,\supseteq\,\,((g''\circ f)*f')*f'\,\,+\,\,(g'\circ f)*f''$.
\end{thm}

\begin{proof}
This follows from \tref{thm-multi-variable-tensorial-chain-rule},
but requires careful definitions of the various bilinear multiplications, all of which are called $*$.
\end{proof}

We will not require \tref{thm-faadibruno-derivative-theorem},
so we have not carefully defined all the multiplications appearing in it,
and we omit a detailed proof.
Instead, more important to us is:

\begin{thm}\wrlab{thm-faadibruno-derivative-theorem-domains}
Let $S,T,U\in\TNSR^+$, $f:S\drta T$, $g:T\drta U$.\\
Assume that $p\in\dom[f^{(k)}]$ and that $f_p\in\dom[g^{(k)}]$.\\
Then $p\in\dom[(g\circ f)^{(k)}]$.
\end{thm}

\begin{proof}
We have: $p\in(\,\dom[f^{(k)}]\,)\,\cap\,(\,f^*(\,\dom[g^{(k)}]\,)\,)$.\\
Want: $(\,\dom[f^{(k)}]\,)\,\cap\,(\,f^*(\dom[g^{(k)}]\,)\,)\,\,\subseteq\,\,\dom[(g\circ f)^{(k)}]$.\\
Let $I$ denote the set of all $\ell\in\N_0$ s.t.\\
\phx\qquad\qquad $\forall V,W,X\in\TNSR^+$, $\forall\phi:V\drta W$, $\forall\psi:W\drta X$,\\
\phx\qquad\qquad\qquad $(\,\dom[\phi^{(\ell)}]\,)\,\cap\,(\,\phi^*(\,\dom[\psi^{(\ell)}]\,)\,)\,\,\subseteq\,\,\dom[(\psi\circ\phi)^{(\ell)}]$.\\
Want: $k\in I$. \qquad\qquad\qquad
Want: $I=\N_0$.\\
We have: $\forall V,W,X\in\TNSR^+$, $\forall\phi:V\drta W$, $\forall\psi:W\drta X$,\\
\phx\qquad\qquad\qquad $(\,\dom[\phi]\,)\,\cap\,(\,\phi^*(\,\dom[\psi]\,)\,)\,\,=\,\,\dom[\psi\circ\phi]$.\\
It follows that $0\in I$. \qquad\qquad
Want: $\forall\ell\in I$, $\ell+1\in I$.\\
Given $\ell\in I$. \qquad
Want: $\ell+1\in I$.\\
Know:\quad $\,\,\,\,\forall V,W,X\in\TNSR^+$, $\forall\phi:V\drta W$, $\forall\psi:W\drta X$,\\
\phx\qquad\qquad\qquad $(\,\dom[\phi^{(\ell)}]\,)\,\cap\,(\,\phi^*(\,\dom[\psi^{(\ell)}]\,)\,)\,\,\subseteq\,\,\dom[(\psi\circ\phi)^{(\ell)}]$.\\
Want:\quad $\,\,\,\,\,\forall V,W,X\in\TNSR^+$, $\forall\phi:V\drta W$, $\forall\psi:W\drta X$,\\
\phx\qquad\qquad\qquad $(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\phi^*(\,\dom[\psi^{(\ell+1)}]\,)\,)\,\,\subseteq\,\,\dom[(\psi\circ\phi)^{(\ell+1)}]$.\\
Given $V,W,X\in\TNSR^+$, $\phi:V\drta W$, $\psi:W\drta X$.\\
Want: $(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\phi^*(\,\dom[\psi^{(\ell+1)}]\,)\,)\,\,\subseteq\,\,\dom[(\psi\circ\phi)^{(\ell+1)}]$.\\
Want: $\forall q\in(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\phi^*(\,\dom[\psi^{(\ell+1)}]\,)\,)$,\\
\phx\qquad\quad $\,q\in\dom[(\psi\circ\phi)^{(\ell+1)}]$.\\
Given $q\in(\,\dom[\phi^{(\ell+1)}]\,)\,\cap\,(\,\phi^*(\,\dom[\psi^{(\ell+1)}]\,)\,)$,\\
Want: $q\in\dom[(\psi\circ\phi)^{(\ell+1)}]$.\\
By \tref{thm-multi-variable-tensorial-chain-rule}, \qquad $(\psi\circ\phi)'\supseteq(\psi'\circ\phi)\,\,*_{VWX}\,\,\phi'$.\\
Then $(\,(\psi\circ\phi)'\,)^{(\ell)}\supseteq(\,(\psi'\circ\phi)\,\,*_{VWX}\,\,\phi'\,)^{(\ell)}$.\\
So, since \quad $(\,(\psi\circ\phi)'\,)^{(\ell)}\quad=\quad(\psi\circ\phi)^{(\ell+1)}$, \qquad we see that:\\
\phx\qquad\qquad $(\psi\circ\phi)^{(\ell+1)}\supseteq(\,(\psi'\circ\phi)\,\,*_{VWX}\,\,\phi'\,)^{(\ell)}$.\\
Then: $\dom[\,(\psi\circ\phi)^{(\ell+1)}\,]\supseteq\dom[\,(\,(\psi'\circ\phi)\,\,*_{VWX}\,\,\phi'\,)^{(\ell)}\,]$.\\
We have $q\in\dom[\phi^{(\ell+1)}]$ and $\phi^{(\ell+1)}=(\phi')^{(\ell)}$, so $q\in\dom[(\phi')^{(\ell)}]$.\\
Also, $q\in\dom[\psi^{(\ell+1)}]\subseteq\dom[\psi^{(\ell)}]$, so $q\in\dom[\psi^{(\ell)}]$.\\
Since \qquad $q\in\dom[(\phi')^{(\ell)}]$, \qquad since $q\in\dom[\psi^{(\ell)}]$,\\
\phx\qquad and \qquad since $\ell\in I$, \qquad we get: \qquad $q\in\dom[(\psi'\circ\phi)^{(\ell)}]$.\\
We have $q\in\dom[\psi^{(\ell+1)}]$ and $\psi^{(\ell+1)}=(\psi')^{(\ell)}$, so $q\in\dom[(\psi')^{(\ell)}]$.\\
Since \quad $q\in\dom[(\psi'\circ\phi)^{(\ell)}]$ \quad and \quad $q\in\dom[(\psi')^{(\ell)}]$,\\
\phx\qquad by \tref{thm-binomial-derivative-theorem-domains}, we get: $q\in\dom[\,(\,(\psi'\circ\phi)\,\,*_{VWX}\,\,\phi'\,)^{(\ell)}\,]$.\\
Then: $q\quad\in\quad\dom[\,(\,(\psi'\circ\phi)\,\,*_{VWX}\,\,\phi'\,)^{(\ell)}\,]$\\
\phx\qquad\qquad $\subseteq\quad\dom[\,(\psi\circ\phi)^{(\ell+1)}\,]$, \qquad as desired.
\end{proof}

\tref{thm-faadibruno-derivative-theorem-domains} above is called the \bfindex[Composition Deriviatives Domain Theorem].

\section{An infintely directionally differentiable function that is not continuous}

You are expected to know the definition of ``infinitely directionally differentiable'', and the fact that
there is an infinitely directionally differentiable function that is not continuous.
You are neither expected to know the proof of that fact
nor expected to know the other facts covered in this section.

Let $V:=\R^2$.
For all $k\in\N$, for all $s\in V^k$,
for all~$\phi:V\drta\R$,
let $\partial_s\phi:=\partial_{s_1}\cdots\partial_{s_k}\phi$.
Let $S:=V\cup V^2\cup V^3\cup\cdots$.
We will say that a function $\phi:V\to\R$ is
{\bf infinitely directionally differentiable}
if, for all $s\in S$, we have $\dom[\partial_s\phi]=V$.

Choose an infinitely differentiable function $g:\R\to\R$
such that (~$g=0$ on $(-\infty,1]\cup[3,\infty)$ )
and ( $g(2)=1$ )
and ( $\im[g]\subseteq[0,1]$ ).
Define $f:V\to\R$ by
$\ds{f(x,y)=\begin{cases}
g(y/x^2),&\hbox{if }x\ne0;\\
0,&\hbox{if }x=0.
\end{cases}}$

\begin{fact}\wrlab{fact-disc-but-repeated-dir-derivs-ewh}
The function $f:V\to\R$ is infinitely directionally differentiable,
and is discontinuous at $0_2$.
\end{fact}

\begin{proof}
We define
\begin{eqnarray*}
U&:=&\{(x,y)\in V\,|\,x^2<y<3x^2\}\qquad\hbox{and}\\
\baru&:=&\{(x,y)\in V\,|\,x^2\le y\le3x^2\}.
\end{eqnarray*}
Then $0_V=(0,0)\in\baru$.
Also, $U$ is the interior in $V$ of $\baru$,
so $V\backslash U$ is the closure in $V$ of $V\backslash\baru$.
Let $\Phi$ be the set of all $\phi:V\to\R$ such that
\begin{itemize}
\item$\phi=0$ on $V\backslash U$ \qquad\qquad\qquad and
\item for all $s\in S$, \qquad $\partial_s\phi$ is continuous on $V\backslash\{0_V\}$.
\end{itemize}

{\it Claim 1:} $f\in\Phi$.
{\it Proof of Claim 1:}
By construction, $f=0$ on $V\backslash U$.
Let $s\in S$ be given.
We wish to show that $\partial_s\phi$ is continuous on $V\backslash\{0_V\}$.

By the Multivariable Chain Rule (to be proved later),
$\forall x,y\in\R$, we have: if $x\ne0$, then $\partial_sf$ is continuous at $(x,y)$.
Let $Y:=\{(0,y)|y\in\R\}$ denote the $y$-axis.
Then $\partial_sf$ is continuous on $V\backslash Y$.
It therefore suffices to show that $\partial_s\phi$ is continuous on $Y\backslash\{0_V\}$.
Let $v\in Y\backslash\{0_V\}$ be given.
We wish to show: $\partial_s\phi$ is continuous at $v$.

Let $V_0:=V\backslash\baru$.
We have $v\in Y\backslash\{0_V\}\subseteq V\backslash\barU=V_0$.
So, since $V_0$ is open in $V$, we see that $V_0$ is an open nbd in $V$ of $v$.
Since $V_0\subseteq V\backslash U$ and since $f=0$ on $V\backslash U$, we see that $f=0$ on $V_0$.
So, since $V_0$ is open in $V$,
it follows that $\partial_s\phi=0$ on~$V_0$.
So, since $V_0$ is an open nbd in $V$ of $v$,
it follows that $\partial_s\phi$ is continuous at $v$.
{\it End of proof of Claim 1.}

{\it Claim 2:} Let $\phi\in\Phi$ and let $v\in V$.
Then we have $(\partial_v\phi)(0_V)=0$.
{\it Proof of Claim 2:}
Let $L:=\R v\subseteq V$ denote the line through $v$ in $V$,
and give $L$ the relative topology inherited from $V$.
Choose a nbd $L_0$ of~$0_V$ in~$L$
such that $L_0\subseteq V\backslash U$.
Since $\phi=0$ on $V\backslash U$,
we conclude that $\phi=0$ on $L_0$.
Then $(\partial_v\phi)(0_V)=0$, as desired.
{\it End of proof of Claim 2.}

{\it Claim 3:} Let $\phi\in\Phi$, let $v\in V$ and let $s\in S$.
Then $\partial_s\partial_v\phi$ is continuous on $V\backslash\{0_V\}$.
{\it Proof of Claim 3:}
Because $s\in S=V\cup V^2\cup V^3\cup\cdots$,
choose $k\in\N$ such that $s\in V^k$.
Let $t:=(s_1,\ldots,s_k,v)$.
Then we have $t\in V^{k+1}\subseteq S$ and $\partial_t\phi=\partial_s\partial_v\phi$.
Since $\phi\in\Phi$, we see that $\partial_t\phi$ is continuous on $V\backslash\{0_V\}$.
Then $\partial_s\partial_v\phi$ is continuous on~$V\backslash\{0_V\}$, as desired.
{\it End of proof of Claim~3.}

{\it Claim 4:} Let $\phi\in\Phi$ and let $v\in V$.
Then we have $\partial_v\phi\in\Phi$.
{\it Proof of~Claim 4:}
By Claim~3, it suffices to show that $\partial_v\phi=0$ on $V\backslash U$.
Since $\phi\in\Phi$, we know that $\phi=0$ on $V\backslash U$.
So, since $V\backslash\baru\subseteq V\backslash U$,
it follows that $\phi=0$ on~$V\backslash\baru$.
So since $V\backslash\baru$ is open in $V$,
we see that $\partial_v\phi=0$ on~$V\backslash\baru$.
By~Claim~2, $(\partial_v\phi)(0_V)=0$.
Let $U^*:=\baru\backslash(U\cup\{0_V\})$.
It remains to~show that $\partial_v\phi=0$ on $U^*$.
Let $x\in U^*$ be given.
We wish to~show that $(\partial_v\phi)(x)=0$.

As $\phi\in\Phi$ and $v\in V\subseteq S$,
we know that $\partial_v\phi$ is continuous on~$V\backslash\{0_V\}$.
We have $x\in U^*\subseteq V\backslash\{0_V\}$.
Then $\partial_v\phi$ is continuous at $x$.
Also, $x\in\baru\backslash U\subseteq V\backslash U$,
and $V\backslash U$ is the closure in $V$ of $V\backslash\baru$.
Then $x$ is an element of the closure in~$V$ of $V\backslash\baru$,
so, since $\partial_v\phi=0$ on~$V\backslash\baru$
and since $\partial_v\phi$ is continuous at $x$,
we get $(\partial_v\phi)(x)=0$.
{\it End of proof of Claim 4.}

{\it Claim 5:} Let $\phi\in\Phi$.
Then we have: $\forall k\in\N$, $\forall s\in V^k$, $\partial_s\phi\in\Phi$.
{\it Proof of Claim 5:}
We argue by induction on $k$.
By Claim 4, we have: $\forall s\in V$, $\partial_s\phi\in\Phi$,
proving the base case.
Let $k\in\N$ be given and make the induction assumption: $\forall s\in V^k$, $\partial_s\phi\in\Phi$.
We wish to show: $\forall s\in V^{k+1}$, $\partial_s\phi\in\Phi$.
Let $s\in V^{k+1}$ be given.
We wish to show: $\partial_s\phi\in\Phi$.

Let $r:=(s_2,\ldots,s_{k+1})\in V^k$ and $\psi=\partial_r\phi$.
Then $\partial_s\phi=\partial_{s_1}\partial_r\phi=\partial_{s_1}\psi$.
By the induction assumption, $\partial_r\phi\in\Phi$.
That is, we have $\psi\in\Phi$.
Then, by Claim 4, $\partial_{s_1}\psi\in\Phi$.
Then $\partial_s\phi=\partial_{s_1}\psi\in\Phi$.
{\it End of proof of Claim 5.}

Let $C:=\{(x,y)\in V\,|\,y=2x^2\}$.
By construction, know both that $f=1$ on $C\backslash\{0_V\}$
and that $f(0_V)=0$.
Thus $f$ is discontinuous at $0_V$.
It remains to show that $f$ is infinitely directionally differentiable.
Let $s\in S$ be given.
We wish to show that $\dom[\partial_s\phi]=V$.

Since $s\in S=V\cup V^2\cup V^3\cup\cdots$,
choose $k\in\N$ such that $s\in V^k$.
By~Claim 1, we have $f\in\Phi$.
Then, by Claim 5, we have $\partial_s\phi\in\Phi$.
Then, by definition of $\Phi$,
we see that $\dom[\partial_s\phi]=V$, as desired.
\end{proof}

We say a function $\phi:V\to\R$ is
{\bf directionally differentiable}
if, for all $v\in V$, $\dom[\partial_v\phi]=V$.
Recall: $f:V\to\R$ is defined by
$$f(v)=\begin{cases}
g(y/x^2),&\hbox{if }x\ne0;\\
0,&\hbox{if }x=0.
\end{cases}$$
Let $\sigma:V\to\R$ be an infinitely differentiable function
satisfying $\sigma=0$ on $V\backslash(B(0_2,1))$
and $\sigma(0_2)=1$ and $\im[\sigma]\subseteq[0,1]$.
For all $\varepsilon>0$, define $\sigma_\varepsilon:V\to\R$
by~$\sigma_\varepsilon(x)=\varepsilon\cdot[\sigma(x/\varepsilon)]$;
then $\sigma_\varepsilon=0$ on~$V\backslash(B(0_2,\varepsilon))$
and $\sigma_\varepsilon(0_2)=\varepsilon$ and $\im[\sigma_\varepsilon]\subseteq[0,\varepsilon]$.
For all $\varepsilon>0$, for all $p\in V$,
we define $f_{p,\varepsilon}:V\to\R$ by
$f_{p,\varepsilon}(x)=[\sigma_\varepsilon(x-p)][f(x-p)]$;
then
\begin{itemize}
\item$f_{p,\varepsilon}=0$ on $V\backslash(B(p,\varepsilon))$,
\item$\im[f_{p,\varepsilon}]\subseteq[0,\varepsilon]$,
\item$f_{p,\varepsilon}$ is infinitely directionally differentiable \qquad and
\item$f_{p,\varepsilon}$ is discontinuous at $p$.
\end{itemize}
For any sequence $p_1,p_2,\ldots$ of distinct points in $V$,
there is a sequence $\varepsilon_1,\varepsilon_2,\dots$ of~positive real numbers
s.t.~$f_{p_1,\varepsilon_1}+f_{p_2,\varepsilon_2}+\cdots$ is
both directionally differentiable
and discontinuous at each point of~$\{p_1,p_2,\ldots\}$.
In particular, there is a directionally differentiable
$g:V\to\R$ such that $g$ is discontinuous at each point of $\Q^2$.

A subset $S$ of a topological space $X$ is said to be {\bf interior-free in~$X$} if
the interior in $X$ of $S$ is empty.
A subset $S$ of a topological space~$X$ is said to be {\bf meager in $X$} if $S$ is a subset of
a countable union of~closed interior-free subsets of $X$.
A subset $S$ of a topological space $X$ is said to be {\bf comeager in $X$} if $X\backslash S$
is meager in $X$.
By the Baire Category Theorem, for any~$n\in\N$, any~comeager subset of $\R^n$ is to~be dense in~$\R^n$;
in particular, a comeager subset of $\R^n$ is nonempty.

For any $\phi:V\to\R$, define $C_\phi:=\{x\in V\,|\,\phi\hbox{ is continuous at }x\}$,
and let $D_\phi:=V\backslash C_\phi$ be the set of points of discontinuity of $\phi$.

\begin{fact}\wrlab{fact-dir-diff-implies-contin-on-comeager}
Let $\phi:V\to\R$
and assume: $\forall i\in\{1,2\}$, $\dom[\partial_i\phi]=V$.
Then $C_\phi$ is comeager in $V$.
\end{fact}

\begin{proof}
For all $x\in\R$, the maps $\phi(x,\bullet):\R\to\R$
and $\phi(\bullet,x):\R\to\R$ are both differentiable, hence continuous.
Then, by {\it e.g.}, Namioka, Separate continuity and joint continuity,
Pacific Journal of Mathematics, Volume 51, Number 2, 1974,
we see that $C_\phi$ is comeager in $V$.
\end{proof}

\begin{fact}\wrlab{fact-twice-dir-diff-implies-contin-on-open-dense}
Let $\phi:V\to\R$.
Assume: $\forall i,j\in\{1,2\}$, $\dom[\partial_i\partial_j\phi]=V$.
Then $C_\phi$ contains a dense open subset of $V$.
\end{fact}

\begin{proof}
Since $D_\phi=V\backslash C_\phi$,
we wish to~show that $D_\phi$ is nowhere dense in~$V$.
Let $\barD$ be the closure in~$V$ of $D_\phi$.
Let $U$ be the interior in $V$ of~$\barD$.
We wish to show: $U=\emptyset$.
Assume, for a contradiction, that $U\ne\emptyset$.

For all $j\in\{1,2\}$, let $\psi_j:=\partial_j\phi$.
For all $i\in\{1,2\}$, $\dom[\partial_i\psi_1]=V$,
so, by \fref{fact-dir-diff-implies-contin-on-comeager},
we see that $C_{\psi_1}$ is comeager in $V$.
For all $i\in\{1,2\}$, $\dom[\partial_i\psi_2]=V$,
so, by \fref{fact-dir-diff-implies-contin-on-comeager},
we see that $C_{\psi_2}$ is comeager in~$V$.
Let $C:=C_{\psi_1}\cap C_{\psi_2}$.
Then $C$ is comeager in $V$, so, by the Baire Category Theorem,
$C$ is dense in $V$.
So, as $U$ is a nonempty open subset of $V$,
we conclude that $C\cap U\ne\emptyset$.
Choose $x\in C\cap U$.
Since $x\in C=C_{\psi_1}\cap C_{\psi_2}$,
we see that $\psi_1$ and $\psi_2$ are both continuous at~$x$.
For all $j\in\{1,2\}$, choose an open neighborhood $U_j$ in $U$ of $x$
such that $\psi_j$ is bounded on~$U_j$.
Then $U_1\cap U_2$ is an open neighborhood in $U$ of~$x$,
so choose open intervals $I,J\subseteq\R$ such that $x\in I\times J\subseteq U_1\cap U_2$.
Then $\psi_1$ and $\psi_2$ are bounded on $I\times J$.
That is, $\partial_1\phi$ and $\partial_2\phi$ are bounded on~$I\times J$.
Then, by the Mean Value Theorem, $\phi$ is continuous on $I\times J$.
Let $W:=I\times J$.
Then $W\subseteq C_\phi$, so $W\cap D_\phi=\emptyset$.

We have both $x\in I\times J=W$ and $W=I\times J\subseteq U_1\cap U_2$.
Also, $U_1\subseteq U$ and $U_2\subseteq U$.
Also, by definition of $U$, we have $U\subseteq\barD$.
Then $x\in W\subseteq U_1\cap U_2\subseteq U\subseteq\barD$.
Since~$I$~and~$J$~are open intervals in $\R$ and since $W=I\times J$,
it follows that $W$ is an open subset of $V$.
So, since $x\in W$, we see that $W$ is an open neighborhood in $V$ of $x$.
So, since $x\in\barD$ and since $\barD$ is the closure in $V$ of~$D_\phi$,
it follows that $W\cap D_\phi\ne\emptyset$.
However, we showed that $W\cap D_\phi=\emptyset$.
Contradiction.
\end{proof}

\section{A tensor computation}

\begin{defn}
Let $\scri_\R:=\{\emptyset\}$.\\
$\forall x\in\R$, let $x_\emptyset:=x$. \qquad
Let $\pi_\emptyset^\R:=\id_\R$ and let $\varepsilon_\emptyset^\R:=1$.\\
$\forall\sigma\in\N$, $\forall m\in\N^\sigma$, let $m\|\emptyset:=m$ and $\emptyset\|m:=m$.\\
Define $\emptyset\|\emptyset:=\emptyset$.
\end{defn}

Note: $\R\ne\R^{\{\emptyset\}}=\R^{\scri_\R}$.
We therefore cannot extend the statement\\
\phx\qquad\qquad\qquad $\forall S\in\TNSR$, \qquad $S=\R^{\scri_S}$\\
to $\TNSR^+$.
On the other hand, we do have a quantified equivalence for equality of tensors:

\begin{thm}
$\forall S\in\TNSR^+$, $\forall v,w\in S$, we have:\\
\phx\qquad\qquad\qquad\qquad\qquad $(\,v=w\,)\qquad\Leftrightarrow\qquad(\,\forall j\in\scri_S,\,v_j=w_j\,)$.
\end{thm}

\begin{thm}
Let $V,W,X\in\TNSR^+$, $A\in W\otimes V$, $B\in X\otimes W$.\\
Let $i\in\scri_V$, $k\in\scri_W$. \quad
Then: $\ds{(B\,\,*_{VWX}\,\,A)_{k\|i}\,\,=\,\,\sum_{j\in\scri_W}\,(B_{k\|j})\cdot(A_{j\|i})}$.
\end{thm}

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

\begin{thm}
Let $V,W\in\TNSR^+$, $A\in W\otimes V$.\\
Let $i\in\scri_V$ and $j\in\scri_W$. \quad
Then: \quad $(A\,\,*_{\R VW}\,\,\varepsilon_i^V)\,\,*_{\R W\R}\,\,\varepsilon_j^W\,\,\,=\,\,\,A_{j\|i}$.
\end{thm}

\begin{proof}
Let $x\,\,:=\,\,A\,\,*_{\R VW}\,\,\varepsilon_i^V$.
Want: $x\,\,*_{\R W\R}\,\,\varepsilon_j^W\,\,=\,\,A_{j\|i}$.
We have:\\
\phx\quad $\ds{x\,\,*_{\R W\R}\,\,\varepsilon_j^W\quad=\quad(x\,\,*_{\R W\R}\,\,\varepsilon_j^W)_{\emptyset\|\emptyset}\quad=\quad\sum_{k\in\scri_W}\,(x_{\emptyset\|k})\,\cdot\,(\varepsilon_j^W)_{k\|\emptyset}}$\\
\phantom{xx}\quad\quad $\ds{=\quad\sum_{k\in\scri_W}\,x_k\,\cdot\,(\varepsilon_j^W)_k\quad=\quad(\,x_j\,\cdot\,(\varepsilon_j^W)_j\,)\,+\,0\,\,\,=\,\,\,x_j\,\,\,=\,\,\,x_{j\|\emptyset}}$\\
\phantom{xx}\quad\quad $\ds{=\quad(A\,\,*_{\R VW}\,\,\varepsilon_i^V)_{j\|\emptyset}\quad=\quad\sum_{\ell\in\scri_V}\,\,(\,A_{j\|\ell}\,)\,\,\cdot\,\,(\,(\varepsilon_i^V)_{\ell\|\emptyset}\,)}$\\
\phantom{xx}\quad\quad $\ds{=\quad\sum_{\ell\in\scri_V}\,\,(\,A_{j\|\ell}\,)\,\,\cdot\,\,(\,(\varepsilon_i^V)_\ell\,)\quad=\quad(\,(\,A_{j\|i}\,)\,\,\cdot\,\,(\,(\varepsilon_i^V)_i\,)\,)\,\,+\,\,0}$\\
\phantom{xx}\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad $\ds{=\quad A_{j\|i}}$, \qquad as desired.
\end{proof}

We reviewed \tref{thm-linear-at-x-is-tensor-times-x}.

\begin{thm}\wrlab{thm-partial-from-prime-deriv-function-form}
Let $S,T\in\TNSR^+$, $f:S\drta T$, $v\in S$.\\
Define $L\in\scrl_{T\otimes S}^T$ by: $L_A\,\,=\,\,A\,*_{\R ST}\,v$. \quad
Then $\partial_v^{ST}f\,\,\supseteq\,\,L\circ(f')$.
\end{thm}

\begin{proof}
Want: $\forall x\in S$, $(\partial_v^{ST}f)_x\,\,=^*\,\,(L\circ(f'))_x$.\\
Given $x\in S$. \qquad
Want: $(\partial_v^{ST}f)_x\,\,=^*\,\,(L\circ(f'))_x$.\\
By HW\#9-2, \quad $(\partial_v^{ST}f)_x\,\,=^*\,\,(f'_x)\,\,*_{\R ST}\,\,v$.\\
Then $(\partial_v^{ST}f)_x\,\,=^*\,\,(f'_x)\,\,*_{\R ST}\,\,v\,\,=\,\,L(f'_x)\,\,=\,\,(L\circ(f'))_x$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-partial-from-prime-deriv-function-domain}
Let $S,T\in\TNSR^+$, $f:S\drta T$, $v\in S$.\\
\phx\qquad\qquad\qquad\qquad Then $\dom[f']\subseteq\dom[\partial_v^{ST}f]$.
\end{thm}

\begin{proof}
We have $\im[f']\subseteq T\otimes S=\dom[L]$, so $\dom[L\circ(f')]=\dom[f']$.\\
By \tref{thm-partial-from-prime-deriv-function-form},
$\partial_v^{ST}f\,\,\supseteq\,\,L\circ(f')$, so $\dom[\partial_v^{ST}f]\,\,\supseteq\,\,\dom[L\circ(f')]$.\\
Then $\dom[f']\,\,=\,\,\dom[L\circ(f')]\,\,\subseteq\,\,\dom[\partial_v^{ST}f]$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-deriv-linear-has-same-dom-as-linear}
Let $V,W\in\TNSR^+$, $L\in\scrl_V^W$.\\
\phx\qquad\qquad\qquad\qquad Then $V=\dom[L']$.
\end{thm}

\begin{proof}
Since $L:V\to W$ we get $L:V\drta W\otimes V$, and so $\dom[L']\subseteq V$.\\
Want: $V\subseteq\dom[L']$. \quad
Want: $\forall x\in V$, $x\in\dom[L']$.\\
Given $x\in V$. \qquad
Want $x\in\dom[L']$.\\
Since $L\in\scrl_V^W$, we get $\sl_L^{VW}\in W\otimes V$.\\
By HW\#6-4, $D_xL=L$, and so $L'_x=\sl_L^{VW}$.\\
Then $L'_x=\sl_L^{VW}\in W\otimes V$, and so $L'_x\ne\frownie$, and so $x\in\dom[L']$.
\end{proof}

\begin{thm}\wrlab{thm-second-total-dom-in-first-total-of-directional-dom}
Let $S,T\in\TNSR^+$, $v\in S$, $f:S\drta T$.\\
\phx\qquad\qquad\qquad\qquad Then $\dom[f'']\subseteq\dom[(\partial_v^{ST}f)']$.
\end{thm}

\begin{proof}
Define $L\in\scrl_{T\otimes S}^T$ by: $L_A\,\,=\,\,A\,*_{\R ST}\,v$.\\
By \tref{thm-partial-from-prime-deriv-function-form}, $\partial_v^{ST}f\,\,\supseteq\,\,L\circ(f')$.\\
Let $g:=f'$. \qquad
Then $\partial_v^{ST}f\,\,\supseteq\,\,L\circ g$.\\
Then $(\partial_v^{ST}f)'\,\,\supseteq\,\,(L\circ g)'$, so $\dom[(\partial_v^{ST}f)']\,\,\supseteq\,\,\dom[(L\circ g)']$.\\
Want: $\forall x\in\dom[f'']$, $x\in\dom[(\partial_v^{ST}f)']$.\\
Given $x\in\dom[f'']$. \qquad
Want: $x\in\dom[(\partial_v^{ST}f)']$.\\
Since $\dom[(L\circ g)']\,\,\subseteq\,\,\dom[(\partial_v^{ST}f)']$,\\
\phx\qquad it suffices to show: $x\in\dom[(L\circ g)']$.\\
By \tref{thm-faadibruno-derivative-theorem-domains}, it suffices to show: $(\,\,x\in\dom[g']\,\,)\,\,\&\,\,(\,\,g_x\in\dom[L']\,\,)$.\\
We have $x\in\dom[f'']=\dom[g']$. \qquad
Want: $g_x\in\dom[L']$.\\
Since $x\in\dom[g']\subseteq\dom[g]$, we get $g_x\in\im[g]$.\\
Since $f:S\drta T$, we see that $f':S\drta T\otimes S$, and so $\im[f']\subseteq T\otimes S$.\\
Since $L\in\scrl_{T\otimes S}^T$, we conclude, by \tref{thm-deriv-linear-has-same-dom-as-linear}, that $\dom[L']=T\otimes S$.\\
Then $g_x\in\im[g]=\im[f']\subseteq T\otimes S=\dom[L']$, as desired.
\end{proof}

\section{Some basic properties of directional derivatives}

\begin{thm}
Let $V,W\in\TNSR^+$, $f,g:V\drta W$, $u\in V$.\\
Then $\partial_u^{VW}(f+g)\supseteq(\partial_u^{VW}f)+(\partial_u^{VW}g)$.
\end{thm}

\begin{proof}
Want: $\forall x\in V$, $(\partial_u^{VW}(f+g))_x\,\,=^*\,\,((\partial_u^{VW}f)+(\partial_u^{VW}g))_x$.\\
Given $x\in V$. \qquad
Want: $(\partial_u^{VW}(f+g))_x\,\,=^*\,\,((\partial_u^{VW}f)+(\partial_u^{VW}g))_x$.\\
Let \qquad $\phi:=f\circ(i_x^u)$ \qquad and let \qquad $\psi:=g\circ(i_x^u)$.\\
Then \qquad $\phi'_0=(\partial_u^{VW}f)_x$ \qquad and \qquad $\psi'_0=(\partial_u^{VW}g)_x$.\\
Also, since $\phi+\psi=(f\circ(i_x^u))+(g\circ(i_x^u))=(f+g)\circ(i_x^u)$,\\
\phx\qquad\qquad\qquad we get $(\phi+\psi)'_0=(\partial_u^{VW}(f+g))_x$.\\
By \tref{thm-deriv-distribs-over-addn}, we have $(\phi+\psi)'_0\,\,=^*\,\,\phi'_0\,\,+\,\,\psi'_0$.\\
Then $(\partial_u^{VW}(f+g))_x\,\,=\,\,(\phi+\psi)'_0\,\,=^*\,\,\phi'_0\,\,+\,\,\psi'_0$\\
\phx\qquad\qquad\qquad\qquad\quad $=\,\,((\partial_u^{VW}f)+(\partial_u^{VW}g))_x$, as desired.
\end{proof}

\begin{thm}
Let $V,W\in\TNSR^+$, $c\in\R$, $f:V\drta W$, $u\in V$.\\
Then $\partial_u^{VW}(c\cdot f)\supseteq c\cdot(\partial_u^{VW}f)$.
\end{thm}

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

\begin{thm}
Let $V:=\R^2$, $W:=\R$, $C\in\scrc_V^W$.\\
Then: \qquad $\partial_1^{VW}C\quad=\quad\partial_2^{VW}C\quad=\quad\bfzero_V^W$.
\end{thm}

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

\begin{thm}
Let $V:=\R^2$, $W:=\R$, $\lambda,\mu\in\R$.\\
Define $L\in\scrl_V^W$ by $L(x,y)=(\lambda,\mu)\,\,\sbullet_V\,\,(x,y)$.\\
Then: \qquad $(\,\,\partial_1^{VW}L\,\,=\,\,C_V^\lambda\,\,)\qquad\&\qquad(\,\,\partial_2^{VW}L\,\,=\,\,C_V^\mu\,\,)$.
\end{thm}

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

\begin{thm}
Let $V:=\R^2$, $W:=\R$, $\alpha,\gamma,\delta\in\R$.\\
Define $Q\in\scrq_V^W$ by $\ds{Q(x,y)=\left[\begin{array}{cc}\alpha&\gamma\\ \gamma&\delta\end{array}\right]\,\,\,\,\sbullet_{V\otimes V}\,\,\,\,((x,y)^{\otimes2})}$.\\
Then, $\forall x,y\in\R$, we have:\\
\phx\qquad\qquad $(\partial_1^{VW}Q)(x,y)\,\,=\,\,2\alpha x\,+\,2\gamma y$ \qquad\qquad and\\
\phx\qquad\qquad $(\partial_2^{VW}Q)(x,y)\,\,=\,\,2\gamma x\,+\,2\delta y$.
\end{thm}

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

\begin{defn}
Let $V\in\TNSR^+$, $f:\R\to V$.\\
Then $\partial_\emptyset^{\R V}f:=f'$.
\end{defn}

We paraphrase HW\#9-2:\\
Let $V,W\in\TNSR^+$, $f:V\drta W$, $u\in V$.\\
Then: \qquad\qquad\qquad\qquad $\!\!\partial_u^{VW}f\,\,\,\,\,\supseteq\,\,\,\,f'\,\,*_{\R VW}\,\,u$,\\
\phx\qquad {\it i.e.}, $\forall p\in V$, \qquad $(\partial_u^{VW}f)_p\,\,=^*\,\,f'_p\,\,*_{\R VW}\,\,u$.

\begin{thm}\wrlab{thm-formula-for-bilin-on-xy}
Let $V,W,Z\in\TNSR^+$.\\
Let $A\in Z\otimes V\otimes W$, \quad $x\in V$, \quad $y\in W$.\\
Then: \qquad\qquad $\Bilin_A^{VWZ}(x,y)\,\,=\,\,A\,\,*_{\R,V\otimes W,Z}\,\,(x\otimes y)$.
\end{thm}

\begin{proof}
Let $B:=\Bilin_A^{VWZ}$. \qquad
Then $B\in\scrb_{VW}^Z$ and $[B]_{VW}^Z=A$.\\
Let $*\,\,:=\,\,*_{\R,V\otimes W,Z}$. \qquad
Then $*\in\scrb_{Z\otimes V\otimes W,V\otimes W}^Z$.\\
We have: $\forall i\in\scri_V$, $\forall j\in\scri_W$, $\forall k\in\scri_Z$,\\
\phx\qquad $A_{k\|i\|j}=([B]_{VW}^Z)_{k\|i\|j}=\pi_k^Z(B(\varepsilon_i^V,\varepsilon_j^W))=(B(\varepsilon_i^V,\varepsilon_j^W))_k$.\\
Want: \qquad\qquad $\Bilin_A^{VWZ}(x,y)\,\,=\,\,A\,\,*\,\,(x\otimes y)$.\\
Want: $\forall k\in\scri_Z$, \quad $(\,\Bilin_A^{VWZ}(x,y)\,)_k\,\,=\,\,(\,A\,\,*\,\,(x\otimes y)\,)_k$.\\
Given $k\in\scri_Z$. \quad
Want: $(\,\Bilin_A^{VWZ}(x,y)\,)_k\,\,=\,\,(\,A\,\,*_{\R,V\otimes W,Z}\,\,(x\otimes y)\,)_k$.\\
We calculate: $\Bilin_A^{VWZ}(x,y)\,\,=\,\,B(x,y)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,B\left(\,\,\sum_{i\in\scri_V}\,x_i\varepsilon_i\,\,,\,\,\sum_{i\in\scri_V}\,x_i\varepsilon_i\,\,\right)}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{i\in\scri_V}\,\sum_{i\in\scri_V}\,x_i\,\,\cdot\,\,y_j\,\,\cdot\,\,(B(\varepsilon_i^V,\varepsilon_j^W))}$\\
Then: $\ds{(\,\Bilin_A^{VWZ}(x,y)\,)_k\,\,=\,\,\sum_{i\in\scri_V}\,\sum_{i\in\scri_V}\,x_i\,\,\cdot\,\,y_j\,\,cdot\,\,(\,B(\varepsilon_i^V,\varepsilon_j^W)\,)_k}$.\\
We compute: $(\,A\,\,*\,\,(x\otimes y)\,)_k\,\,=\,\,(\,A\,\,*\,\,x\otimes y)\,\,)_{k\|\emptyset}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{\ell\in\scri_{V\otimes W}}\,A_{k\|\ell}\,\,*\,\,(x\otimes y)_{\ell\|\emptyset}}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{\ell\in\scri_{V\otimes W}}\,A_{k\|\ell}\,\,\cdot\,\,(x\otimes y)_\ell}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{i\in\scri_V}\,\sum_{j\in\scri_W}\,A_{k\|i\|j}\,\,\cdot\,\,(x\otimes y)_{i\|j}}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{i\in\scri_V}\,\sum_{j\in\scri_W}\,A_{k\|i\|j}\,\,\cdot\,\,x_i\,\,\cdot\,\,y_j}$\\
Then $\ds{(\,\Bilin_A^{VWZ}(x,y)\,)_k\,\,=\,\,\sum_{i\in\scri_V}\,\sum_{i\in\scri_V}\,x_i\,\,\cdot\,\,y_j\,\,\cdot\,\,(\,B(\varepsilon_i^V,\varepsilon_j^W)\,)_k}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{i\in\scri_V}\,\sum_{i\in\scri_V}\,x_i\,\,\cdot\,\,y_j\,\,\cdot\,\,A_{k\|i\|j}}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{i\in\scri_V}\,\sum_{i\in\scri_V}\,A_{k\|i\|j}\,\,\cdot\,\,x_i\,\,\cdot\,\,y_j}$\\
\phx\qquad\qquad\qquad\qquad\qquad $\ds{=\,\,(\,A\,\,*\,\,(x\otimes y)\,)_k}$, \qquad
as desired.
\end{proof}

\begin{thm}\wrlab{thm-components-of-deriv-are-partials}
Let $h:\R^2\drta\R$ and let $p\in\dom[h']$.\\
Then \quad (1) $(h'_p)_1=(\partial_1h)_p$ \quad and \quad (2) $(h'_p)_2=(\partial_2h)_p$.
\end{thm}

\begin{proof}
{\it Proof of (1):}\\
Let $V:=\R^2$.\\
We have $(\partial_1h)_p\,\,=^*\,\,h'_p\,\,*_{\R V\R}\,\,\varepsilon_1^V\,\,=\,\,h'_p\,\,\sbullet_V\,\,\varepsilon_1^V\,\,=\,\,(h'_p)_1\,\,\ne\,\,\frownie$.\\
Then $(h'_p)_1=(\partial_1h)_p$, as desired.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}\\
Unassigned HW.\\
{\it End of proof of (2).}
\end{proof}

\begin{thm}\wrlab{thm-all-but-21-zero-implies-lito2}
Let $V:=\R^2$ and let $W:=\R$.\\
Let $R:V\drta W$ and let $z:=0_2$. \qquad
Assume $z\in\dom[R'']$.\\
Assume $(\partial_1\partial_1R)_z=(\partial_1\partial_2R)_z=(\partial_2\partial_2R)_z=(\partial_1R)_z=(\partial_2R)_z=R_z=0$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $R\in\scrlito_2^{VW}$.
\end{thm}

\begin{proof}
Since $z\in\dom[R'']$, it follows that $R'$ is defined near $z$,\\
\phx\qquad\qquad\qquad so choose $B\in\scrb_V(z)$ s.t.~$B\subseteq\dom[R']$.\\
Since $B\in\scrb_V(z)$, choose $r>0$ s.t.~$B=B_V(z,r)$.\\
Let $\delta:=r/\sqrt{2}$, \quad $J:=(-\delta,\delta)$. \qquad\qquad
Then $J^2\subseteq B_V(z,r)$.\\
Then $J^2\subseteq B_V(z,r)=B\subseteq\dom[R']$.\\
Let $g:=\partial_1R$, \qquad $h:=\partial_2R$, \qquad $i:=i_z^{\varepsilon_1^V}$.\\
By HW\#9-3, choose $\sigma\in\scrbigo_1^{WW}$ and $\tau\in\scrbigo_1^{VV}$ s.t.\\
\phantom{xx}\qquad\qquad $f\,\,=\,\,(g\circ i\circ\sigma\circ\pi_1^V)\cdot\pi_1^V\,\,+\,\,(h\circ\tau)\cdot\pi_2^V$ \qquad near $z$.\\
Define $*\in\scrb_{WW}^W$ by $a*b=ab$.\\
Then \quad $f\,\,=\,\,(g\circ i\circ\sigma\circ\pi_1^V)\,*\,\pi_1^V\,\,+\,\,(h\circ\tau)\,*\,\pi_2^V$ \qquad near $z$.\\
By HW\#10-5, we have: \qquad $g\circ i\in\scrlito_1^{WW}$.\\
Then \quad $g\circ i\circ\sigma\circ\pi_1^V\,\,\,\in\,\,\,\scrlito_1^{WW}\circ\scrbigo_1^{WW}\circ\scrbigo_1^{VW}\,\,\,\subseteq\,\,\,\scrlito_1^{VW}$.\\
Then \qquad $(g\circ i\circ\sigma\circ\pi_1^V)\,*\,\pi_1^V\,\,\,\in\,\,\,\scrlito_1^{VW}\,*\,\scrbigo_1^{VW}\,\,\,\subseteq\,\,\,\scrlito_2^{VW}$.\\
By \tref{thm-second-total-dom-in-first-total-of-directional-dom}, $\dom[R'']\subseteq\dom[(\partial_2R)']$.\\
Then $z\in\dom[R'']\subseteq\dom[(\partial_2R)']=\dom[h']$.\\
By \tref{thm-components-of-deriv-are-partials}, \quad $(h'_z)_1=(\partial_1h)_z$ \quad and \quad $(h'_z)_2=(\partial_2h)_z$.\\
So, since \quad $(\partial_1h)_z=(\partial_1\partial_2R)_z=0$ \quad and \quad $(\partial_2h)_z=(\partial_2\partial_2R)_z=0$,\\
\phx\qquad we conclude that \quad $(h'_z)_1=0$ \quad and \quad $(h'_z)_2=0$.\\
Also, we have $W\otimes V=\R\otimes\R^2=\R^2$.\\
Then $h'_z=(\,(h'_z)_1\,,\,(h'_z)_2\,)=(0,0)=0_{\R^2}=0_{W\otimes V}$.\\
So, since $h_z=(\partial_2R)_z=0=0_W$, by HW\#8-1, we get: \quad $h\in\scrlito_1^{VW}$.\\
Then \quad $h\circ\tau\,\,\,\in\,\,\,\scrlito_1^{VW}\circ\scrbigo_1^{VV}\,\,\,\subseteq\,\,\,\scrlito_1^{VW}$.\\
Also, \qquad $(h\circ\tau)\,*\,\pi_2^V\,\,\,\in\,\,\,\scrlito_1^{VW}\,*\,\scrbigo_1^{VW}\,\,\,\subseteq\,\,\,\scrlito_2^{VW}$.\\
So, since \qquad\quad\quad $\,\,\,(g\circ i\circ\sigma\circ\pi_1^V)\,*\,\pi_1^V\,\,\,\in\,\,\,\scrlito_2^{VW}$,\\
\phx\qquad we get: \quad\quad $\,\,\,\,(g\circ i\circ\sigma\circ\pi_1^V)\,*\,\pi_1^V\,\,+\,\,(h\circ\tau)\,*\,\pi_2^V\,\,\,\in\,\,\,\scrlito_2^{VW}$.\\
So, since \qquad $f\,\,=\,\,(g\circ i\circ\sigma\circ\pi_1^V)\,*\,\pi_1^V\,\,+\,\,(h\circ\tau)\,*\,\pi_2^V$ \qquad near $z$,\\
\phx\qquad\qquad we conclude that \qquad $f\in\scrlito_2^{VW}$, \qquad as desired.
\end{proof}

\begin{thm}\wrlab{thm-all-but-12-zero-implies-lito2}
Let $V:=\R^2$ and let $W:=\R$.\\
Let $S:V\drta W$ and let $z:=0_2$. \qquad
Assume $z\in\dom[S'']$.\\
Assume $(\partial_1\partial_1S)_z=(\partial_2\partial_1S)_z=(\partial_2\partial_2S)_z=(\partial_1S)_z=(\partial_2S)_z=S_z=0$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $S\in\scrlito_2^{VW}$.
\end{thm}

\begin{proof}
Define $L\in\scrl_V^V$ by $L(x,y)=(y,x)$ \quad
Then $L\circ L=\id_V$.\\
Let $R:=S\circ L$. \qquad
Then, for all $x,y\in\R$, we have $R(x,y)=S(y,x)$.\\
Unassigned HW: Show:\\
\phx\qquad $(\partial_1\partial_1R)_z=(\partial_1\partial_2R)_z=(\partial_2\partial_2R)_z=(\partial_1R)_z=(\partial_2R)_z=r_z=0$.\\
Then, by \tref{thm-all-but-21-zero-implies-lito2}, we have $R\in\scrlito_2^{VW}$.\\
Also, \quad $R\circ L=S\circ L\circ L=S\circ\id_V=S$ \quad and \quad $L\in\scrl_V^V\subseteq\scrbigo_1^{VV}$.\\
Then $S=R\circ L\in\scrlito_2^{VW}\circ\scrbigo_1^{VV}=\scrlito_2^{VW}$, as desired.
\end{proof}

\section{Directional derivatives commute with one another}

\begin{thm}\wrlab{thm-mixed-partials-agree-R2-to-R}
Let $V:=\R^2$, $\,\,$ $W:=\R$, $\,\,$ $f:V\drta W$, $\,\,$ $z:=0_2$.\\
Assume $z\in\dom[f'']$. \qquad\qquad
Then $(\partial_1\partial_2f)_z=(\partial_2\partial_1f)_z$.
\end{thm}

\begin{proof}
Let \quad $\alpha:=(\partial_1\partial_1f)_z$, \quad $\beta:=(\partial_1\partial_2f)_z$.\\
\phx\qquad $\,\,$ Let \quad $\gamma:=(\partial_2\partial_1f)_z$, \quad $\delta:=(\partial_2\partial_2f)_z$.\\
Want: $\beta=\gamma$. \qquad
Let $\lambda:=(\partial_1f)_z$, \quad $\mu:=(\partial_2f)_z$, \quad $\rho:=f_z$.\\
Define \quad $C\in\scrc_V^W$, \quad $L\in\scrl_V^W$, \quad $P,Q\in\scrq_V^W$ \quad by:\\
\phantom{xx}\qquad\qquad\qquad $C(x,y)=\rho$,\\
\phantom{xx}\qquad\qquad\qquad $L(x,y)=(\lambda,\mu)\,\,\sbullet_V\,\,(x,y)$,\\
\phantom{xx}\qquad\qquad\qquad $\ds{P(x,y)\,\,=\,\,\left[\begin{array}{cc}\alpha&\beta\\\beta&\delta\end{array}\right]\,\,\sbullet_{V\otimes V}\,\,((x,y)^{\otimes2})}$.\\
\phantom{xx}\qquad\qquad\qquad $\ds{Q(x,y)\,\,=\,\,\left[\begin{array}{cc}\alpha&\gamma\\\gamma&\delta\end{array}\right]\,\,\sbullet_{V\otimes V}\,\,((x,y)^{\otimes2})}$.\\
Let \quad $\ds{R:=f-\left(C+L+\frac{P}{2!}\right)}$ \quad and \quad $\ds{S:=f-\left(C+L+\frac{Q}{2!}\right)}$.\\
By HW\#9-5, we have:\\
\phx\quad $(\partial_1\partial_1R)_z=(\partial_1\partial_2R)_z=(\partial_2\partial_2R)_z=(\partial_1R)_z=(\partial_2R)_z=R_z=0$.\\
Then, by \tref{thm-all-but-21-zero-implies-lito2}, $R\in\scrlito_2^{VW}$.\\
Unassigned HW:\\
\phx\quad $(\partial_1\partial_1S)_z=(\partial_2\partial_1S)_z=(\partial_2\partial_2S)_z=(\partial_1S)_z=(\partial_2S)_z=S_z=0$.\\
Then, by \tref{thm-all-but-12-zero-implies-lito2}, $S\in\scrlito_2^{VW}$.\\
Since $z\in\dom[f'']\subseteq\dom[f']$, we conclude that $f$ is defined near $z$.\\
Then $f-f=\bfzero_V^W$ near $z$. \qquad
Then $\ds{R-S=-\frac{P}{2}+\frac{Q}{2}}$ near $z$.\\
Then $2\cdot(R-S)=Q-P$ near $z$.\\
Since $R,S\in\scrlito_2^{VW}$, we conclude that $2\cdot(R-S)\in\scrlito_2^{VW}$.\\
Then $Q-P\in\scrlito_2^{VW}$. \qquad
Since $Q,P\in\scrq_V^W$, we get $Q-P\in\scrq_V^W$.\\
Then $Q-P\in(\scrlito_2^{VW})\cap(\scrq_V^W)$.\\
So, since $(\scrlito_2^{VW})\cap(\scrq_V^W)=\{\bfzero_V^W\}$, it follows that $Q-P=\bfzero_V^W$.\\
Then $P=Q$, so $P(1,1)=Q(1,1)$.\\
Then $\alpha+2\beta+\delta=P(1,1)=Q(1,1)=\alpha+2\gamma+\delta$.\\
Then $2\beta=2\gamma$, and so $\beta=\gamma$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-pull-linear-out-of-primediff}
Let \quad $X,Z\in\TNSR^+$, \quad $\phi:\R\drta X$.\\
\phx\qquad Let $L\in\scrl_X^Z$, \quad $t\in\dom[\phi']$. \qquad\qquad
Then \quad $(L\circ\phi)'_t=L(\phi'_t)$.
\end{thm}

\begin{proof}
We have $(L\circ\phi)'_t\,\,=\,\,(D_t(L\circ\phi))(1)\,\,=^*\,\,((D_{\phi_t}L)\circ(D_t\phi))(1)$\\
\phx\qquad\qquad\qquad\qquad $=\,\,(L\circ(D_t\phi))(1)\,\,=\,\,L((D_t\phi)(1))\,\,=\,\,L(\phi'_t)\,\,\ne\,\,\frownie$.\\
Then $(L\circ\phi)'_t\,\,=\,\,L(\phi'_t)$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-pull-partial-past-linear}
Let $V,X,Z\in\TNSR^+$.\\
\phx\qquad Let \quad $f:V\drta X$, \quad $L\in\scrl_X^Z$, \quad $u\in V$.\\
\phx\qquad Then: \qquad $\partial_u(L\circ f)\,\,\supseteq\,\,L\,\circ\,(\partial_uf)$.
\end{thm}

\begin{proof}
Want: $\forall q\in V$, $(\partial_u(L\circ f))_q\,\,=^*\,\,(L\,\circ\,(\partial_uf))_q$.\\
Given $q\in V$. \qquad
Want: $(\partial_u(L\circ f))_q\,\,=^*\,\,(L\,\circ\,(\partial_uf))_q$.\\
Want: $(\,\,(L\,\circ\,(\partial_uf))_q\ne\frownie\,\,)\,\,\Rightarrow\,\,(\,\,(\partial_u(L\circ f))_q\,\,=\,\,(L\,\circ\,(\partial_uf))_q\,\,)$.\\
Assume $(L\,\circ\,(\partial_uf))_q\ne\frownie$. \qquad
Want: $(\partial_u(L\circ f))_q\,\,=\,\,(L\,\circ\,(\partial_uf))_q$.\\
Let \qquad $i:=i_q^u$, \qquad $\phi:f\circ i$.\\
Then \quad $(\partial_u(L\circ f))_q\,\,=\,\,(L\circ f\circ(i_q^u))'_0\,\,=\,\,(L\circ f\circ i)'_0\,\,=\,\,(L\circ\phi)'_0$.\\
Also, \quad $(\partial_uf)_q\,\,=\,\,(f\circ(i_q^u))'_0\,\,=\,\,(f\circ i)'_0\,\,=\,\,\phi'_0$. \quad
Then $\phi'_0=(\partial_uf)_q$.\\
Because $(L\,\circ\,(\partial_uf))_q\ne\frownie$, \qquad it follows that $(\partial_uf)_q\ne\frownie$.\\
Then \quad $\phi'_0\,\,=\,\,(\partial_uf)_q\,\,\ne\,\,\frownie$, \qquad\qquad and so \quad $0\in\dom[\phi']$.\\
Then, by \tref{thm-pull-linear-out-of-primediff}, we have : \qquad $(L\circ\phi)'_0\,\,=\,\,L(\phi'_0)$.\\
Then $(\partial_u(L\circ f))_q\,\,=\,\,(L\circ\phi)'_0\,\,=\,\,L(\phi'_0)$\\
\phx\qquad\qquad\qquad\quad $\,\,\,\,\,=\,\,L((\partial_uf)_q)\,\,=\,\,(L\,\circ\,(\partial_uf))_q$, \qquad as desired.
\end{proof}

\begin{thm}\wrlab{thm-two-inclusions-of-domains}
Let $S,T\in\TNSR^+$, $f:S\drta T$, $u\in S$.\\
Then \qquad (1) $\dom[f'']\subseteq\dom[(\partial_uf)']$ \qquad and\\
\phx\qquad\qquad (2) $\dom[f']\subseteq\dom[\partial_uf]$.
\end{thm}

\begin{proof}
By \tref{thm-second-total-dom-in-first-total-of-directional-dom}, (1) holds. \quad
By \tref{thm-partial-from-prime-deriv-function-domain}, (2) holds.\\
Then both (1) and (2) hold, as desired.
\end{proof}

\begin{thm}\wrlab{thm-seconderivdom-in-secondpartialdom}
Let $S,T\in\TNSR^+$, $f:S\drta T$, $u,v\in S$.\\
Then $\dom[f'']\subseteq\dom[(\partial_u\partial_vf)']$.
\end{thm}

\begin{proof}
Let $g:=\partial_vf$. \qquad
By (2) of \tref{thm-two-inclusions-of-domains}, $\dom[g']\subseteq\dom[\partial_ug]$.\\
By (1) of \tref{thm-two-inclusions-of-domains}, $\dom[f'']\subseteq\dom[(\partial_vf)']$.\\
Then $\dom[f'']\subseteq\dom[(\partial_vf)']=\dom[g']$\\
\phx\qquad\qquad\qquad $\subseteq\dom[\partial_ug]=\dom[\partial_u\partial_vf]$, \qquad as desired.
\end{proof}

\begin{thm}\wrlab{thm-partials-commute-R2-to-X}
Let $V:=\R^2$, $X\in\TNSR^+$, $f:V\drta X$, $z:=0_2$.\\
\phx\qquad\qquad Assume $z\in\dom[f'']$. \qquad
Then $(\partial_1\partial_2f)_z=(\partial_2\partial_1f)_z$.
\end{thm}

\begin{proof}
Want: $\forall j\in\scri_X$, \quad $(\,(\partial_1\partial_2f)_z\,)_j\,=\,(\,(\partial_2\partial_1f)_z\,)_j$.\\
Given $j\in\scri_X$. \qquad
Want: $(\,(\partial_1\partial_2f)_z\,)_j\,=\,(\,(\partial_2\partial_1f)_z\,)_j$.\\
\phx\qquad\qquad\qquad\qquad Want: $\pi_j^X((\partial_1\partial_2f)_z)=\pi_j^X((\partial_2\partial_1f)_z)$.\\
Let $L:=\pi_j^X$. \qquad
Want: $L((\partial_1\partial_2f)_z)=L((\partial_2\partial_1f)_z)$.\\
\\
{\it Claim 1:} $(\partial_1\partial_2(L\circ f))_z=L((\partial_1\partial_2f)_z)$.\\
{\it Proof of Claim 1:}\\
By two applications of \tref{thm-pull-partial-past-linear},
we get: $\partial_1\partial_2(L\circ f)\supseteq L\circ(\partial_1\partial_2f)$.\\
Then $(\partial_1\partial_2(L\circ f))_z\,\,=^*\,\,(L\circ(\partial_1\partial_2f))_z$.\\
By \tref{thm-seconderivdom-in-secondpartialdom}, we get $\dom[f'']\subseteq\dom[\partial_1\partial_2f]$.\\
Then $z\in\dom[f'']\subseteq\dom[\partial_1\partial_2f]$,\\
\phx\qquad so $(\partial_1\partial_2f)_z\ne\frownie$, \qquad\qquad
\phx\qquad so $L((\partial_1\partial_2f)_z)\ne\frownie$.\\
Then $(\partial_1\partial_2(L\circ f))_z\,\,=^*\,\,(L\circ(\partial_1\partial_2f))_z\,\,=\,\,L((\partial_1\partial_2f)_z)\ne\frownie$.\\
Then $(\partial_1\partial_2(L\circ f))_z=L((\partial_1\partial_2f)_z)$.\\
{\it End of proof of Claim 1.}\\
\\
{\it Claim 2:} $(\partial_2\partial_1(L\circ f))_z=L((\partial_2\partial_1f)_z)$.\\
{\it Proof of Claim 2:}\\
By two applications of \tref{thm-pull-partial-past-linear},
we get: $\partial_2\partial_1(L\circ f)\supseteq L\circ(\partial_2\partial_1f)$.\\
Then $(\partial_2\partial_1(L\circ f))_z\,\,=^*\,\,(L\circ(\partial_2\partial_1f))_z$.\\
By \tref{thm-seconderivdom-in-secondpartialdom}, we get $\dom[f'']\subseteq\dom[\partial_2\partial_1f]$.\\
Then $z\in\dom[f'']\subseteq\dom[\partial_2\partial_1f]$,\\
\phx\qquad so $(\partial_2\partial_1f)_z\ne\frownie$, \qquad\qquad
\phx\qquad so $L((\partial_2\partial_1f)_z)\ne\frownie$.\\
Then $(\partial_2\partial_1(L\circ f))_z\,\,=^*\,\,(L\circ(\partial_2\partial_1f))_z\,\,=\,\,L((\partial_2\partial_1f)_z)\ne\frownie$.\\
Then $(\partial_2\partial_1(L\circ f))_z=L((\partial_2\partial_1f)_z)$.\\
{\it End of proof of Claim 2.}\\
\\
Since $L\in\scrl_Z^\R$, we see that $\dom[L'']=X$.\\
Since $z\in\dom[f'']\subseteq\dom[f]$, we get $f_z\in\im[f]$.\\
Since $z\in\dom[f'']$ and since $f_z\in\im[f]\subseteq X=\dom[L'']$,\\
\phx\qquad we conclude, by \tref{thm-faadibruno-derivative-theorem-domains}, that $z\in\dom[(L\circ f)'']$.\\
Then, by \tref{thm-mixed-partials-agree-R2-to-R}, we have $(\partial_1\partial_2(L\circ f))_z=(\partial_2\partial_1(L\circ f))_z$.\\
By Claim 1, $(\partial_1\partial_2(L\circ f))_z=L((\partial_1\partial_2f)_z)$.\\
By Claim 2, $L((\partial_2\partial_1f)_z)=(\partial_2\partial_1(L\circ f))_z$.\\
Then $L((\partial_1\partial_2f)_z)=(\partial_1\partial_2(L\circ f))_z=(\partial_2\partial_1(L\circ f))_z=L((\partial_2\partial_1f)_z)$.
\end{proof}

\begin{defn}
Let $S\in\TNSR^+$, $q,v,w\in S$.\\
Then $j_q^{vw}:\R^2\to S$ is defined by
$j_q^{vw}(a,b)=q+av+bw$.\\
\end{defn}

\noindent
Unassigned HW: $S\in\TNSR^+$, $q,v,w\in S$.\\
Show: $\R^2=\dom[j]=\dom[j']=\dom[j'']$.

\begin{thm}\wrlab{thm-first-partials-intertwine-parametric plane}
Let \quad $S,X\in\TNSR^+$, \quad $f:S\drta X$.\\
\phx\qquad\qquad\qquad\qquad Let \quad $q,v,w\in S$, \quad $j:=j_q^{vw}$.\\
Then: (1) $\partial_1(f\circ j)=(\partial_vf)\circ j$ \qquad\qquad and\\
\phx\qquad (2) $\partial_2(f\circ j)=(\partial_wf)\circ j$.
\end{thm}

\begin{proof}
{\it Proof of (1):}\\
Unassigned HW.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}\\
Want: $\forall y\in\R^2$, $(\partial_2(f\circ j))_y=((\partial_wf)\circ j)_y$.\\
Given $y\in\R^2$. \qquad
Want: $(\partial_2(f\circ j))_y=((\partial_wf)\circ j)_y$.\\
Let $p:=j(y)$ and $e:=\varepsilon_2^V$. \qquad
Want: $(\partial_e(f\circ j))_y=(\partial_wf)_p$.\\
Want: $(f\circ j\circ(i_y^e))'_0=(f\circ(i_p^w))'_0$.\\
Want: \qquad $j\circ(i_y^e)\,\,\,\,\,=\,\qquad i_p^w$.\\
Want: $\forall t\in\R$, $(j\circ (i_y^e))(t)=(i_p^w)(t)$.\\
Given $t\in\R$. \qquad
Want: $(j\circ(i_y^e))(t)=(i_p^w)(t)$.\\
We compute $i_y^e(t)=y+te=y+t\varepsilon_2^V=(y_1,y_2)+t\cdot(0,1)=(y_1,y_2+t)$.\\
We compute $(i_p^w)(t)=p+tw$ and
$p=j(y)=j_q^{vw}(y_1,y_2)=q+y_1v+y_2w$.\\
Then $(j\circ(i_y^e))(t)\quad=\quad j((i_y^e)(t))\quad=\quad j(y_1,y_2+t)$\\
\phx\qquad\qquad\qquad\qquad $\,\,=\quad q+y_1v+(y_2+t)w$\\
\phx\qquad\qquad\qquad\qquad $\,\,=\quad q+y_1v+y_2w+tw\quad$\\
\phx\qquad\qquad\qquad\qquad $\,\,=\quad p+tw\quad=\quad(i_p^w)(t)$, \qquad\qquad as desired.\\
{\it End of proof of (2).}
\end{proof}

\begin{thm}\wrlab{thm-second-partials-intertwine-parametric plane}
Let \quad $S,X\in\TNSR^+$, \quad $f:S\drta X$.\\
\phx\qquad\qquad\qquad\qquad Let \quad $q,v,w\in S$, \quad $j:=j_q^{vw}$.\\
Then: (1) $\partial_1\partial_2(f\circ j)=(\partial_v\partial_wf)\circ j$ \qquad\qquad and\\
\phx\qquad (2) $\partial_2\partial_1(f\circ j)=(\partial_w\partial_vf)\circ j$.
\end{thm}

\begin{proof}
{\it Proof of (1):}\\
By (2) of \tref{thm-first-partials-intertwine-parametric plane}, $\partial_2(f\circ j)=(\partial_wf)\circ j$.\\
Let $g:=\partial_wf$. \qquad
Then $\partial_2(f\circ j)=g\circ j$.\\
By (1) of \tref{thm-first-partials-intertwine-parametric plane}, $\partial_1(g\circ j)=(\partial_vg)\circ j$.\\
Then $\partial_1\partial_2(f\circ j)=\partial_1(g\circ j)=(\partial_vg)\circ j=(\partial_v\partial_wg)\circ j$.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}\\
Unassigned HW.\\
{\it End of proof of (2).}
\end{proof}

\begin{thm}\wrlab{thm-partials-commute-S-to-X}
Let \quad $S,X\in\TNSR^+$, \quad $f:S\drta X$.\\
\phx\qquad\qquad\qquad\qquad Let $q\in\dom[f'']$, \quad $v,w\in S$.\\
\phx\qquad\qquad\qquad\qquad Then $(\partial_v\partial_wf)_q=(\partial_w\partial_vf)_q$.
\end{thm}

\begin{proof}
Let \quad $j:=j_q^{vw}$, \quad $z:=0_2$.\\
We have $j_z=j_{0_2}=j_{(0,0)}=q+0\cdot v+0\cdot w=q$.\\
Want: $((\partial_v\partial_wf)\circ j)_z=((\partial_w\partial_vf)\circ j)_z$.\\
Since $z\in\R^2=\dom[j'']$ and $j_z=q\in\dom[f'']$,\\
\phx\qquad it follows, from \tref{thm-faadibruno-derivative-theorem-domains}, that $z\in\dom[(f\circ j)'']$.\\
Then, by \tref{thm-partials-commute-R2-to-X}, we get: \quad $(\partial_1\partial_2(f\circ j))_z=(\partial_2\partial_1(f\circ j))_z$.\\
By \tref{thm-second-partials-intertwine-parametric plane}, we have:\\
\phx\qquad $\partial_1\partial_2(f\circ j)=(\partial_v\partial_w)\circ j$ \qquad and \qquad $\partial_2\partial_1(f\circ j)=(\partial_w\partial_v)\circ j$.\\
Then $((\partial_v\partial_wf)\circ j)_z=(\partial_1\partial_2(f\circ j))_z$\\
\phx\qquad\qquad\qquad\qquad $\,\,\,=(\partial_2\partial_1(f\circ j))_z=((\partial_w\partial_vf)\circ j)_z$, \quad as desired.
\end{proof}

\begin{thm}
Let $V:=\R^2$, $W:=\R$, $z:=0_2$.\\
Then there exists $f:V\to W$ s.t.\\
\phx\qquad (1) $\dom[f']=V$, \qquad\qquad\qquad (2) $\forall k\in\N^\times_1,\,\dom[f^{(k)}]=V_z^\times$,\\
\phx\qquad\qquad (3) $(\partial_1\partial_2f)_z=0$ \qquad and \qquad (4) $(\partial_2\partial_1f)_z=1$.
\end{thm}

\begin{proof}
Let \quad $X:=\pi_1^V$ \quad and \quad $Y:=\pi_2^V$.\\
Let \quad $S\,\,:=\,\,\{\,\,(x,y)\in\R^2~\hbox{s.t.}~2\cdot|x|\le|y|\,\,\}$.\\
Let \quad $T:\,\,=\,\,\{\,\,(x,y)\in\R^2~\hbox{s.t.}~2\cdot|y|\le|x|\,\,\}$.\\
Choose $f:V\to W$ s.t.\\
\phx\qquad (A) $\dom[f']=V$, \qquad\qquad\qquad (B) $\forall k\in\N^\times_1,\,\dom[f^{(k)}]=V_z^\times$,\\
\phx\qquad\qquad (C) $f=XY$ on $S$ \qquad and \qquad (D) $f=\bfzero_V^W$ on $T$.\\
By (A) and (B), we have (1) and (2). \qquad
Want: (3) and (4).\\
Since $\partial_2f=\bfzero_V^W$ on $\R\times\{0\}$, we get $(\partial_1\partial_2f)_z=0$, verifying (3).\\
Since $\partial_1f=Y$ on $\{0\}\times\R$, we get $(\partial_2\partial_1f)_z=1$, verifying (4).\\
Then (3) and (4) hold, as desired.
\end{proof}

\section{A higher order Chain Rule}

\begin{thm}
Let $f,g:\R\to\R$.\\
Then \quad\quad $(g\circ f)'\quad\supseteq\quad(g'\circ f)\,\cdot\,(f')$ \qquad\qquad and\\
\phx\qquad\quad\quad $(g\circ f)''\quad\supseteq\quad(g''\circ f)\,\cdot\,((f')^{\otimes2})\,\,+\,\,(g'\circ f)\,\cdot\,(f'')$.
\end{thm}

\begin{proof}
Unassigned HW.
Follows from: Chain and Product Rules.
\end{proof}

\begin{thm}\wrlab{thm-faa-di-bruno-R-to-R2-to-R}
Let $V:=\R^2$, $S:=V\otimes V$, $f:\R\to V$, $g:V\to\R$.\\
Then \quad\quad $(g\circ f)'\quad\supseteq\quad(g'\circ f)\,\sbullet_V\,(f')$ \qquad\qquad and\\
\phx\qquad\quad\quad $(g\circ f)''\quad\supseteq\quad(g''\circ f)\,\sbullet_S\,((f')^{\otimes2})\,\,+\,\,(g'\circ f)\,\sbullet_V\,(f'')$.
\end{thm}

\begin{proof}
Unassigned HW.
Follows from: Chain and Product Rules,
together with some tensor algebra.
\end{proof}

\noindent
Let $V:=\R^2$, $S:=V\otimes V$, $f:\R\to V$, $g:V\to\R$ and $p\in V$.\\
Assume that $p\in\dom[f'']$ and that $f_p\in\dom[g'']$.\\
Assume that $g$ has a ``critical point'' at $f_p$, {\it i.e.}, assume that $g'_{f_p}=0$.\\
Then, according to \tref{thm-faa-di-bruno-R-to-R2-to-R}, $(g\circ f)''_p\,\,=\,\,(g''_{f_p})\sbullet_S((f'_p)^{\otimes2})$.\\
In this situation, $(g\circ f)''_p$ does not depend on $f''_p$, only on $g''_{f_p}$ and $f'_p$.

\section{Positive definite criterion}

\begin{defn}\wrlab{defn-principal-submatrix}
Let $n\in\N$, $A\in\R^{n\times n}$, $m\in[1..n]$.\\
Then: \qquad $\PS_m(A)\,\,:=\,\,A\,|\,([1..m]^2)$.
\end{defn}

In \dref{defn-principal-submatrix}, $\PS_m(A)$ is called
the $m$th \bfindex[principal submatrix] of $A$.
Its determinant is called the
the $m$th \bfindex[principal minor] of $A$.

\begin{thm}
Let $\ds{A:=\left[\begin{array}{ccc}1&2&3\\4&5&6\\7&8&9\end{array}\right]}$.\\
Then $\PS_1(A)=[1]$ and $\ds{\PS_2(A)=\left[\begin{array}{cc}1&2\\4&5\end{array}\right]}$ and $\PS_3(A)=A$.
\end{thm}

\begin{thm}
Let $n\in\N$, $V:=\R^n$, $S:=V\otimes V$, $z:=0_n$.\\
Let $A\in S$. \qquad\qquad
Assume that $A$ is symmetric.\\
Then: \quad\quad $(\,\,\,\forall u\in V_z^\times,\,\,\Bilin_A^{VV\R}(u,u)\,>\,0\,\,\,)$\\
\phx\qquad\quad $\Leftrightarrow\,\,(\,\,\,\forall u\in V_z^\times,\,\,A\,\sbullet_S\,(u^{\otimes2})\,>\,0\,\,\,)$\\
\phx\qquad\quad $\Leftrightarrow\,\,(\,\,\,\forall m\in[1..n],\,\,\det(\PS_m(A))\,>\,0\,\,\,)$.\\
\end{thm}

That is: \qquad a symmetric matrix is positive definite \qquad iff\\
\phx\qquad\qquad\qquad $\,$ all of its principal minors are positive.

\vskip.1in
There is a similar criterion for negative definite.
However, for positive and negative semidefinite, the criteria are slightly more complicated.

\section{The second total derivative is symmetric}

\begin{thm}
Let $V,W\in\TNSR^+$, $A\in W\otimes V$, $i\in\scri_V$, $j\in\scri_W$.\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad Then $A_{j\|i}\quad=\quad(A\,\,*_{\R VW}\,\,\varepsilon_i^V)_j$.
\end{thm}

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

\begin{thm}
Let $V,W\in\TNSR^+$ and let $f:V\drta W$.\\
\phx\qquad Let $u\in V$ and let $W':=W\otimes V$.\\
\phx\qquad Then \quad $\partial_uf:V\drta W$ \quad and \quad $(\partial_uf)':V\drta W'$ \quad and\\
\phx\qquad\qquad\qquad $\,\,f':V\drta W$ \quad and \quad $\partial_u(f'):V\drta W'$.
\end{thm}

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

\begin{thm}\wrlab{thm-partial-total-is-total-partial}
Let \qquad $V,W\in\TNSR^+$, \qquad $f:V\drta W$.\\
\phx\qquad\qquad\qquad\qquad\qquad Let \qquad $p\in\dom[f'']$, \qquad $u\in V$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then: \quad $(\partial_u(f'))_p=(\partial_uf)'_p$.
\end{thm}

\begin{proof}
Let \quad $g:=f'$, \quad $h:=\partial_uf$. \qquad\qquad
Want: $(\partial_ug)_p=h'_p$.\\
Let $W':=W\otimes V$. \qquad
We have: $g:V\drta W'$ and $\partial_ug:V\drta W'$.\\
Since $p\in\dom[f'']=\dom[g']\subseteq\dom[\partial_ug]$, we get $(\partial_ug)_p\in\im[\partial_ug]$.\\
Then $(\partial_ug)_p\in\im[\partial_ug]\subseteq W'$.\\
We have: $h:V\drta W$ and $h':V\drta W'$.\\
Since $p\in\dom[f'']\subseteq\dom[(\partial_uf)']=\dom[h']$, we get $h'_p\in\im[h']$.\\
Then $h'_p\in\im[h']\subseteq W'$.\\
Want: \quad $\forall k\in\scri_{W'}$, $((\partial_ug)_p)_k=(h'_p)_k$.\\
Given $k\in\scri_{W'}$. \qquad
Want: $((\partial_ug)_p)_k=(h'_p)_k$.\\
Let $L:=\pi_k^{W'}$. \qquad
Want: $L((\partial_ug)_p)=L(h'_p)$.\\
\phx\qquad\qquad\qquad\qquad Want: $(L\circ(\partial_ug))_p=(L\circ(h'))_p$.\\
Since $\dom[L]=W'$, we get:\\
\phx\quad $\dom[\partial_ug]=\dom[L\circ(\partial_ug)]$ \quad and \quad $\dom[h']=\dom[L\circ(h')]$.\\
We have $p\in\dom[\partial_ug]=\dom[L\circ(\partial_ug)]$.\\
Also, $p\in\dom[h']=\dom[L\circ(h')]$.\\
Then $(L\circ(\partial_ug))_p\ne\frownie\ne(L\circ(h'))_p$.\\
Since $k\in\scri_{W'}=\scri_{W\otimes V}$, choose $i\in\scri_V$ and $j\in\scri_W$ s.t.~$k=j\|i$.\\
Then $L=\pi_{j\|i}^{W'}$. \qquad
Let $M:=\pi_j^W$.\\
By HW\#10-5, both $L\circ(h')\subseteq M\circ(\partial_ih)$ and $L\circ(f')\subseteq M\circ(\partial_if)$.\\
By \tref{thm-pull-partial-past-linear}, $L\circ(\partial_ug)\subseteq\partial_u(L\circ g)$.\\
By \tref{thm-pull-partial-past-linear}, $M\circ(\partial_if)\subseteq\partial_i(M\circ f)$,\\
\phx\quad and so \quad $\,\,\,\,\partial_u(M\circ(\partial_if))\subseteq\partial_u\partial_i(M\circ f)$.\\
Since $L\circ(f')\subseteq M\circ(\partial_if)$, we get $\partial_u(L\circ(f'))\subseteq\partial_u(M\circ(\partial_if))$.\\
Then $L\circ(\partial_ug)\subseteq\partial_u(L\circ g)=\partial_u(L\circ(f'))\subseteq\partial_u(M\circ(\partial_if))\subseteq\partial_u\partial_i(M\circ f)$,\\
\phx\qquad\qquad and so \qquad $\,L\circ(\partial_ug)\,\,\,\subseteq\,\,\,\partial_u\partial_i(M\circ f)$,\\
\phx\qquad\qquad and so \quad $(L\circ(\partial_ug))_p\,\,\,\,{}^*\!\!=\,\,(\partial_u\partial_i(M\circ f))_p$.\\
So, since \qquad $\,\,\,\frownie\ne(L\circ(\partial_ug))_p$,\\
\phx\quad we see that: \quad $\,\,\,\,(L\circ(\partial_ug))_p\,\,\,=\,\,\,(\partial_u\partial_i(M\circ f))_p$.\\
By \tref{thm-pull-partial-past-linear}, $M\circ(\partial_ih)\subseteq\partial_i(M\circ h)$.\\
By \tref{thm-pull-partial-past-linear}, $M\circ(\partial_uf)\subseteq\partial_u(M\circ f)$,\\
\phx\qquad and so \quad $\partial_i(M\circ(\partial_uf))\subseteq\partial_i\partial_u(M\circ f)$.\\
Then $L\circ(h')\subseteq M\circ(\partial_ih)\subseteq\partial_i(M\circ h)=\partial_i(M\circ(\partial_uf))\subseteq\partial_u\partial_u(M\circ f)$,\\
\phx\qquad\qquad and so \qquad $\,\,\,L\circ(h')\,\,\,\subseteq\,\,\,\partial_u\partial_u(M\circ f)$,\\
\phx\qquad\qquad and so \quad $\,(L\circ(h'))_p\,\,\,\,{}^*\!\!=\,\,(\partial_u\partial_i(M\circ f))_p$.\\
So, since \qquad $\,\,\,\frownie\ne(L\circ(h'))_p$,\\
\phx\quad we see that: \quad $\,\,\,\,(L\circ(h'))_p\,\,\,\,=\,\,\,(\partial_i\partial_u(M\circ f))_p$.\\
Sicne $M\in\scrl_W^\R$, we get $\dom[M'']=W$.\\
Since $p\in\dom[f'']\subseteq\dom[f]$, we get $f_p\in\im[f]$.\\
Then $f_p\in\im[f]\subseteq W=\dom[M'']$.\\
Since \quad $p\in\dom[f'']$ \quad and \quad $f_p\in\dom[M'']$,\\
\phx\qquad it follows, by \tref{thm-faadibruno-derivative-theorem-domains}, that: \quad $p\in\dom[(M\circ f)'']$.\\
Then, by \tref{thm-partials-commute-S-to-X}, we get: \quad $(\partial_u\partial_i(M\circ f))_p=(\partial_i\partial_u(M\circ f))_p$.\\
Then $(L\circ(\partial_ug))_p=(\partial_u\partial_i(M\circ f))_p=(\partial_i\partial_u(M\circ f))_p=(L\circ(h'))_p$.
\end{proof}

\begin{thm}
Let $V:=\R^2$, $W:=\R$.
$\,\,$ Then $\exists f,g:V\to W$ s.t.\\
\phx\qquad\qquad\qquad\qquad\qquad $\partial_q(f')\,\,\not\subseteq\,\,(\partial_1f)'$ \quad and \quad $(\partial_1g)'\,\,\not\subseteq\,\,\partial_1(g')$.
\end{thm}

\begin{proof}
Define $f,g:V\to W$ by $f(x,y)=y^2\cdot|x|$ and $g(x,y)=|y|$.\\
Want: \quad $\partial_q(f')\,\,\not\subseteq\,\,(\partial_1f)'$ \quad and \quad $(\partial_1g)'\,\,\not\subseteq\,\,\partial_1(g')$.\\
We have: $\forall x>0$, $\forall y\in\R$, \quad $f(x,y)=xy^2$.\\
Then: $\forall x>0$, $\forall y\in\R$, \quad $(\,(\partial_1f)(x,y)\,,\,(\partial_2f)(x,y)\,)\,=\,(\,y^2\,,\,2xy\,)$.\\
Then: $\forall x>0$, $\forall y\in\R$, \quad $f'(x,y)=(y^2,2xy)$.\\
Then: $\forall x>0$, \quad $f'(x,0)=(0,0)$.\\
We have: $\forall x<0$, $\forall y\in\R$, \quad $f(x,y)=-xy^2$.\\
Then: $\forall x<0$, $\forall y\in\R$, \quad $(\,(\partial_1f)(x,y)\,,\,(\partial_2f)(x,y)\,)\,=\,(\,-y^2\,,\,-2xy\,)$.\\
Then: $\forall x<0$, $\forall y\in\R$, \quad $f'(x,y)=(-y^2,-2xy)$.\\
Then: $\forall x<0$, \quad $f'(x,0)=(0,0)$.\\
We have $f=(\pi_2^V)^2\cdot|\pi_1^V|\subseteq\scrbigo_2^{VW}\cdot\scrbigo_1^{VW}\subseteq\scrbigo_3^{VW}\subseteq\scrlito_2^{VW}\subseteq\scrlito_1^{VW}$,\\
\phx\qquad and so $f'(0,0)=(0,0)$.\\
We conclude: $\forall x\in\R$, \quad $f'(x,0)=(0,0)$.\\
Then $(\partial_1(f'))(0,0)=(0,0)$, \qquad so $(0,0)\in\dom[\partial_1(f')]$.\\
We have: $\forall y\in\R_0^\times$, \quad $(\partial_1f)(0,y)=\frownie$,\\
\phx\qquad and so \qquad $\neg\,(\,\,\,\partial_1f\hbox{ is defined near }(0,0)\,\,\,)$,\\
\phx\qquad and so \qquad $(\partial_1f)'(0,0)\,\,=\,\,\frownie$,\\
\phx\qquad and so \qquad $(0,0)\,\,\notin\,\,\dom[(\partial_1f)']$.\\
Since $(0,0)\in\dom[\partial_1(f')]$ and $(0,0)\notin\dom[(\partial_1f)']$,\\
\phx\qquad we conclude that \quad $\dom[\partial_1(f')]\,\,\not\subseteq\,\,\dom[(\partial_1f)']$.\\
Then \quad $\partial_1(f')\,\,\not\subseteq\,\,(\partial_1f)'$. \qquad
Want: $(\partial_1g)'\,\,\not\subseteq\,\,\partial_1(g')$.\\
We have: $\forall x,y\in\R$, \quad $(\partial_1g)(x,y)=0$.\\
Then: $\forall x,y\in\R$, \quad $(\,\,(\partial_1\partial_1g)(x,y)\,\,\,,\,\,\,(\partial_2\partial_1g)(x,y)\,\,\,)\,\,\,=\,\,\,(\,\,\,0\,\,\,,\,\,\,0\,\,\,)$.\\
Then: $\forall x,y\in\R$, \quad $(\partial_1g)'(x,y)=(0,0)$.\\
Then: \quad $(\partial_1g)'(0,0)=(0,0)$, \qquad
and so \quad $(0,0)\in\dom[(\partial_1g)']$.\\
We have: $\forall x\in\R$, \quad $(\partial_2g)(x,0)=\frownie$.\\
Then: \quad $(\partial_2g)'(0,0)=\frownie$, \qquad
and so \quad $(0,0)\notin\dom[\partial_2g]$.\\
So, since $\dom[\partial_1(g')]\subseteq\dom[g']\subseteq\dom[\partial_2g]$,\\
\phx\qquad\qquad we get: \quad $(0,0)\notin\dom[\partial_1(g')]$.\\
Since $(0,0)\in\dom[(\partial_1g)']$ and $(0,0)\notin\dom[\partial_1(g')]$,\\
\phx\qquad we conclude that \quad $\dom[(\partial_1g)']\,\,\not\subseteq\,\,\dom[\partial_1(g')]$.\\
Then \quad $(\partial_1g)'\,\,\not\subseteq\,\,\partial_1(g')$, \quad as desired.
\end{proof}

You are not required to read through the proof of the next theorem.
You should be aware, however, that it is true.

\begin{thm}
Let \quad $V:=\R^2$, \quad $W:=\R$, \quad $z:=0_2$.\\
Then $\exists h:V\to W$ s.t. \quad $h$ is infinitely differentiable on $V^\times_z$,\\
\phx\qquad\qquad\qquad and s.t. \quad
$(\partial_1(h'))_z\,=\,(0,0)$ \quad and \quad $(\partial_1h)'\,=\,(0,1)$.
\end{thm}

\begin{proof}
Choose $\psi:\R\to\R$ infinitely differentiable s.t.\\
\phx\qquad\qquad\qquad\qquad\qquad $0\le\psi\le1$ on $\R$,\\
\phx\qquad\qquad\qquad\qquad\qquad $\psi=1$ on $[-1;1]$,\\
\phx\qquad\qquad\qquad\qquad\qquad $\psi=0$ on $\R\backslash(-2;2)$ \qquad\qquad\qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad $|\psi'|<2$ on $\R$.\\
Define $h:V\to W$ by:\\
\phx\qquad $\ds{h(x,y)=\begin{cases}
\left(\psi\left(x/\sqrt{y}\right)\right)\cdot xy,&\hbox{if }y>0,\\
\qquad 0,&\hbox{if }y=0,\\
\left(\psi\left(x/\sqrt{-y}\right)\right)\cdot xy,&\hbox{if }y<0.\\
\end{cases}}$\\
Want: \quad\quad $\,$ $h$ is infinitely differentiable on $V^\times_z$,\\
\phx\qquad and \quad $(\partial_1(h'))_z\,=\,(0,0)$ \quad and \quad $(\partial_1h)'_z\,=\,(0,1)$.\\
Let $S:=\{(x,y)~\hbox{s.t.}~|y|<x^2\}$.\\
Then $h=0$ on $S$, so $h$ is infinitely differentiable on $S$.\\
Let $X:=\pi_1^V$ and $Y:=\pi_2^V$. \quad
$\forall x,y\in\R$, $X(x,y)=x$ and $Y(x,y)=y$.\\
Let $T:=\{(x,y)\in\R^2\,|\,y>0\}$.\\
Then $\sqrt{Y}$ is infinitely differentiable on $T$.\\
So, since $h=(\psi\circ(X/\sqrt{Y}))\cdot XY$ on $T$,\\
\phx\qquad we see that $h$ is infinitely differentiable on $T$.\\
Let $U:=\{(x,y)\in\R^2\,|\,y<0\}$.\\
Then $\sqrt{-Y}$ is infinitely differentiable on $U$.\\
So, since $h=(\psi\circ(X/\sqrt{-Y}))\cdot XY$ on $U$,\\
\phx\qquad we see that $h$ is infinitely differentiable on $U$.\\
Since $h$ is infinitely differentiable on $S$, on $T$ and on $U$,\\
\phx\qquad and since $S\cup T\cup U=V_z^\times$,\\
we conclude that $h$ is infinitely differentiable on $V_z^\times$.\\
Want: \quad\quad $(\partial_1(h'))_z\,=\,(0,0)$ \quad and \quad $(\partial_1h)'_z\,=\,(0,1)$.\\
Since $h\in\scrbigo_2^{VW}\subseteq\scrlito_1^{VW}$, \qquad we see that $h'(z)=(0,0)$.\\
Let $R:=\{(x,0)\,|\,x\in\R_0^\times\}$. \qquad
Then $R\subseteq S$.\\
Since $h=0$ on $S$, \qquad we conclude that $h'=(0,0)$ on $S$.\\
So, since $R\subseteq S$, we conclude that $h'=(0,0)$ on $R$.\\
So since $h'(0,0)=h'(z)=(0,0)$,\\
\phx\qquad we conclude: $\forall x\in\R$, $h'(x,0)=(0,0)$.\\
Then $(\partial_1(h'))_z=(0,0)$. \qquad
Want: $(\partial_1h)'_z\,=\,(0,1)$.\\
Since $\sl_Y^{VW}=(0,1)$, it suffices to show: $(\partial_1h)_z^T-Y\in\scrlito_1^{VW}$.\\
We have: \qquad\qquad $\forall x\in\R$, \quad $h(x,0)=0$.\\
Then: \qquad\qquad $\forall x\in\R$, \quad $(\partial_1h)(x,0)=0$.\\
Then $(\partial_1h)_z=0$. \quad
It follows that $(\partial_1h)^T_z=\partial_1h$.\\
Want: $\partial_1h-Y\in\scrlito_1^{VW}$.\\
We have: $\forall x\in\R$, $\forall y>0$,\\
\phx\quad $(\partial_1h)(x,y)=\left(\psi'\left(x/\sqrt{y}\right)\right)\cdot\left(1/\sqrt{y}\right)\cdot xy+\left(\psi\left(x/\sqrt{y}\right)\right)\cdot y$.\\
Recall: $\forall x\in\R$, \qquad\qquad $(\partial_1h)(x,0)=0$.\\
We have: $\forall x\in\R$, $\forall y<0$,\\
\phx\quad $(\partial_1h)(x,y)=\left(\psi'\left(x/\sqrt{-y}\right)\right)\cdot\left(1/\sqrt{-y}\right)\cdot xy+\left(\psi\left(x/\sqrt{-y}\right)\right)\cdot y$.\\
Let $\eta:=\partial_1h-Y$. \qquad Want: $\eta\in\scrlito_1^{VW}$.\\
Want: \quad\qquad $\forall x,y\in\R$, \quad $|\eta(x,y)|\le2\cdot|x|\cdot\sqrt{|y|}+x^2$.\\
Recall: $\forall x\in\R$, $(\partial_1h)(x,0)=0$. \quad Also, $\forall x\in\R$, $Y(x,0)=0$.\\
Then: $\forall x\in\R$, $\eta(x,0)=0-0=0$.\\
Then: \quad\qquad $\forall x\in\R$, \quad $|\eta(x,0)|=0=2\cdot|x|\cdot\sqrt{|0|}+x^2$.\\
Want: \quad\qquad $\forall x\in\R$, $\forall y\in\R_0^\times$, \quad $|\eta(x,y)|\le2\cdot|x|\cdot\sqrt{|y|}+x^2$.\\
Given $x\in\R$, $y\in\R_0^\times$. \qquad
Want: $|\eta(x,y)|\le2\cdot|x|\cdot\sqrt{|y|}+x^2$.\\
Let $\chi:=\psi-C_V^1$.\\
Since $0\le\psi\le1$ on $\R$, \quad we conclude: $-1\le\chi\le0$ on $\R$.\\
Then $|\chi|\le1$ on $\R$.\\
We have: If $y>0$, then\\
\phx\quad $\eta(x,y)=\left(\psi'\left(x/\sqrt{y}\right)\right)\cdot x\cdot\sqrt{y}+\left(\chi\left(x/\sqrt{y}\right)\right)\cdot y$.\\
We have: If $y<0$, then\\
\phx\quad $\eta(x,y)=-\left(\psi'\left(x/\sqrt{-y}\right)\right)\cdot x\cdot \sqrt{-y}+\left(\chi\left(x/\sqrt{-y}\right)\right)\cdot y$.\\
Then $|\eta(x,y)|\le|\psi'(x,y)|\cdot|x|\cdot\sqrt{|y|}+|\chi(x/\sqrt{|y|})|\cdot|y|$.\\
Recall: $|\psi'|\le2$ on $\R$.\\
Then $|\eta(x,y)|\le2\cdot|x|\cdot\sqrt{|y|}+|\chi(x/\sqrt{|y|})|\cdot|y|$.\\
Want: $|\chi(x/\sqrt{|y|})|\cdot|y|\le x^2$.\\
Since $|\chi|\le1$ on $\R$, we see that $|\chi(x/\sqrt{|y|})|\le1$.\\
We have: If $|y|\le x^2$, then $|\chi(x/\sqrt{|y|})|\cdot|y|\le1\cdot|y|=|y|\le x^2$.\\
Also, if $|y|>x^2$, then $\sqrt{|y|}>|x|$, so $|\,x/\sqrt{|y|}\,|\,<\,1$, so $\psi(x/\sqrt{|y|})=1$,\\
\phx\qquad so $\chi(x/\sqrt{|y|})=0$, so $|\chi(x/\sqrt{|y|})|\cdot|y|=0\le x^2$.\\
Then $|\chi(x/\sqrt{|y|})|\cdot|y|\le x^2$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-fprpr-relates-to-2nd-order-dir-deriv}
Let \quad $V,W\in\TNSR^+$.\\
\phx\qquad\qquad\qquad\qquad $\,$ Let \quad $f:V\drta W$, \quad $p\in\dom[f'']$, \quad $u,v\in V$.\\
\phx\qquad\qquad\qquad\qquad $\,$ Then: \quad $\Bilin_{f''_p}^{VVW}(u,v)\,\,\,=\,\,\,(\partial_u\partial_vf)_p$.
\end{thm}

\begin{proof}
Since $p\in\dom[f'']$, we see that $f''_p\in W\otimes V\otimes V$.\\
Then $\Bilin_{f''_p}\in\scrb_{VV}^W$, so $\Bilin_{f''_p}(u,v)\in W$, so $\Bilin_{f''_p}(u,v)\ne\frownie$.\\
By \tref{thm-partial-total-is-total-partial}, $(\partial_v(f'))_p=(\partial_vf)'_p$.\\
Let \quad $g:=f'$, \quad $h:=\partial_vf$ \quad and \quad $A:=f''_p$.\\
Then $A=g'_p$ and $(\partial_vg)_p=(\partial_v(f'))_p=(\partial_vf)'_p=h'_p$.\\
By \tref{thm-formula-for-bilin-on-xy}, $\Bilin_A^{VVW}(u,v)\,\,\,=\,\,\,A\,\,*_{\R,V\otimes V,W}\,\,(u\otimes v)$.\\
By HW\#10-3, $A\,\,*_{\R,V\otimes V,W}\,\,(u\otimes v)\,\,\,=\,\,\,(A\,\,*_{\R,V,W\otimes V}\,\,v)\,\,*_{\R VW}\,\,u$\\
By HW\#9-2, $(g'_p)\,\,*_{\R,V,W\otimes V}\,\,v\,\,\,\,\,{}^*\!\!=\,\,\,(\partial_vg)_p$.\\
By HW\#9-2, $(h'_p)\,\,*_{\R VW}\,\,u\,\,\,\,\,{}^*\!\!=\,\,\,(\partial_uh)_p$.\\
We have: $\Bilin_{f''_p}^{VVW}(u,v)\,\,\,=\,\,\,\Bilin_A^{VVW}(u,v)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,\,\,=\,\,\,A\,\,*_{\R,V\otimes V,W}\,\,(u\otimes v)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,\,\,=\,\,\,(A\,\,*_{\R,V,W\otimes V}\,\,v)\,\,*_{\R VW}\,\,u$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,\,\,=\,\,\,((g'_p)\,\,*_{\R,V,W\otimes V}\,\,v)\,\,*_{\R VW}\,\,u$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,\,\,\!\!{}^*\!\!=\,\,\,(\partial_vg)_p\,\,*_{\R VW}\,\,u$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,\,\,=\,\,\,(h'_p)\,\,*_{\R VW}\,\,u$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,\,\,\!\!{}^*\!\!=\,\,\,(\partial_uh)_p$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,\,\,\,\,\,=\,\,\,(\partial_u\partial_vf)_p$.\\
So, since $\frownie\ne\Bilin_{f''_p}^{VVW}(u,v)$, we conclude that\\
\phx\qquad\qquad $\Bilin_{f''_p}^{VVW}(u,v)\,\,\,=\,\,\,(\partial_u\partial_vf)_p$, \qquad as desired.
\end{proof}

\begin{thm}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in\dom[f'']$.\\
\phx\qquad\qquad\qquad\qquad $\,$ Then \quad $\Bilin_{f''_p}^{VVW}\,\,\,\in\,\,\,\scrs\scrb_V^W$.
\end{thm}

\begin{proof}
Since $p\in\dom[f'']$, we get $f''_p\in W\otimes V\otimes V$, so $\Bilin_{f''_p}\in\scrb_{VV}^W$.\\
Want: $\forall u,v\in V$, $\Bilin_{f''_p}^{VVW}(u,v)\,\,=\,\,\Bilin_{f''_p}^{VVW}(v,u)$.\\
Given $u,v\in V$. \qquad
Want: $\Bilin_{f''_p}^{VVW}(u,v)\,\,=\,\,\Bilin_{f''_p}^{VVW}(v,u)$.\\
By \tref{thm-fprpr-relates-to-2nd-order-dir-deriv}, $\,\Bilin_{f''_p}^{VVW}(u,v)\,\,=\,\,(\partial_u\partial_vf)_p$\\
\phx\qquad\qquad and \qquad $\Bilin_{f''_p}^{VVW}(v,u)\,\,=\,\,(\partial_v\partial_uf)_p$.\\
By \tref{thm-partials-commute-S-to-X}, $(\partial_u\partial_vf)_p\,\,=\,\,(\partial_v\partial_uf)_p$.\\
Then $\Bilin_{f''_p}^{VVW}(u,v)\,\,=\,\,(\partial_u\partial_vf)_p$\\
\phx\qquad\qquad\qquad\qquad\quad $\,=\,\,(\partial_v\partial_uf)_p\,\,=\,\,\Bilin_{f''_p}^{VVW}(v,u)$, as desired.
\end{proof}

\section{Multivariable Choice Mean Value Theorem}

\begin{thm}\wrlab{thm-Eucl-MVT-choice-U-to-R}
Let $m\in\N$, $U:=\R^m$, $W:=\R$, $\phi:U\drta W$.\\
Let $\delta:=0$, $J:=(-\delta;\delta)$, $A:=J^m$. \quad
Assume $\phi_{0_V}=0_W$.\\
Assume: $\forall i\in\scri_U$, $A\subseteq\dom[\partial_i\phi]$.\\
Then: $\exists\alpha:\scri_U\to\scrbigo_1^{UU}$ s.t. \qquad
$\ds{\phi\,\,\,=\,\,\,\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i)\cdot\pi_i^U}$ \qquad on $A$.
\end{thm}

\begin{proof}
Define $S:\scri_U\times A\to2^\R$ by:\\
\phx\qquad $S_{(i,x)}\quad=\quad\{\,\,\,c\in[0|x_i]\quad\hbox{s.t.}$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\,(\phi(x_1,\ldots,x_{i-1},\,\,\,x_i\,\,\,,0,\cdots,0))$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $-\,\,\,(\phi(x_1,\ldots,x_{i-1},\,\,\,\,0\,\,\,\,,0,\cdots,0))$\\
\phx\qquad\qquad\qquad\qquad $=\quad\,\,\,\,((\partial_i\phi)(x_1,\ldots,x_{i-1},\,\,\,\,c\,\,\,\,,0,\cdots,0))\,\,\,\cdot\,\,\,x_i\,\,\,\}$.\\
By the one-variable Mean Value Theorem, we have:\\
\phx\qquad $\forall i\in\scri_U$, $\forall x\in A$, \quad $S_{(i,x)}\ne\emptyset$.\\
It follows that:
\phx\qquad $\forall i\in\scri_U$, $\forall x\in A$, \quad $\CH(S_{(i,x)})\in S_{(i,x)}$.\\
Also,  by definition of $A$,  we have:\\
\phx\qquad $\forall i\in\scri_U$, $\forall x\in A$, \quad $x_i\in J$.\\
So, since $J$ is an interval and since $0\in J$, we get:\\
\phx\qquad $\forall i\in\scri_U$, $\forall x\in A$, \quad $[0|x_i]\subseteq J$.\\
By definition of $S$, we have:
\phx\qquad $\forall i\in\scri_U$, $\forall x\in A$, \quad $S_{(i,x)}\subseteq[0|x_i]$.\\
Then: $\forall i\in\scri_U$, $\forall x\in A$, \quad $\CH(S_{(i,x)})\in S_{(i,x)}\subseteq[0|x_i]\subseteq J$.\\
Define $\alpha:\scri_U\to A^A$ by:\\
\phx\qquad $\alpha_i(x)\,\,\,=\,\,\,(x_1,\ldots,x_{i-1},\,\,\,\CH(S_{(i,x)})\,\,\,,0,\ldots,0)$.\\
We have: $\forall i\in\scri_U$, $\forall x\in A$, \quad $(\alpha_i(x))_i=\CH(S_{(i,x)})\in[0|x_i]$,\\
\phx\qquad\qquad\qquad\qquad so $|(\alpha_i(x))_i|\le|x_i|$, \qquad so $((\alpha_i(x))_i)^2\le x_i^2$.\\
Then, $\forall i\in\scri_U$, $\forall x\in A$, \quad $|\alpha_i(x)|_U^2\,\,\le\,\,|x|_U^2$.\\
Then, $\forall i\in\scri_U$, $\forall x\in A$, \quad $|\alpha_i(x)|_U\,\,\le\,\,|x|_U$.\\
Then, by HW\#9-1, we have: $\forall i\in\scri_U$, \quad $\alpha_i\in\scrbigo_1^{UU}$.\\
Then $\alpha:\scri_U\to\scrbigo_1^{UU}$. \qquad
Want: $\ds{\phi\,\,\,=\,\,\,\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i)\cdot\pi_i^U}$ \quad on $A$.
Want: $\forall x\in A$, \qquad\qquad $\ds{\phi_x\,\,\,=\,\,\,\left(\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i)\cdot\pi_i^U\right)_x}$.\\
Given $x\in A$. \qquad
Want: $\ds{\phi_x\,\,\,=\,\,\,\left(\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i)\cdot\pi_i^U\right)_x}$.\\
Want: $\ds{\phi_x\,\,\,=\,\,\,\sum_{i\in\scri_U}\,((\partial_i\phi)(\alpha_i(x)))\cdot x_i}$.\\
We compute: $\phi_x\,\,\,=\,\,\,\phi_x\,-\,0_W\,\,\,=\,\,\,\phi_x\,-\,\phi_{0_U}\,\,\,=\,\,\,(\phi(x))-(\phi(0_U)$\\
\phx\qquad\qquad $=\,\,\,(\phi(x_1,\ldots,x_m)-(\phi(0,\ldots,0))$\\
\phx\qquad\qquad $\ds{=\,\,\,\sum_{i\in\scri_U}\,\bigg(\qquad\,\,(\phi(x_1,\ldots,x_{i-1},\,\,\,\,\,\,\,\,\,x_i\,\,\,\,\,\,\,\,\,,0,\ldots,0))}$\\
\phx\qquad\qquad\qquad\qquad\quad $\ds{-\quad(\phi(x_1,\ldots,x_{i-1},\,\,\,\,\,\,\,\,\,0\,\,\,\,\,\,\,\,\,\,\,,0,\ldots,0))\qquad\bigg)}$\\
\phx\qquad\qquad $\ds{=\,\,\,\sum_{i\in\scri_U}\,\bigg(\,((\partial_i\phi)(x_1,\ldots,x_{i-1},\CH(S_{(i,x)}),0,\ldots,0))\cdot x_i\,\,\,\,\,\bigg)}$\\
\phx\qquad\qquad $\ds{=\,\,\,\sum_{i\in\scri_U}\,((\partial_i\phi)(\alpha_i(x)))\cdot x_i}$, \qquad\qquad\qquad as desired.
\end{proof}

\begin{defn}
Let $U,V\in\TNSR^+$, $\lambda:\scri_U\to\scri_V$.\\
Then $\hatlambda\in\scrl_U^V$ is defined by $\ds{\hatlambda(x)=\sum_{i\in\scri_V}\,x_i\varepsilon_i^V}$.
\end{defn}

\begin{thm}
Let $U:=\R^6$ and $V:=\R^{2\times3}$.\\
\phx\qquad\qquad\qquad Let \qquad $\ds{\lambda:=\left(\begin{array}{c}1\mapsto(1,1)\\2\mapsto(1,2)\\3\mapsto(1,3)\\4\mapsto(2,1)\\5\mapsto(2,2)\\6\mapsto(2,3)\end{array}\right)}$.\\
\phx\qquad Then, $\forall u,v,w,x,y,z\in\R$, we have: $\ds{\hatlambda(u,v,w,x,y,z)\,\,=\,\,\left[\begin{array}{ccc}u&v&w\\x&y&z\end{array}\right]}$.
\end{thm}

\begin{thm}
Let $U:=\R^6$ and $V:=\R^{2\times3}$.\\
\phx\qquad\qquad\qquad Let \qquad $\ds{\lambda:=\left(\begin{array}{c}1\mapsto(1,1)\\2\mapsto(2,1)\\3\mapsto(1,2)\\4\mapsto(2,2)\\5\mapsto(1,3)\\6\mapsto(2,3)\end{array}\right)}$.\\
\phx\qquad Then, $\forall u,v,w,x,y,z\in\R$, we have: $\ds{\hatlambda(u,v,w,x,y,z)\,\,=\,\,\left[\begin{array}{ccc}u&w&y\\v&x&z\end{array}\right]}$.
\end{thm}

\begin{thm}
Let $U,V,W\in\TNSR^+$, $\lambda:\scri_u\to\scri_V$, $\mu:\scri_V\to\scri_W$.\\
Then $\widehat{\mu\circ\lambda}=\hatmu\circ\hatlambda$.
\end{thm}

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

\begin{thm}
Let $U\in\TNSR^+$, $\lambda:=\id_{\scri_U}$. \quad
Then $\hatlambda=\id_U$.
\end{thm}

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

\begin{thm}
Let $U,V\in\TNSR^+$, $\lambda:\scri_U\to\scri_V$.\\
\phx\qquad\qquad Assume that $\lambda:\scri_U\hookrightarrow>\scri_V$.\\
\phx\qquad\qquad Then \quad $\hatlambda:U\hookrightarrow>V$ \quad and \quad $(\hatlambda)^{-1}=\widehat{(\lambda^{-1})}$.
\end{thm}

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

\begin{thm}
Let $U,V\in\TNSR^+$, $\lambda:\scri_U\to\scri_V$, $i\in\scri_U$.\\
\phx\quad Then \quad $\hatlambda(\varepsilon_i^U)=\varepsilon_{\lambda(i)}^V$. \quad
Also, \quad $\forall x\in U$, $\,\,$ $\pi_{\lambda(i)}^V(\hatlambda(x))\,=\,\pi_i^U(x)$.
\end{thm}

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

\begin{thm}
Let $U,V,W\in\TNSR^+$.\\
\phx\qquad\qquad\qquad\qquad\quad Let $L\in\scrl_U^V$, $f:V\drta W$, $x\in U$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\partial_x(f\circ L)\,\,=\,\,(\partial_{L(x)}f)\circ L$.
\end{thm}

\begin{proof}
Want: $\forall p\in U$, $(\partial_x(f\circ L))_p\,\,=\,\,((\partial_{L(x)}f)\circ L)_p$.\\
Given $p\in U$. \qquad
Want: $(\partial_x(f\circ L))_p\,\,=\,\,((\partial_{L(x)}f)\circ L)_p$.\\
We have: $(\partial_x(f\circ L))_p\,\,=\,\,(f\circ L\circ (i_p^x))'_0$.\\
Let \quad $y:=L(x)$ \quad and let \quad $q:=L(p)$.\\
Then $((\partial_{L(x)}f)\circ L)_p\,\,=\,\,((\partial_yf)\circ L)_p\,\,=\,\,(\partial_yf)_{L(p)}$\\
\phx\qquad\qquad\qquad\qquad\quad $=\,\,(\partial_yf)_q\,\,=\,\,(f\circ(i_q^y))'_0$.\\
Want: $(f\circ L\circ (i_p^x))'_0\,\,=\,\,(f\circ(i_q^y))'_0$.\\
Want:\qquad $\,\,L\circ (i_p^x)\,\,\,\,\,\,\quad=\quad\,\,\,\,\,\,i_q^y$.\\
Want: \qquad $\forall t\in\R$, \quad $(L\circ(i_p^x))(t)\,\,=\,\,(i_q^y)(t)$.\\
Given $t\in\R$. \qquad
Want: $(L\circ(i_p^x))(t)\,\,=\,\,(i_q^y)(t)$.\\
We compute: $(L\circ(i_p^x))(t)\,\,=\,\,L((i_p^x)(t))\,\,=\,\,L(p+tx)$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $\,\,=\,\,(L(p))\,+\,t\cdot(L(x))$\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $\,\,=\,\,q+ty\,\,=\,\,(i_q^y)(t)$, \qquad as desired.
\end{proof}

The following is another \bfindex[Choice MVT]:

\begin{thm}\wrlab{thm-choice-MVT-VtoR}
Let $V\in\TNSR^+$, $W:=\R$, $f:V\drta W$.\\
Assume $f_{0_V}=0_W$.\\
Assume: $\forall j\in\scri_V$, $\partial_jf$ is defined near $0_V$.\\
Then: $\exists\beta:\scri_V\to\scrlito_1^{VV}$ s.t. \qquad
$\ds{f\,\,\,=\,\,\,\sum_{j\in\scri_V}\,((\partial_jf)\circ\beta_j)\cdot\pi_j^V}$ \quad near $0_V$.
\end{thm}

\begin{proof}
Let $m:=\#\scri_V$, $U:=\R^m$. \qquad
Then $\scri_U=[1..m]$, so $\#\scri_U=m$.\\
Since $\#\scri_U=m=\#\scri_V$,
choose $\lambda:\scri_U\hookrightarrow>\scri_V$. \qquad
Let $\phi:=f\circ\hatlambda$.\\
We have: \qquad $\forall i\in\scri_U$, \quad $\hatlambda(\varepsilon_i^U)=\varepsilon_{\lambda(i)}$.\\
Then: $\forall i\in\scri_U$, \quad $\partial_i\phi\,\,=\,\,\partial_{\varepsilon_i^U}(f\circ\hatlambda)\,\,=\,\,(\partial_{\hatlambda(\varepsilon_i^U)}f)\circ\hatlambda$\\
\phx\qquad\qquad\qquad\qquad\quad $\,\,=\,\,(\partial_{\varepsilon_{\lambda(i)}^U}f)\circ\hatlambda\,\,=\,\,(\partial_{\lambda(i)}f)\circ\hatlambda$.\\
Then: $\forall i\in\scri_U$, \quad $\partial_i\phi\,\,=\,\,(\partial_{\lambda_i}f)\circ\lambda$.\\
Choose $D\in\scrb_V(0_V)$, s.t., \qquad $\forall j\in\scri_V$, $\,\,$ $D\subseteq\dom[\partial_jf]$.\\
Choose $C\in\scrb_U(0_U)$ s.t.~$\hatlambda_*(C)\subseteq D$.\\
Then, $\forall i\in\scri_U$, \quad $C\subseteq\dom[(\partial_{\lambda_i}f)\circ\lambda]=\dom[\partial_i\phi]$.\\
Choose $r>0$ s.t.~$C=B_U(0_U,r)$.\\
Let $\delta:=r/\sqrt{m}$. \qquad
Then $B_U(0_U,\delta)\subseteq(\delta;\delta)^m\subseteq B_U(0_U,r)$.\\
Let $J:=(-\delta;\delta)$, $A:=J^m$. \qquad
Then $B_U(0_U,\delta)\subseteq A\subseteq B_U(0_U,r)$.\\
Then $A\subseteq B_U(0_U,r)=A\subseteq C$.\\
Then, $\forall i\in\scri_U$, \quad $A\subseteq C\subseteq\dom[\partial_i\phi]$.\\
By \tref{thm-Eucl-MVT-choice-U-to-R}, choose $\alpha:\scri_U\to\scrbigo_1^{UU}$ s.t.\\
\phx\qquad $\ds{\phi\,\,\,=\,\,\,\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i)\cdot\pi_i^U}$ \qquad on $A$.\\
Since $\lambda:\scri_U\hookrightarrow>\scri_V$, we see that $\hatlambda:U\hookrightarrow>V$. \qquad
Let $\kappa:=\lambda^{-1}$.\\
Then $\kappa:\scri_V\hookrightarrow>\scri_U$ and $\hatkappa:V\hookrightarrow>U$ and $\hatlambda^{-1}=\hatkappa$.\\
We have $\hatkappa\in\scrl_V^U\subseteq\scrbigo_1^{VU}$ and $\hatlambda\in\scrl_U^V\subseteq\scrbigo_1^{UV}$.\\
Also, $\forall i\in\scri_U$, we have: $\alpha_i\in\scrbigo_1^{UU}$.\\
Then, $\forall i\in\scri_U$, we have: \qquad $\hatlambda\,\,\circ\,\,\alpha_i\,\,\circ\,\,\hatkappa\quad\in\quad\scrbigo_1^{VV}$.\\
Define $\beta:\scri_V\to\scrlito_1^{VV}$ by: \qquad $\beta_j\,\,=\,\,\hatlambda\,\,\circ\,\,\alpha_{\kappa_j}\,\,\circ\,\,\hatkappa$.\\
Then, $\forall i\in\scri_U$, we have: \qquad $\beta_{\lambda_i}\,\,=\,\,\hatlambda\,\,\circ\,\,\alpha_i\,\,\circ\,\,\hatkappa$.\\
Want: $\ds{f\,\,\,=\,\,\,\sum_{j\in\scri_V}\,((\partial_jf)\circ\beta_j)\cdot\pi_j^V}$ \quad near $0_V$.\\
Choose $B\in\scrb_V(0_V)$ s.t. $\hatkappa_*(B)\subseteq B_U(0_U,\delta)$.\\
Want: $\ds{f\,\,\,=\,\,\,\sum_{j\in\scri_V}\,((\partial_jf)\circ\beta_j)\cdot\pi_j^V}$ \quad on $B$.\\
Want: $\forall y\in B$, $\ds{f_y\,\,\,=\,\,\,\left(\sum_{j\in\scri_V}\,((\partial_jf)\circ\beta_j)\cdot\pi_j^V\right)_y}$.\\
Given $y\in B$. \qquad
Want: $\ds{f_y\,\,\,=\,\,\,\left(\sum_{j\in\scri_V}\,((\partial_jf)\circ\beta_j)\cdot\pi_j^V\right)_y}$.\\
Let $x:=\hatkappa_y$. \quad
Then $\hatlambda_x=y$. \quad
Then $f_y=f(\hatlambda_x)=(f\circ\lambda)_x=\phi_x$.\\
Want: $\ds{\phi_x\,\,\,=\,\,\,\left(\sum_{j\in\scri_V}\,((\partial_jf)\circ\beta_j)\cdot\pi_j^V\right)_{\hatlambda_x}}$.\\
Recall that $\lambda:\scri_U\hookrightarrow>\scri_V$.\\
Want: $\ds{\phi_x\,\,\,=\,\,\,\left(\sum_{i\in\scri_U}\,((\partial_{\lambda_i}f)\circ\beta_{\lambda_i})\cdot\pi_{\lambda_i}^V\right)_{\hatlambda_x}}$.\\
Recall: \qquad $\forall i\in\scri_U$, \quad $\beta_{\lambda_i}\,\,=\,\,\hatlambda\,\,\circ\,\,\alpha_i\,\,\circ\,\,\hatkappa$.\\
Want: $\ds{\phi_x\,\,\,=\,\,\,\left(\sum_{i\in\scri_U}\,((\partial_{\lambda_i}f)\circ\hatlambda\circ\alpha_i\circ\hatkappa)\cdot\pi_{\lambda_i}^V\right)_{\hatlambda_x}}$.\\
Recall: $\forall i\in\scri_U$, \quad $\partial_i\phi\,\,=\,\,(\partial_{\lambda_i}f)\circ\lambda$.\\
Want: $\ds{\phi_x\,\,\,=\,\,\,\left(\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i\circ\hatkappa)\cdot\pi_{\lambda_i}^V\right)_{\hatlambda_x}}$.\\
We have $\hatkappa(\hatlambda_x)=x$. \qquad
Also, $\forall i\in\scri_U$, $\pi_{\lambda_i}^V(\hatlambda_x)=\pi_i^U(x)=(\pi_i^U)_x$.\\
Want: \qquad $\ds{\phi_x\,\,\,=\,\,\,\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i)_x\cdot(\pi_i^U)_x}$.\\
Since $y\in B\subseteq V=\dom[\hatkappa]$, we get: $y\in B\cap(\dom[\hatkappa])$, so $\hatkappa_y\in\hatkappa_*(B)$.\\
Recall: \quad $x=\hatkappa_y$ \quad and \quad $B_U(0_U,\delta)\subseteq A$, \quad and \quad
$\hatkappa_*(B)\subseteq B_U(0_U,\delta)$.\\
Then $x=\hatkappa_y\in\hatkappa_*(B)\subseteq B_U(0_U,\delta)\subseteq A$.\\
Then, by choice of $\alpha$, \qquad
$\ds{\phi_x\,\,\,=\,\,\,\left(\sum_{i\in\scri_U}\,((\partial_i\phi)\circ\alpha_i)\cdot\pi_i^U\right)_x}$.\\
Then: $\ds{\phi_x\,\,\,=\,\,\,\sum_{i\in\scri_U}\,((\partial_i\phi\circ\alpha_i)_x\cdot(\pi_i^U)_x}$, \qquad as desired.
\end{proof}

\section{Functions with small derivatives are small}

\begin{thm}\wrlab{thm-continuity-by-components}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
Then: $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,\pi_m^W\circ f\hbox{ is continuous at }p\,\,)}$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\ds{\Leftrightarrow\,\,(\,\,f\hbox{ is continuous at }p\,\,)\,\,)}$\\
\end{thm}

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

\begin{thm}\wrlab{thm-much-by-components}
Let $V,W\in\TNSR^+$, $\alpha:V\drta W$.\\
Then: $\ds{(\,\,\forall q\in V,\,\,|\alpha_q-\alpha_{0_V}|_W^2\,=\,\sum_{m\in\scri_W}\,|(\pi_m^W\circ\alpha)_q-(\pi_m^W\circ\alpha)_{0_V}|^2\,\,)}$\\
\phx\qquad and \quad $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,\pi_m^W\circ\alpha\hbox{ is continuous at }0_V\,\,)}$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\ds{\Leftrightarrow\,\,(\,\,\alpha\hbox{ is continuous at }0_V\,\,)\,\,)}$\\
\phx\qquad and \quad $\ds{(\,\,\forall m\in\scri_W,\,\,\dom[\pi_m^W\circ\alpha]=\dom[\alpha]\,\,)}$\\
\phx\qquad and \quad $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,\pi_m^W\circ\alpha\in\DNZ_V^\R\,\,)\,\,\Leftrightarrow\,\,(\,\,\alpha\in\DNZ_V^W\,\,)\,\,)}$\\
\phx\qquad and \quad $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,(\pi_m^W\circ\alpha)_{0_V}=0\,\,)\,\,\Leftrightarrow\,\,(\,\,\alpha_{0_V}=0_W\,\,)\,\,)}$\\
\phx\qquad and \quad $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,\pi_m^W\circ\alpha\in\CVZ_V^\R\,\,)\,\,(\,\,\alpha\in\CVZ_V^W\,\,)\,\,)}$\\
\phx\qquad and \quad $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,\pi_m^W\circ\alpha\in\BNZ_V^\R\,\,)\,\,(\,\,\alpha\in\BNZ_V^W\,\,)\,\,)}$.
\end{thm}

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

\begin{thm}\wrlab{thm-oO-by-components}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $k\in\N_0$.\\
Then: $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,\pi_m^W\circ f\in\scrlito_k^{V\R}\,\,)\,\,\Leftrightarrow\,\,(\,\,f\in\scrlito_k^{VW}\,\,)\,\,)}$\\
\phx\qquad and \quad $\ds{(\,\,(\,\,\forall m\in\scri_W,\,\,\pi_m^W\circ f\in\scrbigo_k^{V\R}\,\,)\,\,\Leftrightarrow\,\,(\,\,f\in\scrbigo_k^{VW}\,\,)\,\,)}$.
\end{thm}

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

\begin{defn}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $S\subseteq V$.\\
\phx\qquad\qquad\qquad Then $f$ is \bfindex[infinitely differentiable] on $S$ means:\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\forall k\in\N$, $S\subseteq\dom[f^{(k)}]$.
\end{defn}

\begin{thm}
$\exists f:\R\to\R^2$ s.t.\\
\phx\qquad\qquad\qquad\qquad\quad $\,\,(\,\,f\hbox{ is infinitely differentiable on }\R\,\,)$\\
\phx\qquad\qquad\qquad\qquad $\&\,\,\,\,(\,\,f_{-1}=f_1\,\,)\,\,\,\,\&\,\,\,\,(\,\,\not\exists c\in(-1;1)~\hbox{s.t.}~f'_c=0_2\,\,)$.
\end{thm}

\begin{proof}
Define $g,h:\R\to\R$ by $g_t=t^2$, $h_t=t^3-t$.\\
Define $f:\R\to\R^2$ by $f_t=(g_t,h_t)$.\\
Want: \qquad\quad $(\,\,f\hbox{ is infinitely differentiable on }\R\,\,)$\\
\phx\qquad\qquad $\,\&\,\,\,\,(\,\,f_{-1}=f_1\,\,)\,\,\,\,\&\,\,\,\,(\,\,\not\exists c\in(-1;1)~\hbox{s.t.}~f'_c=0_2\,\,)$.\\
We compute $f_{-1}=(g_{-1},h_{-1})=(1,0)=(g_1,h_1)=f_1$.\\
Also, $\forall t\in\R$, \quad $f'_t=(2t,3t^2-1)$.\\
Also, $\forall t\in\R$, \quad $f''_t=(2,6t)$.\\
Also, $\forall t\in\R$, \quad $f'''_t=(0,6)$.\\
Also, $\forall t\in\R$, $\forall k\in[4..\infty)$, \quad $f_t^{(k)}=(0,0)$.\\
Then $f$ is infinitely differentiable.\\
Want: $\not\exists c\in(-1;1)~\hbox{s.t.}~f'_c=0_2$.\\
Assume: $\exists c\in(-1;1)~\hbox{s.t.}~f'_c=0_2$. \qquad
Want: Contradiction.\\
Choose $c\in(-1;1)~\hbox{s.t.}~f'_c=0_2$.\\
Then $(2c,3c^2-1)=f'_c=0_2=(0,0)$, so $2c=0$ and $3c^2-1=0$.\\
Since $2c=0$, we conclude that $c=0$ and so $3c^2-1=3\cdot0^2-1=-1$.\\
Then $0=3c^2-1=-1$, so $0=-1$.\\
\phx\qquad\qquad\qquad\quad However, $0\ne-1$. \quad Contradiction.
\end{proof}

\begin{thm}\wrlab{thm-bringing-linear-to-inside-extends-fn}
Let $V,W,X\in\TNSR^+$.\\
\phx\qquad Let \quad $f:V\drta W$, \quad $L\in\scrl_W^X$, \quad $j\in\scri_V$.\\
\phx\qquad Then: \qquad $\partial_j(L\circ f)\,\,\supseteq\,\,L\,\circ\,(\partial_jf)$.
\end{thm}

\begin{proof}
Let $u:=\varepsilon_j^V$. \quad
Then $\partial_j(L\circ f)=\partial_u(L\circ f)$ and $\partial_jf=\partial_uf$.\\
By \tref{thm-pull-partial-past-linear}, we have $\partial_u(L\circ f)\,\,\supseteq\,\,L\,\circ\,(\partial_uf)$.\\
Then $\partial_j(L\circ f)\,\,=\,\,\partial_u(L\circ f)\,\,\supseteq\,\,L\,\circ\,(\partial_uf)\,\,=\,\,L\,\circ\,(\partial_jf)$.
\end{proof}

\begin{thm}\wrlab{thm-partials-lito-function-lito-up-one}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $k\in\N_0$.\\
Assume $f_{0_V}=0_W$.
Assume: $\forall j\in\scri_V$, $\partial_jf\in\scrlito_k^{VW}$. \quad
Then $f\in\scrlito_{k+1}^{VW}$.
\end{thm}

\begin{proof}
By \tref{thm-oO-by-components},
it suffices to show: $\forall m\in\scri_W$, $\pi_m^W\circ f\in\scrlito_{k+1}^{V\R}$.\\
Given $m\in\scri_W$. \qquad
Want: $\pi_m^W\circ f\in\scrlito_{k+1}^{V\R}$.\\
Let $g:=\pi_m^W\circ f$. \qquad
Want: $g\in\scrlito_{k+1}^{V\R}$.\\
By \tref{thm-choice-MVT-VtoR}, choose $\beta:\scri_V\to\scrbigo_1^{VV}$ s.t.\\
\phx\qquad\qquad\qquad $\ds{g\,\,\,=\,\,\,\sum_{j\in\scri_V}\,((\partial_jg)\circ\beta_j)\cdot\pi_j^V}$ \quad near $0_V$.\\
Want: \qquad $\forall j\in\scri_V$, \qquad $((\partial_jg)\circ\beta_j)\cdot\pi_j^V\,\,\in\,\,\scrlito_{k+1}^{V\R}$.\\
Given $j\in\scri_V$. \qquad
Want: $((\partial_jg)\circ\beta_j)\cdot\pi_j^V\,\,\in\,\,\scrlito_{k+1}^{V\R}$.\\
Since $\pi_j^V\in\scrl_V^W\subseteq\scrbigo_1^{V\R}$,
it suffices to show: $(\partial_jg)\circ\beta_j\,\,\in\,\,\scrlito_k^{V\R}$.\\
So, since $\beta_j\in\scrbigo_1^{VV}$,
it suffices to show: $\partial_jg\,\,\in\,\,\scrlito_k^{V\R}$.\\
So, since $\partial_jg=\partial_j((\pi_m^W)\circ f)\supseteq\pi_m^W\circ(\partial_jf)$,\\
\phx\qquad it suffices to show: $\pi_m^W\circ(\partial_jf)\,\,\in\,\,\scrlito_k^{V\R}$.\\
By assumption, $\partial_jf\in\scrlito_k^{VW}$.\\
So, by \tref{thm-oO-by-components},
we have $\pi_m^W\circ(\partial_jf)\,\,\in\,\,\scrlito_k^{V\R}$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-2nd-partials-lito-function-lito-up-two}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $k\in\N_0$.\\
Assume $f_{0_V}=0_W$. \qquad\qquad\qquad
Assume: $\forall j\in\scri_V$, $(\partial_jf)_{0_V}=0_W$.\\
Assume: $\forall i,j\in\scri_V$, $\partial_i\partial_jf\in\scrlito_k^{VW}$. \qquad
Then $f\in\scrlito_{k+2}^{VW}$.
\end{thm}

\begin{proof}
Since $f_{0_V}=0_W$, by \tref{thm-partials-lito-function-lito-up-one},\\
\phx\qquad it suffices to show: $\forall j\in\scri_V$, $\partial_jf\in\scrlito_{k+1}^{VW}$.\\
Given $j\in\scri_V$. \qquad
Want: $\partial_jf\in\scrlito_{k+1}^{VW}$.\\
Let $g:=\partial_jf$. \qquad
Want: $g\in\scrlito_{k+1}^{VW}$.\\
Since $g_{0_V}=(\partial_jf)_{0_V}=0_W$, by \tref{thm-partials-lito-function-lito-up-one},\\
\phx\quad it suffices to show: $\forall i\in\scri_V$, $\partial_ig\in\scrlito_k^{VW}$.\\
Given $i\in\scri_V$. \qquad
Want: $\partial_ig\in\scrlito_k^{VW}$.\\
We have $\partial_ig=\partial_i\partial_jf\in\scrlito_k^{VW}$, as desired.
\end{proof}

\section{Properties of partials imply properties of function}

\begin{thm}\wrlab{thm-partial-of-trans-dbl-trans-defdnear-continat}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
Then: $\,$ (1) $\partial_j(f(p+\bullet))=(\partial_jf)(p+\bullet)$\\
\phx\quad and (2) $(\quad p\in\dom[f]\quad)\quad\Rightarrow$\\
\phx\qquad\quad\quad $\,$ $(\quad(\,\,(\partial_j(f_p^T)=(\partial_jf)(p+\bullet)\,\,)\quad\&\quad(\,\,(f_p^T)'=f'(p+\bullet)\,\,)\quad)$\\
\phx\quad and (3) $(\,\,f\hbox{ is defined near }p\,\,)\,\,\Rightarrow\,\,(\,\,f(p+\bullet)\hbox{ is defined near }0_V\,\,)$\\
\phx\quad and (4) $\,(\,\,f\hbox{ is continuous at }p\,\,)\,\,\Rightarrow\,\,(\,\,f(p+\bullet)\hbox{ is continuous at }0_V\,\,)$.
\end{thm}

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

\begin{thm}\wrlab{thm-partials-defnear-continat-deriv-defdat}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
Assume: \qquad $\forall j\in\scri_V$, \quad $\partial_jf$ is defined near $p$ and continuous at $p$.\\
\phx\qquad\qquad\qquad\quad Then $p\in\dom[f']$.
\end{thm}

\begin{proof}
Choose $i\in\scri_V$. \quad
Then $p\in\dom[\partial_if]\subseteq\dom[f]$. \quad
Let $g:=f_p^T$.\\
Then $g_{0_V}=0_W$ and $g'=f'(p+\bullet)$. \quad
Then $\dom[f']=(\dom[g'])+p$.\\
It suffices to show: $0_V\in\dom[g']$.\\
By HW\#12-5, it suffices to show:\\
\phx\qquad $\forall j\in\scri_V$, $\partial_jg$ is defined near $0_V$ and continuous at $0_V$.\\
Given $j\in\scri_V$. \qquad
Want: $\partial_jg$ is defined near $0_V$ and continuous at $0_V$.\\
Since $p\in\dom[f]$ and $g=f_p^T$, we get $\partial_jg=(\partial_jf)(p+\bullet)$.\\
Then $\dom[\partial_jg]=(\dom[\partial_jf])-p$.\\
So, since $\partial_jf$ is defined near $p$,\\
\phx\qquad we see that $\partial_jg$ is defined near $0_V$.\\
Want: $\partial_jg$ is continuous at $0_V$.\\
Since $\partial_jg=(\partial_jf)(p+\bullet)$ and since $\partial_jf$ is continuous at $p$,\\
\phx\qquad we see that $\partial_jg$ is continuous at $0_V$, as desired. \qquad
\end{proof}

\begin{defn}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\drta Y$ and let $p\in X$.\\
Then $f$ is \bfindex[continuous near] $p$ (from $X$ to $Y$) means:\\
\phx\qquad $\exists B\in\scrb_X(p)$ s.t.~$f$ is continuous on $B$ from $X$ to $Y$.
\end{defn}

\begin{thm}\wrlab{thm-totderiv-continnear-implies-partials-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
\phx\qquad\qquad\qquad\qquad\quad Assume: \quad $f'\hbox{ is continuous near }p$.\\
\phx\qquad\qquad\qquad\qquad\quad Then: \qquad $\forall j\in\scri_V,\,\,\,\partial_jf\hbox{ is continuous near }p$.
\end{thm}

\begin{proof}
Given $j\in\scri_V$. \qquad
Want: $\partial_jf\hbox{ is continuous near }p$.\\
Since $f'$ is continuous near $p$,\\
\phx\qquad choose $B\in\scrb_V(p)$ s.t.~$f'$ is continuous on $B$.\\
Want: $\partial_jf$ is continuous on $B$.\\
Want: $\forall q\in B$, $\partial_jf$ is continuous at $q$.\\
Given $q\in B$. \qquad
Want: $\partial_jf$ is continuous at $q$.\\
Define $L\in\scrl_{W\otimes V}^W$ by $L(x)=x\,*_{\R VW}\,\varepsilon_j^V$. \qquad
Then $L$ is continuous.\\
Also, $\im[f']\subseteq W\otimes V=\dom[L]$, \qquad so $\im[f']\subseteq\dom[L]$.\\
We have $\partial_jf\,\,\supseteq\,\,f'\,*_{\R VW}\,\varepsilon_j^V\,\,=\,\,L\circ(f')$, \qquad so $\partial_jf\,\,\supseteq\,\,L\circ(f')$.\\
Since $f'$ is continuous on $B$, we get: $B\subseteq\dom[f']$.\\
So, since $\im[f']\subseteq\dom[L]$,
we conclude: $B\subseteq\dom[L\circ(f')]$.\\
So, since $\partial_jf\,\,\supseteq\,\,L\circ(f')$,
we conclude: $\partial_jf\,\,=\,\,L\circ(f')$ on $B$.\\
So, since $q\in B$, by the Recentering Lemma,\\
\phx\qquad we conclude that: $\partial_jf\,\,=\,\,L\circ(f')$ near $q$.\\
It therefore suffices to show: $L\circ(f')$ is continuous at $q$.\\
Since \quad $q\in B$ \quad and since \quad $f'$ is continuous on $B$,\\
\phx\qquad it follows that: $f'$ is continuous at $q$.\\
We have $q\in B\subseteq\dom[f']$, \qquad so $f'_q\in\im[f']$.\\
Since \quad $f'_q\in\im[f']\subseteq\dom[L]$ \quad and since \quad $L$ is continuous,\\
\phx\qquad we see that: $L$ is continuous at $f'_q$.\\
So, since $f'$ is continuous at $q$,\\
\phx\qquad we get: $L\circ(f')$ is continuous at $q$, \qquad as desired.
\end{proof}

\section{Defined at total derivatives of each partial derivative}

You are not expected to know the result or the proof in this section.

It shows that definedness of the total derivative of each partial does not
guarantee definedness of the second total derivative.

\begin{thm}
Let $V:=\R^2$, $W:=\R$, $z:=0_2$.\\
Then: $\exists f:V\to W$ s.t.~$z\in\dom[(\partial_1f)']$, $z\in\dom[(\partial_2f)']$, $z\notin\dom[f'']$.
\end{thm}

\begin{proof}
Choose an infinitely differentiable function $\lambda:\R\to\R$ s.t.\\
\phx\qquad\qquad $0\le\lambda\le1$ on $\R$ \qquad\qquad\quad and \qquad $|\lambda'|\le100$ on $\R$ \qquad and\\
\phx\quad $\,\,\lambda=0$ on $(-\infty;1/2]\cup[3/2;\infty)$ \quad and \qquad $\lambda_1=1$.\\
Choose an infinitely differentiable function $\rho:\R\to\R$ s.t.\\
\phx\qquad $\,0\le\rho\le1$ on $\R$ $\,$ \qquad and \qquad $|\rho'|\le100$ on $\R$ \qquad and\\
\phx\qquad $\rho=1$ on $(-\infty;2]$ \qquad and \qquad $\rho=0$ on $[4;\infty)$.\\
Define $\eta:\R^2\to\R$ by\\
\phx\qquad $\eta(x,y)=\begin{cases}((\lambda(y/x))\cdot(\rho(x^2+y^2))\cdot x,&\hbox{if }x\ne0\\\qquad\qquad\,0,&\hbox{if }x=0.\end{cases}$\\
Then: \qquad $\forall x,y\in\R$, \quad $(\,x^2+y^2\ge4\,)\,\Rightarrow\,(\,\eta(x,y)=0\,)$.\\
Also: \qquad $\forall x\in[-1;1]$, \quad $\eta(x,x)=x$.\\
Then: \qquad $(\partial_{(1,1)}\eta)(0,0)=1$.\\
Also: \qquad $\forall x,y\in\R$, \quad $(\,y\,\notin\,[\,x/2\,|\,3x/2\,]\,)\,\Rightarrow\,(\,\eta(x,y)=0\,)$.\\
Also: \qquad $\forall y\in\R_0^\times$, \quad because $\eta=0$ near $(0,y)$,\\
\phx\qquad we conclude: $(\partial_1\eta)(x,y)=0$ and $(\partial_2\eta)(x,y)=0$.\\
Also, because $\eta=0$ on $\R\times\{0\}$, we conclude: $(\partial_1\eta)(0,0)=0$.\\
Also, because $\eta=0$ on $\{0\}\times\R$, we conclude: $(\partial_2\eta)(0,0)=0$.\\
Since $(\partial_1\eta)(0,0)=0$ and $(\partial_2\eta)(0,0)=0$ and $(\partial_{(1,1)}\eta)(0,0)=1$,\\
\phx\qquad it follows that $\eta'(z)=\frownie$, \qquad {\it i.e.}, that $z\ne\dom[\eta']$.\\
We compute: $\forall x\in\R_0^\times$, $\forall y\in\R$,\\
\phx\qquad $(\partial_1\eta)(x,y)\qquad=\qquad(\lambda'(y/x))\cdot(\rho(x^2+y^2))\cdot(-y/x)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,+\,\,\,\,(\lambda(y/x))\cdot(\rho'(x^2+y^2))\cdot(2x^2)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,+\,\,\,\,(\lambda(y/x))\cdot(\rho(x^2+y^2))\cdot(1)$ \qquad\quad and\\
\phx\qquad $(\partial_2\eta)(x,y)\qquad=\qquad(\lambda'(y/x))\cdot(\rho(x^2+y^2))\cdot(1)$\\
\phx\qquad\qquad\qquad\qquad\qquad $\,\,+\,\,\,\,(\lambda(y/x))\cdot(\rho'(x^2+y^2))\cdot(2xy)$.\\
Also: \quad $\forall x\in\R_0^\times$, $\forall y\in\R$, \quad $(\,|y/x|>3/2\,)\,\Rightarrow\,(\,\lambda(y/x)=0\,)$.\\
Then: \quad $\forall x\in\R_0^\times$, $\forall y\in\R$, \quad $(\,|y/x|>3/2\,)\,\Rightarrow\,(\,\eta(x,y)=0\,)$.\\
Then: $\forall x\in\R_0^\times$, $\forall y\in\R$,\\
\phx\qquad $(\,|y/x|>3/2\,)\,\Rightarrow\,(\,(\partial_1\eta)(x,y)=(\partial_2\eta)(x,y)=0\,)$.\\
Also: \quad $\forall x\in\R_0^\times$, $\forall y\in\R$, \quad $(\,x>2\,)\,\Rightarrow\,(\,\rho(x^2+y^2)=0\,)$.\\
Then: \quad $\forall x\in\R_0^\times$, $\forall y\in\R$, \quad $(\,x>2\,)\,\Rightarrow\,(\,\eta(x,y)=0\,)$.\\
Then: $\forall x\in\R_0^\times$, $\forall y\in\R$,\\
\phx\qquad $(\,x>2\,)\,\Rightarrow\,(\,(\partial_1\eta)(x,y)=(\partial_2\eta)(x,y)=0\,)$.\\
Also: \quad $\forall x\in\R_0^\times$, $\forall y\in\R$, \quad $(\,y>2\,)\,\Rightarrow\,(\,\rho(x^2+y^2)=0\,)$.\\
Then: \quad $\forall x\in\R_0^\times$, $\forall y\in\R$, \quad $(\,y>2\,)\,\Rightarrow\,(\,\eta(x,y)=0\,)$.\\
Then: $\forall x\in\R_0^\times$, $\forall y\in\R$,\\
\phx\qquad $(\,y>2\,)\,\Rightarrow\,(\,(\partial_1\eta)(x,y)=(\partial_2\eta)(x,y)=0\,)$.\\
It follows that: $\forall x\in\R_0^\times$, $\forall y\in\R$,\\
\phx\qquad $|(\partial_1\eta)(x,y)|\quad\le\quad100\cdot1\cdot(3/2)\,+\,1\cdot100\cdot2\cdot2^2\,+\,1\cdot1\cdot1\quad=\quad953$.\\
It also follows that: $\forall x\in\R_0^\times$, $\forall y\in\R$,\\
\phx\qquad $|(\partial_2\eta)(x,y)|\quad\le\quad100\cdot1\cdot1\,+\,1\cdot100\cdot2\cdot2\cdot2\quad=\quad900$.\\
So, since $\partial_1\eta=\partial_2\eta=0$ on $\{0\}\times\R$, we get:\\
\phx\qquad  $\forall x,y\in\R$, \qquad $|(\partial_1\eta)(x,y)|\le1000$ \quad and \quad $|(\partial_2\eta)(x,y)|\le1000$.\\
Define $q,c\in\R^\N$ by $q_i=(1/2)^i$ and $c_i=(1/100)^i$.\\
$\forall i\in\N$, define $g_i:V\to W$ by $\ds{g_i(x,y)=c_i^2\cdot\left(\eta\left(\frac{x-q_i}{c_i},\frac{y}{c_i}\right)\right)}$.\\
Then: $\forall i\in\N$, $(q_i,0)\notin\dom[g'_i]$.\\
Also: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad $\ds{|(\partial_1g)(x,y)|\,\,\le\,\,(c_i^2)\cdot\left(\frac{1}{c_i}\right)\cdot1000\,\,=\,\,1000\cdot c_i}$ \qquad\qquad and\\
\phx\qquad $\ds{|(\partial_2g)(x,y)|\,\,\le\,\,(c_i^2)\cdot\left(\frac{1}{c_i}\right)\cdot1000\,\,=\,\,1000\cdot c_i}$.\\
We have: $\forall x,y\in\R$,\\
\phx\qquad $(\,x<-2\,)\,\Rightarrow\,(\,\eta(x,y)=0\,)$.\\
Then: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad $(\,x<q_i-2c_i\,)\,\Rightarrow\,(\,g_i(x,y)=0\,)$.\\
Then: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad $(\,x<q_i-2c_i\,)\,\Rightarrow\,(\,(\partial_1g_i)(x,y)=(\partial_2g_i)(x,y)=0\,)$.\\
We have: $\forall i\in\N$, $q_{i+1}=1/(2^{i+1})<(1/2)^i-2\cdot(1/100)^i=q_i-2c_i$.\\
Then: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad $(\,|x|<q_{i+1}\,)\,\Rightarrow\,(\,x<q_{i+1}\,)\,\Rightarrow\,(\,x<q_i-2c_i\,)$\\
\phx\qquad\qquad $\Rightarrow\,(\quad(\partial_1g_i)(x,y)=(\partial_2g_i)(x,y)=0\quad)$\\
\phx\qquad\qquad $\Rightarrow\,(\quad(\,|(\partial_1g_i)(x,y)|\,\le\,1000\cdot c_i\cdot(x/q_{i+1})^2\,)\quad\&$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,(\,|(\partial_2g_i)(x,y)|\,\le\,1000\cdot c_i\cdot(x/q_{i+1})^2\,)\quad)$.\\
Also: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad $(\,|x|\ge q_{i+1}\,)\,\Rightarrow\,(\,(x/q_{i+1})^2\ge1\,)$\\
\phx\qquad\qquad $\Rightarrow\,(\quad(\,|(\partial_1g_i)(x,y)|\,\le\,1000\cdot c_i\cdot(x/q_{i+1})^2\,)\quad\&$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,(\,|(\partial_2g_i)(x,y)|\,\le\,1000\cdot c_i\cdot(x/q_{i+1})^2\,)\quad)$.\\
We conclude: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad\qquad\quad $\,\,\,(\quad(\,|(\partial_1g_i)(x,y)|\,\le\,1000\cdot c_i\cdot(x/q_{i+1})^2\,)\quad\&$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,(\,|(\partial_2g_i)(x,y)|\,\le\,1000\cdot c_i\cdot(x/q_{i+1})^2\,)\quad)$.\\
We have: $\forall i\in\N$, $c_i\cdot(1/q_{i+1})^2\,=\,(1/100)^i\cdot(2^i)^2\,=\,(4/100)^i\,<\,1$.\\
We conclude: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad\qquad\quad $\,\,\,(\quad(\,|(\partial_1g_i)(x,y)|\,\le\,1000x^2\,)\quad\&$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,(\,|(\partial_2g_i)(x,y)|\,\le\,1000x^2\,)\quad)$.\\
We have: $\forall i\in\N$, $q_{i+1}+2c_{i+1}=(1/2)^{i+1}+2\cdot(1/100)^{i+1}$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad $\,\,\,<(1/2)^i-2\cdot(1/100)^i=q_i-2c_i$.\\
$\forall i\in\N$, let $T_i:=\{(x,y)\,|\,q_i-2c_i\le x\le q_i+2c_i\}$.\\
Then: $\forall i,j\in\N$, $(\,i\ne j\,)\,\Rightarrow\,(\,T_i\cap T_j=\emptyset\,)$.\\
We have: $\forall x,y\in\R$,\\
\phx\qquad $(\,|x|>2\,)\,\Rightarrow\,(\,\eta(x,y)=0\,)$.\\
Then: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad $(\,|x-q_i|>2c_i\,)\,\Rightarrow\,(\,g_i(x,y)=0\,)$.\\
Then: $\forall i\in\N$, $\forall x,y\in\R$,\\
\phx\qquad $(\,g_i(x,y)\ne0\,)\,\Rightarrow\,(\,|x-q_i|\le2c_i\,)\,\Rightarrow\,(\,x\in T_i\,)$.\\
$\forall i\in\N$, let $S_i:=\{(x,y)\,|\,g_i(x,y)\ne0\}$.\\
Then: $\forall i\in\N$, $S_i\subseteq T_i$.\\
Recall: $\forall i,j\in\N$, $(\,i\ne j\,)\,\Rightarrow\,(\,T_i\cap T_j=\emptyset\,)$.\\
Let $f:=g_1+g_2+\cdots$.\\
Then, $\forall p\in\R^2$, $\exists i\in\N$ s.t.: \qquad $f=g_i$ near $p$.\\
Then, $\forall p\in\R^2$, $\exists i\in\N$ s.t.\\
\phx\quad $(\,f'(p)=g_i'(p)\,)\,\&\,(\,(\partial_1f)(p)=(\partial_1g_i)(p)\,)\,\&\,(\,(\partial_2f)(p)=(\partial_2g_i)(p)\,)$.\\
Then: $\forall x,y\in\R$,\\
\phx\qquad\qquad\quad $\,\,\,(\quad(\,|(\partial_1f)(x,y)|\,\le\,1000x^2\,)\quad\&$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,(\,|(\partial_2f)(x,y)|\,\le\,1000x^2\,)\quad)$.\\
Then $\partial_1f,\partial_2f\in\scrbigo_2^{VW}$.\\
Since $\partial_1f,\partial_2f\in\scrbigo_2^{VW}\subseteq\scrlito_1^{VW}$, we get: $(\partial_1f)'=z=(\partial_2f)'$.\\
Then $z\in\dom[(\partial_1f)']$ and $z\in\dom[(\partial_2f)']$. \qquad
Want: $z\notin\dom[f'']$.\\
Recall: \qquad $\forall i\in\N$, \quad $(q_i,0)\notin\dom[g'_i]$.\\
Also: \qquad $\forall i\in\N$, \quad $f=g_i$ near $(q_i,0)$.\\
Then: \qquad $\forall i\in\N$, \quad $(q_i,0)\notin\dom[f']$.\\
So, since $q_\bullet\to0$ in $\R$, we see that $f'$ is not defined near $z$.\\
Then $z\notin\dom[f'']$, as desired.
\end{proof}

\section{Partial derivative properties to total derivative properties}

\begin{thm}\wrlab{thm-from-totderiv-to-partial-derivs}
Let $V,W\in\TNSR^+$, $f:V\drta W$.\\
Let $p\in V$, $j\in\scri_V$, $k\in\scri_W$.\\
Then: $\pi_k\circ(\partial_jf)\supseteq\pi_{k\|j}\circ(f')$.
\end{thm}

\begin{proof}
Want: $\forall p\in V$, $(\pi_k\circ(\partial_jf))\,\,=^*\,\,(\pi_{k\|j}\circ(f'))_p$.\\
Given $p\in V$. \qquad
Want: $(\pi_k\circ(\partial_jf))\,\,=^*\,\,(\pi_{k\|j}\circ(f'))_p$.\\
Want: $(\,\,(\pi_{k\|j}\circ(f'))_p\ne\frownie\,\,)\,\,\Rightarrow\,\,(\,\,(\pi_k\circ(\partial_jf))=(\pi_{k\|j}\circ(f'))_p\,\,)$.\\
Assume: $(\pi_{k\|j}\circ(f'))_p\ne\frownie$. \qquad
Want: $(\pi_k\circ(\partial_jf))=(\pi_{k\|j}\circ(f'))_p$.\\
Let $*:=*_{\R VW}$. \qquad
By HW\#9-2, $(\partial_jf)_p\,\,=^*\,\,(f'_p)*(\varepsilon_j^V)$.\\
As $\pi_{k\|j}(f'_p)=(\pi_{k\|j}\circ(f'))_p\ne\frownie$, we conclude that $f'_p\ne\frownie$.\\
Then $f'_p\in\im[f']\subseteq W\otimes V$, so $(f'_p)*(\varepsilon_j^V)\in W$, so $(f'_p)*(\varepsilon_j^V)\ne\frownie$.\\
Then $(\partial_jf)_p\,\,=^*\,\,(f'_p)*(\varepsilon_j^V)\,\,\ne\,\,\frownie$,
so $(\partial_jf)_p=(f'_p)*(\varepsilon_j^V)$.\\
Then $\,(\pi_k\circ(\partial_jf))\,\,=\,\,\partial_k((\partial_jf)_p)\,\,=\,\,\pi_k((f'_p)*(\varepsilon_j^V))\,\,=\,\,((f'_p)*(\varepsilon_j^V))_k$\\
\phx\qquad\qquad\qquad\qquad $\ds{=\,\,((f'_p)*(\varepsilon_j^V))_{k\|\emptyset}\,\,=\,\,\sum_{i\in\scri_V}\,((f'_p)_{k\|i})\cdot((\varepsilon_j^V)_{i\|\emptyset})}$\\
\phx\qquad\qquad\qquad\qquad $\ds{=\,\,\sum_{i\in\scri_V}\,((f'_p)_{k\|i})\cdot((\varepsilon_j^V)_i)}$\\
\phx\qquad\qquad\qquad\qquad $\ds{=\,\,\left(((f'_p)_{k\|j})\cdot((\varepsilon_j^V)_j)\right)+\left(\sum_{i\in\scri_V\backslash\{j\}}\,((f'_p)_{k\|i})\cdot((\varepsilon_j^V)_i)\right)}$\\
\phx\qquad\qquad\qquad\qquad $\ds{=\,\,\left(((f'_p)_{k\|j})\cdot1\right)+\left(\sum_{i\in\scri_V\backslash\{j\}}\,((f'_p)_{k\|i})\cdot0\right)}$\\
\phx\qquad\qquad\qquad\qquad $=\,\,(f'_p)_{k\|j}\,\,=\,\,\pi_{k\|j}(f'_p)\,\,=\,\,(\pi_{k\|j}\circ(f'))_p$.
\end{proof}

\begin{defn}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\drta Y$, $p\in X$.\\
Then $f$ is \bfindex[bounded near $p$] (from $X$ to $Y$) means:\\
\phx\qquad $\exists B\in\scrb_X(p)$ s.t.~$f_*(B)$ is bounded in $Y$.
\end{defn}

\begin{thm}\wrlab{thm-continat-implies-bddnear}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\drta Y$, $p\in X$.\\
Assume: $f$ is continuous at $p$ from $X$ to $Y$.\\
Then: $f$ is bounded near $p$ from $X$ to $Y$.
\end{thm}

\begin{proof}
Want: $\exists B\in\scrb_X(p)$ s.t.~$f_*(B)$ is bounded in $Y$.\\
Let $C:=B_Y(f_p,1)$. \qquad
Then $C\in\scrb_Y(f_p)$.\\
So, since $f$ is continuous at $p$ from $X$ to $Y$,\\
\phx\qquad choose $B\in\scrb_X(p)$ s.t.~$f_*(B)\subseteq C$.\\
Want: $f_*(B)$ is bounded in $Y$.\\
Since $C=B_Y(f_p,1)\in\scrb_Y$ and since $f_*(B)\subseteq C$,\\
\phx\qquad it follows that $f_*(B)$ is bounded in $Y$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-totderiv-continnear-iff-partials-continnear}.
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
Then: \qquad\quad $\,(\,f'\hbox{ is continuous near }p\,)$\\
\phx\qquad\quad $\,\,\Leftrightarrow\quad(\,\forall j\in\scri_V,\,\partial_jf\hbox{ is continuous near }p\,)$.
\end{thm}

\begin{proof}
{\it Proof of $\Rightarrow$:}
This is \tref{thm-totderiv-continnear-implies-partials-continnear}.
{\it End of proof of $\Rightarrow$.}\\
\\
{\it Proof of $\Leftarrow$:}\\
Assume: $\forall j\in\scri_V,\,\partial_jf\hbox{ is continuous near }p$.\\
Want: $f'\hbox{ is continuous near }p$.\\
Choose $B\in\scrb_V(p)$ s.t.~$\forall j\in\scri_V$, $\partial_jf$ is continuous on $B$.\\
Want: $f'$ is continuous on $B$. \quad
Want: $\forall q\in B$, $f'$ is continuous at $q$.\\
Given $q\in B$. \qquad
Want: $f'$ is continuous at $q$.\\
By \tref{thm-continuity-by-components},\\
\phx\qquad we wish to show: $\forall\ell\in\scri_{W\otimes V}$, $\pi_\ell\circ(f')$ is continuous at $q$.\\
Given $\ell\in\scri_{W\otimes V}$. \qquad
Want: $\pi_\ell\circ(f')$ is continuous at $q$.\\
Since $\ell\in\scri_{W\otimes V}$, choose $j\in\scri_V$, $k\in\scri_W$ s.t.~$\ell=k\|j$.\\
Want: $\pi_{k\|j}\circ(f')$ is continuous at $q$.\\
Since $\partial_jf$ is continuous on $B$ and $q\in B$,\\
\phx\qquad we conclude that $\partial_jf$ is continuous at $q$.\\
Then, by \tref{thm-continuity-by-components}, $\pi_k\circ(\partial_jf)$ is continuous at $q$.\\
Also, by \tref{thm-from-totderiv-to-partial-derivs}, we have: $\pi_k\circ(\partial_jf)\subseteq\pi_{k\|j}\circ(f')$.\\
So, by \tref{thm-restr-maintains-continuity},\\
\phx\qquad we wish to show: $q\in\dom[\pi_{k\|j}\circ(f')]$.\\
Since $\im[f']\subseteq W\otimes V=\dom[\pi_{k\|j}]$, we get: $\dom[f']=\dom[\pi_{k\|j}\circ(f')]$.\\
We therefore wish to show: $q\in\dom[f']$.\\
By \tref{thm-partials-defnear-continat-deriv-defdat}, it suffices to show:\\
\phx\quad $\,\,\,\,\,\forall i\in\scri_V$, \qquad\qquad\quad $\,\partial_if$ is defined near $q$ and continuous at $q$.\\
Given $i\in\scri_V$. \qquad
Want: $\partial_if$ is defined near $q$ and continuous at $q$.\\
Since $\partial_if$ is continuous on $B$ and $q\in B$,\\
\phx\qquad we see that $\partial_if$ is continuous at $q$.\\
Want: $\partial_if$ is defined near $q$.\\
Since $q\in B\in\scrb_V$, by the Recentering Lemma (\tref{thm-subset-recentering}),\\
\phx\qquad choose $A\in\scrb_V(q)$ s.t.~$A\subseteq B$.\\
By the choice of $B$, we know that $\partial_if$ is continuous on $B$,\\
\phx\qquad so $B\subseteq\dom[\partial_if]$.\\
Since $A\in\scrb_V(q)$ and $A\subseteq B\subseteq\dom[\partial_if]$,\\
\phx\qquad it follows that $\partial_if$ is defined near $q$, as desired.\\
{\it End of proof of $\Leftarrow$.}
\end{proof}

\begin{thm}\wrlab{thm-partials-defdnear-continat-implies-fn-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
Assume: \qquad $\forall j\in\scri_V$, \quad $\partial_jf$ is defined near $p$ and bounded near $p$.\\
\phx\qquad\qquad\qquad\quad Then $f$ is continuous near $p$.
\end{thm}

\begin{proof}
Choose $B\in\scrb_V(p)$ s.t., $\forall j\in\scri_V$,\\
\phx\qquad\qquad $B\subseteq\dom[\partial_jf]$ \quad and \quad $(\partial_jf)_*(B)$ is bounded in $W$.\\
Want: $f$ is continuous on $B$. \qquad
Want: $\forall y\in B$, $f$ is continuous at $y$.\\
Given $y\in B$. \qquad
Want: $f$ is continuous at $y$. \qquad
Let $g:=f_y^T$.\\
Want: $g$ is continuous at $0_V$. \qquad
Want: $g\in\CVZ_V^W$.\\
Since $\scrbigo_1^{VW}\subseteq\scrlito_0^{VW}=\CVZ_V^W$, it suffices to show: $g\in\scrbigo_1^{VW}$.\\
Then, by HW\#12-3, we wish to prove: $\forall j\in\scri_V$, $\partial_jg\in\scrbigo_0^{VW}$.\\
Given $j\in\scri_V$. \qquad
Want: $\partial_jg\in\scrbigo_0^{VW}$.\\
We have $\partial_jg=\partial_j(f_y^T)=(\partial_jf)(y+\bullet)$.\\
Then $\dom[\partial_jg]=(\dom[\partial_jf])-y$. \qquad
Recall: $B\subseteq\dom[\partial_jf]$.\\
Then $B-y\subseteq(\dom[\partial_jf])-y=\dom[\partial_jg]$.\\
Because $\partial_jg=(\partial_jf)(y+\bullet)$,\\
\phx\qquad we conclude that $(\partial_jg)_*(B-y)=(\partial_jf)_*(B) $,\\
\phx\qquad so, since $(\partial_jf)_*(B)$ is bounded in $W$,\\
\phx\qquad it follows that $(\partial_jg)_*(B-y)$ is bounded in $W$.\\
Since $B\in\scrb_V$, we get: $B-y\in\scrb_V$. \quad
Also, $0_V=y-y\in B-y$.\\
As $0_V\in B-y\in\scrb_V$, by the Recentering Lemma (\tref{thm-subset-recentering}),\\
\phx\qquad choose $A\in\scrb_V(0_V)$ s.t.~$A\subseteq B$.\\
Then $A\subseteq B-y\subseteq\dom[\partial_jg]$.\\
So, as $A\in\scrb_V(0_V)$, we see that $\partial_jg$ is defined near $0_V$.\\
That is, $\partial_jg\in\DNZ_V^W$.\\
Also, $(\partial_jg)_*(A)\subseteq(\partial_jg)_*(B-y)$,\\
\phx\qquad so, since $(\partial_jg)_*(B-y)$ is bounded in $W$,\\
\phx\qquad we conclude that $(\partial_jg)_*(A)$ is bounded in $W$.\\
So, since $A\in\scrb_V(0_V)$ and since $\partial_jg\in\DNZ_V^W$,\\
\phx\qquad\qquad we see that $\partial_jg\in\BNZ_V^W$.\\
Then $\partial_jg\in\BNZ_V^W=\scrbigo_0^{VW}$, as desired.
\end{proof}

\begin{thm}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p,u\in V$.\\
Assume: $\forall k\in\scri_W$, $\partial_u(\pi_k^W\circ f)$ is defined near $p$.\\
Then $\partial_uf$ is defined near $p$.
\end{thm}

\begin{proof}
Choose $B\in\scrb_V(p)$ s.t., $\forall k\in\scri_W$, $B\subseteq\dom[\partial_u(\pi_k^W\circ f)]$.\\
Want: $B\subseteq\dom[\partial_uf]$. \qquad
Want: $\forall q\in B$, $q\in\dom[\partial_uf]$.\\
Given $q\in B$. \qquad
Want: $q\in\dom[\partial_uf]$.\\
We have: \qquad $\forall k\in\scri_W$, \quad $q\in B\subseteq\dom[\partial_u(\pi_k^W\circ f)]$.\\
Then, by HW\#13-2, we get: $q\in\dom[\partial_uf]$, as desired.
\end{proof}

Let $X$ and $Y$ be metric spaces, $f:X\drta Y$, $p\in X$.\\
Recall: If $f$ is continuous at $p$, the $p\in\dom[f]$.\\

Let $X$ and $Y$ be metric spaces, $f:X\drta Y$, $S\subseteq X$.\\
Assue $f$ is continuous on $S$. \quad Then $S\subseteq\dom[f]$.\\

\begin{thm}\wrlab{thm-partials-defdnear-continat-implies-total-continat}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
Assume: \qquad $\forall j\in\scri_V$, \quad $\partial_jf$ is defined near $p$ and continuous at $p$.\\
\phx\qquad\qquad\qquad\quad Then $f'$ is continuous at $p$.
\end{thm}

\begin{proof}
By \tref{thm-partials-defnear-continat-deriv-defdat}, we get: $p\in\dom[f']$.\\
Since $f:V\drta W$, we get $f':V\drta W\otimes V$.\\
By \tref{thm-continuity-by-components}, we wish to show:\\
\phx\qquad $\forall\ell\in\scri_W\otimes V$, \qquad $\pi_\ell\circ(f')$ is continuous at $p$.\\
Given $\ell\in\scri_W\otimes V$. \qquad
Want: $\pi_\ell\circ(f')$ is continuous at $p$.\\
Since $\ell\in\scri_W\otimes V$, choose $j\in\scri_V$, $k\in\scri_W$ s.t.~$\ell=k\|j$.\\
Since $\partial_jf$ is continuous at $p$, by \tref{thm-continuity-by-components},\\
\phx\qquad we see that $\pi_k\circ(\partial_jf)$ is continuous at $p$.\\
Also, $p\in\dom[f']\subseteq\dom[\pi_\ell\circ(f')]$.\\
By \tref{thm-from-totderiv-to-partial-derivs}, we get: \quad
$\pi_\ell\circ(f')\subseteq\pi_k\circ(\partial_jf)$.\\
So, since $p\in\dom[\pi_\ell\circ(f')]$ and since $\pi_k\circ(\partial_jf)$ is continuous at $p$,\\
\phx\qquad by \tref{thm-restr-maintains-continuity}, we get: $\pi_\ell\circ(f')$ is continuous at $p$.
\end{proof}

\begin{thm}\wrlab{thm-contin-on-ball-implies-defdnear-contat-all-its-pts}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\drta Y$, $B\in\scrb_X$, $p\in B$. \qquad
Assume: $f$ is continuous on $B$.\\
Then $f$ is defined near $p$ and continuous at $p$.
\end{thm}

\begin{proof}
Since $f$ is continuous on $B$ and $p\in B$,\\
\phx\qquad we conclude that $f$ is continuous at $p$.\\
Want: $f$ is defined near $p$.\\
By the Recentering Lemma (\tref{thm-subset-recentering}),\\
\phx\qquad choose $A\in\scrb_V(p)$ s.t.~$A\subseteq B$. \qquad\qquad
Want: $A\subseteq\dom[f]$.\\
Since $f$ is continuous on $B$, we get: $B\subseteq\dom[f]$.\\
Then $A\subseteq B\subseteq\dom[f]$, as desired.
\end{proof}

See \tref{thm-totderiv-continnear-implies-partials-continnear}
for the converse to the next result, \tref{thm-partials-continnear-implies-totalderiv-continnear}:

\begin{thm}\wrlab{thm-partials-continnear-implies-totalderiv-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $q\in V$.\\
Assume: $\forall j\in\scri_V$, $\partial_jf$ is continuous near $q$.\\
Then: $f'$ is continuous near $q$.
\end{thm}

\begin{proof}
Choose $B\in\scrb_V(q)$ s.t., $\forall j\in\scri_V$, $\partial_jf$ is continuous on $B$.\\
Want: $f'$ is continuous on $B$. \quad
Want: $\forall p\in B$, $f'$ is continuous at $p$.\\
Given $p\in B$. \qquad
Want: $f'$ is continuous at $p$.\\
By \tref{thm-contin-on-ball-implies-defdnear-contat-all-its-pts}, it suffices to show:\\
\phx\qquad $\forall j\in\scri_V$, \qquad $\partial_jf$ is defined near $p$ and continuous at $p$.\\
Given $j\in\scri_V$. \qquad
Want: $\partial_jf$ is defined near $p$ and continuous at $p$.\\
By the choice of $B$, we know that $\partial_jf$ is continuous on $B$.\\
Then, by \tref{thm-contin-on-ball-implies-defdnear-contat-all-its-pts}, $\partial_jf$ is defined near $p$ and continuous at $p$.
\end{proof}

The next result is the order two version of \tref{thm-partials-defdnear-continat-implies-fn-continnear}.

\begin{thm}\wrlab{thm-second-partials-defdnear-bddnear-implies-firsttotal-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $p\in V$.\\
Assume: \qquad $\forall i,j\in\scri_V$, \quad $\partial_i\partial_jf$ is defined near $p$ and bounded near $p$.\\
\phx\qquad\qquad\qquad\quad Then $f'$ is continuous near $p$.
\end{thm}

\begin{proof}
By \tref{thm-partials-continnear-implies-totalderiv-continnear}, it suffices to show:\\
\phx\qquad $\forall j\in\scri_V$, \qquad $\partial_jf$ is continuous near $p$.\\
Given $j\in\scri_V$. \qquad
Want: $\partial_jf$ is continuous near $p$.\\
Let $g:=\partial_jf$. \qquad Want: $g$ is continuous near $p$.\\
By \tref{thm-partials-defdnear-continat-implies-fn-continnear}, it suffices to show:\\
\phx\qquad $\forall i\in\scri_V$, \qquad $\partial_ig$ is defined near $p$ and bounded near $p$.\\
Given $i\in\scri_V$. \qquad
Want: $\partial_ig$ is defined near $p$ and bounded near $p$.\\
By assumption, $\partial_i\partial_jf$ is defined near $p$ and bounded near $p$.\\
So since $\partial_ig=\partial_i\partial_jf$, we get:\\
\phx\qquad $\partial_ig$ is defined near $p$ and bounded near $p$, \qquad as desired.
\end{proof}

Recall \tref{thm-bringing-linear-to-inside-extends-fn}.

\begin{thm}\wrlab{thm-restr-defdnear-implies-equalitynear}
Let $X$ be a metric space, $Y$ a set.\\
Let $f,g:X\drta Y$, $p\in X$.\\
Assume that \qquad $f\subseteq g$ and that \qquad $f$ is defined near $p$.\\
Then $f=g$ near $p$.
\end{thm}

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

\begin{thm}\wrlab{thm-equalitynear-one-defdnear-implies-othertoo}
Let $X$ be a metric space, $Y$ a set.\\
Let $f,g:X\drta Y$, $p\in X$.\\
Assume that \qquad  $f=g$ near $p$ \qquad and that \qquad $f$ is defined near $p$.\\
Then $g$ is defined near $p$.
\end{thm}

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

\begin{thm}\wrlab{thm-equalitynear-one-continat-implies-othertoo}
Let $X$ and $Y$ be metric spaces.\\
Let $f,g:X\drta Y$, $p\in X$.\\
Assume that \qquad  $f=g$ near $p$ \qquad and that \qquad $f$ is continuous at $p$.\\
Then $g$ is continuous at $p$.
\end{thm}

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

\begin{thm}\wrlab{thm-equalitynear-implies-partials-agree-near}
Let $V,W\in\TNSR^+$.\\
Let $f,g:V\drta W$, $p\in V$, $j\in\scri_V$.\\
Assume that \qquad  $f=g$ near $p$. \qquad
Then $\partial_jf=\partial_jg$ near $p$.
\end{thm}

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

\begin{thm}\wrlab{thm-equalitynear-implies-totals-agree-near}
Let $V,W\in\TNSR^+$.\\
Let $f,g:V\drta W$, $p\in V$.\\
Assume that \qquad  $f=g$ near $p$. \qquad
Then $f'=g'$ near $p$.
\end{thm}

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

\begin{thm}\wrlab{thm-second-partials-defdnear-continat-implies-secondtotal-continat}
Let $V,W\in\TNSR^+$, $f,g:V\drta W$, $p\in V$.\\
Assume: $\forall i,j\in\scri_V$, $\partial_i\partial_jf$ is defined near $p$ and continuous at $p$.\\
Then $f''$ is continuous at $p$.
\end{thm}

\begin{proof}
By \tref{thm-continat-implies-bddnear}, $\forall i,j\in\scri_V$, $\partial_i\partial_jf$ is bounded near $p$.\\
Also, by assumption, $\forall i,j\in\scri_V$, $\partial_i\partial_jf$ is defined near $p$.\\
Then, by \tref{thm-second-partials-defdnear-bddnear-implies-firsttotal-continnear}, $f'$ is continuous near $p$.\\
Then: \quad $f'$ is continuous at $p$ \quad and \quad $f'$ is defined near $p$.\\
\\
{\it Claim:} Let $i,j\in\scri_V$, $k\in\scri_W$.\\
\phx\qquad\quad Then: \quad $\partial_i(\pi_{k\|j}\circ(f'))\,\,=\,\,\pi_k\circ(\partial_i\partial_jf)$ \quad near $p$.\\
{\it Proof of Claim:}\\
Since $f'$ is defined near $p$, and since $\im[f']\subseteq W\otimes V=\dom[\pi_{k\|j}]$,\\
\phx\qquad we see that $\pi_{k\|j}\circ(f')$ is defined near $p$.\\
By \tref{thm-from-totderiv-to-partial-derivs}, $\pi_k\circ(\partial_jf)\supseteq\pi_{k\|j}\circ(f')$.\\
Then: $\pi_{k\|j}\circ(f')\subseteq\pi_k\circ(\partial_jf)$.\\
So, since $\pi_{k\|j}\circ(f')$ is defined near $p$, it follows that:\\
\phx\qquad $\pi_{k\|j}\circ(f')\,\,=\,\,\pi_k\circ(\partial_jf)$ \quad near $p$.\\
Then: \quad $\partial_i(\pi_{k\|j}\circ(f'))\,\,=\,\,\partial_i(\pi_k\circ(\partial_jf))$ \quad near $p$.\\
Want: \quad $\partial_i(\pi_k\circ(\partial_jf))\,\,=\,\,\pi_k\circ(\partial_i\partial_jf)$ \quad near $p$.\\
By assumption, $\partial_i\partial_jf$ is defined near $p$.\\
So, since $\im[\partial_i\partial_jf]\subseteq W=\dom[\pi_k]$,\\
\phx\qquad we see that $\pi_k\circ(\partial_i\partial_jf)$ is defined near $p$.\\
By \tref{thm-pull-partial-past-linear}, $\partial_i(\pi_k\circ(\partial_jf))\supseteq\pi_k\circ(\partial_i\partial_jf)$.\\
So, since $\pi_k\circ(\partial_i\partial_jf)$ is defined near $p$, it follows that:\\
\phx\qquad $\partial_i(\pi_k\circ(\partial_jf))\,\,=\,\,\pi_k\circ(\partial_i\partial_jf)$ \quad near $p$, \quad as desired.\\
{\it End of proof of Claim.}\\
\\
Let $g:=f'$. \qquad
Want: $g'$ is continuous at $p$.\\
Since $f:V\drta W$ and $g=f'$, we get $g:V\drta W\otimes V$.\\
By \tref{thm-partials-defdnear-continat-implies-total-continat}, it suffices to show:\\
\phx\qquad $\forall i\in\scri_V$, \quad $\partial_ig$ is defined near $p$ and continuous at $p$.\\
Given $i\in\scri_V$. \qquad Want: \quad (A) $\partial_ig$ is defined near $p$ \qquad and\\
\phx\qquad\qquad\qquad\qquad\qquad\quad $\,\,\,$ (B) $\partial_ig$ is continuous at $p$.\\
\\
{\it Proof of (A):}\\
By HW\#13-2, it suffices to show:\\
\phx\qquad $\forall\ell\in\scri_{W\otimes V}$, \quad $\partial_i(\pi_\ell\circ g)$ is defined near $p$.\\
Given $\ell\in\scri_{W\otimes V}$. \qquad
Want: $\partial_i(\pi_\ell\circ g)$ is defined near $p$.\\
Since $\ell\in\scri_{W\otimes V}$, choose $j\in\scri_V$ and $k\in\scri_W$ s.t.~$\ell=k\|j$.\\
By assumption, $\partial_i\partial_jf$ is defined near $p$.\\
So, since $\im[\partial_i\partial_jf]\subseteq W=\dom[\pi_k]$,\\
\phx\qquad we see that $\pi_k\circ(\partial_i\partial_jf)$ is defined near $p$.\\
By the claim: \quad $\partial_i(\pi_{k\|j}\circ(f'))\,\,=\,\,\pi_k\circ(\partial_i\partial_jf)$ \quad near $p$.\\
So, since $\ell=k\|j$ and $g=f'$, we see that:\\
\phx\qquad\qquad $\partial_i(\pi_\ell\circ g)\,\,=\,\,\pi_k\circ(\partial_i\partial_jf)$ \quad near $p$.\\
So, since $\pi_k\circ(\partial_i\partial_jf)$ is defined near $p$, we conclude:\\
\phx\qquad\qquad $\partial_i(\pi_\ell\circ g)$ is defined near $p$, \qquad as desired.\\
{\it End of proof of (A).}\\
\\
{\it Proof of (B):}\\
By \tref{thm-continuity-by-components}, it suffices to show:\\
\phx\qquad $\forall\ell\in\scri_{W\otimes V}$, \quad $\pi_\ell\circ(\partial_ig)$ is continuous at $p$.\\
Given $\ell\in\scri_{W\otimes V}$. \qquad
Want: $\pi_\ell\circ(\partial_ig)$ is continuous at $p$.\\
By (A), $\partial_ig$ is defined near $p$. \qquad
Then $p\in\dom[\partial_ig]$.\\
So, since $\im[\partial_ig]\subseteq W\otimes V=\dom[\pi_\ell]$,\\
\phx\qquad we see that $p\in\dom[\pi_\ell\circ(\partial_ig)]$.\\
By \tref{thm-pull-partial-past-linear}, $\partial_i(\pi_\ell\circ g)\supseteq\pi_\ell\circ(\partial_ig)$.\\
Then, by \tref{thm-restr-maintains-continuity}, it suffices to show:\\
\phx\qquad\qquad $\partial_i(\pi_\ell\circ g)$ is continuous at $p$.\\
Since $\ell\in\scri_{W\otimes V}$, choose $j\in\scri_V$ and $k\in\scri_W$ s.t.~$\ell=k\|j$.\\
By assumption, $\partial_i\partial_jf$ is continuous at $p$.\\
Then, by \tref{thm-continuity-by-components},\\
\phx\qquad we see that $\pi_k\circ(\partial_i\partial_jf)$ is continuous at $p$.\\
By the claim, \quad $\partial_i(\pi_{k\|j}\circ(f'))\,\,=\,\,\pi_k\circ(\partial_i\partial_jf)$ \quad near $p$.\\
So, since $\ell=k\|j$ and $g=f'$, we see that:\\
\phx\qquad\qquad $\partial_i(\pi_\ell\circ g)\,\,=\,\,\pi_k\circ(\partial_i\partial_jf)$ \quad near $p$.\\
So, since $\pi_k\circ(\partial_i\partial_jf)$ is continuous at $p$, by \tref{thm-agree-near-p-one-contin-implies-other-contin}, we have:\\
\phx\qquad\qquad $\partial_i(\pi_\ell\circ g)$ is continuous at $p$, \qquad as desired.\\
{\it End of proof of (B).}
\end{proof}

\begin{thm}\wrlab{thm-comps-of-sectotal-are-comps-of-secpartial}
Let $V,W\in\TNSR^+$, \quad $f:V\drta W$.\\
Let $i,j\in\scri_V$, $k\in\scri_W$. \qquad
Then $\pi_k\circ(\partial_i\partial_jf)\,\,\supseteq\,\,\pi_{k\|i\|j}\circ(f'')$.
\end{thm}

\begin{proof}
Want: $\forall p\in V$, $(\pi_k\circ(\partial_i\partial_jf))_p\,\,=^*\,\,(\pi_{k\|i\|j}\circ(f''))_p$.\\
Given $p\in V$. \qquad
Want: $(\pi_k\circ(\partial_i\partial_jf))_p\,\,=^*\,\,(\pi_{k\|i\|j}\circ(f''))_p$.\\
Want: $(\,\,(\pi_{k\|i\|j}\circ(f''))_p\ne\frownie\,\,)\,\,\Rightarrow\,\,(\,\,(\pi_k\circ(\partial_i\partial_jf))_p\,\,=\,\,(\pi_{k\|i\|j}\circ(f''))_p\,\,)$.\\
Assume: $(\pi_{k\|i\|j}\circ(f''))_p\ne\frownie$. $\,$
Want: $(\pi_k\circ(\partial_i\partial_jf))_p\,\,=\,\,(\pi_{k\|i\|j}\circ(f''))_p$.\\
Since $(\pi_{k\|i\|j}\circ(f''))_p\ne\frownie$, we get $f''_p\ne\frownie$, and so $p\in\dom[f'']$.\\
By \tref{thm-fprpr-relates-to-2nd-order-dir-deriv}, we have: \quad
$\Bilin_{f''_p}^{VVW}(\varepsilon_i,\varepsilon_j)\,\,\,=\,\,\,(\partial_i\partial_jf)_p$.\\
Let $A:=f''_p$ and $B:=\Bilin_A^{VVW}$. \qquad
Then $B(\varepsilon_i,\varepsilon_j)=(\partial_i\partial_jf)_p$.\\
Since $\Bilin_A^{VVW}=B$, get $A=[B]_{VV}^W$, and so $A_{k\|i\|j}=\pi_k(B(\varepsilon_i,\varepsilon_j))$.\\
We have $(\pi_{k\|i\|j}\circ(f''))_p=\pi_{k\|i\|j}(f''_p)=\pi_{k\|i\|j}(A)=A_{k\|i\|j}$.\\
Then $\,(\pi_k\circ(\partial_i\partial_jf))_p\,\,=\,\,\pi_k((\partial_i\partial_jf)_p)\,\,=\,\,\pi_k(B(\varepsilon_i,\varepsilon_j))$\\
\phx\qquad\qquad\qquad\qquad\quad $=\,\,A_{k\|i\|j}\,\,=\,\,(\pi_{k\|i\|j}\circ(f''))_p$, \quad as desired.
\end{proof}

\begin{thm}\wrlab{thm-sectotalderiv-continnear-implies-secpartials-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $q\in V$.\\
Assume: $f''$ is continuous near $q$.\\
Then: $\forall i,j\in\scri_V$, $\partial_i\partial_jf$ is continuous near $q$.
\end{thm}

\begin{proof}
This is HW\#13-3.
\end{proof}

\begin{thm}\wrlab{thm-comps-of-thirdtotal-are-comps-of-thirdpartial}
Let $V,W\in\TNSR^+$, \quad $f:V\drta W$.\\
Let $h,i,j\in\scri_V$, $k\in\scri_W$. \qquad
Then $\pi_k\circ(\partial_h\partial_i\partial_jf)\,\,\supseteq\,\,\pi_{k\|h\|i\|j}\circ(f'')$.
\end{thm}

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

\begin{thm}\wrlab{thm-thirdtotalderiv-continnear-implies-thirdpartials-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $q\in V$.\\
Assume: $f'''$ is continuous near $q$.\\
Then: $\forall h,i,j\in\scri_V$, $\partial_h\partial_i\partial_jf$ is continuous near $q$.
\end{thm}

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

\begin{thm}\wrlab{thm-secpartials-continnear-implies-sectotalderiv-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $q\in V$.\\
Assume: $\forall i,j\in\scri_V$, $\partial_i\partial_jf$ is continuous near $q$.\\
Then: $f''$ is continuous near $q$.
\end{thm}

\begin{proof}
Choose $B\in\scrb_V(q)$ s.t., $\forall i,j\in\scri_V$, $\partial_i\partial_jf$ is continuous on $B$.\\
Want: $f''$ is continuous on $B$. \quad
Want: $\forall p\in B$, $f''$ is continuous at $p$.\\
Given $p\in B$. \qquad
Want: $f''$ is continuous at $p$.\\
By \tref{thm-second-partials-defdnear-continat-implies-secondtotal-continat}, it suffices to show:\\
\phx\qquad $\forall i,j\in\scri_V$, \quad $\partial_i\partial_jf$ is defined near $p$ and continuous at $p$.\\
Given $i,j\in\scri_V$. \quad
Want: $\partial_i\partial_jf$ is defined near $p$ and continuous at $p$.\\
By the choice of $B$, we know that $\partial_i\partial_jf$ is continuous on $B$.\\
Then, by \tref{thm-contin-on-ball-implies-defdnear-contat-all-its-pts},\\
\phx\qquad $\partial_i\partial_jf$ is defined near $p$ and continuous at $p$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-thirdpartials-continnear-implies-thirdtotalderiv-continnear}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $q\in V$.\\
Assume: $\forall h,i,j\in\scri_V$, $\partial_h\partial_i\partial_jf$ is continuous near $q$.\\
Then: $f'''$ is continuous near $q$.
\end{thm}

\begin{proof}
Choose $B\in\scrb_V(q)$ s.t., $\forall h,i,j\in\scri_V$, $\partial_h\partial_i\partial_jf$ is continuous on $B$.\\
Want: $f'''$ is continuous on $B$. \quad
Want: $\forall p\in B$, $f'''$ is continuous at $p$.\\
Given $p\in B$. \qquad
Want: $f'''$ is continuous at $p$.\\
By HW\#13-5, it suffices to show:\\
\phx\quad $\forall h,i,j\in\scri_V$, \quad $\partial_h\partial_i\partial_jf$ is defined near $p$ and continuous at $p$.\\
Given $h,i,j\in\scri_V$.
Want: $\partial_h\partial_i\partial_jf$ is defined near $p$ and continuous at~$p$.\\
By the choice of $B$, we know that $\partial_h\partial_i\partial_jf$ is continuous on $B$.\\
Then, by \tref{thm-contin-on-ball-implies-defdnear-contat-all-its-pts},\\
\phx\qquad $\partial_h\partial_i\partial_jf$ is defined near $p$ and continuous at $p$, as desired.
\end{proof}

Recall \tref{thm-partials-lito-function-lito-up-one}.

\begin{thm}\wrlab{thm-van-to-order-one-totderiv-implies-litoone}
Let $V,W\in\TNSR^+$, $f:V\drta W$.\\
Assume $f_{0_V}=0_W$ and $f'_{0_V}=0_{W\otimes V}$. \qquad
Then $f\in\scrlito_1^{VW}$.
\end{thm}

\begin{proof}
Let $L:=D_{0_V}f$. \quad
Since $f'_{0_V}=0_{W\otimes V}$, we get: $L=\bfzero_V^W$.\\
Then $L\ne\frownie$, and so $f_{0_V}^T-L\in\scrlito_1^{VW}$.\\
Since $f_{0_V}=0_W$, we get $f_{0_V}^T=f$.\\
Then $f=f-\bfzero_V^W=f_{0_V}^T-L\in\scrlito_1^{VW}$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-totaldiffatq-implies-total-van-iff-all-partials-van}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $q\in\dom[f']$.\\
Then: $(\,\,f'_q=0_{W\otimes V}\,\,)\,\,\Leftrightarrow\,\,(\,\,\forall j\in\scri_V,\,\,(\partial_jf)_q=0\,\,)$.
\end{thm}

\begin{proof}
Since $q\in\dom[f']$, we get $f'_q\in\im[f']$.\\
Then $f'_q\in\im[f']\subseteq W\otimes V=\dom[\pi_{k\|j}]$, so $\pi_{k\|j}(f'_q)\ne\frownie$.\\
Since $(\pi_{k\|j}\circ(f'))_q=\pi_{k\|j}(f'_q)\ne\frownie$,\\
\phx\qquad by \tref{thm-from-totderiv-to-partial-derivs}, we get:
$(\pi_k\circ(\partial_jf))_q\,=\,(\pi_{k\|j}\circ(f'))_q$.\\
It follows that: \qquad\quad $(\,\,f'_q=0_{W\otimes V}\,\,)$\\
\phx\qquad\qquad\qquad\quad $\,\Leftrightarrow\quad(\,\,\forall j\in\scri_V,\,\forall k\in\scri_W,\,\,(\pi_{k\|j}\circ(f'))_q=0\,\,)$\\
\phx\qquad\qquad\qquad\quad $\,\Leftrightarrow\quad(\,\,\forall j\in\scri_V,\,\forall k\in\scri_W,\,\,(\pi_k\circ(\partial_jf))_q=0\,\,)$\\
\phx\qquad\qquad\qquad\quad $\,\Leftrightarrow\quad(\,\,\forall j\in\scri_V,\,\,(\partial_jf)_q=0_W\,\,)$, \qquad as desired.
\end{proof}

\begin{thm}\wrlab{thm-twtotaldiffatq-implies-secondtotal-van-iff-all-secondpartials-van}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $q\in\dom[f'']$.\\
Then: $(\,\,f''_q=0_{W\otimes V\otimes V}\,\,)\,\,\Leftrightarrow\,\,(\,\,\forall i,j\in\scri_V,\,\,(\partial_i\partial_jf)_q=0\,\,)$.
\end{thm}

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

\section{Second order Taylor theorem}

\begin{thm}\wrlab{thm-van-to-order-two-totderiv-implies-litotwo}
Let $V,W\in\TNSR^+$, $f:V\drta W$.\\
Assume $f_{0_V}=0_W$, $f'_{0_V}=0_{W\otimes V}$ and $f''_{0_V}=0_{W\otimes V\otimes V}$.
Then $f\in\scrlito_2^{VW}$.
\end{thm}

\begin{proof}
By \tref{thm-partials-lito-function-lito-up-one}, it suffices to show:\\
\phx\qquad\qquad $\forall j\in\scri_V$, \quad $\partial_jf\in\scrlito_1^{VW}$.\\
Given $j\in\scri_V$. \qquad
Want: $\partial_jf\in\scrlito_1^{VW}$.\\
Let $g:=\partial_jf$. \qquad
Want: $g\in\scrlito_1^{VW}$.\\
Since $f:V\drta W$ and $g=\partial_jf$, we get $g:V\drta W$.\\
Since $f'_{0_V}=0_{W\otimes V}$, by \tref{thm-totaldiffatq-implies-total-van-iff-all-partials-van},
we get $(\partial_jf)_{0_V}=0_W$.\\
Then $g_{0_V}=(\partial_jf)_{0_V}=0_W$.\\
Then, by \tref{thm-van-to-order-one-totderiv-implies-litoone}, it suffices to show: $g'_{0_V}=0_{W\otimes V}$.\\
By \tref{thm-seconderivdom-in-secondpartialdom}, we have $\dom[f'']\subseteq\dom[(\partial_jf)']$.\\
Then $0_V\in\dom[f'']\subseteq\dom[(\partial_jf)']=\dom[g']$.\\
Then, by \tref{thm-totaldiffatq-implies-total-van-iff-all-partials-van}, we wish to show: $\forall i\in\scri_V$, $(\partial_ig)_{0_V}=0_W$.\\
Given $i\in\scri_V$. \qquad
Want: $(\partial_ig)_{0_V}=0_W$.\\
By assumption, we have: \qquad $f''_{0_V}=0_{W\otimes V\otimes V}$.\\
Then, by \tref{thm-twtotaldiffatq-implies-secondtotal-van-iff-all-secondpartials-van}, we get: \qquad $(\partial_i\partial_jf)_{0_V}=0_W$.\\
Then: \qquad $(\partial_ig)_{0_V}=(\partial_i\partial_jf)_{0_V}=0_W$, \qquad as desired.
\end{proof}

\begin{thm}\wrlab{thm-dirderiv-lin}
Let $V,W\in\TNSR^+$, $L\in\scrl_V^W$, $x,u\in V$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $(\partial_uL)_x=L(u)$.
\end{thm}

\begin{proof}
Let $i:=i_x^u$. \quad
Then $(\partial_uL)_x=(L\circ i)'_0$.\\
We calculate: $\forall t\in\R$,\\
\phx\qquad $(L\circ i)_t=L(i_t)=L(x+tu)=(L(x))+t\cdot(L(u))$.\\
Define $M\in\scrl_\R^W$ by $M(h)=h\cdot(L(u))$.\\
Then $\sl_M^{\R W}=M(1)=1\cdot(L(u))=L(u)$.\\
We calculate: $\forall h\in\R$,\\
\phx\qquad $\,\,(L\circ i)^T_h\qquad=\qquad\,\,(L\circ i)_{0+h}\,\,-\,\,(L\circ i)_0$\\
\phx\qquad\qquad\qquad\qquad $=\qquad\,\,\,\,\,\,\,(L\circ i)_h\,\,-\,\,(L\circ i)_0$\\
\phx\qquad\qquad\qquad\qquad $=\qquad(\,\,(L(x))+h\cdot(L(u))\,\,)$\\
\phx\qquad\qquad\qquad\qquad $\qquad-\,\,(\,\,(L(x))+0\cdot(L(u))\,\,)$\\
\phx\qquad\qquad\qquad\qquad $=\qquad\qquad\qquad\,\,\,\,h\cdot(L(u))\qquad=\qquad M_h$.\\
Then $(L\circ i)^T_0=M$. \qquad
Then $(L\circ i)^T_0-M=\bfzero_\R^W\in\scrlito_1^{\R W}$.\\
Then $D_0(L\circ i)=M$, so $(L\circ i)'_0=\sl_M^{\R W}$.\\
Then  $(\partial_uL)_x=(L\circ i)'_0=\sl_M^{\R W}=L(u)$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-secdirderiv-lin}
Let $V,W\in\TNSR^+$, $L\in\scrl_V^W$, $x,u,v\in V$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $(\partial_u\partial_vL)_x=0_W$.
\end{thm}

\begin{proof}
Let $C:=C_V^{L(v)}$. \qquad
Then $(\partial_uC)_x=0_W$.\\
By \tref{thm-dirderiv-lin}, we have: $\forall y\in V$, $(\partial_vL)_y=L(v)$.\\
Then: $\forall y\in V$, $(\partial_vL)_y=L(v)=C_y$.\\
Then $\partial_vL=C$. \quad
Then $(\partial_u\partial_vL)_x=(\partial_uC)_x=0_W$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-dirderiv-quad}
Let $V,W\in\TNSR^+$, $B\in\scrs\scrb_V^W$, $Q:=B(\bullet,\bullet)$.\\
\phx\qquad\quad Let $x,u\in V$. \qquad\quad Then $(\partial_uQ)_x=2\cdot(B(x,u))$.
\end{thm}

\begin{proof}
Let $i:=i_x^u$. \quad
Then $(\partial_uQ)_x=(Q\circ i)'_0$.\\
We calculate: $\forall t\in\R$,\\
\phx\qquad $(Q\circ i)_t=Q(i_t)=B(i_t,i_t)$.\\
\phx\qquad\qquad\qquad\qquad\quad $=B(x+tu,x+tu)$.\\
\phx\qquad\qquad\qquad\qquad\quad $=(B(x,x))+(2t)\cdot(B(x,u))+(t^2)\cdot(B(u,u))$.\\
\phx\qquad\qquad\qquad\qquad\quad $=(Q(x))+(2t)\cdot(B(x,u))+(t^2)\cdot(Q(u))$.\\
Define $M\in\scrl_\R^W$ by $M(h)=(2h)\cdot(B(x,u))$.\\
Then $\sl_M^{\R W}=M(1)=(2\cdot1)\cdot(B(x,u))=2\cdot(B(x,u))$.\\
Define $P\in\scrq_\R^W$ by $P(h)=(h^2)\cdot(Q(u))$.\\
We calculate: $\forall h\in\R$,\\
\phx\qquad $\,\,(Q\circ i)^T_h\qquad=\qquad\,\,(Q\circ i)_{0+h}\,\,-\,\,(Q\circ i)_0$\\
\phx\qquad\qquad\qquad\qquad $=\qquad\,\,\,\,\,\,\,(Q\circ i)_h\,\,-\,\,(Q\circ i)_0$\\
\phx\qquad\qquad\qquad\qquad $=\qquad(\,\,(Q(x))+\,\,(2h)\,\cdot(B(x,u))+(h^2)\cdot(Q(u))\,\,)$\\
\phx\qquad\qquad\qquad\qquad $\qquad-\,\,(\,\,(Q(x))+(2\cdot0)\cdot(B(x,u))+(0^2)\cdot(Q(u))\,\,)$\\
\phx\qquad\qquad\qquad\qquad $=\qquad\qquad\qquad\,\,\,\,\,\,\,(2h)\,\cdot(B(x,u))+(h^2)\cdot(Q(u))$\\
\phx\qquad\qquad\qquad\qquad $=\qquad\qquad\qquad\qquad\qquad M_h\qquad\,\,\,+\,\,\,\qquad P_h$.\\
Then $(Q\circ i)^T_0=M+P$.\\
Then $(Q\circ i)^T_0-M=P\in\scrq_\R^W\subseteq\scrbigo_2^{\R W}\subseteq\scrlito_1^{\R W}$.\\
Then $D_0(Q\circ i)=M$, so $(Q\circ i)'_0=\sl_M^{\R W}$.\\
Then  $(\partial_uQ)_x=(Q\circ i)'_0=\sl_M^{\R W}=2\cdot(B(x,u))$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-secdirderiv-quad}
Let $V,W\in\TNSR^+$, $B\in\scrs\scrb_V^W$, $Q:=B(\bullet,\bullet)$.\\
\phx\qquad\quad Let $x,u,v\in V$. \qquad\quad Then $(\partial_u\partial_vQ)_x=2\cdot(B(u,v))$.
\end{thm}

\begin{proof}
Let $L:=2\cdot(B(\bullet,v))$. \qquad
Then $L\in\scrl_V^W$.\\
By \tref{thm-dirderiv-quad}, we have: $\forall y\in V$, $(\partial_vQ)_y=2\cdot(B(y,v))$.\\
Then: $\forall y\in V$, $(\partial_vQ)_y=2\cdot(B(y,v))=L_y$. \qquad
Then $\partial_vQ=L$.\\
By \tref{thm-dirderiv-lin}, $(\partial_uL)_x=L(u)$.\\
Then $(\partial_u\partial_vQ)_x=(\partial_uL)_x=L(u)=2\cdot(B(u,v))$, as desired.
\end{proof}

The following theorem is the \bfindex[Second Order Taylor Theorem]:

\begin{thm}\wrlab{thm-second-order-taylor}
Let $V,W\in\TNSR^+$, $f:V\drta W$, $x\in\dom[f'']$.\\
Let $L:=\Lin_{f'_x}$ and $Q:=((1/2)\cdot(\Bilin_{f''_x}))(\bullet,\bullet)$.\\
Let $R:=f_x^T-L-Q$. \qquad
Then $R\in\scrlito_2^{VW}$.
\end{thm}

\begin{proof}
Since $x\in\dom[f'']\subseteq\dom[f']\subseteq\dom[f]$, we get $f_x^T(0_V)=0_W$.\\
Let $B:=(1/2)\cdot(\Bilin_{f''_x})$. \qquad
Then $Q=B(\bullet,\bullet)$.\\
Since $L\in\scrl_V^W$, we get $\dom[L'']=V$ and $L_{0_V}=0_W$.\\
Since $Q\in\scrq_V^W$, we get $\dom[Q'']=V$ and $Q_{0_V}=0_W$.\\
We have $(f_x^T)'=f'(x+\bullet)$ and
$(f_x^T)''=(f'(x+\bullet))'=f''(x+\bullet)$.\\
Also, $R'=((f_x^T)-L-Q)'\supseteq(f_x^T)'-L'-Q'$.\\
Then $R''\supseteq((f_x^T)'-L'-Q')'\supseteq(f_x^T)''-L''-Q''$.\\
Then $R'\supseteq(f'(x+\bullet))-L'-Q'$ and $R''\supseteq(f''(x+\bullet))-L''-Q''$.\\
Then $\dom[R'']\supseteq\dom[(f''(x+\bullet))-L''-Q'']$.\\
Since $x\in\dom[f'']$, we get $0_V\in\dom[f''(x+\bullet)]$.\\
So, since $0_V\in V=\dom[L'']$ and $0_V\in V=\dom[Q'']$,\\
\phx\qquad we conclude: $0_V\in\dom[(f''(x+\bullet))-L''-Q'']$.\\
Then $0_V\in\dom[(f''(x+\bullet))-L''-Q'']\subseteq\dom[R'']$.\\
Also, $R_{0_V}=(f_x^T-L-Q)_{0_V}=0_W-0_W-0_W=0_W$.\\
Then, by \tref{thm-van-to-order-two-totderiv-implies-litotwo},
it suffices to show:\\
\phx\qquad both \qquad $R'_{0_V}=0_{W\otimes V}$ \qquad and \qquad $R''_{0_V}=0_{W\otimes V\otimes V}$.\\
\\
{\it Proof of (1):}\\
We have $0_V\in\dom[R'']\subseteq\dom[R']$.\\
By \tref{thm-totaldiffatq-implies-total-van-iff-all-partials-van}, it suffices to show:
$\forall j\in\scri_V$, $(\partial_jR)_{0_V}=0_W$.\\
Given $j\in\scri_V$. \qquad
Want: $(\partial_jR)_{0_V}=0_W$.\\
Let $u:=\varepsilon_j^V$. \qquad
Then $\partial_jR=\partial_uR$.\\
By \tref{thm-dirderiv-lin}, $(\partial_uL)_{0_V}=L(u)$.\\
By \tref{thm-dirderiv-quad}, $(\partial_uQ)_{0_V}=B(0_V,u)$.\\
Since $B\in\scrb_{VV}^W$, we get $B(0_V,u)=0_W$.\\
Since $L=\Lin_{f'_x}$, we get $L(u)=\Lin_{f'_x}(u)$.\\
By HW\#8-4, \quad $(\partial_uf)(x)\,\,=^*\,\,(D_xf)(u)$.\\
By \tref{thm-lin-fprime-is-Dderiv}, \quad $(D_xf)(u)\,\,\,=\,\,\,\Lin_{f'_x}(u)$.\\
Then $((\partial_uf)(x+\bullet))_{0_V}\,\,=\,\,(\partial_uf)(x)\,\,=^*\,\,(D_xf)(u)\,\,=\,\,\Lin_{f'_x}(u)$.\\
Since $x\in\dom[f'']\subseteq\dom[f']$, we get $f'_x\in\im[f']\subseteq W\otimes V$.\\
Then $\Lin_{f'_x}\in\scrl_V^W$. \qquad Then $\Lin_{f'_x}(u)\in W$.\\
Then $(\Lin_{f'_x}(u))-(\Lin_{f'_x}(u))-(0_W)=0_W$.\\
Then $(\partial_jR)_{0_V}\,\,=\,\,\,\,(\partial_uR)_{0_V}$\\
\phx\qquad\qquad\qquad $\,=\,\,\,\,(\partial_u(f_x^T-L-Q))_{0_V}$\\
\phx\qquad\qquad\qquad $\,=^*\,\,(\partial_u(f_x^T))_{0_V}-(\partial_uL)_{0_V}-(\partial_uQ)_{0_V}$\\
\phx\qquad\qquad\qquad $\,=\,\,\,\,((\partial_uf)(x+\bullet))_{0_V}-(L(u))-(B(0_V,u))$\\
\phx\qquad\qquad\qquad $\,=^*\,\,(\Lin_{f'_x}(u))-(\Lin_{f'_x}(u))-(0_W)$.\\
\phx\qquad\qquad\qquad $\,=\,\,\,\,0_W\quad\ne\quad\frownie$.\\
Then $(\partial_jR)_{0_V}\,\,=\,\,\,\,0_W$, as desired.\\
{\it End of proof of (1).}\\
\\
{\it Proof of (2):}\\
We have $0_V\in\dom[R'']$.\\
By \tref{thm-twtotaldiffatq-implies-secondtotal-van-iff-all-secondpartials-van}, it suffices to show:
$\forall i,j\in\scri_V$, $(\partial_i\partial_jR)_{0_V}=0_W$.\\
Given $i,j\in\scri_V$. \qquad
Want: $(\partial_i\partial_jR)_{0_V}=0_W$.\\
Let $u:=\varepsilon_i^V$ and let $v:=\varepsilon_j^V$. \qquad
Then $\partial_i\partial_jR=\partial_u\partial_vR$.\\
By \tref{thm-secdirderiv-lin}, $(\partial_u\partial_vL)_{0_V}=0_W$.\\
By \tref{thm-secdirderiv-quad}, $(\partial_u\partial_vQ)_{0_V}=2\cdot(B(u,v))$.\\
Since $x\in\dom[f'']$, by \tref{thm-fprpr-relates-to-2nd-order-dir-deriv},\\
\phx\qquad we get: \quad $\Bilin_{f''_x}(u,v)\,\,\,=\,\,\,(\partial_u\partial_vf)_x$.\\
Then $((\partial_u\partial_vf)(x+\bullet))_{0_V}\,\,=\,\,(\partial_u\partial_vf)(x)\,\,=\,\,\Bilin_{f''_x}(u,v)$.\\
Since $B:=(1/2)\cdot(\Bilin_{f''_x})$, we get $2\cdot(B(u,v))=\Bilin_{f''_x}(u,v)$.\\
Since $x\in\dom[f'']$, we get $f''_x\in\im[f'']\subseteq W\otimes V\otimes V$.\\
Then $\Bilin_{f''_x}\in\scrb_{VV}^W$. \qquad Then $\Bilin_{f''_x}(u,v)\in W$.\\
Then $(\Bilin_{f''_x}(u,v))-(0_W)-(\Bilin_{f''_x}(u,v))=0_W$.\\
Then $(\partial_i\partial_jR)_{0_V}\,\,=\,\,\,\,(\partial_u\partial_vR)_{0_V}$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,=\,\,\,\,(\partial_u\partial_v(f_x^T-L-Q))_{0_V}$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,=^*\,\,(\partial_u\partial_v(f_x^T))_{0_V}-(\partial_u\partial_vL)_{0_V}-(\partial_u\partial_vQ)_{0_V}$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,=\,\,\,\,((\partial_u\partial_vf)(x+\bullet))_{0_V}-(0_W)-2\cdot(B(u,v))$\\
\phx\qquad\qquad\qquad $\,\,\,\,\,=\,\,\,\,(\Bilin_{f'_x}(u))-(0_W)-(\Bilin_{f''_x}(u,v))$.\\
\phx\qquad\qquad\qquad $\,\,\,\,\,=\,\,\,\,0_W\quad\ne\quad\frownie$.\\
Then $(\partial_i\partial_jR)_{0_V}\,\,=\,\,\,\,0_W$, as desired.\\
{\it End of proof of (2).}
\end{proof}

\section{Second Derivative Theorem}

\begin{thm}\wrlab{thm-TSes-are-proper}
Let $V\in\TNSR^+$.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $(V,d_V)$ is a proper metric space.
\end{thm}

\begin{proof}
Let $W:=\R^m$.\\
By \tref{thm-Rm-is-proper}, $(W,d_W)$ is a proper metric space.\\
Let $m:=\#\scri_V$. \qquad
Then $\#\scri_V=m=\#[1..m]$.\\
Choose $\lambda:\scri_V\hookrightarrow>[1..m]$.\\
Then $\hatlambda:V\hookrightarrow>W$ is an isometry from $(V,d_V)$ to $(W,d_W)$.\\
Then $(V,d_V)$ is a proper metric space.
\end{proof}

\begin{thm}\wrlab{thm-posdef-quadratics-are-bdd-below}
Let $V\in\TNSR^+$, $Q\in\scrq_V^\R$.\\
Assume: $Q>0$ on $V_{0_V}^\times$. \qquad
Then: $\exists\varepsilon>0$ s.t.~$Q\ge\varepsilon\cdot(|\bullet|_V^2)$ on $V$.
\end{thm}

\begin{proof}
Let $S:=\{x\in V~\hbox{s.t.}~|x|_V=1\}$.\\
Since $Q\in\scrq_V^\R$, it follows that $Q$ is continuous from $V$ to $\R$.\\
Then $Q|S$ is continuous from $S$ to $\R$.\\
Since $S=(|\bullet|_V)^*(\{1\})$ and
since $|\bullet|_V:V\to\R$ is continuous\\
\phx\qquad and since $\{1\}$ is closed in $\R$, we get: \quad $S$ is closed in $V$.\\
Moreover, as $S\subseteq B_V(0_V,2)$, we see that $S$ is bounded in $V$.\\
Since $S$ is closed and bounded in $V$,\\
\phx\qquad and since (by \tref{thm-TSes-are-proper}), $(V,d_V)$ is proper,\\
\phx\qquad\qquad we see that $S$ is compact.\\
So, since $Q|S$ is continuous from $S$ to $\R$,\\
\phx\qquad it follows, from the Extreme Value Theorem (\tref{thm-EVT}),\\
\phx\qquad\qquad that $\min(\im[Q|S])\ne\frownie$.\\
Let $\varepsilon:=\min(\im[Q|S])$. \qquad
Then $\varepsilon\in\im[Q|S]$ and $\im[Q|S]\ge\varepsilon$.\\
Since $S\subseteq V_{0_V}^\times$ and since $Q>0$ on $V_{0_V}^\times$, we get: \quad $\im[Q|S]>0$.\\
Then $\varepsilon\in\im[Q|S]>0$, so $\varepsilon>0$.\\
Want: \quad $Q\ge\varepsilon\cdot(|\bullet|_V^2)$ \quad on $V$.\\
Since $Q\in\scrq_V^\R$, we see that $Q_{0_V}=0$.\\
Then $Q_{0_V}=0=\varepsilon\cdot0^2=\varepsilon\cdot(|0_V|_V^2)=(\varepsilon\cdot(|\bullet|_V^2))_{0_V}$.\\
Want: \quad $Q\ge\varepsilon\cdot(|\bullet|_V^2)$ \quad on $V_{0_V}^\times$.\\
Want: \quad $\forall x\in V_{0_V}^\times$, \quad $Q_x\ge(\varepsilon\cdot(|\bullet|_V^2))_x$.\\
Given $x\in V_{0_V}^\times$. \qquad
Want: $Q_x\ge(\varepsilon\cdot(|\bullet|_V^2))_x$.\\
Let $a:=|x|_V$. \qquad As $x\in V_{0_V}^\times$, we get: $a>0$.\\
Let $u:=x/a$. \qquad Then $x=au$.\\
Also, $|u|_V=|x|_V/a=a/a=1$, \quad so $u\in S$.\\
Then $Q_u\in\im[Q|S]\ge\varepsilon$, so $Q_u\ge\varepsilon$.\\
Since $Q_u\ge\varepsilon$ and since $a^2\ge0$, we get $a^2\cdot Q_u\ge a^2\cdot\varepsilon$.\\
Since $Q\in\scrq_V^\R$, we get $Q_{au}=a^2\cdot Q_u$. \qquad
Recall: $a=|x|_V$.\\
Then $Q_x=Q_{au}=a^2\cdot Q_u\ge a^2\cdot\varepsilon=\varepsilon\cdot(|x|_V^2)=(\varepsilon\cdot(|\bullet|_V^2))_x$.
\end{proof}

\begin{thm}\wrlab{thm-cvz-implies-le-epsilon-near-zero}
Let $V,W\in\TNSR^+$, $\alpha\in\CVZ_V^W$, $\varepsilon>0$.\\
Then $\exists B\in\scrb_V(0_V)$ s.t.~$|\alpha|_W\le\varepsilon$ on $B$.
\end{thm}

\begin{proof}
Since $\alpha\in\CVZ_V^W$, we get: $\alpha_{0_V}=0_W$.\\
Since $\alpha\in\CVZ_V^W\subseteq\DNZ_V^W$,
choose $C\in\scrb_V(0_V)$ s.t.~$C\subseteq\dom[\alpha]$.\\
Since $\alpha\in\CVZ_V^W$,
we know that $\alpha$ is continuous at $0_V$ from $V$ to $W$.\\
Choose $D\in\scrb_V(0_V)$ s.t.~$\alpha_*(D)\subseteq B_W(\alpha_{0_V},\varepsilon)$.\\
Let $B:=C\cap D$. \qquad Then $B\in\scrb_V(0_V)$.\\
Want: \quad $|\alpha|_W\le\varepsilon$ \quad on $B$.\\
Want: \quad $\forall x\in B$, \quad $(|\alpha|_W)_x\le\varepsilon$.\\
Given $x\in B$. \qquad
Want: $(|\alpha|_W)_x\le\varepsilon$.\\
Since $x\in B\subseteq C\subseteq\dom[\alpha]$
and since $x\in B\subseteq D$,\\
\phx\qquad it follows that $\alpha_x\in\alpha_*(D)$.\\
Since $\alpha_x\in\alpha_*(D)\subseteq B_W(\alpha_{0_V},\varepsilon)$, we get: $|\alpha_x-\alpha_{0_V}|<\varepsilon$.\\
Since $\alpha_{0_V}=0_W$, we get: $\alpha_x-\alpha_{0_V}=\alpha_x$.\\
Since $(|\alpha|_W)_x=|\alpha_x|_W=|\alpha_x-\alpha_{0_V}|_W<\varepsilon$,\\
\phx\qquad we get $(|\alpha|_W)_x<\varepsilon$, and so $(|\alpha|_W)_x\le\varepsilon$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-second-deriv-test}
Let $V\in\TNSR^+$, $f:V\drta\R$, $x\in\dom[f'']$.\\
Let $L:=\Lin_{f'_x}$ and $B:=\Bilin_{f''_x}$.\\
Assume that \quad $L=0$ on $V$ \quad and that \quad $B(\bullet,\bullet)>0$ on $V_{0_V}^\times$.\\
Then $f$ has a strict local minimum at $x$.
\end{thm}

\begin{proof}
Since $x\in\dom[f'']\subseteq\dom[f]$, we get: $(f_x^T)_{0_V}=0$.\\
Want: $f_x^T$ has a strict local minimum at $0_V$.\\
Let $g:=f_x^T$. \qquad
Then $g_{0_V}=0$.\\
Want: $g$ has a strict local minimum at $0_V$.\\
Want: $\exists U\in\scrb_V(0_V)$ s.t.~$g>g_{0_V}$ on $U_{0_V}^\times$.\\
Let $Q:=((1/2)\cdot B)(\bullet,\bullet)$. \qquad
Then $Q=(1/2)\cdot(B(\bullet,\bullet))$.\\
So, since $B(\bullet,\bullet)>0$ on $V_{0_V}^\times$,
\qquad we see that $Q>0$ on $V_{0_V}^\times$.\\
Also, $Q=((1/2)\cdot\Bilin_{f''_x})(\bullet,\bullet)$.\\
Let $R:=f_x^T-L-Q$. \qquad
By \tref{thm-second-order-taylor}, $R\in\scrlito_2^{V\R}$.\\
Since $R\in\scrlito_2^{V\R}=(\CVZ_V^\R)\cdot(|\bullet|_V^2)$,\\
\phx\qquad choose $\alpha\in\CVZ_V^\R$ s.t.~$R=\alpha\cdot(|\bullet|_V^2)$.\\
Since $L=0$ on $V$, we conclude that $L=\bfzero_V^\R$.\\
Then $g-Q=g-\bfzero_V^\R-Q=f_x^T-L-Q=R$.\\
By \tref{thm-posdef-quadratics-are-bdd-below}, choose $\varepsilon>0$ s.t.~$Q\ge\varepsilon\cdot(|\bullet|_V^2)$ on $V$.\\
By \tref{thm-cvz-implies-le-epsilon-near-zero}, choose $U\in\scrb_V(0_V)$ s.t.~$|\alpha|\le\varepsilon/2$ on $U$.\\
Want: $g>g_{0_V}$ on $U_{0_V}^\times$. \qquad
Want: $\forall y\in U_{0_V}^\times$, $g_y>g_{0_V}$.\\
Given $y\in U_{0_V}^\times$. \qquad
Want: $g_y>g_{0_V}$.\\
Since $y\in U_{0_V}^\times\subseteq V_{0_V}^\times$ and since $Q>0$ on $V_{0_V}^\times$,\\
\phx\qquad we conclude that $Q_y>0$. \qquad
Then $Q_y/2>0$.\\
Since $y\in U_{0_V}^\times\subseteq U$ and since $Q\ge\varepsilon\cdot(|\bullet|_V^2)$ on $U$,\\
\phx\qquad we conclude that $Q_y\ge\varepsilon\cdot|y|_V^2$. \qquad
Then $\varepsilon\cdot|y|_V^2\le Q_y$.\\
Since $y\in U_{0_V}^\times\subseteq U$ and since $|\alpha|\le\varepsilon/2$ on $U$,\\
\phx\qquad we conclude that $|\alpha_y|\le\varepsilon/2$.\\
We have $g-Q=R=\alpha\cdot(|\bullet|_V^2)$, \quad so $(g-Q)_y=(\alpha\cdot(|\bullet|_V^2))_y$.\\
Then \quad $g_y-Q_y=(g-Q)_y=(\alpha\cdot(|\bullet|_V^2))_y=\alpha_y\cdot(|y|_V^2)$,\\
\phx\qquad and so $g_y-Q_y=\alpha_y\cdot(|y|_V^2)$, and so $|g_y-Q_y|=|\alpha_y|\cdot|y|_V^2$.\\
Recall: \quad $|\alpha_y|\le\varepsilon/2$ \quad and \quad $\varepsilon\cdot|y|_V^2\le Q_y$.\\
Then $|g_y-Q_y|\,=\,|\alpha_y|\cdot|y|_V^2\,\le\,(\varepsilon/2)\cdot|y|_V^2\,=\,(\varepsilon\cdot|y|_V^2)/2\,\le\,Q_y/2$.\\
Since $|g_y-Q_y|\le Q_y/2$, we get: \quad $Q_y-(Q_y/2)\,\,\le\,\,g_y\,\,\le\,\,Q_y+(Q_y/2)$.\\
Then $g_y\,\,\ge\,\,Q_y-(Q_y/2)$. \qquad
Recall: $Q_y/2>0$ and $g_{0_V}=0$.\\
Then $g_y\,\,\ge\,\,Q_y-(Q_y/2)\,\,=\,\,Q_y(1-(1/2))\,\,=\,\,Q_y/2\,\,>\,\,0\,\,=\,\,g_{0_V}$.
\end{proof}

\section{Partitions}

\begin{defn}
Let $\scrp$ be a set of sets.\\
\phx\qquad\qquad Then $\scrp$ is a \bfindex[partition] means:\\
\phx\qquad\qquad\qquad\qquad $\forall P,Q\in\scrp$, \qquad $(\,\,\,(\,P=Q\,)\,\,\,\vee\,\,\,(\,P\cap Q=\emptyset\,)\,\,\,)$.
\end{defn}

\begin{defn}
Let $X$ be a set and let $\scrp$ be a set of sets.\\
\phx\qquad\qquad Then $\scrp$ is a \bfindex[partition of $X$] means:\\
\phx\qquad\qquad\qquad\qquad $\left(\,\,\,(\,\scrp\hbox{ is a partition}\,)\,\,\,\&\,\,\,\left(\,\bigcup\scrp=X\,\right)\,\,\,\right)$.
\end{defn}

\begin{defn}
We define: \quad $\forall j\in\N_0$,\\
\phx\qquad\qquad $\ds{\scri_j\,\,:=\,\,\left\{\,\,\left[\frac{m}{2^j},\frac{m+1}{2^j}\right)\,\,\bigg|\,\,m\in\Z\,\,\right\}}$ \qquad and\\
\phx\qquad\qquad $\scrs_j\,\,:=\,\,\{\,\,I\times J\,\,|\,\,I,J\in\scri_j\,\,\}$.
\end{defn}

\noindent
We often refer to elements of a partition $\scrp$ as ``legos'' or ``$\scrp$-legos''.\\
\\
\noindent
Let $D:=\barB_{\R^2}(0_2,\sqrt{2})$ and let $j:=10^{100}$.\\
As you can assemble a Star Wars Death Star out of legos,\\
\phx\quad so, too, you can build a good approximation to $D$ out of $\scrs_j$-legos.

\begin{thm}
We have: $\forall j\in\N_0$,\\
\phx\qquad $\scri_j$ is a partition of $\R$ \qquad and \qquad $\scrs_j$ is a partition of $\R^2$.
\end{thm}

\begin{defn}
Let $\scrp$ be a partition.\\
\phx\qquad\qquad\qquad\qquad\qquad Then $\hatscrp\,\,:=\,\,\{\,\,\bigcup\scra\,\,|\,\,\scra\subseteq\scrp\,\,\}$.
\end{defn}

Note: $\emptyset,\bigcup\scrp\in\hatscrp$ and $\scrp\subseteq\hatscrp$.
\vskip.1in\noindent
We often refer to elements of $\hatscrp$ as ``assemblies'' or ``$\scrp$-assemblies''.\\
\\
\noindent
Let $D:=\barB_{\R^2}(0_2,\sqrt{2})$ and let $j:=10^{100}$.\\
As you can assemble a Star Wars Death Star out of legos,\\
\phx\quad so, too, you can find sets in $\widehat{\scrs_j}$ that approximate $D$.

\begin{defn}
Let $\scrp$ and $\scrq$ be partitions.\\
\phx\qquad Then $\scrp<<\scrq$ means: \quad both \quad $\scrp\subseteq\hatscrq$ \quad and \quad $\bigcup\scrp=\bigcup\scrq$.
\end{defn}

\begin{thm}
Let $\scrp$ and $\scrq$ be partitions.\\
\phx\qquad\qquad\qquad Assume $\scrp<<\scrq$. \qquad
Then $\hatscrp\subseteq\hatscrq$.
\end{thm}

\begin{thm}
We have:\\
\phx\quad both \quad $\scri_0<<\scri_1<<\scri_2<<\cdots$ \quad and \quad $\scrs_0<<\scrs_1<<\scrs_2<<\cdots$.
\end{thm}

\section{Partition measures}

\begin{defn}
Let $\mu$ be a function.\\
\phx\qquad Then $\mu$ is a \bfindex[partition measure] means:\\
\phx\qquad\qquad\qquad both \quad $\dom[\mu]$ is a partition \quad and \quad $\im[\mu]\subseteq[0;\infty]$.
\end{defn}

\begin{defn}
Let $\mu$ be a partition measure.\\
\phx\qquad\qquad Then we define: \quad $\scrp_\mu:=\dom[\mu]$ \quad and \quad $X_\mu:=\bigcup\scrp_\mu$.
\end{defn}

\begin{defn}
$\forall j\in\N_0$, define $\alpha^j:\scrs_j\to[0;\infty]$ by $\alpha_S^j=4^{-j}$.
\end{defn}

\begin{thm}
$\forall j\in\N_0$, we have:\\
\phx\qquad $\alpha^j$ is a partition measure \quad and \quad $\scrp_{\alpha^j}=\scrs_j$ \quad and \quad $X_{\alpha^j}=\R^2$.
\end{thm}

\begin{defn}
Let $X$ be a set and let $\mu$ be a function.\\
Then $\mu$ is a \bfindex[partition measure on $X$] means:\\
\phx\qquad\qquad\qquad both \quad $\mu$ is a partition measure \quad and \quad $X_\mu=X$.
\end{defn}

\begin{thm}
$\forall j\in\N_0$, \quad $\alpha^j$ is a partition measure on $\R^2$.
\end{thm}

\begin{defn}
Let $\mu$ be a partition measure.\\
\phx\qquad\quad Then we define $\hatmu:\widehat{\scrp_\mu}\to[0;\infty]$ by: \quad $\ds{\hatmu_B\,\,=\,\,\sum_{P\in\scrp_\mu\cap2^B}\,\mu_P}$.
\end{defn}

We call $\hatmu$ the \bfindex[assembly measure] of $\mu$.

\vskip.1in\noindent
Note: $\emptyset,X_\mu\in\dom[\hatmu]$ and $\mu\subseteq\hatmu$.

\begin{thm}
Let $\mu$ be a partition measure and let $S,T\in\widehat{\scrp_\mu}$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\hatmu_{S\cup T}\le\hatmu_S+\hatmu_T$.
\end{thm}

\begin{defn}
Let $\mu$ and $\nu$ be partition measures.\\
Then $\mu<<\nu$ means: \quad both \quad $\mu\subseteq\hatnu$ \quad and \quad $X_\mu=X_\nu$.
\end{defn}

\begin{thm}
Let $\mu$ and $\nu$ be partition measures.\\
\phx\qquad\qquad\qquad Assume $\mu<<\nu$. \qquad
Then $\hatmu\subseteq\hatnu$.
\end{thm}

\begin{thm}
We have: $\alpha^0<<\alpha^1<<\alpha^2<<\cdots$.
\end{thm}

\section{Approximating sets}

\begin{defn}
Let $\scrp$ be a partition, $B\subseteq\bigcup\scrp$.\\
Then $B_\scrp^-:=\bigcup\{P\in\scrp\,|\,P\subseteq B\}$ and $B_\scrp^+:=\bigcup\{P\in\scrp\,|\,P\cap B\ne\emptyset\}$.
\end{defn}

\noindent
We call $B_\scrp^-$ the \bfindex[inner assembly] or {\bf inner $\scrp$-assembly} of $B$.\\
We call $B_\scrp^+$ the \bfindex[outer assembly] or {\bf outer $\scrp$-assembly} of $B$.\\
\\
\noindent
Let \quad $D:=\barB_{\R^2}(0_2,\sqrt{2})$.\\
We drew a picture of $D$.\\
We added each of the four squares in $\{S\in\scrs_0\,|\,S\subseteq D\}$.\\
Note that $D_{\scrs_0}^-$ is the union of those four squares.\\
Adding five more squares, we displayed\\
\phx\qquad\qquad $\,\,\,$ all of the 13 squares in $\{S\in\scrs_0\,|\,S\cap D\ne\emptyset\}$.\\
Note that $D_{\scrs_0}^+$ is the union of those 13 squares.
 squares.\\

\noindent
Let \quad $D:=\barB_{\R^2}(0_2,\sqrt{2})$, \quad $A:=D\cap\Q^2$.\\
We discussed how to picture~$A$.\\
We noted that $\{S\in\scrs_0\,|\,S\subseteq A\}\,\,=\,\,\emptyset$.\\
Therefore, $A_{\scrs_0}^-\,\,=\,\,\emptyset$.\\
We noted that $\{S\in\scrs_0\,|\,S\cap A\ne\emptyset\}\,\,=\,\,\{S\in\scrs_0\,|\,S\cap D\ne\emptyset\}$.\\
Those nine squares from before are $\{S\in\scrs_0\,|\,S\cap A\ne\emptyset\}$.\\
Note that $A_{\scrs_0}^+$ is the union of those nine squares.\\

\noindent
Let \quad $D:=\barB_{\R^2}(0_2,\sqrt{2})$, \quad $A:=D\cap\Q^2$, \quad $j=10^{100}$.\\
We discussed why\\
\phx\qquad $D_{\scrs_j}^-$ and $D_{\scrs_j}^+$ are both indistinguishable from $D$ on the board.\\
We discussed why\\
\phx\qquad $A_{\scrs_j}^-=\emptyset$, while $A_{\scrs_j}^+$ is indistinguishable from $D$ on the board.

\begin{thm}
Let $\scrp$ be a partition, $B\subseteq\bigcup\scrp$.\\
\phx\qquad\qquad\qquad\qquad\qquad $\,$ Then: \qquad $B_\scrp^-\subseteq B\subseteq B_\scrp^+$.
\end{thm}

\begin{thm}
Let $X$ be a set, $B\subseteq X$.\\
\phx\qquad Let $\scrp$ and $\scrq$ be partitions of $X$. \qquad\qquad
Assume: \quad $\scrp<<\scrq$.\\
\phx\qquad\qquad Then: \qquad $B_\scrp^-\subseteq B_\scrq^-\subseteq B\subseteq B_\scrq^+\subseteq B_\scrp^+$.
\end{thm}

\section{Approximating measures of sets}

\begin{defn}
Let $\mu$ be a partition measure.\\
\phx\qquad Then $\mu^-,\mu^+:2^{X_\mu}\to[0;\infty]$ are defined by:\\
\phx\qquad\qquad\qquad $\mu^-(B)\,=\,\hatmu(B_{\scrp_\mu}^-)$ \qquad and \qquad $\mu^+(B)\,=\,\hatmu(B_{\scrp_\mu}^+)$.
\end{defn}

\noindent
We call $\mu^-$ the \bfindex[inner measure] of $\mu$.\\
We call $\mu^+$ the \bfindex[outer measure] of $\mu$.

\begin{thm}
Let $D:=\barB_{\R^2}(0_2,\sqrt{2})$.\\
Then $(\alpha^0)^-(D)=4$ and $(\alpha^0)^+(D)=13$.
\end{thm}

\noindent
It has been known since antiquity that the area of $D$ is $2\pi$.\\
Note that $(\alpha^0)^-(D)=4<2\pi<9=(\alpha^0)^+(D)$.\\
If we approximate $D$ by $\scrs_0$-assemblies (from the inside and outside),\\
\phx\qquad we don't get such a good approximation to the correct area.

\begin{thm}
Let \quad $D:=\barB_{\R^2}(0_2,\sqrt{2})$, \quad $j:=10^{100}$.\\
Then: $\,\,2\pi-0.1\,\,<\,\,(\alpha^j)^-(D)\,\,<\,\,2\pi\,\,<\,\,(\alpha^j)^+(D)\,\,<\,\,2\pi+0.1$.
\end{thm}

\noindent
If we approximate $D$ by $\scrs_j$-assemblies (from the inside and outside),\\
\phx\qquad we get a good approximation to the correct area.

\begin{thm}
Let $\mu$ be a partition measure and let $S,T\subseteq X_\mu$.\\
\phx\qquad Then both $\mu^-_{S\cup T}\ge\mu^-_S+\mu^-_T$ and $\mu^+_{S\cup T}\le\mu^+_S+\mu^+_T$.
\end{thm}

\begin{thm}
Let $\mu$ be a partition measure.\\
\phx\qquad\qquad\qquad Then: \quad $\,\,\,\,\,\,\,$ $\mu^-=\hatmu=\mu^+$ $\,\,\,\,\,\,\,\,\,\,$ on $\widehat{\scrp_\mu}$\\
\phx\qquad\qquad\qquad $\,$ and \quad $\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$ $\mu^-\le\mu^+$ $\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$ on $2^X$.
\end{thm}

\begin{thm}
Let $X$ be a set.\\
\phx\qquad\qquad\qquad  Let $\mu$ and $\nu$ be a partition measures on $X$.\\
\phx\qquad\qquad\qquad Then: $\,\,\,$ $\mu^-\le\nu^-\le\nu^+\le\mu^+$ $\,\,\,$ on $2^X$.
\end{thm}

\begin{thm}
$\,\,(\alpha^0)^-\le(\alpha^1)^-\le(\alpha^2)^-\le\cdots$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\qquad $\,\le$\\
\phx\qquad\qquad\qquad\quad $\cdots\le(\alpha^2)^+\le(\alpha^1)^+\le(\alpha^0)^+$\\
\phx\qquad\qquad\qquad\qquad\qquad\qquad\quad $\,\,$ on $2^{\R^2}$.
\end{thm}

\section{The definition of area}

\begin{defn}
Define $\alpha^+,\alpha^-:2^{\R^2}\to[0;\infty]$ by\\
\phx\qquad\qquad\qquad\qquad\qquad\quad\quad $\alpha^-(B)=\sup\{(\alpha^j)^-(B)\,|\,j\in\N_0\}$\\
\phx\qquad\qquad\qquad\qquad\quad and \quad $\,\alpha^+(B)=\,\inf\{(\alpha^j)^+(B)\,|\,j\in\N_0\}$.
\end{defn}

\noindent
We call $\alpha^-(B)$ the \bfindex[inner area] of $B$.\\
We call $\alpha^+(B)$ the \bfindex[outer area] of $B$.

\begin{thm}
Let $S,T\in\scrm$.\\
\phx\qquad Then both $\alpha^-_{S\cup T}\ge\alpha^-_S+\alpha^-_T$ and $\alpha^+_{S\cup T}\le\alpha^+_S+\alpha^+_T$.
\end{thm}

\begin{thm}
Define $F:\R^2\to\R^2$ by $F(x,y)=(y,x)$. \quad
Let $S\in\scrm$.\\
\phx\qquad Then both $\alpha^-(F_*(S))=\alpha^-(S)$ and $\alpha^+(F_*(S))=\alpha^+(S)$.
\end{thm}

\begin{thm}
Let $D:=\barB_{\R^2}(0_2,\sqrt{2})$.\\
\phx\qquad\qquad\qquad\qquad\quad Then \qquad\qquad $\alpha^-(D)=2\pi=\alpha^+(D)$.\\
\phx\qquad\qquad\qquad\qquad\quad Also, $\,\,\,\,\,\,\alpha^-(D\cap\Q^2)=0\ne2\pi=\alpha^+(D\cap\Q^2)$.
\end{thm}

\begin{defn}
We define:\\
\phx\qquad $\scrm\quad:=\quad\{\,\,\,B\subseteq\R^2\,\,\,|\,\,\,(\,B\hbox{ is bounded in }\R^2\,)\,\,\,\&\,\,\,(\,\alpha_B^-=\alpha_B^+\,)\,\,\,\}$.
\end{defn}

\noindent
That is, $\scrm$ is the collection of\\
\phx\qquad bounded subsets of $\R^2$ whose inner and outer areas agree.\\
A subset $B$ of $\R^2$ is \bfindex[Jordan measurable] if $B\in\scrm$.\\
\\
Let $D:=\barB_{\R^2}(0_2,\sqrt{2})$. \quad
Then $D\in\scrm$ and $D\cap\Q^2\notin\scrm$.\\

\begin{thm}
Let $S,T\in\scrm$. \qquad
Then $S\cup T\in\scrm$.
\end{thm}

\begin{thm}
Define $F:\R^2\to\R^2$ by $F(x,y)=(y,x)$.\\
Let $S\in\scrm$. \qquad
Then $F_*(S)\in\scrm$.
\end{thm}

Note that $\alpha^-|\scrm=\alpha^+|\scrm$.

\begin{defn}
$\alpha:=\alpha^-|\scrm$.
\end{defn}

\noindent
Note: \quad $\forall B\subseteq\R^2$, \quad $\,(\,\,(\,B\hbox{ is bounded in }\R^2\,)\,\Rightarrow\,(\,\alpha^-_B\le\alpha^+_B<\infty\,)\,\,)$.\\
Also, \quad $\,\,\forall B\in\scrm$, \qquad $\,$ $B$ is bounded in $\R^2$.\\
It follows that \qquad  $\im[\alpha]\subseteq[0;\infty)$. \qquad
Then $\alpha:\scrm\to[0;\infty)$.\\
\\
The function $\alpha:\scrm\to[0;\infty)$ is called \bfindex[Jordan area].\\
\\
Note: \qquad $\forall B\subseteq\R^2$, \quad $(\,B\hbox{ is Jordan measurable}\,)\,\Leftrightarrow\,(\,\alpha_B\ne\frownie\,)$.

\begin{thm}
Let $S,T\in\scrm$. \qquad
Then $\alpha_{S\cup T}\le\alpha_S+\alpha_T$.
\end{thm}

\begin{thm}\wrlab{thm-reflection-meas-pres}
Define $F:\R^2\to\R^2$ by $F(x,y)=(y,x)$.\\
Let $S\in\scrm$. \qquad
Then $\alpha(F_*(S))=\alpha(S)$.
\end{thm}

\section{Jordan/Riemann Integration}

In this section, we develop an integration theory that is often called \bfindex[Riemann integration].
It is closely tied to Jordan area, and so might also be called \bfindex[Jordan integration].

\begin{defn}\wrlab{defn-gph-ordinateset}
Let $f:\R\drta\R$.\\
\phx\qquad\qquad We define \quad $G_f:=\{(x,y)\in\R^2\,|\,y=f(x)\}$,\\
\phx\qquad\qquad\quad and \qquad $\,\,\,\,\,O_f:=\{(x,y)\in\R^2\,|\,0<y<f(x)\}$.\\
\end{defn}

\noindent
In \dref{defn-gph-ordinateset}, $G_f$ is called the \bfindex[graph] of $f$,\\
\phx\qquad\qquad and \qquad $\,\,O_f$ is called the \bfindex[ordinate set] of $f$.

\begin{defn}
Let $f:\R\drta\R$.\\
\phx\qquad\qquad We define \quad $\ds{\int_\R f \quad:=\quad(\alpha(\scro_f))\,-\,(\alpha(\scro_{-f}))}$.
\end{defn}

\noindent
Note that $\alpha(\scro_f)$ is the Jordan area of the region under $f$.\\
Note that $\alpha(\scro_{-f})$ is equal to the Jordan area of the region over $f$.\\
Thus, the integral of $f$ is the area under $f$ minus the area over $f$.

\begin{defn}
Let $f:\R\drta\R$.\\
\phx\qquad\qquad Then $f$ is \bfindex[Jordan integrable] means: \quad $\ds{\int_\R f\,\,\ne\,\,\frownie}$.
\end{defn}

\begin{thm}
Let $f:\R\drta\R$.\\
\phx\qquad\qquad Then: $(\,f\hbox{ is Jordan integrable}\,)\,\Leftrightarrow\,(\,\scro_f,\scro_{-f}\in\scrm\,)$.
\end{thm}

\noindent
That is, $f$ is Jordan integrable iff the regions under and over $f$ are both Jordan measurable.\\
\\
Define $\phi:\R\to\R$ by $\phi(x)=1/(1+x^2)$.\\
Then $\scro_\phi$ is not bounded in $\R^2$, so $\scro_\phi\notin\scrm$.\\
Then $\phi$ is not Jordan integrable.\\
\\
Also, the characteristic function $\chi_{[0;1]\cap\Q}^{[0;1]}$ is not Jordan integrable.

\begin{defn}
Let $f:\R\drta\R$ and let $a,b\in\R$.\\
Assume that $[a|b]\subseteq\dom[f]$. \quad
Let $\ds{I:=\int_\R\,(f|[a|b])}$.\\
\phx\qquad Then we define: \qquad $\ds{\int_a^b\,f\,\,\,:=\,\,\,\begin{cases}I,&\hbox{if }a<b\\0,&\hbox{if }a=b\\-I,&\hbox{if }a>b.\end{cases}}$\\
\phx\qquad Also, we define: \qquad $\ds{\dashint_a^b\,f\,\,\,:=\,\,\,\left(\frac{1}{b-a}\right)\cdot\left(\int_a^b\,f\right)}$.
\end{defn}

Note: $\forall f:\R\drta\R$, $\forall a\in\dom[f]$, both $\ds{\int_a^a\,f=0}$ and $\ds{\dashint_a^a\,f=\frownie}$.

\section{Continuity on a compact implies uniform continuity}

\begin{thm}\wrlab{thm-simultaneous-convergence}
Let $X$ be a compact metric space.
Let $p,q\in X^\N$.\\
\phx\qquad Then $\exists$strictly increasing $m\in\N^\N$ s.t.\\
\phx\qquad\qquad\qquad $p\circ m$ and $q\circ m$ are both convergent in $X$.
\end{thm}

\begin{proof}
Since $X$ is compact, $p$ is subconvergent in $X$.\\
Choose a strictly increasing $k\in\N^\N$ s.t.~$p\circ k$ is convergent in $X$.\\
Since $X$ is compact, $q\circ k$ is subconvergent in $X$.\\
Choose a strictly increasing $\ell\in\N^\N$ s.t.~$q\circ k\circ\ell$ is convergent in $X$.\\
Let $m:=k\circ\ell$. \quad Then $q\circ m$ is convergent in $X$.\\
\phx\qquad\qquad\qquad\quad Want: $p\circ m$ is convergent in $X$.\\
Since $p\circ m=p\circ k\circ\ell$, it follows that $p\circ m$ is a subsequence of $p\circ k$.\\
Since $p\circ k$ is convergent in $X$ and since $p\circ m$ is a subsequence of $X$,\\
\phx\qquad $\,$ we conclude that $p\circ m$ is convergent in $X$, as desired.
\end{proof}

\begin{thm}
Let $X$ and $Y$ be metric spaces.\\
Let $f:X\to Y$ be continuous and let $\varepsilon>0$.\\
Assume that $X$ is compact.\\
Then: $\exists\delta>0$ s.t., $\forall p,q\in X$,\\
\phx\qquad\qquad $(\,\,d_X(p,q)<\delta\,\,)\,\,\Rightarrow\,\,(\,\,d_Y(f_p,f_q)<\varepsilon\,\,)$.
\end{thm}

\begin{proof}
Assume: $\forall\delta>0$, $\exists p,q\in X$ s.t.\\
\phx\qquad $(\,\,d_X(p,q)<\delta\,\,)\,\,\&\,\,(\,\,d_Y(f_p,f_q)\ge\varepsilon\,\,)$.\\
Want: Contradiction.\\
By the Axiom of Choice, choose $p,q\in X^\N$ s.t., $\forall j\in\N$,\\
\phx\qquad $(\,\,d_X(p_j,q_j)<1/j\,\,)\,\,\&\,\,(\,\,d_Y(f_{p_j},f_{q_j})\ge\varepsilon\,\,)$.\\
By \tref{thm-simultaneous-convergence},choose a strictly increasing $m\in\N^\N$ s.t.\\
\phx\qquad $p\circ m$ and $q\circ m$ are both convergent in~$X$.\\
Let $a:=p\circ m$, $b:=q\circ m$. \quad
Then $a$ and $b$ are both convergent in~$X$.\\
Choose $\alpha,\beta\in X$ s.t.~both $a_\bullet\to\alpha$ and $b_\bullet\to\beta$ in $X$.\\
Then $(d_X(a,b))_\bullet\to d_X(\alpha,\beta)$ in $\R$.\\
By our choice of $p$ and $q$, we have: $\forall j\in\N$, $d_X(p_j,q_j)\le 1/j$.\\
Then: $\forall j\in\N$, $0\le(d_X(p,q))_j\le 1/j$.\\
Then, by the Squeeze Theorem, $(d_X(p,q))_\bullet\to0$ in $\R$.\\
Also, $d_X(a,b)=(d_X(p,q))\circ m$, so $d_X(a,b)$ is a subsequence of $d_X(p,q)$.\\
Then $(d_X(a,b))_\bullet\to0$ in $\R$.\\
So, since $(d_X(a,b))_\bullet\to d_X(\alpha,\beta)$ in $\R$,\\
\phx\qquad we conclude that $0=d_X(\alpha,\beta)$. \qquad\qquad
Then $\alpha=\beta$.\\
Since $f$ is continuous, since $a_\bullet\to\alpha$ in $X$ and since $b_\bullet\to\beta\in X$,\\
\phx\qquad it follows that both $(f\circ a)_\bullet\to f_\alpha$ and $(f\circ b)_\bullet\to f_\beta$ in $Y$.\\
Then $(d_Y(f\circ a,f\circ b))_\bullet\to d_Y(f_\alpha,f_\beta)$ in $\R$.\\
Since $\alpha=\beta$, it follows that $d_Y(f_\alpha,f_\beta)=0$.\\
Then $(d_Y(f\circ a,f\circ b))_\bullet\to0$ in $\R$.\\
Choose $K\in\N$ s.t., $\forall i\in\N$,\\
\phx\qquad$(\,\,i\ge K\,\,)\,\,\Rightarrow\,\,(\,\,(d_Y(f\circ a,f\circ b))_i<\varepsilon\,\,)$.\\
Then we have: \qquad $\,\,\,\,(d_Y(f\circ a,f\circ b))_K<\varepsilon$.\\
Let $j:=m_K$. \quad
Then $p_j=(p\circ m)_K=a_K$ and $q_j=(q\circ m)_K=b_K$.\\
By our choice of $p$ and $q$, we have $d_Y(f_{p_j},f_{q_j})\ge\varepsilon$, so $\varepsilon\le d_Y(f_{p_j},f_{q_j})$.\\
Then $\,\,\varepsilon\,\,\le\,\,d_Y(f_{p_j},f_{q_j})\,\,=\,\,d_Y(f_{a_K},f_{b_K})\,\,=\,\,(d_Y(f\circ a,f\circ b))_K\,\,<\,\,\varepsilon$.\\
Then $\,\,\varepsilon\,\,<\,\,\varepsilon$. \qquad Contradiction.
\end{proof}

\begin{thm}\wrlab{thm-gph-continuous-on-cpt-intvl-is-null}
Let $a,b\in\R$. \quad
Assume $a<b$.\\
Let $f:[a;b]\to\R$ be continuous. \qquad
Then $\alpha(G_f)=0$.
\end{thm}

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

\begin{thm}\wrlab{thm-circle-is-null}
Let $C:=S_{\R^2}(0_2,\sqrt{2})$. \quad
Then $\alpha(C)=0$.
\end{thm}

\begin{proof}
Since $\alpha(C)\ge0$, it suffices to show: $\alpha(C)\le0$.\\
Define $f:[-\sqrt{2},\sqrt{2}]\to\R$ by $f(x)=\sqrt{2-x^2}$.\\
Since $C=G_f\cup G_{-f}$, we get: $\alpha(C)\le(\alpha(G_f))+(\alpha(G_{-f}))$.\\
By \tref{thm-gph-continuous-on-cpt-intvl-is-null}, we have both $\alpha(G_f)=0$ and $\alpha(G_{-f})=0$.\\
Then $\alpha(C)\le(\alpha(G_f))+(\alpha(G_{-f}))=0+0=0$, as desired.
\end{proof}

\begin{defn}
Let $p,q\in\R^2$.\\
\phx\qquad\qquad Then: \qquad $[p|q]\quad:=\quad\{\,\,(1-t)p+tq\,\,|\,\,t\in[0;1]\,\,\}$.
\end{defn}

The set $[p|q]$ is called the \bfindex[closed line segment] from $p$ to $q$.

\begin{thm}\wrlab{thm-line-segments-null}
Let $p,q\in\R^2$. \quad
Then $\alpha([p|q])=0$.
\end{thm}

\begin{proof}
We have $p=(p_1,p_2)$ and $q=(q_1,q_2)$\\
Exactly one of the following is true:\\
\phx\qquad (1) $p_1=q_1$ \qquad\qquad or \qquad\qquad (2) $p_1\ne q_1$.\\
\\
{\it Case (1):}\\
Define $F:\R^2\to\R^2$ by $F(x,y)=(y,x)$.\\
Define $h:[p_2|q_2]\to\R$ by $h(t)=p_1$. \quad
Then $[p|q]=F_*(G_h)$.\\
By \tref{thm-gph-continuous-on-cpt-intvl-is-null}, $\alpha(G_h)=0$.\\
By \tref{thm-reflection-meas-pres}, $\alpha(F_*(G_h))=\alpha(G_h)$.\\
Then $\alpha([p|q])=\alpha(F_*(G_f))=\alpha(G_f)=0$, as desired.\\

{\it End of Case (1).}\\
\\
{\it Case (2):}\\
Define $f:[p_1|q_1]\to\R$ by $f(t)=(1-t)p_2+tq_2$. \quad
Then $[p|q]=G_f$.\\
By \tref{thm-gph-continuous-on-cpt-intvl-is-null}, $\alpha(G_f)=0$.\\
Then $\alpha([p|q])=\alpha(G_f)=0$, as desired.\\
{\it End of Case (2).}
\end{proof}

\section{Bounding sets and Jordan measurability}

\begin{defn}
Let $\scrp$ be a partition and let $B,V\subseteq\bigcup\scrp$.\\
\phx\qquad Then $B$ $\scrp$-\bfindex[bounds] $V$ means: \qquad $\forall P\in\scrp$,\\
\phx\qquad\qquad\qquad $(\,\,P\cap V\ne\emptyset\ne P\backslash V\,\,)\,\,\Rightarrow\,\,(\,\,P\cap B\ne\emptyset\,\,)$.
\end{defn}

\begin{thm}\wrlab{thm-circle-bounds-disk}
Let $C:=S_{\R^2}(0_2,\sqrt{2})$, $D:=\barB_{\R^2}(0_2,\sqrt{2})$, $j\in\N_0$.\\
\phx\qquad\qquad\qquad Then $C$ $\scrs_j$-bounds $D$.
\end{thm}

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

\begin{thm}\wrlab{thm-outer-minus-inner-inside-boundary}
Let $\scrp$ be a partition, \qquad $B,V\subseteq\bigcup\scrp$.\\
\phx\qquad\qquad Assume: $B$ $\scrp$-bounds $V$. \qquad
Then: \quad $V_\scrp^+\backslash V_\scrp^-\subseteq B_\scrp^+$.
\end{thm}

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

\begin{thm}\wrlab{thm-plus-minus-difference-le-boundarymsr}
Let $\mu$ be a partition measure, \qquad $B,V\subseteq X_\mu$.\\
\phx\qquad\qquad Assume: $B$ $\scrp_\mu$-bounds $V$. \qquad
Then: \quad $\mu_V^+\,\,-\,\,\mu_V^-\,\,\,\le\,\,\,\mu_B^+$.
\end{thm}

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

\begin{thm}\wrlab{thm-boundary-criterion-of-measurability}
Let $B,V\subseteq\R^2$. \qquad
Assume: $\alpha_B=0$.\\
\phx\qquad Assume: $\forall j\in\N_0$, $B$ $\scrs_j$-bounds $V$. \quad
Then: $V\in\scrm$.
\end{thm}

\begin{proof}
Want: $\alpha_V^-=\alpha_V^+$.\\
Since $\alpha_V^-\le\alpha_V^+$, it suffices to show: $\alpha_V^+\le\alpha_V^-$.\\
Want: $\alpha_V^+-\alpha_V^-\le0$. \quad
Want: $\forall\varepsilon>0$, $\alpha_V^+-\alpha_V^-<\varepsilon$.\\
Given $\varepsilon>0$. \qquad
Want: $\alpha_V^+-\alpha_V^-<\varepsilon$.\\
Let $S:=\{(\alpha^j)_B^+\,|\,j\in\N_0\}$. \quad
Then $\alpha_B^+:=\inf S$.\\
By assumption, we have: $\alpha_B^+=0$.\\
As $\inf S=\alpha_B^+=0<\varepsilon$, we get $\neg(\,\varepsilon\le S\,)$. $\,$
Choose $t\in S$ s.t.~$t<\varepsilon$.\\
Since $t\in S=\{(\alpha^j)_B^+\,|\,j\in\N_0\}$, choose $k\in\N_0$ s.t.~$t=(\alpha^k)_B^+$.\\
We have $\alpha_V^+=\inf\{(\alpha^j)_V^+\,|\,j\in\N_0\}$, so $\alpha_V^+\le\{(\alpha^j)_V^+\,|\,j\in\N_0\}$,\\
\phx\qquad\qquad and so $\alpha_V^+\le(\alpha^k)_V^+$.\\
Also, $\alpha_V^-=\sup\{(\alpha^j)_V^-\,|\,j\in\N_0\}$, so $\alpha_V^-\ge\{(\alpha^j)_V^-\,|\,j\in\N_0\}$,\\
\phx\qquad\qquad and so $\alpha_V^-\ge(\alpha^k)_V^-$.\\
Since $\alpha_V^+\le(\alpha^k)_V^+$ and $\alpha_V^-\ge(\alpha^k)_V^-$,\\
\phx\qquad\qquad we get: $\alpha_V^+-\alpha_V^-\le(\alpha^k)_V^+-(\alpha^k)_V^-$.\\
By \tref{thm-plus-minus-difference-le-boundarymsr}, we have: $(\alpha^k)_V^+-(\alpha^k)_V^-\le(\alpha^k)_B^+$.\\
Then $\alpha_V^+-\alpha_V^-\le(\alpha^k)_V^+-(\alpha^k)_V^-\le(\alpha^k)_B^+=t<\varepsilon$, as desired.
\end{proof}

\begin{thm}
Let $D:=\barB_{\R^2}(0_2,\sqrt{2})$. \qquad
Then $D\in\scrm$.
\end{thm}

\begin{proof}
Let $C:=S_{\R^2}(0_2,\sqrt{2})$. \qquad
By \tref{thm-circle-is-null}, $\alpha_C=0$.\\
By \tref{thm-circle-bounds-disk}, we have: $\forall j\in\N_0$, $C$ $\scrs_j$-bounds $D$.\\
Then, by \tref{thm-boundary-criterion-of-measurability}, $D\in\scrm$, as desired.
\end{proof}

\begin{thm}\wrlab{thm-continuous-nonneg-fns-integrbl}
Let $a,b\in\R$. \qquad
Assume $a\le b$.\\
\phx\qquad Let $f:[a;b]\to[0;\infty)$ be continuous. \qquad
Then $\scro_f\in\scrm$.
\end{thm}

\begin{proof}
Let $V:=\scro_f$. \qquad
Want: $V\in\scrm$.\\
Let \quad $p:=(a,0)$, \quad $q:=(a,f_a)$, \quad $r:=(b,0)$, \quad $s:=(b,f_b)$.\\
Let \quad $C:=[p|q]$, \quad $D:=[r|s]$, \quad $E:=[p|r]$.\\
Let \quad $B:=C\cup D\cup E\cup G_f$.\\
Then $\alpha(B)\le(\alpha(C))+(\alpha(D))+(\alpha(E))+(\alpha(G_f))$.\\
Unassigned HW: \quad Show, $\forall j\in\N_0$, $B$ $\scrs_j$-bounds $V$.\\
By \tref{thm-line-segments-null}, we have: $\alpha(C)=\alpha(D)=\alpha(E)=0$.\\
By \tref{thm-gph-continuous-on-cpt-intvl-is-null}, we have: $\alpha(G_f)=0$.\\
Then $\alpha(B)\le(\alpha(C))+(\alpha(D))+(\alpha(E))+(\alpha(G_f))=0+0+0+0=0$.\\
So, since $\alpha(B)\ge0$, we get: $\alpha(B)=0$.\\
Then, by \tref{thm-boundary-criterion-of-measurability}, we have: $V\in\scrm$, as desired.
\end{proof}

\begin{thm}
Let $a,b\in\R$.\\
\phx\qquad\qquad Let $f:[a|b]\to\R$ be continuous. \qquad
Then $\scro_f\in\scrm$.
\end{thm}

\begin{proof}
Let \quad $\alpha:=\min\{a,b\}$ \quad and \quad $\beta:=\max\{a,b\}$.\\
Then \quad $\alpha\le\beta$ \quad and \quad $f:[\alpha;\beta]\to\R$.\\
Define $g:=(f+|f|)/2$. \qquad 
Then $g$ is continuous.\\
Also, $\forall x\in[\alpha;\beta]$, we have $g_x=(f_x+|f_x|)/2=\max\{f_x,0\}$.\\
Then $\scro_f=\scro_g$. \quad
Also, $g:[\alpha;\beta]\to[0;\infty)$.\\
By \tref{thm-continuous-nonneg-fns-integrbl}, we have: $\scro_g\in\scrm$.\\
Then $\scro_f=\scro_g\in\scrm$, as desired.
\end{proof}

\section{Basic properties of integration}

\begin{thm}
Let $f:\R\drta[0;\infty]$, $a\ge0$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\ds{\int_\R\,(a\cdot f)\,\,=^*\,\,a\cdot\left(\int_\R\,f\right)}$.
\end{thm}

\begin{thm}
Let $f:\R\drta\R$, $a\in\R$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\ds{\int_\R\,(a\cdot f)\,\,=^*\,\,a\cdot\left(\int_\R\,f\right)}$.
\end{thm}

\begin{thm}
Let $D\subseteq\R$, $f,g:D\to[0;\infty]$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\ds{\int_\R\,(f+g)\,\,=^*\,\,\left(\int_\R\,f\right)\,+\,\left(\int_\R\,g\right)}$.
\end{thm}

\begin{thm}
Let $D\subseteq\R$, $f,g:D\to\R$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\ds{\int_\R\,(f+g)\,\,=^*\,\,\left(\int_\R\,f\right)\,+\,\left(\int_\R\,g\right)}$.
\end{thm}

\begin{thm}\wrlab{thm-mononicity-of-integration}
Let $D\subseteq\R$. \quad
Let $f,g:D\to\R$.\\
Assume that $f$ and $g$ are both Jordan integrable.\\
Assume that $f\le g$ on $D$. \quad
Then $\ds{\int_\R\,f\,\,\le\,\,\int_\R\,g}$.
\end{thm}

\begin{thm}\wrlab{thm-integration-of-constant}
Let $a,b,u\in\R$.
Assume $a<b$.
Let $D:=[a,b]$.\\
\phx\qquad\qquad\qquad\qquad\quad Then $\ds{\int_\R\,C_D^u\,\,=\,\,u\cdot(b-a)}$.
\end{thm}

\section{The Fundamental Theorem of Calculus}

\begin{thm}\wrlab{thm-bd-fn-implies-bd-avg}
Let $a,b\in\R$. \quad
Assume $a\ne b$. \quad
Let $D:=[a|b]$.\\
\phx\qquad\qquad\qquad Let $f:\R\drta\R$. \quad
Assume that $f$ is continuous on $D$.\\
\phx\qquad\qquad\qquad Then: \qquad $\ds{\min(f_*(D))\,\,\le\,\,\dashint_a^b\,f\,\,\le\,\,\max(f_*(D))}$.
\end{thm}

\begin{proof}
Let $\alpha:=\min\{a,b\}$ and let $\beta:=\max\{a,b\}$.\\
Then: \qquad $\alpha<\beta$ \quad and \quad $D=[\alpha;\beta]$ \quad and \quad $\ds{\dashint_a^b\,f=\dashint_\alpha^\beta\,f}$.\\
Let $y:=\min(f_*(D))$ and let $z:=\max(f_*(D))$.\\
Since $f$ is continuous on $D$, it follows that $D\subseteq\dom[f]$.\\
Then $y\le f\le z$ on $D$. \qquad Let $\phi:=f|D$. \qquad
Then $C_D^y\le\phi\le C_D^z$.\\
Since $\phi=f|D=f|[\alpha;\beta]$, we get: $\,\ds{\int_\alpha^\beta\,f=\int_\R\phi}$.\\
\phx\qquad\qquad Want: \qquad $\ds{y\,\,\le\,\,\,\,\frac{1}{\beta-\alpha}\int_\alpha^\beta\,f\,\,\,\,\le\,\,z}$.\\
\phx\qquad\qquad Want: \qquad $\ds{y\,\,\le\,\,\,\,\frac{1}{\beta-\alpha}\int_\R\,\phi\,\,\,\,\le\,\,z}$.\\
\phx Want: \qquad $\ds{y\cdot(\beta-\alpha)\,\,\le\qquad\,\int_\R\,\phi\,\qquad\le\,\,z\cdot(\beta-\alpha)}$.\\
By \tref{thm-integration-of-constant}, we get:\\
\phx\quad both \quad $\ds{\int_\R\,C_D^y\,\,=\,\,y\cdot(\beta-\alpha)}$ \quad and \quad $\ds{\int_\R\,C_D^z\,\,=\,\,z\cdot(\beta-\alpha)}$.\\
Since $C_D^y\le\phi\le C_D^z$, by \tref{thm-mononicity-of-integration},\\
\phx\qquad we see that $\ds{\int_\R\,C_D^y\,\,\le\,\,\int_\R\,\phi\,\,\le\,\,\int_\R\,C_D^z}$.\\
Then: \qquad $\,\,\,\,\,\ds{y\cdot(\beta-\alpha)\,\,\le\,\,\int_\R\,\phi\,\,\le\,\,z\cdot(\beta-\alpha)}$, \quad as desired.
\end{proof}

The following theorem is the \bfindex[Fundamental Theorem of Calculus]:

\begin{thm}
Let $a,b\in\R$. \quad
Assume that $a<b$.\\
\phx\quad Let $f:[a;b]\to\R$ be continuous.\\
\phx\quad Define $g:[a;b]\to\R$ by: \quad $\ds{g(x)=\int_a^x\,f}$.\\
\phx\quad Let $p\in(a;b)$. \qquad
Then $g'_p=f_p$.
\end{thm}

\begin{proof}
Let $m:=f_p$. \quad
Want: $g'_p=m$.\\
Define $L\in\scrl_\R^\R$ by $L_h=mh$. \quad
Then $\sl_L^{\R\R}=m$.\\
Want: $g'_p=\sl_L^{\R\R}$. \qquad
Want: $D_pg=L$. \qquad
Want $g_p^T-L\in\scrlito_1^{\R\R}$.\\
Let $\ds{\alpha:=\adj_0^0\left(\frac{g_p^T-L}{\id_\R}\right)}$. \quad
Then $g_p^T-L=\alpha\cdot\id_\R$.\\
Since $\id_\R\in\scrbigo_1^{\R\R}$, it suffices to prove: $\alpha\in\scrlito_0^{\R\R}$.\\
Since $\scrlito_0^{\R\R}=\CVZ_\R^\R$, it suffices to prove: $\alpha\in\CVZ_\R^\R$.\\
We have $\alpha\in\DNZ_\R^\R$ and $\alpha_0=0$.\\
It remains to show: $\alpha$ is continuous at $0$.\\
Want: $\forall\varepsilon>0$, $\exists U\in\scrb_\R(0)$ s.t.~$\alpha_*(U)\subseteq(-\varepsilon;\varepsilon)$.\\
Given $\varepsilon>0$. \qquad
Want: $\exists U\in\scrb_\R(0)$ s.t.~$\alpha_*(U)\subseteq(-\varepsilon;\varepsilon)$.\\
Since $f$ is continuous, $f$ is continuous at $p$. \qquad
Recall: $f_p=m$.\\
Since $p\in(a;b)$, choose $V\in\scrb_\R(0)$ s.t.~$p+V\subseteq(a;b)$.\\
Choose $U\in\scrb_\R(0)$ s.t.~$U\subseteq V$ and $f_*(p+U)\subseteq(m-\varepsilon;m+\varepsilon)$.\\
Want: $\alpha_*(U)\subseteq(-\varepsilon;\varepsilon)$. \quad
We have $\alpha_0=0\in(-\varepsilon;\varepsilon)$.\\
Want: $\alpha_*(U_0^\times)\subseteq(-\varepsilon;\varepsilon)$. \qquad
Want: $\forall y\in\alpha_*(U_0^\times)$, $y\in(-\varepsilon,\varepsilon)$.\\
Given $y\in\alpha_*(U_0^\times)$. \qquad
Want: $y\in(-\varepsilon,\varepsilon)$.\qquad
Want: $-\varepsilon<y<\varepsilon$.\\
Since $y\in\alpha_*(U_0^\times)$, choose $h\in U_0^\times\cap(\dom[\alpha])$ s.t.~$y=\alpha(h)$.\\
Since $U\in\scrb_\R(0)$, it follows that $U$ is an interval, so $p+U$ is an interval.\\
Since $0,h\in U$, we get $p,p+h\in p+U$.\\
So, since $p+U$ is an interval, we get $[p|p+h]\subseteq p+U$.\\
We have $U\subseteq V$, so $p+U\subseteq p+V$.\\
Then $p+U\subseteq p+V\subseteq(a;b)\subseteq[a;b]=\dom[f]$.\\
So, since $f_*(p+U)\subseteq(m-\varepsilon;m+\varepsilon)$,\\
\phx\qquad\qquad we conclude that: \quad\qquad $m-\varepsilon<f<m+\varepsilon$ \quad on $p+U$.\\
\phx\qquad\qquad\qquad\qquad Then: \qquad\qquad $\,\,-\varepsilon<f-C_\R^m<\varepsilon$ $\,$ \quad on $p+U$.\\
So, since $[p|p+h]\subseteq p+U$, we get: $\,\,-\varepsilon<f-C_\R^m<\varepsilon$ $\,$ \quad on $[p|p+h]$.\\
Then, by \tref{thm-bd-fn-implies-bd-avg}, \qquad $\ds{-\varepsilon\,\,\,<\,\,\,\dashint_p^{p+h}\,(f-C_\R^m)\,\,\,<\,\,\,\varepsilon}$.\\
It therefore suffices to show: \qquad $\,\,\ds{y=\dashint_p^{p+h}\,(f-C_\R^m)}$.\\
We have: \qquad both \quad $\ds{g_p^T(h)=\int_p^{p+h}\,f}$ \quad and \quad $\ds{L(h)=\int_p^{p+h}\,C_\R^m}$.\\
\phx\qquad\qquad\qquad\quad Then: \quad $\ds{(g_p^T-L)(h)=\int_p^{p+h}\,(f-C_\R^m)}$.\\
Since \quad $h\in U_0^\times\subseteq\R_0^\times$ \quad and \quad $\ds{\alpha=\adj_0^0\left(\frac{g_p^T-L}{\id_\R}\right)}$,\\
\phx\qquad\quad we get: $\,\,\,\,\ds{\alpha(h)\,\,=\,\,\frac{(g_p^T-L)(h)}{h}}$.\\
Then: \qquad $\,\,\ds{y\,\,=\,\,\alpha(h)\,\,=\,\,\frac{(g_p^T-L)(h)}{h}\,\,=\frac{1}{h}\cdot((g_p^T-L)(h))}$\\
\phx\qquad\qquad\qquad $\ds{=\,\,\frac{1}{h}\cdot\int_p^{p+h}\,(f-C_\R^m)\,\,=\,\,\dashint_p^{p+h}\,(f-C_\R^m)}$.
\end{proof}

\vfil\eject

\printindex[terms]

FOR OFFICE USE ONLY: \tref{thm-two-inclusions-of-domains}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\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:
