\documentclass{beamer}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{calc,decorations.markings,positioning,arrows.meta}

\tikzset{->-/.style={decoration={
  markings,
  mark=at position #1 with {\arrow{>}}},postaction={decorate}}}
  
\author{Tom Cuchta}
\title{}
\mode<presentation> {
\usetheme{Warsaw}
\setbeamertemplate{navigation symbols}{}
}
\begin{document}


\begin{frame}{First order arithmetic}
\textbf{\underline{Axioms}} \\
\begin{enumerate}
\item $(\forall x)(0 \neq Sx)$ 
\item $(\forall x)(\forall y)(Sx=Sy \rightarrow x=y)$ 
\item $(\forall y)(y=0 \vee (\exists x)(Sx=y))$ 
\item $(\forall x)(x+0=x)$ 
\item $(\forall x)(\forall y)(x+Sy=S(x+y))$
\item $(\forall x)(x \cdot 0=0)$ 
\item $(\forall x)(\forall y)(x \cdot Sy=(x\cdot y)+x)$
\item $(\forall x)(\forall y)(x+y=y+x)$ 
\item $(\forall x)(\forall y)(x \cdot y = y \cdot x)$
\end{enumerate}
\end{frame}

\begin{frame}{First order arithmetic}
\vspace{-10pt}
Prove in 1st order arithmetic: $(x+S0)=SS0 \leftrightarrow x=S0$.
\hspace*{-0.3in}
\begin{tabular}{|lll|}
\hline
$\{\mathrm{Ax \hspace{2pt}} 5\}$ & (1) $(\forall y)(x+Sy=S(x+y))$ & Axiom 5 US \\
$\{\mathrm{Ax \hspace{2pt}} 5\}$ & (2) $x+S0=S(x+0)$ & 1 US \\
$\{\mathrm{Ax \hspace{2pt}} 4\}$ & (3) $x+0=x$ & Axiom 4 US \\
$\{\mathrm{Ax \hspace{2pt}} 4, 5\}$ & (4) $x+S0=Sx$ & 2 3 Identity Law \\
$\{5\}$ & (5) $(x+S0)=SS0$ & Premise \\
$\{5, \mathrm{Ax \hspace{2pt}} 4,5\}$ & (6) $SS0=Sx$ & 4 5 Identity Law \\
$\{\mathrm{Ax \hspace{2pt}} 2\}$ & (7) $(\forall y)(SS0=Sy \rightarrow S0=y)$ & Axiom 2 US \\
$\{\mathrm{Ax \hspace{2pt}} 2\}$ & (8) $SS0=Sx \rightarrow S0=x$ & 7 US \\
$\{5, \mathrm{Ax \hspace{2pt}} 2, 4,5\}$ & (9) $S0=x$ & 6 8 Detachment \\
$\{5, \mathrm{Ax \hspace{2pt}} 2, 4,5\}$ & (10) $x=S0$ & 9 Identity \\
$\{\mathrm{Ax \hspace{2pt}} 2, 4,5\}$ & (11) $(x+S0)=SS0 \rightarrow x=S0$ & 5 10 C.P. \\
$\{12\}$ & (12) $x=S0$ & Premise \\
$\{12, \mathrm{Ax \hspace{2pt}} 5\}$ & (13) $(x+S0)=S(S0+0)$ & 2 12 Identity Law \\
$\{\mathrm{Ax \hspace{2pt}} 4\}$ & (14) $S0+0=S0$ & Axiom 4 \\
$\{12, \mathrm{Ax \hspace{2pt}} 4,5\}$ & (15) $x+S0=SS0$ & 13 14 Identity Law \\
$\{\mathrm{Ax \hspace{2pt}} 4,5\}$ & (16) $x=S0 \rightarrow (x+S0)=SS0$ & 12 15 C.P. \\
$\{\mathrm{Ax \hspace{2pt}} 2, 4,5\}$ & (17) $(x+S0)=SS0 \leftrightarrow x=S0$ & 11 16 Law of Biconditionals
\end{tabular}

\end{frame}

\begin{frame}{First order arithmetic}
Sometimes it is useful to break a proof of a theorem down into constituent parts and then combine the parts. This can help ``chunk" a longer proof into a sequence of simpler proofs.  We could have proven $(x+S0)=SS0 \leftrightarrow x=S0$ in the following way: 
\begin{itemize}
\item \textbf{Theorem A}: $(x+S0) = SS0 \rightarrow x=S0$ 
\item \textbf{Theorem B}: $x=S0 \rightarrow (x+S0)=SS0$ 
\end{itemize}
Notice in the previous slide, \textbf{Theorem A} was proven on line (11) and depends on Axioms 2, 4, and 5 and \textbf{Theorem B} was proven on line (16) and depends on Axioms 4 and 5. \\ 
\vspace{1cm}
We allow ourselves to use theorems in a formal deduction by placing it on a new line (with proper documentation). 
\end{frame}

\begin{frame}{First order arithmetic}
Prove 
$$(x+S0)=SS0 \leftrightarrow x=S0$$
from \textbf{Theorem A} and \textbf{Theorem B}: 
\hspace*{-0.3in}
\begin{tabular}{|lll|}
\hline
$\{ \mathrm{Ax \hspace{2pt}}2,4,5  \}$ & (1) $(x+S0)=SS0 \rightarrow x=S0$ & \textbf{Theorem A} \\
$\{ \mathrm{Ax \hspace{2pt}} 4, 5\}$ & (2) $x=S0 \rightarrow (x+S0) = SS0$ & \textbf{Theorem B} \\
$\{ \mathrm{Ax \hspace{2pt}}2,4,5  \}$ & (3) $(x+S0)=SS0 \leftrightarrow x=S0$ & 1 2 Law of Biconditionals \\
\hline
\end{tabular}

\end{frame}

\begin{frame}{First order arithmetic}
Prove $(\forall x)(x \cdot (x+S0) = x \cdot x + x)$ in first order arithmetic.
\hspace*{-0.3in}
\begin{tabular}{|lll|}
\hline
$\{\mathrm{Axiom \hspace{2pt}} 7 \}$ & (1) $(\forall y)(x \cdot Sy = (x \cdot y) + x$ & Axiom 7 US \\
$\{\mathrm{Axiom \hspace{2pt}} 7 \}$ & (2) $x \cdot Sx = (x \cdot x) + x$ & 1 US \\
$\{\mathrm{Axiom \hspace{2pt}} 5\}$ & (3) $(\forall y)(x + Sy = S(x+y))$ & Axiom 5 US \\
$\{\mathrm{Axiom \hspace{2pt}} 5\}$ & (4) $x+S0=S(x+0)$ & 3 US \\
$\{\mathrm{Axiom \hspace{2pt}} 4\}$ & (5) $x+0=x$ & Axiom 4 \\
$\{\mathrm{Axiom \hspace{2pt}} 4,5\}$ & (6) $x+S0=Sx$ & 4 5 Identity Law \\
$\{\mathrm{Axiom \hspace{2pt}} 4,5,7\}$ & (7) $x \cdot (x+S0)=(x \cdot x)+x$ & 2 6 Identity Law \\
$\{\mathrm{Axiom \hspace{2pt}} 4,5,7\}$ & (8) $(\forall x)(x \cdot (x+S0)=(x \cdot x)+x)$ & 7 UG \\
\hline
%$\{\mathrm{Axiom \hspace{2pt}} 7 \}$ & (3) $x \cdot S0 = (x \cdot 0) + x$ & 1 US \\
%$\{\mathrm{Axiom \hspace{2pt}} 6 \}$ & (4) $x \cdot 0 = 0$ & Axiom 6 US \\
%$\{\mathrm{Axiom \hspace{2pt}} 6, 7 \}$ & (5) $x \cdot S0 = 0+x$ & 3 4 Identity Law \\
%$\{\mathrm{Axiom \hspace{2pt}} 4\}$ & (6) $x+0=x$ & Axiom 4 US \\
%$\{\mathrm{Axiom \hspace{2pt}} 4,6,7\}$ & (7) $x \cdot S0 = x$ & 5 6 Identity Law \\
\end{tabular}

\end{frame}


\end{document}
