\documentclass{article}
\input{preamble.tex}
\usepackage{url}
\title{Day 6}
\date{Tuesday May 29, 2012}
\newcommand{\df}{\textbf}
  \def\Display{\@empty}
\newcommand{\Hide}[2]{\ifx \Display\undefined \strut \\ \vspace{#1} \\ \strut  \else {\color{blue} #2} \fi  }
\begin{document}
	\maketitle
	
	\section{Basic Proofs}
	
	We continue our look at basic proofs. We will do a few examples of different methods of proving. 
	
	\subsection{Proof Techniques}
	
	Recall that so far in class we have made two main distinctions: indirect and direct proofs. We've been using the ``law of the excluded middle'' frequently too. Now, we will never make explicit mention to this. 
	
	But, we still make a distinction between direct and indirect proofs. Direct proofs have the following characteristics:
	\begin{itemize}
		\item If you are proving an implication, you assume the hypotheses and prove the conclusion. 
		\item If you are proving a universal statement, you take an arbitrary element in the domain of discourse, and prove the statement for that element.
		\item If you are proving an existential statement, you prove a the statement for a specific element of the domain of discourse. 
	\end{itemize}

	Often, direct proofs are hard to do, and it's much easier to do indirect methods. There are two main indirect methods. 
	\begin{itemize}
		\item Proof by Contraposition: If you are proving an implication, assume the negation of the conclusion and prove the negation of the hypotheses. 
		\item Proof by Contradiction: You assume the negation of the statement you want to show, and derive a contradiction. 
	\end{itemize}
	\begin{question}
		I claim that any proof by contraposition can be rephrased into a proof by contradiction; why?
	\end{question}
	\begin{ans}
		\Hide{4cm}{
			Well, say the statement is $A\to B$. You begin with assuming $A$, and you want to prove $B$. By contradiction, you assume $\neg B$ and then aim for a contradiction.
			
			Compare this with how you would do a proof by contraposition. You would assume $\neg B$, and aim for $\neg A$. 
			
			If you could prove $\neg A$ just from $\neg B$, then that would also yield a contradiction in the proof by contradiction, since you are assuming $A$.
			
			So, in a matter of speaking, you might as well do a proof by contradiction if you are going to do a proof by contraposition. This is actually many proofs by contraposition are found; you begin with a proof by contradiction, and then after you are done you realize you never use the assumption of $A$, so the proof is rewritten. 
		}
	\end{ans}
	
	\subsubsection{Direct Proof Examples}
	\begin{question}
		Write a formula $\psi(x,y)$ such that for a given $n$ and $m$ integers, $\psi(n,m)$ is true if and only if $n$ divides $m$.
	\end{question}
	\begin{ans}
		\Hide{1cm}{
			\[	
				\psi(x,y) := \E z\in \Z \stt m = z\cdot n
			\]

		}
	\end{ans}
	
	\begin{eg}
		\[
			\E m\in \Z \st \A n\in\Z \stt m\mbox{ divides }n
		\]
	\end{eg}
	\begin{proof}
		\Hide{2cm}{
			Let $m = 1$. Then let $n$ be an arbitrary integer. Well, 
			\[
				n = 1\cdot n = m\cdot n
			\]
			So $1$ divides $n$.
		}
	\end{proof}

	\begin{eg}
		\[
			\A n\in \Z \st \A m\in \Z \stt (n\mbox{ divides } m) \to \left(\A z\in \Z \stt (z\mbox{ divides } n) \to (z\mbox{ divides } m) \right)
		\]
	\end{eg}
	\begin{proof}
		\Hide{2cm}{
			Let $n$ and $m$ be arbitrary integers, where $n$ divides $m$. Let $z$ be an arbitrary integer where $z$ divides $n$.
			
			As $n$ divides $m$, we can find an integer $a$ such that $m = a\cdot n$. Similarly, we can find $b$ such that $n = b\cdot z$ as $z$ divides $n$. 
			
			Doing a substitution, we see $m = a\cdot (b\cdot z)$, or
			\[
				m = (ab)\cdot z
			\]
			So $z$ divides $m$. 
		}
	\end{proof}




	\begin{question}
		Write a formula $\phi(x)$ such that for a given integer $n$, $\phi(n)$ is true if and only if $n$ is an even number.
	\end{question}
	\begin{ans}
		\Hide{1cm}{
			
			\[
				\phi(x) := \E m\in\Z \stt x = 2\cdot m
			\]
		}
	\end{ans}
	
	\begin{eg}
		\[
			\A n\in\Z \stt n(n+1)\mbox{ is even}
		\]
		\begin{proof}
			\Hide{2cm}{
				Let $n$ be an arbitrary natural number. We can do cases on whether $n$ itself is even.
				
				Case 1: $n$ is even. 
				
				Then $n(n+1)$ is even, since an even times an odd is even. Or, just using the definition of even, since $n$ is even we can find an $m$ such that $n=2m$. Thus, $n(n+1) = 2(m(n+1))$, which is clearly even.
				
				Case 2: $n$ is odd
				
				Then $n+1$ is even, and so $n(n+1)$ is even since an even times an odd is even. Or, just using the definition, since $n+1$ is even we can find $m$ such that $n+1 = 2m$. thus $n(n+1) = 2(mn)$, which is clearly even.
			}
		\end{proof}
	\end{eg}
	
	\subsubsection{Contradiction Examples}
	
	\begin{question}
		How would you define $\phi(x)$ to be such that for any real number $y$, if $y$ is rational then $\phi(y)$ holds.
	\end{question}
	\begin{ans}
		\Hide{1cm}{
		\[
			\E m \in \Z \st \E n\in \Z \stt (m\neq 0) \oand \left(\frac{n}{m} = x\right)
		\]
		}
	\end{ans}

	\begin{eg}
		\[
			\E y\in \R \stt \neg(y\mbox{ is rational})
		\]
	\end{eg}
	\begin{proof}
		More specifically, we will prove $\sqrt{2}$ is irrational. 
		
		\Hide{4cm}{
			For contradiction, suppose that $\sqrt{2}$ was rational. Then we can take witnesses $m$ and $n$ integers, $m\neq 0$ such that $\frac{n}{m} = \sqrt{2}$. Multiplying both sides by $m$ and squaring both sides, we have:
			\[
				n^2 = 2 m^2
			\]
			
			Without loss of generality, we can assume that $m$ and $n$ have no common factors, ie. we wrote $\sqrt{2}$ as a reduced fraction. Note that $n^2$ is even. By a homework problem, we know that $n$ is also even. By the definition of even, we can find a $n'$ such that $n=2n'$. Therefore,
			\[
				(2n')^2 = 2m^2
			\]
			ie. $4(n')^2 = 2m^2$. Dividing both sides by $2$, we have
			\[
				2(n')^2 = m^2
			\]
			But, then $m$ is also divisible by $2$. So, $m$ and $n$ are both divisble by $2$, which contradicts $\frac{n}{m}$ being a fully reduced fraction.
		}
	\end{proof}


	
	\subsubsection{Contrapositive Examples}
	
	We have already seen two:
	\begin{itemize}
		\item $\A x,y\in\R \stt (x \geq y) \to \left(\sqrt{x} \geq \sqrt{y}\right)$
		\item $\A n\in \Z \stt n^2\mbox{ is even} \to n\mbox{ is even}$
	\end{itemize}
	
	Proofs by contrapositive are useful when the negation of the conclusion is ``easier to work with'' than the hypotheses themselves. For instance
	\begin{eg}
		\[
			\A n,m\in \N \stt (n+1 \neq m+1) \to (n\neq m)
		\]
	\end{eg}
	\begin{proof}
		\Hide{2cm}{
			Notice, the assumption $n+1 \neq m+1$ is odd to work with, because we're not used to doing algebra on non-equalities. 
			
			First, we take $n,m$ in the naturals arbitrary, and then we proceed by contraposition. As a clue to our reader, this is what I would say:
			
			For sake of proving the contrapositive, assume $n=m$ and we aim to prove that $n+1 = m+1$. 
			
			This statement tells the reader your assumption, and your goal.
			
			Now, when we have $n=m$, we can just add $1$ to both sides and be done!
		}
	\end{proof}

	


		
	
	\subsubsection{Exhaustion Examples}
	
	A \df{proof by exhaustion} is a proof by cases. It's also called a \df{brute force} proof. The idea is: extra assumptions are good. The easiest way to get extra assumptions is the partition all possibilities into different cases which give us more specific information. We've already seen some proofs by cases.
	
	\begin{eg}
		The Triangle Inequality:
		\[
			\A x,y\in\R \stt |x + y| \leq |x| + |y|
		\]
	\end{eg}
	\begin{proof}
		We did cases on where $x+y \geq 0$ and $x+y < 0$. 
	\end{proof}


		
		\begin{eg}
			\[\E x \st \E y\st \neg (x\mbox{ is rational}) \oand \neg (y\mbox{ is rational}) \oand (x^y\mbox{ is rational})\]
		\end{eg}
		\begin{proof}
			\Hide{3in}{
			Here we do a proof by cases. First, note above we proved that $\sqrt{2}$ is irrational. Therefore, consider the following:
			
			Case 1: $\sqrt{2}^{\sqrt{2}}$ is rational
			
			Then we are done, as $x=y=\sqrt{2}$ satified all the above.
			
			Case 2: $\sqrt{2}^{\sqrt{2}}$ is irrational
			
			Then consider $x=\sqrt{2}^{\sqrt{2}}$ and $y=\sqrt{2}$. Then 
			\[
				x^y = \left(\sqrt{2}^{\sqrt{2}}\right)^{\sqrt{2}} = \sqrt{2}^{\sqrt{2}\cdot \sqrt{2}} = \sqrt{2}^2 = 2
			\]
			As $2$ is rational, we are done. 
			}
		\end{proof}


	
	
	\section{Induction}
	
	Next we segway into another way to write a proof about natural numbers. 
	
	Consider a row of dominoes all upright. Let's postulate that if the $i$th domino falls it will cause the $i+1$th domino to fall. If you know the 1st domino falls, what can you say about the dominoes?
	
	\begin{dfn}[Principle of Mathematical Induction]
		Let $\phi(x)$ be a formula. If $\phi(0)$ is true, and $\phi(n) \to \phi(n+1)$ is true, then $\phi(m)$ is true for any natural number $m$. In particular, $\A m\in\N \stt \phi(m)$ is true.
	\end{dfn}
	
	\begin{question}
		Think about the domino metaphor above. Do you think induction works for the integers, rationals, and reals.
	\end{question}
	\begin{ans}
		\Hide{1cm}{
			No; the integers aren't like the dominoes because there is no first domino. The reals and the rationals also don't have a first, but even more disappointingly, they don't have the ``one after another'' property either, which is another hindrance to knowing they all get knocked down. 	
		}
	\end{ans}

	
	\begin{rmk}
		I am very particular about variables, as I said. This makes the form of an induction proof very important to me. Pay attention to my form, and try to emulate it.
	\end{rmk}
	
	\begin{thm}
		\[\A n\in \N \stt \left(\sum_{i=0}^n 2^i\right) = 2^{n+1} - 1\]
	\end{thm}

	\begin{proof}[Proof With Exposition]
		The first thing you want to do in an induction proof is notify the reader that they are about to read a proof by induction. Otherwise, it could be very confusing why you are doing what you are doing. It's also useful to say the variable you are inducting on.
		
		We prove this by induction on $n\in \N$. 
	
		First, we want to show that that we can knock down the first domino. This is called our \df{base case}. Sometimes, we need to do more than one, depending what we are trying to prove. We will talk more about this tomorrow.
		
		But, we need to show the above sum is true when $n=0$. When $n=0$, the summation is just $2^0$, which is $1$. The RHS is $2^1 - 1 = 1$. So the base case is true. 
		
		Now, we need to show $\A n\in \N \stt \phi(n) \to \phi(n+1)$. That is, if the $n$th domino falls, so will the $n+1$th. This is called out \df{inductive step}. 
		
		Let $n$ be a natural number, and assume that $\sum_{i=0}^n 2^i$. This assumption is called the \df{inductive hypothesis}. There are a few important things to note:
		\begin{itemize}
			\item The induction hypothesis is ``allowed'' to be the base case. For example, to see domino number 1 falls, we need to know domino number 0 knocks down domino number 1. So it's very important, since our base case $n=0$ is allowed to be the $n$ assumed in the induction hypothesis.
			\item When you think about these proofs, think about them as an iterative procedure rather than a proof. Don't think about trying to prove $\A n \in \N \stt \phi(n)$ think concretely that you are interested in $\phi(70)$ or something. The way you prove this is to prove $\phi(0)$, then prove $\phi(0) \to \phi(1)$, then $\phi(1)\to\phi(2)$, and so on. The principle of induction formalized this procedure. 
		\end{itemize}

		At this point in the proof, it's useful to say your goal. We want to prove 
		\[
			\left(\sum_{i=0}^{n+1} 2^i\right) = 2^{n+2} - 1
		\]
		
		Well, we know that 
		\[
			\left(\sum_{i=0}^{n} 2^i\right) = 2^{n+1} - 1
		\]
		
		So, notice, if we ass $2^{n+1}$ to both sides, we get
		\[
			2^{n+1} + \left(\sum_{i=0}^{n} 2^i\right) = 2^{n+1} + 2^{n+1} - 1
		\]
		Which we can rewrite as
		\[
			\left(\sum_{i=0}^{n+1} 2^i\right) = 2\cdot 2^{n+1} - 1 = 2^{n+2} - 1
		\]
		Which was what we wanted!		
		
		Now, you want to say a summary statement, concluding that we have accomplished our goal. So we might say, by induction, this statement is true for all $n$ in the natural numbers.
	\end{proof}
	
	\begin{proof}[Proof as I'd write it]
		We proceed by induction on the natural number $n$
		
		In our base case, $n=0$. Note that
		\[
			\sum_{i=0}^0 2^i = 2^0 = 1 = 2^1 - 1
		\]
		Thus the statement is true when $n=0$.
		
		For our induction hypothesis, let $n$ be a natural number, and assume that our statement is true at $n$; that is:
		\[
			\mbox{(IH)}\qquad \left(\sum_{i=0}^{n} 2^i\right) = 2^{n+1} - 1
		\]
		We would like to true that this statement is true at $n+1$; that is
		\[
			\left(\sum_{i=0}^{n+1} 2^i\right) = 2^{n+2} - 1
		\]
		
		Well, by adding $2^{n+1}$ to both sides of my induction hypothesis, we see
		\[
			2^{n+1} + \left(\sum_{i=0}^{n} 2^i\right) = 2^{n+1} + 2^{n+1} - 1
		\]
		Simplifying, 
		\[
			\left(\sum_{i=0}^{n+1} 2^i \right) = 2^{n+2} - 1
		\]
		Which was what we wanted. 

		Thus, by induction, we have proved the statement for all $n$ in the natural numbers.
	\end{proof}




	
\end{document}
