INTRODUCTION TO SETS
MATH 101 Lecture Notes
Department of Mathematics, Botswana International University of Science and Technology
December 12, 2016
Definition 1 A set is a collection of clearly defined objects. The objects are usually
called the elements of a set.
Notations
a) We shall use capital letters A, B, C, . . . to denote sets and lower case letters a, b, c, . . .
to denote the objects or elements belonging to these sets.
We denote the set of all rational numbers (fractions) by Q and the set of all real
numbers by R.
b) If an object a belongs to a set A, we express this fact by the notation
a ∈ A.
2 √
For example, ∈ Q and 2 ∈ R.
3
√
c) If a does not belong to A, we write a ∈
/ A to express this fact. For example 2∈
/Q
and π ∈
/ Q.
d) We write a = b to mean that a and b are symbols for the same object. (Two sets
A and B are equal if they have exactly the same elements, in which case we write
A = B).
e) A 6= B will be used to indicate that the sets A and B are different.
Subset
Definition 2 If A and B are sets, we say that A is a subset of B if every element of A
is also an element of B. We express this fact by
A⊂B
↑
inclusion
The inclusion A ⊂ B is read “A is contained in B.”
1
Remark 3 Note that this is not the same thing as A ∈ B. For example, if A = {1, 2, 3}
and B = {1, 2, 3, 4, 5}, then A ⊂ B and A ∈
/ B because the elements of B are 1, 2, 3, 4
and 5 but A is not one of these.
Remark 4 If A = B, then it is true that A ⊂ B and B ⊂ A.
Definition 5 If A ⊂ B and A is different from B, then we say that A is a proper subset
of B, and write
A(B
↑
proper inclusion
Remark 6 If A ⊂ B, then we can also express this fact by B ⊃ A, which reads as “B
contains A”.
Specifying A Set
Perhaps the simplest way to specify a set is by listing all its elements. We use the notation
A = {1, 2, 3, 4}
to denote the set A whose elements are 1, 2, 3 and 4. If A is the set consisting of the
elements a, b, c, d, e and f , then we can write
A = {a, b, c, d, e, f }.
However, if the set has infinite number of elements, then it can not be specified by listing
all its elements. The usual way to specify a set A with infinitely many elements is to
take some property that elements of A may or may not possess, and to form the set
consisting of all elements of A having that property. For example, the set of even integers
is expressed as
A = {x | x is an even integer}.
Here, the vertical bar | implies “such that”. So the above equation reads ‘A is a set of
elements x such that x is an even number’.
Example 7 Identify the following sets:
(a) A = {x | x ∈ Q} (b) B = {x | x ∈ Q and x > 0} (c) C = {x | x2 − 1 = 0}
Solution: (a) The set A consists of all numbers x such that x is a rational number
(x ∈ Q). The numbers with this property are all rational numbers. Therefore, A is the
set of all rational numbers.
(b) The set B consists of all numbers x such that x is a rational number (x ∈ Q) and
x is positive (x > 0). The numbers with these two properties are all positive rational
numbers. Therefore, B is the set of all positive rational numbers.
(c) The set C consists of all numbers x such that x2 − 1 = 0. There are only two numbers
satisfying this property, namely, 1 and −1. Therefore, C = {−1, 1}.
2
Convention
We denote by ∅, the set with no elements. The set ∅ is called an empty set. For example,
the set
A = {x ∈ R | x2 + 1 = 0}
is empty. This is because there are no real numbers satisfying
x2 + 1 = 0.
Note that if x is a real number, then x2 is either zero or positive.
Similarly, the set
B = {x ∈ R | x2 + 1 < 0}
is empty. This is because, we can not find any real number x such that x2 + 1 is negative.
1 Set Operations
We can form new sets from existing ones.
The Union of A and B
Definition 8 The union of two sets A and B is the set consisting of all elements x that
belong to A or to B or to both. It is denoted by A ∪ B. In symbols, we write
A ∪ B = {x | x ∈ A or x ∈ B}.
A B
A∪B
Example 9 If A = {1, 2, 3, 4, 5} and B = {2, 4, 6, 8, 10} then A∪B = {1, 2, 3, 4, 5, 6, 8, 10}.
The intersection of sets
The intersection of A and B, denoted A ∩ B, is the set consisting of those elements
common to A and B. In symbols,
A ∩ B = {x | x ∈ A and x ∈ B}
A B
A∩B
3
Example 10 The intersection of the sets in Example 9 is the set {2, 4}. That is, A∩B =
{2, 4}.
Example 11 If A = {2, 4, 6, 8, 10} and B = {1, 3, 5, 7, 11}, then
A ∩ B = ∅.
That is, A and B have no common elements. In this case, we say that A and B are
disjoint.
Definition 12 Two sets A and B are said to be disjoint if their intersection is empty.
Remark 13 From the definitions of union and intersection of a set, we always have the
equations
A ∪ ∅ = A and A ∩ ∅ = ∅.
The Difference Of Two Sets
The difference of A and B, denoted by A − B, is the set consisting of those elements of
A that are not in B. That is,
A − B = {x | x ∈ A and x ∈
/ B}.
A B
A−B
It is sometimes called the complement of B relative to A, (or the complement of B in A)
Example 14 (a) If A = {1, 2, 3, 4, 5} and B = {2, 4, 6, 7, 8}, then
A − B = {1, 3, 5} and B − A = {6, 7, 8}.
(b) If A = {2, 4, 6, 8, 10} and B = {1, 3, 5, 7, 9, 11}, then
A − B = {2, 4, 6, 8, 10} = A and B − A = {1, 3, 5, 7, 9, 11} = B.
That is, A and B have no common elements. In this case, we say that A and B are
disjoint.
Remark 15 If A and B are disjoint, i.e., A ∩ B = ∅, then A − B = A and B − A = B.
Remark 16 Note that if U is the universal set, then
U − A = {x | x ∈ U and x ∈
/ A}
is just the complement of A.
4
Rules of set theory
As in algebra, we use parentheses to indicate in what order the operations are to be per-
formed. For example A ∪ (B ∩ C) denotes the union of the two sets A and B ∩ C while
(A ∪ B) ∩ C denotes the intersection of the two sets A ∪ B and C. In general, the sets
A ∪ (B ∩ C) and (A ∪ B) ∩ C are different as seen below.
A B A B
C C
A ∪ (B ∩ C) (A ∪ B) ∩ C
Example 17 Let the sets A = {1, 5, 6, 8, 12, 15}, B = {3, 5, 7, 9, 11, 12} and
C = {4, 5, 8, 9, 10, 13} be given. Find
(a) A ∪ (B ∩ C) (b) (A ∪ B) ∩ C
Solution: (a) We first find elements of the set B ∩ C by finding the common elements of
A and B. Such elements are 5 and 9. Therefore
B ∩ C = {5, 9}.
Next, we find the union of the sets A and B ∩ C by finding elements that are either in A
or B ∩ C, or both. Such elements are 1, 5, 6, 8, 9, 12 and 15. Therefore,
A ∪ (B ∩ C) = {1, 5, 6, 8, 9, 12, 15}.
(b) In this case, we first find elements of the set A ∪ B. By definition, these are numbers
that are in A or B, or in both A and B. Such elements are 1, 3, 5, 6, 7, 8, 9, 11, 12 and 15.
Therefore
A ∪ B = {1, 3, 5, 6, 7, 8, 9, 11, 12, 15}.
Next, we find the intersection of the sets A ∪ B and C by finding numbers that are in
both A ∪ B and C. Such elements are 5, 8, 9. Hence
(A ∪ B) ∩ C = {5, 8, 9}.
Remark 18 Example 17 shows that indeed the sets A ∪ (B ∩ C) and (A ∪ B) ∩ C are in
general different.
Exercises
1. Distributive laws
Use Venn diagrams below to show that
5
a) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
b) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
2. De Morgan’s Laws
Use Venn diagram below to show that
a) A − (B ∪ C) = (A − B) ∩ (A − C)
b) A − (B ∩ C) = (A − B) ∪ (A − C)
Example 19 Let the sets A = {1, 5, 6, 8, 12, 15}, B = {3, 5, 7, 9, 11, 12} and
C = {4, 5, 8, 9, 10, 13} be given. Show that
(a) A − (B ∪ C) = (A − B) ∩ (A − C) (b) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
Solution: The idea is to show that the set on the Left Hand Side (LHS) is exactly the
set on the Right Hand Side (RHS).
(a) To find elements of the set A − (B ∪ C), we first find elements of the set B ∪ C by
finding all numbers that are either in B or C or in both B and C. Such elements are
3, 4, 5, , 7, 8, 9, 10, 11, 12 and 13. Therefore
B ∪ C = {3, 4, 5, , 7, 8, 9, 10, 11, 12, 13}.
Next we find elements that are in A but not in the set B ∪ C. Such elements are 1, 6 and
15. That is,
LHS = A − (B ∪ C) = {1, 6, 15}.
On the other hand,
(A − B) = {1, 6, 8, 15} and (A − C) = {1, 6, 12, 15}.
The numbers that are common to the sets (A − B) and (A − C) are 1, 6 and 15. That is
RHS = (A − B) ∩ (A − C) = {1, 6, 15}.
Since LHS=RHS, the identity in part (a) above is shown.
(b) From part (a) above,
B ∪ C = {3, 4, 5, , 7, 8, 9, 10, 11, 12, 13}.
The elements that are common to both A and B ∪ C are 5, 8 and 12. Therefore,
LHS = A ∩ (B ∪ C) = {5, 8, 12}.
On the other hand,
(A ∩ B) = {5, 12} and (A ∩ C) = {5, 8}.
The numbers that are either in the sets (A ∩ B) or (A ∩ C), or in both (A ∩ B) and (A ∩ C)
are 5, 8 and 12. That is
RHS = (A ∩ B) ∪ (A ∩ C) = {5, 8, 12}.
Since LHS=RHS, the identity in part (b) above is shown.
6
2 Intervals
Open Intervals
Let a < b. The open interval from a to b, denoted by (a, b) consists of all numbers between
a and b, excluding a and b.
The open interval can be written as
(a, b) = {x ∈ R | a < x and x < b}
= {x ∈ R | a < x < b}.
a b
The points a and b are called endpoints. The open circles and parenthesis ( and ) are used
to indicate that the endpoints are not included. Examples of open intervals are (0, 1) and
(−3, 2).
Closed Intervals
Let a < b. The closed interval from a to b, denoted by [a, b] consists of all numbers
between a and b, including the endpoints a and b.
The closed interval can be written as
[a, b] = {x ∈ R | a ≤ x and x ≤ b}
= {x ∈ R | a ≤ x ≤ b}.
a b
The solid/shaded circles and square brackets [ and ] are used to indicate that the endpoints
are included. Examples of closed intervals are [0, 1] and [−3, 2].
Other Types of Intervals
In some cases, we may form intervals in which one endpoint is included but not the other.
For example,
(a, b] = {x ∈ R | a < x and x ≤ b}
= {x ∈ R | a < x ≤ b}.
a b
An example of such an interval is (2, 9].
Another form of interval with only one endpoint included is
[a, b) = {x ∈ R | a ≤ x and x < b}
= {x ∈ R | a ≤ x < b}.
7
a b
An example of such interval is [−2, 0)
Example 20 Given that A = (−3, 6) and B = (2, 11], find
(a) A ∪ B (b) A ∩ B (c) A − B.
Solution: (a) We use a number line to find all numbers that are in A or B, or in both A
and B.
B
A
-3 2 6 11
A∪B
Therefore, A ∪ B = (−3, 11].
(b) We draw the intervals and find where the two intervals overlap.
B
A
-3 2 6 11
A∩B
The intersection of two intervals is (2, 6).
(c) From the graph below, A − B = (−3, 2] and B − A = [6, 11].
B
A
-3 2 6 11
A−B B−A
Rays
There are also intervals that extend infinitely in one direction without ending. Such
intervals are sometimes called rays. For example
(a, ∞) = {x ∈ R | a < x < ∞}.
a
Note that ∞ is not a new number. This symbol is used to indicate that the ray is
extending without ending in one direction.
Sometimes we write this interval as
(a, ∞) = {x ∈ R | x > a}.
In the particular case when a = 0, this interval becomes
(0, ∞) = {x ∈ R | x > 0},
which is the set of all positive real numbers.
8
Another interval that extends without ending in one direction is
(−∞, b) = {x ∈ R | −∞ < x < b}.
b
Sometimes we write this interval as
(−∞, b) = {x ∈ R | x < b}.
In the particular case when b = 0, this interval becomes
(−∞, 0) = {x ∈ R | x < 0}.
which is the set of all negative real numbers.
Note that in the last two examples, we may include the endpoints a and b, respectively
to get the rays
[a, ∞) = {x ∈ R | a ≤ x < ∞},
when a is included. This interval is drawn below
In the case when the endpoint b is includes, we have
(−∞, b] = {x ∈ R | −∞ < x ≤ b}.
This interval is drawn below
b
Another important interval is one in which the ray extends infinitely in both directions.
This interval is represented by
(−∞, ∞] = {x ∈ R | −∞ < x ≤ ∞}.
In fact, this interval is the set of all real numbers.
1
Example 21 Given that A = (−3, 2], B = , 5 and C = [−1, ∞), find
2
(a) A − B (b) A − C (c) (A − B) ∩ (A − C) (d) A − (B ∪ C).
Solution: (a) We use a number line to find elements/numbers that are in A but not in B.
B
A
-3 0.5 2 5
A−B
1
Therefore, A − B = −3, .
2
9
(b) Similarly, we use a number line to find elements/numbers that are in A but not in C.
C
A
-3 -1 2
A−C
Therefore, A − C = (−3, −1).
1
(c) From part (a) and (b), we have A − B = −3, and A − C = (−3, −1).
2
(A − C)
A−B
-3 -1 0.5
(A − B) ∩ (A − C)
1
The numbers that are in both A − B = −3, and A − C = (−3, −1) are all the real
2
numbers between −3 and −1, excluding −3 and −1. Therefore,
(A − B) ∩ (A − C) = (−3, −1).
(d) We first first find elements of the set B ∪ C using the following
C
B
-1 0.5 5
B∪C
From the above, it follows that B ∪ C = [−1, ∞). We now find numbers that are in A
but not in [−1, ∞)
B∪C
A
-3 -1 2
A − (B ∪ C)
From the above, numbers that are in A but not in [−1, ∞) are all numbers in the interval
(−3, −1). Therefore, A − (B ∪ C) = A − C = (−3, −1).
Remark 22 We may also find the set A − (B ∪ C) by first observing that B ∪ C =
[−1, ∞) = C. Then from B ∪ C = C, it follows from part (b) of the above example that
A − (B ∪ C) = A − C = (−3, −1).
10