Lecture 3
Lecture 3
Lecture 3
قومية كلية
ل معتمدة من الهيئة ال عتماد
ضمان جودة التعليم واال
• Proof.
Assume x is arbitrary element from set A, xA, (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 xA B, (3)
We showed that arbitrary element x from set A belongs to the union A B, that is A AB.
Direct proof (Cont.)
• Example 6: Theorem: Let A and B be any two sets. Prove that AB A.
Proof
We need to prove that for any x if x AB, then xA, i.e. x [x AB → x A].
So, take arbitrary x AB (1)
By the definition of the set intersection (1) implies that x A xB, (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 AB belongs to A. By the definition of subset relation, it means that AB
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)
• 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 AB AB.
Proof:
A B → AB AB
p→ q
AB = AB → A = B
q→p
We can prove the equivalent contrapositive proposition
Proof. To prove AB = AB → A = B assume AB = AB and prove 1) A B and 2) B A
1) xA → x AB → x AB → xB
2) xB → x A B → x A B → xA
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 | xB xA
If we have an element xA, by definition of complement, we must have that xA. So we have
x | xB xA.
But, this means that x AB!!! From that we can conclude that AB , 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)(AB) =
Proof by contradiction. Assume
(A−B)(AB) , (1)
i.e., that there exists at least one element in the intersection.
≡ x [x (A−B)(AB)] definition of empty set
≡ x [x(A−B) x(AB)] definition of
x [(xA x B)( xA xB)] definition of set difference and
x [xA (xB xB)] commutative, associative law
≡ x [xA x ] since BB=
≡ x [xA] 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 | xB xA
this is equivalent to...
x | xB xA.
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:
• 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.