\documentclass[11pt]{article}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{anyfontsize}
\usepackage[super]{nth}
\usepackage{ulem}
\usepackage{multicol}
\usepackage{phaistos}
\usepackage{verbatim}
\usepackage[pdftex]{graphicx}
\usepackage[all,arc]{xy}
\usepackage{url}
\usepackage{epigraph}
\usepackage{mathrsfs}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}


\newcommand{\len}{\textrm{length}}
\input{preamble.tex}

\begin{document}

\lecture{5: Measure, Integrals and Limits}{Week 6}
\setlength{\epigraphwidth}{.6\textwidth}
\epigraph{O! it is excellent\\
To have a giant's strength; but it is tyrannous\\
To use it like a giant.}{Isabella, scene II, Measure for Measure}


\section{Measure}

\subsection{Definitions.}
Loosely speaking, a ``measure'' on some space $X$ is simply a way to assign a notion of ``length'' to some of the subsets of that space.  For example, you already know how to assign a notion of length to the interval subsets of $\mathbb{R}$: you just set the length of $[a,b]$ to be $b-a$, for any interval $[a,b]$.

But how can we make this formal?  In other words: how can we talk about lengths for \textbf{lots} of things, rather than just the ``nice'' ones that we know?  Can we create a notion of length that is ``smart'' enough to know that the length of $[0,1/2] \cup [1/2,3/4] \cup [3/4, 7/8]\cup \ldots$ should be 1?

The answer is yes!  In this set of notes, we set about doing just this.

Formally, we say that a measure is the following sort of object:
\begin{defn}
A \textbf{measure} on $\mathbb{R}$ is a function $\mu$ from some collection of subsets of $\mathbb{R}$ to $\mathbb{R} \cup \{\infty\}$, such that $\mu$ satisfies the following properties:
\begin{enumerate}
\item $\mu(\emptyset) = 0$.
\item For any measurable set $A$, $\mu(A) \geq 0$.
\item If $X, Y$ are a pair of measurable sets, and $X \subseteq Y$, we have $\mu(X) \leq \mu(Y)$.
\item For any countable collection of disjoint measurable sets $\{A_i\}_{i=1}^\infty$, the set $\bigcup_{i=1}^\infty A_i$ is also measurable.  Moreover, we have the following equality:
\begin{align*}\mu\left(\bigcup_{i=1}^\infty A_i\right) = \sum_{i=1}^\infty \mu(A_i).
\end{align*}
\end{enumerate}
\end{defn}
This definition, however, is missing some of the aspects we really like about measures on $\mathbb{R}$.  For example, we could take the ``zero'' measure, that assigns every set measure 0 --- this satisfies our axioms, but isn't really a property that want to think length satisfies!  So we have two more properties that we'd like measures on the real line $\mathbb{R}$ to satisfy:
\begin{defn}
A measure $\mu$ on the real line is called a \textbf{Lebesgue measure} if it satisfies the following additional two properties:
\begin{enumerate}
\item[5.] $\mu([0,1]) = 1$.
\item[6.] $\mu$ is \textbf{scale and translation invariant}: in other words, given any measurable set $A$ and real number $t$, the set $t+ A = \{t+x ~|~ x \in A\}$ is measurable and has the same measure as $A$, while the set $tA = \{ t \cdot x ~|~ x \in A\}$ is also measurable and has measure $|t|\cdot \mu(A)$.
\end{enumerate}
\end{defn}

Throughout this talk, we will assume that ``measure'' means Lebesgue measure from here on out, and never refer to measures that are not Lebesgue unless explicitly stated as such.
\subsection{Properties; basic cases.}
Let's assume we have some such measure $\mu$.  What can we say about it?

Well: one plausible goal might be to verify some of the things that we know length ``ought'' to satisfy.  For example, we could ask about the length of an arbitrary interval $[a,b]$:
\begin{prop}
For any $a < b$, $a,b \in \mathbb{R}$, we have $\mu([a,b]) = b-a.$
\end{prop}
\begin{proof}
First, take the interval $[0,1]$.  By scaling, the measure of $[0, b-a]$ is just $b-a$ times the measure of $[0,1]$; therefore we know that $\mu([0,b-a]) = (b-a) \cdot 1$.

Now, translate the interval $[0,b-a]$ by $a$.  This doesn't change the length of our interval by our properties; consequently, we have that $\mu([a, b-a+a]) = \mu([a,b]) = b-a$, as claimed.
\end{proof}

We could also ask about the length of a single point:
\begin{prop}
For any $a \in \mathbb{R}$, we have $\mu(\{a\}) = 0.$
\end{prop}
\begin{proof}
We present three proofs, to give a feel for how measures work.  On one hand, the ``fast'' proof is simply to scale $[0,1]$ by 0; this tells us that the measure of the set $[0,0] = \{0\}$ is 0, and therefore by scaling that the measure of any single-point set is 0.

On the other hand, we could also prove this fact by contradiction: assume not, that there is some single point $a \in \mathbb{R}$ such that $\mu(\{a\}) \neq 0$.  Because measures only output positive real numbers or possible $\infty$, we can actually say that there is some $\epsilon > 0$ with $\mu(\{a\}) = \epsilon$.  (In practice, this strategy of ``this thing is nonzero: let's give a name to that nonzero quantity'' is something you should do on autopilot in your proofs!  Always give objects names!)

But, by translation, this would mean that the measure of \textbf{any} single-point set is $\epsilon$!  In particular, this would force the measure of any set containing infinitely many points --- say, $[0,1]$ --- to be infinity, as we would have 
\begin{align*}
\mu([0,1]) \geq \mu \left( \bigcup_{n=1}^\infty \left\{ \frac{1}{n}\right\} \right) = \sum_{n=1}^\infty \mu\left(\left\{ \frac{1}{n}\right\}\right) = \sum_{n=1}^\infty \epsilon = \infty.
\end{align*}
But this is impossible, as $\mu([0,1]) = 1$!  So we have a contradiction.

Finally, we can present a third proof, by ``covering.'' Suppose that we want to show that some set $S$ has measure zero.  To do this, we can simply show that it is ``covered'' by arbitrarily small sets!  In other words: suppose that for any $\epsilon > 0$, we could find a set $T$ with measure less than $\epsilon$, such that $S \subseteq T$. Then, because this implies that $\mu(S) \leq \mu(T)$, we would have shown that $\mu(S) \leq \epsilon$, for any $\epsilon > 0$.  But the only nonnegative number less than all positive numbers is 0; therefore $\mu(S) = 0$!

To do this here: take any $a$, and notice that for any $\epsilon  > 0$, the interval $[a-\epsilon/2, a+\epsilon/2]$ is a set of measure $\epsilon$ (by our first proposition) that contains $\{a\}$.  Therefore, for any $\epsilon > 0$ we have that $\mu(\{a\}) \leq \mu([a-\epsilon/2, a+\epsilon/2]) = \epsilon$; consequently $\mu(\{a\})$ must equal 0, as claimed.
\end{proof}

From here, you can make observations like the following:
\begin{prop}
For any $a < b$, $a,b \in \mathbb{R}$, we have $\mu((a,b)) = b-a.$
\end{prop}
\begin{proof}
Simply notice that 
\begin{align*}
b-a = \mu([a,b]) = \mu( \{a\} \cup (a,b) \cup \{b\}) = \mu(\{a\}) + \mu((a,b)) + \mu(\{b\}) = 0 + \mu((a,b)) + 0,
\end{align*}
and therefore that our claim is true.
\end{proof}

From here, we can start to study stranger sets.  Recall the Cantor set, from past problem sets:
\begin{defn}
The \textbf{Cantor set} $\mathcal{C}_\infty$ is defined as follows:
\begin{itemize}
\item Start with the interval $[0,1]$. Call this set $C_0$.
\item Remove the middle-third of this set, so that you have $[0, 1/3]$ and $[2/3, 1]$ left over.  Call this set $C_1$.
\item Remove the middle-third of those two sets, so that you have $[0, 1/9], [2/9, 1/3], [2/3, 7/9], [8/9, 1]$ left over.  Call this set $C_2$.
\item Repeat this process!  In other words, to form $C_n$, take all of the closed intervals that make up $C_{n-1}$, and remove the middle-third from each of these intervals.  The resulting collection of closed intervals is $C_n$.
\end{itemize}
Define $\mathcal{C}_\infty,$ the Cantor set, as the set made by taking all of the elements $x$ such that $x$ is in $C_i$, for every $i$.  In other words, set
\begin{align*}
\mathcal{C}_\infty = \bigcap_{n=1}^\infty C_n.
\end{align*}
\end{defn}
\begin{prop}
The measure of the Cantor set $\mathcal{C}_\infty$ is 0.
\end{prop}
\begin{proof}
Consider the construction of the Cantor set above.  In particular, let's define the ``leftover sets'' $L_n$ from the Cantor construction as follows:
\begin{itemize}
\item $L_1 = (1/3,2/3)$: in other words, $L_1$ consists of the middle-third that we removed from $C_0$ to make $C_1$.
\item $L_2 = (1/9,2/9) \cup (7/9, 8/9)$.  In other words, $L_2$ is the collection of all of the open intervals we deleted from $C_1$ to make $C_2$.
\item In general, $L_n = C_{n-1} \setminus C_{n}$.  
\end{itemize}
Now, make the following observations about how the sets $C_n, L_n$ grow and interact:
\begin{itemize}
\item $C_n$ is a union of $2^n$ distinct closed intervals.  To see this, simply apply induction.  Our base case, $C_0$ consists of $2^0 = 1$ interval.  Finally, if we inductively assume that $C_n$ is made out of $2^n$ intervals, when we delete the middle third out of each of those intervals to make $C_{n+1}$, we will have at the end $2^{n+1}$ many intervals (as we split each of our $2^n$ into two pieces.)
\item Consequently, we have that $L_n$ consists of a union of $2^{n-1}$ intervals, as there are as many pieces in $L_n$ as there were middle-thirds deleted from $C_{n-1}$.
\item As well, the length of each interval in $C_n$ is $\frac{1}{3^n}$.  This is again justifiable by induction; our base case has length $0 = 1/3^0$, while if $C_n$'s intervals all have length $1/3^n$, chopping out their middle-thirds will leave us with intervals of length $(1/3)(1/3^n)$ for $C_{n+1}$, as claimed.
\item Consequently, $L_n$'s intervals all have length $1/3^n$, as they correspond to precisely the deleted middle-thirds that transform $C_{n-1}$ into $C_n$. 
\item Finally, all of the $L_n$'s are disjoint from each other and from $\mathcal{C}_\infty$, as the $L_n$'s correspond to deleted middle-thirds from the Cantor set (check this if you don't see why it is true!)
\item As a result, we know the measure of $L_n$ for each $n$: because $L_n$ is made of $2^{n-1}$ disjoint open intervals of length $1/3^n$, we can conclude that $\mu(L_n) = \frac{2^{n-1}}{3^n}$ by our earlier results and properties.
\end{itemize}

What do these observations tell us?  Well: if we write
\begin{align*}
[0,1] = \mathcal{C}_\infty \cup \left(\bigcup_{n=1}^\infty L_n\right),
\end{align*}
and use the fact that $C_n$ and all of the $L_n$'s are disjoint, we have
\begin{align*}
1 = \mu([0,1]) = \mu\left(\mathcal{C}_\infty \cup \left(\bigcup_{n=1}^\infty L_n\right)\right) &= \mu\left(\mathcal{C}_\infty\right) + \sum_{n=1}^\infty \mu\left(L_n\right).\\
&= \mu\left(\mathcal{C}_\infty\right) + \sum_{n=1}^\infty \frac{2^{n-1}}{3^n}.\\
&= \mu\left(\mathcal{C}_\infty\right) +\frac{1/3}{1-(2/3)} = \mu\left(\mathcal{C}_\infty\right) + 1.\\
\end{align*}
Consequently, $\mu\left(\mathcal{C}_\infty\right) = 0$, as claimed.
\end{proof}

With somewhat less work, we can study a few stranger sets:
\begin{prop}
For any countable set $A$, $\mu(A) = 0$.
\end{prop}
\begin{proof}
Because $A$ is countable, there is some bijection between $A$ and the natural numbers!  Therefore, we can use this bijection to ``label'' the elements of $A$:\ that is, if $\phi: \mathbb{N} \to A$ is a bijection, simply label each element of $a$ with the element of $\mathbb{N}$ that maps to it!  

Doing this lets us write $A = \{a_n\}_{n=0}^\infty$, as we have ``labeled'' all of our elements in $A$.  This is a tremendously useful thing to do to $A$, and is often the first/only thing we will do with a set when we know that it is countable!  In later proofs, we will skip this discussion, and simply say ``Write $A = \{a_n\}_{n=1}^\infty$\ldots'' to start our proofs; but it's a useful trick!

With this done: simply notice that
\begin{align*}
\mu(A) = \mu \left( \bigcup_{n=1}^\infty \{a_n\} \right) = \sum_{n=1}^\infty \mu(\{a_n\}) = \sum_{n=1}^\infty 0
 = 0.
 \end{align*}
Therefore, $\mu(A) = 0$!
\end{proof}

This has some strange corollaries:
\begin{cor}
$\mu(\mathbb{Q}) = 0$.
\end{cor}
\begin{cor}
$\mu([0,1] \setminus \mathbb{Q}) = 1$.
\end{cor}

Think about these two results for a while; try to persuade yourself why they are true, and also try to think about why they are surprising!


From here, you might wonder how much further you can keep going: i.e. how many sets can we define our measure on?  Can you make \textbf{every} set measurable?  

Surprisingly enough, the answer is no!  Within the axioms that we work with in mathematics, we can construct sets that cannot have any notion of length in any Lebesgue measure.  We give a proof of this here:
\begin{thm}
There is a nonmeasurable set.
\end{thm}
\begin{proof}
Consider the following construction.  Take the interval $[0,1]$.  Define an equivalence relation on $[0,1]$ as follows: set $x \sim y$ iff $x-y \in \mathbb{Q}$.  (Check that this is an equivalence relation!)  

For example, the collection of all elements equivalent to $0$ here is just the set
\begin{align*}
\{x \in \mathbb{R} ~|~ x - 0 \in \mathbb{Q} \};
\end{align*}
in other words, the equivalence class for $0$ is just $\mathbb{Q}$!  Similarly, the equivalence class for $\pi$ is just
\begin{align*}
\{x \in \mathbb{R} ~|~ x - \pi \in \mathbb{Q} \} = \{\pi + q ~|~ q \in \mathbb{Q} \} =  \mathbb{Q} + \pi,
\end{align*}
and our other equivalence classes look similar.

Using this equivalence relation, we can partition $[0,1]$ into its equivalence classes under this relation!  Denote these equivalence relations $\{E_i\}_{i \in I}$, for some indexing set $I$.  (This trick, of labeling things with some index set $I$ without saying what $I$ is, is an incredibly useful one!  For example, right now, we don't know what $I$ is: it would be a mistake to assume that $I$ is countable, or perhaps the size of $\mathcal{P}(\mathbb{R})$, without knowing more.  But we can certainly assert that there is some way to collect all of our equivalence relations together; once we do this, we can simply let $I$ be any way to label all of these sets!)

Now, take each of these sets $E_i$, and pick out\footnote{The particularly astute among you might notice that this step --- unique among the steps we've done throughout this class since we started axiomatizing things in week 2 to build the natural numbers! --- is, strictly speaking, not something that our axioms let us do.  We can make power sets and unions and formulas and all sorts of stuff, but there is no axiom that lets us simply pick out elements from other sets without defining a rule!  So, let's fix that here:
\begin{axiom}[The Axiom of Choice]:  For every family $\Phi$ of nonempty sets, there is a choice function 
\begin{align*}
f: \Phi \to \bigcup_{S \in \Phi} S,
\end{align*}
such that $f(S) \in S$ for every $S \in \Phi$.
\end{axiom}

When this was first proposed as an axiom, mathematicians were opposed to it on several grounds:
\begin{itemize}
\item Constructivist and intutionist mathematicians opposed it, on the grounds that it posits the existence of functions without any clue whatsoever as to how to find them!  
\item Many other working mathematicians just thought it was a true statement; i.e. that AC was a trivial consequence of any logical framework of mathematics.
\end{itemize}
Surprisingly enough, however, Paul Cohen and Kurt G\"odel proved that the axiom of choice is independent of the Zermelo-Fraenkel axioms of set theory, the current framework within which we do mathematics: i.e. that it is its own proper axiom!  Pretty much all of modern mathematics accepts the Axiom of Choice; it's a pretty phenomenally useful axiom, and most fields of mathematics like to be able to call on it when pursuing nonconstructive proofs.  We'll talk lots more about it later.} some element $e_i \in E_i$ from each of them.  Furthermore, when we do this, pick out $e_i$ so that it lives in the interval $[0,1]$.  This is not hard to do: if we have any element $e_i \in E_i$, then any translation $e_i + q$ is also in $E_i$.   Therefore we can just shift our element into $[0,1]$ if it wasn't already there!


Let $A+q$ denote the translation of $A$ by some rational $q$.  Notice that for any $q, r \in \mathbb{Q}$, if $A+q$ and $A+r$ have an element in common, we would have some $e_i + q = e_j + r$.  But this means that $e_i \sim e_j$; consequently, because there is only one member from any equivalence class in $A$, this tells us that $e_i = e_j$, and therefore that $q = r$!  In other words, if $q \neq r$, $A+q \neq A+r$.

Conversely; for any $x \in \mathbb{R}$, there is some $q \in \mathbb{Q}$ such that $x \in A+q$.  To see this, simply find the equivalence class $E_i$ of $\mathbb{R}$ that contains $x$, and look up the representative $e_i$ we chose for $E_i$.  We know by definition that $x \sim e_i$; consequently, there is some $q$ such that $x = e_i + q$, and therefore that $x \in A+q$.

Therefore, the collection of sets $\{A + q ~|~ q \in \mathbb{Q}\}$ partition the real numbers!  That's\ldots strange.

How strange?  Well: consider the union $\mathcal{A}$ of these sets given by all translations of $A$ by a rational number in $[-1,1]$,
\begin{align*}
\mathcal{A} = \bigcup_{q \in [-1,1] \cap \mathbb{Q}} (A + q)
\end{align*}
On one hand: for any $x \in [0,1]$, if $x$ is in the equivalence class $E_i$, we can see that 
\begin{align*}
x \sim e_i \Rightarrow x = e_i + q, \textrm{ for some }q \Rightarrow q \in [-1,1],
\end{align*}
because both $x, e_i \in [0,1]$, and therefore their difference is at least $-1$ and at most 1.

On the other hand: no element in $\mathcal{A}$ is greater than 2 (as elements in $A$ are all $\leq 1$) nor smaller than $-1$ (as elements in $A$ are all nonnegative.)

Therefore, we have
\begin{align*}
(-1,2) \supseteq \bigcup_{q \in [-1,1] \cap \mathbb{Q}} (A + q) \supseteq [0,1],
\end{align*}
and therefore that

\begin{align*}
3 = \mu((-1,2)) \geq \mu\left(\bigcup_{q \in [-1,1] \cap \mathbb{Q}} (A + q) \right)\geq \mu([0,1]) = 1
\end{align*}

But all of the $A+{q}$'s are just translations of each other.  Therefore they all have the same measure, $\mu(A)$: so we have
\begin{align*}
3 \geq \sum_{q \in [-1,1] \cap \mathbb{Q}} \mu(A)\geq 1.
\end{align*}
So: what is $\mu(A)$?  We can clearly see that it is nonzero, because otherwise we would not satisfy our rightmost inequality, that $\sum_{q \in [-1,1] \cap \mathbb{Q}} \mu(A)\geq 1$.  But we cannot have that it is equal to any $\epsilon > 0$, because this would break our leftmost inequality $3 \geq \sum_{q \in [-1,1] \cap \mathbb{Q}} \mu(A)$.  But any nonnegative number is either 0 or greater than 0; consequently, we have proven that there is \textbf{no} value we can assign to $\mu(A)$ without creating a contradiction!

In other words: for any measure $\mu$ that we make, there are sets (like $A$!) that \textbf{cannot} be measured by that $\mu$!  In other words; there are nonmeasurable sets.
\end{proof}
Strange!  

Despite this oddity, though, measures are still pretty ridiculously useful.  One of the best applications of the concept of measure is to \textbf{integration,} which we discuss in the next section:
\section{Integration}

\subsection{The old-school approach.}
Way back in calculus, you probably saw the integral of a function defined as ``the area under the curve.''  As a rigorous definition, this seems lacking --- what is this area, and how are we calculating it? --- but it is not a bad place to start.  For example, this definition works just fine at telling us what the integral of certain very simple functions should be:
\begin{defn}
Take any interval $[a,b)$, for $a < b \in \mathbb{R}$.  We define the \textbf{characteristic function} $\chi_{[a,b)}(x)$ of this interval as follows:
\begin{align*}
\chi_{[a,b)}(x) = \left\{ \begin{array}{cc} 1, & x \in [a,b), \\ 0, & x \notin [a,b).\end{array}\right.
\end{align*}
\end{defn}


\begin{defn}
For any interval $[a,b)$ and corresponding characteristic function $\chi_{[a,b)}$, we define the \textbf{integral} of $\chi_{[a,b)}(x)$ over $\mathbb{R}$ as $b-a$, and write
\begin{align*}
\int_{\mathbb{R}}\chi_{[a,b)}(x)dx = b-a.
\end{align*}
Notice that this is the area between our function and the $x$-axis!
\begin{center}
%\includegraphics[width=3in]{charfn.pdf}
\end{center}
\end{defn}

We can extend this definition in a few logical ways:

\begin{defn}
For any interval $[a,b)$ and corresponding characteristic function $\chi_{[a,b)}$, and any constant $c$, we set the  \textbf{integral} of $c \cdot \chi_{[a,b)}(x)$ over $\mathbb{R}$ as $c \cdot (b-a)$, and write
\begin{align*}
\int_{\mathbb{R}}c\chi_{[a,b)}(x)dx = c(b-a).
\end{align*}
This, too, is the area between our function and the $x$-axis, if we interpret area ``beneath'' the $x$-axis as ``negative.''
\begin{center}
%\includegraphics[width=3in]{charfn.pdf}
\end{center}

Similarly, for any disjoint intervals $[a_1, b_1), [a_2, b_2), \ldots [a_n, b_n)$, corresponding characteristic functions $\chi_{[a_1,b_1)}(x), \ldots \chi_{[a_n,b_n)}(x)$, and any constants $c_1, \ldots c_n$, we set the \textbf{integral} of $\displaystyle\sum_{k=1}^n c_k\cdot \chi_{[a_k,b_k)}(x)$ over $\mathbb{R}$ to be the sum $\displaystyle\sum_{k=1}^n c_k (b_k - a_k)$: that is,
\begin{align*}
\int_{\mathbb{R}}\left( \sum_{k=1}^n c_k\cdot \chi_{[a_k,b_k)}(x) \right)dx = \displaystyle\sum_{k=1}^n c_k (b_k - a_k).
\end{align*}
This, as well, is still the area between our function and the $x$-axis, because the sum of our individual areas is just the area of our sum!
\begin{center}
%\includegraphics[width=3in]{charfn.pdf}
\end{center}
\end{defn}
The sorts of functions that we could integrate above are particularly useful, and merit a definition of their own:
\begin{defn} 
Take any collection of intervals $[a_1, b_1), [a_2, b_2), \ldots [a_n, b_n)$, corresponding characteristic functions $\chi_{[a_1,b_1)}(x), \ldots \chi_{[a_n,b_n)}(x)$, and any constants $c_1, \ldots c_n$.

The \textbf{step function} associated to these objects is the map
\begin{align*}
\displaystyle\sum_{k=1}^n c_k\cdot \chi_{[a_k,b_k)}(x).
\end{align*}
\end{defn}
Notice that if any two scaled characteristic functions $\chi_{[a_1,b_1)}(x),  \chi_{[a_2,b_2)}(x)$ overlap, then we can actually write their sum as the sum of three scaled non-overlapping characteristic functions!  For example, we can write 
\begin{align*}
3\chi_{[1,4)}(x) + 5\chi_{[2, 7)}(x) = 3\chi_{[1,2)}(x) + 8\chi_{[2,4)}(x) + 5\chi_{[4,7)}(x).
\end{align*}
So, when we work with the concepts above, we can actually omit the ``disjoint'' condition above, as it doesn't change our results; this will simplify\footnote{Relatedly, this is why we're working with intervals of the form $[a,b)$ instead of the more standard closed $[a,b]$ or open $(a,b)$ intervals.  Tntervals of this form have the nice property that when you stack/intersect/union them, the resulting intervals all still have the same form --- this simplifies some of our arguments!  You could of course do everything here with other sorts of intervals, and it would all work; you'd just have weird things where equations like the above would not hold at single points of overlap or stuff like that.} our work. 


So: how can we integrate other functions?  Well: the central idea that you probably saw back in calculus was that if you wanted to find the area beneath \textbf{any} curve, you could just \textbf{approximate} that curve with rectangles, and take the area beneath those rectangles! Somewhat more formally, this is the following definition:

\begin{defn}
Take any function $f: \mathbb{R} \to \mathbb{R}$, and any interval $[a,b]$.  We say that $f$ is \textbf{integrable} on the interval $[a,b]$ if the following equation holds:
\begin{align*}
\inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } [a,b],\\ \varphi(x) \textrm{ a step function}, \\\varphi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \varphi(x) dx = \sup_{\substack{\psi(x) \leq f(x) \textrm{ on } [a,b],\\ \psi(x) \textrm{ a step function}, \\\psi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \psi(x) dx.
\end{align*}
If this does happen, then we say that the integral $\int_a^b f(x) dx$ is equal to both the left- and right-hand-sides above.


There are a lot of undefined concepts here!  Let's back up and define some of them:
\begin{itemize}
\item Given any set $A \subseteq \mathbb{R}$, we define the \textbf{infimum} of that set as the largest element $I \in \mathbb{R}$ such that $I \leq a, \forall a \in A$.  This, in a sense, is describing the ``best possible'' lower bound for $A$.  We denote this by ``$\inf$'' for shorthand.  For example, in the above definition, the left-hand-side is the infimum of the set 
\begin{align*}
\left\{\int_{\mathbb{R}} \varphi(x) dx ~\big|~ \varphi(x) \geq f(x) \textrm{ on }  [a,b], \varphi(x) = 0 \textrm{ off of } [a,b], \varphi(x) \textrm{ a step function}. \right\}
\end{align*}

To offer another example: the infimum of the set $(0,1)$ is 0, because
\begin{itemize}
\item $0 \leq x,$ for all $x \in (0,1)$; that is, $0$ is a lower bound!
\item Moreover, $0$ is the largest possible lower bound.  To see this, take any any other potential lower bound $\epsilon > 0$.  We can trivially observe that $\epsilon < 1$, as otherwise $\epsilon$ would fail to be a lower bound for \textbf{any} of the elements in our set!  

But then we have that $\epsilon \not\leq \epsilon/2$, while $\epsilon/2 \in (0,1)$ (because $\epsilon < 1$.)  So no value greater than 0 can be a lower bound!
\end{itemize}
Checking these two properties is how we show that something is an infimum.
\item Similarly, given any set $A \subseteq \mathbb{R}$, we define the \textbf{supremum} of that set as the smallest element $S \in \mathbb{R}$ such that $S \geq a, \forall a \in A$.  This, in a sense, is describing the ``best possible'' upper bound for $A$.  We denote this by ``$\sup$'' for shorthand.  Again, for example, the right-hand-side above is the supremum of the set 
\begin{align*}
\left\{\int_{\mathbb{R}} \psi(x) dx ~\big|~ \psi(x) \leq f(x) \textrm{ on }  [a,b], \psi(x) = 0 \textrm{ off of } [a,b], \psi(x) \textrm{ a step function}. \right\}
\end{align*}
To offer another example: the supremum of the set $[3,7]$ is 7, because
\begin{itemize}
\item $7 \geq x,$ for all $x \in [3,7]$; that is, $7$ is a upper bound!
\item Moreover, $7$ is the smallest possible upper bound.  Take any other possible upprt bound that is less than 7; we can describe this possible bound as $7-\epsilon$, for some positive $\epsilon$.  Notice that $\epsilon \leq 4$, as otherwise our upper bound would not be less than 3 (and thus in particular not less than any element in our set!  

But then we have that $7-\epsilon \not\leq 7-(\epsilon/2)$, while $7-\epsilon/2$ is an element in $[3,7]$ (because $\epsilon < 4$.)  So no value less than 7 can be a upper bound!
\end{itemize}
Checking these two properties is how we show that something is an infimum.
\end{itemize}

Ok.  With that done, let's check back in with our definition and make sure that it's actually describing what we think an integral should be!  

On one hand, we can interpret the left-hand-side of 
\begin{align*}
\inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } [a,b],\\ \varphi(x) \textrm{ a step function}, \\\varphi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \varphi(x) dx = \sup_{\substack{\psi(x) \leq f(x) \textrm{ on } [a,b],\\ \psi(x) \textrm{ a step function}, \\\psi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \psi(x) dx.
\end{align*}
as the ``smallest set of rectangles that are greater than $f(x)$ on $[a,b]$.''   On the other, we can interpret the right-hand-side as the ``largest set of rectangles that are smaller than $f(x)$ on $[a,b]$.''

If our function has a well-defined area beneath its curve, then these two methods of measuring area --- creating the best upper bound, versus making the best lower bound --- should agree!  Therefore, we are simply saying that a function has well-defined area beneath its curve if and only if these two methods of measuring agree with each other.

\begin{center}
%\includegraphics[width=3in]{charfn.pdf}
\end{center}
\end{defn}

To illustrate how this definition works, consider the following example:

\begin{thm}
The integral of $x^2$ on $[0,1]$ is  $\frac{1}{3}$.
\end{thm}
\begin{proof} 
To do this, a natural first step is to try to find some likely-looking step functions that seem to be going to the same values.  How can we do this?

Well: one trick that will usually work is to simply divide the interval $[0,1]$ into $n$ equal parts -- i.e. to consider the division $[0,1/n), [1/n, 2/n), \ldots [(n-1)/n, 1]$.  Under this division, the best upper-bound function $\varphi(x)$ we can make is
\begin{align*}
\varphi(x) = \left\{ \begin{array}{cc} 
1/n^2, & x \in [0,1/n), \\ 
4/n^2, & x \in [1/n, 2/n),\\
9/n^2, & x \in [2/n, 3/n),\\
& \vdots \\
1, & x \in [(n-1/n, 1].\\
\end{array}\right.
\end{align*}

Similarly, the best lower-bound function $\psi(x)$ we can have is 
\begin{align*}
\varphi(x) = \left\{ \begin{array}{cc} 
0, & x \in [0,1/n), \\ 
1/n^2, & x \in [1/n, 2/n),\\
4/n^2, & x \in [2/n, 3/n),\\
& \vdots \\
(n-1)^2/n^2, & x \in [(n-1/n, 1].\\
\end{array}\right.
\end{align*}

We can integrate these two functions, and get
\begin{align*}
\int \varphi(x) dx &= \sum_{k=1}^n \frac{k^2}{n^2} \cdot \len([(k-1)/n,(k/n))\\
&=\sum_{k=1}^n \frac{k^2}{n^3}\\
&= \frac{\sum_{k=1}^n k^2}{n^3}\\
&= \frac{\frac{n(n+1)(2n+1)}{6}}{n^3}\\
&= \frac{2n^3 + 3n^2 + 1}{6n^3} \\
&= \frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2},
\end{align*}
while
\begin{align*}
\int \psi(x) dx &= \sum_{k=1}^n \frac{(k-1)^2}{n^2} \cdot \len([(k-1)/n,(k/n))\\
&=\sum_{k=1}^n \frac{(k-1)^2}{n^3}\\
&= \frac{\sum_{k=0}^{n-1} k^2}{n^3}\\
&= \frac{\frac{(n-1)n(2n-1)}{6}}{n^3}\\
&= \frac{2n^3 - 3n^2 + 1}{6n^3} \\
&= \frac{1}{3} - \frac{1}{2n} + \frac{1}{6n^2}.
\end{align*}
(In both cases, we used the identity $\sum_{k=1}^n \frac{k^2} = \frac{n(n+1)(2n+1)}{6}$, which is easily proved by induction if you haven't seen it!)

What does this mean?  Well: we know that on one hand, for any $n$ we have
\begin{align*}
\inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } [a,b],\\ \varphi(x) \textrm{ a step function}, \\\varphi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \varphi(x) dx \leq \frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2},
\end{align*}
because the smallest value must be at least as small as these values for $\varphi$ we've just found.  Similarly, we have that 
\begin{align*}
\sup_{\substack{\psi(x) \leq f(x) \textrm{ on } [a,b],\\ \psi(x) \textrm{ a step function}, \\\psi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \psi(x) dx \geq \frac{1}{3} - \frac{1}{2n} + \frac{1}{6n^2},
\end{align*}
because the largest value must be at least as large as these values for $\psi$ we've just found.

But we also know that 
\begin{align*}
\inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } [a,b],\\ \varphi(x) \textrm{ a step function}, \\\varphi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \varphi(x) dx \geq \sup_{\substack{\psi(x) \leq f(x) \textrm{ on } [a,b],\\ \psi(x) \textrm{ a step function}, \\\psi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \psi(x) dx,
\end{align*}
because for any $\varphi(x) \geq f(x)$ and $\psi(x) \leq f(x)$ on $[a,b]$, we have $\varphi(x) \geq \psi(x)$ for all $x$, and therefore that $\int \varphi(x) \geq \int \psi(x)$ must hold!

But, if we combine all of our observations, we have that for all $n$, 
\begin{align*}
\frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2} \geq \inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } [a,b],\\ \varphi(x) \textrm{ a step function}, \\\varphi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \varphi(x) dx \geq \sup_{\substack{\psi(x) \leq f(x) \textrm{ on } [a,b],\\ \psi(x) \textrm{ a step function}, \\\psi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \psi(x) dx \geq \frac{1}{3} - \frac{1}{2n} + \frac{1}{6n^2}.
\end{align*}

For large values of $n$, the far-left-hand and far-right-hand sides go to $1/3$; therefore the middle two terms must be equal to $1/3$!  Therefore our function $x^2$ is integrable, and its integral is $1/3$, as claimed.  
\end{proof}


So we can integrate things!  However, we cannot integrate all things with our current definitions:

\begin{thm}
The function
\begin{align*}
f(x) = \left\{ \begin{array}{cc} 
1, & x \in [0,1] \cap \mathbb{Q}, \\ 
0, & \textrm{otherwise}\\
\end{array}\right.
\end{align*}
is not integrable on $[0,1]$.
\end{thm}
\begin{proof}
To see why, consider any step function $\varphi(x)$ such that $\varphi(x) \geq f(x)$ on $(0,1)$.  Notice that it is impossible for $\varphi(x)$ to be anything less than 1 on this interval: if $\varphi(x) < 1$ at some $x \in (0,1)$, then, because $\varphi$ is a sum of a finite number of disjoint scaled copies of characteristic functions of intervals, there is some entire interval on which $\varphi$ is less than 1.  But any interval contains rational points!  Therefore, $\varphi(x)$ is not greater than $f(x)$ on this interval, which is a contradiction.

Similarly, notice that if $\psi(x)$ is any step function such that $\psi(x)\leq f(x)$ on $(0,1)$, then $\psi(x)$ must be no greater than 0 on this interval (by the same logic!)

But this means that 
\begin{align*}
\inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } [a,b],\\ \varphi(x) \textrm{ a step function}, \\\varphi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \varphi(x) dx &\geq 1, \textrm{ while}\\
\sup_{\substack{\psi(x) \leq f(x) \textrm{ on } [a,b],\\ \psi(x) \textrm{ a step function}, \\\psi(x) = 0 \textrm{ off of [a,b]}}} \int_{\mathbb{R}} \psi(x) dx &\leq 0.
\end{align*}
Consequently, these two quantities cannot be equal!  Therefore our function is not integrable.
\end{proof}

This is \ldots bothersome.  Luckily, we can fix this with our concept of \textbf{measure!}

\subsection{Measures and integration.}

Consider the following alternate definition for integrals:

\begin{defn}
Take any subset $S$ of $\mathbb{R}$.  We define the \textbf{characteristic function} $\chi_{S}(x)$ of this set as follows:
\begin{align*}
\chi_{s}(x) = \left\{ \begin{array}{cc} 1, & x \in S, \\ 0, & x \notin S\end{array}\right.
\end{align*}
\end{defn}


\begin{defn}
For any measurable subset $S \subseteq \mathbb{R}$ and corresponding characteristic function $\chi_{s}$, we define the \textbf{Lebesgue integral} of $\chi_{s}(x)$ over $\mathbb{R}$ as $\mu(S)$, and write
\begin{align*}
\int_{\mathbb{R}}\chi_{s}(x)dx =\mu(S).
\end{align*}
Notice that this is the ``area'' between our function and the $x$-axis, if we interpret area as ``length'' times height, and stick with our intuitive idea of the measure of a set being its length!
\end{defn}

We extend this to combinations of such characteristic functions in the same way as before:
\begin{defn} 
Take any collection of sets $S_1, \ldots S_n$ and corresponding characteristic functions $\chi_{s_1}(x), \ldots \chi_{s_n}(x)$, and any constants $c_1, \ldots c_n$.

The \textbf{simple function} associated to these objects is the map
\begin{align*}
\sum_{k=1}^n c_k\cdot \chi_{s_n}(x).
\end{align*}
We define the Lebesgue integral of any such simple function in the same way as before:
\begin{align*}
\int_{\mathbb{R}}\left(\sum_{k=1}^n c_k\cdot \chi_{s_n}(x)\right) dx = \sum_{k=1}^n c_k \cdot \mu(S_k).
\end{align*}
\end{defn}

\begin{defn}
Take any function $f: \mathbb{R} \to \mathbb{R}$, and any measurable set $S$.  We say that $f$ is \textbf{Lebesgue-integrable} on the set $S$ if the following equation holds:
\begin{align*}
\inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } S\\ \varphi(x) \textrm{ a simple function}, \\\varphi(x) = 0 \textrm{ off of S}}} \int_{\mathbb{R}} \varphi(x) dx = \sup_{\substack{\psi(x) \leq f(x) \textrm{ on } S,\\ \psi(x) \textrm{ a simple function}, \\\psi(x) = 0 \textrm{ off of S}}} \int_{\mathbb{R}} \psi(x) dx.
\end{align*}
If this does happen, then we say that the integral $\int_S f(x) dx$ is equal to both the left- and right-hand-sides above.
\end{defn}
In other words: this is just our definition from before, except with measures used to calculate lengths instead of simply using intervals!  As promised, this will let us integrate new functions:
\begin{thm}
The function
\begin{align*}
f(x) = \left\{ \begin{array}{cc} 
1, & x \in [0,1] \cap \mathbb{Q}, \\ 
0, & \textrm{otherwise}\\
\end{array}\right.
\end{align*}
is Lebesgue-integrable on $[0,1]$, and has integral 0.
\end{thm}
\begin{proof}
To see this, simply notice that $f(x)$ is just the characteristic function of the set $\mathbb{Q} \cap [0,1]$.  We could be done right here, as we know how to integrate characteristic functions; but let's pretend we forgot this for a second.  

Then, we can pick $\varphi(x) = f(x) = \psi(x)$ as valid simple functions such that $\varphi(x) \geq f(x) \geq \psi(x)$, and notice that because
\begin{align*}
\int_\mathbb{R} \varphi(x) dx = \mu(\mathbb{Q} \cap [0,1]) = 0 = \int_\mathbb{R} \psi(x) dx ,
\end{align*}
we have
\begin{align*}
0 \geq \inf_{\substack{\varphi(x) \geq f(x) \textrm{ on } S\\ \varphi(x) \textrm{ a simple function}, \\\varphi(x) = 0 \textrm{ off of S}}} \int_{\mathbb{R}} \varphi(x) dx \qquad\geq \sup_{\substack{\psi(x) \leq f(x) \textrm{ on } S,\\ \psi(x) \textrm{ a simple function}, \\\psi(x) = 0 \textrm{ off of S}}} \int_{\mathbb{R}} \psi(x) dx \geq 0
\end{align*}
and therefore that both sides are equal, and in particular equal to 0.
\end{proof}

Instead of delving further into this concept, we take a sidetrack to one of the more interesting concepts we hit on with our discussion of infimum and supremum earlier: the idea of limits!

\section{Limits of Sequences}


\subsection{Sequences: Definitions}
We list the basic definitions here.
\begin{defn}
A \textbf{sequence} of real numbers is a collection of real numbers $\{a_n\}^\infty_{n=1}$  indexed by the natural numbers.  
\end{defn}

\begin{defn}
A sequence  $\{a_n\}^\infty_{n=1}$ is called $\textbf{bounded}$ if there is some value $B \in \mathbb{R}$ such that $|a_n| < B$, for every $n \in \mathbb{N}$.  Similarly, we say that a sequence is \textbf{bounded above} if there is some value $U$ such that $a_n \leq U, \forall n$, and say that a sequence is \textbf{bounded below} if there is some value $L$ such that $a_n \geq L, \forall n$.
\end{defn}

\begin{defn}
A sequence  $\{a_n\}^\infty_{n=1}$ is said to be $\textbf{monotonically increasing}$ if $a_{n} \leq a_{n+1}$, for every $n \in \mathbb{N}$; conversely, a sequence is called \textbf{monotonically decreasing} if $a_{n} \geq a_{n+1}$, for every $n \in \mathbb{N}$.
\end{defn}
\begin{defn}
A sequence $\{a_n\}^\infty_{n=1}$  converges to some value $\lambda$ if the $a_n$'s ``go to $\lambda$'' at infinity. To put it more formally,
$\lim_{n \to \infty}a_n = \lambda$ iff for any distance $\epsilon$, there is some cutoff point $N$ such that for any $n$ greater than this cutoff point, $a_n$ must be within $\epsilon$ of our limit $\lambda$.

In symbols:
\begin{align*}
\lim_{n \to \infty} a_n = \lambda \textrm{ iff }( \forall \epsilon )(\exists N )(\forall n > N)~ |a_n - \lambda| < \epsilon.
\end{align*}
\end{defn}

Convergence is one of the most useful properties of sequences!   If you know that a sequence converges to some value $\lambda$, you know, in a sense, where the sequence is ``going,'' and furthermore know where almost all of its values are going to be (specifically, close to $\lambda$.) 

Because convergence is so useful, we've developed a number of tools for determining where a sequence is converging to.  We omit the proofs of these results here; you'll see them when you take a proper analysis class!

\subsection{Sequences: Convergence Tools}
\begin{enumerate}
\item \textbf{The definition of convergence}:  The simplest way to show that a sequence converges is sometimes just to use the definition of convergence.  In other words, you want to show that for any distance $\epsilon$, you can eventually force the $a_n$'s to be within $\epsilon$ of our limit, for $n$ sufficiently large.  

How can we do this?  One method I'm fond of is the following approach:
\begin{itemize}
\item First, examine the quantity $|a_n - L|$, and try to come up with a very simple upper bound that depends on $n$ and goes to zero.  Example bounds we'd love to run into: $1/n, 1/n^2, 1/\log(\log(n)).$
\item Using this simple upper bound, given $\epsilon > 0$, determine a value of $N$ such that whenever $n > N$, our simple bound is less than $\epsilon.$  This is usually pretty easy: because these simple bounds go to 0 as n gets large, there's always some value of $N$ such that for any $n > N$, these simple bounds are as small as we want.
\item Combine the two above results to show that for any $\epsilon$, you can find a cutoff point $N$ such that for any $n > N$, $|a_n-L| < \epsilon$.
\end{itemize}

\item \textbf{The definition of nonconvergence}:  Sometimes, you will want to show that a given sequence $\{a_n\}_{n=1}^\infty$ \textbf{fails} to converge!  How can you do this?  Well: if we're working with our definition, we would want to prove that
\begin{align*}
\neg\left( \exists L ~\forall \epsilon ~\exists N ~\forall n > N,~ |a_n - \lambda| < \epsilon\right).
\end{align*}
If you recall from week 1 how to work with negation and quantifiers, you can express this statement equivalently as the following claim:
\begin{align*}
\forall L ~\exists \epsilon ~\forall N ~\exists n > N,~ |a_n - \lambda| \geq \epsilon.
\end{align*}

In other words, for any limit $L$ we want to find an $\epsilon$ such that some of our terms in our sequence are at least $\epsilon$-away from $L$, no matter how far away we are restricted to look for such terms!

How can we do this?  Well: we can actually just mimic how we use the definition!
\begin{itemize}
\item Start by taking any $L$, as this must be our first step.
\item First, examine the quantity $|a_n - L|$, and try to come up with a very simple \textbf{lower} bound that depends on $n$ but does not go to 0, like say $1$.  You don't need this bound to hold for all $n$: you just want it to hold \textbf{infinitely often}, that is for any $N$ you want to be able to find a $n > N$ for which this bound will hold.
\item Using this simple lower bound, pick $\epsilon$ that is smaller than this lower bound!  
\item Then, we now have that for any $L$, we have found $\epsilon$ such that for all $N$, we can find a $n  > N$ with $|a_n - L| \geq \epsilon$!  So we've proven our claim.
\end{itemize}

\item \textbf{Arithmetic and sequences}:  These tools let you combine previously-studied results to get new ones.  Specifically, we have the following results:
\begin{itemize}
\item \textit{Additivity of sequences}: if $\lim_{n \to \infty} a_n, \lim_{n \to \infty} b_n$ both exist, then $\lim_{n \to \infty} a_n + b_n = (\lim_{n \to \infty} a_n) + (\lim_{n \to \infty} b_n)$.
\item \textit{Multiplicativity of sequences}: if $\lim_{n \to \infty} a_n, \lim_{n \to \infty} b_n$ both exist, then  $\lim_{n \to \infty} a_n b_n =  (\lim_{n \to \infty} a_n) \cdot (\lim_{n \to \infty} b_n)$.
\end{itemize}

\item \textbf{Monotone and bounded sequences}: if the sequence $\{a_n\}_{n=1}^\infty$ is bounded above and nondecreasing, then it converges; similarly, if it is bounded below and nonincreasing, it also converges.  If a sequence is monotone, this is usually the easiest way to prove that your sequence converges, as both monotone and bounded are ``easy'' properties to work with.  One interesting facet of this property is that it can tell you that a sequence converges without necessarily telling you what it converges to!  So, it's often of particular use in situations where you just want to show something converges, but don't actually know where it converges \textit{to}.

\item \textbf{Squeeze theorem for sequences}: if $\lim_{n \to \infty} a_n, \lim_{n \to \infty} b_n$ both exist and are equal to some value $l$, and the sequence $\{c_n\}_{n=1}^\infty$ is such that $a_n \leq c_n \leq b_n$, for all n, then the limit $\lim_{n \to \infty} c_n$ exists and is also equal to $l$.  This is particularly useful for sequences with things like $\sin(\textrm{horrible things})$ in them, as it allows you to ``ignore'' bounded bits that aren't changing where the sequence goes.


\item \textbf{Cauchy sequences}: We say that a sequence is \textbf{Cauchy} if and only if for every $\epsilon > 0$ there is a natural number $N$ such that for every $m> n \geq N$, we have
\begin{align*}
|a_m - a_n| < \epsilon.
\end{align*}

You can think of this condition as saying that Cauchy sequences ``settle down'' in the limit -- i.e. that if you look at points far along enough on a Cauchy sequence, they all get fairly close to each other.

The Cauchy theorem, in this situation, is the following: a sequence is Cauchy if and only if it converges.
\end{enumerate}

\subsection{Sequences: Applications of Convergence Tools}
In this section, we work an example for each of these tools.  We start by illustrating how to prove a sequence converges using just the definition:

\begin{claim}
(Definition of convergence example:)
\begin{align*}
\lim_{n \to \infty} \sqrt{n+1} - \sqrt{n} = 0.
\end{align*}
\end{claim}
\begin{proof}
When we discussed the definition as a convergence tool, we talked about a ``blueprint'' for how to go about proving convergence from the definition: (1) start with $|a_n - L|$, (2) try to find a simple upper bound on this quantity depending on $n$, and (3) use this simple bound to find for any $\epsilon$ a value of $N$ such that whenever $n > N$, we have
\begin{align*}
|a_n - L| < (\textrm{simple upper bound}) < \epsilon.
\end{align*}

Let's try this!  Specifically, examine the quantity $| \sqrt{n+1} - \sqrt{n} - 0|$:
\begin{align*}
| \sqrt{n+1} - \sqrt{n} - 0| &= \sqrt{n+1} - \sqrt{n} \\
&= \frac{(\sqrt{n+1} - \sqrt{n})(\sqrt{n+1} + \sqrt{n})}{\sqrt{n+1} + \sqrt{n}}\\
&= \frac{n+1 - n}{\sqrt{n+1} + \sqrt{n}}\\
&= \frac{1}{\sqrt{n+1} + \sqrt{n}}\\
&< \frac{1}{\sqrt{n}}.\\
\end{align*}
All we did here was hit our $|a_n - L|$ quantity with a ton of random algebra, and kept trying things until we got something simple.  The specifics aren't as important as the idea here: just start with the $|a_n - L|$ bit, and try everything until it's bounded by something simple and small!  

In our specific case, we've acquired the upper bound $\frac{1}{\sqrt{n}}$, which looks rather simple: so let's see if we can use it to find a value of $N$.

Take any $\epsilon < 0$.  If we want to make our simple bound $\frac{1}{\sqrt{n}} < \epsilon$, this is equivalent to making $\frac{1}{\epsilon} < \sqrt{n}$, i.e $\frac{1}{\epsilon^2} < n$.  So, if we pick $N > \frac{1}{\epsilon^2},$ we know that whenever $n > N$, we have $n > \frac{1}{\epsilon^2}$, and therefore that our simple bound is $< \epsilon$.  But this is exactly what we wanted!

In specific, for any $\epsilon > 0$, we've found a $N$ such that for any $n> N$, we have 
\begin{align*}
| \sqrt{n+1} - \sqrt{n} - 0| < \frac{1}{\sqrt{n}} < \frac{1}{\sqrt{N}} < \epsilon,
\end{align*}
which is the definition of convergence.  So we've proven that $\lim_{n \to \infty} \sqrt{n+1} - \sqrt{n} = 0.$
\end{proof}


\begin{claim}
(Arithmetic and Sequences example:)  Does the sequence 
\begin{align*}
a_1 &= 1,\\
 a_{n+1} &= \sqrt{1+a_{n}^2}
\end{align*}
converge?
\end{claim}
\begin{proof}
On the homework!
\end{proof}



\begin{claim}
(Cauchy sequence example:)  The sequence
\begin{align*}
a_n = \sum^n_{k=1} \frac{1}{k^2} 
\end{align*}
converges.
\end{claim}
\begin{proof}
To show that this sequence converges, we will use the Cauchy convergence tool, which tells us that sequences converge if and only if they are Cauchy.

How do we prove that a sequence is Cauchy?  As it turns out, we can use a similar blueprint to the methods we used to show that a sequence converges:
\begin{itemize}
\item First, examine the quantity $|a_m - a_n|$, and try to come up with a very simple upper bound that depends on $m$ and $n$ and goes to zero.  Example bounds we'd love to run into: $\frac{1}{n}, \frac{1}{mn}, \frac{1}{n}, \frac{1}{m^4\log(n)}.$  Things that won't work: $\frac{n}{m}$ (if $n$ is really big compared to $m$, we're doomed!), $\frac{m}{n^{34}}$ (same!), 4.
\item Using this upper bound, given $\epsilon > 0$, determine a value of $N$ such that whenever $m > n > N$, our simple bound is less than $\epsilon.$
\item Combine the two above results to show that for any $\epsilon$, you can find a cutoff point $N$ such that for any $m> n > N$, $|a_m - a_n| < \epsilon$.
\end{itemize}


Let's apply the above blueprint, and study $|a_m - a_n|$.  Remember that we're assuming that $m>n$ here:
\begin{align*}
| a_m - a_n| &= \left|\sum^m_{k=1} \frac{1}{k^2} - \sum^n_{k=1} \frac{1}{k^2}\right| \\
 & = \sum^m_{k=n+1} \frac{1}{k^2} \\
\end{align*}
The following step may seem quite weird: it's motivated by partial fractions (because we want a way to simplify our $\frac{1}{k^2}$'s into simpler things), but it's mostly just an algebraic trick.  The important thing is not to remember these tricks, but to just try tons of things until eventually *one* of them sticks:
\begin{align*}
 \sum^m_{k=n+1} \frac{1}{k^2} & < \sum^m_{k=n+1} \frac{1}{k(k-1)} \\
 & = \sum^m_{k=n+1} \left(\frac{1}{k-1} - \frac{1}{k}\right) \\
 & = \sum^m_{k=n+1} \frac{1}{k-1} -  \sum^m_{k=n+1} \frac{1}{k} \\
 & = \sum^{m-1}_{k=n} \frac{1}{k} -  \sum^m_{k=n+1} \frac{1}{k} \\
 & = \frac{1}{n} - \frac{1}{m} \\
 & < \frac{1}{n}.\\
\end{align*}
This looks fairly simple!

Moving onto the second step: given $\epsilon > 0$, we want to force this quantity $\frac{1}{n} < \epsilon$.  How can we do this? Well: if $m>n>N$, we have that $\frac{1}{n}  < \frac{1}{N}$; so it suffices to pick $N$ such that $\frac{1}{N} < \epsilon$.

Thus,we've shown that for any $\epsilon > 0$ we can find a $N$ such that for any $m,n > N$,
\begin{align*}
|a_m - a_n| < \frac{1}{n}  < \frac{1}{N}< \epsilon.
\end{align*}
But this just means that our sequence is Cauchy!  So, because all Cauchy sequences converge, we've proven that our sequence converges.
\end{proof}


The example above is interesting for a number of reasons: not only was it a nice way to illustrate the Cauchy condition, it was the first example of a \textbf{series}!  We define series here:

\begin{defn}
A sequence is called \textbf{summable} if the sequence $\{s_n\}^\infty_{n=1}$ of partial sums
\begin{align*}
s_n := a_1 + \ldots a_n = \sum_{k=1}^n a_k
\end{align*}converges.  

If it does, we then call the limit of this sequence the \textbf{series} associated to $\{a_n\}_{n=1}^\infty$, and denote this quantity by writing
\begin{align*}
\sum^\infty_{n=1} a_n.
\end{align*}

We say that a series$ \sum^\infty_{n=1} a_n$  \textbf{converges} or \textbf{diverges} if the sequence $\left\{  \sum_{k=1}^n a_k \right\}^\infty_{n=1}$ of partial sums converges or diverges, respectively.   
\end{defn}



\begin{claim}
(Nonconvergence example:)  The \textbf{harmonic series}
\begin{align*}
\sum_{n=1}^\infty \frac{1}{n}
\end{align*}
diverges.
\end{claim}
\begin{proof}
Notice the following inequalities:
\begin{align*}
&\left(\frac{1}{2}\right) \geq \frac{1}{2} = \frac{1}{2},\\
&\left(\frac13 + \frac 14 \right)\geq 2 \cdot \frac14 = \frac{1}{2},\\
&\left(\frac15+\frac16 + \frac17 + \frac18 \right)\geq 4 \cdot \frac18 = \frac12,\\
&\left(\frac19 + ~\ldots~ + \frac1{16}\right)  \geq 8 \cdot \frac{1}{16} = \frac12,\\
&\qquad\qquad\qquad\qquad\vdots
\end{align*}
In particular, notice that by applying these inequalities, we can show that
\begin{align*}
\sum_{n=1}^{2^n} \frac{1}{n} &= 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \ldots + \frac{1}{2^n}\\
&\geq 1 + \left(\frac{1}{2}\right) + \left(\frac13 + \frac 14 \right) + \left(\frac15+\frac16 + \frac17 + \frac18 \right) + \ldots + \left(\frac{1}{2^{n-1}}+ \ldots + \frac1{2^n} \right)\\
& \geq 1 + \frac{1}{2} + \ldots + \frac{1}{2} \\
&= 1 + \frac{n}{2},\\
\end{align*}
for \textbf{any} value of $n$.  

Therefore, for any fixed value of $L$, we have that for $n> 2L$,
\begin{align*}
\left| \sum_{n=1}^{2^n} \frac{1}{n}  - L \right| \geq \left| 1 + \frac{n}{2} - L \right| = 1 + \frac{n}{2} - L
\end{align*}

So: take any $L$, and set $\epsilon = 1$.  Then, for any $N$, if we pick $n$ such that $2^n > N$ and $n > 2L$, we have
\begin{align*}
\left| a_{2^n} - L \right| = \left| \sum_{n=1}^{2^n} \frac{1}{n}  - L \right| \geq \left| 1 + \frac{n}{2} - L \right| = 1 + \frac{n}{2} - L > 1 = \epsilon.
\end{align*}

This is the definition of nonconvergence!  So we have proven our series does not have a limit, as claimed.


\end{proof}



\end{document}