\documentclass[numbers=enddot,12pt,final,onecolumn,notitlepage]{scrartcl}%
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[all,cmtip]{xy}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{framed}
\usepackage{comment}
\usepackage{color}
\usepackage[breaklinks=True]{hyperref}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{needspace}
\usepackage{tabls}
\usepackage{tikz}
\usepackage{bbding}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Thursday, January 11, 2024 10:51:04}
%TCIDATA{SuppressPackageManagement}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Language=American English}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\usetikzlibrary{arrows.meta}
\usetikzlibrary{chains}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations.pathmorphing}
\newcounter{exer}
\newcounter{exera}
\theoremstyle{definition}
\newtheorem{theo}{Theorem}[subsection]
\newenvironment{theorem}[1][]
{\begin{theo}[#1]\begin{leftbar}}
{\end{leftbar}\end{theo}}
\newtheorem{lem}[theo]{Lemma}
\newenvironment{lemma}[1][]
{\begin{lem}[#1]\begin{leftbar}}
{\end{leftbar}\end{lem}}
\newtheorem{prop}[theo]{Proposition}
\newenvironment{proposition}[1][]
{\begin{prop}[#1]\begin{leftbar}}
{\end{leftbar}\end{prop}}
\newtheorem{defi}[theo]{Definition}
\newenvironment{definition}[1][]
{\begin{defi}[#1]\begin{leftbar}}
{\end{leftbar}\end{defi}}
\newtheorem{remk}[theo]{Remark}
\newenvironment{remark}[1][]
{\begin{remk}[#1]\begin{leftbar}}
{\end{leftbar}\end{remk}}
\newtheorem{coro}[theo]{Corollary}
\newenvironment{corollary}[1][]
{\begin{coro}[#1]\begin{leftbar}}
{\end{leftbar}\end{coro}}
\newtheorem{conv}[theo]{Convention}
\newenvironment{convention}[1][]
{\begin{conv}[#1]\begin{leftbar}}
{\end{leftbar}\end{conv}}
\newtheorem{quest}[theo]{Question}
\newenvironment{question}[1][]
{\begin{quest}[#1]\begin{leftbar}}
{\end{leftbar}\end{quest}}
\newtheorem{warn}[theo]{Warning}
\newenvironment{warning}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{convention}[1][Convention]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\newcommand\arxiv[1]{\href{http://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\setlength\textheight{22.5cm}
\setlength\textwidth{14.8cm}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\newcommand{\defn}[1]{{\color{darkred}\emph{#1}}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\are}{\ar@{-}}
\newcommand{\arebi}[1][]{\ar@{<-}@/_/[#1] \ar@/^/[#1]}
\newcommand{\of}{\text{ of }}
\newtheoremstyle{plainsl}
{8pt plus 2pt minus 4pt}
{8pt plus 2pt minus 4pt}
{\slshape}
{0pt}
{\bfseries}
{.}
{5pt plus 1pt minus 1pt}
{}
\theoremstyle{plainsl}
\ihead{Lecture 2, version \today}
\ohead{page \thepage}
\cfoot{}
\begin{document}
\section*{Math 221 Winter 2023, Lecture 2: Induction}

\textbf{website:}
\texttt{\href{https://www.cip.ifi.lmu.de/~grinberg/t/23wd}{\texttt{https://www.cip.ifi.lmu.de/\symbol{126}%
grinberg/t/23wd}}}

\section{Induction and recursion (cont'd)}

\setcounter{subsection}{1}

Last time, we defined the sequence $\left(  m_{0},m_{1},m_{2},\ldots\right)
$, whose entry $m_{n}$ is the \# of moves needed to win the Tower of Hanoi
game with $n$ disks.

We proved that $m_{0}=0$ and%
\[
m_{n}=2m_{n-1}+1\ \ \ \ \ \ \ \ \ \ \text{for each }n\geq1.
\]


I then claimed that%
\[
m_{n}=2^{n}-1\ \ \ \ \ \ \ \ \ \ \text{for each }n\geq0.
\]


I gave a rather hasty and untrustworthy proof of $m_{n}=2^{0}+2^{1}%
+\cdots+2^{n-1}$, and the right hand side here can be simplified to $2^{n}-1$
with a bit of work. Today, I will not use this approach; instead, we will
prove $m_{n}=2^{n}-1$ using a different technique.

\subsection{The Principle of Mathematical Induction}

This technique is one of the fundamental proof techniques in mathematics. It
is called \textbf{proof by induction}, and it relies on the following principle:

\begin{theorem}
[Principle of Mathematical Induction]Let $b$ be an integer.

Let $P\left(  n\right)  $ be a mathematical statement defined for each integer
$n\geq b$.

(For example, $P\left(  n\right)  $ can be \textquotedblleft$n+1>n$%
\textquotedblright\ or \textquotedblleft$n$ is even\textquotedblright\ or
\textquotedblleft$n$ is prime\textquotedblright\ or \textquotedblleft there
exists a prime number larger than $n$\textquotedblright. Note that not every
statement needs to be true (for example, \textquotedblleft$n$ is
even\textquotedblright\ is true for some $n$'s and false for others). So
$P\left(  n\right)  $ is a statement that depends on $n$; in logic, such a
statement is called a \textbf{predicate}.)

Assume the following:

\begin{enumerate}
\item The statement $P\left(  b\right)  $ holds (i.e., the statement $P\left(
n\right)  $ holds for $n=b$).

\item For each integer $n\geq b$, the implication $P\left(  n\right)
\Longrightarrow P\left(  n+1\right)  $ holds (i.e., if $P\left(  n\right)  $
holds, then $P\left(  n+1\right)  $ does as well)\footnotemark.
\end{enumerate}

Then, the statement $P\left(  n\right)  $ holds for every integer $n\geq b$.
\end{theorem}

\footnotetext{Let me recall the meaning of the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ symbol:
\par
If $A$ and $B$ are two statements, then \textquotedblleft$A\Longrightarrow
B$\textquotedblright\ means the statement \textquotedblleft if $A$, then
$B$\textquotedblright. This statement is true whenever $B$ is true, but also
true whenever $A$ is false; only in the remaining case (i.e., when $A$ is true
but $B$ is false) is it false. In other words, its truth table is as follows:%
\[%
\begin{tabular}
[c]{|c|c||c|}\hline
$A$ & $B$ & $A\Longrightarrow B$\\\hline
true & true & true\\\hline
true & false & false\\\hline
false & true & true\\\hline
false & false & true\\\hline
\end{tabular}
\ \ .
\]
You can think of it as a contract: \textquotedblleft If you make $A$ true,
then I make $B$ true\textquotedblright. If you don't make $A$ true, then this
contract places no obligation on me, since you haven't done your part! The
only way for me to violate the contract is if you make $A$ true but I don't
make $B$ true. In other words, $A\Longrightarrow B$ is a \textquotedblleft
relative\textquotedblright\ statement, which is true by default if $A$ is not.
\par
Usually, if you want to prove an implication $A\Longrightarrow B$, you start
by assuming that $A$ holds, and you need to show that $B$ holds (under this
assumption).}Before we discuss the true meaning of this principle, let me show
how to use it to prove our $m_{n}=2^{n}-1$ claim. We state this claim as a theorem:

\begin{theorem}
[explicit answer to Tower of Hanoi]\label{thm.hanoi.mn=2n-1}For each integer
$n\geq0$, we let $m_{n}$ be the \# of moves needed to win the Tower of Hanoi
game (or $\infty$ if it cannot be won).

Then,%
\[
m_{n}=2^{n}-1\ \ \ \ \ \ \ \ \ \ \text{for each integer }n\geq0.
\]

\end{theorem}

\begin{proof}
We denote the statement \textquotedblleft$m_{n}=2^{n}-1$\textquotedblright\ by
$P\left(  n\right)  $. So we must prove that $P\left(  n\right)  $ holds for
each integer $n\geq0$.

According to the Principle of Mathematical Induction (applied to $b=0$), it
suffices (for this purpose) to show that

\begin{enumerate}
\item the statement $P\left(  0\right)  $ holds;

\item for each integer $n\geq0$, the implication $P\left(  n\right)
\Longrightarrow P\left(  n+1\right)  $ holds.
\end{enumerate}

Proving these two claims will be our two goals; we call them Goal 1 and Goal
2. Let us see if we can achieve them.

Goal 1 is easy: The statement $P\left(  0\right)  $ is just saying that
$m_{0}=2^{0}-1$, which is true since both sides are $0$.

We now start working towards Goal 2. Let $n\geq0$ be an integer. We must prove
the implication $P\left(  n\right)  \Longrightarrow P\left(  n+1\right)  $. To
prove this, we assume that $P\left(  n\right)  $ holds, and we set out to
prove that $P\left(  n+1\right)  $ holds.

Our assumption says that $P\left(  n\right)  $ holds, i.e., that
\[
m_{n}=2^{n}-1.
\]
In particular, $m_{n}$ is an integer, so that the Tower of Hanoi game for $n$
disks is winnable.

We need to prove that $P\left(  n+1\right)  $ holds, i.e., that
\[
m_{n+1}\overset{?}{=}2^{n+1}-1.
\]
(The question mark above the equality sign just serves to remind us that we
have not proved this equality yet.)

Proposition 1.1.4 from Lecture 1 yields that $m_{n}=2m_{n-1}+1$ if $n\geq1$
(and if $m_{n-1}$ is not $\infty$). But this is not very helpful, since we are
looking for $m_{n+1}$, not for $m_{n}$.

However, we can also apply Proposition 1.1.4 from Lecture 1 to $n+1$ instead
of $n$ (since $n$ is just an arbitrary integer $\geq1$ in that proposition; it
is not bound to be our current $n$). This gives us%
\[
m_{n+1}=2m_{n}+1.
\]
Thus,%
\begin{align*}
m_{n+1}  &  =2\underbrace{m_{n}}_{=2^{n}-1}+\,1=2\cdot\left(  2^{n}-1\right)
+1=2\cdot2^{n}-2+1=\underbrace{2\cdot2^{n}}_{\substack{=2^{n+1}\\\text{(by one
of the laws}\\\text{of exponents)}}}-1\\
&  =2^{n+1}-1.
\end{align*}
But this is precisely the statement $P\left(  n+1\right)  $. So we have shown
that $P\left(  n+1\right)  $ holds.

More precisely, we have shown that $P\left(  n+1\right)  $ holds under the
assumption that $P\left(  n\right)  $ holds. In other words, we have proved
the implication $P\left(  n\right)  \Longrightarrow P\left(  n+1\right)  $.
This achieves Goal 2.

So we have achieved both goals, and thus the Principle of Mathematical
Induction yields that $P\left(  n\right)  $ holds for every integer $n\geq0$.
In other words, $m_{n}=2^{n}-1$ holds for every integer $n\geq0$. This proves
the theorem.
\end{proof}

\bigskip

What have we really done here? How did this proof work? What is the logic
underlying the Principle of Mathematical Induction?

Let us take a look at the structure of our above proof.

Our goal was to prove that $P\left(  n\right)  $ holds for every $n\geq0$.

In other words, our goal was to prove the statements%
\[
P\left(  0\right)  ,\ P\left(  1\right)  ,\ P\left(  2\right)  ,\ P\left(
3\right)  ,\ \ldots.
\]
This is an infinite sequence of statements.

We have proved that $P\left(  0\right)  $ holds; that was our Goal 1.

We have then proved that $P\left(  n\right)  \Longrightarrow P\left(
n+1\right)  $ for each $n$. In other words, we have proved that each statement
in our sequence implies the next. In particular, $P\left(  0\right)
\Longrightarrow P\left(  1\right)  $ and $P\left(  1\right)  \Longrightarrow
P\left(  2\right)  $ and $P\left(  2\right)  \Longrightarrow P\left(
3\right)  $ and so on.

Combining $P\left(  0\right)  $ with $P\left(  0\right)  \Longrightarrow
P\left(  1\right)  $, we obtain $P\left(  1\right)  $.

Combining $P\left(  1\right)  $ with $P\left(  1\right)  \Longrightarrow
P\left(  2\right)  $, we obtain $P\left(  2\right)  $.

Combining $P\left(  2\right)  $ with $P\left(  2\right)  \Longrightarrow
P\left(  3\right)  $, we obtain $P\left(  3\right)  $.

And so on. Continuing this logic, you obtain $P\left(  4\right)  $, then
$P\left(  5\right)  $, then $P\left(  6\right)  $, and so on. By common sense,
it is clear that if you keep going on like this, you will eventually reach
each statement in our infinite sequence; i.e., you will obtain $P\left(
n\right)  $ for any given integer $n\geq0$. Of course, this reasoning is
informal (\textquotedblleft common sense\textquotedblright\ is not a
mathematical concept, nor are the words \textquotedblleft and so
on\textquotedblright).

Thus, if we want to use this kind of reasoning in a mathematical proof, we
need to state it as a precise principle and we need this principle to be true.
The Principle of Mathematical Induction is doing precisely that.

\bigskip

(You can metaphorically think of this as an infinite daisy chain. Or, to use a
common illustration, you have an infinite sequence of dominos arranged in a
row, at sufficiently close distances so that tipping over one domino will tip
over the next. After you tip over the first domino, all the dominos will
eventually fall down.)

\bigskip

I called the Principle of Mathematical Induction a theorem, but I will not
prove it, since it is one of the fundamental axioms of mathematics. You can at
best replace it by a different axiom, but this doesn't change much; you need
some kind of axiom that allows you to \textquotedblleft chain
together\textquotedblright\ arbitrarily many little implications.

\subsection{Another proof by induction}

A proof that uses the Principle of Mathematical Induction is called a
\textbf{proof by induction}. So our above proof of Theorem
\ref{thm.hanoi.mn=2n-1} was a proof by induction.

Let us see another (simpler) example of a proof by induction. We will prove
the following result:

\begin{theorem}
[\textquotedblleft Little Gauss formula\textquotedblright]%
\label{thm.ind.1+2+...+n}For every integer $n\geq0$, we have%
\[
1+2+\cdots+n=\dfrac{n\left(  n+1\right)  }{2}.
\]

\end{theorem}

The LHS (= left hand side) here is understood to be the sum of the first $n$
positive integers. For $n=0$, this sum is an empty sum (i.e., it has no
addends at all), so its value is $0$ by definition.

\begin{proof}
[First proof of Theorem \ref{thm.ind.1+2+...+n}.]We set
\[
s_{n}:=1+2+\cdots+n
\]
for each $n\geq0$. Thus, we must prove that $s_{n}=\dfrac{n\left(  n+1\right)
}{2}$ for each $n\geq0$.

Let us denote the statement \textquotedblleft$s_{n}=\dfrac{n\left(
n+1\right)  }{2}$\textquotedblright\ by $P\left(  n\right)  $. So we need to
prove that $P\left(  n\right)  $ holds for every $n\geq0$.

According to the Principle of Mathematical Induction, it suffices to show that

\begin{enumerate}
\item the statement $P\left(  0\right)  $ holds;

\item for each $n\geq0$, the implication $P\left(  n\right)  \Longrightarrow
P\left(  n+1\right)  $ holds.
\end{enumerate}

Goal 1 is easy: To prove $P\left(  0\right)  $, we must show that
$s_{0}=\dfrac{0\left(  0+1\right)  }{2}$, but this is true because both sides
equal $0$.

Now to Goal 2. We let $n\geq0$ be an integer, and we want to prove the
implication $P\left(  n\right)  \Longrightarrow P\left(  n+1\right)  $. So we
assume that $P\left(  n\right)  $ holds, and we set out to prove $P\left(
n+1\right)  $.

By assumption, $P\left(  n\right)  $ holds, so that we have%
\[
s_{n}=\dfrac{n\left(  n+1\right)  }{2}.
\]
We must prove $P\left(  n+1\right)  $; in other words, we must prove that%
\[
s_{n+1}\overset{?}{=}\dfrac{\left(  n+1\right)  \left(  \left(  n+1\right)
+1\right)  }{2}.
\]


To do so, we observe that%
\begin{align*}
s_{n+1}  &  =1+2+\cdots+\left(  n+1\right)  =\underbrace{\left(
1+2+\cdots+n\right)  }_{=s_{n}}+\left(  n+1\right) \\
&  =s_{n}+\left(  n+1\right)  =\dfrac{n\left(  n+1\right)  }{2}+\left(
n+1\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }s_{n}=\dfrac{n\left(
n+1\right)  }{2}\right) \\
&  =\dfrac{n\left(  n+1\right)  }{2}+\dfrac{2\left(  n+1\right)  }{2}%
=\dfrac{\left(  n+2\right)  \left(  n+1\right)  }{2}=\dfrac{\left(
n+1\right)  \left(  n+2\right)  }{2}\\
&  =\dfrac{\left(  n+1\right)  \left(  \left(  n+1\right)  +1\right)  }{2}.
\end{align*}
In other words, $P\left(  n+1\right)  $ holds. Thus, we have proved the
implication $P\left(  n\right)  \Longrightarrow P\left(  n+1\right)  $.

We have now achieved both goals, so the Principle of Mathematical Induction
yields that $P\left(  n\right)  $ holds for every $n\geq0$. This proves the theorem.
\end{proof}

There is also a non-inductive proof; this is how Gauss supposedly did it:

\begin{proof}
[Second proof of Theorem \ref{thm.ind.1+2+...+n}.]We have%
\begin{align*}
&  2\cdot\left(  1+2+\cdots+n\right) \\
&  =\left(  1+2+\cdots+n\right)  +\left(  1+2+\cdots+n\right) \\
&  =\left(  1+2+\cdots+n\right)  +\left(  n+\left(  n-1\right)  +\cdots
+1\right) \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we turned the second sum upside-down, i.e.,}\\
\text{we reversed the order of its addends}%
\end{array}
\right) \\
&  =\underbrace{\left(  1+n\right)  }_{=n+1}+\underbrace{\left(  2+\left(
n-1\right)  \right)  }_{=n+1}+\cdots+\underbrace{\left(  n+1\right)  }%
_{=n+1}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we rearranged the sum by matching}\\
\text{up each addend inside the first pair of}\\
\text{parentheses with the corresponding addend}\\
\text{inside the second pair of parentheses}%
\end{array}
\right) \\
&  =\underbrace{\left(  n+1\right)  +\left(  n+1\right)  +\cdots+\left(
n+1\right)  }_{n\text{ addends}}\\
&  =n\cdot\left(  n+1\right)  .
\end{align*}
Dividing this by $2$, we find%
\[
1+2+\cdots+n=\dfrac{n\cdot\left(  n+1\right)  }{2},
\]
and thus Theorem \ref{thm.ind.1+2+...+n} is proved again.
\end{proof}

\bigskip

Here is a similar theorem:

\begin{theorem}
\label{thm.ind.12+22+...+n2}For every integer $n\geq0$, we have%
\[
1^{2}+2^{2}+\cdots+n^{2}=\dfrac{n\left(  n+1\right)  \left(  2n+1\right)  }%
{6}.
\]

\end{theorem}

\begin{proof}
The following proof is almost a word-by-word copy of the first proof of
Theorem \ref{thm.ind.1+2+...+n}. The structure is the same; only the
calculations change.

We set
\[
s_{n}:=1^{2}+2^{2}+\cdots+n^{2}.
\]
Thus, we must prove that $s_{n}=\dfrac{n\left(  n+1\right)  \left(
2n+1\right)  }{6}$ for each $n\geq0$.

Let us denote the statement \textquotedblleft$s_{n}=\dfrac{n\left(
n+1\right)  \left(  2n+1\right)  }{6}$\textquotedblright\ by $P\left(
n\right)  $. So we need to prove that $P\left(  n\right)  $ holds for every
$n\geq0$.

According to the Principle of Mathematical Induction, it suffices to show that

\begin{enumerate}
\item the statement $P\left(  0\right)  $ holds;

\item for each $n\geq0$, the implication $P\left(  n\right)  \Longrightarrow
P\left(  n+1\right)  $ holds.
\end{enumerate}

Goal 1 is easy: To prove $P\left(  0\right)  $, we must show that
$s_{0}=\dfrac{0\left(  0+1\right)  \left(  2\cdot0+1\right)  }{6}$, but this
is true because both sides equal $0$.

Now to Goal 2. We let $n\geq0$ be an integer, and we want to prove the
implication $P\left(  n\right)  \Longrightarrow P\left(  n+1\right)  $. So we
assume that $P\left(  n\right)  $ holds, and we set out to prove $P\left(
n+1\right)  $.

By assumption, $P\left(  n\right)  $ holds, so that we have%
\[
s_{n}=\dfrac{n\left(  n+1\right)  \left(  2n+1\right)  }{6}.
\]
We must prove $P\left(  n+1\right)  $; in other words, we must prove that
\[
s_{n+1}\overset{?}{=}\dfrac{\left(  n+1\right)  \left(  \left(  n+1\right)
+1\right)  \left(  2\left(  n+1\right)  +1\right)  }{6}.
\]


To do so, we observe that%
\begin{align*}
s_{n+1}  &  =1^{2}+2^{2}+\cdots+\left(  n+1\right)  ^{2}\\
&  =\underbrace{\left(  1^{2}+2^{2}+\cdots+n^{2}\right)  }_{=s_{n}}+\left(
n+1\right)  ^{2}\\
&  =s_{n}+\left(  n+1\right)  ^{2}\\
&  =\dfrac{n\left(  n+1\right)  \left(  2n+1\right)  }{6}+\left(  n+1\right)
^{2}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }s_{n}=\dfrac{n\left(  n+1\right)
\left(  2n+1\right)  }{6}\right) \\
&  =\left(  n+1\right)  \cdot\left(  \dfrac{n\left(  2n+1\right)  }{6}+\left(
n+1\right)  \right) \\
&  =\left(  n+1\right)  \cdot\dfrac{2n^{2}+7n+6}{6}\\
&  =\dfrac{\left(  n+1\right)  \left(  2n^{2}+7n+6\right)  }{6}\\
&  =\dfrac{\left(  n+1\right)  \left(  n+2\right)  \left(  2n+3\right)  }%
{6}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }2n^{2}+7n+6\text{ can be}\\
\text{factored as }\left(  n+2\right)  \left(  2n+3\right)
\end{array}
\right) \\
&  =\dfrac{\left(  n+1\right)  \left(  \left(  n+1\right)  +1\right)  \left(
2\left(  n+1\right)  +1\right)  }{6}.
\end{align*}
In other words, $P\left(  n+1\right)  $ holds. Thus, we have proved the
implication $P\left(  n\right)  \Longrightarrow P\left(  n+1\right)  $.

We have now achieved both goals, so the Principle of Mathematical Induction
yields that $P\left(  n\right)  $ holds for every $n\geq0$. This proves the theorem.
\end{proof}

\bigskip

As we said, our above proof of Theorem \ref{thm.ind.12+22+...+n2} was an
almost verbatim copy of our first proof of Theorem \ref{thm.ind.1+2+...+n}; we
only needed to make the obvious changes and calculate a little bit harder.
Both proofs were more or less determined by the idea to use induction. In
contrast, the slick second proof of Theorem \ref{thm.ind.1+2+...+n} cannot be
adapted to Theorem \ref{thm.ind.12+22+...+n2}. So the induction proof has the
advantage of better generalizability.

However, it has the disadvantage that it can only be used to \textbf{prove} a
formula (in our case, $1+2+\cdots+n=\dfrac{n\left(  n+1\right)  }{2}$ or
$1^{2}+2^{2}+\cdots+n^{2}=\dfrac{n\left(  n+1\right)  \left(  2n+1\right)
}{6}$), not to \textbf{find} this formula in the first place. We could not
have used induction to answer the question \textquotedblleft what is
$1+2+\cdots+n$?\textquotedblright; we could only use it to prove the answer
after guessing it in some way.

\subsection{Notations for an induction proof}

Here is some standard terminology that is commonly used in proofs by
induction. Let's say that you are proving a statement of the form $P\left(
n\right)  $ for every integer $n\geq b$ (where $b$ is some fixed integer).

\begin{itemize}
\item The $n$ is called the \textbf{induction variable}; you say that you
\textbf{induct on }$n$. It does not have to be called $n$. Your statement
might just as well be \textquotedblleft for every integer $a\geq0$, we have
$1+2+\cdots+a=\dfrac{a\left(  a+1\right)  }{2}$\textquotedblright, and then
you can prove it by inducting on $a$.

\item The proof of $P\left(  b\right)  $ (that is, Goal 1 in our above proofs)
is called the \textbf{induction base} or the \textbf{base case}. In our above
examples, this was always the proof of $P\left(  0\right)  $, but in general
$b$ can be another integer. (For example, if you are proving the statement
\textquotedblleft every integer $n\geq4$ satisfies $2^{n}\geq n^{2}%
$\textquotedblright, then $b$ will have to be $4$, so your induction base
consists in proving that $2^{4}\geq4^{2}$.)

\item The proof of \textquotedblleft$P\left(  n\right)  \Longrightarrow
P\left(  n+1\right)  $ for every $n\geq b$\textquotedblright\ (that is, Goal 2
in our above proofs) is called the \textbf{induction step}. For example, in
the proof of Theorem \ref{thm.ind.12+22+...+n2}, this was the part where we
assumed that $s_{n}=\dfrac{n\left(  n+1\right)  \left(  2n+1\right)  }{6}$ and
proved that $s_{n+1}=\dfrac{\left(  n+1\right)  \left(  \left(  n+1\right)
+1\right)  \left(  2\left(  n+1\right)  +1\right)  }{6}$.

In the induction step, the assumption that $P\left(  n\right)  $ holds is
called the \textbf{induction hypothesis} or the \textbf{induction assumption},
and the claim that $P\left(  n+1\right)  $ holds (this is the claim that you
are trying to prove) is called the \textbf{induction goal}. The induction step
is complete when the induction goal is reached.
\end{itemize}

As an example, let us rewrite our above proof of Theorem
\ref{thm.hanoi.mn=2n-1} using this language:

\begin{proof}
[Proof of Theorem \ref{thm.hanoi.mn=2n-1}, rewritten.]We induct on $n$.

\textit{Base case:} The theorem\footnote{i.e., Theorem \ref{thm.hanoi.mn=2n-1}%
} holds for $n=0$, since both $m_{0}$ and $2^{0}-1$ equal $0$.

\textit{Induction step:} Let $n\geq0$ be an integer. We assume that the
theorem holds for $n$ (this is what we previously called $P\left(  n\right)
$). We will now show that the theorem holds for $n+1$ as well (this is what we
previously called $P\left(  n+1\right)  $).

We have assumed that the theorem holds for $n$. In other words, $m_{n}%
=2^{n}-1$. This is our induction hypothesis.

We must prove that the theorem holds for $n+1$. In other words, we must prove
that $m_{n+1}\overset{?}{=}2^{n+1}-1$.

To prove this, we apply Proposition 1.1.4 from Lecture 1 to $n+1$ instead of
$n$ (we can do this, since $m_{n}=2^{n}-1$ is not $\infty$). This gives us%
\begin{align*}
m_{n+1}  &  =2\underbrace{m_{n}}_{\substack{=2^{n}-1\\\text{(by the induction
hypothesis)}}}+1=2\cdot\left(  2^{n}-1\right)  +1\\
&  =2\cdot2^{n}-2+1=\underbrace{2\cdot2^{n}}_{=2^{n+1}}-1=2^{n+1}-1.
\end{align*}
Thus, the induction goal is reached, and the induction is complete. Hence, the
theorem is proved.
\end{proof}

\subsection{The Fibonacci numbers}

Our next applications of induction will be some properties of the
\textbf{Fibonacci sequence}. The Fibonacci sequence is defined
\textbf{recursively} -- i.e., a given entry is not defined directly, but
rather defined in terms of the previous entries. Specifically, it is defined
as follows:

\begin{definition}
The \textbf{Fibonacci sequence} is the sequence $\left(  f_{0},f_{1}%
,f_{2},\ldots\right)  $ of nonnegative integers defined recursively by setting%
\begin{align*}
f_{0}  &  =0,\ \ \ \ \ \ \ \ \ \ f_{1}=1,\ \ \ \ \ \ \ \ \ \ \text{and}\\
f_{n}  &  =f_{n-1}+f_{n-2}\ \ \ \ \ \ \ \ \ \ \text{for each }n\geq2.
\end{align*}

\end{definition}

In other words, the Fibonacci sequence starts with the two entries $0$ and
$1$, and then every next entry is the sum of the two previous entries.

The entries of the Fibonacci sequence are called the \textbf{Fibonacci
numbers}. Let us compute the first fourteen of them:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|c|}\hline
$n$ & $0$ & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ & $10$ & $11$
& $12$ & $13$\\\hline
$f_{n}$ & $0$ & $1$ & $1$ & $2$ & $3$ & $5$ & $8$ & $13$ & $21$ & $34$ & $55$
& $89$ & $144$ & $233$\\\hline
\end{tabular}
\ \ \ .
\]


As we see, a recursive definition is a perfectly valid way to define (e.g.) a
sequence of numbers. It allows you to compute each entry of the sequence
eventually, as long as you compute the entries in order (i.e., first $f_{0}$,
then $f_{1}$, then $f_{2}$, and so on). In a sense, the reason why this works
is the same as the reason why induction works: You can get to any integer
$n\geq0$ if you start at $0$ and keep adding $1$.

Note that it is important that our recursive definition of $f_{n}$ uses only
previous entries of the sequence (in our case, $f_{n-1}$ and $f_{n-2}$). If we
had instead defined the Fibonacci sequence by%
\[
f_{n}=f_{n+1}-f_{n-2},
\]
then we could not even compute $f_{2}$, since this would require knowing
$f_{3}$, which would in turn require knowing $f_{4}$, and so on.

\bigskip

Let us now see some properties of the Fibonacci sequence:

\begin{theorem}
\label{thm.fib.sum-first-n}For any integer $n\geq0$, we have%
\[
f_{1}+f_{2}+\cdots+f_{n}=f_{n+2}-1.
\]

\end{theorem}

For example, for $n=8$, this is saying that%
\[
1+1+2+3+5+8+13+21=55-1.
\]


\begin{proof}
[Proof of Theorem \ref{thm.fib.sum-first-n}.]We induct on $n$.

\textit{Base case:} For $n=0$, the theorem claims that $f_{1}+f_{2}%
+\cdots+f_{0}=f_{0+2}-1$. This is true, since the LHS is an empty sum (thus
$=0$) whereas the RHS is $f_{2}-1=1-1=0$.

\textit{Induction step:} Let $n\geq0$ be an integer. Assume that the theorem
holds for $n$.

We must prove that the theorem holds for $n+1$.

So we assumed that
\[
f_{1}+f_{2}+\cdots+f_{n}=f_{n+2}-1.
\]
We must prove that%
\[
f_{1}+f_{2}+\cdots+f_{n+1}\overset{?}{=}f_{\left(  n+1\right)  +2}-1.
\]


We have%
\begin{align*}
f_{1}+f_{2}+\cdots+f_{n+1}  &  =\underbrace{\left(  f_{1}+f_{2}+\cdots
+f_{n}\right)  }_{\substack{=f_{n+2}-1\\\text{(by our induction hypothesis)}%
}}+f_{n+1}=f_{n+2}-1+f_{n+1}\\
&  =\underbrace{f_{n+2}+f_{n+1}}_{\substack{=f_{n+3}\\\text{(since the
recursive definition}\\\text{of the Fibonacci sequence}\\\text{yields }%
f_{n+3}=f_{n+2}+f_{n+1}\text{)}}}-1=f_{n+3}-1\\
&  =f_{\left(  n+1\right)  +2}-1\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n+3=\left(  n+1\right)  +2\right)  .
\end{align*}
This is precisely what we wanted to prove -- i.e., it says that the theorem
holds for $n+1$. This completes the induction step. Thus, the theorem is proved.
\end{proof}


\end{document}