CS103
HO#7
Proof Methods
4/4/11
1
Suppose we can prove that q follows from p.
There are two ways to think about the proof:
p
s
1
...
s
n
q
Suppose p is true
s
1
...
s
n
q
p
q
Doing Real Proofs: Example
Prove:
If n is even, then n
2
is even.
That is,
Prove: Even(n)
Even(n
2
)
Problem: the formula above is not a sentence in FOL, since
n appears as a free variable.
This is better:
x (Even(x)
Even(x
2
))
but what is the domain of the quantifier?
Doing Real Proofs: Example
Prove:
If n is even, then n
2
is even.
That is,
Prove: Even(n)
Even(n
2
)
Problem: the formula above is not a sentence in FOL, since
n appears as a free variable.
What we really mean:
Prove:
x (Even(x)
Even(x
2
)), where the domain is integers
So now we need rules of inference for quantifiers.
x (P(x)
Q(x))
z (Q(z)
R(z))
x(P(x)
R(x))
Can we just use the rules we have inside the quantifiers?
x (P(x)
Q(x))
z (Q(z)
R(z))
x(P(x)
R(x))
No!
Example: Statement-reason proof
Prove:
For all integers, if n is even, then n
2
is even.
1.
Let c be an
arbitrary
integer, and
suppose Even(c).
2.
k (c = 2k)
Def. of Even, 1
3.
c
2
= 4k
2
Algebra, 2
4.
c
2
= 2m, where m = 2k
2
Algebra, 3
5.
Even(c
2
)
Def. of Even, 4
6.
x (Even(x)
Even(x
2
))
General Conditional
Proof, 1 - 5
Example: Statement-reason proof
Prove:
For all integers, if n is even, then n
2
is even.
1.
Let c be an
arbitrary
integer, and
suppose Even(c).
2.
k (c = 2k)
Def. of Even, 1
3.
c
2
= 4k
2
Algebra, 2
4.
c
2
= 2m, where m = 2k
2
Algebra, 3
5.
Even(c
2
)
Def. of Even, 4
6.
x (Even(x)
Even(x
2
))
General Conditional
Proof, 1 - 5