Basic Set Theory: 1 2 2 Sets and Elements 2
Basic Set Theory: 1 2 2 Sets and Elements 2
Basic Set Theory: 1 2 2 Sets and Elements 2
Contents
1 Introduction 2
1
Sets and Elements 2
1 Introduction
Set theory is a basis of modern mathematics, and notions of set theory are used in all formal
descriptions. The notion of set is taken as undefined, primitive, or basic, so I will not try to
define what a set is, but an informal description is provided below, and also described are some
important properties and operations regarding sets, and some examples. All other notions of
mathematics can be built up based on the notion of set.
Notice that the sets in the odd numbered examples are defined, i.e., presented, by actually
listing its elements; and the sets in the even numbered examples are defined by stating properties,
i.e., rules, which decide whether or not a particular object is an element of the set.
As seen in the above examples, sets can consist of elements of various natures: people, physical
objects, numbers, signs, and, sometimes, other sets as well. (We will use the words object or
entity in a very broad way to include all these different kinds of things.) A set is an object; its
members do not have to be physically collected together for them to constitute a set.
The membership criteria for a set must in principle be well-defined, and not vague. If we
have a set and an object, it is possible that we do not know whether this object belongs to the
set or not, because of our lack of information or knowledge. (E.g. “The set of students in this
room over the age of 15”: a well-defined set but we may not know who is in it.) But the answer
should exist, at any rate in principle. It could be unknown, but it should not be vague. If the
answer is vague for some collection, we cannot consider that collection as a set. Another thing:
If we have a set, then for any two elements of it, x and y, it should not be vague whether x = y,
or they are different. (If they are identical, then they are not actually “two” elements of it; the
issue really arises when we have two descriptions of elements, and we want to know whether those
descriptions describe the same element, or two different elements.)
For example: is the letter q the same thing as the letter Q? Well, it depends on what set we
are considering. If we take the set of the 26 letters of the English alphabet, then q and Q are
the same element. But if we take the set of 52 upper-case and lower-case letters of the English
alphabet, then q and Q are two distinct elements. Either is possible, but we have to make it clear
what set we are talking about, so that we know whether or not q = Q. Sometimes we simply
assume for the sake of examples that a description is not vague when perhaps for other purposes
it would be vague – e.g., the set of all red objects.
2.1 Notations
Usually, sets are denoted by capital letters of the alphabet like A, B, C, X, Y , . . . while the
elements are denoted by small letters a, b, c, x, y, z, . . . and so on. We also have the following
notations:
• set of natural numbers: N
• set of prime numbers: P
• set of integers: Z
• set of rational numbers: Q
• set of real numbers: R
• set of positive real numbers: R+
If a is an element of a set A, we write down a ∈ A (read “a belongs to A”) and if a is not an
element of set A, we write a ∈/ A (read “a does not belong to A”).
There are two ways to specify sets:
• the tabular or roster form
• set-builder form
In roster or tabular form, the set is specified by actually listing all its distinct elements separated
by commas and enclosing them inside a pair of braces {}. For example, let set A consist of the
numbers 1, 3, 7, and 10, then we write
A = {1, 3, 7, 10}
In set-builder form, we specify the set by stating the property or properties satisfied by a generic
element to be part of the set. For example, if B is the set of all even integers, then B can be
specified as:
B = {x | x = 2n, n ∈ Z}
which reads “B is the set of x such that x is equal to 2n for an integer n”. The x before “|”
represents a generic element of the set, the vertical bar “|” means “such that” and the statement
after the vertical bar gives the condition which x satisfies. As examples, let us write the ten sets
given in the above examples using these notations:
Example 11. A1 = {1, 3, 7, 10}.
Example 12. A2 = {x | x2 − 3x − 2 = 0}.
Example 13. A3 = {a, e, i, o, u}.
Example 14. A4 = {x | x is a person living on the earth presently}.
Example 15. A5 = {Ramesh, Suresh, Mahesh}.
Example 16. A6 = { x | x is a student, x is absent from school}.
Example 17. A7 = {India, Pakistan, Bangladesh}.
Example 18. A8 = {x | x is a capital city, x is in Europe}.
Example 19. A9 = {2, 4, 6, 8, . . . }.
Example 20. A10 = { x | x is a river, x is in India}.
Equality of sets: Two sets A and B are equal, written A = B, if they have the same elements,
that is, if every element which belongs to A also belongs to B, and vice versa. The negation of
A = B is written A ̸= B.
2.3 Subset
If every element in a set A is also a member of a set B, then A is called a subset of set B. More
specifically, A is a subset of B if x ∈ A implies x ∈ B.
If A is a subset of B, we denote this relationship by writing
A⊂B
Example 22. The set E = {2, 4, 6} is a subset of F = {6, 4, 2}, since each element 2, 4 and 6 belonging
to E also belongs to F . Note, in particular, that E = F . In a similar manner it can be shown that every
set is a subset of itself.
Example 23. Let G = {x | x is a positive even integer}, and H = {x | x is a positive integral power of 2}.
Then H ⊂ G.
With the above definition of a subset, we are able to restate the definition of the equality of
two sets:
Definition 1 (Equality of two sets). Two sets A and B are equal, i.e. A = B, if and only if
A ⊂ B and B ⊂ A.
B⊃A
A ̸⊂ B or B ̸⊃ A
B⊂A and A ̸= B
B⊆A
B⊂A
We will continue to use the notations introduced in Section 2.3 in which we do not distinguish
between a subset and a proper subset.
Example 25. The set A = {{2, 3}, {2}, {5, 6}} is a family of sets. Its members are the sets {2, 3},
{2}, and {5, 6}.
Theoretically, it is possible that a set has some members which are sets themselves and some
members which are not sets, although in any application of the theory of sets this case arises
infrequently.
Example 26. Let A = {2, {1, 3}, 4, {2, 5}}. Then A is not a family of sets; here some elements of A
are sets and some are not.
2T = {T, {4, 7}, {4, 8}, {7, 8}, {4}, {7}, {8}, ∅}
If a set S is finite, say S has n elements, then the power set of S can be shown to have 2n
elements. This is one reason why the class of subsets of S is called the power set of S and denoted
by 2S .
Example 30. Let A be the set of all even integers and B the set of all odd integers. Then A and B are
disjoint since no integer is simultaneously even and odd.
Example 31. Let E = {x, y, z} and F = {r, s, t}. Then E and F are disjoint.
U U U
B B B
A A
A
A ∪ B = {x | x ∈ A, or x ∈ B}
S ∪ T = {a, b, c, d, f, g}
Example 33. Let P be the set of positive real numbers and let Q be the set of negative real numbers.
Then P ∪ Q, the union of P and Q, consists of all real numbers except zero.
111111
000000
U 000000
111111
000000
111111
U U
000
111
000000
111111 1
0
000
111
000000
111111
000
111 0
1 11
00
000000
111111
000
111 B 0
1 B 00
11
00
11 B
000000
111111
A
000
111
A 0
1
0
1
A
00
11
000000
111111
000
111 00
11
000000
111111
000000
111111
Figure 2: A ∪ B is the shaded Figure 3: A ∩ B is the shaded Figure 4: A − B is the shaded
portion portion portion
It follows directly from the definition of the union that the sets A ∪ B and B ∪ A are the same
set, i.e.,
(Commutative Property) : A∪B =B∪A
We also notice that A ⊂ (A ∪ B) and B ⊂ (A ∪ B).
That is, whenever y is in C, it is also in B. Hence C ⊂ B. So B ⊂ C and C ⊂ B. But this implies that
B = C.
A − B = {x | x ∈ A, x ∈
/ B}
Also note that (A − B) ⊂ A and the sets (A − B), A ∩ B, and (B − A) are mutually disjoint,
that is, the intersection of any two is the null set.
The difference of A and B is also denoted by A/B or by A ∼ B.
3.4 Complement
The complement of a set A is the set of the elements which do not belong to A, the difference of
the universal set U and A. We denote the complement of A by Ac or A′ . It can be written in a
concise form as
A′ = {x | x ∈ U, x ∈
/ A}
In Figure 5, A′ is shown by the shaded portion assuming that the universal set consists of the
1111111111
0000000000
0000000000
1111111111
0000000000
1111111111
U
0000000000
1111111111
0000000000
1111111111A B
0000000000
1111111111
0000000000
1111111111
Figure 5: A′ is the shaded portion.
entire rectangle. The following facts follow directly from the definition of the complement:
(i) The union of a set A and its complement A′ is the universal set U, i.e. A ∪ A′ = U. Further,
A and A′ are disjoint, i.e. A ∩ A′ = ∅.
(ii) The complement of the universal set is the empty set and vice-versa, i.e. U′ = ∅ and
∅′ = U.
(iii) The complement of the complement of a set is the set itself: (A′ )′ = A.
Also notice that the difference of two sets A and B can be expressed as follows:
A − B = A ∩ B′
/ B} = {x | x ∈ A, x ∈ B ′ } = A ∩ B ′
A − B = {x | x ∈ A, x ∈
⊙ Theorem 2. Let A be a subset of B. Then the union of A and B is precisely B, that is,
A ⊂ B implies A ∪ B = B.
⊙ Theorem 5 (De Morgan’s first theorem). The complement of the union of two sets is the
intersection of the complements, that is, (A ∪ B)′ = A′ ∩ B ′ .
Proof. Consider x ∈ (A ∪ B)′ ; then x does not belong to A ∪ B. Therefore x ̸∈ A and x ̸∈ B, i.e.
x ∈ A′ and x ∈ B ′ , and by the definition of intersection, x ∈ A′ ∩ B ′ . Hence x ∈ (A ∪ B)′ implies
x ∈ A′ ∩ B ′ , i.e.
(A ∪ B)′ ⊂ (A′ ∩ B ′ )
Next, let y ∈ (A′ ∩ B ′ ); then y belongs to A′ and y belongs to B ′ . Thus, y ̸∈ A and y ̸∈ B and
hence y ̸∈ (A ∪ B), i.e. y ∈ (A ∪ B)′ . Hence, y ∈ (A′ ∩ B ′ ) implies y ∈ (A ∪ B)′ , i.e.
(A′ ∩ B ′ ) ⊂ (A ∪ B)′
⊙ Theorem 6 (De Morgan’s second theorem). The complement of the intersection of two sets
is the union of their complements, that is, (A ∩ B)′ = A′ ∪ B ′ .
twice (once with |A| and again with |B|). So we remove the number of common elements once
to rectify our mistake so that
This statement is called the principle of inclusion and exclusion (PIE in short) for two sets.
Example 36. How many integers from 1 to 100 are multiples of 2 or 3?
Solution: Let A denote the set of all integers from 1 to 100 that are even, and let B denote the set of all
integers from 1 to 100 that are odd. Then we need |A ∪ B|. First of all |A| = 50 since we have 2 × 1, 2 × 2,
2 × 3, . . . , 2 × 50 = 100. Similarly, since 3 × 1, 3 × 2, . . . 3 × 33 = 99, we have |B| = 33. Also, A ∩ B is the
set of integers from 1 to 100 that are multiple of 2 and 3 both, i.e. they are multiple of 6. Since 6, 6 × 2,
. . . , 6 × 16 = 96, we get |A ∩ B| = 16. Hence, by Equation 2, we have
|A ∪ B| = |A| + |B| − |A ∩ B| = 50 + 33 − 16 = 67
In Figure 6, it is shown how the formula takes into account each region exactly once by depicting
Figure 6: Each term of the inclusion-exclusion formula gradually corrects the count until finally each portion of
the Venn diagram is counted exactly once.
the number of times each region is counted by the various terms of Equation 3.
Generalizing the results of these examples gives the principle of inclusion-exclusion for a
finite numbers of sets: to find the number of elements of the union of n sets, i) include the
number of elements of the sets, ii) exclude the number of elements of the pairwise intersections,
iii) include the number of elements of the triple-wise intersections, iv) exclude the number of
elements of the quadruple-wise intersections, v) include the number of elements of the quintuple-
wise intersections, vi) and continue, until the number of elements of the n-tuple-wise intersection
is included (if n is odd) or excluded (n even). That is for a finite number n of sets A1 , A2 , . . . ,
An :
∪n ∑ n ∑ ∑
Ai = |Ai | − |Ai ∩ Aj | + |Ai ∩ Aj ∩ Ak | − · · · + (−1)n−1 |A1 ∩ . . . ∩ An |
i=1 i=1 1≤i<j≤n 1≤i<j<k≤n
(4)