09-Methods of Proof
09-Methods of Proof
CS 202
Rosen section 1.5
Aaron Bloomfield
1
In this slide set…
Rules of inference for propositions
2
Proof methods in this slide set
Logical equivalences Ten proof methods in section 1.5:
via truth tables Direct proofs
via logical equivalences Indirect proofs
Set equivalences
Vacuous proofs
Trivial proofs
via membership tables Proof by contradiction
via set identities Proof by cases
via mutual subset proof Proofs of equivalence
via set builder notation and Existence proofs
logical equivalences Constructive
Rules of inference Non-constructive
for propositions Uniqueness proofs
for quantified statements Counterexamples
Induction
Weak mathematical induction
Pigeonhole principle Strong mathematical induction
Combinatorial proofs Structural induction
3
Modus Ponens
Consider (p (p→q)) → q
4
Modus Ponens example
Assume you are given the following two
statements:
p
“you are in this class”
“if you are in this class, you will get a grade” pq
q
Let p = “you are in this class”
Let q = “you will get a grade”
6
Modus Tollens example
Assume you are given the following two
statements:
q
“you will not get a grade”
“if you are in this class, you will get a grade” pq
p
Let p = “you are in this class”
Let q = “you will get a grade”
8
Addition & Simplification
Addition: If you know
that p is true, then p q p
will ALWAYS be true pq
Simplification: If p q is
true, then p will pq
ALWAYS be true p
9
Example of proof
Example 6 of Rosen, section 1.5
We have the hypotheses:
“It is not sunny this afternoon and it ¬p q
p yesterday””
is colder than yesterday
q “We will go swimming only if it is r→p
sunny
sunny””
r
“If we do not go swimming,
swimming, then we ¬r → s
s trip””
will take a canoe trip
t “If we take a canoe trip,
trip, then we will s→t
be home by sunset”
sunset”
Does this imply that ““we
we will be t
sunset”?
home by sunset ”?
10
Example of proof
1. ¬p q 1st hypothesis
2. ¬p Simplification using step 1
3. r→p 2nd hypothesis
4. ¬r Modus tollens using steps 2 & 3
5. ¬r → s 3rd hypothesis
6. s Modus ponens using steps 4 & 5
7. s→t 4th hypothesis
8. t Modus ponens using steps 6 & 7
p q
pq pq pq
p q p11
So what did we show?
We showed that:
[(¬p q) (r → p) (¬r → s) (s → t)] → t
That when the 4 hypotheses are true, then the
implication is true
In other words, we showed the above is a tautology!
16
Fallacy of
Modus Badus affirming the
conclusion
Consider the following: q q
pq q p
p p
Is this true?
p q p→q q(p→q)) (q(p→q)) → p
T T T T T
Not a
valid
T F F F T
rule!
F T T T F
F F T F T
17
Modus Badus example
Assume you are given the following two
statements: q
“you will get a grade”
pq
“if you are in this class, you will get a grade”
p
21
Just in time for Valentine’s Day…
22
Bittersweets: Dejected sayings
I MISS MY EX ASYLUM BOUND
PEAKED AT 17 DIGNITY FREE
MAIL ORDER PROG FAN
TABLE FOR 1 STATIC CLING
I CRY ON Q WE HAD PLANS
U C MY BLOG? XANADU 2NITE
REJECT PILE SETTLE 4LESS
PILLOW HUGGIN NOT AGAIN
23
Bittersweets: Dysfunctional sayings
RUMORS TRUE PAROLE IS UP!
PRENUP OKAY? BE MY YOKO
HE CAN LISTEN U+ME=GRIEF
GAME ON TV I WANT HALF
CALL A 900# RETURN 2 PIT
P.S. I LUV ME NOT MY MOMMY
DO MY DISHES BE MY PRISON
UWATCH CMT C THAT DOOR?
24
What we have shown
Rules of inference for propositions
25
Rules of inference for the
universal quantifier
Assume that we know that x P(x) is true
Then we can conclude that P(c) is true
Here c stands for some specific constant
This is called “universal instantiation”
28
Example of proof
1. x (R(x)→T(x)) 3rd hypothesis
2. R(Linda) → T(Linda) Universal instantiation using step 1
3. R(Linda) 2nd hypothesis
4. T(Linda) Modes ponens using steps 2 & 3
5. C(Linda) 1st hypothesis
6. C(Linda) T(Linda) Conjunction using steps 4 & 5
7. x (C(x)T(x)) Existential generalization using
step 6
32
Quick survey
I feel I understand rules of inference
for quantified statements…
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
33
Proof methods
We will discuss ten proof methods:
1. Direct proofs
2. Indirect proofs
3. Vacuous proofs
4. Trivial proofs
5. Proof by contradiction
6. Proof by cases
7. Proofs of equivalence
8. Existence proofs
9. Uniqueness proofs
10. Counterexamples
34
Direct proofs
Consider an implication: p→q
If p is false, then the implication is always true
Thus, show that if p is true, then q is true
35
Direct proof example
Rosen, section 1.5, question 20
Show that the square of an even number is an
even number
Rephrased: if n is even, then n2 is even
Assume n is even
Thus, n = 2k, for some k (definition of even
numbers)
n2 = (2k)2 = 4k2 = 2(2k2)
As n2 is 2 times an integer, n2 is thus even
36
Quick survey
These quick surveys are really
getting on my nerves…
a) They’re great - keep ‘em coming!
b) They’re fine
c) A bit tedious
d) Enough already! Stop!
37
Indirect proofs
Consider an implication: p→q
It’s contrapositive is ¬q→¬p
Is logically equivalent to the original implication!
If the antecedent (¬q) is false, then the
contrapositive is always true
Thus, show that if ¬q is true, then ¬p is true
41
Example of which to use
Rosen, section 1.5, question 21
Prove that if n is an integer and n3+5 is odd, then n is
even
44
Proof by contradiction
Given a statement p, assume it is false
Assume ¬p
45
Proof by contradiction example 1
Theorem (by Euclid): There are infinitely many
prime numbers.
50
Quick survey
I feel I understand proof by
contradiction…
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
51
Vacuous proofs
Consider an implication: p→q
53
Trivial proofs
Consider an implication: p→q
55
Proof by cases
Show a statement is true by showing all
possible cases are true
58
Quick survey
I feel I understand trivial and vacuous
proofs and proof by cases…
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
59
End of prepared slides
60
Proofs of equivalences
This is showing the definition of a bi-
conditional
61
Proofs of equivalence example
Rosen, section 1.5, question 40
Show that m2=n2 if and only if m=n or m=-n
Rephrased: (m2=n2) ↔ [(m=n)(m=-n)]
Need to prove two parts:
[(m=n)(m=-n)] → (m2=n2)
Proof by cases!
Case 1: (m=n) → (m2=n2)
(m)2 = m2, and (n)2 = n2, so this case is proven
Case 2: (m=-n) → (m2=n2)
(m)2 = m2, and (-n)2 = n2, so this case is proven
(m2=n2) → [(m=n)(m=-n)]
Subtract n2 from both sides to get m2-n2=0
Factor to get (m+n)(m-n) = 0
Since that equals zero, one of the factors must be zero
Thus, either m+n=0 (which means m=n)
Or m-n=0 (which means m=-n) 62
Existence proofs
Given a statement: x P(x)
We only have to show that a P(c) exists
for some value of c
Two types:
Constructive: Find a specific value of c for
which P(c) exists
Nonconstructive: Show that such a c exists,
but don’t actually find it
Assume it does not exist, and show a contradiction
63
Constructive existence proof
example
Show that a square exists that is the sum
of two other squares
Proof: 32 + 42 = 52
64
Non-constructive existence proof
example
Rosen, section 1.5, question 50
Prove that either 2*10500+15 or 2*10500+16 is not a
perfect square
A perfect square is a square of an integer
Rephrased: Show that a non-perfect square exists in the set
{2*10500+15, 2*10500+16}
Existence
We can manipulate 5x+3=a to yield x=(a-3)/5
Is this constructive or non-constructive?
Uniqueness
If there are two such numbers, then they would fulfill
the following: a = 5x+3 = 5y+3
We can manipulate this to yield that x = y
Thus, the one solution is unique! 67
Counterexamples
Given a universally quantified statement, find a single
example which it is not true
68
Mistakes in proofs
Modus Badus
Fallacy of denying the hypothesis
Fallacy of affirming the conclusion
Proving a universal by example
You can only prove an existential by example!
69
Quick survey
I felt I understood the material in this
slide set…
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
70
Quick survey
The pace of the lecture for this
slide set was…
a) Fast
b) About right
c) A little slow
d) Too slow
71
Quick survey
How interesting was the material in
this slide set? Be honest!
a) Wow! That was SOOOOOO cool!
b) Somewhat interesting
c) Rather borting
d) Zzzzzzzzzzz
72