\documentclass[t]{beamer}
\mode<presentation>

\newcommand{\lecnumber}{4}

\include{cocmacros}
\newcommand{\uuline}[1]{\underline{\underline{#1}}}
\newcommand{\ures}[3]{
  \begin{array}{c@{\hspace*{2em}}c} 
    #1 & #2 \\ \hline \multicolumn{2}{c}{#3} 
  \end{array}}

\title{\lecnumber. Induction}
\date{}
\institute[Stanford University]

\begin{document}

\setbeamertemplate{footline}[text line]
{
	%\begin{large}
	\hspace*{\stretch{1}}\lecnumber - \insertframenumber \bigskip
	%\end{large}
}

\begin{frame}[c]
\Large
\textsc{The Calculus of Computation:}\\
Decision Procedures with\\
Applications to Verification

\bigskip
\bigskip
by\\
Aaron Bradley\\
Zohar Manna

\bigskip
\bigskip
Springer 2007
\end{frame}

\begin{frame}
	\titlepage
\end{frame}

\begin{frame}
\frametitle{Induction}
\begin{itemize}
\item \underline{Stepwise induction} (for $\tpeano$, $\tcons$)\\
\bigskip
\item \underline{Complete induction} (for $\tpeano$, $\tcons$)\\
\smallskip
Theoretically equivalent in power to stepwise induction,\\
\underline{but} sometimes produces more concise proof\\
\bigskip
\item \underline{Well-founded induction}\\
\smallskip
Generalized complete induction\\
\bigskip
\item \underline{Structural induction}\\
\smallskip
Over logical formulae\\
\bigskip
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Stepwise Induction (Peano Arithmetic $\tpeano$)}
\underline{Axiom schema (induction)}\\
\smallskip
\quad
\begin{tabular}{@{}l@{\qquad \ldots\ }l}
$F[0] \band$ & base case\\
$(\forall n.\ F[n] \bimplies F[n + 1])$ & inductive step\\
$\bimplies \forall x.\ F[x]$ & conclusion
\end{tabular}\\
\smallskip
\quad for $\speano$-formulae $F[x]$ with one free variable $x$.

\bigskip
To prove $\forall x.\ F[x]$, i.e.,\\
\qquad $F[x]$ is $\tpeano$-valid for all $x \in \naturals$,\\
it suffices to show
\begin{itemize}
\item \underline{base case}: prove $F[0]$ is $\tpeano$-valid.
\item \underline{inductive step}: For arbitrary $n \in \naturals$,\\
\quad assume \underline{inductive hypothesis}, i.e.,\\
\qquad $F[n]$ is $\tpeano$-valid,\\
\quad then prove the \underline{conclusion}\\
\qquad $F[n+1]$ is $\tpeano$-valid.
\end{itemize}
\end{frame}

\newcommand{\texp}{\mathit{exp}_3}
\begin{frame}
\underline{Example}:\\
\smallskip
\quad Theory $\tpeano^+$ obtained from $\tpeano$ by adding the axioms:\\
\begin{itemize}
\item $\forall x.\ x^0 = 1$ \naxiom{E0}
\item $\forall x,y.\ x^{y+1} = x^y \cdot x$ \naxiom{E1}
\item $\forall x,z.\ \texp(x,0,z) = z$ \naxiom{P0}
\item $\forall x,y,z.\ \texp(x,y+1,z) = \texp(x,y,x \cdot z)$ \naxiom{P1}
\end{itemize}

\bigskip
\quad Prove that\\
\bigskip
\qquad \fbox{$\forall x,y.\ \texp(x,y,1) = x^y$}\\
\bigskip
\quad is $\tpeano^+$-valid.
\end{frame}

\begin{frame}
\uuline{First attempt}:
\[ \forall y\ [\underbrace{\forall x.\ \texp(x,y,1) = x^y}_{F[y]}] \]
We chose induction on $y$. Why?

\bigskip
\underline{Base case}:\\
\smallskip
\qquad $F[0]:\ \forall x.\ \texp(x,0,1) = x^0$\\
\smallskip
\quad OK since $\texp(x,0,1)=1$ (P0) and $x^0=1$ (E0).

\bigskip
\underline{Inductive step}: Failure.\\
\smallskip
\quad For arbitrary $n \in \naturals$, we cannot deduce\\
\smallskip
\qquad $F[n+1]: \forall x.\ \texp(x,n+1,1)=x^{n+1}$\\
\smallskip
\quad from the inductive hypothesis\\
\smallskip
\qquad $F[n]: \forall x.\ \texp(x,n,1)=x^n$\\
\end{frame}

\begin{frame}
\uuline{Second attempt}: Strengthening\\
\bigskip
\quad \underline{Strengthened property}\\
\bigskip
\qquad \qquad \fbox{$\forall x,y,z.\ \texp(x,y,z) = x^y \cdot z$}\\
\bigskip
\quad Implies the desired property (choose $z=1$)\\
\smallskip
\qquad \qquad $\forall x,y.\ \texp(x,y,1) = x^y$

\bigskip
\quad Again, induction on $y$\\
\smallskip
\qquad \qquad $\forall y\ [\underbrace{\forall x,z.\ \texp(x,y,z) = x^y\cdot z}_{F[y]}]$

\smallskip
\quad \underline{Base case}:\\
\smallskip
\qquad \qquad $F[0]:\ \forall x,z.\ \texp(x,0,z) = x^0\cdot z$\\
\smallskip
\quad \quad OK since $\texp(x,0,z)=z$ (P0) and $x^0=1$ (E0).
\end{frame}

\begin{frame}
\quad \underline{Inductive step}: For arbitrary $n \in \naturals$\\
\smallskip
\quad \quad Assume inductive hypothesis\\
\smallskip
\qquad \qquad $F[n]: \forall x,z.\ \texp(x,n,z)=x^n\cdot z \naxiom{IH}$\\
\smallskip
\quad \quad prove\\
\smallskip
\qquad \qquad
\begin{tabular}{@{}l@{\,}l@{}l}
$F[n+1]: \forall x,$ & $z'$ & $.\ \texp(x,n+1,z')=x^{n+1}\cdot z'$\\
& ${}^\uparrow$ &\\
\end{tabular}

\begin{align*}
\texp(x,n+1,z') &= \texp(x,n,x \cdot z') & \mbox{\axiom{P1}} \\
&= x^n \cdot (x \cdot z') & \mbox{IH $F[n], z \mapsto x \cdot z'$} \\
&= x^{n+1} \cdot z' & \mbox{\axiom{E1}}
\end{align*}
\end{frame}

\begin{frame}
\frametitle{Stepwise Induction (Lists $\tcons$)}
\underline{Axiom schema (induction)}\\
\smallskip
\quad
\begin{tabular}{@{}l@{\qquad \ldots\ }l}
$(\forall\ \atom\ u.\ F[u] \band$ & base case\\
$(\forall u,v.\ F[v] \bimplies F[\cons(u,v)])$ & inductive step\\
$\bimplies \forall x.\ F[x]$ & conclusion
\end{tabular}\\
\smallskip
\quad for $\scons$-formulae $F[x]$ with one free variable $x$.

\bigskip
To prove $\forall x.\ F[x]$, i.e.,\\
\qquad $F[x]$ is $\tcons$-valid for all lists $x$,\\
it suffices to show
\begin{itemize}
\item \underline{base case}: prove $F[u]$ is $\tcons$-valid for arbitrary atom $u$.
\item \underline{inductive step}: For arbitrary list $v$,\\
\quad assume \underline{inductive hypothesis}, i.e.,\\
\qquad $F[v]$ is $\tcons$-valid,\\
\quad then prove the \underline{conclusion}\\
\qquad $F[\cons(u,v)]$ is $\tcons$-valid for arbitrary atom $u$.
\end{itemize}
\end{frame}

\newcommand{\concat}{\mathit{concat}}
\newcommand{\rvs}{\mathit{rvs}}
\newcommand{\flatc}{\mathit{flat}}
\newcommand{\qatom}{\ \atom\ }
\begin{frame}[shrink=5]
\underline{Example}\\
\smallskip
\quad Theory $\tcons^+$ obtained from $\tcons$ by adding the axioms for
concatenating two lists, reverse a list, and decide if a list is flat\\
(i.e., $\flatc(x)$ is $\true$ iff every element of list $x$ is an atom).
\begin{itemize}
\item $\forall \qatom u.\ \forall v.\ \concat(u,v) = \cons(u,v)$ \naxiom{C0}
\item $\forall u,v,x.\ \concat(\cons(u,v),x) = \cons(u,\concat(v,x))$ \naxiom{C1}
\item $\forall \qatom u.\ \rvs(u) = u$ \naxiom{R0}
\item $\forall x,y.\ \rvs(\concat(x,y)) = \concat(\rvs(y),\rvs(x))$ \naxiom{R1}
\item $\forall \qatom u.\ \flatc(u)$ \naxiom{F0}
\item $\forall u,v.\ \flatc(\cons(u,v)) \biff \atom(u) \band \flatc(v)$ \naxiom{F1}
\end{itemize}

\bigskip
\quad Prove\\
\smallskip
\qquad \qquad \fbox{$\forall x.\ \flatc(x) \bimplies \rvs(\rvs(x)) = x$}\\
\smallskip
\quad \quad is $\tcons^+$-valid.

\bigskip
\quad \underline{Base case}: For arbitrary atom $u$,\\
\qquad \qquad $F[u]: \flatc(u) \bimplies \rvs(\rvs(u)) = u$\\
\quad \quad by R0.
\end{frame}

\begin{frame}
\quad \underline{Inductive step}: For arbitrary lists $u, v,$\\
\quad \quad assume the inductive hypothesis\\
\qquad \qquad $F[v]:\ \flatc(v) \bimplies \rvs(\rvs(v)) = v \hspace{\stretch{1}} \naxiom{IH}$\\
\bigskip
\quad \quad Prove\\
\qquad \qquad $F[\cons(u,v)]:\ \flatc(\cons(u,v)) \bimplies$\\
\qquad \qquad \qquad \qquad \qquad \qquad $\rvs(\rvs(\cons(u,v))) = \cons(u,v) \hspace{\stretch{1}} \naxiom{*}$

\bigskip
\quad \quad \quad \underline{Case $\neg \atom(u)$}\\
\smallskip
\quad \qquad \qquad $\flatc(\cons(u,v)) \Bequiv \atom(u) \band \flatc(v) \Bequiv \false$\\
\smallskip
\quad \quad \quad \quad by (F1). ($*$) holds since its antecedent is $\false$.

\bigskip
\quad \quad \quad \underline{Case $\atom(u)$}\\
\smallskip
\quad \qquad \qquad $\flatc(\cons(u,v)) \Bequiv \atom(u) \band \flatc(v) \Bequiv \flatc(v)$\\
\smallskip
\quad \quad \quad \quad by (F1).\\
\smallskip
\quad \qquad \qquad $\rvs(\rvs(\cons(u,v))) = \cdots = \cons(u,v)$.
\end{frame}

\begin{frame}
\frametitle{Complete Induction (Peano Arithmetic $\tpeano$)}
\underline{Axiom schema (complete induction)}\\
\smallskip
\quad
\begin{tabular}{@{}l@{\qquad \ldots\ }l}
$(\forall n.\ (\forall n'.\ n' < n \bimplies F[n']) \bimplies F[n])$ & inductive step\\
$\bimplies \forall x.\ F[x]$ & conclusion
\end{tabular}\\
\smallskip
for $\speano$-formulae $F[x]$ with one free variable $x$.

\bigskip
To prove $\forall x.\ F[x]$, i.e.,\\
\qquad $F[x]$ is $\tpeano$-valid for all $x \in \naturals$,\\
it suffices to show
\begin{itemize}
\item \underline{inductive step}: For arbitrary $n \in \naturals$,\\
\quad assume \underline{inductive hypothesis}, i.e.,\\
\qquad $F[n']$ is $\tpeano$-valid for every $n' \in \naturals$ such that $n' < n$,\\
\quad then prove\\
\qquad $F[n]$ is $\tpeano$-valid.
\end{itemize}
\end{frame}

\newcommand{\quot}{\mathit{quot}}
\newcommand{\rem}{\mathit{rem}}
\begin{frame}[shrink=2]
Is base case missing?\\
\smallskip
\quad No. Base case is implicit in the structure of complete induction.

\smallskip
\underline{Note}:
\begin{itemize}
\item Complete induction is theoretically equivalent in power to stepwise induction.
\item Complete induction sometimes yields more concise proofs.
\end{itemize}

\bigskip
\underline{Example}: Integer division \qquad $\quot(5,3)=1$ and $\rem(5,3)=2$\\
\smallskip
\quad Theory $\tpeano^*$ obtained from $\tpeano$ by adding the axioms:
\begin{itemize}
\item $\forall x,y.\ x < y \bimplies \quot(x,y) = 0$ \naxiom{Q0}
\item $\forall x,y.\ y > 0 \bimplies \quot(x+y,y) = \quot(x,y) + 1$ \naxiom{Q1}
\item $\forall x,y.\ x < y \bimplies \rem(x,y) = x$ \naxiom{R0}
\item $\forall x,y.\ y > 0 \bimplies \rem(x+y,y) = \rem(x,y)$ \naxiom{R1}
\end{itemize}

\quad Prove\\
\qquad (1) $\forall x,y.\ y > 0 \bimplies \rem(x,y) < y$\\
\qquad (2) $\forall x,y.\ y > 0 \bimplies x = y \cdot \quot(x,y) + \rem(x,y)$

\smallskip
\quad Best proved by complete induction.
\end{frame}

\begin{frame}[shrink = 6]
\underline{Proof of (1)}\\
\smallskip
\qquad $\forall x.\ \underbrace{\forall y.\ y>0 \bimplies \rem(x,y) < y}_{F[x]}$\\
\smallskip
\quad Consider an arbitrary natural number $x$.\\
\quad Assume the inductive hypothesis\\
\qquad $\forall x'.\ x' < x \bimplies \underbrace{\forall y'.\ y' > 0 \bimplies \rem(x', y') < y'}_{F[x']}$ \hspace{\stretch{1}} (IH)

\smallskip
Prove \quad $F[x]: \forall y.\ y > 0 \bimplies \rem(x,y) < y$.

\smallskip
\quad Let $y$ be an arbitrary positive integer\\
\smallskip
\quad \underline{Case $x < y$}:\\
\smallskip
\qquad \begin{tabular}{lcl@{\qquad}l}
$\rem(x,y)$ & $=$ & $x$ & by (R0)\\
& $<$ & $y$ & case
\end{tabular}

\quad \underline{Case $\neg (x < y)$}:\\
\smallskip
\quad \quad Then there is natural number $n$, $n < x$ s.t. $x = n + y$\\
\smallskip
\qquad \begin{tabular}{lcl@{\qquad}l}
$\rem(x,y)$ & $=$ & $\rem(n+y, y)$ & $x= n + y$\\
& $=$ & $\rem(n, y)$ & (R1)\\
& $<$ & $y$ & IH ($x' \mapsto n, y' \mapsto y$)\\
&&& since $n < x$ and $y > 0$
\end{tabular}
\end{frame}

\newcommand{\cprec}{\prec_\mathsf{c}}
\begin{frame}
\frametitle{Well-founded Induction}
A binary predicate $\prec$ over a set $S$ is a \underline{well-founded
relation} iff there does not exist an infinite decreasing sequence\\
\qquad $s_1 \succ s_2 \succ s_3 \succ \cdots$\\
\smallskip
\underline{Note}: where $s \prec t$ iff $t \succ s$

\bigskip
\underline{Examples}:
\begin{itemize}
\item $<$ is well-founded over the natural numbers.\\
Any sequence of natural numbers decreasing according to $<$ is finite:\\
\smallskip
\qquad $1023 > 39 > 30 > 29 > 8 > 3 > 0$.
\smallskip
\item $<$ is \underline{not} well-founded over the rationals.\\
\smallskip
\qquad $1 > \frac{1}{2} > \frac{1}{3} > \frac{1}{4} > \cdots$\\
\smallskip
is an infinite decreasing sequence.
\item The strict sublist relation $\cprec$ is well-founded on the set of all lists.
\end{itemize}
\end{frame}


\begin{frame}
\underline{Well-founded Induction Principle}\\
\smallskip
For theory $T$ and well-founded relation $\prec$,\\
\quad the \underline{axiom schema (well-founded induction)}
\[ (\forall n.\ (\forall n'.\ n' \prec n \bimplies F[n']) \bimplies F[n]) \bimplies \forall x.\ F[x] \]
\quad for $\Sigma$-formulae $F[x]$ with one free variable x.

\bigskip
To prove $\forall x.\ F[x]$, i.e.,\\
\qquad $F[x]$ is $T$-valid for every $x$,\\
\quad it suffices to show
\begin{itemize}
\item \underline{inductive step}: For arbitrary $n$,\\
\quad assume inductive hypothesis, i.e.,\\
\qquad $F[n']$ is $T$-valid for every $n'$, such that $n' \prec n$\\
\quad then prove\\
\qquad $F[n]$ is $T$-valid.
\end{itemize}

\bigskip
Complete induction in $\tpeano$ is a specific instance of well-founded induction, where the well-founded relation $\prec$ is $<$.
\end{frame}

\begin{frame}
\underline{Lexicographic Relation}\\
\smallskip
Given pairs of sets and well-founded relations
\[ (S_1, \prec_1), \ldots, (S_m, \prec_m) \]
Construct
\[ S = S_1 \times \ldots, S_m \]
Define \underline{lexicographic relation} $\prec$ over $S$ as
\[ \underbrace{(s_1,\ldots,s_m)}_s \prec \underbrace{(t_1,\ldots,t_m)}_t \Bequiv \bigvee_{i=1}^{m} \left( s_i \prec_i t_i \band \bigwedge_{j=1}^{i-1} s_j = t_j \right) \]
for $s_i, t_i \in S_i$.

\medskip
$\bullet$ If $(S_1, \prec_1), \ldots, (S_m, \prec_m)$ are well-founded relations, so is $(S, \prec)$.
\end{frame}

\begin{frame}
\underline{Lexicographic well-founded induction principle}

\smallskip
For theory $T$ and well-founded lexicographic relation $\prec$,
\[
\begin{array}{@{}l}
\left[\begin{array}{@{}l@{}}
\forall n_1,\ldots,n_m. \\
\left[
\begin{array}{@{}l@{}}
(\forall n_1',\ldots,n_m'.\ (n_1',\ldots,n_m') \prec (n_1,\ldots,n_m) \bimplies F[n_1',\ldots,n_m']) \\
\mbox{} \bimplies F[n_1,\ldots,n_m]
\end{array}\right]
\end{array}\right] \\
\mbox{} \bimplies \forall x_1,\ldots,x_m.\ F[x_1,\ldots,x_m]
\end{array}
\]
for $\Sigma$-formula $F[x_1,\ldots,x_m]$ with free variables $x_1,\ldots,x_m$, is $T$-valid.

\bigskip
Same as regular well-founded induction, just\\
\smallskip
\qquad $n \Bimplies$ tuple $(n_1,\ldots,n_m)$.

\end{frame}

\begin{frame}
\underline{Example}: Puzzle\\
\smallskip
Bag of red, yellow, and blue chips\\
If one chip remains in the bag -- remove it\\
Otherwise, remove two chips at random:
\begin{enumerate}
\item If one of the two is red --\\
don't put any chips in the bag
\item If both are yellow --\\
put one yellow and five blue chips
\item If one of the two is blue and the other not red --\\
put ten red chips
\end{enumerate}
Does this process terminate?

\bigskip
\underline{Proof}: Consider
\begin{itemize}
\item Set $S: \naturals^3$ of triples of natural numbers and
\item Well-founded lexicographic relation $<_3$ for such triples, e.g.
\[ (11,13,3) \not<_3 (11,9,104) \qquad (11,9,104) <_3 (11,13,3) \]
\end{itemize}
\end{frame}

\begin{frame}
Show
\[ (y',b',r') <_3 (y,b,r) \]
for each possible case. Since $<_3$ well-formed relation\\
$\Bimplies$ only finite decreasing sequences 
$\Bimplies$ process must terminate

\begin{enumerate}
\item If one of the two removed chips is red --\\
do not put any chips in the bag
\[ \left. 
\begin{array}{c}
(y-1,b,r-1)\\(y,b-1,r-1)\\(y,b,r-2)
\end{array}
\right\} <_3 (y,b,r) \]
\item If both are yellow --\\
put one yellow and five blue
\[ (y-1,b+5,r) <_3 (y,b,r) \]
\item If one is blue and the other not red --\\
put ten red
\[ \left. 
\begin{array}{c}
(y-1,b-1,r+10)\\(y,b-2,r+10)
\end{array}
\right\} <_3 (y,b,r) \]
\end{enumerate}
\end{frame}

\newcommand{\ack}{\mathit{ack}}
\begin{frame}
\underline{Example}: Ackermann function\\
\smallskip
Theory $\tpresb^{\ack}$ is the theory of Presburger arithmetic
$\tpresb$ (for natural numbers) augmented with\\
\smallskip
\quad \underline{Ackermann axioms}:
\begin{itemize}
\item $\forall y.\ \ack(0,y) = y + 1$ \naxiom{L0}
\item $\forall x.\ \ack(x+1,0) = \ack(x,1)$ \naxiom{R0}
\item $\forall x,y.\ \ack(x+1,y+1) = \ack(x,\ack(x+1,y))$ \naxiom{S}
\end{itemize}

\bigskip
\underline{Ackermann function} grows quickly:\\
\begin{tabular}{l}
$\ack(0,0) = 1$\\
$\ack(1,1) = 3$\\
$\ack(2,2) = 7$\\
$\ack(3,3) = 61$
\end{tabular}
\qquad
$\ack(4,4) = 2^{2^{2^{2^{16}}}} - 3$
\end{frame}

\begin{frame}
Let $<_2$ be the lexicographic extension of $<$ to pairs of natural numbers.
\begin{enumerate}
\item[(L0)] $\forall y.\ \ack(0,y) = y+1$\\
does not involve recursive call
\item[(R0)] $\forall x.\ \ack(x+1,0)=\ack(x,1)$\\
\qquad $(x+1,0) >_2 (x,1)$
\item[(S)] $\forall x,y.\ \ack(x+1,y+1) = \ack(x,\ack(x+1,y))$\\
\qquad $(x+1,y+1) >_2 (x+1,y)$\\
\qquad $(x+1,y+1) >_2 (x,\ack(x+1,y))$
\end{enumerate}

\bigskip
No infinite recursive calls $\Bimplies$ the recursive computation
of $\ack(x,y)$ terminates for all pairs of natural numbers.
\end{frame}

\begin{frame}
\underline{Proof of property}\\
\smallskip
Use well-founded induction over $<_2$ to prove\\
\smallskip
\qquad $\forall x,y.\ \ack(x,y) > y$\\
\smallskip
is $\tpresb^\ack$ valid.

\bigskip
Consider arbitrary natural numbers $x$, $y$.\\
Assume the \underline{inductive hypothesis}\\
\qquad $\forall x',y'.\ (x',y') <_2 (x,y) \bimplies \underbrace{\ack(x',y') > y'}_{F[x',y']}$
\hspace{\stretch{1}}(IH)\\
\smallskip
Show\\
\qquad $F[x,y]: \ack(x,y) > y$.

\bigskip
\underline{Case $x=0$}:\\
\smallskip
\qquad $\ack(0,y) = y+1 > y$ \qquad by (L0)

\end{frame}

\begin{frame}[shrink=6]
\underline{Case $x>0 \band y=0$}:\\
\smallskip
\qquad $\ack(x,0) = \ack(x-1,1)$ \qquad by (R0)\\
\smallskip
\quad Since\\
\smallskip
\qquad $(\underbrace{x-1}_{x'}, \underbrace{1}_{y'}) <_2 (x,y)$\\
\smallskip
\quad Then\\
\smallskip
\qquad $\ack(x-1,1) > 1$ \qquad by (IH) $(x'\mapsto x-1, y'\mapsto 1)$\\
\smallskip
\quad Thus\\
\qquad $\ack(x,0) = \ack(x-1,1) > 1 > 0$

\bigskip
\underline{Case $x>0 \band y>0$}:\\
\smallskip
\qquad $\ack(x,y)=\ack(x-1,\ack(x,y-1))$ \qquad by (S) \hspace{\stretch{1}} (1)\\
\smallskip
\quad Since\\
\smallskip
\qquad $(\underbrace{x-1}_{x'}, \underbrace{\ack(x,y-1)}_{y'}) <_2 (x,y)$\\
\smallskip
\quad Then\\
\smallskip
\qquad $\ack(x-1,\ack(x,y-1)) > \ack(x,y-1)$ \hspace{\stretch{1}} (2)\\
\smallskip
\quad by (IH) $(x'\mapsto x-1, y'\mapsto \ack(x,y-1))$.
\end{frame}

\begin{frame}
\quad Furthermore, since\\
\smallskip
\qquad $(\underbrace{x}_{x'}, \underbrace{y-1}_{y'}) <_2 (x,y)$\\
\smallskip
\quad then\\
\smallskip
\qquad $\ack(x,y-1) > y-1$ \hspace{\stretch{1}} (3)

\bigskip
By (1)--(3), we have
\[ \ack(x,y) \stackrel{(1)}{=} \ack(x-1,\ack(x,y-1)) \stackrel{(2)}{>}
\ack(x,y-1) \stackrel{(3)}{>} y-1 \]
Hence
\[ \ack(x,y) > (y-1) + 1 = y \]
\end{frame}

\begin{frame}
\frametitle{Structural Induction}
How do we prove properties about logical formulae themselves?

\bigskip
\underline{Structural induction principle}\\
\smallskip
To prove a desired property of FOL formulae,
\begin{itemize}
\item[] \underline{inductive step}:
Assume the \underline{inductive hypothesis}, that for arbitrary FOL formula $F$,
the desired property holds for every strict subformula $G$ of $F$.\\
Then prove that $F$ has the property.
\end{itemize}

\bigskip
Since atoms do not have strict subformulae, they are treated as \underline{base cases}.
\end{frame}

\begin{frame}
\underline{Example}: Prove that\\
\smallskip
Every propositional formula $F$ is equivalent to a propositional formula $F'$
constructed with only $\true$, $\vee$, $\neg$ (and propositional variables)

\bigskip
\underline{Base cases}:
\begin{itemize}
\item[] $F: \true \Bimplies F': \true$
\item[] $F: \false \Bimplies F': \neg \true$
\item[] $F: P \Bimplies F': P$ for propositional variable $P$
\end{itemize}

\bigskip
\underline{Inductive step}:\\
Assume as the \underline{inductive hypothesis} that $G$, $G_1$, $G_2$
are equivalent to $G'$, $G_1'$, $G_2'$ constructed only from
$\true$, $\vee$, $\neg$ (and propositional variables).\\
\qquad \begin{tabular}{@{}l@{\quad $\Bimplies$ \quad}l}
$F: \neg G$ & $F': \neg G'$\\
$F: G_1 \band G_2$ & $ F': \neg (\neg G_1' \bor \neg G_2')$\\
$F: G_1 \bimplies G_2$ & $F': \neg G_1' \bor G_2'$\\
$F: G_1 \biff G_2$ & $F': \cdots$
\end{tabular}

Each $F'$ is equivalent to $F$ and is constructed only by $\true$, $\vee$, $\neg$
by the inductive hypothesis.
\end{frame}
\end{document}
