You are on page 1of 13

# CPE222 Discrete Structures

Lecture Notes

Lecture 5
Proof Techniques
Introduction to Proofs
To understand written mathematics, one must
understand what makes up a correct mathematical
argument, that is, a proof.
This requires an understanding of the techniques used to
build proofs.
The methods we will study for building proofs are also
used throughout computer science, such as the rules
computers used to reason, the techniques used to verify
that programs are correct, etc.
Many theorems in mathematics are implications, p q.
The techniques of proving implications give rise to
different methods of proofs
What is a theorem?
Ans : A statement that can be shown true. Sometimes called facts.
What is a Proof?
Ans : Demonstration that a theorem is true.

Some Terminology
propositions - Less important theorems
axioms - statement that is assumed to be true
lemma - A less important theorem that is useful to prove a
theorem
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
trivial proof - A proof that p q is true based on the fact that q is
true
Some Basic Definitions
Rational Numbers
A number is rational if we can write it as a fraction where top number of the
fraction and bottom number are both whole numbers with no common factors
Every whole number, including negative numbers and zero, is a rational number.
This is because every whole number n can be written in the form n/1
Examples of Rational Numbers - 8 (8/1) , 3/4, 1.5 (3/2), 0.333... (1/3)
Recurring decimals such as 0.26262626, all integers and all finite decimals,
such as 0.241, are also rational numbers

Irrational Numbers
An irrational number is any number that is not rational.
It is a number that cannot be written as a fraction of two integers
An irrational number has endless non-repeating digits to the right of the
decimal point
Examples of irrational number - 2 (1.414.) , (3.141592), e (2.718 )

## Real number set of all rational and irrational numbers

Even numbers
A number n is even if there exist a number k, such that n = 2k where k is integer
An even number is any number that can be divided by 2 (last digit is 0,2,4,6,or 8)
examples of even numbers 6, 58, 44884, 998632, 10000000
Odd numbers
A number n is odd if there exist a number k, such that n = 2k + 1 where k is integer
i.e An odd number n divided by 2, always get a quotient k with a remainder of 1.
Having a remainder of 1 means that n cannot in fact be divided by 2
(last digit is 1, 3, 5, 7 or 9)
examples of odd numbers 7, 59, 44885, 998631
Basic operations with even and odd numbers
Addition Rule Subtraction Rule
even + even = even 4 + 2 = 6 even even = even 8 4 = 4
even + odd = odd 6 + 3 = 9 even odd = odd 85=3
odd + odd = even 13 + 13 = 26 odd odd = even 95=4
Multiplication Rule
even even = even 2 6 = 12
even odd = even 8 3 = 24
odd odd = odd 3 5 = 15
Methods of Proving Theorems
Direct Proofs
First assume p is true
Then show q must be true (using axioms, definitions)
So the combination of p is true and q is false never occurs
Thus p q is true
Example - Prove that the sum of two odd integers is even.
Proof: Let m and n be two odd integers.
Then by definition of odd numbers m = 2k + 1 for some k Z
n = 2L + 1 for some L Z
Now m + n = (2k + 1) + (2L + 1)
= 2k + 2L + 2 = 2 (k + L + 1) = 2r where r = (k + L+ 1) Z
Hence m + n is even. Hence Proved

## Example - The product of two odd numbers is odd

Proof x = 2m+1, y = 2n+1
xy = (2m+1)(2n+1) = 4mn + 2m + 2n + 1 = 2(2mn+m+n) + 1 odd
Example - If m and n are perfect square, then m+n+2(mn) is a
perfect square
Proof: m = a2 and n = b2 for some integers a and b
Then m + n + 2(mn) = a2 + b2 + 2ab
= (a + b)2 is perfect square Hence proved

## Example - Give a direct proof that if m and n are both perfect

squares, then nm is also a perfect square.
Proof: let r and s are two integers, then m=r and n=s,
Now m . n= r s = (r s) = t where t = r s Hence proved

## Example - Use a direct proof to show that the product of two

rational numbers is rational.
Proof: First number x = a/b, b 0 Second number y =c/d, d0
x*y = a*c/b*d since b 0 and d0 then b*d0.
Let a*c = L and b*d = m so, x = L/m
Hence x is rational number. Hence Proved
Proof by Contraposition
A proof that p q is true that proceeds by showing that p must be
false when q is false. p q !q !p
( Prove contrapositive, i.e. prove not Q implies not P )
It is an indirect proofs
Example - Prove that if n is an integer and 3n+2 is odd, then n is odd
Proof: Assume that n is even (negation).
So, n can be expressed as 2k for some integer k; n = 2k
Therefore, 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) = 2 x even
So 3n + 2 is even. Hence proved

## Example - If r is irrational, then r is irrational

Proof: We shall prove contrapositive if r is rational, then r is rational
Since r is rational, r = a/b for some integers a,b
r = a2/b2. Since a,b are integers, a2,b2 are integers
Therefore, r is rational
Example - Prove that If n2 is even, then n is even
Proof: Assume that n is odd (negation).
So, n can be expressed as 2k+1 for some integer k; n = 2k+1
Therefore, n2 = (2k+1)2 = (2k)2 + 2(2k) + 1 = 2(2k2 + 2k) + 1
So 2x + 1 is odd. Hence proved

Proof by Contradiction
A proof that p is true based on the truth of the conditional statement
!p q, where q is contradiction
Example - Give a proof by contradiction of theorem If 3n + 2 is odd, then n
is odd.
Let p= 3n + 2 is odd q= n is odd
To construct a proof by contradiction, assume that both p and q are true
That is, assume that 3n + 2 is odd and that n is not odd
Because n is not odd (means even), n = 2k
3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) = 2t is even = p
both p and p are true, we have contradiction
This completes proof by contradiction, proving if 3n + 2 is odd, then n is odd
Example - Prove 2 is irrational using contradiction
Suppose 2 was rational
Choose m, n integers without common factors (always true)
2 = m /n 2 n=m 2n2=m2 (a is even if and only if a2 is even)
so m is even
m=2l 2 n=2l 2 n2=4l2 n2=2l2 so n is even
m and n are both even, thus have a common factor 2, a contradiction!

Example - Show that if n is an integer and n+5 is odd , then n is even using
a proof by contradiction
Let p= n+5 is odd and q= n is even
assume that both p and q are true
So n is odd n=2k-1 for some integer k
n+5 = (2k-1)+ 5 = (4k+4k+1) (2k-1) + 5 = 8k- 4k+ 8k-4k + 2k 1 + 5 =
8k+4k- 2k + 4 =2(4k+2k-k+1) =2t is even (where t= 4k+2k- k + 1 ) = q
both p and q are true, we have contradiction
We conclude that for every integer n, if n +5 is odd, then n is even. Hence
Proved
Proof by Cases
- Sometimes easiest way to prove a theorem is to split it into
several cases.
- the original conditional statement p q with a hypothesis p
made up of a disjunction of propositions p1, p2, . . . , pn can be
proved by proving each of the n conditional statements pi q,
i = 1, 2, . . . , n, individually.

Exhaustive Proof
- Some theorems can be proved by examining a relatively small
number of examples. Such proofs are called exhaustive proofs, or
proofs by exhaustion because these proofs proceed by exhausting
all possibilities.
- An exhaustive proof is a special type of proof by cases where each
case involves checking a single example
Example - Prove that (n + 1)3 3n if n is a positive integer with n 4
We use a proof by exhaustion.
n = 1, (n + 1)3 = (1 + 1)3 = (2)3 = 8 and 3n = 31 = 3
n = 2, (n + 1)3 = (2 + 1)3 = (3)3 = 27 and 3n = 32 = 9
n = 3, (n + 1)3 = (3 + 1)3 = (4)3 = 64 and 3n = 33 = 27
n = 4, (n + 1)3 = (4 + 1)3 = (5)3 = 125 and 3n = 34 = 81
In each of these four cases, we see that (n + 1) 3 3n for n 4

## Example - Prove that if n is an integer, then n2 n

Solution: We can prove that n2 n for every integer by considering three cases,
when n = 0, when n 1, and when n 1
Case (i): When n = 0, because 02 = 0, we see that 02 0. It follows that n2 n is true
Case (ii): When n 1, multiply both sides by n, we get n n n 1
This implies that n2 n
Case (iii): In this case n 1, square both sides, However, n2 0.
It follows that n2 n.
Because the inequality n2 n holds in all three cases,
we can conclude that if n is an integer, then n2 n.
Example - Let n be an integer. Prove that 9n2 + 3n - 2 is even
Case 1: n is even
The product of an even integer and any integer is even. Since n is
even, 9n2 and 3n are even too.
Thus 9n2 + 3n -2 is even because it is sum of three even integers.
Case 2: n is odd
The product of odd integers is odd. In this case, since n is odd, 9n2 and
3n are also odd. The sum of two odd integers is even.
Thus 9n2 + 3n is even.
sum of even integers is even, so 9n2 + 3n -2 = (9n2 + 3n) + (-2) is even