Lecture 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Assiut University

‫قومية‬ ‫كلية‬
‫ل معتمدة من الهيئة ال عتماد‬
‫ضمان جودة التعليم واال‬

Course Title: Discrete Structures


Course Code: CS201

Prof. Dr. Khaled F. Hussain


Proof Methods
• Proof is a fundamental concept that involves demonstrating the
truth or falsity of a mathematical statement or proposition.
• Several common proof methods:
• Direct Proof
• Indirect Proof
• Proof by Contrapositive
• Proof by Contradiction
• Proof by Exhaustion
• Proof by Case Analysis
Direct proof
• A Direct proof of a conditional statement p → q is constructed
when the first step is the assumption that p is true; subsequent
steps are constructed using rules of inference, with the final step
showing that q must also be true. It's a straightforward approach
that involves:
1.Starting with the premises: Begin with the given premises or
assumptions.
2.Applying logical rules and mathematical operations: Use logical
connectives (AND, OR, NOT, IMPLIES, IF AND ONLY IF) and mathematical
operations to derive intermediate steps and eventually the conclusion.
3.Concluding the statement: Once the conclusion is reached, state that
the original statement is proven.
Direct proof (Cont.)
• Example 1: Prove that if n is an even integer, then n^2 is also
even.
• Proof:
1.Assume: n is an even integer.
2.Definition of even: n = 2k for some integer k.
3.Square n: n^2 = (2k)^2 = 4k^2 = 2(2k^2)
4.Conclusion: Since n^2 can be expressed as 2 times another integer
(2k^2), n^2 is also even.
Direct proof (Cont.)
• Example 2: Prove that if n is an odd integer, then n^2 is also
odd.
• Proof:
1.Assume: n is an odd integer.
2.Definition of even: n = 2k+1 for some integer k.
3.Square n: n^2 = (2k+1)^2 = 4k^2 +4k+1= 2(2k^2 +2k)+1 =2i+1
4.Conclusion: Since n^2 can be expressed as 2 times another integer
(2k^2) plus one, n^2 is also odd.
Direct proof (Cont.)
• Example 3: Prove that if x is a real number, then x^2 ≥ 0.
• Proof:
1.Consider cases:
1. If x = 0, then x^2 = 0, which is non-negative.
2. If x > 0, then x^2 = x * x, and since the product of two positive numbers is positive,
x^2 > 0.
3. If x < 0, then x^2 = (-x) * (-x), and since the product of two negative numbers is
positive, x^2 > 0.
2.Conclusion: In all cases, x^2 is non-negative, so x^2 ≥ 0.
Direct proof (Cont.)
• Example 4: Give a direct proof that if m and n are both perfect squares, then nm is also a perfect square. (An
integer a is a perfect square if there is an integer b such that a = b2.)
• To produce a direct proof of this theorem, we assume that the hypothesis of this conditional statement is true,
namely, we assume that m and n are both perfect squares. By the definition of a perfect square, it follows that
there are integers s and t such that m = s2 and n = t2.
• The goal of the proof is to show that mn must also be a perfect square when m and n are; looking ahead we
see how we can show this by substituting s2 for m and t2 for n into mn. This tells us that mn = s2t2. Hence, mn
= s2t2 = (ss)(t t) = (st)(st) = (st)2, using commutativity and associativity of multiplication.
• By the definition of perfect square, it follows that mn is also a perfect square, because it is the square of st,
which is an integer.
• We have proved that if m and n are both perfect squares, then mn is also a perfect square.
Direct proof (Cont.)
• Example 5: Theorem
A  AB ≡ x [xA → xA B].

• Proof.
Assume x is arbitrary element from set A, xA, (1)
But x A → x A  (any other proposition) since p →p  q is a tautology.
So, (1) implies, that x A  x B, (2)
By the definition of set union, (2) is equivalent to xA B, (3)
We showed that arbitrary element x from set A belongs to the union A B, that is A  AB.
Direct proof (Cont.)
• Example 6: Theorem: Let A and B be any two sets. Prove that AB  A.

Proof
We need to prove that for any x if x AB, then xA, i.e. x [x AB → x A].
So, take arbitrary x  AB (1)
By the definition of the set intersection (1) implies that x  A  xB, (2)
(2) implies that x  A, (3) by p q → p, i. e. p q → p is a tautology.
We showed that any element from AB belongs to A. By the definition of subset relation, it means that AB
 A.
Direct proof (Cont.)
Example 7: Theorem: Prove that the sum of two odd integers is an even integer..
Proof: Let a, b denote two (arbitrary) odd integers. We want to prove that a + b is even.
By the definition of odd integers, there exist integers c and d such that
a=2c+1 (1)
b=2d+1 (2)

Adding equations (1) and (2) yields


a + b = (2 c + 1) + (2 d + 1)
= 2 c + 2 d + 2, commutative and associative laws
= 2 (c + d + 1), distributive law
Since (c + d + 1) is an integer, because c and d are and because of the closure property under add, the above
equation for a + b proves that it is even, by the definition of even integers.
Direct proof (Cont.)
• Example 8: Theorem: Prove that if a | b, and b | c, then a | c, where a, b, and c are integers.
Proof: By the definition of divisibility, a | b implies that there exists integer a’ such that
b = a a’ (1)
Similarly, b | c implies that there exists integer b’ such that
c = b b’ (2)
Substituting b of (1) into (2) yields
c = (a a’) b’
= a (a’ b’), associative law (3)
Since a’ and b’ are integers, a’ b’ is also an integer by the closure property of multiplication. Also, a  0 because
it is a divisor of b. Thus, a  0 and Equation (3) together imply a | c, by the definition of divisibility.
Direct proof (Cont.)
• Example 9: AB ≡ A−B= 

AB ≡ x [xA → xB] by subset definition


≡ x [xA  xB] by equivalence p →q ≡ p q
≡ x  [xA  x B] by DeMorgan’s law
≡ x  [x A−B] by definition of A−B
≡ x [x A−B] by negation of 
≡ A−B =  by definition of empty set
Direct proof (Cont.)
• Example 10: show that A −(A−B) =A B
• Note: A −(A−B)  B!
Proof
A−B = {x| xA  xB }= {x| xA B } = A B
Then: A −(A−B) = A −(AB) = A [(AB)]
= A [A(B)] = A (AB)
= (A A)(A  B) =  (A  B) = A B
Proof by Contrapositive
• Proof by contrapositive is a method of indirect proof where,
instead of proving the original statement "p → q," you prove its
contrapositive "¬q → ¬p." The contrapositive is logically equivalent
to the original statement.
Proof by Contrapositive (Cont.)
• if n is an integer such that 3n+2 is odd, then n is odd.

• Proof: Assume n is not odd. Then, we must prove 3n+2 is not odd.
Since n is not odd, it is even and we have n=2k for some integer k.
Then, 3n+2=3(2k)+2=6k+2=2(3k+1). Letting k′=3k+1 we
have 3n+2=2k′. Hence, it is even.
Proof by Contrapositive (Cont.)
• Prove that if n = ab, where a and b are positive integers, then 𝑎 ≤ 𝑛 or 𝑏 ≤ 𝑛 .

• The first step in a proof by contraposition is to assume that the conclusion of the conditional statement “If n =
ab, where a and b are positive integers, then 𝑎 ≤ 𝑛 or 𝑏 ≤ 𝑛” is false.
• That is, we assume that the statement (𝑎 ≤ 𝑛) ∨ (𝑏 ≤ 𝑛) is false. Using the meaning of disjunction together
with De Morgan’s law, we see that this implies a > 𝑛 and b > 𝑛. We can multiply these inequalities together
(using the fact that if 0 < s < t and 0 < u < v, then su < tv) to obtain ab > 𝑛 · 𝑛 = n. This shows that ab ≠ n,
which contradicts the statement n = ab.
• Because the negation of the conclusion of the conditional statement implies that the hypothesis is false, the
original conditional statement is true.
Proof by Contrapositive (Cont.)
Example: Theorem: If A B, then AB  AB.
Proof:
A B → AB  AB
p→ q

AB = AB → A = B
q→p
We can prove the equivalent contrapositive proposition
Proof. To prove AB = AB → A = B assume AB = AB and prove 1) A B and 2) B  A
1) xA → x AB → x AB → xB
2) xB → x A  B → x A  B → xA
Proof by Contrapositive (Cont.)
Example: If A  B = , then B  A.
Proof:
The contrapositive of this statement is the following:
if ( B  A) then (A  B = ).
If we prove this statement, we have also proven the original, since a statement and its contrapositive are
equivalent.
So, we will assume that ( B  A). Under this assumption we must show that A  B  .
If we have that ( B  A), then there exists an element x such that x is IN B but NOT IN the complement of
A. Symbolically we have:
x | xB  xA
If we have an element xA, by definition of complement, we must have that xA. So we have
x | xB  xA.
But, this means that x  AB!!! From that we can conclude that AB  , as desired.
Proof by contradiction
• Proof by contradiction is a powerful method of indirect proof
where you assume the negation of the statement you want to
prove and then show that this assumption leads to a logical
contradiction. This contradiction implies that the original
statement must be true.
• By contrapositive, if ¬p→F holds then T→p holds.
Therefore, p must be true.
Proof by contradiction (Cont.)
• Example: There is no largest integer.
• Proof: Assume that there does exist some largest integer. Call such an
integer n. But, n+1 is also an integer and n+1 is strictly larger than n.
Therefore, our assumption that a largest integer exists is false. That is,
there is no largest integer is true.
Proof by contradiction (Cont.)
• Prove that 2 is irrational by giving a proof by contradiction.
• Solution: Let p be the proposition “ 2 is irrational.” To start a proof by contradiction, we suppose that ¬p is true.
Note that ¬p is the statement “It is not the case that 2 is irrational,” which says that 2 is rational. We will
shointeger,ng that ¬p is true leads to a contradiction.
• If 2 is rational, there exist integers a and b with 2 = a/b, where b ≠ 0 and a and b have no common factors (so that
the fraction a/b is in lowest terms.) (Here, we are using the fact that every rational number can be written in lowest
terms.) Because 2 = a/b, when both sides of this equation are squared, it follows that 2 =a2/b2 .
• Hence, 2b2 = a2. By the definition of an even integer it follows that a2 is even. We next use the fact that if a2 is even,
a must also be even. Furthermore, because a is even, by the definition of an even integer, a = 2c for some integer c.
Thus, 2b2 = 4c2.
• Dividing both sides of this equation by 2 gives b2 = 2c2 By the definition of even, this means that b2 is even. Again
using the fact that if the square of an integer is even, then the integer itself must be even, we conclude that b must be
even as well.
• We have now shown that the assumption of ¬p leads to the equation 2 = a/b, where a and b have no common
factors, but both a and b are even, that is, 2 divides both a and b.
• Because our assumption of ¬p leads to the contradiction that 2 divides both a and b and 2 does not divide both a
and b, ¬p must be false. That is, the statement p, “ 2 is irrational,” is true. We have proved that 2 is irrational.
Proof by contradiction (Cont.)
• Give a proof by contradiction of the theorem “If 3n + 2 is odd, then n is odd.”
• Solution: Let p be “3n + 2 is odd” and q be “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, we know that it is even. Because n is even, there is an integer k such that n = 2k. This
implies that 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1). Because 3n + 2 is 2t , where t = 3k + 1, 3n + 2 is even.
• Note that the statement “3n + 2 is even” is equivalent to the statement ¬p, because an integer is even if and
only if it is not odd.
• Because both p and ¬p are true, we have a contradiction. This completes the proof by contradiction, proving
that if 3n + 2 is odd, then n is odd.
Proof by contradiction (Cont.)
Example: Theorem: For any two sets A and B (A−B)(AB) = 
Proof by contradiction. Assume
(A−B)(AB)  , (1)
i.e., that there exists at least one element in the intersection.
≡ x [x (A−B)(AB)] definition of empty set
≡ x [x(A−B) x(AB)] definition of 
x [(xA  x B)( xA  xB)] definition of set difference and 
x [xA  (xB xB)] commutative, associative law
≡ x [xA  x ] since BB= 
≡ x [xA] definition of 
≡ x [x] domination law
≡F since x [x ]
We come to the contradiction that proves the original proposition.
Proof by contradiction (Cont.)
Example: If A  B = , then B  A.
So we first assume that A  B = . Next we will also assume that B  A is false.

If we have ( B  A), then we must have an element x that is in B that is NOT in the complement of A.
Symbolically we have:
x | xB  xA
this is equivalent to...
x | xB  xA.
But this is impossible – it contradicts our assumption A  B = . Thus, we must have made a mistake in our
proof. Every step we took was logical EXCEPT for our assumption. Thus, this is what must be wrong...we can
conclude that the opposite of it, is indeed true. This proves that
If A  B = , then B  A.
Mistakes in Proofs
• What is wrong with this famous supposed “proof” that 1 = 2?
• “Proof:“ We use these steps, where a and b are two equal positive integers.

• Step Reason
1. a = b Given
2. a2 = ab Multiply both sides of (1) by a
3. a2 − b2 = ab − b2 Subtract b2 from both sides of (2)
4. (a − b)(a + b) = b(a − b) Factor both sides of (3)
5. a + b = b Divide both sides of (4) by a − b
6. 2b = b Replace a by b in (5) because a = b and simplify
7. 2 = 1 Divide both sides of (6) by b

• Solution: Every step is valid except for one, step 5 where we divided both sides by a − b. The error is that a −
b equals zero; division of both sides of an equation by the same quantity is valid if this quantity is not zero.
Exhaustive Proof and Proof by Cases
• To prove a conditional statement of the form
(p1 ∨ p2 ∨ · · · ∨ pn) → q is tautology. We can use as a rule of inference:
[(p1 ∨ p2 ∨ · · · ∨ pn) → q] [(p1 → q) ∧ (p2 → q) ∧ · · · ∧ (pn → q)]

• This shows that the original conditional statement with a hypothesis made up of a disjunction of
the propositions p1, p2, . . . , pn can be proved by proving each of the n conditional statements pi →
q, i = 1, 2, . . . , n, individually.
Proof by exhaustion
• Proof by exhaustion is a method of proof that involves testing a
statement for all possible cases or instances within a finite
domain. It's particularly effective when the domain is small or can
be easily enumerated.
• Steps involved:
1.Identify the possible cases: Determine all the distinct values or
combinations of values that the variables in the statement can take.
2.Test the statement for each case: Verify that the statement is true for
each of the possible cases.
3.Conclude: If the statement is true for all cases, then it is true for the
entire domain.
Proof by exhaustion (Cont.)
• Example: For any integer n between 1 and 4, n^2 is greater than or
equal to n.
• Proof by exhaustion:
• Case 1: n = 1: 1^2 = 1, which is greater than or equal to 1.
• Case 2: n = 2: 2^2 = 4, which is greater than or equal to 2.
• Case 3: n = 3: 3^2 = 9, which is greater than or equal to 3.
• Case 4: n = 4: 4^2 = 16, which is greater than or equal to 4.
• Conclusion: Since the statement is true for all integers between 1 and 4,
it is true for the entire domain.
Proof by exhaustion (Cont.)
• Truth table method. To prove a statement about small number of Boolean variables make a truth table and
check all possible cases.
Example: (((A  B)  C)  B) ≡ (B  C)
One way is to use a membership table:

A B C BC ((A  B)  C) B (((A  B)  C)  B)


0 0 0 0 1 1 0
0 0 1 0 1 1 0
0 1 0 0 1 0 0
0 1 1 1 0 0 1
1 0 0 0 1 1 0
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 1
Proof by Case Analysis
• Proof by case analysis is a method of proof where you divide the proof
into different cases based on specific conditions or possibilities and
then prove the statement for each case separately. This technique is
often used when the domain of a statement is divided into distinct
subsets or when there are different conditions that can affect the truth
of the statement.

• Steps:
1.Identify the cases: Determine the different cases or conditions that can occur.
2.Prove the statement for each case: Prove the statement separately for each
identified case using appropriate proof techniques.
3.Conclude: Since the statement is true for all cases, it is true for the entire
domain.
Proof by Case Analysis (Cont.)
• Example:
• Statement: For any integer n, n^2 is either even or odd.
• Proof by case analysis:
• Case 1: n is even. If n is even, then n = 2k for some integer k. Therefore, n^2 = (2k)^2
= 4k^2 = 2(2k^2), which is even.
• Case 2: n is odd. If n is odd, then n = 2k + 1 for some integer k. Therefore, n^2 = (2k +
1)^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1, which is odd.
• Conclusion: Since n is either even or odd, and we have shown that n^2 is
even in the first case and odd in the second case, it follows that n^2 is
either even or odd for any integer n.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy