\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:20}
%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 3, version \today}
\ohead{page \thepage}
\cfoot{}
\begin{document}
\section*{Math 221 Winter 2023, Lecture 3: 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}{5}

\subsection{Some more examples of induction}

Let us see some more examples of proofs by induction.

\begin{theorem}
\label{thm.geo-sum.2}For any integer $n\geq0$, we have
\[
2^{0}+2^{1}+2^{2}+\cdots+2^{n-1}=2^{n}-1.
\]

\end{theorem}

\begin{proof}
We induct on $n$.

\textit{Base case:} For $n=0$, the equality $2^{0}+2^{1}+2^{2}+\cdots
+2^{n-1}=2^{n}-1$ is true, because the LHS\footnote{\textquotedblleft
LHS\textquotedblright\ means \textquotedblleft left-hand
side\textquotedblright. Likewise, \textquotedblleft RHS\textquotedblright%
\ means \textquotedblleft right-hand side\textquotedblright.} is an empty sum
and thus equals $0$, whereas the RHS is $2^{0}-1=1-1=0$.

\textit{Induction step:} Let $n$ be an integer $\geq0$. Assume that Theorem
\ref{thm.geo-sum.2} holds for $n$, i.e., that we have%
\[
2^{0}+2^{1}+2^{2}+\cdots+2^{n-1}=2^{n}-1.
\]
We must prove that Theorem \ref{thm.geo-sum.2} holds for $n+1$ as well, i.e.,
that we have%
\[
2^{0}+2^{1}+2^{2}+\cdots+2^{\left(  n+1\right)  -1}=2^{n+1}-1.
\]


However,%
\begin{align*}
&  2^{0}+2^{1}+2^{2}+\cdots+2^{\left(  n+1\right)  -1}\\
&  =2^{0}+2^{1}+2^{2}+\cdots+2^{n}\\
&  =\underbrace{\left(  2^{0}+2^{1}+2^{2}+\cdots+2^{n-1}\right)
}_{\substack{=2^{n}-1\\\text{(by the induction hypothesis)}}}+2^{n}\\
&  =2^{n}-1+2^{n}=\underbrace{2\cdot2^{n}}_{=2^{n+1}}-1=2^{n+1}-1,
\end{align*}
which is precisely what we want: This shows that Theorem \ref{thm.geo-sum.2}
holds for $n+1$. Thus, our induction step is complete, and Theorem
\ref{thm.geo-sum.2} is proved.
\end{proof}

Theorem \ref{thm.geo-sum.2} can be generalized:

\begin{theorem}
\label{thm.geo-sum.xy}Let $x$ and $y$ be any two numbers. Then, for any
integer $n\geq0$, we have%
\[
\left(  x-y\right)  \left(  x^{n-1}+x^{n-2}y+x^{n-3}y^{2}+\cdots+x^{2}%
y^{n-3}+xy^{n-2}+y^{n-1}\right)  =x^{n}-y^{n}.
\]
Here, the big sum in the parentheses is the sum of all products $x^{i}y^{j}$
where $i$ and $j$ are nonnegative integers with $i+j=n-1$.
\end{theorem}

Before we prove this, let us give some examples for what this theorem actually says:

\begin{itemize}
\item For $n=2$, Theorem \ref{thm.geo-sum.xy} says that%
\[
\left(  x-y\right)  \left(  x+y\right)  =x^{2}-y^{2}.
\]


\item For $n=3$, Theorem \ref{thm.geo-sum.xy} says that%
\[
\left(  x-y\right)  \left(  x^{2}+xy+y^{2}\right)  =x^{3}-y^{3}.
\]


\item For $n=4$, Theorem \ref{thm.geo-sum.xy} says that%
\[
\left(  x-y\right)  \left(  x^{3}+x^{2}y+xy^{2}+y^{3}\right)  =x^{4}-y^{4}.
\]


\item For $x=2$ and $y=1$, Theorem \ref{thm.geo-sum.xy} says that%
\[
\left(  2-1\right)  \left(  2^{n-1}+2^{n-2}1+2^{n-3}1^{2}+\cdots+2^{2}%
1^{n-3}+2\cdot1^{n-2}+1^{n-1}\right)  =2^{n}-1^{n}.
\]
Since any power of $1$ is $1$ (and since the $2-1$ factor also equals $1$),
this simplifies to%
\[
2^{n-1}+2^{n-2}+2^{n-3}+\cdots+2^{2}+2+1=2^{n}-1,
\]
which is precisely Theorem \ref{thm.geo-sum.2}. Thus, Theorem
\ref{thm.geo-sum.xy} generalizes Theorem \ref{thm.geo-sum.2}.
\end{itemize}

Let us now prove Theorem \ref{thm.geo-sum.xy}:

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

\textit{Base case:} For $n=0$, the claim%
\[
\left(  x-y\right)  \left(  x^{n-1}+x^{n-2}y+x^{n-3}y^{2}+\cdots+x^{2}%
y^{n-3}+xy^{n-2}+y^{n-1}\right)  =x^{n}-y^{n}%
\]
is true, since the LHS is $0$ (because the second factor is an empty sum),
while the RHS is $x^{0}-y^{0}=1-1=0$ as well.

\textit{Induction step:} Let $n\geq0$ be an integer. Assume that Theorem
\ref{thm.geo-sum.xy} is true for $n$. That is, assume that%
\[
\left(  x-y\right)  \left(  x^{n-1}+x^{n-2}y+x^{n-3}y^{2}+\cdots+x^{2}%
y^{n-3}+xy^{n-2}+y^{n-1}\right)  =x^{n}-y^{n}.
\]
We must prove that Theorem \ref{thm.geo-sum.xy} is also true for $n+1$. That
is, we must prove that%
\[
\left(  x-y\right)  \left(  x^{n}+x^{n-1}y+x^{n-2}y^{2}+\cdots+x^{3}%
y^{n-3}+x^{2}y^{n-2}+xy^{n-1}+y^{n}\right)  =x^{n+1}-y^{n+1}.
\]


We begin by extracting the $y^{n}$ addend from the long sum in the second pair
of parentheses in this equation. We thus obtain
\begin{align*}
&  \left(  x-y\right)  \left(  x^{n}+x^{n-1}y+x^{n-2}y^{2}+\cdots+x^{3}%
y^{n-3}+x^{2}y^{n-2}+xy^{n-1}+y^{n}\right)  \\
&  =\left(  x-y\right)  \underbrace{\left(  x^{n}+x^{n-1}y+x^{n-2}y^{2}%
+\cdots+x^{3}y^{n-3}+x^{2}y^{n-2}+xy^{n-1}\right)  }_{\substack{=\left(
x^{n-1}+x^{n-2}y+x^{n-3}y^{2}+\cdots+x^{2}y^{n-3}+xy^{n-2}+y^{n-1}\right)
x\\\text{(here, we have factored out an }x\text{ from the sum)}}}+\left(
x-y\right)  y^{n}\\
&  =\underbrace{\left(  x-y\right)  \left(  x^{n-1}+x^{n-2}y+x^{n-3}%
y^{2}+\cdots+x^{2}y^{n-3}+xy^{n-2}+y^{n-1}\right)  }_{\substack{=x^{n}%
-y^{n}\\\text{(by the induction hypothesis)}}}x+\left(  x-y\right)  y^{n}\\
&  =\left(  x^{n}-y^{n}\right)  x+\left(  x-y\right)  y^{n}=x^{n+1}%
-xy^{n}+xy^{n}-y^{n+1}=x^{n+1}-y^{n+1}.
\end{align*}
This means precisely that Theorem \ref{thm.geo-sum.xy} is also true for $n+1$.
Thus, the induction step is complete, and the theorem is proved.
\end{proof}

Another useful particular case of Theorem \ref{thm.geo-sum.xy} is the
following equality:\footnote{A \textquotedblleft corollary\textquotedblright%
\ means a theorem that follows easily from another theorem.}

\begin{corollary}
\label{cor.geo-sum.q}Let $q$ be a number distinct from $1$. Let $n\geq0$ be an
integer. Then,%
\[
q^{0}+q^{1}+q^{2}+\cdots+q^{n-1}=\dfrac{q^{n}-1}{q-1}.
\]

\end{corollary}

\begin{proof}
Apply Theorem \ref{thm.geo-sum.xy} to $x=q$ and $y=1$. We obtain%
\[
\left(  q-1\right)  \left(  q^{n-1}+q^{n-2}1+q^{n-3}1^{2}+\cdots+q^{2}%
1^{n-3}+q\cdot1^{n-2}+1^{n-1}\right)  =q^{n}-1^{n}.
\]
Simplifying this, we obtain%
\[
\left(  q-1\right)  \left(  q^{n-1}+q^{n-2}+q^{n-3}+\cdots+q^{2}+q+1\right)
=q^{n}-1.
\]
Thus,%
\[
q^{n-1}+q^{n-2}+q^{n-3}+\cdots+q^{2}+q+1=\dfrac{q^{n}-1}{q-1}.
\]
In other words,%
\[
q^{0}+q^{1}+q^{2}+\cdots+q^{n-1}=\dfrac{q^{n}-1}{q-1}%
\]
(since the sum on the left hand side can be rearranged in any order). This
proves Corollary \ref{cor.geo-sum.q}.
\end{proof}

\subsection{How not to use induction}

Induction proofs can be slippery:

\begin{theorem}
[Fake theorem]\label{thm.ind.horses}In any set of $n\geq1$ horses, all the
horses are the same color.
\end{theorem}

\begin{proof}
We induct on $n$.

\textit{Base case:} This is clearly true for $n=1$, since a single horse
always has the same color as itself.

\textit{Induction step:} Let $n\geq1$ be an integer. We assume that the
theorem holds for $n$, i.e., that any $n$ horses are the same color.

We must prove that it also holds for $n+1$, i.e., that any $n+1$ horses are
the same color.

So let $H_{1},H_{2},\ldots,H_{n+1}$ be $n+1$ horses.

By our induction hypothesis, the first $n$ horses $H_{1},H_{2},\ldots,H_{n}$
are the same color.

Again by our induction hypothesis, the last $n$ horses $H_{2},H_{3}%
,\ldots,H_{n+1}$ are the same color.

Now, consider the first horse $H_{1}$ and the last horse $H_{n+1}$. They both
have the same color as the \textquotedblleft middle horses\textquotedblright%
\ $H_{2},H_{3},\ldots,H_{n}$ (according to the preceding two paragraphs).
Thus, all the $n+1$ horses have the same color, right? \medskip

When a claim is as obviously wrong as this one, there is an easy way to find
the mistake in the proof: You just look at some example in which the claim is
wrong, and you trace the proof on this example. The first time you see a wrong
conclusion, that's where the error probably is.

Theorem \ref{thm.ind.horses} is wrong for $n=2$ already, i.e., for two horses.
So let us see where the induction step goes wrong when $n=1$ (that is, going
from $1$ horse to $2$ horses). In this induction step, we claim that $H_{1}$
and $H_{n+1}=H_{2}$ both have the same color as the \textquotedblleft middle
horses\textquotedblright\ $H_{2},H_{3},\ldots,H_{1}$. But there are no
\textquotedblleft middle horses\textquotedblright, so it makes no sense to
have the same color as these \textquotedblleft middle horses\textquotedblright%
. So the argument doesn't work.

Thus, our mistake was to implicitly treat the \textquotedblleft middle
horses\textquotedblright\ as if they existed. They do exist for any $n>1$, but
not for $n=1$, and thus our induction step breaks down for $n=1$.
\end{proof}

Note how one little mistake has brought down the entire proof! For an
induction proof to work, the induction step needs to work for all $n$; that
is, we need the implication $P\left(  n\right)  \Longrightarrow P\left(
n+1\right)  $ to hold for every $n$. If even one of these implications breaks
down, the whole chain is disconnected, and all the statements $P\left(
n\right)  $ \textquotedblleft to the right of\textquotedblright\ this breaking
point are no longer guaranteed to hold. For example, if we have a statement
$P\left(  n\right)  $ for each $n\geq0$, and we have proved the base case
$P\left(  0\right)  $ and the implication $P\left(  n\right)  \Longrightarrow
P\left(  n+1\right)  $ for all $n\neq4$, then we can conclude that $P\left(
0\right)  ,\ P\left(  1\right)  ,\ P\left(  2\right)  ,\ P\left(  3\right)  $
and $P\left(  4\right)  $ hold, but we cannot guarantee that any of $P\left(
5\right)  ,\ P\left(  6\right)  ,\ P\left(  7\right)  ,\ \ldots$ hold. As so
often, a chain is only as strong as its weakest link.

\subsection{More on the Fibonacci numbers}

Recall the Fibonacci sequence, which we defined in Lecture 2:

\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}

The entries of the Fibonacci sequence are called the \textbf{Fibonacci
numbers}. Here are the first few:%
\[%
\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}
\ \ \ .
\]


Back in Lecture 2, we proved:

\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}

\bigskip

Let us now prove two deeper properties of the Fibonacci sequence.

\begin{theorem}
[addition theorem for Fibonacci numbers]\label{thm.fib.add}We have%
\[
f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}\ \ \ \ \ \ \ \ \ \ \text{for all integers
}n,m\geq0.
\]

\end{theorem}

\begin{proof}
Can you induct on two variables at the same time? Not directly (although you
can induct on $n$ and then induct on $m$ in the induction step, so that you
have one induction proof inside another). Fortunately, we don't need to do
this here. It suffices to induct on one of the variables.

To be specific, let us induct on $n$. To that purpose, for every integer
$n\geq0$, we define the statement $P\left(  n\right)  $ to say%
\[
\text{\textquotedblleft for all integers }m\geq0\text{, we have }%
f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}\text{\textquotedblright.}%
\]
(Don't forget the \textquotedblleft for all integers $m\geq0$%
\textquotedblright\ part! The statement $P\left(  n\right)  $ is not just a
single equality $f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}$ for some specific value
of $m$, but rather combines infinitely many such equalities, one for each
integer $m\geq0$. If we fixed a value of $m$ and defined $P\left(  n\right)  $
to be just the single equality $f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}$, then the
induction proof below would not work, because we are going to apply the
induction hypothesis to a different $m$ than we start with.)

We shall now prove this statement $P\left(  n\right)  $ for all $n\geq0$ by
induction on $n$.

\textit{Base case:} We must prove $P\left(  0\right)  $. In other words, we
must prove that%
\[
\text{\textquotedblleft for all integers }m\geq0\text{, we have }%
f_{0+m+1}=f_{0}f_{m}+f_{0+1}f_{m+1}\text{\textquotedblright.}%
\]
This is easy to show: For all integers $m\geq0$, we have $f_{0+m+1}=f_{m+1}$
and $\underbrace{f_{0}}_{=0}f_{m}+\underbrace{f_{0+1}}_{=f_{1}=1}%
f_{m+1}=0f_{m}+1f_{m+1}=f_{m+1}$, so the two sides are equal.

\textit{Induction step:} Let $n\geq0$ be an integer. We assume that $P\left(
n\right)  $ holds. We must show that $P\left(  n+1\right)  $ holds.

Our induction hypothesis says that $P\left(  n\right)  $ holds, i.e., that%
\[
\text{\textquotedblleft for all integers }m\geq0\text{, we have }%
f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}\text{\textquotedblright\ holds.}%
\]


We must prove that $P\left(  n+1\right)  $ holds, i.e., that%
\[
\text{\textquotedblleft for all integers }m\geq0\text{, we have }%
f_{n+1+m+1}=f_{n+1}f_{m}+f_{n+1+1}f_{m+1}\text{\textquotedblright\ holds.}%
\]


To prove this, we let $m\geq0$ be an integer. Then,%
\begin{align}
&  f_{n+1}f_{m}+\underbrace{f_{n+1+1}}_{\substack{=f_{n+2}\\=f_{n+1}%
+f_{n}\\\text{(by the recursive}\\\text{definition of the}\\\text{Fibonacci
numbers)}}}f_{m+1}\nonumber\\
&  =f_{n+1}f_{m}+\left(  f_{n+1}+f_{n}\right)  f_{m+1}\nonumber\\
&  =f_{n+1}f_{m}+f_{n+1}f_{m+1}+f_{n}f_{m+1}\nonumber\\
&  =f_{n+1}\underbrace{\left(  f_{m}+f_{m+1}\right)  }_{\substack{=f_{m+1}%
+f_{m}\\=f_{m+2}\\\text{(by the recursive}\\\text{definition of the}%
\\\text{Fibonacci numbers)}}}+f_{n}f_{m+1}\nonumber\\
&  =f_{n+1}f_{m+2}+f_{n}f_{m+1}=f_{n}f_{m+1}+f_{n+1}f_{m+2}.
\label{pf.thm.fib.add.maincalc}%
\end{align}


Now, recall that the induction hypothesis says that $P\left(  n\right)  $
holds, i.e., that%
\[
\text{\textquotedblleft for all integers }m\geq0\text{, we have }%
f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}\text{\textquotedblright\ holds.}%
\]
Note that the $m$ in this statement is a bound variable, i.e., it has nothing
to do with the $m$ that we have fixed; it just happens to have the same name.
Thus, we are free to apply our induction hypothesis $P\left(  n\right)  $ not
to the current $m$, but to any other $m$ as well. In particular, we can apply
it to $m+1$ instead of $m$. Thus, we obtain%
\[
f_{n+m+1+1}=f_{n}f_{m+1}+f_{n+1}f_{m+1+1}.
\]
\footnote{Let me explain this again in a slightly clearer (if longer) way.
\par
Our induction hypothesis tells us that
\[
\text{\textquotedblleft for all integers }m\geq0\text{, we have }%
f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}\text{\textquotedblright\ holds.}%
\]
We can rename the variable $m$ as $p$ in this statement (since it is just a
bound variable). Thus, we obtain that%
\[
\text{\textquotedblleft for all integers }p\geq0\text{, we have }%
f_{n+p+1}=f_{n}f_{p}+f_{n+1}f_{p+1}\text{\textquotedblright\ holds.}%
\]
Now, applying this latter statement to $p=m+1$ (where $m$ is the $m$ that we
fixed), we obtain%
\[
f_{n+m+1+1}=f_{n}f_{m+1}+f_{n+1}f_{m+1+1}.
\]
} This can be trivially simplified to%
\[
f_{n+m+2}=f_{n}f_{m+1}+f_{n+1}f_{m+2}.
\]


This equality has the same right hand side as (\ref{pf.thm.fib.add.maincalc}).
Thus, the left hand sides of the two equalities must be equal as well. In
other words, we must have%
\[
f_{n+m+2}=f_{n+1}f_{m}+f_{n+1+1}f_{m+1}.
\]
Since $n+m+2=n+1+m+1$, we can rewrite this as%
\[
f_{n+1+m+1}=f_{n+1}f_{m}+f_{n+1+1}f_{m+1}.
\]


Thus, we have proved that for all integers $m\geq0$, we have $f_{n+1+m+1}%
=f_{n+1}f_{m}+f_{n+1+1}f_{m+1}$. In other words, we have proved that $P\left(
n+1\right)  $ holds.

So the induction step is complete, and Theorem \ref{thm.fib.add} is proved.
\end{proof}

\bigskip

Our next theorem involves divisibility of integers. We will study this in more
detail in future lectures (it is the fundamental concept of number theory),
but for now let me give its definition:

\begin{definition}
\label{def.divides}Let $a$ and $b$ be two integers. We say that $a$
\textbf{divides }$b$ (and we write $a\mid b$) if there exists an integer $c$
such that $b=ac$. Equivalently, we say that $b$ is \textbf{divisible by }$a$
in this case.
\end{definition}

For example, we have $2\mid4$ and $3\mid12$ and $10\mid30$ and $0\mid0$ and
$5\mid0$. But we don't have $2\mid3$ or $0\mid1$. The integer $0$ is divisible
by every integer, but only divides itself.

Now we can state a divisibility property of Fibonacci numbers:

\begin{theorem}
\label{thm.fib.div}If $a,b\geq0$ are two integers that satisfy $a\mid b$, then
$f_{a}\mid f_{b}$.
\end{theorem}

In other words, in our above table of Fibonacci numbers, if some entry of the
first row divides some other entry of the first row, then the same holds for
the corresponding entries of the second row. For example, $6\mid12$ implies
$f_{6}\mid f_{12}$ (which is saying that $8\mid144$).

\begin{proof}
[Proof of Theorem \ref{thm.fib.div}.]It is reasonable to try induction.
However, inducting on $a$ does not lead anywhere: The base case is easy, but
in the induction step it is completely unclear how to reach the goal, since
the condition $a\mid b$ in the induction hypothesis usually has nothing to do
with the condition $a+1\mid b$ in the induction goal.

Similar problems appear if you try to induct on $b$. So neither of the two
variables in the theorem is suitable for being inducted on.

What can we do? Give up on induction?

Not so fast. One thing we haven't tried is to introduce a new variable and
then induct on that new variable.

To do so, we observe that two integers $a,b\geq0$ satisfy $a\mid b$ if and
only if there exists an integer $c$ such that $b=ac$ (by the definition of
\textquotedblleft divides\textquotedblright). Moreover, if this integer $c$
exists, then it can be chosen to be $\geq0$ (this is automatic when $b\neq0$,
because $c=\dfrac{b}{a}>0$ in this case; but otherwise we can achieve this by
simply choosing $c=0$). Thus, two integers $a,b\geq0$ satisfy $a\mid b$ if and
only if there exists an integer $c\geq0$ such that $b=ac$.

Hence, a pair of integers $a,b\geq0$ satisfying $a\mid b$ is nothing but a
pair of the form $a,ac$ where $a,c\geq0$ are integers. This allows us to
restate Theorem \ref{thm.fib.div} as follows:

\begin{statement}
\textit{Restated theorem:} \textquotedblleft For any integers $a,c\geq0$, we
have $f_{a}\mid f_{ac}$.\textquotedblright
\end{statement}

Now, we shall prove this restated theorem by induction on $c$. In other words,
for each $c\geq0$, we shall prove the statement%
\[
P\left(  c\right)  :=\left(  \text{\textquotedblleft for any integer }%
a\geq0\text{, we have }f_{a}\mid f_{ac}\text{\textquotedblright}\right)  .
\]


\textit{Base case:} We must prove $P\left(  0\right)  $. In other words, we
must prove that
\[
\text{\textquotedblleft for any integer }a\geq0\text{, we have }f_{a}\mid
f_{a\cdot0}\text{\textquotedblright.}%
\]
But this is easy, because for any integer $a\geq0$, we have $f_{a\cdot0}%
=f_{0}=0$, which is divisible by any integer (thus in particular by $f_{a}$).

\textit{Induction step:} Let $c\geq0$ be an integer. We assume that $P\left(
c\right)  $ holds, i.e., that
\[
\text{\textquotedblleft for any integer }a\geq0\text{, we have }f_{a}\mid
f_{ac}\text{\textquotedblright\ holds.}%
\]
We must prove that $P\left(  c+1\right)  $ holds, i.e., that%
\[
\text{\textquotedblleft for any integer }a\geq0\text{, we have }f_{a}\mid
f_{a\left(  c+1\right)  }\text{\textquotedblright\ holds.}%
\]


Let $a\geq0$ be any integer. Then, the induction hypothesis (i.e., our
assumption that $P\left(  c\right)  $ holds) yields that $f_{a}\mid f_{ac}$.
In other words, $f_{ac}=f_{a}p$ for some integer $p$. Now,%
\begin{align*}
f_{a\left(  c+1\right)  }  &  =f_{ac+a}=f_{ac+\left(  a-1\right)  +1}\\
&  =\underbrace{f_{ac}}_{=f_{a}p}f_{a-1}+f_{ac+1}f_{a}%
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.fib.add},}\\
\text{applied to }n=ac\text{ and }m=a-1
\end{array}
\right) \\
&  =f_{a}pf_{a-1}+f_{ac+1}f_{a}=f_{a}\cdot\underbrace{\left(  pf_{a-1}%
+f_{ac+1}\right)  }_{\text{an integer}}.
\end{align*}
This immediately yields that $f_{a}\mid f_{a\left(  c+1\right)  }$. Thus, we
have shown that for any integer $a\geq0$, we have $f_{a}\mid f_{a\left(
c+1\right)  }$. In other words, we have proved that $P\left(  c+1\right)  $
holds. This completes the induction step, and thus the restated theorem is
proved. Therefore, the original Theorem \ref{thm.fib.div} is also proved.
\medskip

$\ldots\ldots\ldots\ldots\ldots$

Is it? There is a subtle gap in our above argument. Can you find it? \medskip

$\ldots\ldots\ldots\ldots\ldots$

Can you? Don't look down just yet. The gap is somewhere above! \medskip

$\ldots\ldots\ldots\ldots\ldots$

This time, the theorem itself is correct, so you can't find the gap by tracing
the proof through a case where the theorem is false. Though an example might
be useful... \medskip

$\ldots\ldots\ldots\ldots\ldots$

No, we didn't misuse the principle of induction. The structure of the proof is
fine. (Actually, we could have made our statements a bit shorter by fixing
$a\geq0$, but this wouldn't have made much of a difference.) \medskip

$\ldots\ldots\ldots\ldots\ldots$

The base case was fine, too. \medskip

$\ldots\ldots\ldots\ldots\ldots$

A computer, of course, would spot the problem.

If you tried to formalize the above proof in a computer language (e.g.,
\href{https://en.wikipedia.org/wiki/Coq}{Coq} or
\href{https://en.wikipedia.org/wiki/Lean_(proof_assistant)}{Lean}), you would
run into a type mismatch error. Some statement has been proved for variables
of a certain type, but is being used for variables of a different type. Very
slightly different. \medskip

$\ldots\ldots\ldots\ldots\ldots$

The statement in question is Theorem \ref{thm.fib.add}. It is stated for one
kind of variables, but we have used it for a slightly different kind. \medskip

$\ldots\ldots\ldots\ldots\ldots$

OK, I am spelling it out: Theorem \ref{thm.fib.add} (i.e., the addition
formula $f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}$) has been stated and proved for
all integers $n,m\geq0$, but we have applied it to $n=ac$ and $m=a-1$. For
this to work, we need $ac\geq0$ and $a-1\geq0$. Now, $ac\geq0$ is indeed
satisfied (since $a\geq0$ and $c\geq0$), but $a-1\geq0$ holds only if $a\geq
1$, which is not guaranteed. Thus, our use of Theorem \ref{thm.fib.add} was
illegal when $a=0$. And indeed, if we apply Theorem \ref{thm.fib.add} for
$a=0$, then we end up with an $f_{-1}$ term, which is undefined. Even if you
define $f_{-1}$ appropriately (and there is a good definition; see homework
set \#1 Exercise 5), we have not proved Theorem \ref{thm.fib.add} for negative
$n,m$. So there is a gap in our proof. Can we fix it?\medskip

$\ldots\ldots\ldots\ldots\ldots$

Fortunately, we can: Our argument breaks down only in the case when $a=0$, and
we can just treat this case $a=0$ manually, since it is an easy case. So we
build a case distinction into our above induction step. Thus, the induction
step takes the following form: \medskip

\textit{Induction step (corrected):} Let $c\geq0$ be an integer. We assume
that $P\left(  c\right)  $ holds, i.e., that
\[
\text{\textquotedblleft for any integer }a\geq0\text{, we have }f_{a}\mid
f_{ac}\text{\textquotedblright\ holds.}%
\]
We must prove that $P\left(  c+1\right)  $ holds, i.e., that%
\[
\text{\textquotedblleft for any integer }a\geq0\text{, we have }f_{a}\mid
f_{a\left(  c+1\right)  }\text{\textquotedblright\ holds.}%
\]


Let $a\geq0$ be any integer. We must show that $f_{a}\mid f_{a\left(
c+1\right)  }$. We are in one of the following two cases:

\textit{Case 1:} We have $a=0$.

\textit{Case 2:} We have $a\neq0$.

In Case 1, we have $a=0$, so that both $f_{a}$ and $f_{a\left(  c+1\right)  }$
equal $f_{0}=0$, and thus $f_{a}\mid f_{a\left(  c+1\right)  }$ holds (since
$0\mid0$). Thus, the divisibility $f_{a}\mid f_{a\left(  c+1\right)  }$ is
proved in Case 1.

Now, consider Case 2. In this case, $a\neq0$, so that $a\geq1$ (because $a$ is
an integer and $\geq0$).\ Hence, $a-1\geq0$. This will allow us to apply
Theorem \ref{thm.fib.add} to $n=ac$ and $m=a-1$ in a few moments. The
induction hypothesis (i.e., our assumption that $P\left(  c\right)  $ holds)
yields that $f_{a}\mid f_{ac}$. In other words, $f_{ac}=f_{a}p$ for some
integer $p$. Now,%
\begin{align*}
f_{a\left(  c+1\right)  }  &  =f_{ac+a}=f_{ac+\left(  a-1\right)  +1}\\
&  =\underbrace{f_{ac}}_{=f_{a}p}f_{a-1}+f_{ac+1}f_{a}%
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.fib.add},}\\
\text{applied to }n=ac\text{ and }m=a-1
\end{array}
\right) \\
&  =f_{a}pf_{a-1}+f_{ac+1}f_{a}=f_{a}\cdot\underbrace{\left(  pf_{a-1}%
+f_{ac+1}\right)  }_{\text{an integer}}.
\end{align*}
This immediately yields that $f_{a}\mid f_{a\left(  c+1\right)  }$.

So we have proved $f_{a}\mid f_{a\left(  c+1\right)  }$ in both Cases 1 and 2.
Therefore, $f_{a}\mid f_{a\left(  c+1\right)  }$ always holds.

Thus, $P\left(  c+1\right)  $ is proved. This completes the induction step,
and thus the restated theorem is proved. Therefore, Theorem \ref{thm.fib.div}
is proved -- correctly this time!
\end{proof}


\end{document}