08 Introduction To Proofs PDF
08 Introduction To Proofs PDF
Niloufar Shafiei
proofs
Proofs are essential in mathematics and computer
science.
Some applications of proof methods
Proving mathematical theorems
Designing algorithms and proving they meet their
specifications
Verifying computer programs
Establishing operating systems are secure
Making inferences in artificial intelligence
Showing system specifications are consistent
…
1
Terminology
Theorem:
A statement that can be shown to be true.
Proposition:
A less important theorem.
Lemma:
A less important theorem that is helpful in the proof of
other results.
2
Terminology
Proof:
A convincing explanation of why the theorem is true.
Axiom:
A statement which is assumed to be true.
Corollary:
A theorem that can be established easily from a
theorem that has been proven.
3
Theorem (example)
Many theorems assert that a property holds for all elements in
a domain.
Example:
If x>y, where x and y are positive real numbers, then x2 > y2.
For all positive real numbers x and y, if x>y, then x2 > y2.
4
Theorem
How to prove x (R(x) S(x))?
P(c)
Universal generalization (review): x P(x)
5
Theorem
How to prove x (R(x) S(x))?
p q pq
pq is true unless p is true and
T T T
q is false.
T F F
F T T
To show pq is true, we need to
F F T
show that if p is true, then q is true.
6
Direct proof
How to prove x (R(x) S(x))?
Let c be any element of the domain.
Assume R(c) is true.
These steps are constructed using
• Rules of inference
• Axioms
• Lemmas
• Definitions
• Proven theorems
•…
S(c) must be true.
Direct proof
7
Direct proof (example)
Theorem:
If n is an odd integer, then n2 is odd.
Proof:
Assume n is an odd integer.
Definition:
By definition, integer k,
n is odd integer,
such that n = 2k + 1 if integer k
n2 = (2k + 1)2 such that
n2 = 4k2 + 4k + 1 = 2 (2k2 + 2k) + 1 n=2k+1.
Let m = 2k2 + 2k.
n2 = 2m + 1
So, by definition, n2 is odd.
8
Direct proof (example)
Theorem:
If n and m are both perfect squares then nm is also a
perfect square.
Proof: Definition:
Assume n and m are perfect squares. An integer a is
perfect square if
By definition, integers s and t
2 2
integer b such
such that n=s and m=t . that a=b2.
nm = s2 t2 = (st)2
Let k = st.
nm = k2
So, by definition, nm is a perfect square.
9
Proof techniques
Direct proof leads from the hypothesis of
a theorem to the conclusion.
10
Proof by contraposition
pq ¬q¬p
Conditional Its
statement contrapositive
11
Proof by contraposition
Proof by contraposition of pq:
Assume ¬q is true.
These steps are constructed using
• Rules of inference
• Axioms
• Lemmas
• Definitions
• Proven theorems
•…
¬p must be true.
Proof by contraposition
12
Proof by contraposition (example)
Theorem:
If n is an integer and 3n+2 is odd, then n is odd.
Proof (by contraposition):
Assume n is even.
integer k, such that n = 2k
3n+2 = 3(2k)+2 = 2(3k+1)
Let m = 3k+1.
3n+2 = 2m
So, 3n+2 is even.
By contraposition, if 3n+2 is odd, then n is odd.
13
Proof by contraposition (example)
Theorem:
If n =ab, where a and b are positive integers, then
b n or a n.
Proof (by contraposition):
Assume b > n and a > n.
ab > (n) . (n) = n
So, n ab.
By contraposition, if n=ab, then b n or a
n.
14
Example
Assume P(n) is “if n > 0, then n2 > 0”.
Show that P(0) is true.
Proof:
P(0) is “if 0>0, then 02 > 0”.
Since the hypothesis of P(0) is false, then P(0) is
true.
Vacuous proof:
pq is true when p is false.
15
Example
Assume P(n) is “if ab > 0, then (ab)n > 0”.
Show that P(0) is true.
Proof:
P(0) is “if ab>0, then (ab)0 > 0”.
(ab)0 = 1 > 0
Since the conclusion of P(0) is true, P(0) is true.
Trivial proof:
pq is true when q is true.
16
Example
Theorem:
The sum of two rational numbers is rational.
Proof:
Assume r and s are rational.
Definition:
p,q r = p/q q 0 The real number r
t,u s = t/u u 0 is rational if r=p/q,
r+s = p/q + t/u = (pu+tq) / (qu) integers p and q
Since q 0 and u 0 then qu 0 . that q.
Let m=(pu+tq) and n=qu where n 0 .
So, r+s = m/n, where n 0 .
So, r+s is rational.
17
Example
Theorem:
If n is an integer and n2 is even, then n is even.
Direct proof or proof by contraposition?
Proof (direct proof):
Assume n2 is an even integer.
n2 = 2k (k is integer)
n = ± 2k
???
dead end!
18
Example
Theorem:
If n is an integer and n2 is even, then n is even.
Direct proof or proof by contraposition?
Proof (proof by contraposition):
Assume n is an odd integer.
n = 2k+1 (k is integer)
n2 = (2k+1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1
Assume integer m = 2k2 + 2k.
n2 = 2m + 1
So, n2 is odd.
By contraposition, If n2 is even, then n is even.
19
Proof by contradiction
How to prove a proposition by contradiction?
20
Proof by contradiction
Proof by contradiction of pq:
23
Proof by contradiction (example)
Prove if n2 is odd then n is odd.
Proof (proof by contradiction):
Assume n2 is odd and n is even.
integer k n = 2k
n2 = 4k2 = 2(2k2)
Let m = 2k2.
n2 = 2m
So, n2 is even.
Let p is “n2 is odd ”.
p ¬p is a contradiction.
By contradiction, if n2 is odd then n is odd.
24
Proofs of equivalences
How to prove pq?
p q pq
T T T
T F F
F T F
F F T
pq (pq)(qp)
25
Proofs of equivalences
How to prove pq?
We need to prove
pq
qp
26
Proofs of equivalences
How to prove pp1p2…pn?
pp1p2…pn
(p1p2)(p2p3)…(pn-1pn)(pnp1)
We need to prove
p1p2
p2p3
…
pn-1pn
pnp1
27
Proofs of equivalences (example)
¬p¬q is true if and only if ¬(pq) is true.
Proof:
Part1: if ¬p¬q is true then ¬(pq) is true.
¬p¬q is true.
¬p is true and ¬q is true.
p is false and q is false.
pq is false.
¬(pq) is true.
28
Proofs of equivalences (example)
¬p¬q is true if and only if ¬(pq) is true.
Proof:
Part2: if ¬(pq) is true then ¬p¬q is true.
¬(pq) is true.
pq is false.
p is false and q is false.
¬p is true and ¬q is true.
¬p¬q is true.
29
Proofs of equivalences (example)
Show these statements about integer n are
equivalent
p: n is odd.
q: n+1 is even.
r: n2 is odd.
Proof:
1. pq: if n is odd then n+1 is even. (direct proof)
n is odd. n=2k+1
n+1 = 2k+2 = 2(k+1) m=k+1
n+1 = 2m n+1 is even.
31
Proofs of equivalences (example)
Show these statements about integer n are equivalent
p: n is odd.
q: n+1 is even.
r: n2 is odd.
Proof:
2. qr: if n+1 is even then n2 is odd. (direct proof)
n+1 is even. n+1=2k
n = 2k-1
n2 = 4k2-4k+1 = 2(2k2-2k)+1 m= 2k2-2k
n2 = 2m+1 n2 is odd.
32
Proofs of equivalences (example)
Show these statements about integer n are equivalent
p: n is odd.
q: n+1 is even.
r: n2 is odd.
Proof:
3. rp: if n2 is odd then n is odd.
by previous example
33
Counterexample (review)
How to show x P(x) is false?
find a counterexample
34
Counterexample (example)
Show “every positive integer is a sum of the squares
of two integers.” is false.
Proof:
3 cannot be written as the sum of the squares of two
integers.
Because only squares not exceeding 3 are 02 = 0 and
12 = 1.
There is no way to get 3 as the sum of these squares.
35
Recommended exercises
1,3,7,9,10,11,15,17,25,27,33,39
36