Styles of Mathematical Proofs Abbreviations “Direct proof” – based

Abbreviations
•  RTP: Requried To Prove (statement of theorem, but in such a
way that you do not get confused and assume it is true)
•  PROOF: Marks the beginning of the proof
•  QED: “Quod Eram Demonstratum” (“What had to be
showed”). Marks the end of a proof
•  =def A definition of a notation. It can be used left to right to
expand the definition, or right to left to replace it. Used like an
equivalence.
In the following, we will use the following predicate definitions
Even(n) or n even =def
integer k. n=2k
Styles of Mathematical Proofs
(and their connection to formal logic
we studied)
Odd(n) or n odd =def integer k. n=2k +1
Divides(m,n) or m | n =def integer z. n = z * m
Prime(n) or n prime =def
integer n /\ n>1 /\
1
© Borgida/Rosen 2016
“Direct proof” – based on
(k=1 \/ k=n))
2
© Borgida/Rosen 2016
Notes
Intro
RTP x. Integer(x)
( Even(x)
Even(x*x) )
Proof
1. [assume n is arbitrary integer] for
Intro
2.
[assume n is even]
for
Intro
3.
n=2k
for some special k (by defn of "even")
4.
n*n=2k * 2k = 2 (2*k*k)
(by algebra from 3)
5.
n*n is even
(by denf of "even", from 4)
6.
n even
n*n even
(by Intro from 2,5)
7. n integer
(n even
n*n even) (by Inro from 1,6
QED
NOTE 1 : the desired theorem was really of the form
x.
Integer(x)
(P(x) Q(x)), and we started the proof with
[assume n is arbitrary integer] ending with Q(n). We left out
8.
x. Integer(x)
( x even
(x*x) even) U.G. 1,7
We will do so for the rest of the course
© Borgida/Rosen 2016
integer k. (k divides n
NOTE 2: One often merges the two conditions: Integer(n) and
Even(n) into
n. (Integer(n)
Even(n) )
Even(n*n) which is
logically equivalent to
x.Integer(x)
(Even(x)
Even(x)).
The price is that we would need to simplify (eliminate the AND). In
addition we had to use an
Intro at the end.
The above two extra steps in logical proofs will be skipped (outside
Chapter 1.1-1.6) by proving instead something like
Integer(n), Even(n) |- Even(n*n)
and then appealing to the "Deduction Theorem”
IF one can prove A1,...,An |- B
THEN one has proven |- (A1 /\ ... /\ An)
B
This avoids the need for assumptions (they become "given") and
Inro, as well as simplification / AND-elimination
We will do this all the time in the rest of the course, but not on
exams in questions dealing with Chapter 1
3
© Borgida/Rosen 2016
4
“Indirect Proof”
‘To prove P Q, prove instead the logically equivalent ¬Q
(called the contrapositive) Or, switching to entailment:
‘To prove P |- Q, prove instead the equivalent ¬ Q |- ¬ P’
“Indirect Proof”
¬P’
Try proving the contrapositive:
RTP If ¬(n is even) then ¬(n*n is even)
= RTP IF (n is odd) THEN (n*n is odd)
1.  let n be arbitrary odd integer
2.  n=2k+1 for some integer k (from 1 by defn of odd)
3. n*n = (2k+1)(2k+1) (from 2 by substitution of
equals for equals)
4.
= 2k(2k+1) + 1(2k+1)
(algebra)
5.
= 2[k(2k+1) +k] + 1
(algebra)
6.  n*n is odd
from 5 since k is an integer, and
defn of odd)
e.g. RTP If (n*n is even) then (n is even)
/* try this as a direct proof: */
let n be arbitrary integer
1. n*n= 2k for some integer k
2. n = sqrt(2k)
3 ??? /* stuck */
QED
5
© Borgida/Rosen 2016
“Indirect Proof”
“Proof by Contradiction” – based on ¬-Intro
e.g., Let P =def the set of all primes.
RTP: P is infinite
Proof:
1 [Assume set P is finite]
for ¬INTRO
so can enumerate its n elements: P= {p1,...,pn}
2 let b=p1 × p2 × ... × pn + 1
3 then b is not divisible by any of the values in P
(they all leave remainder 1)
4 so b must be a prime itself
5 so b belongs to P
by def of P
6 but b is at least one greater than all elements in P (line 2)
7 so b > b
(from 5,6)
8 contradiction/false
¬(P is finite) (since assumption led to false)
P is infinte by def of "infinite"
The above proof would normally be shortened to
1. let n be an arbitrary odd integer
2. n=2k+1 for some integer k ( by defn of odd)
3. n*n = (2k+1)(2k+1)
4.
= 2k(2k+1) + 1(2k+1)
(algebra)
5.
= 2[k(2k+1) +k] + 1
(algebra)
6. n*n is odd
(defn of odd)
QED
because we do not refer to a line number when it is the immediately
preceding one
Excercise: try to prove IF n3 +5 is odd THEN n is even
© Borgida/Rosen 2016
6
© Borgida/Rosen 2016
7
© Borgida/Rosen 2016
8
“Proof by Cases” – based on \/-Elim
“Proof by Cases” – cont’d
“To prove p1 v ... v pk |- q , show p1 |- q, ... , pk |- q”
Definition: consecutive(x,y) =def y=x+1
RTP IF {integer(x) /\ integer(y) /\ consecutive(x,y)} THEN odd(x+y)
Proof
let x be an arbitrary integer
0. x is even
x is odd (to be totally formal, need a lemma for this)
(Case (a):)
1. suppose x is even
2. x=2k
for some int k (by def of even)
3. y = x+1 because consecutive(x,y)
= 2k+1 from 2
4. x+y = 2k+(2k+1) from 2 & 3
= 2*(k+k)+1 algebra
5. odd(x+y)
by def of odd
RTP IF {integer(x) /\ integer(y) /\ consecutive(x,y)} THEN odd(x+y)
let x be an arbitrary integer
0.
“Proof by Cases” – another eg.
10
© Borgida/Rosen 2016
“Existential proofs” based on E.G.
To prove theorems of the form x.P(x)
RTP every squared integer ends in 0, or 1,or 4, or 5,or 6, or 9
(shortened to "ends in 0,1,4,5,6,9”)
1. Let n be an arbitrary integer
2. Every integer, including n, ends in 0 or 1 or 2 or 3 ... or 9 /*lemma*/
= Every integer n can be written as 10 m + d for d in {0,1,2..,9}
3(0). [case 0: n ends in 0]
n=10k+0 for some integer k
n*n=100k*k
algebra
n*n ends in 0
n*n ends in 0,1,4,5,6 by OR-intro
3(1) [case 1: n ends in 1]
n=10k+1
n*n=100k*k + 20k + 1
algebra
ends in 1
n*n ends in 0,1,4,5,6 by OR-intro
3(2) [case 2: n ends in 2]
n=10k+2
n*n = 100k*k + 40k + 4
algebra
n ends in 4
n*n ends in 0,1,4,5,6 by OR-intro
...
n*n ends in 0,1,4,5,6,9 by case analysis from 2,3(0),3(1),...
© Borgida/Rosen 2016
x is odd
(Case (b))
6. suppose x is odd
7. x=2m+1 for some int m
( by def of odd )
8. y = x+1 because consecutive(x,y)
= 2m+1+1
from 7
= 2m+2
algebra
9 x+y =
= 2m+1 + 2m+2 from 7 , 8
= 2(m+m+1) + 1 algebra
10 odd(x+y) by def of odd( )
11 odd(x+y)
by case analysis from 0,case a, case b
QED
9
© Borgida/Rosen 2016
x is even
(1)  CONSTRUCTIVE: find specific value c such that P(c)
(eg1) RTP
integers w,x,y,z w3 +x3 + y3 =z3
Proof: verify that w=3, x=4, y=5, and z= 6, have this property
11
© Borgida/Rosen 2016
12
“Existential proofs” based on E.G.
(2) NON-CONSTRUCTIVE: there must be a value but we
cannot figure out what it is. Often by contradiction somewhere
(eg2) RTP either 107632+ 5 or 107632 + 6 do not have integer square
roots (are not "perfect squares")
w. w {107632+ 5, 107632+6}
¬PerfectSquare(w)
Lemma If sqrt(n)=a, sqrt(n+1)=b, both a and b integers then
a=0, b=1, and hence n=0, n+1=1.
Proof of lemma :
if n=a*a, n+1=b*b then a*a + 1 = b*b
therefore 0<= a <b,
so b=a+k for k>=1
so we have b*b = (a+k)(a+k) = a*a + 2ak + k*k
= (a*a)+1 by hypothesis
2ak + k*k = 1 where a>=0, k>=1
only integer solution is a=0,k=1; so a=0, b=1 as claimed
By lemma, if both 107632+ 5, 107632+6 are perfect squares, then =
0,1. Obvious contradiction.
© Borgida/Rosen 2016
MATHEMATICIANS hunt elephants by going to Africa, throwing
out everything that is not an elephant, and catching one of whatever
is left.
EXPERIENCED MATHEMATICIANS will attempt to prove the
existence of at least one unique elephant before proceeding to step 1
as a subordinate exercise.
PROFESSORS OF MATHEMATICS will prove the existence of at
least one unique elephant and then leave the detection and capture of
an actual elephant as an exercise for their graduate students.
13
COMPUTER SCIENTISTS hunt elephants by Algorithm A:
1. Go to Africa.
2. Start at the Cape of Good Hope.
3. Work northward in an orderly manner, traversing the
continent alternately east and west.
4. During each traverse pass,
a. Catch each animal seen.
b. Compare each animal caught to a known elephant.
c. Stop when a match is detected.
EXPERIENCED COMPUTER PROGRAMMERS modify
Algorithm A by placing a known elephant in Cairo to ensure that the
algorithm will terminate.
ASSEMBLY LANGUAGE PROGRAMMERS prefer to execute
Algorithm A on their hands and knees.
© Borgida/Rosen 2016
15
© Borgida/Rosen 2016
14