\section{Proofs by Induction}

\definition{}
The last proof technique we'll discuss in this handout is \textit{induction.} \par
This is particularly useful when we have a \say{countable} variable, usually an integer. \par
Let's say we're proving a statement $A$ for all positive integers $n$. \par
We'll write the special case \say{$A$ holds for $n$} as $A_n$.

\vspace{2mm}

A proof by induction consists of two parts: a \textit{base case} and a \textit{inductive step}. \par
The base case is usually fairly simple: we show that our statement holds for $n = 0$. \par
In other words, the base case shows that $A_0$ is true.

The inductive step is a bit more confusing: we show that if our statement holds for
$n$, it must hold for $n = 1$. In other words, we show that $A_n \implies A_{n + 1}$.

\vspace{2mm}

In this way, we build an infinite implication chain: \par
The base case proves that $A_0$. By the inductive step,
$A_0 \implies A_1$, $A_1 \implies A_2$, and so on. \par
We can thus conclude that $A_n$ is true for all $n \in \{0, 1, 2, 3, ...\}$

\problem{}
Proof by induction will make a bit more sense with an example. \par
Read and understand the following proof.

\begin{examplesolution}
	Show that $1 + 2 + ... + n = \frac{n(n+1)}{2}$

	\linehack{}

	\textbf{Base case:} $n = 1$ \par
	Substitute $n = 1$ into the hypothesis:
	$1 \qe \frac{1(1 + 1)}{2}$ \par

	but we have that
	$\frac{1(1 + 1)}{2} = \frac{2}{2} = 1$,
	so this is of course true.

	\vspace{2mm}

	\textbf{Inductive step:} \par
	Now, we assume our hypothesis is true for $n$, \par
	and show it is true for $n + 1$.

	\vspace{2mm}

	Write the hypothesis for $n + 1$:
	$$
		1 + 2 + ... + n + (n + 1) \qe \frac{(n+1)(n+2)}{2}
	$$
	We know that $1 + 2 + ... + n = \frac{n(n+1)}{2}$, so:
	$$
		1 + 2 + ... + n + (n + 1) = \frac{n(n+1)}{2} + (n+1)
	$$
	now we can complete the proof with some algebra:
	$$
		\frac{n(n+1)}{2} + (n+1) = \frac{n(n+1) + 2(n+1)}{2} = \frac{(n + 2)(n+1)}{2}
	$$
	So, we've shown that the $n^\text{th}$ case implies the $(n+1)^\text{th}$ case.\par
	We're therefore done, the hypothesis is true for $n \in \{1, 2, 3, ...\}$
\end{examplesolution}

\vfill
\pagebreak

\problem{}
Why do we need a base case when constructing a proof by induction? \par
\hint{Try to prove that $n = n + 1$ for all $n \in \mathbb{Z}^+$}

\begin{solution}
	Consider the following example: \par
	Say we want to prove that $n = n + 1$ for all $n \in \mathbb{Z}^+$.

	\vspace{2mm}

	\textbf{Inductive step:}
	Assume our hypothesis is true for $n$ (that is $n = n + 1$). Is this true for $n + 1$? \par
	Adding 1 to both sides, we get $n+1=n+1+1$, which means that $(n+1)=(n+1)+1$,
	which is the statement we wanted to prove. We've thus completed the inductive step!

	\vspace{2mm}

	Our problem is as follows: we've shown that $A_1 \implies A_2 \implies ...$,
	but we have no reason to believe that $A_1$ is true. If it was, our hypothesis
	would be correct---but since it isn't, this is not a complete proof.
\end{solution}

\vfill



\problem{}
Show that $1^2 + 2^2 + 3^3 + ... + n^2 = \frac{1}{6}(n)(n+1)(2n+1)$.

\begin{solution}
	\textbf{Base case:}\par
	$1^2 = \frac{1}{6}(1)(1+1)(2 + 1) = 1$, which is true.

	\vspace{2mm}

	\textbf{Induction:}\par
	Assume $1^2 + ... + n^2$ satisfies the equation above. \par
	$$
		1^2 + 2^2 + ... + n^2 + (n+1)^2 =
		\frac{(n)(n+1)(2n+1)}{6} + (n + 1)^2
	$$
	which is equal to
	$$
		\frac{(n)(n+1)(2n+1) + 6(n+1)^2}{6}
	$$
	now expand and factor to get
	$$
		\frac{(n+1)(n+2)(2(n+1)+1)}{6}
	$$
\end{solution}

\vfill



\problem{}
Show that $2^n - 1$ is divisible by 3 for all odd $n$ \par
\hint{If $n$ is odd, the next odd number is $n + 2$.}

\begin{solution}
	\textbf{Base case:} \par
	$2^2 - 1 = 3$, which is divisible by 3..

	\vspace{2mm}

	\textbf{Induction:}\par
	Assume $2^n - 1$ is divisible by 3. \par
	$2^{(n+2)} - 1 = 4(2^n) - 1 = 4(2^n - 1) + 3$ \par
	By our induction hypothesis, $(2^n - 1)$ has a factor of 3. \par
	Therefore, $4(2^n - 1) + 3$ must also have a factor of 3.
\end{solution}

\vfill
\pagebreak







\definition{}
As you may already know, \say{n choose k} is defined as follows: \par
$$
	\binom{n}{k} = \frac{n!}{k!(n-k)!}
$$
This counts the number of ways to choose $k$ things from a set of $n$,
disregarding the order of the chosen items.

\theorem{Pascal's Identity}
The binomial coefficient defined above satisfies the following equality:
$$
	\binom{n+1}{k} = \binom{n}{k-1} \times \binom{n}{k}
$$

\problem{}<binomsum>
Using induction, show that
$$
	\binom{n}{0} + \binom{n}{1} + ... + \binom{n}{n} = 2^n.
$$










\vfill

Note that although induction is a powerful proof technique, it usually leads to uninteresting results. \par
If we prove a statement using induction, we conclude that it is true---but we get very little insight on
\textit{why} it is true.

\vspace{2mm}

Alternative proofs are take a bit more work than inductive proofs, but they are much more valuable. \par
For example, see the proof of the statement in \ref{binomsum} on the next page.

\pagebreak


\begin{hobox}{Alternative Proof}{ogrape!10!white}{ogrape}
	Consider the following problem: \par
	How many ways are there to write a number $x$ as an ordered sum of positive integers? \par
	\note{
		An \say{ordered sum} means that the order of numbers in the sum matters. \\
		For example, if $x = 5$, we will consider $4 + 1$ and $1 + 4$ as distinct sums.
	}

	\vspace{2mm}

	First, we'll think of $x$ as an array of $1$s which we want to group
	into positive integers. If $x = 3$, We have $x = 1~1~1$, which we can
	group as $1+1+1$,~ $(1+1) + 1$,~ $1 + (1+1)$,~ and $(1+1+1)$.


	\linehack{}

	\textbf{Solution 1:}\par
	One way to solve this is to use the usual \say{stars and bars} method, \par
	where we count the number of ways we can place $n$ \say{bars} between
	$x$ \say{stars}. Each bar corresponds to a \say{$+$} in the array of ones. \par
	\note[Note]{Convince yourself that there are $\binom{x-1}{n}$ ways to place $n$ bars
	between $x$ objects.}

	If we add the number of ways to write $x$ as a sum of $n \in \{1, 2, ..., x\}$ integers, we get:

	$$
		\sum_{n = 1}^{x-1} \binom{x-1}{n} = \binom{x-1}{0} + \binom{n}{1} + ... + \binom{x-1}{x-1}
	$$


	\linehack{}

	\textbf{Solution 2:}\par
	We could also observe that there are $x - 1$ places to put a \say{bar} in
	the array of ones. This corresponds to $x - 1$ binary positions, and thus
	$2^{x-1}$ ways to separate our array of $1$s with bars.

	\linehack{}

	\textbf{Conclusion:}\par
	We've found that the number of ways to split $x$ can be written as either
	$\sum_{n = 1}^{x-1} \binom{x-1}{n}$ or $2^{x-1}$,
	and therefore $\sum_{n = 1}^{x-1} \binom{x-1}{n} = 2^{x-1}$.
\end{hobox}


\pagebreak