CSD101- Discrete Structures
(Discrete Mathematics)
Fall 2016
Lecture - 7
Introduction to
Proofs
Proofs
• Proof:
A proof is a valid argument that establishes the truth of a
mathematical statement.
• 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
• …
Terminology
• Theorem: A statement that can be shown true. Sometimes
called facts.
• Lemma: A less important theorem that is useful to prove a
theorem.
• Proof: Demonstration that a theorem is true.
• Axiom: A statement that is assumed to be true.
• Corollary: A theorem that can be proven directly from a
theorem that has been proved.
• Conjecture: A statement that is being proposed to be a true
statement.
Stating Theorems
• Theorem: If 𝑥 > 𝑦, where 𝑥 and 𝑦 are positive real numbers,
then 𝑥 2 > 𝑦 2 .
• Theorem: For all positive real numbers 𝑥 and 𝑦, if 𝑥 > 𝑦, then
𝑥2 > 𝑦2.
Theorem
• Conditional statement (review):
• p q is true unless p is true and q is false.
p q pq
T T T
T F F
F T T
F F T
Methods of Proving Theorems
Vacuous Proof
• Consider an implication: 𝑝→𝑞
• If it can be shown that 𝑝 is false, then the implication is
always true.
• By definition of an implication
• Note that you are showing that the hypothesis is false
Vacuous Proof Example
• Assume P(n) is “if n > 0, then 𝑛2 > 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:
p q is true when p is false.
Vacuous Proof Example
• If n is both odd and even then n2 = n + n
Trivial Proof
• Consider an implication: 𝑝 → 𝑞
• If it can be shown that q is true, then the implication is
always true
• By definition of an implication
• Note that you are showing that the conclusion is true
Trivial Proof Example
• Assume P(n) is “if ab > 0, then (𝑎𝑏)𝑛 > 0”. Show that P(0)
is true.
• Proof:
P(0) is “if ab >0, then (𝑎𝑏)0 > 0”.
(𝑎𝑏)0 = 1 > 0
Since the conclusion of P(0) is true, P(0) is true.
• Trivial proof:
p q is true when q is true.
Trivial Proof Example
• If n is the sum of two prime numbers, then either
n is odd or n is even.
• If you are in CSD101 then you are a student.
Direct Proof
• A direct proof of a conditional statement p → q is
constructed when the first step is the assumption that p is
true; use axioms, definitions, and previously proven
theorems, together with rules of inference, with the final
step showing that q must also be true.
• A direct proof shows that a conditional statement p → q is
true by showing that if p is true, then q must also be true,
so that the combination p true and q false never occurs.
Direct Proof
• Direct proof of p q:
• Assume p is true.
These steps are constructed using
Rules of inference
Axioms
Lemmas
Definitions
Proven theorems
…
• q must be true. Direct Proof
Direct Proof
• Odd Number:
n is odd if n=2k+1 for some k of type integer.
• Even Number:
n is even if n=2k for some k of type integer.
Direct Proof
• Theorem:
If n is an odd integer, then 𝑛2 is odd.
• Proof:
Assume n is an odd integer.
By definition, ∃ integer k,
such that n = 2k + 1
2
𝑛2 = (2k + 1)
𝑛2 = 4𝑘 2 + 4k + 1 = 2 (2𝑘 2 + 2k) + 1
Let m = 2𝑘 2 + 2k.
𝑛2 = 2m + 1
So, by definition, 𝑛2 is odd.
Direct Proof
• Theorem:
If n and m are both perfect squares then nm is also a
perfect square.
• Proof:
Assume n and m are perfect squares. Definition:
An integer a is
By definition, ∃ integers s and t perfect square if
such that n = 𝑠 2 and m = 𝑡 2 . ∃ integer b such
that a= 𝑏2 .
nm = 𝑠 2 𝑡 2 = (𝑠𝑡)2
Let k = st.
nm = 𝑘 2
So, by definition, nm is a perfect square.
Direct Proof
• Prove If n and m are odd integers then n + m is even.
Example
• Theorem:
The sum of two rational numbers is rational.
• Proof:
Assume r and s are rational.
∃ p,q r = p/q q ≠ 0 Definition:
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
that q ≠ 0.
Since q ≠ 0 and u ≠ 0 then qu ≠ 0.
Let m=(pu+tq) and n=qu where n ≠ 0.
So, r+s = m/n, where n ≠ 0.
So, r+s is rational.
Proof Techniques
• Direct proof leads from the hypothesis of a theorem to
the conclusion.
• Proofs of theorems that do not start with the hypothesis
and end with the conclusion, are called indirect proofs.
Proof By Contraposition
p q ¬q ¬p
Conditional Its
statement contrapositive
• In a proof by contraposition of p q, we take ¬q as a
hypothesis and we show that ¬p must follow.
• Thus, show that if ¬q is true, then ¬p is true
• Proof by contraposition is an indirect proof.
Proof By Contraposition
• Proof by contraposition of p q:
• Assume ¬q is true.
These steps are constructed using
Rules of inference
Axioms
Lemmas
Definitions
Proven theorems
…
• ¬p must be true. Proof by contraposition
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.
Proof By Contraposition (Example)
• Theorem:
If n = ab, where a and b are positive integers, then
b ≤ 𝑛 or a ≤ 𝑛.
• Proof (by contraposition):
• Assume b > 𝑛 and a > 𝑛.
ab > ( 𝑛) . ( 𝑛)
ab > n
So, n ≠ ab.
By contraposition, if n = ab, then b ≤ 𝑛 or a ≤ 𝑛.
Example
• Theorem:
If n is an integer and 𝑛2 is even, then n is even.
Direct proof or proof by contraposition?
• Proof (direct proof):
Assume 𝑛2 is an even integer.
𝑛2 = 2k (k is integer)
n = ± 2k
???
dead end!
Example
• Theorem:
If n is an integer and 𝑛2 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)
𝑛2 = (2𝑘 + 1)2 = 4𝑘 2 + 4𝑘 + 1 = 2 2𝑘 2 + 2𝑘 + 1
Assume integer m = 2 𝑘 2 + 2k.
𝑛2 = 2m + 1
So, 𝑛2 is odd.
By contraposition, If 𝑛2 is even, then n is even.
Proof By Contradiction
• How to prove a proposition by contradiction?
• Assume the proposition is false.
• Using the assumption and other facts to reach a
contradiction.
• This is another kind of indirect proof.
Proof By Contradiction
• Proof by contradiction of p q:
• Assume p and ¬q is true.
These steps are constructed using
Rules of inference
Axioms
Lemmas
Definitions
Proven theorems
contradiction …
Proof by contradiction
Proof By Contradiction (Example)
• Prove if 3n+5 is even then n is odd.
• Proof (proof by contradiction):
Assume 3n+5 is even and n is even.
n = 2k (k is some integer)
3n+5 = 3(2k) + 5 = 6k + 5 = 2(3k + 2) + 1
Assume m = 3k+2.
3n+5 = 2m + 1
So, 3n+5 is odd.
Which contradicts over assumption that 3n+5 is even
So by contradiction, if 3n+5 is even then n is odd.
Proof By Contradiction (Example)
• Prove if 𝑛2 is odd then n is odd.
• Proof (proof by contradiction):
Assume 𝑛2 is odd and n is even.
∃ integer k n = 2k
𝑛2 = 4𝑘 2 = 2(2𝑘 2 )
Let m = 2𝑘 2
𝑛2 = 2m
So, 𝑛2 is even.
Which contradicts over assumption that p is “𝑛2 is odd ”.
So by contradiction, if 𝑛2 is odd then n is odd.
Proof By Contradiction (Example)
• Prove The difference of any rational number and any irrational
number is irrational.
• Proof:
[We take the negation of the theorem and suppose it to be true.]
Suppose ∃ a rational number x and an irrational number y such that
(x − y) is rational. By definition of rational, we have
x = a/b for some integers a and b with b ≠ 0.
and x − y = c/d for some integers c and d with d ≠ 0.
x − y = c/d
a/b − y = c/d
y = a/b − c/d
= (ad − bc)/bd
But (ad − bc) are integers and bd ≠ 0. Therefore, by definition of
rational, y is rational. This contradicts the supposition that y is
irrational. [Hence, the supposition is false and the theorem is true.]
Proof By Contradiction (Example)
• Prove that 2 is not rational by contradiction.
• Proof (proof by contradiction):
Assume 2 is rational. Definition:
∃a,b 2 = a/b b≠0 The real number r
is rational if r=p/q,
If a and b have common factor, remove it
∃ integers p and
by dividing a and b by it q that q ≠ 0.
2=𝑎 /𝑏2 2
2 𝑏2 = 𝑎2
So, 𝑎2 is even and by previous theorem, a is even.
∃ k a = 2k.
2 𝑏2 = 4 𝑘 2
𝑏2 = 2 𝑘 2
So, 𝑏 2 is even and by previous theorem, b is even.
∃ m b = 2m.
So, a and b have common factor 2 which contradicts the Assumption.
Practice Exercise and Chapter Reading
• Q – 1,2,3,6,9,10,17,18,19
• Chapter 1, Kenneth H. Rosen, Discrete Mathematics and
Its Applications, Section 1.7