\documentclass[11pt]{amsart}
\usepackage{amsmath,amsthm,amsfonts,latexsym,amssymb,amscd,xcolor}
\pagestyle{headings}
\setlength{\textwidth}{468true pt}
\setlength{\headheight}{0true pt} % needed for 12pt documents
\setlength{\oddsidemargin}{0 truept}
\setlength{\evensidemargin}{0 truept}
\setlength{\textheight}{580true pt}

\begin{document}


\noindent
{\bf Solutions to HW 5.}

\bigskip

\noindent
Addition
\[
\begin{array}{clrl}
m+0&:=m & \hphantom{X} & \textrm{(Initial Condition for $+$)}\\
m+S(n)&:=S(m+n) & & \textrm{(Recurrence Relation (or Propagation Rule) for $+$)}
\end{array}
\]

\bigskip

\noindent
Multiplication
\[
\begin{array}{clrl}
m\cdot 0&:=0 & \hphantom{X} & \textrm{(Initial Condition for $\cdot$)}\\

m\cdot S(n)&:=m\cdot n + m & & \textrm{(Recurrence Relation for $\cdot$)}

\end{array}
\]

\bigskip
\bigskip
\bigskip

  
\begin{enumerate}
\item[1.]
 Prove that $m(n+k)=(mn)+(mk)$ holds for the natural numbers.
\end{enumerate}
  

\bigskip

\color{blue}
This is a proof by induction on $k$.

(Base Case: $k=0$)
$$
\begin{array}{rlcl}
m(n+0)  &= mn  &\hphantom{AAAAA} &(\textrm{IC}, +)\\
 &= mn+0  &\hphantom{AAAAA} &(\textrm{IC}, +)\\
 &= mn+m0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
\end{array}
$$

(Inductive Step: Assume true for $k$, prove true for $S(k)$)
$$
\begin{array}{rlcl}
m(n+S(k))  &= mS(n+k)  &\hphantom{AAAAA} &(\textrm{RR}, +)\\
  &= m(n+k)+m  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
  &= (mn+mk)+m  &\hphantom{AAAAA} &(\textrm{IH})\\
  &= mn+(mk+m)  &\hphantom{AAAAA} &(\textrm{Associative Law}, +)\\
  &= mn+mS(k)  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
\end{array}
$$
\color{black}
  
\vfill

\begin{enumerate}
\item[2.]
Prove that $m(nk)=(mn)k$ holds for the natural numbers.
\end{enumerate}
  
  \bigskip
  
\color{blue}
This is a proof by induction on $k$.

(Base Case: $k=0$)
$$
\begin{array}{rlcl}
m(n0)  &= m0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
  &= 0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
  &= (mn)0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
\end{array}
$$

(Inductive Step: Assume true for $k$, prove true for $S(k)$)
$$
\begin{array}{rlcl}
m(n\cdot S(k))  &= m(nk+n)  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
  &= m(nk)+mn  &\hphantom{AAAAA} &(\textrm{Distributive Law})\\
  &= (mn)k+mn  &\hphantom{AAAAA} &(\textrm{IH})\\
  &= (mn)\cdot S(k)  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
\end{array}
$$
\color{black}

\vfill
\pagebreak

\begin{enumerate}
\item[3.]
Prove that $mn=nm$ holds for the natural numbers. (Some lemmas will be needed.) 
\end{enumerate}


\bigskip

\color{blue}
{\bf Lemma 1.} $0k=0$.
\medskip     

{\it Proof.}
This is a proof by induction on $k$.

(Base Case: $k=0$)
$$
\begin{array}{rlcl}
00  &= 0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
\end{array}
$$

(Inductive Step: Assume true for $k$, prove true for $S(k)$)
$$
\begin{array}{rlcl}
0\cdot S(k)  &= 0k+0  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
  &= 0+0 &\hphantom{AAAAA} &(\textrm{IH})\\
  &= 0  &\hphantom{AAAAA} &(\textrm{IC},+)\\
\end{array}
$$
%\color{black}
\medskip

{\bf Lemma 2.} (Right distributivity)
$(m+n)k = mk+nk$.
\medskip     

{\it Proof.}
This is a proof by induction on $k$.

(Base Case: $k=0$)
$$
\begin{array}{rlcl}
(m+n)0  &= 0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
  &= 0+0  &\hphantom{AAAAA} &(\textrm{IC},+)\\
  &= m0+n0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
\end{array}
$$

(Inductive Step: Assume true for $k$, prove true for $S(k)$)
$$
\begin{array}{rlcl}
(m+n)\cdot S(k)  &= (m+n)k+(m+n)  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
  &= (mk+nk)+(m+n) &\hphantom{AAAAA} &(\textrm{IH})\\
  &= mk+(nk+(m+n)) &\hphantom{AAAAA} &(\textrm{Associative Law},+)\\
  &= mk+((nk+m)+n)) &\hphantom{AAAAA} &(\textrm{Associative Law},+)\\
  &= mk+((m+nk)+n)) &\hphantom{AAAAA} &(\textrm{Commutative Law},+)\\
  &= mk+(m+(nk+n)) &\hphantom{AAAAA} &(\textrm{Associative Law},+)\\
  &= (mk+m)+(nk+n) &\hphantom{AAAAA} &(\textrm{Associative Law},+)\\
  &= (m\cdot S(k))+(n\cdot S(k))  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
\end{array}
$$

\medskip

\noindent
{\bf Solution to the Problem.}
  
\noindent
{\it Proof.}
We prove that $mn=nm$ by induction on $n$.

(Base Case: $n=0$)
$$
\begin{array}{rlcl}
m0  &= 0  &\hphantom{AAAAA} &(\textrm{IC}, \cdot)\\
  &= 0m  &\hphantom{AAAAA} &(\textrm{Lemma 1})\\
\end{array}
$$

(Inductive Step: Assume true for $n$, prove true for $S(n)$)
$$
\begin{array}{rlcl}
m\cdot S(n)  &= mn+m  &\hphantom{AAAAA} &(\textrm{RR}, \cdot)\\
  &= nm+m &\hphantom{AAAAA} &(\textrm{IH})\\
  &= (n+1)m  &\hphantom{AAAAA} &(\textrm{Lemma 2})\\
  &= S(n)\cdot m  &\hphantom{AAAAA} &(S(n)=n+1)\\
\end{array}
$$
\color{black}

\vfill  


\end{document}
