% Document Head
\documentclass[11pt, oneside]{book}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage[parfill]{parskip}
\usepackage{graphicx}

% Essential Packages
\usepackage{ragged2e}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[hyperref]{ntheorem}

% Theorem Style Customization
\setlength\theorempreskipamount{2ex}
\setlength\theorempostskipamount{3ex}

% hyperref Package Settings
\usepackage{hyperref}
\hypersetup{
	colorlinks = true,
	linkcolor = magenta
}

% ntheorem Declarations
\theoremstyle{break}
\newtheorem{thm}{Theorem}[section]
\newtheorem*{proof}{Proof}
\newtheorem{crly}{Corollary}[thm]
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{propo}{Proposition}[section]
\newtheorem*{remark}{Remark}
\newtheorem*{note}{Note}
\newtheorem{defn}{Definition}[section]
\newtheorem{eg}{Example}[section]

% ntheorem listtheorem style
\makeatletter
\def\thm@@thmline@name#1#2#3#4{%
        \@dottedtocline{-2}{0em}{2.3em}%
                   {\makebox[\widesttheorem][l]{#1 \protect\numberline{#2}}#3}%
                   {#4}}
\@ifpackageloaded{hyperref}{
\def\thm@@thmline@name#1#2#3#4#5{%
    \ifx\\#5\\%
        \@dottedtocline{-2}{0em}{2.3em}%
            {\makebox[\widesttheorem][l]{#1 \protect\numberline{#2}}#3}%
            {#4}
    \else
        \ifHy@linktocpage\relax\relax
            \@dottedtocline{-2}{0em}{2.3em}%
                {\makebox[\widesttheorem][l]{#1 \protect\numberline{#2}}#3}%
                {\hyper@linkstart{link}{#5}{#4}\hyper@linkend}%
        \else
            \@dottedtocline{-2}{0em}{2.3em}%
                {\hyper@linkstart{link}{#5}%
                  {\makebox[\widesttheorem][l]{#1 \protect\numberline{#2}}#3}\hyper@linkend}%
                    {#4}%
        \fi
    \fi}
}
\makeatother
\newlength\widesttheorem
\AtBeginDocument{
  \settowidth{\widesttheorem}{Proposition A.1.1.1\quad}
}

\theoremlisttype{allname}

% Shortcuts
\newcommand{\bb}[1]{\mathbb{#1}}			% using bb instead of mathbb
\newcommand{\floor}[1]{\lfloor #1 \rfloor}	% simplifying the writing of a floor function
\newcommand{\ceiling}[1]{\lceil #1 \rceil}	% simplifying the writing of a ceiling function
\newcommand{\dotp}{\, \cdotp}				% dot product to distinguish from \cdot

% Main Body
\title{UW W17 PMATH333 - Definitions and Theorems}
\author{Johnson Ng}

\begin{document}
\maketitle

% =================================
% 		Preface
% =================================
\chapter*{Preface}
PMATH333 is offered as a course that attempts to bridge the gap for students who have taken the regular math courses instead of the advanced math courses, in particular for MATH147, MATH148 and MATH247 in UW. This set of notes is taken from the W2017 term.

\tableofcontents

\chapter*{List of Definitions}
\theoremlisttype{allname}
\listtheorems{defn}

\chapter*{List of Theorems}
\theoremlisttype{allname}
\listtheorems{lemma,thm,crly,propo}

% =================================
% 		Chapter 1
% =================================
\chapter{The Real Number System}

\section{Ordered Field Axioms}
Please review \hyperref[apdxA]{Appendix A}. We shall use all of the set notations that are introduced in Appendix A. We will also introduce one more notation.

\begin{defn}[Removal]
	Let A and B be sets. The set A remove B, denoted as $A \setminus B$, is the set
	\[
		A \setminus B = \{ x | x \in A \land x \notin B \}
	\]
\end{defn}

\begin{defn}[Disjoint]
	Let A and B be sets. We say that A and B are disjoint when $A \cap B = \emptyset$
\end{defn}

\begin{thm}[Properties of Sets]
	Let $A, B, C \subseteq X$. Then
	\begin{enumerate}
		\item (Idempotence) $A \cup A = A, A \cap A = A$
		\item (Identity) $A \cup \emptyset = A, A \cap \emptyset = \emptyset, A \cup X = X, A \cap X = A$
		\item (Associativity) $(A \cup B) \cup C = A \cup (B \cup C)$ and $(A \cap B) \cap C = A \cap (B \cap C)$
		\item (Commutativity) $A \cup B = B \cup A$ and $A \cap B = B \cap A$
		\item (Distributivity) $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$ and $A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$
		\item (De Morgan's Laws) $X \setminus (A \cup B) = (X \setminus A) \cap (X \setminus B)$ and $X \setminus (A \cap B) = (X \setminus A) \cup (X \setminus B)$
	\end{enumerate}
\end{thm}

\begin{defn}[Intervals]
	For $a, b \in \bb{R}$ with $a \leq b$ we write
	\begin{center}
		\begin{tabular}{c c}
			$(a, b) = \{x \in \bb{R} | a < x < b\}$,	&	$[a, b] = \{x \in \bb{R} | a \leq x \leq b \}$,\\
			$(a, b] = \{x \in \bb{R} | a < x \leq b \}$,	&	$[a, b) = \{x \in \bb{R} | a \leq x < b \}$,\\
			$(a, \infty) = \{x \in \bb{R} | a < x \}$,	&	$[a, \infty) = \{x \in \bb{R} | a \leq x\}$,\\
			$(-\infty, b) = \{x \in \bb{R} | x \leq b\}$,	&	$(-\infty, b] = \{x \in \bb{R} | x < b\}$,\\
			\multicolumn{2}{c}{$(-\infty, \infty) = \bb{R}$}
		\end{tabular}
	\end{center}

	An interval in $\bb{R}$ is any set of one of the above forms. In the case that a = b, we have $(a, b) = [a, b) = (a, b] = \emptyset$ and $[a, b] = \{a\}$, and these intervals are called $\textbf{denegerate}$ intervals. The intervals $\emptyset, (a, b), (a, \infty), (-\infty, b) \text{ and } (\infty, \infty)$ are called open intervals. The intervals $\emptyset, [a, b], [a, \infty), (-\infty, b] \text{ and } (-\infty, \infty)$ are called closed intervals.
\end{defn}

\begin{remark}
	Note on how the intervals $\emptyset$ and $(-\infty, \infty)$ are both open and closed intervals.
\end{remark}

\begin{defn}[Ring]
	A ring is a set F with two distinct elements $0, 1 \in F$ and two binary operations + and $\cdot$ such that
	\begin{enumerate}
		\item (Additive Associativity) For all $x, y, z \in F$ we have (x + y) = z = x + (y + z),
		\item (Additive Commutativity) For all $x, y \in F$ we have x + y = y + x,
		\item (Additive Identity) For all $x \in F$ we have 0 + x = x.
		\item (Additive Inverse) $\forall x \in F \> \exists! y \in F \> x + y = 0$
		\item (Multiplicative Associativity) $\forall x, y, z \in F$ we have $(x \cdot y) \cdot z = x \cdot (y \cdot z)$,
		\item (Multiplicative Identity) $\forall x \in F$ we have $1 \cdot x = x = x \cdot 1$,
		\item (Distributivity) $\forall x, y, z \in F$ we have $x \cdot (y + z) = (x \cdot y) + (x \cdot z)$
	\end{enumerate}
\end{defn}

\begin{defn}[Commutative Ring]
	A ring F is a commutative ring if it has the following (additional) property: \\
	(Multiplicative Commutativity) $\forall x, y \in F$ we have $x \cdot y = y \cdot x$.
\end{defn}

\begin{defn}[Field]
	A commutative ring F is a field if it has the following (additional) property: \\
	(Multiplicative Inverse) $\forall x \neq 0 \in F \> \exists! y \in F$ such that $x \cdot y = 1$.
\end{defn}

\begin{remark}
	For the sake of simplicity, we will write $x \cdot y = xy$ for any x and y.
\end{remark}

\begin{thm}[$\bb{Q} \text{ and } \bb{R}$ as Fields]
	$\bb{Q} \text{ and } \bb{R}$ are fields.
\end{thm}

\begin{remark}
	Note that $\bb{Z}$ and $\bb{N}$ are not fields since their elements do have have a multiplicative inverse. They are, however, commutative rings.
\end{remark}

\begin{remark}[Some shorthand notations]
	Let F be a friend and let $a ,b \in F$. We denote the unique additive inverse of a by -a and we write a - b = a + (-b). When $a \neq -$, we denote the unique multiplicatie inverse of a by $a^{-1}$ and we write $b \div a = \frac{b}{a} = ba^{-1}$.
\end{remark}

\begin{thm}[Cancellations \& Identities]
	Lt F be a field. Then $\forall x, y z \in F$ we have
	\begin{enumerate}
		\item (Additive Cancellation) $x + y = x + z \implies x = z$
		\item (Uniqueness of Additive Identity) $x + y = x \implies y = 0$
		\item (Multiplicative Cancellation) $xy = xz \implies (x = 0 \lor y = z)$
		\item (Uniqueness of Multiplicative Identity) $xy = x \implies y = 1$
		\item (No Zero Divisors) $xy = 0 \implies (x = 0 \lor y = 0)$
	\end{enumerate}
\end{thm}

\begin{thm}[Properties of Fields]
	Let F be a field. Then for all $x, y \in F$ we have
	\begin{center}
		\begin{tabular}{c c c c}
			$0 \cdot x = 0$	&	-(-x) = x 	&	-(x + y) = -x - y 	&	(-1)x = x \\
			(-x)y = -(xy) &	(-x)(-y) = xy &	$(a^{-1})^{-1} = a$	&	$(ab)^{-1} = a^{-1}b^{-1}$ \\
			\multicolumn{4}{c}{$(-a)^{-1} = -a^{-1}$}
		\end{tabular}
	\end{center}
\end{thm}

\begin{defn}[Order]
	An order on a set X is a binary relation $\leq$ on X such that
	\begin{enumerate}
		\item (Totality) $\forall x, y \in X (x \leq y \lor y \leq x)$
		\item (Antisymmetry) $\forall x, y \in X \> (x \leq y \land y \leq x) \implies x = y$
		\item (Transitivity) $\forall x, y, z \in X \> (x \leq y \land y \leq z) \implies x \leq z$
	\end{enumerate}
\end{defn}

\begin{remark}[Order defined using the $<$ operator]
	Note that we may also make a definition of the above using < instead of $\leq$. Then the properties that will define an order will be:
	\begin{enumerate}
		\item (Trichotomy Property) $\forall x, y \in X (x < y \lor y < x \lor x = y)$
		\item (Transitive Property) $\forall x, y, z \in X (x < y \land y < z) \implies x < z$
		\item (Additive Property) $\forall x, y, z \in X \> x < y \implies x + z < y + z$
		\item (Multiplicative Property) $\forall a, b, c \in X$ we have
		\begin{enumerate}
			\item $a < b \land c > 0 \implies ac < bc$
			\item $a < b \land c < 0 \implies bc < ac$

		\end{enumerate}
	\end{enumerate}
\end{remark}

\begin{remark}[Non-negative and Non-positive]
	 Let $a \in \bb{R}$. We say that a is non-negative when $0 \leq a$ and that a is non-positive $a \leq 0$.
\end{remark}

\begin{remark}
	Some ways of writing the order symbol. Let $a, b, c \in \bb{R}$
	\begin{itemize}
		\item b > a is equivalent to b < a
		\item $b \leq a$ is equivalent to $b < a \lor b = a$
		\item If a < b and b < c, we can write a < b < c.
	\end{itemize}
\end{remark}

\begin{thm}[$\bb{N}, \bb{Z}, \bb{Q}$ and $\bb{R}$ are ordered]
	Each of $\bb{N}, \bb{Z}, \bb{Q}$ and $\bb{R}$  is an ordered set using the standard order $\leq$. Under the inclusions $\bb{N} \subseteq \bb{Z} \subseteq \bb{Q} \subseteq \bb{R}$ the orders coincide (e.g. when $a, b \in \bb{N}$ we have $a \leq b$ in $\bb{N}$ if and only if $a \leq b$ in $\bb{R}$)
\end{thm}

\begin{defn}[Ordered Field]
	An ordered field is a field F with an order $\leq$ such that for all $x ,y ,z \in F$
	\begin{enumerate}
		\item $x \leq y \implies x + z \leq y + z$, and
		\item $0 \leq x \land 0 \leq y \implies 0 \leq xy$.
	\end{enumerate}
\end{defn}

\begin{thm}[$\bb{Q}$ and $\bb{R}$ as Ordered Fields]
	$\bb{Q}$ and $\bb{R}$ are ordered fields.
\end{thm}

\begin{thm}[Properties of Ordered Fields]
	Let F be an ordered field. Then $\forall x, y, z \in F$ we have
	\begin{enumerate}
		\item $x > 0 \implies -x < 0$ and $x < 0 \implies -x > 0$
		\item $x \neq 0 \implies x^2 > 0$ and in particular 1 > 0
		\item $0 < x < y \implies 0 < \frac{1}{y} < \frac{1}{x}$
	\end{enumerate}
\end{thm}

\begin{defn}[Absolute Value]
	Let F be an ordered field. For $a \in F$ we define the absolute value of a to be
	\begin{gather*}
		|a| =
		\begin{cases}
			 a & \text{ if } a \geq 0, \\
			-a & \text{ if } a \leq 0.
		\end{cases}
	\end{gather*}
\end{defn}

\begin{thm}[Properties of Absolute Values]
	Let F be an ordered field. Then for all $x, y, z \in F$ we have
	\begin{enumerate}
		\item (Positive Definiteness) $|x| \geq 0$ and $|x| = 0 \iff x = 0$
		\item (Symmetry) $|x - y| = |y - x|$
		\item (Multiplicativeness) $|xy| = |x||y|$
		\item (Triangle Inequality) $|x + y| \leq |x| + |y|$
		\item (Approximation) $|x - y| \leq z \implies y - z \leq x \leq y + z$
	\end{enumerate}
\end{thm}

\begin{thm}[Basic Order Properties in $\bb{Z}$]
	\begin{enumerate}
		\item $\forall n \in \bb{Z} (n \in \bb{N} \iff n \geq 0)$
		\item $\forall k, n \in \bb{Z} (k \leq n \iff k < n + 1)$
	\end{enumerate}
\end{thm}

\section{Completeness Axiom}

\begin{defn}[Upper and Lower Bounds]
	Let X be an ordered set and let $A \subseteq X$
	\begin{enumerate}
		\item We say that A is bounded above (in X) when $\exists b \in X \> \forall a \in A \> a \leq b$, in which case we call b the upper bound of A.
		\item We say that A is bounded below (in X) when $\exists c \in X \> \forall a \in A \> c \leq a$, in which case we call c the lower bound of A.
	\end{enumerate}
	We say that A is bounded when it is bounded above and below.
\end{defn}

\begin{defn}[Supremum and Infimum]
	Let X be an ordered set and let $A \subseteq X$.
	\begin{enumerate}
		\item We say that A has a supremum (or the least upper bound) when
			\[
				\exists b \in X (\forall a \in A \> a \leq b) \quad \forall c \in X (\forall a \in A \> a \leq c) \quad b < c.
			\]
			We write b = sup A. \\
			Now if b = sup A and $b \in A$, we call b the maximum of A, and denote it as b = max A. \\
		\item We say that A has an infimum (or the greatest lower bound) when
			\[
				\exists d \in X (\forall a \in A \> d \leq a) \quad \forall c \in X (\forall a \in A \> c \leq a) \quad c < d.
			\]
			We write d = inf A. \\
			Now if d = inf A and $d \in A$, we call d the minimum of A, and denote it as d = min A.
	\end{enumerate}
\end{defn}

\begin{thm}[Approximation Property of Supremum and Infimum]\label{approx_prop}
	Let $\emptyset \neq A \subseteq \bb{R}$.
	\begin{enumerate}
		\item $b = \sup A \implies \forall 0 < \epsilon \in \bb{R} \> \exists x \in A \> (b - \epsilon < x \leq b)$
		\item $c = \inf A \implies \forall 0 < \epsilon \in \bb{R} \> \exists x \in A \> (c \leq x < c + \epsilon)$
	\end{enumerate}
\end{thm}

\begin{thm}[Completeness Properties of $\bb{R}$]
	\begin{enumerate}
		\item $\forall \emptyset \neq A \subseteq \bb{R}$, if A is bounded above, then A has a supremum in $\bb{R}$
		\item $\forall \emptyset \neq A \subseteq \bb{R}$, if A is bounded below, then A has an infimum in $\bb{R}$
	\end{enumerate}
\end{thm}

\begin{thm}[Well-Ordering Properties of $\bb{Z}$ in $\bb{R}$]
	\begin{enumerate}
		\item Every nonempty subset of $\bb{Z}$ which is bounded above in $\bb{R}$ has a maximum.
		\item Every nonempty subset of $\bb{Z}$ which is bounded below in $\bb{R}$ has a minimum. In particular, every nonempty subset of $\bb{N}$ has a minimum.
	\end{enumerate}
\end{thm}

\begin{thm}[Floor and Ceiling Properties of $\bb{Z}$ in $\bb{R}$]
	\begin{enumerate}
		\item (Floor Properties) $\forall x \in \bb{R} \> \exists! n \in \bb{Z} \> (x - 1 < n \leq x)$
		\item (Ceiling Properties) $\forall x \in \bb{R} \> \exists! n \in \bb{Z} \> (x \leq n < x + 1)$
	\end{enumerate}
\end{thm}

\begin{defn}[Floor and Ceiling Functions]
	Given $x \in \bb{R}$ we define the floor of x to be the unique $n \in \bb{Z}$ with $x - 1 < n \leq x$ and denote the floor of x by $\floor{x}$. The function $f: \bb{R} \to \bb{Z}$ given by $f(x) = \floor{x}$ is called the floor function.

	Similarly, we define the ceiling of x to be the unique $n \in \bb{Z}$ with $x \leq n < x + 1$ and denote the ceiling of x by $\ceiling{x}$. The function $f: \bb{R} \to \bb{Z}$ given by $f(x) = \ceiling{x}$ is called the ceiling function.
\end{defn}

\begin{thm}[Archimedean Properties of $\bb{Z}$ in $\bb{R}$]
	\begin{enumerate}
		\item $\forall x \in \bb{R} \> \exists n \in \bb{Z} \> (n > x)$
		\item $\forall x \in \bb{R} \> \exists m \in \bb{Z} \> (m < x)$
	\end{enumerate}
\end{thm}

\begin{thm}[Density of $\bb{Q}$]
	\begin{gather*}
		\forall a, b \in \bb{R} (a < b) \quad \exists q \in \bb{Q} (a < q < b)
	\end{gather*}
\end{thm}

% =================================
% 		Chapter 2
% =================================
\chapter{Sequences}\label{chp2}

\section{Limits of Sequences}

\begin{defn}[Sequence]
	For $p \in \bb{Z}$, let $\bb{Z}_{\geq p} = \{k \in \bb{Z} | k \geq p\}$. A sequence in a set A is a function of the form $x: \bb{Z}_{\geq p} \to A$ for some $p \in \bb{Z}$. Given a sequence $x: \bb{Z}_{\geq p} \to A$, the k-th term of the sequence is the element $x_k = x(k) \in A$, and we denote the sequence x by
	\[
		\langle x_k \rangle_{k \geq p} = \{x_k | k \geq p\} = \{x_p, x_{p + 1}, x_{p + 2}, ...\}
	\]
	Note that the range of the sequence $\langle x_k \rangle_{k \geq p}$ is the set $\{x_k\}_{k \geq p} = \{x_k | k \geq p\}$.
\end{defn}

\begin{remark}
	While the notation $\{x_k\}_{k \geq p}$ is more commonly used, since this set of notes works a lot between sequences and sets, we shall use the notation $\langle x_k \rangle_{k \geq p}$ to denote a sequence instead to make a clear distinction between the two.
\end{remark}

\begin{defn}[Subsequence]
	Let $\langle x_k \rangle_{k \geq p}$ be a sequence. A subsequence of $\langle x_k \rangle_{k \geq p}$ is a sequence of the form $\langle x_{k_n} \rangle_{n \in \bb{N}}$ such that $k_1 < k_2 < k_3 < \hdots$ and $x_{k_1} < x_{k_2} < x_{k_3} < \hdots$, where $x_{k_l} = x_m$ for all $n \geq l \in \bb{N}$ and a unique $k \geq m \in \bb{Z}_{\geq p}$.
\end{defn}

\begin{remark}
	In other words, a subsequence $\langle x_{k_n} \rangle_{n \in \bb{N}}$ is constructed from $\langle x_k \rangle_{k \geq p}$ by "removing" from $x_p, x_{p + 1}, x_{p + 2}, ...$ all the $x_m$'s except for those such that $m = k_l$ for some l.
\end{remark}

\begin{defn}[Extended Ordered Field]
	Let F be an ordered field. We can define the extended ordered field $\hat{F}$ to be the set $\hat{F} = F \cup \{-\infty, \infty\}$, such that $\forall a \in F, -\infty < a < \infty$.

	We also define, $\forall a \in F$:
	\begin{itemize}
		\item $a + \infty = \infty$,
		\item $a - \infty = -\infty$,
		\item if $a > 0$, then $a \cdot \infty = \infty$, and
		\item if $a < 0$, then $a \cdot \infty = -\infty$.
	\end{itemize}

	We define some indeterminant forms:
	\[
		\infty - \infty, \; \infty \cdot 0, \; \frac{\infty}{\infty}, \; \frac{\infty}{0}, \; \frac{0}{\infty}
	\]
	We extend the order relation < on F such that $-\infty < \infty$.
\end{defn}

\begin{defn}[Convergence, Divergence and Limits of a Sequence]
	Let F be an extended ordered field. and $\langle x_k \rangle_{k \geq p}$ be a sequence in F. For $a \in F$, we say that the sequence $\langle x_k \rangle_{k \geq p}$ converseges to a (or that the limit of $\langle x_k \rangle_{k \geq p}$ is equal to a), and we write $x_k \to a (\text{as } k \to \infty)$, or we write $\lim_{k \to \infty} = a$, when
	\[
		\forall 0 < \epsilon \in F \; \exists m \in \bb{Z} \; \forall k \in \bb{Z}_{\geq p} \; (k \geq m \implies |x_k - a| \leq \epsilon).
	\]
	We say that the sequence $\langle x_k \rangle_{k \geq p}$ diverges (in F) when it does not converge (to any $a \in F$). We say that $\langle x_k \rangle_{k \geq p}$ diverges to infinity, or that the limit of $\langle x_k \rangle_{k \geq p}$ is equal to infinity, and we write $x_k \to \infty (\text{as } k \to \infty$, or we write $\lim_{k \to \infty}x_k = \infty$, when
	\[
		\forall r \in F \; \exists m \in \bb{Z} \; \forall k \in \bb{Z}_{\geq p} \; (k \geq m \implies x_k \geq r)
	\]
	Similarly, we say that $\langle x_k \rangle_{k \geq p}$ diverges to $-\infty$, or that the limit of $\langle x_k \rangle_{k \geq p}$ is equal to negative infinity, and we write $x_k \to -\infty (\text{as } k \to \infty)$, or we write $\lim_{k \to \infty}x_k = -\infty$, when
	\[
		\forall r \in F \; \exists m \in \bb{Z} \; \forall k \in \bb{Z}_{\geq p} \; (k \geq m \implies x_k \leq r)
	\]
\end{defn}

\begin{thm}[Independence of Limit from Initial Terms]
	Let $\langle x_k \rangle_{k \geq p}$ be a sequence in a subfield F of $\bb{R}$.
	\begin{enumerate}
		\item If $q \geq p$ and $y_k = x_k$ for all $k \geq q$, then $\langle x_k \rangle_{k \geq p}$ converges iff $\langle y_k \rangle_{k \geq q}$ converges, and in this case $\lim_{k \to \infty} x_k = \lim_{k \to \infty} y_k$.

		(Note that in this statement, $\langle y_k \rangle_{k \geq q}$ is a subsequence of $\langle x_k \rangle_{k \geq p}$, such that it takes on all the elements of the sequence after some $q \geq p$.)
		\item If $l \geq 0$ and $y_k = x_{k + l}$ for all $k \geq p$, then $\langle x_k \rangle_{k \geq p}$ converges iff $\langle y_k \rangle_{k \geq p}$ converges, and in this case $\lim_{k \to \infty} x_k = \lim_{k \to \infty} y_k$.

		(Note that in this statement, $\langle x_k \rangle_{k \geq p}$ is a subsequence of $\langle y_k \rangle_{k \geq p}$ instead, such that $\langle x_k \rangle_{k \geq p}$ takes on all the values of $\langle y_k \rangle_{k \geq p}$ from k + l.)
	\end{enumerate}
\end{thm}

\begin{remark}
	Because of the above theorem, we often simply denote $\langle x_k \rangle_{k \geq p}$ as $\langle x_k \rangle$
\end{remark}

\begin{thm}[Uniqueness of Limit]
	Let $\langle x_k \rangle$ be a sequence in an ordered field F. If $\langle x_k \rangle$ has a limit (finite or infinite) then its limit is unique.
\end{thm}

\section{Limit Theorems}

\begin{thm}[Basic Limits]
	In any ordered field F, for $a \in F$ we have
	\[
		\lim_{k \to infty} a = a, \quad \lim_{k \to \infty} k = \infty, \quad \lim_{k \to \infty} \frac{1}{k} = 0
	\]
\end{thm}

\begin{thm}[Operations on Limits]\label{operations_limits}
	Let $\langle x_k \rangle$ and $\langle y_k \rangle$ be sequnces in an ordefred field F and let $c \in F$. SPS that $\langle x_k \rangle$ and $\langle y_k \rangle$ both converge with $x_k \to a$ and $y_k \to b$. Then
	\begin{enumerate}
		\item $ cx_k \to ca$
		\item $(x_k + y_k) \to a + b$
		\item $(x_k - y_k) \to a - b$
		\item $x_k y_k \to ab$
		\item If $b \neq 0$, then $\frac{x_k}{y_k} \to \frac{a}{b}$
	\end{enumerate}
\end{thm}

\begin{thm}[Extended Operations on Limits]
	Let $\langle x_k \rangle$ and $\langle y_k \rangle$ be sequences in F. SPS that $\lim_{k \to \infty} x_k = u$ and $\lim_{k \to \infty} y_k = v$, where $u, v \in \hat{F}$.
	\begin{enumerate}
		\item If u + v is defined in $\hat{F}$, then $\lim_{k \to \infty} (x_k + y_k) = u + v$.
		\item If u - v is defined in $\hat{F}$, then $\lim_{k \to \infty} (x_k - y_k) = u - v$.
		\item If uv is defined in $\hat{F}$, then $\lim_{k \to \infty} x_k y_k = uv$.
		\item If $\frac{u}{v}$ is defined in $\hat{F}$, then $\lim_{k \to \infty} \frac{x_k}{y_k} = \frac{u}{v}$
	\end{enumerate}
\end{thm}

\begin{thm}[Monotonic Surjective Functions]
	Let I and J be intervals in a subfield $F \subseteq \bb{R}$. SPS $f: I \to J$ is increasing and surjective. Let $\langle x_k \rangle$ be a sequence in I. Then
	\begin{enumerate}
		\item If $x_K \to a \in I$, then $f(x_k) \to f(a) \in J$.
		\item If $x_k \to u \in F \cup \{\infty\}$ is the right endpoint of I, then $f(x_k) \to v \in F \cup \{\infty\}$ is the right endpoint in J.
		\item If $x_k \to u \in F \cup \{-\infty\}$ is the left endpoint of I, then $f(x_k) \to v \in F \cup \{-\infty\}$ is the left endpoint in J.
	\end{enumerate}
\end{thm}

\begin{thm}[Basic Elementary functions Acting on Limits]
	Let $\langle x_k \rangle$ be a sequence in $\bb{R}$ ad let $b \in \bb{R}$. Then
	\begin{enumerate}
		\item $x_k \to a > 0 \implies x_k^b \to a^b$ and \\
			\[
				x_k \to \infty \implies \lim_{k \to \infty} x_k^b =
				\begin{cases}
					\infty 	& b > 0 \\
					1		& b = 0 \\
					0 		& b < 0
				\end{cases}
			\]
		\item $(x_k \to a \land b > 0) \implies b^{x_k} \to b^a$ and \\
			\[
				(x_k \to \infty \land b > 0) \implies \lim_{k \to \infty} b^{x_k} =
				\begin{cases}
					\infty 	& b > 1 \\
					1		& b = 1 \\
					0		& 0 < b < 1
				\end{cases}
			\]
		\item $(x_k \to a > 0 \land b > 0) \implies \log_b x_k \to \log_b a$ and \\
			\[
				(x_k \to \infty \land b > 0) \implies \lim_{k \to \infty} \log_b x_k =
				\begin{cases}
					\infty 	& b > 1 \\
					0		& b = 1 \\
					-\infty & 0 < b < 1
				\end{cases}
			\]
		\item $x_k \to a \implies (\sin x_k \to \sin a \land \cos x_k \to \cos a)$ and \\
			  $(x_k \to a (\forall t \in \bb{Z} \> a \neq \frac{\pi}{2} + 2 \pi t)) \implies \tan x_k \to \tan a$
		\item $x_k \to a \in [-1, 1] \implies (\arcsin x_k = \arcsin a \land \arccos x_k = \arccos a)$, \\
			  $x_k \to a \implies \arctan x_k \to \arctan a$, \\
			  $x_k \to \infty \implies \arctan x_k \to \frac{\pi}{2}$, and \\
			  $x_k \to -\infty \implies \arctan x_k \to -\frac{\pi}{2}$
	\end{enumerate}
\end{thm}

\begin{thm}[Comparison Theorem for Sequences]\label{comparison_seq}
	Let $\langle x_k \rangle$ and $\langle y_k \rangle$ be sequences in a subfield $F \subseteq \bb{R}$. SPS that $x_k \leq y_k$ for all k. Then
	\begin{enumerate}
		\item $(x_k \to a \land y_k \to b) \implies a \leq b$
		\item $x_k \to \infty \implies y_k \to \infty$
		\item $y_k \to -\infty \implies x_k \to -\infty$
	\end{enumerate}
\end{thm}

\begin{thm}[Squeeze Theorem for Sequences]\label{squeeze_seq}
	Let $\langle x_k \rangle$, $\langle y_k \rangle$ and $\langle z_k \rangle$ be sequences in a subfield $F \subseteq \bb{R}$.
	\begin{enumerate}
		\item $(\forall k \in \bb{N} \; x_k \leq y_k \leq x_k \> \land \> x_k \to a \land z_k \to a) \implies y_k \to a$
		\item $(\forall k \in \bb{N} \; |x_k| \leq y_k \> \land \> y_k \to 0) \implies x_k \to 0$
	\end{enumerate}
\end{thm}

\begin{defn}[Bounds]
	Let $\langle x_k \rangle$ be a sequence in an ordered set X. We say that
	\begin{enumerate}
		\item $\langle x_k \rangle$ is bounded above iff the set $\{x_k | n \in \bb{N} \}$ is bounded above;
		\item $\langle x_k \rangle$ is bounded below iff the set $\{x_k | n \in \bb{N} \}$ is bounded below.
	\end{enumerate}
\end{defn}

\section{Bolzano-Weierstrass Theorem}

\begin{defn}[Increasing, Decreasing, and Monotonic Sequences]
	Let $\langle x_k \rangle$ be a sequence in a subfiend $F \subseteq \bb{R}$. We say that
	\begin{enumerate}
		\item $\langle x_k \rangle$ is increasing iff $\forall k, l \in \bb{Z}_{\geq p} \> (k \leq l \implies x_k \leq x_l)$
		\item $\langle x_k \rangle$ is strictly increasing iff $\forall k, l \in \bb{Z}_{\geq p} \> (k < l \implies x_k < x_l)$
		\item $\langle x_k \rangle$ is decreasing iff $\forall k, l \in \bb{Z}_{\geq p} \> (k \leq l \implies x_k \geq x_l)$
		\item $\langle x_k \rangle$ is strictly decreasing iff $\forall k, l \in \bb{Z}_{\geq p} \> (k < l \implies x_k > x_l)$
	\end{enumerate}
	We say that $\langle x_k \rangle$ is monotonic when it is either increasing or decreasing only.
\end{defn}

\begin{thm}[Monotone Convergence Theorem]\label{monotone_convergence}
	Let $\langle x_k \rangle$ be a sequence in $\bb{R}$.
	\begin{enumerate}
		\item SPS $\langle x_k \rangle$ is increasing. If $\langle x_k \rangle$ is bounded above, then $x_k \to \sup \{x_k\}$. If $\langle x_k \rangle$ is not bounded above, then $x_k \to \infty$.
		\item SPS $\langle x_k \rangle$ is decreasing. If $\langle x_k \rangle$ is bounded below, then $x_k \to \inf \{x_k\}$. If $\langle x_k \rangle$ is not bounded below, then $x_k \to -\infty$.
	\end{enumerate}
\end{thm}

\begin{proof}
	[Proof of Part(1)]

	WTP $\langle x_k \rangle$ is increasing and bounded above $\implies x_k \to \sup \{x_k\}$.

	By assumption
	\begin{gather*}
		\exists b \in \bb{R} \; \forall k \in \bb{N} \; x_k \leq b \\
		A := \{ x_k \, | \, k \in \bb{N} \} \\
		\because A \neq \emptyset \text{ and } \forall c \in A \; c \leq b
	\end{gather*}
	By \hyperref[completeness_R]{Completeness Property of $\bb{R}$},
	\begin{gather*}
		a := \sup A \\
		\\
		\forall \epsilon > 0
	\end{gather*}
	By the \hyperref[approx_prop]{Approximation Property for the Supremum},
	\begin{gather*}
		\exists m \in \bb{N} \enspace x_m \in A \enspace a - \epsilon < x_m \leq a \leq b \quad (\text{since } a = \sup A) \\
		\because \langle x_k \rangle \text{ is increasing} \\
		\forall k \in \bb{N} \enspace x_m \leq x_k \\
		\implies a - \epsilon < x_m \leq x_k \leq a < a + \epsilon \implies |x_k - a| < \epsilon
	\end{gather*}

	WTP $\langle x_k \rangle$ is increasing and not bounded above $\implies x_k \to \infty$.

	Let $r > 0$. Since the sequence is unbounded, choose $m \in \bb{Z}_{\geq p}$ such that $x_m \geq r$. Then $\forall l \in \bb{Z}_{\geq p}$, if $l \geq m$, then $r \leq x_m \leq x_l$.

	Part(2) follows a similar argument as in the proof of Part(1).
\end{proof}

\begin{thm}[Nested Interval Theorem]
	Let $I_0, I_1, I_2, ...$ be nonempty, closed, and bounded intervals in $\bb{R}$. SPS $I_0 \supseteq I_1 \supseteq I_2 \supseteq \hdots$, then $\bigcap_{k = 0}^\infty I_k \neq \emptyset$. Moreover, if the lengths of these intervals satisfy $|I_k| \to 0$ as $k \to \infty$, then $\bigcap_{k = 0}^\infty I_k$ is a single point.
\end{thm}

\begin{proof}
	\begin{gather*}
		\forall k \in \bb{N} \enspace a_k, b_k \in \bb{R} \enspace a_k < b_k \qquad I_k := [a_k, b_k] \\
		I_k \supseteq I_{k + 1} \implies a_k \leq a_{k + 1} < b_{k + 1} \leq b_k \\
		\\
		\langle a_k \rangle := \{a_k \, | \, k \in \bb{N} \} \quad \langle b_k \rangle := \{b_k \, | \, k \in \bb{N} \} \\
		a_k \leq a_{k + 1} \implies \langle a_k \rangle \text{ is increasing} \\
		b_{k + 1} \leq b_k \implies \langle b_k \rangle \text{ is decreasing} \\
		\\
		\because a_0 \leq a_1 \leq \hdots \leq a_{k - 1} \leq a_k < b_k \leq b_{k - 1} \leq \hdots \leq b_0 \\
		\forall k \in \bb{N} \quad a_k < b_0 \land a_0 \leq b_k \\
		\therefore \langle a_k \rangle \text{ is increasing and bounded above (by $b_0$)} \\
		\langle b_k \rangle \text{ is decreasing and bounded below (by $a_0$)}
	\end{gather*}
	By the \hyperref[monotone_convergence]{Monotone Convergence} Theorem
	\begin{gather*}
		a := \sup \{ a_k \} = \lim_{k \to \infty} a_k \qquad b := \inf \{ b_k \} = \lim_{k \to \infty} b_k \\
		\because \forall k \in \bb{N} \quad a_0 \leq a_1 \leq \hdots \leq a_{k - 1} \leq a_k < b_k \leq b_{k - 1} \leq \hdots \leq b_0 \\
		a_k \leq b_k
	\end{gather*}
	By the \hyperref[comparison_seq]{Comparison Theorem}
	\begin{gather*}
		a \leq b \implies [a, b] \neq \emptyset \\
		\because a = \sup \{ a_k \} \text{ and } b = \inf \{ b_k \} \\
		\forall k \in \bb{N} \quad a_k \leq a \text{ and } b \leq b_k \\
		\therefore [a, b] \subseteq [a_k, b_k] = I_k
		\implies [a, b] \subseteq \bigcap\limits_{k=1}^\infty I_k \implies \bigcap\limits_{k=1}^\infty I_k \neq \emptyset
	\end{gather*}
	Furthermore,
	\begin{equation*}
		a = b \implies [a, b] = \{a\} \implies \bigcap\limits_{k=1}^\infty I_k = \{a\}
	\end{equation*}
	Indeed,
	\begin{equation*}
		|I_k| \to 0 \; (\text{as } k \to \infty) \implies b_k - a_k \to 0
	\end{equation*}
	By \hyperref[operations_limits]{Operations on Limits}
	\begin{gather*}
		a = b
	\end{gather*}
\end{proof}

\begin{defn}[Rearrangement of a Sequence]
	Let $\langle x_k \rangle_{k \geq p}$ be a sequence in a set X. Given a bijective function $F: \bb{Z}_{\geq q} \to \bb{Z}_{\geq p}$ such that $f(l) = k_l$ and let $y_l = x_{k_l}$ for $l \geq q$. Then the sequence $\langle y_l \rangle_{l \geq q}$ is called a rearrangement of the sequence $\langle x_k \rangle_{k \geq p}$.
\end{defn}

\begin{thm}[Convergence of Subsequences and Rearrangements]
	Let $\langle x_k \rangle$ be a sequence in a subfield $F \subseteq \bb{R}$. SPS that $x_k \to a$. Then
	\begin{enumerate}
		\item every subsequence of $\langle x_k \rangle$ converges to a; and
		\item every rearrangement of $\langle x_k \rangle$ converges to a.
	\end{enumerate}
\end{thm}

\begin{thm}[Bolzano-Weierstrass Theorem]\label{bolzano-weierstass_R}
	Every bounded sequence of $\bb{R}$ has a convergent subsequence.
\end{thm}

\section{Cauchy Sequences}

\begin{defn}[Cauchy]
	Let $\langle x_k \rangle_{k \geq p}$ be a sequence in a subfield $F \subseteq \bb{R}$. We say that $\langle x_k \rangle$ is Cauchy when
	\[
		\forall \epsilon > 0 \; \exists m \in \bb{Z} \; \forall k, l \in \bb{Z}_{k \geq p}\; (k, l \geq m \implies |x_k - x_l| \leq \epsilon)
	\]
\end{defn}

\begin{thm}[Cauchy Criterion for Convergence]\label{CauchyCriterion_Seq}
	Let $\langle x_k \rangle$ be a sequence of $\bb{R}$. Then $\langle x_k \rangle$ is Cauchy iff $\langle x_k \rangle$ converges (to some point $a \in \bb{R}$).
\end{thm}

% =================================
% 		Chapter 3
% =================================
\chapter{Functions on \texorpdfstring{$\bb{R}$}{R}}

\section{Two-Sided Limits}

\begin{defn}[Limit Point]
	Let $U \subseteq F$ where F is an ordered field. Let $f: U \to F$. For $a \in F$ we say that a is a limit point of U when
	\[
		\forall \epsilon > 0 \; \exists x \in U \; 0 < |x - a| < \epsilon
	\]

	When a is a limit point of A, we make the following definitions.
	\begin{enumerate}
		\item For $b \in F$ we say that the limit of f(x) as x tends to a is equal to b, and write $\lim\limits_{x \to a} f(x) = b$ when
			\[
				\forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in U \; (0 < |x - a| \leq \delta \implies |f(x) - b| \leq \epsilon).
			\]
		\item We say that the limit of f(x) as x tends to a is equal to infinity, and write $\lim\limits_{x \to a} f(x) = \infty$ when
			\[
				\forall r \in F \; \exists \delta > 0 \; \forall x \in U \; (0 < |x - a| \leq \delta \implies f(x) \geq r).
			\]
		\item We say that the limit of f(x) as x tends to a is equal to negative infinity, and write $\lim\limits_{x \to a}f(x) = -\infty$ when
			\[
				\forall r \in F \; \exists \delta > 0 \; \forall x \in U \; (0 < |x - a| \leq \delta \implies f(x) \leq r).
			\]
	\end{enumerate}
\end{defn}

\begin{defn}[Limit Point from Above and Below]
	Let $U \subseteq F$ where F is an ordered field. Let $f: U \to F$.

	For $a \in F$, we say that a is a $\textbf{limit point from below}$ when
	\[
		\forall \delta > 0 \; \exists x \in U \; a - \delta < \leq x < a
	\]
	When a is a limit point of U from below and $b \in F$, we define:
	\begin{enumerate}
		\item $\lim\limits_{x \to a^-} f(x) = b \iff \forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in U \; (a - \delta \leq x < a \implies |f(x) - b| \leq \epsilon)$.
		\item $\lim\limits_{x \to a^-} f(x) = \infty \iff \forall r \in F \; \exists \delta > 0 \; \forall x \in U \; (a - \delta \leq x < a \implies f(x) \geq r)$.
		\item $\lim\limits_{x \to a^-} f(x) = -\infty \iff \forall r \in F \; \exists \delta > 0 \; \forall x \in U \; (a - \delta \leq x < a \implies f(x) \leq r)$.
	\end{enumerate}

	For $a \in F$, we say that a is a $\textbf{limit point from above}$ when
	\[
		\forall \delta > 0 \; \exists x \in U \; a < x \leq a + \delta
	\]
	When a is a limit point of U from above and $b \in F$, we define:
	\begin{enumerate}
		\item $\lim\limits_{x \to a^+} f(x) = b \iff \forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in U \; (a < x \leq a + \delta \implies |f(x) - b| \leq \epsilon)$.
		\item $\lim\limits_{x \to a^+} f(x) = \infty \iff \forall r \in F \; \exists \delta > 0 \; \forall x \in U \; (a < x \leq a + \delta \implies f(x) \geq r)$.
		\item $\lim\limits_{x \to a^+} f(x) = -\infty \iff \forall r \in F \; \exists \delta > 0 \; \forall x \in U \; (a < x \leq a + \delta \implies f(x) \leq r)$
	\end{enumerate}
\end{defn}

\begin{defn}[Infinity As A Limit Point]
	Let $U \subseteq F$ where F is an ordered field. Let $f: U \to F$.

	We say that infinity is a limit point (from below) when U is not bounded above, i.e $\forall m \in F \; \exists x \in U \; x \geq m$. When U is not bounded above and $b \in F$, we make the following definitions:
	\begin{enumerate}
		\item $\lim\limits_{x \to \infty} f(x) = b \iff \forall \epsilon > 0 \; \exists m \in F \; \forall x \in U \; (x \geq m \implies |f(x) - b| \leq \epsilon).$
		\item $\lim\limits_{x \to \infty} f(x) = \infty \iff \forall r \in F \; \exists m \in F \; \forall x \in U \; (x \geq m \implies f(x) \geq r).$
		\item $\lim\limits_{x \to \infty} f(x) = -\infty \iff \forall r \in F \; \exists m \in F \; \forall x \in U \; (x \geq m \implies f(x) \leq r).$
	\end{enumerate}

	We say that negative infinity is a limit point (from above) when U is not bounded below, i.e. $\forall m \in F \; \exists x \in U \; x \leq m$. When U is not bounded below and $b \in F$, we make the following definitions:
	\begin{enumerate}
		\item $\lim\limits_{x \to -\infty} f(x) = b \iff \forall \epsilon > 0 \; \exists m \in F \; \forall x \in U \; (x \leq m \implies |f(x) - b| \leq \epsilon).$
		\item $\lim\limits_{x \to -\infty} f(x) = \infty \iff \forall r \in F \; \exists m \in F \; \forall x \in U \; (x \leq m \implies f(x) \geq r).$
		\item $\lim\limits_{x \to -\infty} f(x) = -\infty \iff \forall r \in F \; \exists m \in F \; \forall x \in U \; (x \leq m \implies f(x) \leq r).$
	\end{enumerate}
\end{defn}

\begin{thm}[Two-sided Limits]
	Let F be a subfield of $\bb{R}$. Let $A \subseteq F$. Let $f: A \to F$. Let $a \in F$. SPS that a is a limit point of A both from above and below. Then $\forall u \in F$, we have $\lim\limits_{x \to a} f(x) = u \iff \lim\limits_{x \to a^-} f(x) = u = \lim\limits_{x \to a^+} f(x)$.
\end{thm}

\begin{thm}[Sequential Characterization of Limits of Functions]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$ and $u \in F$.
	\begin{enumerate}
		\item When $a \in F$ is a limit point of A, $\lim\limits_{x \to a} f(x) = u$ iff for every sequence $\langle x_k \rangle$ in $A \setminus \{a\}$ with $x_k \to a$ we have $f(x_k) \to u$.
		\item When a is a limit point of A from below, $\lim\limits_{x \to a^-} f(x) = u$ iff for every sequence $\langle x_k \rangle$ in $\{x \in A | x < a\}$ with $x_k \to a$ we have $f(x_k) \to u$.
		\item When a is a limit point of A from above, $\lim\limits_{x \to a^+} f(x) = u$ iff for every sequence $\langle x_k \rangle$ in $\{x \in A | x > a\}$ with $x_k \to a$ we have $f(x_k) \to u$.
		\item When A is not bounded above, $\lim\limits_{x \to \infty} f(x) = u$ iff for every sequence $\langle x_k \rangle$ in A with $x_k \to \infty$ we have $f(x_k) \to u$.
		\item When A is not bounded below, $\lim\limits_{x \to -\infty} f(x) = u$ iff for every sequence $\langle x_k \rangle$ in A with $x_k \to -\infty$ we have $f(x_k) \to u$.
	\end{enumerate}
\end{thm}

\begin{remark}
	It follows form the Sequential Characterization of Limits of Functions that all the theorems about limits of sequences (see \hyperref[chp2]{Chapter 2}) imply analogous theorems in the more general setting of limits of functions. We will state those theorems for easier reference.
\end{remark}

\begin{thm}[Local Determination of Limits]
	Let F be a subfield of $\bb{R}$, let $A, B \subseteq F$, let $f: A \to F$ and $g: B \to F$. SPS that $a \in F$ is a limit point of both sets A and B, and that for some $\delta > 0$ we have $C = \{x \in A \; | \; 0 < |x - a| \leq \delta\} \subseteq \{x \in B \; | \; 0 < |x - a| \leq \delta\}$ and that f(x) = g(x) for all $x \in C$. Then for $u \in \hat{F}$
		\[
			\lim_{x \to a} g(x) = u \iff \lim_{x \to a} f(x) = u
		\]
	Analogous results hold for limits $x \to a^\pm$ and $x \to \pm \infty$.
\end{thm}

\begin{thm}[Uniqueness of Limits]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$ and let $a \in F$ be a limit point of A. For $u, v \hat{F}$,
		\[
			\lim_{x \to a} f(x) = u \land \lim_{x \to a} f(x) = v \implies u = v
		\]
	Analogous result holds for limits $x \in a^\pm$ and $x \to \pm \infty$.
\end{thm}

\begin{thm}[Extended Operations on Limits]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f, g: A \to F$, and let $a \in F$ be a limit point of A. Let $u ,v \in \cap{F}$, and SPS that $\lim_{x \to a} f(x) = u$ and $\lim_{x \to a} g(x) = v$. Then
	\begin{enumerate}
		\item $u \pm v \in \hat{F} \implies \lim_{x \to a} (f \pm g)(x) = u \pm v$
		\item $uv \in \hat{F} \implies \lim_{x \to a} (f \cdot g)(x) = uv$
		\item $\frac{u}{v} \in \hat{F} \implies \lim_{x \to a} (\frac{f}{g})(x) = \frac{u}{v}$
	\end{enumerate}
	Analogous results hold for limits $x \to a^\pm$ and $x \to \pm \infty$.
\end{thm}

\begin{thm}[Basic Elementary Functions Acting on Limits]
	For $A \subseteq \bb{R}$, let $f: A \to \bb{R}$ and $a, b \in \bb{R}$ with a as a limit point of A. We have
	\begin{enumerate}
		\item $\lim_{x \to a} f(x) = b > 0 \implies \lim_{x \to a} f(x)^c = b^c$ \\
			  $\lim_{x \to a} f(x) = \infty \implies \lim_{x \to a} f(x)^c = \begin{cases}
			  	\infty 	& c > 0 \\
			  	1		& c = 0 \\
			  	0		& c < 0
			  \end{cases}$ \\
			  $\forall x \in A \; (f(x) > 0 \land \lim_{x \to a} f(x) = 0) \implies \lim_{x \to a} f(x)^c = \begin{cases}
			  	0		& c > 0 \\
			  	1		& c = 0 \\
			  	\infty 	& c < 0
			  \end{cases}$
		\item $\lim_{x \to a} f(x) = \infty \land c > 0 \implies \lim_{x \to a} c^{f(x)} = \begin{cases}
				\infty		& c > 1 \\
				1			& c = 1 \\
				0 			& c < 1
			  \end{cases}$ \\
			  $\lim_{x \to a} f(x) = b \land c > 0 \implies \lim_{x \to a} c^{f(x)} = c^b$ \\
			  $\lim_{x \to a} f(x) = -\infty \land c > 0 \implies \lim_{x \to a} c^{f(x)} = \begin{cases}
			  	\infty 		& c < 1 \\
			  	1			& c = 1 \\
			  	0 			& c > 1
			  \end{cases}$
		\item $\lim_{x \to a} f(x) = b > 0 \land c > 0 \implies \lim_{x \to a} \log_c f(x) = \log_c b$ \\
			  $\lim_{x \to a} f(x) = \infty \land c > 0 \implies \lim_{x \to a} \log_c f(x) = \begin{cases}
			  	\infty 	& c > 1 \\
			  	0 		& c = 1 \\
			  	-\infty & c < 1
			  \end{cases}$ \\
			  $\forall x \in A \; (f(x) > 0 \land \lim\limits_{x \to a} f(x) = 0 \land 1 \neq c > 0) \implies \lim\limits_{x \to a} \log_c f(x) = \begin{cases}
			  	-\infty 	& c > 1 \\
			  	\infty 		& c < 1
			  \end{cases}$
		\item $\lim_{x \to a} f(x) = b \implies (\lim_{x \to a} \sin f(x) = \sin b \land \lim_{x \to a} \cos f(x) = \cos b)$ \\
			  The limits $\lim_{x \to \pm \infty} \sin x, \lim_{x \to \pm \infty} \cos x, \text{ and } \lim_{x \to \pm \infty} \tan x$ do not exists.
		\item $\forall x \in A \; (f(x) \in [-1, 1] \land \lim_{x \to a} f(x) = b) \implies \lim_{x \to a} \arcsin f(x) = \arcsin b$. \\
			  $\lim_{x \to a} f(x) = b \in \bb{R} \implies \lim_{x \to a} \arctan f(x) = \arctan b$ \\
			  $\lim_{x \to a} f(x) = \infty \implies \lim_{x \to a} \arctan f(x) = \frac{\pi}{2}$ and \\
			  $\lim_{x \to a} f(x) = -\infty \implies \lim_{x \to a} \arctan f(x) = -\frac{\pi}{2}$.
	\end{enumerate}

	Similar results hold for limits $x \to a^\pm$ and $x \to \pm \infty$ (unless stated otherwise in the above statements).
\end{thm}

\begin{thm}[Comparison Theorem for Functions]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f, g: A \to F$ and let $a \in F$ be a limit point of A. SPS that $\forall x \in A \; f(x) \leq g(x)$. Then
	\begin{enumerate}
		\item $\exists u, v \in \hat{F} \; (\lim\limits_{x \to a} f(x) = u \land \lim\limits_{x \to a} g(x) = v) \implies u \leq v.$
		\item $\lim\limits_{x \to a} f(x) = \infty \implies \lim\limits_{x \to a} g(x) = \infty,$ and
		\item $\lim\limits_{x \to a} g(x) = -\infty \implies \lim\limits_{x \to a} f(x) = -\infty.$
 	\end{enumerate}
 	Similar results hold for when $x \to a^\pm$ and $x \to \pm \infty$.
\end{thm}

\begin{thm}[Squeeze Theorem for Functions]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f, g, h: A \to F$, let $b \in F$ and let a be a limit point of A. We have that
	\begin{enumerate}
		\item $\forall x \in A \; \Big(f(x) \leq g(x) \leq h(x) \land \lim\limits_{x \to a} f(x) = b = \lim\limits_{x \to a} h(x) \Big) \implies \lim\limits_{x \to a} g(x) = b.$
		\item $\forall x \in A \; \Big(|f(x)| \leq g(x) \land \lim\limits_{x \to a} g(x) = 0 \Big) \implies \lim\limits_{x \to a} f(x) = 0$
	\end{enumerate}
\end{thm}

\section{Continuity}

\begin{defn}[Continuity]
	Let F be a subfield of $\bb{R}$, let $A \in F$, and let $f: A \to F$. For all $a \in A$, we say that f is continuous at a iff
	\[
		\forall a \in A \; \forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in A \; (|x - a| \leq \delta \implies |f(x) - f(a)| \leq \epsilon)
	\]
	(Note that $\delta$ depends on $a, f, \text{ and, especially, } \epsilon$ in general).

	f is said to be continuous (in A) when f is continuous at every point $a \in A$.
\end{defn}

\begin{defn}[Limit Point and Continuity]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$ and let $a \in A$. Then
	\begin{enumerate}
		\item if a is not a limit point of A then f is continuous on a; and
		\item if a is a limit point of A, then f is continuous on a iff $\lim_{x \to a} f(x) = f(a)$.
	\end{enumerate}
\end{defn}

\begin{thm}[Sequential Characterization of Continuity]\label{seq_char_cts}
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$ and let $a \in A$. Then f is continuous at a iff for every sequence $\langle x_k \rangle$ in A with $x_k \to a$ we have $f(x_k) \to f(a)$.
\end{thm}

\begin{thm}[Operations on Continuous Functions]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f, g: A \to F$, let $a \in A$ and let $c \in F$. SPS that f and g are continuous at a. Then the functions cf, f $\pm$ g and fg are call continuous at a, and if $g(a) \neq 0$, then the function $\frac{f}{g}$ is continuous at a.
\end{thm}

\begin{thm}[Composition of Continuous Functions]
	Let F be a subfield of $\bb{R}$, let $A, b \subseteq \bb{R}$, and let $f: A \to \bb{R}$ and $g: B \to \bb{R}$. Let $h = g \circ f : C \to \bb{R}$ where $C = A \cap f^{-1}(B)$
	\begin{enumerate}
		\item If f is continuous at $a \in C$ and g is continuous at f(a), then h is continuous at a.
		\item If f is continuous (in A) and g is continuous (in B), then h is continuous (in C).
	\end{enumerate}
\end{thm}

\begin{crly}[Continuity of Elementary Functions]
	Every elementary function is continuous (in their respective domain).
\end{crly}

\begin{thm}[Functions Acting on Limits]
	Let F be a subfield of $\bb{R}$, let $A, B \subseteq F$, let $f: A \to F$ and $g: B \to F$, and let $h = g \circ f : C \to F$ where $C = A \cap f^{-1}(B)$. Let s be a limit point of C (hence also of A) and let b be a limit point of B. Let $c \in F$. SPS that $\lim\limits_{x \to a} f(x) = a \land \lim\limits_{y \to b} g(y) = c$. SPS either that $\forall x \in C \setminus \{a\} \; f(x) \neq b$ or g is continuous at b. Then $\lim\limits_{x \to a} h(x) = c$.
\end{thm}

\begin{thm}[Intermediate Value Theorem]
	Let I be an interval in $\bb{R}$ and let $f: I \to \bb{R}$ be continuus (in I). Let $a, b \in I$ with $a \leq b$ and let $y \in \bb{R}$.
	\begin{equation*}
		\min \{f(a), f(b)\} \leq y \leq \max \{f(a), f(b)\} \implies \exists x \in [a, b] \; (f(x) = y)
	\end{equation*}
\end{thm}

\begin{proof}
	WLOG SPS $f(a) \leq y \leq f(b)$. $f(a) = y \implies x = a$ and $f(b) = y \implies x = b$. \\
	Thus STP for $f(a) < y < f(b)$
	\begin{gather*}
		A := \{t \in (a, b) \, | \, f(t) < y \} \\
		\because f(a) < y \enspace a \in A \implies A \neq \emptyset \\
		\because \forall t \in A \enspace t \leq b \implies A \text{ is bounded above}
	\end{gather*}
	By the \hyperref[completeness_R]{Completeness Property of $\bb{R}$},
	\begin{gather*}
		x := sup A \\
		\\
		WTP \; f(x) = y \\
	\end{gather*}
	Suppose, for contradiction, that $f(x) \neq y$.
	\begin{gather*}
		SPS \; f(x) < y \\
		\therefore x \in A \\
		\because x \neq b \enspace \exists \delta_1 > 0 \enspace [x, x + \delta_1] \subseteq [a, b] \\
		\because f \text{ is continuous} \\
		\text{fix } \epsilon = y - f(x) > 0 \enspace \exists \delta_2 > 0 \; \forall t \in [a, b] \\
		|t - x| < \delta_2 \implies |f(t) - f(x)| < \epsilon \implies f(t) < y \\
		\\
		\delta := \min\{\delta_1, \delta_2\} \enspace [x, x + \delta] \subseteq [a, b] \\
		\forall t \in [x, x + \delta] \enspace |t - x| < \delta \implies f(t) < y \\
		\implies f(x + \delta) < y \implies x < x + \delta \in A \implies x \neq \sup A
	\end{gather*}
	which is a contradiction.
	\begin{gather*}
		SPS \; f(x) > y \\
		\because x \neq a \enspace \exists \delta_1 > 0 \enspace [x - \delta_1, x] \subseteq [a, b] \\
		\because f \text{ is continuous} \\
		\text{fix } \epsilon = y - f(x) > 0 \enspace \exists \delta_2 > 0 \; \forall t \in [a, b] \\
		|t - x| < \delta_2 \implies |f(t) - f(x)| < \epsilon \implies f(t) > y \\
		\\
		\delta := \min\{\delta_1, \delta_2\} \enspace [x - \delta, x] \subseteq [a, b]
	\end{gather*}
	By the \hyperref[approx_prop]{Approximation Property for the Supremum}, we can have
	\begin{equation*}
		x - \delta < t \leq x \implies t \in A \implies f(t) < y
	\end{equation*}
	But
	\begin{gather*}
		\forall t \in [x - \delta, x] \enspace |t - x| < \delta \implies f(t) > y \\
	\end{gather*}
	which is, hence, our desired contradiction. Thus $f(x) = y$ for some $x \in [a, b]$.
\end{proof}

\begin{defn}[Maximum, Minimum and Extreme Values]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, and let $f: A \to F$. For $a \in A$, fi $f(x) \geq f(x)$ for every $x \in A$, then we say that f(a) is the maximum value of f or that f attains its maximum value at a. Similarly for $b \in A$, if $f(b) \leq f(x)$ for every $x \in A$, we say that f(b) is the minimum value of f, or that f attains its minimum at b.

	We say that f attains its extreme values in A when f attains its maximum value at some point $a \in A$ and f attains its minimum value at some point $b \in A$.
\end{defn}

\begin{thm}[Extreme Value Theorem]\label{EVT}
	Let $, b \in \bb{R}$ with $a < b$, and let $f: [a, b] \to \bb{R}$ be continuous. Then f attains its extreme values in $[a, b]$.
\end{thm}

\begin{defn}[Uniform Continuity]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, and let $f: A \to F$. We say that f is uniformly continuous in A when
	\[
		\forall \epsilon > 0 \; \exists \delta > 0 \; \forall a \in A \; \forall x \in A \; (|x - a| \leq \delta \implies |f(x) - f(a)| \leq \epsilon)
	\]
\end{defn}

\begin{thm}[Closed Bounded Intervals and Uniform Continuity]\label{closed_bounded_cts_fn_unif}
	Let $a, b \in \bb{R}$ with $a < b$ and let $f: [a, b] \to \bb{R}$. If f is continuous (on [a, b]) then f is uniformly continuous (on [a, b]).
\end{thm}

\begin{proof}
	SPS, for contradiction, that f is continous but not uniformly continuous.
	\begin{gather*}
		\because f \text{ is not uniformly continuous} \\
		\exists \epsilon > 0 \; \forall \delta > 0 \; \forall x, t \in [a, b] \\
		|t - x| < \delta \; \land \; |f(x) - f(t)| > \epsilon \\
		\\
		\forall k \in \bb{N} \enspace \exists x_k, t_k \in [a, b] \\
		|x_k - t_k| < \frac{1}{k} \; \land \; |f(x_k) - f(t_k)| > \epsilon
	\end{gather*}
	By the \hyperref[bolzano-weierstass_R]{Bolzano-Weierstass Theorem},
	\begin{equation*}
		\langle t_{k_j} \rangle := \{t_k \, | \, \forall j \in \bb{N}, k_j = k \} \enspace c := \lim_{j \to \infty} t_{k_j}
	\end{equation*}
	Also, construct (without using Bolzano-Weierstass),
	\begin{gather*}
		\langle x_{k_j} \rangle := \{x_k \, | \, \forall j \in \bb{N}, k_j = k \} \\
		\therefore \forall j \in \bb{N} \enspace |x_{k_j} - t_{k_j}| < \frac{1}{k_j} \; \land \; |f(x_{k_j}) - f(t_{k_j})| > \epsilon \\
		|x_{k_j} - t_{k_j}| < \frac{1}{k_j} \implies t_{k_j} - \frac{1}{k_j} < x_{k_j} < t_{k_j} + \frac{1}{k_j} \\
		\because t_{k_j} \to c \, \land \, \frac{1}{k_j} \to 0 \implies t_{k_j} \pm \frac{1}{k_j} \to c
	\end{gather*}
	By the \hyperref[squeeze_seq]{Squeeze theorem},
	\begin{equation*}
		x_{k_j} \to c
	\end{equation*}
	Since f is continuous, by the \hyperref[seq_char_cts]{Sequential Characterization of Continuity},
	\begin{gather*}
		f(t_{k_j}) \to f(c) \, \land \, f(x_{k_j}) \to f(c) \\
		\implies f(x_{k_j}) - f(t_{k_j}) \to 0 \\
		\implies \exists j \in \bb{N} \; |f(x_{k_j}) - f(t_{k_j})| < \epsilon
	\end{gather*}
	which is a contradiction.
\end{proof}

% =================================
% 		Chapter 4
% =================================
\chapter{Differentiability on \texorpdfstring{$\bb{R}$}{R}}

\section{The Derivative}

\begin{defn}[Differentiable on a Point]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, and let $a \in A$ be a limit point of A. We say that f is differentiable at a when the limit
	\[
		\lim_{x \to a} \frac{f(x) - f(a)}{x - a}
	\]
	exists in F. In this case we call the limit the derivative of f at a, and we denote that by $f'(a)$, so we have
	\[
		f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x - a}.
	\]
	When $a \in A$ is a limit point of A from the right, we sya that f is differentiable from the right at a and that $f'_+(a)$ is the derivative from the right of f at a, when
	\[
		f'_+(a) = \lim_{x \to a^+} \frac{f(x) - f(a)}{x - a}.
	\]
	Similarly, when $a \in A$ is a limit point of A from the left, we say that f is differentiable from the left at a and that $f'_{-}(a)$ is the derivative from the left of f at a when
	\[
		f'_{-}(a) = \lim_{x \to a^-} \frac{f(x) - f(a)}{x - a}.
	\]
\end{defn}

\begin{defn}[Differentiable in a Domain]
	We say that f is differentiable (in A) when f is differentiable at every point $a \in A$, or that f is in $C^1$. In this case, the derivative of f is the function $f': A \to F$ defined by
	\[
		f'(x) = \lim_{u \to x} \frac{f(u) - f(x)}{u - x}.
	\]
\end{defn}

\begin{defn}[Differentiable n-times \& n-th Derivative]
	When $f'$ is differentiable at a, we denote the derivative of $f'$ at a by $f''(a)$, and we call $f''(a)$ the second derivative of f at a. When $f''(a)$ exists for every a in A, we say that f is twice differentiable (in A), or that it is in $C^2$, and we call the function $f'': A \to F$ is called the second derivative of f. Similarly, $f'''(a)$ is he derivative of $f''$ at a, and so on.

	More generally, for any function $f: A \to F$, we define its derivative to be the function $f': B \to F$ where $B = \{a \in A | f \text{ is differentaible at a}\}$, and we define its second derivative to be the function $f'': C \to F$ where $C = \{a \in B | f' \text{ is differentiable at a}\}$, and so on.
\end{defn}

\begin{remark}
	Note that
	\[
		\lim_{x \to a} \frac{f(x) - f(a)}{x - a} = \lim_{h \to 0} \frac{f(a + h) - f(a)}{h}.
	\]
	To be precise, the limit on the left exists in F iff the limit on the right exists in F, and in this case the two limits are equal.
\end{remark}

\begin{thm}[Definition of Differentiablity in $\epsilon$-$\delta$]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$, and let $a \in A$ be a limit point of A. Then f is differentiable at a with derivative $f'(a) \iff$
	\[
		\forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in A \; (|x - a| \leq \delta \implies |f(x) - f(a) - f'(a)(x-a)| \leq \epsilon)
	\]
\end{thm}

\begin{defn}[Linearization \& Tangent Line]
	When $f: A \to F$ is differentiable at a with derivative $f'(a)$, the function
	\[
		l(x) = f(a) + f'(a)(x-a)
	\]
	is called the linearization of f at a.

	Note that the graph $y = l(x)$ of the linearization is the line through the point $(a, f(a))$ with slope $f'(a)$. This line is called the tangent line to the graph $y = f(x)$ at the point $(a, f(a))$.
\end{defn}

\begin{thm}[Differentiablility $\implies$ Continuity]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$ and let $a \in A$ be a limit point of A.
	\[
		\text{f is differentiable at a} \implies \text{f is continuous at a}.
	\]
\end{thm}

\section{Differentiability Theorems}

\begin{thm}[Local Determination of the Derivative]
	Let F be a subfield of $\bb{R}$, let $A, B \subseteq F$, let $f: A \to F$ and $g:B \to F$, and let $a \in A \cap B$ be a limit point of both A and B. SPS that for some $\delta > 0$ we have $\{ x \in A \; | \; |x - a| \leq \delta \} \subset \{x \in B \; | \; |x - a| \leq \delta\}$. If g is differentiable at a then so is f, and we have $f'(a) = g'(a)$.
\end{thm}

\begin{thm}[Operations on Derivatives]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f, g: A \to F$, let $a \in A$ be a limit point of A, and let $c \in F$. SPS that f and g are differentiable at a. Then
	\begin{enumerate}
		\item (Linearity) the functions cf and f $\pm$ g are differentiable at a with
			\[
				(cf)'(a) = cf'(a), \quad (f \pm g)'(a) = f'(a) \pm g'(a)
			\]
		\item (Product Rule) the function fg is differentiable at a with
			\[
				(fg)'(a) = f'(a)g(a) + f(a)g'(a)
			\]
		\item (Reciprocal Rule) if $g(a) \neq 0$ then the function 1/g is differentiable at a with
			\[
				(\frac{1}{g})'(a) = -\frac{g'(a)}{g(a)^2}
			\]
		\item (Quotient Rule) if $g(a) \neq 0$ then the function f/g is differentiable at a with
			\[
				(\frac{f}{g})'(a) = \frac{f'(a)g(a) - f(a)g'(a)}{g(a)^2}
			\]
	\end{enumerate}
\end{thm}

\begin{thm}[Chain Rule]
	Let F be a subfield of $\bb{R}$, let $A, B \subseteq F$, let $f: A \to F$, let $g:B \to F$ and let $h = g \circ f: C \to F$ where $C = A \cap f^{-1}(B)$. Let $a \in C$ be a limit point of C (hence also for A) and let $b = f(a) \in B$. SPS that f is differentiable at a and g is differentiable at b. Then h is differentiable at a with
	\[
		h'(a) = g'\big( f(a) \big)f'(a)
	\]
\end{thm}

\section{Inverse Function Theorems}

\begin{thm}[Monotonic Functions]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$ and let $f: A \to F$. Then f is monotonic iff f has the property that for all $a, b, c \in A$, if b lies between a and c, then f(b) lies between f(a) and f(c).
\end{thm}

\begin{thm}[Continuity and Strictly Monotonous Functions]
	Let I be an interval in $\bb{R}$, let $f: I \to \bb{R}$ and let J = f(I).
	\begin{enumerate}
		\item If f is continuous then its range J = f(I) is an interval in $\bb{R}$.
		\item If f is injective and continuous, then f is strictly monotonic.
		\item If $f: I \to J$ is strictly monotonic, then so is its inverse $g: J \to I$.
	\end{enumerate}
\end{thm}

\begin{thm}[Inverse Function Theorem]
	Let I be an interval in $\bb{R}$, let $f: I \to \bb{R}$ and let $J = f(I)$.
	\begin{enumerate}
		\item If f is bijective and continuous, then its inverse g is continuous.
		\item If f is bijective and continuous, and f is differentiable at a with $f'(a) \neq 0$, then its inverse g is differentiable a b = f(a) with $g'(b) = \frac{1}{f'(a)}$.
	\end{enumerate}
\end{thm}

\begin{thm}[Derivatives of the Basic Elementary Functions]
	The basic elementary functions have the following derivatives.
	\begin{enumerate}
		\item $(x^a)' = a x^{a-1}$ where $a, x \in \bb{R}$ and $x^{a - 1}$ is defined.
		\item $(a^x)' = (\ln a) \cdot a^x$ where $a > 0$ and $x \in \bb{R}$ and \\
		 	  $(\log_a x)' = \frac{1}{\ln a} \cdot \frac{1}{x}$ where $0 < a \neq 1$ and $x > 0$, and in particular \\
		 	  $(e^x)' = e^x$ for all $x \in \bb{R}$ and $(\ln x)' = \frac{1}{x}$ for all $x > 0$.
		\item $(\sin x)' = \cos x$ and $(\cos x)' = -\sin x$ for all $x \in \bb{R}$, and \\
			  $(\tan x)' = \sec^2 x$ and $(\sec x)' = \sec x \tan x$ for all $x \in \bb{R}$ with $x \neq \frac{\pi}{2} + k\pi, k \in \bb{Z}$,\\
			  $(\cot x)' = -\csc^2 x$ and $(\csc x)' = -\cot x \csc x$ for all $x \in \bb{R}$ with $x \neq \pi + k \pi, k \in \bb{Z}$.
		\item $(\arcsin x)' = \frac{1}{\sqrt{1 - x^2}}$ and $(\arccos x)' = \frac{-1}{\sqrt{1 - x^2}}$ for $|x| < 1$, \\
			  $(\sec^{-1} x)'' = \frac{1}{x \sqrt{x^2 - 1}}$ and $(\csc^{-1} x)' = \frac{-1}{x \sqrt{x^2 - 1}}$ for $|x| > 1$, and \\
			  $(\arctan x)' = \frac{1}{1 + x^2}$ and $(\cot^{-1} x)' = -\frac{1}{1 + x^2}$ for all $x \in \bb{R}$.
	\end{enumerate}
\end{thm}

\section{Mean Value Theorem}

\begin{defn}[Local Maximum and Minimum]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$ and let $a \in A$. We say that f has a local maximum value at a when
	\[
		\exists \delta > 0 \; \forall x \in A \; \big(|x-a| \leq \delta \implies f(x) \leq f(a) \big)
	\]
	Similarly, we say that f has a local minimum value at a when
	\[
		\exists \delta > 0 \; \forall x \in A \; \big( |x-a| \leq \delta \implies f(x) \geq f(a) \big)
	\]
\end{defn}

\begin{thm}[Fermat's Theorem]
	Let F be a subfield of $\bb{R}$, let $A \subseteq F$, let $f: A \to F$. SPS that $a \in A$ is a limit point of A, both from above and from below. SPS that f is differentiable at a and that f has a local maximum or minimum value at a. Then $f'(a) = 0$.
\end{thm}

\begin{thm}[Rolle's Theorem]
	SPS that $a, b \in \bb{R}$ with a < b. If $f: [a, b] \to \bb{R}$ is continuous on [a, b] and differentiable on (a, b), with f(a) = 0 = f(b), then there exists a point $c \in (a, b)$ such that $f'(c) = 0$.
\end{thm}

\begin{remark}
	The continuity hypothesis and differentiability hypothesis in Rolle's Theorem cannot be relaxed at even one point in [a, b].
\end{remark}

\begin{thm}[Mean Value Theorem]
	Let $a, b \in \bb{R}$ with a < b. If $f: [a, b] \to \bb{R}$ is differentiable on (a, b) and continuous on [a, b], then there exists a point $c \in (a, b)$ with
	\[
		f'(c) = \frac{f(b) - f(a)}{b - a}
	\]
\end{thm}

\begin{thm}[Cauchy/Generalized Mean Value Theorem]
	Let $a, b \in \bb{R}$ with a < b. If $f, g: [a, b] \to \bb{R}$ are differentiable on (a, b) and continuous on [a, b], then there exists a point $c \in (a, b)$ such that
	\[
		g'(c)\big( f(b) - f(a) \big) = f'(c)\big( g(b) - g(a) \big)
	\]
\end{thm}

\begin{crly}[Trichotomy of The Derivative]
	Let $a, b \in \bb{R}$ with a < b. Let $f: [a, b] \to \bb{R}$. SPS that f is differentiable in (a, b) and continuous at a and b.
	\begin{enumerate}
		\item $\forall x \in (a, b) \; f'(x) \geq 0 \implies $ f is increasing on [a, b].
		\item $\forall x \in (a, b) \; f'(x) > 0 \implies $ f is strictly increasing on [a, b].
		\item $\forall x \in (a, b) \; f'(x) \leq 0 \implies $ f is decreasing on [a, b].
		\item $\forall x \in (a, b) \; f'(x) < 0 \implies $ f is strictly decreasing on [a, b].
		\item $\forall x \in (a, b) \; f'(x) = 0 \implies $ f is constant on [a,b].
		\item If $g: [a ,b] \to \bb{R}$ is continuous at a and b and differentiable in 9a, b) with $g'(x) = f'(x)$ for all $x \in (a, b)$, then for some $c \in \bb{R}$ we have $g(x) = f(x) + c$ for all $x \in (a, b)$.
	\end{enumerate}
\end{crly}

\begin{crly}[The Second Derivative Test]
	Let I be an interval in $\bb{R}$, let $f: I \to \bb{R}$ and let $a \in I$. SPS that f is differentiable in I with $f'(a) = 0$.
	\begin{enumerate}
		\item If $f''(a) > 0$ then f has a local minimum at a.
		\item If $f''(a) < 0$ then f has a local maximum at a.
	\end{enumerate}
\end{crly}

\section{l'Hôpital's Rule}

\begin{thm}[l'Hôpital's Rule]
	Let I be a non degenerate interval in $\bb{R}$. Let $a \in I$, or let a be an endpoint of I. Let $f, g: I \setminus \{a\} \to \bb{R}$. SPS that f and g are differentiable in $I \setminus \{a\}$ with $g'(x) \neq 0$ for all $x \in I \setminus \{a\}$. SPS further that $\lim\limits_{x \to a} f(x) = \lim\limits_{x \to a} g(x) = 0 \text{ or } \pm \infty$, and suppose that $\lim\limits_{x \to a} \frac{f'(x)}{g'(x)} \in \hat{\bb{R}}$. Then
	\[
		\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}
	\]
\end{thm}

% =================================
% 		Chapter 5
% =================================
\chapter{Integrability on \texorpdfstring{$\bb{R}$}{R}}

\section{The Riemann Integral}

\begin{defn}[Partition \& Subintervals]
	A partition of the closed interval [a, b] is a set $X = \{x_0, x_1, ..., x_n\}$ with
	\[
		a = x_0 < x_1 < x_2 < \hdots < x_n = b.
	\]
	The intervals $[x_{i-1}, x_i]$ are called the subintervals of [a, b], and we write
	\[
		\Delta_i x = x_i - x_{i-1}
	\]
	for the size of the $i^{th}$ subinterval. Note that
	\[
		\sum_{i=1}^{n} \Delta_i x = b - a
	\]
	The size (or norm) of the partition X, denoted by $\Delta X$ is
	\[
		\Delta X = \max \{\Delta_i x | 1 \leq i \leq n\}
	\]
	i.e. $\Delta X$ is the largest subinterval in X.
\end{defn}

\begin{defn}[The Riemann Sum]
	Let X be a partition of [a, b], and let $f: [a, b] \to \bb{R}$ be bounded. A Riemann sum for f on X is a sum of the form
	\[
		S = \sum_{i=1}^{n} f(t_i) \Delta_i x \quad \text{for some } t_i \in [x_{i - 1}, x_i].
	\]
	The points $t_i$ are called sample points.
\end{defn}

\begin{defn}[(Riemann) Integrable]
	Let $f: [a, b] \to \bb{R}$ be bounded. We say that f is (Riemann) integrable on [a, b] when
	\begin{gather*}
		\exists I \in \bb{R} \; \forall \epsilon > 0 \; \exists \delta > 0 \; \forall X = \{x_0, x_1, ..., x_n\} \\
		\Delta X < \delta \implies \bigg(\forall t_i \in [x_{i -1}, x_i] \quad \Bigg|\sum_{i=1}^{n} f(t_i) \Delta_i x - I \Bigg| < \epsilon \bigg)
	\end{gather*}
	where $X = \{x_0, x_1, ..., x_n\}$ is a partition on [a, b].

	The number I is unique, and it is called the (Riemann) integral of f on [a, b], and we write
	\[
		I = \int_{a}^{b} f, \text{ or } I = \int_{a}^{b} f(x) \, dx
	\]
\end{defn}

\section{Upper and Lower Riemann Sums}

\begin{defn}[Upper and Lower Riemann Sums]
	Let X be a partition for [a, b] and let $f: [a, b] \to \bb{R}$ be bounded. The upper Riemann sum for f on X, denoted by U(f, X), is
	\[
		U(f, X) = \sum_{i=1}^{n} M_i \Delta_i X \quad \text{where } M_i = \sup \{f(t) \; | \; t \in [x_{i-1}, x_i] \}
	\]
	and the lower Riemann sum for f on X, denoted L(f, X), is
	\[
		L(f, X) = \sum_{i = 1}^{n} m_i \Delta_i X \quad \text{where } m_i = \inf \{f(t) \; | \; t \in [x_{i-1}, x_i]\}
	\]
\end{defn}

\begin{remark}
	\begin{itemize}
		\item U(f, X) and L(f, X) are not necessarily Riemann sums themselves, since we do not always have $M_i = f(t_i)$ or $m_i = f(s_i)$, for any $t_i, s_i \in [x_{i-1}, x_i]$.
		\item If f is increasing, then $M_i = f(x_i)$ and $m_i = f(x_{i-1})$, and in this case U(f, X) and L(f, X) are Riemann sums.
		\item Similarly, if f is decreasing, then $M_i = f(x_{i-1})$ and $m_i = f(x_i)$, and U(f, X) and L(f, X) are Riemann sums.
		\item If f is continuous, then by the \hyperref[EVT]{Extreme Value Theorem}, we have $M_i = f(t_i)$ and $m_i = f(s_i)$ for some $t_i, s_i \in [x_{i-1}, x_i]$, and so in this case U(f, X) and L(f, X) are again Riemann sums.
	\end{itemize}
\end{remark}

\begin{thm}[Upper and Lower Riemann Sums and the Riemann Sum]
	Let X be a partition of [a, b] and let $f: [a, b] \to \bb{R}$ be bounded. Then
	\begin{align*}
		U(f, X) &= \sup \left\{\sum_{i=1}^{n} f(t_i) \Delta_i x \; \Bigg| \; t_i \in [x_{i-1}, x_i] \right\} \\
		L(f, X) &= \inf \left\{\sum_{i=1}^{n} f(t_i) \Delta_i x \; \Bigg| \; t_i \in [x_{i-1}, x_i] \right\}
	\end{align*}
	In particular, for every Riemann sum S for f on X we have
	\[
		L(f, X) \leq \sum_{i=1}^{n} f(t_i) \Delta_i x \leq U(f, X)
	\]
	for every $t_i \in [x_{i-1}, x_i]$.
\end{thm}

\begin{thm}[Partition Refinement]\label{partition_refinement}
	Let $f: [a, b] \to \bb{R}$ be bounded with upper and lower bounds M and m. Let $X = \{x_0, x_1, ..., x_n\}$ and $Y = \{y_0, y_1, ..., y_q\}$ be partitions of [a, b] such that $\{x_0, x_1, ..., x_n\} \subseteq \{y_0, y_1, ..., y_q\}$ (or $q \geq n$). Then
	\begin{gather*}
		U(f, X) - (M - m)(q - n) \Delta X \leq U(f, Y) \leq U(f, X) \\
		L(f, X) \leq L(f, Y) \leq L(f, X) + (M - m)(q - n) \Delta X
	\end{gather*}
\end{thm}

\begin{remark}
	Let X and Y be partitions of [a, b] with $X \subset Y$. Then
	\[
		L(f, X) \leq L(f, Y) \leq U(f, Y) \leq U(f, X)
	\]
\end{remark}

\begin{defn}[Upper and Lower Integral]
	Let $f: [a, b] \to \bb{R}$ be bounded. The upper integral of f on [a, b], denoted by U(f), is given by
	\[
		U(f) = \inf \{U(f, X) | \text{ X is a partition of [a, b]} \}
	\]
	and the lower integral of f on [a, b], denoted by L(f), is given by
	\[
		L(f) = \sup \{L(f, X) | \text{ X is a partition of [a, b]} \}.
	\]
\end{defn}

\begin{thm}[Upper Integral $\geq$ Lower Integral]
	Let $f: [a, b] \to \bb{R}$. We always have $L(f) \leq U(f)$.
\end{thm}

\begin{thm}[Equivalent Definitions of Integrability]
	Let $f: [a, b] \to \bb{R}$ be bounded. Then TFAE:
	\begin{enumerate}
		\item f is integrable on [a, b].
		\item $\forall \epsilon > 0 \; \exists \text{ partition } X \; U(f, X) - L(f, X) < \epsilon$.
		\item L(f) = U(f).
	\end{enumerate}
\end{thm}

\begin{proof}
	$((1) \implies (2))$
	By assumption,
	\begin{gather*}
		\exists I \in \bb{R} \enspace \forall \epsilon > 0 \enspace \exists \delta > 0 \enspace \forall P = \{x_0 = a, x_1, ..., x_n = b\} \\
		\Delta_i x := |x_i - x_{i-1}| \enspace \Delta P := \max\{\Delta_i x \, | \, i \in \bb{Z}^+\} \\
		\Delta P < \delta \implies \forall t_i \in [x_{i-1}, x_i] \; \left| \sum_{i=1}^{n} f(t_i) \Delta_i x - I \right| < \epsilon \\
		\\
		\forall i \in \bb{Z}^+ \enspace M_i := \{f(t_i) \, | \, t_i \in [x_{i-1}, x_i] \} \enspace m_i := \{f(t_i) \, | \, t_i \in [x_{i-1}, x_i]\}
	\end{gather*}
	By the \hyperref[approx_prop]{Approximation Property for the Supremum and Infimum},
	\begin{gather*}
		\forall i \in \bb{Z}^+ \\
		\exists s_i \in [x_{i-1}, x_i] \enspace M_i - \frac{\epsilon}{4n} < f(s_i) < M_i \\
		\implies U(f, P) - \frac{\epsilon}{4} < \sum_{i=1}^{n} f(s_i) \Delta_i x \leq U(f, P) \implies \left| U(f, P) - \sum_{i=1}^{n} f(s_i) \Delta_i x \right| < \frac{\epsilon}{4} \\
		\text{and} \\
		\exists r_i \in [x_{i-1}, x_i] \enspace m_i \leq f(r_i) \leq m_i + \frac{\epsilon}{4n} \\
		\implies L(f, P) \leq \sum_{i=1}^{n} f(r_i) \Delta_i x \leq L(f, P) + \frac{\epsilon}{4} \implies \left| \sum_{i=1}^{n} f(r_i) \Delta_i x - L(f, P) \right| < \frac{\epsilon}{4} \\
		\\
		S_1 := \sum_{i=1}^{n} f(s_i) \Delta_i x \quad S_2 := \sum_{i=1}^{n} f(r_i) \Delta_i x \\
	\end{gather*}
	By the Triangle Inequality,
	\begin{align*}
		|U(f, P) - L(f, P)| &\leq |U(f, P) - S_1| + |S_1 - I| + |I - S_2| + |S_2 - L(f, P)| \\
							&\leq \frac{\epsilon}{4} + \frac{\epsilon}{4} + \frac{\epsilon}{4} + \frac{\epsilon}{4} \\
							&= \epsilon
	\end{align*}

	$((2) \implies (3))$
	By assumption,
	\begin{equation*}
		\forall \epsilon > 0 \enspace \exists P_n = \{x_0, x_1, ..., x_n\} \enspace U(f, P_n) - L(f, P_n) < \frac{\epsilon}{3}
	\end{equation*}
	Since
	\begin{align*}
		U(f) &= \inf \{U(f, P) \, | \, P \text{ is a partition} \} \\
		L(f) &= \sup \{L(f, P) \, | \, P \text{ is a partition} \}
	\end{align*}
	By the \hyperref[approx_prop]{Approximation Property for the Supremum and Infimum},
	\begin{gather*}
		\exists P_1 \enspace U(f) \leq U(f, P_1) < U(f) + \frac{\epsilon}{3} \\
		\exists P_2 \enspace L(f) - \frac{\epsilon}{3} < L(f, P_2) \leq L(f)
	\end{gather*}
	By \hyperref[partition_refinement]{Partition Refinement}, choose
	\begin{gather*}
		P = P_1 \cup P_2 \text{ so that} \\
		U(f) \leq U(f, P) \leq U(f, P_1) < U(f) + \frac{\epsilon}{3} \\
		L(f) - \frac{\epsilon}{3} < L(f, P_2) \leq L(f, P) \leq L(f)
	\end{gather*}
	Therefore,
	\begin{align*}
		U(f) - L(f) &= (U(f) - U(f, P)) + (U(f, P) - L(f, P)) + (L(f, P) - L(f)) \\
					&< \frac{\epsilon}{3} + \frac{\epsilon}{3} + \frac{\epsilon}{3} \\
					&= \epsilon
	\end{align*}
	WTP $0 \leq U(f) - L(f)$ \\
	Let $P_0, P_1, P_2, ...$ be partitions such that $\forall k \in \bb{N} \enspace P_k$ is finer than $P_{k-1}$. \\
	By \hyperref[partition_refinement]{Partition Refinement}, we have that $\forall k \in \bb{N}$
	\begin{gather*}
		L(f, P_0) \leq L(f, P_1) \leq \hdots \leq L(f, P_k) \leq U(f, P_k) \leq U(f, P_{k - 1}) \leq \hdots \leq U(f, P_0) \\
		\therefore \forall k \in \bb{N} \enspace L(f, P_k) \leq U(f, P_k)
	\end{gather*}
	By \hyperref[comparison_seq]{Comparison Theorem},
	\begin{gather*}
		\lim_{k \to \infty} L(f, P_k) = L(f) \leq U(f) = \lim_{k \to \infty} U(f, P_k) \\
		\implies 0 \leq U(f) - L(f)
	\end{gather*}
	Thus
	\begin{equation*}
		0 \leq U(f) - L(f) \leq \epsilon
	\end{equation*}
	Since $\epsilon > 0$, it follows that
	\begin{equation*}
		0 = U(f) - L(f) \implies U(f) = L(f)
	\end{equation*}

	$((3) \implies (2))$ \\
	\begin{equation*}
		\forall \epsilon > 0 \enspace \exists X_0 \enspace |U(f) - U(f, X_0)| < \frac{\epsilon}{2} \enspace \exists X_1 \enspace |L(f) - L(f, X_1)| < \frac{\epsilon}{2}
	\end{equation*}
	By \hyperref[partition_refinement]{Partition Refinement},
	\begin{equation*}
		\exists X = X_0 \cup X_1 \quad |U(f) - U(f, X)| < \frac{\epsilon}{2} \quad |L(f) - L(f, X)| < \frac{\epsilon}{2}
	\end{equation*}
	\begin{align*}
		\implies U(f, X) - L(f, X) &= U(f, X) - U(f) + U(f) - L(f) - L(f) + L(f) - L(f, X) \\
								   &< \frac{\epsilon}{2} + 0 + \frac{\epsilon}{2} \\
								   &= \epsilon
	\end{align*}

	$((3) \implies (1))$
	\begin{gather*}
		\exists I \in \bb{R} \enspace I = U(f) = L(f) \quad \forall \epsilon > 0 \\
		\because (3) \implies (2) \enspace \exists X_0 := (x_0, x_1, ..., x_n) \enspace U(f) - U(f, X_0) < \frac{\epsilon}{2} \quad L(f) - L(f, X_0) < \frac{\epsilon}{2} \\
		\exists \delta = \frac{\epsilon}{2(n-1)(M - m)} > 0 \quad \forall X \text{ that is a partition} \quad \Delta X < \delta \\
		Y := X \cup X_0
	\end{gather*}
	Since Y is constructed from the arbitrary partition X by adding at most n - 1 points (from $X_0$), the size of each interval in partition Y is either smaller or equal to those of partition X, thus $\Delta Y < \delta$. Also, by \hyperref[partition_refinement]{Partition Refinement},
	\begin{gather*}
		U(f, X) - U(f, Y) \leq (M - m)(n - 1) \Delta X \enspace \land \enspace L(f, Y) - L(f, X) \leq (M - m)(n - 1) \Delta X \\
		\text{Note: } U(f, Y) \leq U(f, X_0) \quad L(f, X_0) \leq L(f, Y) \\
		X := (y_0, y_1, ..., y_k) \enspace \Delta_i y := |y_i - y_{i-1} | \enspace \forall t_i \in [y_{i-1}, y_i]
	\end{gather*}
	\begin{align*}
		\sum_{i=1}^{k} f(t_i) \Delta_i y - I &\leq U(f, X) - U(f) \\
											 &= U(f, X) - U(f, Y) + U(f, Y) - U(f) \\
											 &\leq U(f, X) - U(f, Y) + U(f, X_0) - U(f) \\
											 &< \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon \\
		I - \sum_{i=1}^{k} f(t_i) \Delta_i y &\leq L(f) - L(f, X) \\
											 &= L(f) - L(f, Y) + L(f, Y) - L(f, X) \\
											 &\leq L(f) - L(f, X_0) + L(f, Y) - L(f, X) \\
											 &< \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon
	\end{align*}
\end{proof}

\section{Evaluating Integrals of Continuous Functions}

\begin{thm}[Every Continuous Functions are Integrable]
	Let $f: [a, b] \to \bb{R}$ be continuous. Then f is integrable on [a, b].
\end{thm}

\begin{proof}
	By \hyperref[closed_bounded_cts_fn_unif]{Closed Bounded Intervals and Uniform Continuity}, f is uniformly continuous. Thus
	\begin{gather*}
		\forall \epsilon > 0 \; \exists \delta > 0 \; \forall x, y \in [a, b] \\
		|x - y| < \delta \implies |f(x) - f(y)| < \epsilon \\
		\\
		\forall X \text{ that is a partition}
	\end{gather*}
	By \hyperref[EVT]{Extreme Value Theorem}, for some i
	\begin{gather*}
		\exists t_i \in [x_{i - 1} , x_i] \; M_i = f(t_i) \quad \exists s_i \in [x_{i - 1}, x_i] \; m_i = f(s_i) \\
		|t_i - s_i| \leq |x_i - x_{i-1}| \leq \Delta X < \delta \implies |M_i - m_i| = |f(t_i) - f(s_i)| < \frac{\epsilon}{b - a}
	\end{gather*}
	\begin{align*}
		U(f, X) - L(f, X) &= \sum |M_i - m_i| \Delta_i x \\
						  &= \sum |f(t_i) - f(s_i)| \Delta_i x \\
						  &\leq \sum \frac{\epsilon}{b - a} \Delta_i x \\
						  &\leq \frac{\epsilon}{b - a} (b - a) = \epsilon
	\end{align*}
\end{proof}

\begin{lemma}[Summation Formulas]
	We have
	\[
		\sum_{i=1}^{n} 1 = n, \quad \sum_{i = 1}^{n} i = \frac{n(n+1)}{2}, \quad \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}, \quad \sum_{i=1}^{n} i^3 = \frac{n^2 (n+1)^2}{4}
	\]
\end{lemma}

\section{Basic Properties of Integrals}

\begin{thm}[Linearity]
	Let f and g be integrable on [a, b] and let $c \in \bb{R}$. Then f + g and cf are both integrable on [a, b] and
	\[
		\int_{a}^{b} (f+g) = \int_{a}^{b} f + \int_{a}^{b} g
	\]
	and
	\[
		\int_{a}^{b} cf = c \int_{a}^{b} f
	\]
\end{thm}

\begin{thm}[Comparison Theorem for Integrals]
	Let f and g be integrable on [a, b]. If $f(x) \leq g(x)$ for all $x \in [a, b]$ then
	\[
		\int_{a}^{b} f \leq \int_{a}^{b} g.
	\]
\end{thm}

\begin{thm}[Additivity]
	Let $a < b < c$ and let $f: [a, c] \to \bb{R}$ be bounded. Then f is integrable on [a, c] iff f is integrable both on [a, b] and on [b, c], and in this case
	\[
		\int_{a}^{b} f + \int_{b}^{c} f = \int_{a}^{c} f.
	\]
\end{thm}

\begin{defn}[Integral at a Point \& Integral from the Right]
	We define $\int_{a}^{a} f = 0$ and for a < b we define $\int_{b}^{a} f = -\int_{a}^{b} f$.
\end{defn}

\begin{note}
	Using the above definition, the Additivity Theorem extends to the case that a, b, c $\in \bb{R}$ are not in increasing order: for any a, b, c $\in \bb{R}$, if f is integrable on $[\max \{a, b, c\}, \min \{a, b, c\}]$ then
	\[
		\int_{a}^{b} f + \int_{b}^{c} f = \int_{a}^{c} f.
	\]
\end{note}

\begin{thm}[Estimation]
	Let f be integrable on [a, b]. Then $|f|$ is integrable on [a, b] and
	\[
		\left|\int_{a}^{b} f \right| \leq \int_{a}^{b} |f|
	\]
\end{thm}

\section{Fundamental Theorem of Calculus}

\begin{note}
	For a function F, defined on an interval containing [a, b], we write
	\[
		[F(x)]_a^b = F(b) - F(a).
	\]
\end{note}

\begin{thm}[The Fundamental Theorem of Calculus]
	\begin{enumerate}
		\item Let f be integrable on [a, b]. Define $F: [a, b] \to \bb{R}$ by
			\[
				F(x) = \int_{a}^{x} f = \int_{a}^{x} f(t) \, dt
			\]
			Then F is continuous on [a, b]. Moreover, if f is continuous at a point $x \in [a, b]$, then F is differentiable at x and
			\[
				F'(x) = f(x).
			\]
		\item Let f be integrable on [a, b]. Let F be differentiable on [a, b] with $F' = f$. Then
			\[
				\int_{a}^{b} f = \lbrack F(x) \rbrack_a^b = F(b) - F(a)
			\]
	\end{enumerate}
\end{thm}

\begin{defn}[Antiderivative]
	A function F such that $F' = f$ on an interval is called an antiderivative of f on the interval.
\end{defn}

% =================================
% 		Chapter 6
% =================================
\chapter{Series of \texorpdfstring{$\bb{R}$}{R}}

\section{Introduction}

\begin{defn}[Series]
	Let $\{a_n\}_{n \geq k}$ be a sequence. The series $\sum_{n \geq k} a_n$ is defined to be the sequence $\{S_l\}_{l \geq k}$ where
	\[
		S_l = \sum_{n = k}^{l} a_n = a_k + a_{k + 1} + a_{k + 2} + \hdots + a_l
	\]
	The term $S_l$ is called the $l^{th}$ partial sum of the series $\sum_{n \geq k} a_n$. The sum of the series, denoted by
	\[
		S = \sum_{n = k}^{\infty} a_n = a_k + a_{k + 1} + a_{k + 2} + \hdots ,
	\]
	is the limit of the sequence of the partial sums, if it exists, and we say that the series converges when the sum exists and is finite.
\end{defn}

\begin{eg}[Geometric Series]
	For $a \neq 0$, the series $\sum_{n \geq k} a_n$ converges iff $|r| < 1$, and in this case
	\[
		\sum_{n = k}^{\infty} ar^n = \frac{ar^k}{1 - r}.
	\]
\end{eg}

\begin{thm}[First Finitely Many Terms Do Not Affect Convergence]
	Let $\{a_n\}_{n \geq k}$ be a sequence. Then for any interger $m \geq k$, the series $\sum_{n \geq k} a_n$ converges iff the series $\sum_{n \geq m} a_n$ converges, and in this case
	\[
		\sum_{n = k}^{\infty} a_n = (a_k + a_{k + 1} + \hdots + a_{m - 1}) + \sum_{n = m}^{\infty} a_n.
	\]
\end{thm}

\begin{defn}[Error]
	When we approximate a value x by the value y, the error in our approximation is $|x - y|$.
\end{defn}

\begin{thm}[Linearity]\label{series_linearity}
	If $\sum a_n$ and $\sum b_n$ are convergent series then
	\begin{enumerate}
		\item for any $c \in \bb{R}$, $\sum ca_n$ converges and $\sum\limits_{n=k}^{\infty} ca_n = c \sum\limits_{n=k}^{\infty} a_n$, and
		\item the series $\sum (a_n + b_n)$ converges and $\sum\limits_{n=k}^{\infty} (a_n + b_n) = \sum\limits_{n=k}^{\infty} a_n + \sum\limits_{n=k}^{\infty} b_n$
	\end{enumerate}
\end{thm}

\begin{thm}[Series of Positive Terms]
	Let $\sum a_n$ be a series.
	\begin{enumerate}
		\item If $a_n \geq 0$ for all $n \geq k$ then either $\sum a_n$ converges or $\sum\limits_{n = k}^{\infty} a_n = \infty$.
		\item If $a_n \leq 0$ fora ll $n \geq k$ then either $\sum a_n$ converges or $\sum\limits_{n = k}^{\infty} a_n = -\infty$.
	\end{enumerate}
\end{thm}

\begin{thm}[Cauchy Criterion]
	Let $\sum a_n$ be a series. Then $\sum a_n$ converges iff
	\[
		\forall \epsilon > 0 \; \exists N \in \bb{Z}_{\geq k} \; \forall l, m \in \bb{Z}_{\geq k} \; \Bigg(m > l > N \implies \left|\sum_{n = l +1}^{m} a_n \right| < \epsilon \Bigg)
	\]
\end{thm}

\section{Convergence Tests}

\begin{thm}[Divergence Test]
	If $\sum a_n$ converges then $\lim\limits_{n \to \infty} a_n = 0$. Equivalently, if $\lim\limits_{n \to \infty} a_n$ either does not exists, or exists but is not equal to 0, then $\sum a_n$ diverges.
\end{thm}

\begin{remark}
	Converse of the Divergence Test is false. E.g. $\sum \frac{1}{n}$ (Harmonic Series) diverges but $\lim\limits \frac{1}{n} = 0$.
\end{remark}

\begin{thm}[Integral Test]
	Let f(x) be positive and decreasing for $x \geq k$, and let $a_n = f(n)$ for all integers $n \geq k$. Then $\sum a_n$ converges iff $\int_{k}^{\infty} f(x) \, dx$ converges, and in this case, for any $l \geq k$ we have
	\[
		\int_{l + 1}^{\infty} f(x) \, dx \leq \sum_{n = l + 1}^{\infty} a_n \leq \int_{l}^{\infty} f(x) \, dx
	\]
\end{thm}

\begin{crly}[p-Series]
	The series
	\[
		\sum_{k = 1}^{\infty} \frac{1}{k^p}
	\]
	converges iff $p > 1$.
\end{crly}

\begin{thm}[Comparison Test]
	SPS that $0 \leq a_n \leq b_n$ for all $n \geq k$. Then if $\sum b_n$ converges, then so does $\sum a_n$ and in this case,
	\[
		\sum_{n = k}^{\infty} a_n \leq \sum_{n = k}^{\infty} b_n.
	\]
\end{thm}

\begin{thm}[Limit Comparison Test]
	Let $a_n \geq 0$ and let $b_n > 0$ for all $n \geq k$. SPS that $\lim\limits_{n \to \infty} \frac{a_n}{b_n} = r$. Then
	\begin{enumerate}
		\item if $r = \infty$ and $\sum a_n$ converges, then so does $\sum b_n$.
		\item if r = 0 and $\sum b_n$ conveges, then so does $\sum a_n$, and
		\item if $0 < r < \infty$, then $\sum a_n$ converges iff $\sum b_n$ converges.
	\end{enumerate}
\end{thm}

\begin{thm}[Ratio Test]
	Let $a_n > 0$ for all $n \geq k$. SPS $\lim\limits_{n \to \infty} \frac{a_{n + 1}}{a_n} = r$. Then
	\begin{enumerate}
		\item if $r < 1$, then $\sum a_n$ converges, and
		\item if $r > 1$, then $\lim\limits_{n \to \infty} a_n = \infty$ so $\sum a_n = \infty$
	\end{enumerate}
\end{thm}

\begin{defn}[Limit Supremum]
	The limit supremum of a sequence of real numbers $\{x_k\}$ is defined to be
	\[
		\limsup_{k \to \infty} x_k := \lim_{n \to \infty} \left( \sup_{k > n} x_k \right).
	\]
\end{defn}

\begin{thm}[Root Test]
	Let $a_n \geq 0$ for all $n \geq k$. Let $r = \limsup\limits_{n \to \infty} \sqrt[n]{a_n}$. Then
	\begin{enumerate}
		\item if $r < 1$, then $\sum a_n$ converges, and
		\item if r > 1, then $\lim_{n \to \infty} a_n = \infty$ so $\sum a_n = \infty$.
	\end{enumerate}
\end{thm}

\begin{remark}
	The Root and Ratio Tests are inconclusive when r = 1.
\end{remark}

\begin{defn}[Alternating Sequence]
	A sequence $\{a_n\}_{n \geq k}$ is said to be alternating when either we have $a_n = (-1)^n|a_n|$ for all $n \geq k$ or we have $a_n = (-1)^{n + 1}|a_n|$ for all $n \geq k$.
\end{defn}

\begin{thm}[Alternating Series Test]
	Let $\{a_n\}_{n \geq k}$ be an alternating series. If $\{|a_n|\}$ is decreasing with $\lim\limits_{n \to \infty} |a_n| = 0$, then $\sum_{n \geq k} a_n$ converges, and in this case
	\[
		\left| \sum_{n=k}^{\infty} a_n \right| \leq |a_k|
	\]
\end{thm}

\begin{defn}[Converge Absolutely \& Converge Conditionally]
	A series $\sum_{n \geq k} a_n$ is said to converge absolute when $\sum_{n \geq k} |a_n|$ converges.

	The series is said to converge conditionally if $\sum_{n \geq k} a_n$ converges but $\sum_{n \geq k} |a_n|$ diverges.
\end{defn}

\begin{thm}[Absolute Converges $\implies$ Convergence]
	If $\sum |a_n|$ converges then so does $\sum a_n$.
\end{thm}

\section{Fubini's Theorem for Series}\label{fubinithm_series}
\begin{defn}[Multiplication of Series]\label{series_multiplication}
	SPS that $\sum_{n \geq 0} |a_n|$ and $\sum_{n \geq 0} b_n$ both converge, and define $c_n = \sum\limits_{k = 0}^{n} a_n b_{n - k}$. Then $\sum_{n \geq 0} c_n$ converges and
	\[
		\sum_{n = 0}^{\infty} c_n = \left( \sum_{n = 0}^{\infty} a_n \right) \left(\sum_{n = 0}^{\infty} b_n \right)
	\]
\end{defn}

\begin{thm}[Fubini's Theorem for Series]
	Let $a_{n, m} \in \bb{R}$ for all $n, m \geq 0$. SPS that $\sum_{m \geq 0} |a_{n, m}|$ converges for each $n \geq 0$ and that $\sum\limits_{n \geq 0} \left(\sum\limits_{m = 0}^{\infty} |a_{n, m}| \right)$ converges. Then$\sum_{m \geq 0} a_{n, m}$ converges for all $n \geq 0$, $\sum\limits_{n \geq 0} \left( \sum\limits_{m = 0}^{\infty} a_{n, m} \right)$ converges, $\sum_{n \geq 0} a_{n, m}$ converges for all $m \geq 0, \sum\limits_{m \geq 0} \left(\sum\limits_{n = 0}^{\infty} a_{n, m} \right)$ converges, and
	\[
		\sum_{n = 0}^{\infty} \left(\sum_{m = 0}^{\infty} a_{n, m} \right) = \sum_{m = 0}^{\infty} \left(\sum_{n = 0}^{\infty} a_{n, m} \right)
	\]
\end{thm}

% =================================
% 		Chapter 7
% =================================
\chapter{Sequences and Series of Functions}

\section{Pointwise Convergence}

\begin{defn}[Pointwise Convergence of Sequences of Functions]
	Let $I \subset \bb{R}$, let $f: I \to \bb{R}$, and for each interger $n \geq k$ let $f_n : I \to \bb{R}$. We say that the sequence of functions $\{f_n\}_{n \geq k}$ converges pointwise to f on I, and write $f_n \to f$ pointwise on I, when $\lim\limits_{n \to \infty} f_n(x) = f(x)$ for all $x \in I$, i.e.
	\[
		\forall x \in I \; \forall \epsilon > 0 \; \exists N \geq k \; \forall n \geq k \; (n > N \implies |f_n(x) - f(x)| < \epsilon)
	\]
\end{defn}

\begin{remark}
	Not that by the \hyperref[CauchyCriterion_Seq]{Cauchy Criterion for Convergence (for sequences)}, the sequence $\{f_n\}_{n \geq k}$ converges pointwise to some function f(x) on I iff
	\[
		\forall x \in I \; \forall \epsilon > 0 \; \exists N \geq k \; \forall n, m \geq k \; (n, m > N \implies |f_n(x) - f_m(x)| < \epsilon)
	\]
\end{remark}

\section{Uniform Convergence}

\begin{defn}[Uniform Convergence of Sequences of Functions]
	Let $I \subset \bb{R}$, let $f: I \to \bb{R}$, and for each integer $n \geq k$, let $f_n: I \to \bb{R}$. We say that the sequence of functions $\{f_n\}_{n \geq k}$ converges uniformly to f on I, and write $f_n \to f$ uniformly on I, when
	\[
		\forall \epsilon > 0 \; \exists N \geq k \; \forall x \in I \; \forall n \geq k \; (n > N \implies |f_n(x) - f(x)| < \epsilon)
	\]
\end{defn}

\begin{thm}[Cauchy Criterion for Pointwise Convergence - Sequence of Functions]\label{Cauchy_pointwise_seq_fn}
	Let $\{f_n\}_{n \geq k}$ be a sequence of functions on $I \subset \bb{R}. \; \exists g: I \to \bb{R} \quad f_n \to g$ pointwise on I as $n \to \infty$
	\begin{align*}
		\iff &\forall x \in I \; \forall \epsilon > 0 \; \exists N \geq k \; \forall m, n \geq k \\
			 &( m, n \geq N \implies |f_m(x) - f_n(x)| < \epsilon )
	\end{align*}
\end{thm}

\begin{thm}[Cauchy Criterion for Uniform Convergence - Sequence of Functions]
	Let $\{f_n\}_{n \geq k}$ be a sequence of functions on $I \subset \bb{R}. \; \exists g: I \to \bb{R} \quad f_n \to g$ uniformly on I as $n \to \infty$
	\begin{align*}
		\iff &\forall \epsilon > 0 \; \exists N \geq k \; \forall x \in I \; \forall n, m \geq k \; \\
			 &( n, m > N \implies |f_n(x) - f_m(x)| < \epsilon )
	\end{align*}
\end{thm}

\begin{proof}
	SPS that the sequence of functions $\langle f_n \rangle$ converges uniformly to some function $g: I \to \bb{R}$ as $n \to \infty$.
	\begin{gather*}
		SPS \; \exists g(x) := \lim_{n \to \infty} f_n(x) \quad g: I \to \bb{R} \text{ such that } \\
		\forall \epsilon > 0 \; \exists N \in \bb{Z}_{\geq k} \; \forall x \in I \; \forall n \in \bb{Z}_{\geq k} \\
		n \geq N \implies |f_n(x) - g(x)| < \frac{\epsilon}{2} \\
		\implies \forall s, t \in \bb{Z}_{\geq k} \enspace s, t \geq N
	\end{gather*}
	\begin{align*}
		\implies |f_s(x) - f_t(x)| &\leq |f_s(x) - g(x)| + |g(x) - f_t(x)| \\
								   &\leq \epsilon
	\end{align*}

	\begin{gather*}
		SPS \; \forall \epsilon > 0 \; \exists N \in \bb{Z}_{\geq k} \; \forall x \in I \; \forall k, l \in \bb{Z}_{\geq k} \\
		k, l \geq N \implies |f_k(x) - f_l(x)| \leq \epsilon \\
		\\
		\forall x \in I \; \{f_n(x)\} := \{f_k(x), f_{k + 1}(x), ...\} \text{ is a Cauchy sequence} \\
	\end{gather*}
	By \hyperref[Cauchy_pointwise_seq_fn]{Cauchy Criterion for Pointwise Convergence},
	\begin{gather*}
		g(x) := \lim_{n \to \infty} f_n(x) \quad g:I \to \bb{R} \\
		\text{i.e. } f_n \to g \text{ pointwise on } I
	\end{gather*}
	Then for each $x \in I$,
	\begin{equation*}
		\exists t \in \bb{Z}_{\geq k} \enspace t \geq N \implies |f_l(x) - g(x)| < \frac{\epsilon}{2}
	\end{equation*}
	Thus,
	\[
		\forall \epsilon > 0 \; \exists N \in \bb{Z}_{\geq k} \; \forall x \in I \; \forall s, t \in \bb{Z}_{\geq k}
	\]
	\begin{align*}
		|f_s(x) - g(x)| &\leq |f_s(x) - f_l(x)| + |f_l(x) - g(x)| \\
						&\leq \epsilon
	\end{align*}
\end{proof}

\begin{thm}[Uniform Convergence, Limits and Continuity - Sequence of Functions]
	SPS that $f_n \to f$ uniformly on I. Let x be a limit point of I. If $\lim_{y \to x} f_n(y)$ exists for each n, then
	\begin{equation*}
		\lim_{y \to x} \lim_{n \to \infty} f_n(y) = \lim_{n \to \infty} \lim_{y \to x} f_n(y)
	\end{equation*}
	In particular, if each $f_n$ is continuous on I, then so is f.
\end{thm}

\begin{proof}
	\begin{gather*}
		SPS \; \forall n \in \bb{Z}^+ \; g_n := \lim_{y \to x} f_n(y) \\
		STP \; \lim_{n \to \infty} g_n = \lim_{y \to x} f(y)
	\end{gather*}
	Claim: $\{g_n\}$ converges.
	\begin{gather*}
		\forall \epsilon > 0 \; \exists N \in \bb{Z}^+ \; \forall s, t \in \bb{Z}^+ \; \left(s, t \geq N \implies |f_s(y) - f_t(y)| < \frac{\epsilon}{3} \right) \\
		\because g_n = \lim_{y \to x} f_n(y) \quad |f_s(y) - g_s| < \frac{\epsilon}{3} \enspace |f_t(y) - g_t| < \frac{\epsilon}{3} \\
		\implies |g_s - g_t| \leq |g_s - f_s(y)| + |f_s(y) - f_t(y)| + |f_t(y) - g_t| < \epsilon
	\end{gather*}
	By \hyperref[CauchyCriterion_Seq]{Cauchy Criterion for Sequences}, $\{g_n\}$ converges. Thus,
	\begin{gather*}
		g := \lim_{n \to \infty} g_n \qquad STP \; g = \lim_{y \to x} f(y) \\
		\forall \epsilon > 0 \; \exists N \in \bb{Z}^+ \; \forall y \in I \; \forall n \in \bb{Z}^+ \\
		\left( n \geq N \implies |f_n(y) - f(y)| < \frac{\epsilon}{3} \; \land \; |g - g_n| < \frac{\epsilon}{3}  \right) \\
		\because g_n = \lim_{y \to x} f_n(y) \quad |f_n(y) - g_n| < \frac{\epsilon}{3} \\
		\therefore |g - f(y)| \leq |g - g_n| + |g_n - f_n(y)| + |f_n(y) - f(y)| < \epsilon
	\end{gather*}
	Furthermore,
	\begin{equation*}
		SPS \; \forall n \in \bb{Z}^+ \; \forall a \in I \; \forall \epsilon > 0 \; \exists \delta > 0 \; \forall y \in I \; \left( 0 < |y - a| < \delta \implies |f_n(y) - f_n(a)| < \frac{\epsilon}{3}  \right) \\
	\end{equation*}
	By the above argument, and since $f_n \to f$ uniformly on I, for each a and y in our assumption,
	\begin{gather*}
		|f(y) - f_n(y)| < \frac{\epsilon}{3} \quad |f_n(a) - f(a)| < \frac{\epsilon}{3} \\
		\therefore \forall a \in I \; \forall \epsilon > 0 \; \exists \delta > 0 \; \forall y \in I \quad 0 < |y - a| < \delta \\
		\implies |f(y) - f(a)| \leq |f(y) - f_n(y)| + |f_n(y) - f_n(a)| + |f_n(a) - f(a)| < \epsilon
	\end{gather*}
	Thus f is continuous on I by definition.
\end{proof}

\begin{remark}
	The above theorem allows us to ``interchange'' limit notations.
\end{remark}

\begin{thm}[Uniform Convergence and Integration - Sequence of Functions]
	SPS that $f_n \to f$ uniformly on [a, b]. If each $f_n$ is integrable on [a, b] then so is f. In this case, if $g_n(x) = \int_{a}^{x} f_n(t) \,dt$ and $g(x) = \int_{a}^{x} f(t) dt$, then $g_n \to g$ uniformly on [a, b]. In particular, we have
	\[
		\lim_{n \to \infty} \int_{a}^{b} f_n(x) \, dx = \int_{a}^{b} \lim_{n \to \infty} f_n(x) \, dx
	\]
\end{thm}

\begin{remark}
	The above theorem can be interpretted as if we have a sequence of integrable functions, $f_n$ on a closed domain [a, b], then the function that the sequence of functions converge uniformly to, i.e. f, is also integrable on [a, b].

	Moreover, we can ``interchange'' the limit and integration signs in the function.
\end{remark}

\begin{thm}[Uniform Convergence and Differentiation - Sequence of Functions]
	Let $\{f_n\}$ be a sequence of functions on [a, b]. SPS that each $f_n$ is differentiable on [a, b], $\{f_n'\}$ converges uniformly on [a, b], and $\{f_n(c)\}$ converges for some $c \in [a, b]$. Then $\{f_n\}$ converges uniformly on [a, b], $\lim\limits_{n \to \infty} f_n(x)$ is differentiable, and
	\[
		\frac{d}{dx} \lim_{n \to \infty} f_n(x) = \lim_{n \to \infty} \frac{d}{dx} f_n(x)
	\]
\end{thm}

\begin{remark}
	The above theorem allows us to ``interchange'' the process of differentiation and taking the limit of a sequence of function.
\end{remark}

\section{Series of Functions}
\begin{defn}[Series of Functions]
	Let $\{f_n\}_{n \geq k}$ be a sequence of functions on $I \subseteq \bb{R}$. The series of functions $\sum\limits_{n \geq k} f_n(x)$ is defined to be the sequence $\{S_l(x)\}$ where $S_l(x) = \sum\limits_{n = k}^{l} f_n(x)$. The function $S_l(x)$ is called the $l^{th}$ partial sum of the series. We say that the series $\sum\limits_{n \geq k} f_n(x)$ converges pointwise (or uniformly) on I when the sequence $\{S_l\}$ converges, pointwise (or uniformly) on I. In this case, the sum of the series of functions is defined to be the function
	\[
		f(x) = \sum_{n = k}^{\infty} f_n(x) = \lim_{n \to \infty} S_l = \lim_{n \to \infty} \sum_{n = k}^{l} f_n(x)
	\]
\end{defn}

\begin{note}
	Many of the following theorems have similar proofs to the earlier two sections.
\end{note}

\begin{thm}[Cauchy Criterion for Uniform Convergence - Series of Functions]
	The series $\sum_{n \geq k} f_n(x)$ converges uniformly (to some function f) on I
	\[
		\iff \forall \epsilon > 0 \; \exists N \geq k \; \forall x \in I \; \forall m, l \geq k \; \Bigg(m > l > N \implies \left|\sum_{n = l + 1}^{m} f_n(x) \right| < \epsilon \Bigg)
	\]
\end{thm}

\begin{thm}[Uniform Convergence, Limits and Continuity - Series of Functions]\label{unif_conv_series_fn}
	SPS that $\sum_{n \geq k} f_n(x)$ converges uniformly on I. Let x be a limit point of I. If $\lim\limits_{y \to x} f_n(y)$ exists for all $n \geq k$, then
	\[
		\lim_{y \to x} \sum_{n = k}^{\infty} f_n(y) = \sum_{n = k}^{\infty} \lim_{y \to x} f_n(y)
	\]
	In particular, if each $f_n(x)$ is continuous on I, then so is $\sum_{n = k}^{\infty} f_n(x)$.
\end{thm}

\begin{thm}[Term-by-Term Integration]
	SPS that $\sum_{n \geq k} f_n(x)$ converges uniformly on [a, b]. If each $f_n(x)$ is integrable on [a, b], then so is $\sum_{n \geq k} f_n(x)$. In this case, if $g_n(x) := \int_{a}^{x} f_n(t) \, dt$ and $g(x) := \int_{a}^{x} \sum_{n = k}^{\infty} f_n(t) \, dt$, then $\sum_{n \geq k} g_n(x)$ converges uniformly to g(x) on I. In particular, we have
	\[
		\int_{a}^{b} \sum_{n = k}^{\infty} f_n(x) \, dx = \sum_{n = k}^{\infty} \int_{a}^{b} f_n(x) \, dx
	\]
\end{thm}

\begin{thm}[Term-by-Term Differentiation]
	SPS that each $f_n(x)$ is differentiable on [a, b], $\sum_{n \geq k} f'_n(x)$ converges uniformly on [a, b], and $\sum_{n \geq k} f_n(c)$ converges for some $c \in [a, b]$. Then $\sum_{n \geq k} f_n(x)$ converges uniformly on [a, b], and
	\[
		\frac{d}{dx} \sum_{n = k}^{\infty} f_n(x) = \sum_{n = k}^{\infty} \frac{d}{dx} f_n(x)
	\]
\end{thm}

\begin{thm}[Weierstrass M-Test]
	SPS that $f_n$ is bounded with $|f_n(x)| \leq M_n$ for all $n \geq k$ and $x \in I$, and $\sum_{n \geq k} M_n$ converges. Then $\sum_{n \geq k} f_n(x)$ converges uniformly on I.
\end{thm}

\section{Power Series}
\begin{defn}[Power Series]
	A power series centered at a is a series of the form $\sum\limits_{n \geq 0} a_n (x - a)^n$ for some real numbers $a_n$, where we use the convention that $(x - a)^0 = 1$.
\end{defn}

\begin{lemma}[Abel's Formula]
	Let $\{a_n\}$ and $\{b_n\}$ be sequences. Then we have
	\[
		\sum_{n = m}^{l} a_n b_n + \sum_{[p = m]}^{l - 1} \left( \sum_{n = m}^{p} a_n \right) (b_{p -1} - b_p) = \left(\sum_{n = m}^{l} a_n \right) b_l
	\]
\end{lemma}

\begin{thm}[The Interval and Radius of Convergence]
	Let $\sum\limits_{n \geq 0} a_n (x - a)^n$ be a power series and let $R = \frac{1}{ \limsup\limits_{n \to \infty} \sqrt[n]{|a_n|} } \in [0, \infty)\ $. Then the set of $x \in \bb{R}$ for which the power series converges is an interval I centered at a of radius R. Indeed
	\begin{enumerate}
		\item $|x - a| > R \implies \lim\limits_{n \to \infty} a_n (x - a) \neq 0 \implies \sum\limits_{n \geq 0} a_n (x - a)^n$ diverges,
		\item $|x - a| < R \implies \sum\limits_{n \geq 0} a_n (x - a)^n$ converges absolutely,
		\item $0 < r < R \implies \sum\limits_{n \geq 0} a_n (x - a)^n$ converges uniformly in $[a - r, a + r]$.
	\end{enumerate}
\end{thm}

\begin{thm}[Abel's Theorem]
	Let $\sum\limits_{n \geq 0} a_n (x - a)^n$ be a power series and let $R = \frac{1}{ \limsup\limits_{n \to \infty} \sqrt[n]{|a_n|} } \in [0, \infty)\ $. If $\sum_{n \geq 0} a_n (x - a)^n$ converges when $x = a + R$, then the convergence is uniform on $[a, a + R]$, and, similarly, if $\sum_{n \geq 0} a_n (x - a)^n$ converges when $x = a - R$ then the convergence is uniform on $[a - R, a]$.
\end{thm}

\begin{defn}[Interval and Radius of Convergence]
	The number R is the previous 2 theorems is called the radius of convergence, and the interval I is called the interval of convergence of the power series.
\end{defn}

\section{Operations on Power Series}

\begin{thm}[Continuity of Power Series]
	SPS that the power series $\sum a_n (x - a)^n$ converges in an interval I. Then the sum $f(x) = \sum_{n = 0}^{\infty} a_n (x - a)^n$ is continuous on I.
\end{thm}

\begin{proof}
	This follows from \hyperref[unif_conv_series_fn]{uniform convergence} of $\sum a_n (x - a)^n$ in closed subintervals of I.
\end{proof}

\begin{thm}[Addition and Subtraction of Power Series]
	SPS that the power series $\sum a_n (x-a)^n$ and $\sum b_n (x-a)^n$ both converge in the interval I. Then $\sum (a_n + b_n)(x-a)^n$ and $\sum (a_n - b_n)(x-a)^n$ both converge in I, and for all $x \in I$ we have
	\[
		\left( \sum_{n=0}^{\infty} a_n (x-a)^n \right) \pm \left( \sum_{n=0}^{\infty} b_n (x-a)^n \right) = \sum_{n=0}^{\infty} (a_n \pm b_n)(x-a)^n
	\]
\end{thm}

\begin{proof}
	This follows from \hyperref[series_linearity]{linearity}.
\end{proof}

\begin{thm}[Multiplication of Power Series]
	SPS that the power series $\sum a_n (x-a)^n$ and $\sum b_n (x-a)^n$ both converge in an open interval I wuth $a \in I$. Let $c_n = \sum\limits_{k=0}^{n} a_k b_{n-k}$. Then $\sum c_n (x-a)^n$ converges in I and for all $x \in I$ we have
	\[
		\sum_{n=0}^{\infty} c_n (x-a)^n = \sum\limits_{k=0}^{n} a_k b_{n-k} = \left( \sum_{n=0}^{\infty} a_n (x-a)^n \right) \left( \sum_{n=0}^{\infty} b_n (x-a)^n \right)
	\]
\end{thm}

\begin{proof}
	This follows from \hyperref[series_multiplication]{Multiplication of Series}, since the power series converge absolutely on I.
\end{proof}

\begin{thm}[Division of Power Series]
	SPS that the power series $\sum a_n (x-a)^n$ and $\sum b_n (x-a)^n$ both converge in an open interval I wuth $a \in I$ and that $b_0 \neq 0$. Define $c_n$ by
	\[
		c_0 = \frac{a_0}{b_0}, \text{ and for } n > 0, \; c_n = \frac{a_n}{b_n} - \frac{b_n c_0}{b_0} - \frac{b_{n-1} c_1}{b_{n-1}} - \hdots - \frac{b_1 c_{n-1}}{b_1}.
	\]
	Then there is an open interval J with $a \in J$ such that $\sum c_n (x-a)^n$ converges in J and for all $x \in J$,
	\[
		\sum_{n = 0}^{\infty} = \frac{ \sum\limits_{n=0}^{\infty} a_n (x-a)^n }{ \sum\limits_{n=0}^{\infty} b_n (x-a)^n }.
	\]
\end{thm}

\begin{thm}[Composition of Power Series]
	Let $f(x) = \sum\limits_{n=0}^{\infty} a_n (x-a)^n$ in an open interval I with $a \in I$, and let $g(y) = \sum\limits_{m=0}^{\infty} b_m (y-b)^m$ in an open interval J with $b \in J$ and with $a_0 \in J$. Let K be an open interval with $a \in K$ such that $f(K) \subset J$. For each $m \geq 0$, let $c_{n, m}$ be the coefficients, found by multiplying power series, such that $\sum\limits_{n=0}^{\infty} c_{n, m} (x-a)^n = b_n \left( \sum\limits_{n=0}^{\infty} a_n (x-a)^n - b \right)^m$. Then $\sum_{m \geq 0} c_{n, m}$ converges for all $m \geq 0$, and for all $x \in K, \sum\limits_{n \geq 0} \left( \sum\limits_{m = 0}^{\infty} c_{n, m} \right)(x-a)^n$ converges and
	\[
		\sum_{n=0}^{\infty} \left( \sum_{m=0}^{\infty} c_{n, m} \right)(x-a)^n = g(f(x))
	\]
\end{thm}

\begin{proof}
	This follows from \hyperref[fubinithm_series]{Fubini's Theorem for Series} since
	\[
		g(f(x)) = \sum_{m=0}^{\infty} b_m (f(x) - b)^m = \sum_{m=0}^{\infty} \left(\sum_{n=0}^{\infty} a_n (x-a)^n - b \right) = \sum_{m=0}^{\infty} \left( \sum_{n=0}^{\infty} c_{n, m} (x-a)^n \right).
	\]
\end{proof}

\begin{thm}[Integration of Power Series]
	SPS that $\sum a_n (x-a)^n$ converges in the interval I. Then $\forall x\ in I$, the sum $f(x) = \sum_{n=0}^{\infty} a_n (x-a)^n$ is integrable on $[\min\{a, x\}, \max\{a, x\}]$ and
	\[
		\int_{a}^{x} \sum_{n=0}^{\infty} a_n (t-a)^n \, dt = \sum_{n=0}^{\infty} \int_{a}^{x} a_n (t-a)^n \, dt = \sum_{n=0}^{\infty} \frac{a_n}{n+1} (x-a)^{n+1}.
	\]
\end{thm}

\begin{thm}[Differentiation of Power Series]\label{power_series_differentiation}
	SPS that $\sum a_n (x-a)^n$ converges in the interval I. Then the sum $f(x) = \sum_{n=0}^{\infty} a_n (x-a)^n$ is differentiable in I and
	\[
		f'(x) = \sum_{n=1}^{\infty} a_n (x-a)^{n-1}.
	\]
\end{thm}

\section{Taylor Series}

\begin{thm}[Coefficients of the Taylor Series]
	SPS that $\sum_{n=0}^{\infty} a_n (x-a)^n$ in an open interval I centered at a. Then f is infinitely differentiable at a and for all $n \geq 0$, we have
	\[
		a_n = \frac{f^{(n)} (a)}{n!},
	\]
	where $f^{(n)}(a)$ denotes the n-th derivative of f at a.
\end{thm}

\begin{proof}
	By repeatedly applying \hyperref[power_series_differentiation]{Differentiation on Power Series}, we can obtain our desired result.
\end{proof}

\begin{defn}[Taylor Series and Polynomial]
	Given a function $f(x)$ whose derivatives of all order exists at x = a, we define the Taylor series of $f(x)$ centered at a to be the power series
	\[
		T(x) = \sum_{n \geq 0} a_n (x-a)^n \quad \text{where } a_n = \frac{f^{(n)}(a)}{n!}
	\]
	abd we define the $l^{th}$ Taylor Polynomial of $f(x)$ centered at a to be the $l^{th}$ partial sum
	\[
		T_l(x) = \sum_{n=0}^{l} a_n (x-a)^n \quad \text{where } a_n = \frac{f^{(n)}(a)}{n!}.
	\]
\end{defn}

\begin{thm}[Taylor's Theorem]
	Let $f(x)$ be infinitely differentiable in an open interval I with $a \in I$. Let $T_l(x)$ be the $l^{th}$ Taylor polynomial for $f(x)$ centered at a. Then for all $x \in I$ there exists a number c between a and x such that
	\[
		f(x) - T_l(x) = \frac{f^{(l + 1)}(c)}{(l + 1)!} (x-a)^{l+1}.
	\]
\end{thm}

\begin{thm}[(?) Accuracy of the Maclaurin Expansion]
	The functions $e^x, \sin x$ and $(1+x)^p$ are all exactly equal to the sum of their Taylor series centered at 0 in the interval of convergence.
\end{thm}

% =================================
% 		Chapter 8
% =================================
\chapter{Topology in Euclidean Space}

\section{Algebraic Structure}

\begin{defn}[Dot Product]
	For vectors $x, y \in \bb{R}^n$ we define the dot product of x and y to be
	\begin{equation*}
		x \dotp y = y^T x = \sum_{i=1}^{n} x_i y_i.
	\end{equation*}
\end{defn}

\begin{thm}[Properties of Dot Product]
	For all $x, y, z \in \bb{R}^n$ and for all $t \in \bb{R}$ we have
	\begin{enumerate}
		\item (Bilinearity)
			\begin{enumerate}
				\item $(x + y) \dotp z = x \dotp z + y \dotp z$,
				\item $(tx) \dotp y = t (x \dotp y)$,
				\item $x \dotp (y + z) = x \dotp y + x \dotp z$,
				\item $x \dotp (ty) = t (x \dotp y)$
			\end{enumerate}
		\item (Symmetry) $x \dotp y = y \dotp x$, and
		\item (Positive Definiteness) $x \dotp x \geq 0$ with $x \dotp x = 0 \iff x = \vec{0}$
	\end{enumerate}
\end{thm}

\begin{defn}[Norm]
	For a vector $x \in \bb{R}^n$, we define the norm (or length) of x to be
	\begin{equation*}
		|x| = \sqrt{x \dotp x} = \sqrt{\sum_{i=1}^{n} x_i^2}
	\end{equation*}
	We say that x is a unit vector when $|x| = 1$.
\end{defn}

\begin{thm}[Properties of Norm]
	Let $x, y \in \bb{R}^n$ and let $t \in \bb{R}$. Then
	\begin{enumerate}
		\item (Positive Definiteness) $|x| \geq 0$ with $|x| = 0 \iff x = \vec{0}$
		\item (Scaling) $|tx| = |t||x|$
		\item (Square of a basic Linear Combination) $|x \pm y|^2 = |x|^2 \pm 2(x \dotp y) + |y|^2$
		\item (The Polarization Identities) $x \dotp y = \frac{1}{2} (|x + y|^2 - |x|^2 - |y|^2) = \frac{1}{4} (|x + y|^2 - |x - y|^2)$
		\item (The Cauchy-Schwarz Inequality) $|x \dotp y| \leq |x||y|$ with $|x \dotp y| = |x||y| \iff $ the set $\{x, y\}$ is linearly dependent, and
		\item (The Triangle Inequality) $|x + y| \leq |x| + |y|$
	\end{enumerate}
\end{thm}

\begin{remark}[Linearly Dependent]
	Two vectors $x, y \in \bb{R}^n$ are said to be linearly dependent iff $x = ty$ for some $t \in \bb{R}$.
\end{remark}

\begin{defn}[Distance]
	For points $a, b \in \bb{R}^n$, we define the distance between and b to be
	\begin{equation*}
		\text{dist}(a, b) = |b - a|
	\end{equation*}
\end{defn}

\begin{thm}[Properties of Distance]
	Let $a, b, c \in \bb{R}$. Then
	\begin{enumerate}
		\item (Positive Definiteness) $\text{dist}(a, b) \geq 0$ with $\text{dist}(a, b) = 0 \iff a = b$
		\item (Symmetry) $\text{dist}(a, b) = \text{dist}(b, a)$
		\item (The Triangle Inequality) $\text{dist}(a, c) \leq \text{dist}(a, b) + \text{dist}(b, c)$
	\end{enumerate}
\end{thm}

\section{Topology in \texorpdfstring{$\bb{R}^n$}{Rn}}

\begin{defn}[Sphere, Open Ball, Closed Ball, Punctured Ball]
	For $a \in \bb{R}^n$ and $0 < r \in \bb{R}$, the sphere, the open ball, the closed ball, and the (open) punctured ball in $\bb{R}^n$ centered at a of radius r are defined to be the sets
	\begin{align*}
		S(a, r) 	  &= \{x \in \bb{R}^n \, | \, \text{dist}(x, a) = r \} = \{x \in \bb{R}^n \, | \, |a - x| = r\} \quad \text{(the sphere)}, \\
		B(a, r) 	  &= \{x \in \bb{R}^n \, | \, \text{dist}(x, a) < r \} = \{x \in \bb{R}^n \, | \, |a - x| < r\} \quad \text{(the open ball)}, \\
		\bar{B}(a, r) &= \{x \in \bb{R}^n \, | \, \text{dist}(x, a) \leq r \} = \{x \in \bb{R}^n \, | \, |a - x| \leq r\} \quad \text{(the closed ball)}, \\
		B^*(a, r)	  &= \{x \in \bb{R}^n \, | \, 0 < \text{dist}(x, a) < r \} = \{x \in \bb{R}^n \, | \, 0 < |a - x| < r\} \quad \text{([open] punctured ball)}
	\end{align*}
\end{defn}

\begin{defn}[Open and Closed Sets]
	For a set $A \subseteq \bb{R}^n$, we say that A is open (in $\bb{R}^n$) when
	\begin{equation*}
		\forall a \in A \; \exists r > 0 \; B(a, r) \subseteq A
	\end{equation*}
	We say that A is closed (in $\bb{R}^n$) when its complement $A^c = \bb{R}^n \setminus A$ is open in $\bb{R}^n$.
\end{defn}

\begin{remark}
	Note that we may also define a closed set to be:
	\begin{equation*}
		\forall A \subseteq \bb{R}^n \; \forall a \in A \; \exists r > 0 \; \bar{B}(a, r) \subseteq A
	\end{equation*}
	But we shall note that this definition can eventually be confusing.
\end{remark}

\begin{thm}[Basic Properties of Open Sets]
	\begin{enumerate}
		\item The sets $\emptyset$ and $\bb{R}^n$ are open in $\bb{R}^n$.
		\item If S is a set of open sets then the union $\bigcup S$ is open.
		\item If S is a finite set of open sets then the intersection $\bigcap S$ is open.
	\end{enumerate}
\end{thm}

\begin{thm}[Basic Properties of Closed Sets]
	\begin{enumerate}
		\item The sets $\emptyset$ and $\bb{R}^n$ are closed in $\bb{R}^n$.
		\item If S is a set of closed sets then the intersection $\bigcap S$ is closed.
		\item If S is a finite set of closed sets then the union $\bigcup S$ is closed.
	\end{enumerate}
\end{thm}

\section{Interior, Closure and Boundary}

\begin{defn}[Interior and Closure]
	Let $A \subseteq \bb{R}^n$. The interior of A (in $\bb{R}^n$) is the set
	\begin{equation*}
		A^0 = \bigcup \{ U \subseteq \bb{R}^n \, | \, U \text{ is open} \land U \subseteq A\}
	\end{equation*}
	The closure of A (in $\bb{R}^n$) is the set
	\begin{equation*}
		\bar{A} = \bigcap \{ K \subseteq \bb{R}^n \, | \, K \text{ is closed} \land A \subseteq K\}
	\end{equation*}
\end{defn}

\begin{thm}[Interior of a Set as Its Largest Open Set]
	Let $A \subseteq \bb{R}^n$. The interior of A is the largest open set which is contained in A. In other words, $A^0 \subseteq A$ and $A^0$ is open $\iff \forall \text{open set } U \subseteq A \; (U \subseteq A^0)$
\end{thm}

\begin{thm}[Closure of a Set as The Smallest Closed Set Containing It]
	Let $A \subseteq \bb{R}^n$. The closure of A is the smallest closed set that contains A. In other words, $A \subseteq \bar{A}$ and $\bar{A}$ is closed $\iff \forall \text{closed set } K \; (A \subseteq K) \; \bar{A} \subseteq K$
\end{thm}

\begin{crly}[Another Certificate for Open and Closed Sets]
	Let $A \subseteq \bb{R}^n$.
	\begin{enumerate}
		\item $(A^0)^0$ and $\bar{\bar{A}} = \bar{A}$.
		\item A is open iff $A = A^0$.
		\item A is closed iff $A = \bar{A}$.
	\end{enumerate}
\end{crly}

\begin{defn}[Interior, Isolated, Limit and Boundary Points]
	Let $A \subseteq \bb{R}^n$. An interior point of A is defined such that
	\begin{equation*}
		\forall a \in A \; \exists r > 0 \; B(a, r) \subseteq A
	\end{equation*}
	An isolated point of A is defined such that
	\begin{equation*}
		\forall a \in A \; \exists r > 0 \; B^*(a,r) \cap A = \emptyset \text{ or } B(a,r) \cap A = \{a\}
	\end{equation*}
	(i.e., in laymen's language, for all a in A, there are no other points in A that are close to a)

	A limit point of A is defined such that
	\begin{equation*}
		\forall a \in A \; \forall r > 0 \; B^*(a,r) \cap A \neq \emptyset
	\end{equation*}
	(i.e., in laymen's language, for all a in A, there is always points in A other than a that is close to a)

	The set of all limit points is denoted as $A'$.

	A boundary point of A is defined such that
	\begin{equation*}
		\forall a \in A \; \forall r > 0 \; ( B(a,r) \cap A \neq \emptyset \land B(a,r) \cap A^c \neq \emptyset)
	\end{equation*}
	(i.e., in laymen's language, for all a in A, there are always points that are in A and not in A that are near a in the same ``radius'')

	The set of all boundary points of A, denoted $\partial A$, is called the boundary of A.
\end{defn}

\begin{thm}[Equivalent Topological Definitions]\label{ETD}
	Let $A \subseteq \bb{R}^n$.
	\begin{enumerate}
		\item A is closed iff $A' \subseteq A$
		\item $\bar{A} = A \cup A'$
		\item $A^0$ is equal to the set of all interior points of A.
		\item $\partial A = \bar{A} \setminus A^0$
	\end{enumerate}
\end{thm}

\begin{proof}
	Part (1)
	\begin{align*}
		A \text{ is closed} &\iff A^c \text{ is open} \\
							&\iff \forall a \notin A \; \exists r > 0 \; B(a, r) \subseteq A^c \\
							&\iff \forall a \in \bb{R}^n (a \notin A \implies \exists r > 0 \; B(a, r) \cap A = \emptyset) \\
							&\iff \forall a \in \bb{R}^n (a \notin A \implies \exists r > 0 \; B^*(a, r) \cap A = \emptyset) \\
							&\iff \forall a \in \bb{R}^n (\forall r > 0 \; B^*(a, r) \cap A \neq \emptyset \implies a \in A) \quad \text{by contrapositive} \\
							&\iff \forall a \in \bb{R}^n (a \in A' \implies a \in A) \quad \text{by definition of a limit in $R^n$} \\
							&\iff A' \subseteq A
	\end{align*}

	Part (2) \\
	WTP $A \cup A'$ is the smallest cover of A. By definition of a cover, we first require $A \cup A'$ to be closed and contains A. Clearly, $A \subseteq A \cup A'$. It remains to prove that $(A \cup A')^c$ is open.
	\begin{gather*}
		\forall a \in (A \cup A')^c \; a \notin A \; \land \; a \notin A' \\
		\because a \notin A \; \exists r > 0 \; B(a, r) \cap A = \emptyset \\
	\end{gather*}
	WTP $B(a, r) \cap A' = \emptyset$. Suppose not.
	\begin{gather*}
		\forall b \in B(a, r) \cap A' \\
		\because b \in B(a, r) \quad \exists s > 0 \; B(b, s) \subseteq B(a, r) \\
		\because b \in A' \quad B^*(b, s) \cap A \neq \emptyset \; (\text{by definition of a Limit Point in $\bb{R}^n$}) \\
		\because B^*(b, s) \subseteq B(b, s) \subseteq B(a, r) \quad B(a, r) \cap A \neq \emptyset
	\end{gather*}
	which contradicts our earlier argument. Thus $B(a, r) \cap A' = \emptyset$.

	It remains to prove that $A \cup A'$ is the smallest cover of A. Let K be a cover of A. By defintion, $A \subseteq K$. STP $A' \subseteq K'$ since K is closed, which the conclusion will then follow from Part (1).
	\begin{align*}
		\forall a \in A' &\implies \forall r > 0 \; B(a, r) \cap A \neq \emptyset \\
						 &\implies \forall r > 0 \; B(a, r) \cap K \neq \emptyset \quad \text{since } A \subseteq K \\
						 &\implies a \in K'
	\end{align*}
	This completes the proof. \\

	Part (3) \\
	\begin{equation*}
		S := \{ X \subseteq \bb{R}^n \, | \, X \text{ is open} \, \land X \subseteq A \}
	\end{equation*}
	By definition, $A^0 = \bigcup S$.
	\begin{gather*}
		\forall a \in A^0 \; \exists X \in S \; a \in X \\
		\implies \exists r > 0 \; B(a, r) \subseteq X \subseteq A \\
	\end{gather*}
	$\implies$ a is an interior point of A. \\
	SPS a is an interior point of A. By definition,
	\begin{gather*}
		\exists r > 0 \; B(a, r) \subseteq A \\
		\because B(a, r) \text{ is open} \, \land \, B(a, r) \subseteq A \quad B(a, r) \in S \\
		\implies a \in B(a, r) \subseteq \bigcup S = A^0 \implies a \in A^0
	\end{gather*}
	This completes the proof. \\

	Part (4) \\
	\begin{gather*}
		\forall a \in \partial A \; \forall r > 0 \; (B(a, r) \cap A \neq \emptyset \, \land \, B(a, r) \cap A^c \neq \emptyset) \\
		WTP \; a \in \bar{A} \quad STP \; a \in \partial A \land a \notin A \implies a \in A' \\
		SPS \; a \notin A \quad \because B(a, r) \cap A \neq \emptyset \quad B^*(a, r) \cap A \neq \emptyset \\
		\implies \forall r > 0 \; B^*(a, r) \cap A \neq \emptyset \implies a \in A' \\
		\\
		WTP \; a \notin A^0 \quad SPS \; a \in A^0
	\end{gather*}
	By Part (3), a is an interior point of A.
	\begin{equation*}
		\exists s > 0 \; B(a, s) \subseteq A \implies B(a, s) \cap A^c = \emptyset
	\end{equation*}
	which is a contradiction to our assumption that $a \in \partial A$. \\
	Conversely,
	\begin{equation*}
		SPS \; \forall a \in \bar{A} \setminus A^0 \implies a \in A' \lor a \in A \land a \notin A^0
	\end{equation*}
	Case 1: $a \in A$
	\begin{gather*}
		\exists r > 0 \; B(a, r) \cap A \neq \emptyset \\
		WTP \; B(a, r) \cap A^c \neq \emptyset \quad SPS \; B(a, r) \cap A^c = \emptyset \\
		\therefore B(a, r) \subseteq A \quad \because a \notin A^0 \; \forall s > 0 \; B(a, s) \nsubseteq A
	\end{gather*}
	which is a contradiction. Thus $B(a, r) \cap A^c \neq \emptyset$. Thus, by definition, $a \in \partial A$. \\
	Case 2: $a \notin A$
	\begin{gather*}
		\because a \in \bar{A} \enspace a \in A' \implies \forall r > 0 \; B^*(a, r) \cap A \neq \emptyset \\
		\because a \notin A \quad B(a, r) \cap A \neq \emptyset \\
		\because a \notin A \; a \in A^c \implies \exists s > 0 \; B(a, s) \subseteq A^c \implies B(a, s) \cap A^c \neq \emptyset
	\end{gather*}
	Thus $a \in \partial A$ by definition, once again.
\end{proof}

\begin{defn}[Connectedness]
	Let $A \subseteq \bb{R}^n$. We say that A is disconnected when there exists open sets U and V in $\bb{R}^n$ such that
	\begin{equation*}
		U \cap A \neq \emptyset, \; V \cap A \neq \emptyset, \; U \cap V = \emptyset \text{ and } A = U \cup V
	\end{equation*}
	When A is disconnected, such open sets U and V are said to separate A.

	We say that A is connected when it is not disconnected.
\end{defn}

\begin{thm}[Connected sets in $\bb{R}$ are Intervals]
	The connected sets in $\bb{R}$ are the (open and closed) intervals (including degenerate intervals).
\end{thm}

\section{Heine-Borel Theorem}

\begin{defn}[Bounded in $\bb{R}^n$]
	Let $A \subseteq \bb{R}^n$. We say that A is bounded when
	\begin{equation*}
		\exists a \in \bb{R}^n \; \exists r > 0 \; A \subseteq B(a, r).
 	\end{equation*}
 	Equivalently,
 	\begin{equation*}
 		\exists R > 0 \; A \subseteq B(0, R).
 	\end{equation*}
\end{defn}

\begin{defn}[Open Cover, Subcover, and Compactness]
	Let $A \subseteq \bb{R}^n$. An open cover of A is a set S of open sets such that $A \subseteq \bigcup S$. When S is an open cover, a subcover of S is a subset $T \subseteq S$ such that $A \subseteq \bigcup T$.

	We say that A is compact when every open cover of A has a finite subcover.
\end{defn}

\begin{defn}[Closed Rectangle]
	A closed rectangle in $\bb{R}^n$ is a set of the form
	\begin{align*}
		R &= [a_1, b_1] \times [a_2, b_2] \times \hdots \times [a_n, b_n] \\
		  &= \{(x_1, x_2, ..., x_n) \in \bb{R}^n \, | \, a_i \leq x_i \leq b_i \text{ for all i}\}
	\end{align*}
\end{defn}

\begin{thm}[Nested Rectangles Theorem]
	Let $R_1, R_2, R_3, \hdots$ be closed rectangles in $\bb{R}^n$ with $R_1 \supseteq R_2 \supseteq R_3 \supseteq \hdots $. Then
	\begin{equation*}
		\bigcap_{k=1}^\infty R_k \neq \emptyset
	\end{equation*}
\end{thm}

\begin{thm}[Compactness of Closed Rectangles]\label{compact_closed_rect}
	Every closed rectangle in $\bb{R}^n$ is compact.
\end{thm}

\begin{thm}[Heine-Borel Theorem]
	Let $A \subseteq \bb{R}^n$. A is compact iff A is closed and bounded.
\end{thm}

\begin{proof}
	(Compactness $\implies$ Boundedness) \\
	\begin{equation*}
		S := \{B(0, k) \, | \, k \in \bb{Z}^+\} \implies \bigcup S = \bb{R}^n
	\end{equation*}
	So in particular, S is an open cover of $\bb{R}^n$. Since $A \subseteq \bb{R}^n \subseteq \bigcup S$, S is an open cover of A. Then
	\begin{gather*}
		\exists R > 0 \; A \subseteq \bigcup_{k=1}^R S = B(0, R)
	\end{gather*}
	where we note that $\bigcup_{k=1}^R S$ is a finite subcover that contains A as in the definition of compactness. So $\exists R > 0 \; A \subseteq B(0, R)$, i.e. by definition A is bounded. \\

	(Compactness $\implies$ Closed) \\
	SPS A is compact and not closed, i.e. A is open. By \hyperref[ETD]{Part (1) of the Equivalent Topological Definitions}, $A' \nsubseteq A$. Then
	\begin{gather*}
		\forall a \in A' \, \land \, a \notin A \; \forall k \in \bb{Z}^+ \; T_k := \bar{B} \left(a, \frac{1}{k} \right)^c \; S := \{T_k \, | \, k \in \bb{Z}^+\} \\
		\implies \bigcup S = \bb{R}^n \setminus \{a\} \implies A \subseteq \bigcup S \; (\because a \notin A \, \land \, A \subseteq \bb{R}^n) \\
		\because A \text{ is compact} \; \exists T := \{T_{k_j} \, | \, j \in \bb{Z}_{\leq m}^+ \} \; \text{ where } k_1 < k_2 < \hdots < k_m \quad A \subseteq \bigcup T \\
		\because T_{k_1} \subseteq T_{k_2} \subseteq \hdots \subseteq T_{k_m} \quad \bigcup T = T_{k_m} = \bar{B} \left(a, \frac{1}{k_m} \right)^c \implies A \subseteq \bar{B} \left(a, \frac{1}{k_m} \right)^c \\
		\because a \in A' \quad \forall r > 0 \; B^*(a, r) \cap A \neq \emptyset \implies B(a,r) \cap A \neq \emptyset \; (\text{since } a \notin A) \\
		\implies \bar{B} \left(a, r \right) \cap A \neq \emptyset \implies A \nsubseteq \bar{B}(a, r)^c
	\end{gather*}
	Since $\frac{1}{k_m}$ is a specific $r$, we have that
	\begin{equation*}
		A \nsubseteq \bar{B} \left(a, \frac{1}{k_m} \right)^c
	\end{equation*}
	which is a contradiction. Thus A is compact implies A is closed.

	Conversely, since A is bounded
	\begin{gather*}
		\exists r > 0 \; A \subseteq B(0, r) \\
		R := \{\vec{x} \in \bb{R}^n \, | \, \forall k \in \bb{N}_{\leq n} \; |x_k| < r \}
	\end{gather*}
	which is a closed rectangle. By the \hyperref[compact_closed_rect]{Compactness of Closed Rectangles}, R is compact. Note that
	\begin{gather*}
		\forall \vec{x} = (x_0, x_1, ..., x_n) \in B(0, r) \; \forall k \in \bb{N}_{\leq n} \\
		|x_k| = (x_k^2)^\frac{1}{2} \leq \sqrt{\sum_{i=0}^{n} x_i^2} < r \\
		\implies \vec{x} \in R \implies A \subseteq B(0, r) \subseteq R
	\end{gather*}
	We now have that
	\begin{itemize}
		\item A is closed,
		\item $A \subseteq R$, and
		\item R is compact.
	\end{itemize}
	A is closed implies $A^c$ is open. Let S be an open cover of A, i.e. $A \subseteq \bigcup S$.
	\begin{equation*}
		\because A \subseteq \bigcup S \quad \bigcup S \cup \{A^c\} = \bb{R}^n \\
	\end{equation*}
	Since $R \in \bb{R}^n = \bigcup S \cup \{A^c\}, \; \bigcup S \cup \{A^c\}$ is an open cover for R. Since R is compact,
	\begin{gather*}
		\exists T \subseteq \bigcup S \cup \{A^c\} \quad R \subseteq \bigcup T \\
		\because A \subseteq R \quad A \subseteq \bigcup T \\
		\because A \nsubseteq A^c \quad A \subseteq \bigcup T \setminus \{A^c\}
	\end{gather*}
	Since $\bigcup T$ is a finite, so is $\bigcup T \setminus \{A^c\} \subseteq \bigcup S \cup \{A^c\} \setminus \{A^c\} = \bigcup S$. Thus every open cover of A has a finite subcover, i.e. A is compact.
\end{proof}

% =================================
% 		Chapter 9 (supposedly)
% =================================
\chapter{Convergence in \texorpdfstring{$\bb{R}^n$}{Rn}}

\section{Limits of Functions}

\begin{defn}[Relatively Open and Closed Sets]
	Let $A \subseteq \bb{R}^n$.
	\begin{enumerate}
		\item A set $U \subseteq A$ is said to be relatively open in A iff there exists an open set S such that $U = A \cap S$.
		\item A set $U \subseteq A$ is said to be relatively closed in A iff there exists a closed set S such that $U = A \cap S$, or $U^c = A \setminus U$ is open in A.
	\end{enumerate}
\end{defn}

\begin{thm}[Relatively Open, Closed, and Disconnected]
	Let $A \subseteq S \subseteq \bb{R}^n$.
	\begin{enumerate}
		\item A is open in S iff $\forall a \in A \; \exists r > 0 \; B(a, r) \cap S \subseteq A$.
		\item A is closed in S iff there exists a closed set $K \subseteq \bb{R}^n$ such that $A = S \cap K$.
		\item S is disconnected iff
			\begin{equation*}
				\exists \emptyset \neq A \subsetneq S
			\end{equation*}
			such that A is both open and closed in S.
	\end{enumerate}
\end{thm}

\begin{defn}[Sequences in $\bb{R}^n$]
	Let $\langle a_n \rangle_{n \geq p}$ be a sequence in $\bb{R}^m$. We say that the sequence $\langle a_n \rangle_{n \geq p}$ is bounded when
	\begin{equation*}
		\exists R > 0 \; \forall n \in \bb{Z}_{\geq p} \; |a_n| \leq R.
	\end{equation*}
	For $b \in \bb{R}^m$, we say that the sequence $\langle a_n \rangle_{n \geq p}$ converges to b, and write $\lim\limits_{n \to \infty} a_n = b$ (or $a_n \to b$), when
	\begin{equation*}
		\exists b \in \bb{R}^m \; \forall \epsilon > 0 \; \exists N \in \bb{Z}_{\geq p} \; \forall n \in \bb{Z}_{\geq p} \; (n \geq N \implies |a_n - b| < \epsilon)
	\end{equation*}
	We say that the sequence $\langle a_n \rangle_{n \geq p}$ diverges to $\infty$, and write $\lim\limits_{n \to \infty} a_n = \infty$ (or $a_n \to \infty$), when
	\begin{equation*}
		\forall R > 0 \; \exists N \in \bb{Z}_{\geq p} \; \forall n \in \bb{Z}_{\geq p} \; (n \geq N \implies |a_n| \geq R).
	\end{equation*}
	We say that the sequence $\langle a_n \rangle_{n \geq p}$ converges when it converges to some point $b \in \bb{R}^m$ and otherwise we say that it diverges.

	We say that the sequence $\langle a_n \rangle_{n \geq p}$ is Cauchy when
	\begin{equation*}
		\forall \epsilon > 0 \; \exists N \in \bb{Z}_{\geq p} \; \forall k, l \in \bb{Z}_{\geq p} \; (k, l \geq N \implies |a_k - a_l| < \epsilon)
	\end{equation*}
\end{defn}

For the following theorems, our main variable $\langle a_n \rangle_{n \geq p}$ is a sequence of sequences.

\begin{thm}[Boundedness, Limits, and Convergence of Sequences]
	Let $\langle a_n \rangle_{n \geq p}$ be a sequence in $\bb{R}^m$, say $a_n = (a_{n ,1}, a_{n, 2}, ..., a_{n, m}) \in \bb{R}^m$
	\begin{enumerate}
		\item $\langle a_n \rangle_{n \geq p}$ is bounded iff $\langle a_{n, i} \rangle_{n \geq p}$ is bounded for all indices $i = 1, 2, ..., m$.
		\item $\langle a_n \rangle_{n \geq p}$ converges iff, for all i, $\langle a_{n, i} \rangle_{n \geq p}$ converges
		\item For $b = (b_1, b_2, ..., b_m) \in \bb{R}^m$ we have $\lim\limits_{n \to \infty} a_n = b \iff \forall i \in \{1, 2, ..., m\} \; \lim\limits_{n \to \infty} a_{n, i} = b_i$.
		\item $\langle a_n \rangle_{n \geq p}$ is Cauchy iff, for all i, $\langle a_{n, i} \rangle_{n \geq p}$ is Cauchy
	\end{enumerate}
\end{thm}

\begin{thm}[Uniqueness of Limits and Convergence of Subsequences]
	Let $\langle a_n \rangle_{n \geq p}$ be a sequence in $\bb{R}^m$ and let $u, v \in \bb{R}^m \cup \{\infty\}$
	\begin{enumerate}
		\item $\lim\limits_{n \to \infty} a_n = u \land \lim\limits_{n \to \infty} = v \implies u = v$.
		\item $\lim\limits_{n \to \infty} = u \land \langle a_{n_j} \rangle_{j \geq q}$ is a subsequence of $\langle a_n \rangle_{n \geq p}$ then $\lim\limits_{n \to \infty} a_{n_j} = u$.
		\item If $\langle a_n \rangle_{n \geq p}$ converges then it is bounded.
	\end{enumerate}
\end{thm}

\begin{thm}[Bolzano-Weierstrass Theorem for $\bb{R}^n$]
	Every bounded sequence in $\bb{R}^n$ has a convergent subsequence.
\end{thm}

\begin{thm}[Completeness of $\bb{R}^n$]\label{completeness_R}
	For every sequence in $\bb{R}^n$, the sequence converges iff it is Cauchy.
\end{thm}

\begin{defn}[Limit on a Point]
	Let $A \subseteq \bb{R}^n$ and let $f: A \to \bb{R}^m$ (note n is not necessarily equal to m). When a is a limit point of A and $b \in \bb{R}^m$, we say that $f(x)$ converges to b as x tends to a, and write $\lim\limits_{x \to a} f(x) = b$, when
	\begin{equation*}
		\forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in A \; (0 < |x - a| < \delta \implies |f(x) - b| < \epsilon)
	\end{equation*}
	When a is a limit point of A, we say that $f(x)$ diverges to $\infty$, and write $\lim\limits_{x \to a} f(x) = \infty$, when
	\begin{equation*}
		\forall R > 0 \; \exists \delta > 0 \; \forall x \in A \; (0 < |x - a| < \delta \implies |f(x)| \geq R)
	\end{equation*}
\end{defn}

\begin{thm}[Sequential Characterization of Limits in $\bb{R}^n$]
	Let $A \subseteq \bb{R}^n$, let $f: A \to \bb{R}^m$, let a be a limit point of A and let $u \in \bb{R}^m \cup \{\infty\}$. Then $\lim\limits_{x \to \infty} f(x) = u \iff \lim\limits_{n \to \infty} f(x_n) = u$ for every sequence $\langle x_n \rangle$ in $A \setminus \{a\}$ with $\lim\limits_{n \to \infty} x_n = a$.
\end{thm}

\begin{thm}[Limit of a Function and the Limit of Its Elements]
	Let $A \subseteq \bb{R}^n$ and let $f:A \to \bb{R}^m$, let a be a limit point of A, let $b = (b_1, b_2, ..., b_m) \in \bb{R}^n$, and say $f(x) = (f_1(x), f_2(x), ..., f_m(x)) \in \bb{R}^m$ for each $x \in A$ so that $f_i: A \to \bb{R}$ for each i. Then $\lim\limits_{x \to a} f(x) = b \iff \forall i = \{1, 2, ...., m\}\; \lim\limits_{x \to a} f_i(x) = b_i$.
\end{thm}

\begin{defn}[Continuity in $\bb{R}^n$]
	Let $A \subseteq \bb{R}^n$, let $B \subseteq \bb{R}^m$, let $f: A \to B$. For $a \in A$, we say that f is continuous at a when
	\begin{equation*}
		\forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in A \; (|x - a| < \delta \implies |f(x) - f(a)| < \epsilon)
	\end{equation*}
	We say that f is continuous (on A) when f is continuous at every $a \in A$, i.e,
	\begin{equation*}
		\forall a \in A \; \forall \epsilon > 0 \; \exists \delta > 0 \; \forall x \in A \; (|x - a| < \delta \implies |f(x) - f(a)| < \epsilon)
	\end{equation*}
	We say that f is uniformly continuous in A when
	\begin{equation*}
		\forall \epsilon > 0 \; \exists \delta > 0 \; \forall a, x \in A \; (|x - a| < \delta \implies |f(x) - f(a)| < \epsilon)
	\end{equation*}
\end{defn}

\begin{thm}[Sequential Characterization of Continuity]
	Let $A \subseteq \bb{R}^n$, let $f: A \to \bb{R}^n$, and let $a \in A$. Then f is continuous at a iff $\lim\limits_{n \to \infty} f(x_n) = f(a)$ for every sequence $\langle x_n \rangle_{n \geq p}$ in A iwth $\lim\limits_{n \to \infty} x_n = a$.
\end{thm}

\begin{thm}[Topological Characterization of Continuity]
	Let $A \subseteq \bb{R}^n$, let $B \subseteq \bb{R}^m$, and let $f: A \to B$.
	\begin{enumerate}
		\item f is continuous iff $f^{-1}(U)$ is relatively open in A for every open set U in B.
		\item f is continuous iff $f^{-1}(K)$ is relatively closed in A for every closed set K in B.
	\end{enumerate}
\end{thm}

\begin{thm}[Properties of Continuous Functions]
	Let $A \subseteq \bb{R}^n$, let $B \subseteq \bb{R}^m$, and let $f:A \to B$ be continuous.
	\begin{enumerate}
		\item If A is bounded then f(A) is bounded.
		\item If A is connected then f(A) is connected.
		\item If A is compact then f(A) is compact.
		\item If A is compact then f is uniformly continuous on A.
		\item If A is compact and m = 1 then f(x) attains its maximum and minimum values on A.
	\end{enumerate}
\end{thm}

\begin{defn}[Path \& Path-connected]
	Let $A \subseteq \bb{R}^n$ and let $a, b \in A$. A (continuous) path from a to b in A is a continuous function $f: [0, 1] \to A$ with $f(0) = a$ and $f(1) = b$. We say that A is path-connected when for every $a, b \in A$ there exists a continuous path from a to b in A.
\end{defn}

\begin{thm}[Path-connectedness and Connectedness]
	Let $A \subseteq \bb{R}^n$. If A is path-connected then A is connected.
\end{thm}

% =================================
% 		Appendix
% =================================
\appendix

\chapter{ZF Set Theory and the Axiom of Choice}\label{apdxA}
\section{Introduction}
\begin{eg}[Russel's Paradox]\label{russel_paradox}
	Let X be the set of all sets, and let $S = \{ A \in X | A \notin A\}$.\\
	Note for example that $Z \notin Z \implies Z \in S$, and $X \in X \implies X \notin S$.\\
	Thus we have $S \in S \iff S \notin S$.
\end{eg}

To ensure that mathematical paradoxes (like the above) can no longer arise, mathematicians considered the following questions, and with these questions, rough answers are provided:
\begin{enumerate}
	\item What exactly is an allowable mathematical object? \\
	A: Every mathematical object is a mathematical set, and a mathematical set can be constructed using certain rules, for e.g. the now widely accepted Zermelo-Fraenkel Set Theory and the Axiom of Choice. While the Axiom of Choice is still highly criticized even today (e.g. the highly controversial \href{https://en.wikipedia.org/wiki/Banach–Tarski_paradox}{Banach-Tarski Paradox}), the Zermelo-Fraenkel Set Theory is widely welcomed, but not without critics. We shall call the Zermelo-Fraenkel Set Theory and the Axiom of Choice as the ZFC Axioms of Set Theory.
	\item What exactly is an allowable mathematical statement? \\
	A: Every mathematical statement can be expressed in a formal symbolic language, which uses symbols rather than words from any spoken language.
	\item What exactly is allowable in a mathematical proof? \\
	A: Every mathematical proof is a finite list of ordered pairs $(\mathscr{S}_n, \mathscr{F}_n)$ (which we can think of as proven theorems), where each $\mathscr{S}_n$ is a finite set of formulas (called the $\textit{premises}$) and each $\mathscr{F}_n$ is a single formula (called the $\textit{conclusion}$), which that each pair $(\mathscr{S}_n, \mathscr{F}_n)$ can be obtained from previous pairs $(\mathscr{S}_i, \mathscr{F}_i)$ with $i < n$, using certain proof rules.
\end{enumerate}

In the remainder of this appendix, we shall look more into the first 2 questions.

\section{ZFC Axioms of Set Theory}

\begin{defn}[Mathematical Symbols]
	We allow ourselves to use only the following symbols from the following symbol set: \\
	\begin{center}
		\begin{tabular}{c l}
			$\neg$		&	not \\
			$\land$		&	and \\
			$\lor$		&	or \\
			$\implies$	&	implies \\
			$\iff$	&	if and only if \\
			$=$			&	equals \\
			$\in$		&	is an element of \\
			$\forall$	&	for all \\
			$\exists$	&	there exists \\
			$()\quad\{\}\quad[]$	&	parenthesis
		\end{tabular}
	\end{center}
	along with some variable symbols such as $x, y, z, u, v, w,... \text{ or } x_1, x_2, x_3,...$
\end{defn}

\begin{defn}[Formula]
	A formula (in the formal symbolic language of first order set theory) is a non-empty finite string of symbols, from the above list, which can be obtained using finitely many applications following the three rules below:
	\begin{enumerate}
		\item If x and y are variable symbols, then each of the following strings are formulas.
		\[
			x = y, \quad x \in y
		\]
		\item If F and G are formulas then each of the following strings are formulas.
		\[
			\neg F, \quad (F \land G), \quad (F \lor G), \quad (F \implies G), \quad (F \iff G)
		\]
		\item If x is a variable symbol and F is a formula then each of the following is a formula.
		\[
			\forall x \in F, \quad \exists x \in F
		\]
	\end{enumerate}
\end{defn}

\begin{defn}[Free or Bounded Variable]
	Let x be a variable symbol and let F be a formula. For each occurrence of the symbol x, which does not immediately follow a quantifier, in the formula F, we define whether the occurrence of x is free or bound inductively as follows:
	\begin{enumerate}
		\item If F is a formula of one of the forms y = z or $y \in z$, where y and z are variable symbols (possibly equal to x), then every occurence of x in F is free, and no occurrence is bound.

		\item If F is a formula of one of the forms $\neg H, (H \land G), (H \lor G), (H \implies G), (H \iff G)$, where G and H are formulas, then each occurence of the symbol x is either an occurrence in the formula G or an occurrence in the formula H, and each free (respectively, bound) occurence of x in G remains free (respectively, bound) in F, and similarly for each free (or bound) occurrence of x in G. In other words, wlog, if x is bounded in G, then it is bounded in F, and vice versa.
		\item If F is a formula of one of the forms $\forall y \in G \text{ or } \exists y \in G$, where G is a formula and y is a variable symbol. If y is different from x, then each free (or bound) occurrence of x in G remains free (or bound) in the formula G, and if y = x then every free occurrence of x in G becomes bound in F, and every bound occurrence of x in G remains bound in F.
	\end{enumerate}
\end{defn}

\begin{defn}[Is Bound By and Binds]
	When a quantifier symbol occurs in a given formula F, and is followed by the variable symbol x and then by the formula G, any free occurence of x in G will become bound in the given formula F (by the 3rd definition above). We shall say that the occurrence of x is bound by (that occurrence of) the quantifier symbol, or that (the occurrence of) the quantifier symbol binds the occurence of x.
\end{defn}

\begin{defn}[Free Variable, Statement, Statement About]
	A $\textbf{free variable}$ in a formula F is any variable symbol that has at least one free occurence in F. A formula F with no free variables is called a $\textbf{statement}$. When the free variables in F all lie in the set $\{x_1, x_2, ..., x_n\}$, we shall write F as $F(x_1, x_2, ..., x_n)$ and we shall say that F is a $\textbf{statement about}$ the variables $x_1, x_2, ..., x_n$.
\end{defn}

\begin{defn}[Unique Existence]
	When F(x) is a statement about x, we sometimes write F(y) as a short form for the formula $\forall x(x=y\implies F(x))$, and we sometimes write
	\[
		\exists!y \quad F(y)
	\]
	which we read as "there exists a unique y such that F(y)", as a short form for the formula
	\[
		(\exists y \quad F(y) \land \forall z \quad F(z)) \implies z = y))
	\] which is, in turn, for the formula
	\[
		\exists y \bigg( \forall x \Big(x = y \implies F(x) \Big) \land \forall z \Big(\forall x (x = z \implies F(x)) \implies z = y \Big) \bigg)
	\]
\end{defn}

\begin{remark}[The ZFC Axioms of Set Theory (informal)]
	Every mathematical set can be constructed using specific rules, which we shall use the ZFC Axioms of Set Theory. Below is a list of the ZFC Axioms, stated informally.
	\begin{itemize}
		\item Empty Set Axiom: There exists an empty set $\emptyset$ with no elements.
		\item Extension Axiom: 2 sets are equal if and only if they have the same elements.
		\item Separation Axiom: If u is a set and F(x) is a statement about x, $\{x \in u : F(x)\}$ is a set.
		\item Pair Axiom: If u and v are sets then {u, v} is a set.
		\item Union Axiom: If u is a set then $\cup u = \bigcup\limits_{v \in u} v$ is a set.
		\item Power Set Axiom: If u is a set then $\mathcal{P}(u) = \{v : v \in u\}$ is a set.
		\item Axiom of Infinity: If we define the natural numbers to be the sets $0 = \emptyset, 1 = \{0\}, 2 = \{0, 1\}, 3 = \{0, 1, 2\}$ and so on, then $\bb{N} = \{0, 1, 2, 3, ...\}$ is a set.
		\item Replacement Axiom: If u is a ste and F(x, y) is a statement about x and y with the property that $\forall x \> \exists! y \> F(x,y)$ then $\{y : \exists x \in u \> F(x,y)\}$ is a set.
		\item Axiom of Choice: Given a set u of non-empty pairwise disjoint sets, there exists a set which contains exactly one element from each of the sets in u.
	\end{itemize}
\end{remark}

\begin{defn}[Empty Set Axiom]
	The Empty Set Axiom is the formula
	\[
		\exists u \> \forall x \quad \neg x \in u
	\]
\end{defn}

\begin{defn}[Extension Axiom]
	The Extension Axiom is the formula
	\[
		\forall u \> \forall v \> \Big(u = v \iff \forall x \> (x \in u \iff x \in v) \Big)
	\]
\end{defn}

\begin{thm}[Uniqueness of the Empty Set]
	The empty set is unique.
\end{thm}

\begin{defn}[$\emptyset$]
	We denote the unique empty set by $\emptyset$.
\end{defn}

\begin{defn}[Subset]
	Given sets u and v, we say that u is a $\textbf{subset}$ of v, and write $u \subseteq v$, when $\forall x (x \in u \implies x \in v)$
\end{defn}

\begin{defn}[Separation Axiom]
	For any statement F(x) about x, the following formula is an axiom.
	\[
		\forall u \> \exists v \> \forall x \Big(x \in v \iff (x \in u \land F(x)) \Big)
	\]
	More generally, for any statement $F(x, u_1, u_2, ..., u_n)$ about $x, u_1, u_2, ..., u_n$ where $n \geq 0$, the following formula is an axiom.
	\[
		\forall u \> \forall u_1 \hdots \forall u_n \> \exists v \> \forall x \Big( x \in v \iff (x \in i \land F(x, u_1, ..., u_n)) \Big)
	\]
	Any axiom of this form is called the Separation Axiom.
\end{defn}

\begin{note}
	It is important to realize that a Separation Axiom only allows us to construct a subset of a given set u. So, e.g., we cannot use the Separation Axiom to show that the collection $S = \{x : \neg x \in x\}$, which is used to formulate \hyperref[russel_paradox]{Russel's Paradox}, is a set.
\end{note}

\begin{defn}[Pair Axiom]
	The Pair Axiom is the formula
	\[
		\forall u \> \forall v \> \exists w \> \forall x \Big( x \in w \iff (x = u \lor x = v) \Big)
	\]
\end{defn}

\begin{defn}[Union Axiom]\label{union_axiom}
	The Union Axiom is the formula
	\[
		\forall u \> \exists w \> \forall x \Big( x \in w \iff \exists v (v \in u \land x \in v) \Big)
	\]
\end{defn}

\begin{defn}[Union]
	Given a set u, by the Union Axiom there exists a set w with the property that $\forall x \Big( x \in w \iff \exists v (v \in u \land x \in v) \Big)$, and by the Extension Axiom, this set w is unique. We call the set w the $\textbf{union}$ of the elements in u, and denote it by
	\[
		\cup u = \bigcup_{v \in u} v.
	\]Given two sets u and v, we define the union of u and v to be the set
	\[
		u \cup v := \bigcup \{u, v\}.
	\]
	Given three sets u, v, and w, note that \{z\} = \{z, z\} is a set and so $\{x, y, z\} = \{x, y\} \cup \{z\}$ is also a set. More generally, if $u_1, u_2, ..., u_n$ are sets then $\{u_1, u_2, ..., u_n\}$ is a set and we define the union of the sets $u_1, u_2, ..., u_n$ to be
	\[
		u_1 \cup u_2 \cup \hdots \cup u_n = \bigcup_{k = 1}^{n} u_k = \bigcup \{u_1, u_2, ..., u_n\}
	\]
\end{defn}

\begin{defn}[Intersection]
	Given a st u, we define the intersection of the elements in u to be the set
	\[
		\bigcap u = \biggl\{ x \in \bigcup u \> \Big| \> \forall v (v \in u \implies x \in v) \biggr\}
	\] Given two sets u and v, we define the intersection of u and v to be the set
	\[
		u \cap v = \bigcap \{u, v\}
	\] and more generally, given sets $u_1, u_2, ..., u_n$, we define the intersection of $u_1, u_2, ..., u_n$ to be the set
	\[
	 	u_1 \cap u_2 \cap \hdots \cap u_n = \bigcap_{k=1}^{n} u_k = \bigcap \{u_1, u_2, ..., u_n\}
	\]
\end{defn}

\begin{defn}[Power Set Axiom]
	The Power Set Axiom is the formula
	\[
		\forall u \> \exists w \> \forall v (v \in w \iff v \subseteq u)
	\]
\end{defn}

\begin{defn}[Power Set]
	Given a set u, the set w is with the property that $\forall v (v \in w \iff v \subseteq u)$ (which exists by the Power Set Axiom and is unique by the Extension Axiom) is called the power set of u and is denoted by $\mathcal{P}(u)$, so we have
	\[
		\mathcal{P}(u) = \{v | v \subseteq u\}
	\]
\end{defn}

\begin{defn}[Ordered Pair]
	Given two sets x and y, we define the ordered pair (x, y) to be the set
	\[
		(x, y) = \{\{x\}, \{x, y\}\}.
	\]
	Given two sets u and v, note that if $x \in u$ and $y \in v$ then we have $\{x\} \in \mathcal{P}(u \cup v)$ and $\{x, y\} \in \mathcal{P}(u \cup v)$ and so $(x, y) = \{\{x\}, \{x, y\}\} \in \mathcal{P}(\mathcal{P}(u \cup v))$. We define the product $u \times v$ to be the set
	\[
		u \times v = \{(x, y) | x \in u \land y \in v\},
	\] i.e.
	\[
		u \times v = \Bigr\{ z \in \mathcal{P}(\mathcal{P}(u \cup v)) | \exists x \exists y \big( (x \in u \land y \in v) \land z = (x, y) \big) \Bigr\}
	\]
\end{defn}

\begin{defn}[Successor, Inductive]
	We define
	\[
		0 = \emptyset, \quad	1 = \{0\}, \quad	2 = \{0, 1\} = 1 \cup \{1\}, \quad	3 = \{0, 1, 2\} = 2 \cup \{2\},
	\] and so on. For a set x, we define the successor of x to be the set
	\[
		x + 1 = x \cup \{x\}.
	\] A set u is called inductive when it has the property that
	\[
		(0 \in u \land \forall x (x \in u \implies x + 1 \in u))
	\]
\end{defn}

\begin{defn}[Axiom of Infinity]
	The Axiom of Infinity is the formula
	\[
		\exists u (0 \in u \land \forall x (x \in u \implies x + 1 \in u))
	\] so the Axiom of Infinity states that there exists an inductive set.
\end{defn}

\begin{thm}[Existence \& Uniqueness of an Inductive Set]
	$\exists w := \{x | x \in v \text{ for every inductive set v }\}$ \\
	Moreover, this set w is an inductive set.
\end{thm}

\begin{defn}[Natural Numbers]
	The unique set w in the above theorem is called the set of natural numbers, and we denote it by $\bb{N}$. We write
	\begin{align*}
		\bb{N} &= \{x | x \in v \text{ for every inductive set v }\} \\
			   &= \{0, 1, 2, 3, ...\}
	\end{align*}
	For $x, y \in \bb{N}$, we write x < y when $x \in y$ and write $x \leq y$ when $x < y \lor x = y$.
\end{defn}

\begin{remark}
	For a formula F, we write $\forall x \in u \> F$ as a shorthand notation for the formula $\forall x (x \in u \implies F)$. Similarly, we write $\exists x \in u \> F$ as a shorthand notation for $\exists x (x \in u \land F)$
\end{remark}

\begin{thm}[Principle of Induction]
	Let F(x) be a statement about x. SPS that
	\begin{enumerate}
		\item F(0), and
		\item $\forall x \in \bb{N} (F(x) \implies F(x+1))$.
	\end{enumerate}
	Then $\forall x \in \bb{N} \> F(x)$
\end{thm}

\begin{remark}
	The expression F(0) is short for $\forall x (x = 0 \implies F(x))$, which in turn is short for $\forall x (\forall y \> \neg y \in x \implies F(x))$.Similarly, F(x + 1) is short for the formula $\forall y (y = x + 1 \implies F(y))$, where F(y) is short for $\forall x (x = y \implies F(x))$.
\end{remark}

\begin{defn}[Replacement Axiom]
	Given a statement F(x, y) about x and y, the following formula is an axiom:
	\[
		\forall u \Big( \forall x \exists! y \> F(x,y) \implies \exists w \forall y \big( y \in w \iff \exists x \in u \> F(x, y) \big) \Big)
	\]
	where $\exists! y \> F(x, y)$ is short for $\exists y \Big(F(x, y) \land \forall z \big(F(x, z) \implies z = y)\Big)$ with F(x ,z) short for the formula $\forall y (y = z \implies F(x, y))$. More generally, given a statement $F(x, y, u_1, ..., u_n)$ about $x, y, u_1, ..., u_n$ with $n \geq 0$, the following formula is an axiom:
	\[
		\forall u \forall u_1 \hdots \forall u_n \Big( \forall x \exists!y \> F(x, y, u_1, ..., u_n) \implies \exists w \forall y \big( y \in w \iff \exists x \in u \> F(x, y, u_1, ..., u_n) \big) \Big)
	\]
	An axiom of this form is called a Replacement Axiom.
\end{defn}

\begin{defn}[Axiom of Choice]
	The Axiom of Choice is the formula given by
	\[
		\forall u \Big( \big( \neg \phi \in u \land \forall x \in u \> \forall y \in u (\neg x = y \implies x \cap y = \emptyset) \big) \implies \exists w \forall v \in u \> \exists!x \in v \> x \in w \Big)
	\]
\end{defn}

From this point on, we will be using upper-case letters to denote sets, instead of lower-case as per the statements above.

\section{Relations, Equivalence Relations, Functions and Recursion}

\begin{defn}[Binary Relation]
	A binary relation R on a set X is a subset $R \subseteq X \times X$. More generally, a binary relation is any set R whose elements are ordered pairs. For a binary relation R, we usually write xRy instead of $(x, y) \in R$.
\end{defn}

\begin{defn}[Domain, Range, Image, Inverse Image, Inverse, Composition]
	Let R and S be binary relations. \\
	The domain of R is
	\[
		\text{Domain}(R) = \{x | \exists y \> xRy\}
	\]
	and the range of R is
	\[
		\text{Range}(R) = \{x | \exists y \> xRy\}.
	\]
	For any set A, the image of A under R is
	\[
		R(A) = \{y | \exists x \in A \> xRy\}
	\]
	and the inverse image of A under R is
	\[
		R^{-1}(A) = \{x | \exists y \in A \> xRy\}.
	\]
	The inverse of R is
	\[
		R^{-1} = \{(y, x) | (x, y) \in R\}
	\]
	and the composition S composed with R is
	\[
		S \circ R = \{(x, z) | \exists y \> xRy \land ySz \}
	\]
\end{defn}

\begin{thm}[Domain, Range, Image and Inverse Image as Sets]
	Let A be a set and let R be a binary relation. Then Domain(R), Range(R), R(A) and $R^{-1}(A)$ are sets.
\end{thm}

\begin{thm}[Inverse and Composition as Binary Relations]
	Let A be a set and let R and S be binary relations. Then $R^{-1}$ and $S \circ R$ are binary relations.
\end{thm}

\begin{defn}[Equivalence Relation]
	An equivalence relation on a set X is a binary relation R on X such that
	\begin{enumerate}
		\item R is $\textbf{reflexive}$, i.e. $\forall x \in X \> xRx$
		\item R is $\textbf{symmetric}$, i.e. $\forall x, y \in X \> (xRy \implies yRx)$, and
		\item R is $\textbf{transitive}$, i.e. $\forall x, y, z \in R \> \big( (xRy \land yRz) \implies xRz \big)$.
	\end{enumerate}
\end{defn}

\begin{defn}[Equivalence Class]
	Let R be an equivalence relation on the set X. For $a \in X$, the equivalence class of a modulo R is the set
	\[
		[a]_R = \{x \in X | xRa \}
	\]
\end{defn}

\begin{defn}[Partition]
	A partition of a set X is a set S of non-empty pairwise disjoint sets whose union is X, that is a set S such that
	\begin{enumerate}
		\item $\forall X, Y \in S \> (X \neq Y \implies X \cap Y = \emptyset)$
		\item $\bigcup S = X$.
	\end{enumerate}
\end{defn}

\begin{thm}[Correspondence of Equivalence Relations and Partitions]
	Given a set X, we have the following correspondence between equivalence relations on X and partitions of X.
	\begin{enumerate}
		\item Given an equivalence relation R on X, the set of all equivalence classes
		\[
			S_R = \{[a]_R | a \in X\}
		\] is a partition of X.
		\item Given a partition S of X, the relation $R_S$ on X is defined by
		\[
			R_S = \{(x, y) \in X \times X | \exists A \in S (x \in A \land y \in A)\}
		\] is an equivalence relation on X.
		\item Given an equivalence relation R on X we have $R_{S_R} = R$, and a given partition S of X, we have $S_{R_S} = S$.
	\end{enumerate}
\end{thm}

\begin{note}[Set of All Equivalence Classes]
	Given an equivalence relation R on X, the set of all equivalence classes, which we denote by $S_R$ in the above theorem, is usually denoted by $X/R$, so
	\[
		X/R = \{[a]_R | a \in X\}
	\]
\end{note}

\begin{defn}[Set of Representatives]
	Let R be an equivalence relation. A set of representatives for R is a subset of X which contains exactly one element from each equivalence class in X/R.
\end{defn}

\begin{remark}
	Notice that the AC is equivalent to the statement that every equivalence relation has a set of representatives.
\end{remark}

\begin{defn}[Function]\label{fn_apdxA}
	Get sets X and Y, a function from X to Y is a binary relation $f \subseteq X \times Y$ with the property that
	\[
		\forall x \in X \> \exists! y \in Y \> (x,y) \in f
	\]
	More generally, a function is a binary relation with the property that
	\[
		\forall x \in Domain(f) \> \exists! y \> (x, y) \in f.
	\]
	For a function f, we usually write y = f(x) instead of xfy. It is customary to use the notation $f: X \to Y$ when X = Domain(f) and Y is any set with $Range(f) \subseteq Y$.
\end{defn}

\begin{defn}[One-to-one \& Onto]
	Let $f: X \to Y$. THe function f is called one-to-one (or injective) when
	\[
		\forall y \in Y \> \exists \text{ at most one } x \in X \> y = f(x)
	\]
	and f is called onto (or surjective) when
	\[
		\forall y \in Y \> \exists \text{ at least one } x \in X \> y = f(x)
	\]
\end{defn}

\begin{defn}[Left and Right Inverses]
	Let $f: X \to Y$. Let $I_X$ and $I_Y$ denote the identity function on X and Y respectively. A left inverse of f is a function $g: Y \to X$ such that $g \circ f = I_X$. A right inverse of f is a function $H: X \to Y$ such that $f \circ H = I_Y$. Note that if f has a left inverse g and a right inverse H, then we have $g = g \circ I_Y = g \circ f \circ H = I_X \circ H = H$. In this case, we say that g is the (unique two-sided) inverse of f.
\end{defn}

\begin{thm}[Surjective and Injective VS Inverses]
	Let $f: X \to Y$. Then
	\begin{enumerate}
		\item f is one-to-one if and only if f has a left inverse.
		\item f is onto if and only if f has a right inverse.
		\item f is one-to-one and onto if and only if f has a (two-sided) inverse.
	\end{enumerate}
\end{thm}

\begin{defn}[Invertible]
	A function $f: X \to Y$ is called invertible (or bijective) when it is one-to-one and onto, or equivalently, when it has a (unique two-sided) inverse.
\end{defn}

\begin{thm}[The Recursion Theorem]\label{recursion_theorem}
	\begin{enumerate}
		\item Let A be a set, let $a \in A$, and let $g : A \times \bb{N} \to A$. Then there exists a unique function $f: \bb{N} \to A$ such that
		\[
			f(0) = a \text{ and } f(n+1) = g(f(n), n) \text{ for all } n \in \bb{N}
		\]
		\item Let A and B be sets, let $g: A \to B$, and let $h: A \times B \times \bb{N} \to B$. Then there exists a unique function $f:A \times \bb{N} \to B$ such that for all $a \in A$ we have
		\[
			f(a, 0) = g(a) \text{ and } f(a, n + 1) = h(a, f(a, n), n) \text{ for all } n \in \bb{N}
		\]
	\end{enumerate}
\end{thm}

\section{Construction of Integers, Rational, Real and Complex Numbers}

\begin{defn}[Sum and Product]
	By Part(2) of the \hyperref[recursion_theorem]{Recursion Theorem}, there is a unique function $s: \bb{N} \times \bb{N} \to \bb{N}$ such that for all $a, b \in \bb{N}$ we have
	\[
		s(a, 0) = a, \quad s(1, b + 1) = s(a, b) + 1.
	\]
	We call s(a, b) the sum of a and b $\in \bb{N}$ and write it as
	\[
		a + b = s(a, b).
	\]
	Also, there is a unique function $p: \bb{N} \times \bb{N} \to \bb{N}$ such that for all a, b $\in \bb{N}$ we have
	\[
		p(a, 0) = 0, \quad p(a, b + 1) = p(a, b) + a
	\]
	We call p(a, b) the product of a and b in $\bb{N}$, and we write it as
	\[
		a \cdot b = p(a, b)
	\]
\end{defn}

\begin{defn}[Integers]
	We define the set of integers to be the set
	\[
		\bb{Z} = (\bb{N} \times \bb{N})/R
	\]
	where R is the equivalence relation given by
	\[
		(a, b)R(c,d) \iff a + d = b + c
	\]
	For [(a, b)] and [(c,d)] in $\bb{Z}$, we define
	\begin{gather*}
		[(a, b)] \leq [(c, d)] \iff b + c \leq a + d \\
		[(a, b)] + [(c ,d)] \iff [(a + c, b + d)] \\
		[(a, b)] \cdot [(c, d)] = [(ac + bd, ad + bc)]
	\end{gather*}
	For $n \in \bb{N}$ we write n = [(n, 0)] and -n = [(0, n)], so that every element of $\bb{Z}$ can be written as $\pm n$ for some $n \in \bb{N}$, and we can identity $\bb{N}$ with a subset of $\bb{Z}$
\end{defn}

\begin{defn}[Rational Numbers]
	We define the set of reational numbers to be the set
	\[
		\bb{Q} = (\bb{N} \times \bb{Z}^+)/R
	\]
	where $\bb{Z}^+ = \{x \in \bb{N} | x \neq 0\}$ and R is the equivalence relation given by
	\[
		(a, b)R(c, d) \iff ad = bc
	\]
	For [(a, b)] and [(c, d)] in $\bb{Q}$ we define
	\begin{gather*}
		[(a, b)] \leq [(c, d)] \iff a \cdot d \leq b \cdot c \\
		[(a, b)] + [(c ,d)] \iff [(a \cdot d + b \cdot c, b \cdot d)] \\
		[(a, b)] \cdot [(c, d)] = [(ac, bd)]
	\end{gather*}
	For $a \in \bb{N}$ and $b \in \bb{Z}^+$, it is customary to write $\frac{a}{b} = [(a, b)]$. Also for $a \in \bb{Z}$ we write a = [(a, 1)], and we identify $\bb{Z}$ with a subset of $\bb{Q}$
\end{defn}

\begin{defn}[Real Numbers]
	We define the set of real numbers of the the set
	\[
		\bb{R} = \{x \subseteq \bb{Q} | x \neq \emptyset, x \neq \bb{Q}, \forall a \in x \> \forall b \in \bb{Q}(b \leq a \implies b \in x), \forall a \in x \> \exists b \in x \> a < b \}
	\]
	For $x, y \in \bb{R}$ we define
	\begin{gather*}
		x \leq y \iff x \subseteq y \\
		x + y = \{ a + b | a, b \in \bb{Q}, a \in x, b \in y\}
	\end{gather*}
	For $0 \leq x, y \in \bb{R}$ we define
	\[
		x \cdot y = \{ a \cdot b | 0 \leq a, b \in \bb{Q}, a \in x, b \in y\} \cup \{c \in \bb{Q} | c < 0\},
	\]
	and YOU can try to, similarly, define $x \cdot y$ in the case that x < 0 and y < 0.
\end{defn}

\begin{defn}[Complex Numbers]
	We define the set of complex numbers to be the set
	\[
		\bb{C} = \bb{R} \times \bb{R}.
	\]
	We define addition and multiplication in $\bb{C}$ by
	\begin{align*}
		(a, b) + (c, d) &= (a + c, b + d) \\
		(a, b) \cdot (c, d) &= (ac - bd, ad + bc).
	\end{align*}
	We write $i = (0, 1).$ For $x \in \bb{R}$ we write x = (x, 0) and identify $\bb{R}$ with a subset of $\bb{C}$.
\end{defn}

\chapter{Functions and Cardinality}

\section{Functions}
\begin{defn}[Range, Image, and Inverse Image]
	Let X and Y be sets and let $f: X \to Y$. Recall (see \hyperref[fn_apdxA]{Function in Appendix A}) that the domain of f and the range of f are the sets
	\[
		\text{Domain}(f) = X, \quad \text{Range}(f) = f(X) = \{f(x) | x \in X\}
	\]
	For $A \subseteq X$, the image of A under f is the set
	\[
		f(A) = \{f(x) | x \in A\}
	\]
	For $B \subseteq Y$, the inverse image of B under f is the set
	\[
		f^{-1}(B) = \{x \in X | f(x) \in B\}
	\]
\end{defn}

\begin{defn}[Composite Function]
	Let X, Y and Z be sets. Let $f: X \to Y$ and let $g: Y \to Z$. We define the composite function $g \circ f: X \to Z$ by $(g \circ f)(x) = g \big( f(x) \big)$ for all $x \in X$
\end{defn}

\begin{defn}[Bijection]
	Let X and Y be sets. Let $f: X \to Y$. We say that f is a bijection, or that f is bijective, if f is both one-to-one and onto (or that f is both injective and surjective).
\end{defn}

\begin{thm}[Bijectiveness and Inverse of the Composite Function]
	Let X, Y and Z be sets. Let $f: X \to Y$ and $g: Y \to Z$. Then
	\begin{enumerate}
		\item if f and g are both injective then so is $g \circ f$,
		\item if f and g are both surjective then so is $g \circ f$, and
		\item if f and g are both invertible then so is $g \circ f$, and in this case $(g \circ f)^{-1} = f^{-1} \circ g^{-1}$
	\end{enumerate}
\end{thm}

\begin{defn}[Identity Function]
	For a set X, we define the identity function on X to be the function $I_X: X \to X$ given by $I_X(x) = x$ for all $x \in X$. Note that for $f: X \to Y$ we have $f \circ I_X = f$ and $I_Y \circ f = f$.
\end{defn}

\begin{thm}[Bijectiveness and Invertability of Functions]
	Let X and Y be nonempty sets and let $f: X \to Y$. Then
	\begin{enumerate}
		\item f is injective if and only if f has a left inverse,
		\item f is surjective if and only if f has a right inverse, and
		\item f is bijective if and only if f has a left inverse g and a right inverse h, and in this case we have g = h = $f^{-1}$.
	\end{enumerate}
\end{thm}

\begin{crly}[Relationship between Injection and Surjection]
	Let X and Y be sets. Then there exists an injective map $f: X \to Y$ if and only if there exists a surjective map $g: Y \to X$.
\end{crly}

\section{Cardinality}

\begin{defn}[Equal Cardinality]
	Let A and B be sets. We say that A and B have the same cardinality, and wrtie |A| = |B|, when there exists a bijective map $f: A \to B$.

	We say that the cardinality of A is less than or equal to the cardinality of B, and write $|A| \leq |B|$, when there exists an injective map $f: A \to B$.

	We say that the cardinality of A is less than the cardinality of B, and write $|A| < |B|$, when $|A| \leq |B| \land |A| \neq |B|$ (i.e. there exists an injective map from A to B but no surjective map from A to B).

	We also write $|A| \geq |B|$ when $|B| \leq |A|$ and $|A| > |B|$ when $|B| < |A|$.
\end{defn}

\begin{defn}[Properties for Cardinality of Sets]
	For all sets A, B, and C,
	\begin{enumerate}
		\item |A| = |A|,
		\item if |A| = |B|, then |B| = |A|,
		\item if |A| = |B| and |B| = |C|, then |A| = |C|,
		\item $|A| \leq |B| \iff (|A| = |B| \lor |A| < |B|)$, and
		\item $|A| \leq |B| \land |B| \leq |C| \implies |A| \leq |C|$.
	\end{enumerate}
\end{defn}

\begin{defn}[Finiteness and Countability of Sets]
	Let A be a set. For each $n \in \bb{N}$, let $S_n = \{0, 1, 2, ..., n - 1\}$. For $n \in \bb{N}$, we say that the cardinality of A is equal to n, or that A has n elements, and write |A| = n, when $|A| = |S_n|$. We say that A is finite when |A| = n for some $n \in \bb{N}$. We say that A is infinite when A is not finite. We say that A is countable when $|A| = |\bb{N}|$.
\end{defn}

\begin{remark}
	Note that a set A is said to be countable when A is of the form $A = \{a_0, a_1, a_2, ...\}$ where all its element are distinct.
\end{remark}

\begin{thm}
	Let A be a set. Then the following are equivalent.
	\begin{enumerate}
		\item A is infinite.
		\item A contains a countable subset.
		\item $|\bb{N}| \leq |A|$
		\item There exists a map $f: A \to A$ which is injective but not surjective.
	\end{enumerate}
\end{thm}

\begin{crly}
	Let A and B be sets.
	\begin{enumerate}
		\item If A is countable then A is infinite.
		\item When $|A| \leq |B|$, if B is finite then so is A, and if A is infinite, so is B.
		\item If |A| = n and |B| = m, then |A| = |B| iff n = m.
		\item If |A| = n and |B| = m, then $|A| \leq |B| \iff n \leq m$.
		\item When one of the two sets A or B is finite. If $|A| \leq |B| \land |B| \leq |A| \implies |A| = |B|$.
	\end{enumerate}
\end{crly}

\begin{thm}[$|\bb{N}|$ as a Threshold for Finiteness and Countability]
	Let A be a set. $|A| \leq |\bb{N}| \iff$ A is finite or countable.
\end{thm}

\begin{thm}
	Let A be a set. Then
	\begin{enumerate}
		\item $|A| < |\bb{N}| \iff$ A is finite,
		\item $|\bb{N}| < |A| \iff$ A is neither finite nor countable, and
		\item $|A| \leq |\bb{N}| \land |\bb{N}| \leq |A| \implies |A| = |\bb{N}|$.
	\end{enumerate}
\end{thm}

\begin{defn}[Countability and $\aleph_0$]
	Let A be a set. When A is countable we write $|A| = \aleph_0$.

	When A is finite we write $|A| < \aleph_0$.

	When A is infinite we write $|A| \geq \aleph_0$.

	When A is either finite or countable we write $|A| \leq \aleph_0$, and say that A is at most countable.

	When A is neither finite nor countable we write $|A| > \aleph_0$, and say that A is uncountable.
\end{defn}

\begin{thm}[Set Cartesian Product and Union, and $\bb{Q}$ are Countable]
	\begin{enumerate}
		\item If A and B are countable sets, then so is $A \times B$.
		\item If A and B are countable sets, then so is $A \cup B$.
		\item If $A_0, A_1, A_2, ...$ are countable sets, then so is $\bigcup_{k = 0}^{\infty} A_k$.
		\item $\bb{Q}$ is countable.
	\end{enumerate}
\end{thm}

\begin{remark}
	For a set A, we let $2^A$ denote the set of all functions from A to $S_2 = \{0, 1\}$, i.e.
	\[
		2^A = \{f | f: A \to S_2 \}
	\]
\end{remark}

\begin{thm}[$\bb{R}$ as an Uncountable Set]
	\begin{enumerate}
		\item For every set A, $|\mathcal{P}(A| = |2^A|$.
		\item For every set A, $|A| < |\mathcal{P}(A)|$.
		\item $\bb{R}$ is uncountable.
	\end{enumerate}
\end{thm}

\begin{thm}[Cantor-Schröder-Bernstein Theorem]
	Let A and B be sets.
	\[
		|A| \leq |B| \land |B| \leq |A| \implies |A| = |B|.
	\]
\end{thm}

\end{document}
% Document End