Chapters 2 and 3
Chapters 2 and 3
2.1 Introduction
Before presenting the methods of proving theorems, we need to understand
how mathematical theorems are stated. For example, The statement
If x > y, where x and y are positive real numbers, then x2 > y 2 ,
really means,
For all positive real numbers x and y, if x > y, then x2 > y 2 .
To prove a theorem of the form ∀x p(x) −→ q(x) is true, our goal is to show
that p(c) −→ q(c) is true where c is an arbitrary element of the domain and then
apply universal generalization.
In a direct proof, we assume that p is true and use axioms, definitions, and
previously proven theorems, together with rules of inference, to show that q must
also be true. Before we give the first example, we need the following definition.
23
Dr. Akram Alqesmah 24
Example 2.1. Give a direct proof of the theorem, ( If n is an odd integer, then
n2 is odd).
Solution: Assume that n is odd integer. Then by the definition of odd integers
( Definition 2.1), n = 2k + 1 where k is an integer. Therefore,
n2 =(2k + 1)2 = 4k 2 + 4k + 1
=2(2k 2 + 2k) + 1,
Example 2.2. Give a direct proof to show that, ( If n and m are both perfect
squares, then nm is also a perfect square).
Note that: An integer a is a perfect square if there exists an integer b
such that a = b2 .
Solution: Assume that n and m are perfect squares. Then there exist two
integers r and s such that n = r2 and m = s2 , respectively. Therefore,
nm =r2 s2 = (rs)2 ,
Let us now use the the proof by contraposition. Assume that, the negation of
the conclusion ( n is odd ) is true, namely we assume that n is not odd ( means
n is even ) and we need to prove that the negation of the hypothesis ( 3n + 2 is
odd ) is true, namely we prove that 3n + 2 is even. Thus,
assume that, n is even. Then n = 2k for some integer k. Therefore,
3n + 2 =3(2k) + 2 = 6k + 2
=2(3k + 1).
Since 3k + 1 is an integer, then by the definition of even integers, 3n + 2 is even.
This proves that the contrapositive ( If n is even integer, then 3n + 2 is even ) of
our statement is true. Hence, our statement ( If 3n + 2 is odd, then n is odd )
is true.
Example 2.4. Prove that, ( If n = ab, where a and b are positive integers, then
√ √
a ≤ n or b ≤ n ).
√ √ √ √
Solution: Assume that, ∼ (a ≤ n ∨ b ≤ n) is true, namely a > n ∧ b > n
is true. Using the fact ( if r, s, t and u are positive integers such that r > s and
t > u, then rt > su ), it can be seen that:
√ √
ab > n · n = n ⇔ n < ab.
Dr. Akram Alqesmah 26
This means that, n 6= ab, which is the negation of the hypothesis of the original
√
statement ( If n = ab, where a and b are positive integers, then a ≤ n or
√
b ≤ n). Hence, the proof is completed.
Definition 2.2. A real number r is called rational if there exist integers p and
p
q, with q 6= 0, such that r = . A real number that is not rational is called
q
irrational.
Example 2.5. Show that, ( For every real numbers r and s, if r and s are
rational, then r + s is also rational ).
Solution: To prove this statement we use a direct proof. Assume that, r and s
are rational real numbers. Then by Definition 2.2, there exist some integers p, q, t
p t
and u such that r = and s = , respectively, with q 6= 0 and u 6= 0. Therefore,
q u
p t
r+s= +
q u
pu + tq
= .
qu
n2 = (2k)2 = 4k 2 = 2(2k 2 ).
Thus,
b2 is even ⇐⇒ b is even .
Because a is even and b is even, this implies that a and b have 2 as a common
factor which contradicts the assumption that a and b have no common factor.
√
Hence, 2 is irrational. This completes the proof.
Example 2.9. Show that the statement ”Every positive integer is the sum of
the squares of two consecutive integers” is false.
Solution: To show that this statement is false, we look for a counterexample,
which is a particular integer that is not the sum of the squares of two consecutive
integers. It can be seen that easily the number 3 cannot be written as the sum
of the squares of two integers, because the only perfect squares not exceeding 3
are 02 = 0 and 12 = 1 and
0 + 0 =0 6= 3
0 + 1 =1 + 0 = 1 6= 3
1 + 1 =2 6= 3.
Note that: The idea in the proof by mathematical induction it comes from
the first step (proving that P (1) is true) and the last step ( proving P (k + 1)
is true), that is when we prove that P (1) is true, we know that P (2) is true,
because P (1) implies P (2). Further, we know that P (3) is true, because P (2)
implies P (3). Continuing along these lines, we see that P (n) is true for every
positive integer n.
n(n + 1)
1 + 2 + 3 + ··· + n = .
2
Solution: Let P (n) be the proposition that the sum of the first n positive
n(n + 1)
integers is .
2
1(1 + 1)
Basis step: P (1) is true, because 1 = = 1.
2
Induction step: For the inductive hypothesis we assume that P (k) holds for
an arbitrary positive integer k. That is, we assume that
k(k + 1)
1 + 2 + 3 + ··· + k = .
2
Now, we must prove that P (k + 1) is true, namely,
(k + 1)(k + 2)
1 + 2 + 3 + · · · + (k + 1) = .
2
By adding the term k + 1 to the both sides of the equation of P (k), we obtain
k(k + 1)
1 + 2 + 3 + · · · + k + (k + 1) = + (k + 1)
2
k(k + 1) + 2(k + 1)
=
2
(k + 1)(k + 2)
= .
2
Therefore, P (k + 1) is true and the solution is done.
Dr. Akram Alqesmah 30
1 + 3 + 5 + · · · + (2n − 1) = n2 .
Solution: Let P (n) be the proposition that the sum of the first n odd positive
integers is n2 .
Basis step: P (1) is true, because
2(1) − 1 =(1)2
.
1 =1
Induction step: For the inductive hypothesis we assume that P (k) is true.
That is, we assume that
1 + 3 + 5 + · · · + (2k − 1) = k 2 .
Example 2.12. Use mathematical induction to prove the inequality n < 2n for
all positive integers n.
Solution: Let P (n) be the proposition n < 2n , where n a positive integer.
Basis step: P (1) is true, because 1 < 21 = 2.
Induction step: For the inductive step, we assume that P (k) is true, namely
k < 2k for some positive integer k and we must prove that P (k + 1) is true, i.e.
we must prove that k + 1 < 2k+1 .
We have k < 2k . First we add 1 to both sides with taking in account 1 < 2k , for
some positive integer k. Therefore,
k + 1 < 2k + 1 < 2k + 2k = 2 · 2k = 2k+1
k + 1 < 2k+1 .
Hence, P (k + 1) is true and the statement is proven.
Dr. Akram Alqesmah 31
Example 2.13. Use mathematical induction to prove that the sum of a finite
number of terms of a geometric progression
n
X arn+1 − a
ari = a + ar + ar2 + · · · + arn = , r 6= 1,
i=0
r−1
arn+1 − a
a + ar + ar2 + · · · + arn = , r 6= 1.
r−1
Basis step: P (0) is true, because
ar0+1 − a
ar0 =
r−1
a(r − 1)
a= = a, r 6= 1.
r−1
Induction step: For the inductive step we assume that P (k) is true. That is,
we assume that
ark+1 − a
a + ar + ar2 + · · · + ark = , r 6= 1.
r−1
Now, we must prove that P (k + 1) is true, namely,
ark+2 − a
a + ar + ar2 + · · · + ark+1 = , r 6= 1.
r−1
By adding the term ark+1 to the both sides of the equation of P (k), we obtain
ark+1 − a
a + ar + ar2 + · · · + ark + ark+1 = + ark+1
r−1
ark+1 − a + ark+1 (r − 1)
=
r−1
k+1
ar − a + ark+2 − ark+1
=
r−1
ark+2 − a
= , r 6= 1.
r−1
Therefore, P (k + 1) is true and the prove is done.
Dr. Akram Alqesmah 32
2.7 Exercises
1. Use a direct proof to show that the sum of two odd integers is even.
2. Show that the square of an even number is an even number using a direct
proof.
4. Use a direct proof to show that the product of two odd numbers is odd.
5. Use a direct proof to show that every odd integer is the difference of the
squares of two consecutive integers.
11. Prove that if m and n are integers and mn is even, then m is even or n is
even. [Use a proof by contraposition]
15. Find a counterexample to the statement that every positive integer can be
written as the sum of the squares of three integers.
1 + 2 + 22 + · · · + 2n = 2n+1 − 1,
n(n + 1)(2n + 1)
12 + 22 + 32 + · · · + n2 =
6
for the positive integer n.
19. Use mathematical induction to prove that 2n < n!, for every positive integer
n with n ≥ 4.
3.1 Introduction
Definition 3.1. A set is an unordered collection of objects.
Often, the objects in a set have a common property. For instance, all the
students in this class make up a set. We denote to a set by uppercase letters like
A, B, C, .. etc.
Definition 3.2. The objects in a set are called the elements, or members, of the
set. A set is said to contain its elements.
Example 3.1.
34
Dr. Akram Alqesmah 35
4. The set of positive integers less than 100 can be denoted by {1, 2, 3, · · · , 99}.
Another way to describe a set is to use set builder notation. In this way, we
characterize all those elements in the set by stating the property or properties
they must have to be members. For instance, the set O of all odd positive integers
less than 10 can be written as
We often use this type of notation to describe sets when it is impossible to list
all the elements of the set.
Example 3.2.
O = {x ∈ Z | x = 2k + 1, k ∈ Z}.
E = {x ∈ Z | x = 2k, k ∈ Z}.
4. The set of positive integers less than 100, {1, 2, 3, · · · , 99} can be described
by
{x ∈ Z+ | x < 100}.
Dr. Akram Alqesmah 36
Remark 3.1. These sets, each denoted using a boldface letter, play an important
role in discrete mathematics:
Definition 3.3. Two sets A and B are equal if and only if they have the same
elements, and we write A = B.
Example 3.3. The sets {1, 3, 5}, {3, 1, 5} and {1, 1, 3, 3, 3, 5, 5, 5, 5} are equal
because they have the same elements.
Example 3.4. The Venn diagram that represents V , the set of vowels in the
English alphabet is as follows.
There is a special set that has no elements. This set is called the empty set,
or null set, and is denoted by φ. The empty set can also be denoted by { }. A
set with one element is called a singleton set.
Definition 3.4. The set A is said to be a subset of B if and only if every element
of A is also an element of B. We use the notation A ⊆ B to indicate that A is a
subset of the set B.
U
Example 3.5.
2. Z is a subset of Q.
3. Q is a subset of R.
4. The set of people of Yemen is a subset of the people of Yemen (that is, it
is a subset of itself).
(i) φ ⊆ S.
(ii) S ⊆ S.
Actually, to prove that two sets A and B are equal, we must prove that A ⊆ B
and B ⊆ A.
Example 3.6.
2. {1, 3, 3, 5, 5} = 3.
3. φ = 0.
Example 3.7. What is the power set of the set S = {0, 1, 2}?
Dr. Akram Alqesmah 39
Example 3.8. What is the power set of the empty set? What is the power set
of the set {φ}?
Example 3.10. Show that the Cartesian product B × A is not equal to the
Cartesian product A × B, where A and B are as in Example 3.9.
3.4 Exercises
4. Suppose that A = {2, 4, 6}, B = {2, 6}, C = {4, 6} and D = {4, 6, 8}.
Determine which of these sets are subsets of which other of these sets.
(i) 0 ∈ φ.
(ii) {0} ⊂ φ.
(iii) φ ∈ φ .
(iv) {φ} ⊂ φ, {φ} .
(v) {φ} ⊂ φ, {φ} .
(vi) φ ∈ φ, {φ} .
(vii) {φ} = {φ}, {φ} .
9. Determine whether each of these sets is the power set of a set, where a and
b are distinct elements.
(i) φ.
(ii) φ, {a} .
(iii) φ, {a}, {φ, a} .
(iv) φ, {a}, {b}, {a, b} .
(i) A × B.
(ii) B × A.
An element x belongs to the union of the sets A and B if and only if x belongs
to A or x belongs to B. Hence,
A ∪ B = x|x ∈ A ∨ x ∈ B .
The Venn diagram shown in Figure 3.3 represents the union of two sets A
and B. The area that represents A ∪ B is the shaded area within either the circle
representing A or the circle representing B.
A B
Example 3.11. The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5};
that is, {1, 3, 5} ∪ {1, 2, 3} = {1, 2, 3, 5}.
The Venn diagram shown in Figure 3.4 represents the intersection of two sets
A and B. The shaded area that is within both the circles representing the sets
A and B is the area that represents the intersection of A and B.
A B
A∩B
Example 3.12. The intersection of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 3};
that is, {1, 3, 5} ∩ {1, 2, 3} = {1, 3}.
Definition 3.10. Two sets are called disjoint if their intersection is the empty
set.
We often are interested in finding the cardinality of a union of two finite sets
A and B. Note that |A| + |B| counts each element that is in A but not in B or in
B but not in A exactly once, and each element that is in both A and B exactly
twice. Thus, if the number of elements that are in both A and B is subtracted
from |A| + |B|, elements in A ∩ B will be counted only once. Hence,
The Venn diagram shown in Figure 3.5 represents the difference of the sets A
and B. The shaded area inside the circle that represents A and outside the circle
that represents B is the area that represents A − B.
A B
A−B
Example 3.14. The difference of the sets {1, 3, 5} and {1, 2, 3} is the set {5};
that is, {1, 3, 5} − {1, 2, 3} = {5}. This is different from the difference of {1, 2, 3}
and {1, 3, 5}, which is the set {2}.
Definition 3.12. Let U be the universal set. The complement of the set A,
denoted by A, is the complement of A with respect to U . In other words, the
complement of the set A is U − A.
Dr. Akram Alqesmah 45
In Figure 3.6, the shaded area outside the circle representing A is the area
representing A.
Example 3.15. Let The universal set U be the set of letters of the English
alphabet. Then the complement of the set of vowels A = {a, e, i, o, u} is
A = {b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z}.
Example 3.16. Let A be the set of positive integers greater than 10 (where the
universal set U is the set of all positive integers). Then A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
To show that two sets are equal we have three ways, the first way uses the
set builder notation (as in Example 3.17) and in the second way we show that
each side is a subset of the other. Recall that to show that one set is a subset
of a second set, we can show that if an element belongs to the first set, then it
Dr. Akram Alqesmah 46
must also belong to the second set. We generally use a direct proof to do this
(see Example 3.18).
A = A, A ∪ A = U , A ∩ A = φ Complementation Law
A∪B =B∪A
A∩B =B∩A Commutative Laws
A∪ B∪C = A∪B ∪C
A∩ B∩C = A∩B ∩C Associative Laws
A∪ B∩C = A∪B ∩ A∪C
A∩ B∪C = A∩B ∪ A∩C Distributive Laws
A∪B =A∩B
A∩B =A∪B De Morgan’s Laws
A∪ A∩B =A
A∩ A∪B =A Absorption Laws
Finally, in the third way we can prove these identities by using a type of
tables is called a membership table. We illustrate the set builder type of proof
by establishing the second of De Morgan’s laws as follows:
Example 3.17. Use the set builder notation and logical equivalences to prove
that:
A ∩ B = A ∪ B.
Dr. Akram Alqesmah 47
Solution:
A∩B = x x∈
/ A∩B
= x ∼ x∈A ∩B
= x ∼ x∈A∧ x∈B
= x ∼ x∈A ∨ ∼ x∈B
= x x∈
/A ∨ x∈
/B
= x x∈A ∨ x∈B
=A ∪ B.
Example 3.18 illustrates the second way of proving the set identities.
Solution: Let
x ∈ A ∩ B ∪ C ⇒x ∈ A ∧ x ∈ B ∪ C
⇒x ∈ A ∧ x ∈ B ∨ x ∈ C
⇒ x∈A ∧ x∈ B ∨ x∈A ∧ x∈ C
⇒x ∈ A ∩ B ∨ x ∈ A ∩ C
⇒x ∈ A ∩ B ∪ A ∩ C .
Therefore,
A∩ B∪C ⊆ A∩B ∪ A∩C (1)
Now, let
Dr. Akram Alqesmah 48
x∈ A∩B ∪ A∩C ⇒x ∈ A ∩ B ∨ x ∈ A ∩ C
⇒ x∈A ∧ x∈ B ∨ x∈A ∧ x∈ C
⇒x ∈ A ∧ x ∈ B ∨ x ∈ C
⇒x ∈ A ∧ x ∈ B ∪ C
⇒x ∈ A ∩ B ∪ C
Thus,
A∩B ∪ A∩C ⊆ A∩ B∪C (2)
A B C B ∪C A∩ B∪C A∩B A∩C A∩B ∪ A∩C
1 1 1 1 1 1 1 1
1 1 0 1 1 1 0 1
1 0 1 1 1 0 1 1
1 0 0 0 0 0 0 0
0 1 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0
Table 3.2: A Membership Table for A ∩ B ∪ C = A ∩ B ∪ A ∩ C
Additional set identities can be established using those that we have already
proved. Consider Example 3.20.
Solution:
A ∪ B ∩ C =A ∩ B ∩ C
=A ∩ B ∪ C
=A ∩ C ∪ B
= C ∪ B ∩ A.
U
C
A B
U
C
A B
Example 3.21. Let A = {0, 2, 4, 6, 8}, B = {0, 1, 2, 3, 4}, and C = {0, 3, 6, 9}.
What are A ∪ B ∪ C and A ∩ B ∩ C ?
Definition 3.13. The union of a collection of sets is the set that contains those
Dr. Akram Alqesmah 51
elements that are members of at least one set in the collection, i.e.
n
[
A1 ∪ A2 ∪ · · · ∪ An = Ai .
i=1
Definition 3.14. The intersection of a collection of sets is the set that contains
those elements that are members of all the sets in the collection, i.e.
n
\
A1 ∩ A2 ∩ · · · ∩ An = Ai .
i=1
and n n
\ \
Ai = {i, i + 1, i + 2, · · · } = {n, n + 1, n + 2, · · · } = An
i=1 i=1
and ∞
\
A1 ∩ A2 ∩ · · · ∩ An ∩ · · · = Ai .
i=1
and ∞ ∞
\ \
Ai = {1, 2, 3, · · · , i} = {1} = A1 .
i=1 i=1
(ii) ∀ X, Y ∈ S, X ∩ Y = φ.
n
[
(iii) Xi = A, where Xi ∈ S, ∀ i = 1, 2, · · · , n.
i=1
Example 3.24. Suppose A = {1, 2, 3, 4, 5, 6}. Which of the following sets repre-
sent a partition of A.
S1 = {1, 4, 5}, {2}, {3, 6}
S2 = φ, {1, 2}, {3, 4, 5, 6}
S3 = {1, 2, 3, 4}, {4, 5, 6}
S4 = {1, 2}, {4, 5, 6} .
Hence, S1 is a partition of A.
Next, for S2 :
Also, for S3 :
Finally, for S4 :
Solution: Let A denotes to the set of all odd integers in U , B denotes to the set
of all even integers in U and C denotes to the set of integers not exceeding 5 in
U . i.e. A = {1, 3, 5, 7, 9}, B = {2, 4, 6, 8, 10} and C = {1, 2, 3, 4, 5}. Therefore,
A : 1010101010, B : 0101010101, and C : 1111100000
Solution: Using the membership table technique for the corresponding positions
in the bit strings, it can be seen that:
Find C − A and C − B.
Dr. Akram Alqesmah 55
3.10 Exercises
(i) A ∪ B
(ii) A ∩ B
(iii) A − B
(iv) B − A
4. Prove the first De Morgan law in Table 3.1 by showing that if A and B two
are sets, then A ∪ B = A ∩ B
(i) A ∪ (B ∪ C) = (A ∪ B) ∪ C
(ii) A ∩ (B ∩ C) = (A ∩ B) ∩ C
(iii) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C).
(i) A ∩ B ∩ C
(ii) A ∪ B ∪ C
(iii) (A ∪ B) ∩ C
(iv) (A ∩ B) ∪ C
(i) Ai = {i, i + 1, i + 2, · · · }.
(ii) Ai = {0, i}.
(iii) Ai = {−i, i}.
(iv) Ai = {−i, −i + 1, · · · , −1, 0, 1, · · · , i − 1, i}.
12. Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Express each of these sets with bit
strings
13. In Exercise 12, find by using the bit strings of the sets
(i) A ∩ B.
(ii) A ∪ B.
(iii) B − A.
(iv) C − A.
(v) C − B.
14. Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Find the set specified by each of these
bit strings
(i) 1111001111.
(ii) 0101111000.
(iii) 1000000001.