You are on page 1of 26

1

CS100: DISCRETE
STRUCTURES
Computer Sciences
Department
Lecture 6: Proof techniques
Lecture Contents
2

 Some terminology.
 Proof Methods.
 Direct proof.
 Examples of Proof Methods.
 Disproving by Counterexample.
 Proof by Contradiction.
 Proofs of Equivalence.

4-Apr-22 Computer Sciences Department


Some terminology:
3

Theorem Is a statement that can be shown


to be true.

4-Apr-22 Computer Sciences Department


Some terminology (Cont.):
4

Axioms Statements that used in a proof


“postulates”
and are assumed to be true.

4-Apr-22 Computer Sciences Department


The structure of mathematical proofs
5

 Many theorems assert that a property holds for all elements in


a domain such as the integers or real numbers.
 The precise statement of such theorems needs to include a

universal quantifier, but the standard convention in mathematics


omit it.
EXAMPLE
“If x > y, where x and y are positive real numbers, then x² > y²”.
Really means:
“For all positive real numbers x and y, If x > y, then x² > y²”.

4-Apr-22 Computer Sciences Department


The structure of mathematical proofs
6

To Prove this type of theorems: (∀x (P(x)  Q(x))


 The law of universal instantiation is often used without explicit
mention.
Step 1 of proof:
Select a general element in the domain. (e.g. C)
Subsequent steps:
Show that this element has the property in question. (P(C)  Q(C) is
true
Finally:
Universal generalization implies that the theorem holds for all members
of the domain. (∀x (P(x)  Q(x)) is true
4-Apr-22 Computer Sciences Department
Proof Methods:
7

Direct Proof Indirect Proof


Proving p  q Proving by
contradiction

Assume p is true,
Assume  p is true,
and prove q. and find a contradiction
(p ^  p are both true)

4-Apr-22 Computer Sciences Department


Direct proof:
8

Proving

pq

Direct proof: Direct proofs lead from the hypothesis


Assume p is of a theorem to the conclusion.
true, and
prove q They begin with the premises; continue
with a sequence of deductions, and
ends with the conclusion.

4-Apr-22 Computer Sciences Department


Direct proof (Cont.):
9

The integer n is even if there exists an


integer k such that n=2k, and
n is odd if there exists an integer k such
Definition 1
that n=2k+1.

Axiom: Every integer is either odd or even

4-Apr-22 Computer Sciences Department


Direct proof (Cont.):
10

Give direct proof that : Theorem : “If n is an


odd integer, then n2 is an odd integer”.
Proof
We assume that the hypothesis of this condition is
true “ n is odd”
EXAMPLE 1 n = 2k+1 for some integer k
We want to show that n2 is odd ,
thus n2 = (2k+1)2
n2 = 4k2 + 4k + 1
n2 = 2(2k2 + 2k) + 1
Therefore n2 is of the form 2j + 1
(with j the integer 2k2 + 2k), thus n2 is odd

4-Apr-22 Computer Sciences Department


Direct proof (Cont.):
11

Prove that if n is an integer and 3n+2 is odd,


then n is odd.

We assume that 3n+2 is an odd integer


EXAMPLE 2
This mean that 3n+2=2k+1
There is no direct way to proof that n is odd
integer (Direct proof often reaches dead
ends.)

4-Apr-22 Computer Sciences Department


Examples of Proof Methods:
12

The real number r is rational if there


exist integers p and q with q≠0 such
that r =p/q.
Definition 2

A real number that is not rational is


called irrational

4-Apr-22 Computer Sciences Department


Examples of Proof Methods (cont.):
13

Theorem: Prove that the sum of two rational


numbers is rational.
Proof
 assume that r and s are rational numbers
 r=p/q and s=t/u where p,q,t,u are integers and
EXAMPLE q≠0, u≠0
 r+s=(p/q)+(t/u) = (pu+qt)/(qu)
 Because q≠0 and u≠0, then qu≠0
 Both (pu+qt) and (qu) are integers
 Then the theorem is proved
 Note that :Our attempt to find direct proof
succeeded

4-Apr-22 Computer Sciences Department


Examples of Proof Methods (cont.):
14

Theorem: Prove that the sum of two odd integers is


even.
Proof
Assume p is true (n , m are odd => n=2k+1 , m=2k+1) ,
prove q is true ( n+m is even => n+m=2k) .
EXAMPLE
n+m = (2k+1)+(2k+1)
n+m = 4k+2
n+m = 2(2k+1)
.∙. n+m is even
.∙. q is true
.∙. P  q is true

4-Apr-22 Computer Sciences Department


Disproving by Counterexample:
15

 To prove a statement of the form x P(x) to be


false we look for a counterexample.
EXAMPLE 1
prove or disprove the statement
If x and y are real number, (x² = y²) ↔ (x=y)
Solution:
-3,3 are real number and (-3) ² = 3² but -3 ≠ 3
Hence the result is false and implication is false

4-Apr-22 Computer Sciences Department


Disproving by Counterexample:
16

EXAMPLE 2
Show that the statement “Every positive integer is the sum of the squares of
two integers” is false.
Solution:
 3 cannot be written as the sum of the squares of two integers.

 The only perfect squares not exceeding 3 are 02 = 0 and 12 = 1

 Furthermore, there is no way to get 3 as the sum of two terms each of


which 0 or 1.
 Consequently, the statement “Every positive integer is the sum of the
squares of two integers” is false.

4-Apr-22 Computer Sciences Department


Indirect Proof
17

 We need other method of proving theorem of


pq, which is not direct
 Which don’t start with the hypothesis and end
with the conclusion (we call it indirect proof)
 Proof by contradiction is a type of indirect
proof.
Assume  p is true and find a contradiction (p^ p are
both true.

4-Apr-22 Computer Sciences Department


Indirect proof (Cont.):
18

Give a proof by contradiction of the theorem “if 3n + 2 is


odd, then n is odd”.
Proof
Let p be “3n + 2 is odd” and q be “n is odd”
To construct a proof by contradiction assume both p and (q)
are true.
EXAMPLE The is “3n + 2 is odd” and “n is even”
Then n = 2k for some integer k.
Then 3n+2 = 3(2k)+2 = 6k+2 = 2(3k+1).
Thus 3n+2 is even, because it equals 2j for integer j = 3k+1.
So 3n+2 is not odd p.
Because p and p are true we have a contradiction.

Thus (3n+2 is odd) → (n is odd) is true.

4-Apr-22 Computer Sciences Department


Indirect proof (Cont.):
19

Give a proof by contradiction of the theorem “if n3+ 5 is odd, then


n is even”.
Proof
Let p be “n3 + 5 is odd” and q be “n is even”
To construct a proof by contradiction assume both p and (q) are
true.
The is “n3 + 5 is odd” and “n is odd”
EXAMPLE
Then n = 2k+1 for some integer k.
Then n3 + 5 = (2k+1)3+5 = 8k3 + 12k2 + 6k + 6 = 2(4k3 + 6k2 +
3k + 3).
Thus n3 + 5 is even, because it equals 2j for integer j = 3k+1.
So n3 + 5 is not odd p.
Because p and p are true we have a contradiction.

Thus (n3 + 5 is odd) → (n is even) is true.

4-Apr-22 Computer Sciences Department


Proofs of Equivalence:
20

 To prove a theorem that is a bi-conditional statement


p  q, we show that p  q and q  p are both
true.
 To prove a theorem that states several propositions to
be equivalent p1p2  p3…  pn,
we must show that p1p2, p2p3,…pnp1

4-Apr-22 Computer Sciences Department


Proofs of Equivalence (cont.):
21

 Show that these statements are equivalent:


 p1: n is even

 p2: n -1 is odd
EXAMPLE
 p3: n2 is even

4-Apr-22 Computer Sciences Department


Proofs of Equivalence (cont.):
22

P1  P2
P2  P3
P3  P1
1. P1  P2

• p1: n is even
• p2: n -1 is odd
SOLUTION Assume p1 is true (n is even => n=2k) ,
prove p2 is true ( n-1 is odd => n-1=2k+1) .
(2k) – 1
2k -2+1 => -2+1=-1
2(k-1)+1
2m+1
.∙. n-1 is odd
.∙. P2 is true
.∙. P1  P2 is true
4-Apr-22 Computer Sciences Department
Proofs of Equivalence (cont.):
23

P1  P2
P2  P3
P3  P1
2. P2  P3

• p2: n -1 is odd
• p3: n2 is even
SOLUTION Assume p2 is true ( n-1 is odd => n-1=2k+1) ,
prove p3 is true (n2 is even => n2 =2k) .
𝒏 − 𝟏 = 𝟐𝒌 + 𝟏
𝒏 = 𝟐𝒌 + 𝟐
𝒏𝟐 = (𝟐𝒌 + 𝟐)𝟐
𝒏𝟐 = 𝟒𝒌𝟐 + 𝟖𝒌 + 𝟒
𝒏𝟐 = 𝟐(𝟐𝒌𝟐 + 𝟒𝒌 + 𝟐)
𝒏𝟐 = 𝟐𝒎
.∙. 𝑛2 is even

4-Apr-22 .∙. P3 is true Computer Sciences Department


.∙. P2  P3 is true
Proofs of Equivalence (cont.):
24

P1  P2
P2  P3
P3  P1
3. P3  P1

• p3: n2 is even
• p1: n is even
SOLUTION Assume p3 is true (n2 is even => n2 =2k) ,
prove p1 is true (n is even => n =2k) .
𝑛2 = 2𝑘
𝑛 = 2𝑘
(dead end) => we will use the indirect proof
¬P1  ¬ P3

4-Apr-22 Computer Sciences Department


Proofs of Equivalence (cont.):
25

P1  P2
P2  P3
P3  P1
3. P3  P1
Indirect Proof
Let p3 be “n2 is even” and p1 be “n is even”
SOLUTION To construct a proof by contradiction assume both p3 and ( p1) are true.
The is “n2 is even” and “n is odd”
Then n = 2k+1 for some integer k.
Then n2 = (2𝑘 + 1)2 = 4𝑘 2 + 4𝑘 + 1= 2(2𝑘 2 +2𝑘) + 1.
Thus, n2 is odd, because it equals 2j +1 for integer j = 2𝑘 2 +2𝑘.
So n2 is not even p3.
Because p3 and p3 are true we have a contradiction.

Thus (n2 is even) → (n is even) is true.


.∙. P3  P1

4-Apr-22 Computer Sciences Department


26

Refer to Chapter 1 for further reading

4-Apr-22 Computer Sciences Department

You might also like