0% found this document useful (0 votes)
20 views120 pages

Discrete Structures - Section 2

The document is a comprehensive overview of set theory, which serves as the foundation of modern mathematics. It covers definitions, operations, subsets, universal and empty sets, Venn diagrams, and relations, providing a structured approach to understanding sets and their properties. The content is aimed at engineers and students, emphasizing a naive set theory approach to avoid paradoxes while still being rigorous.

Uploaded by

berefo81
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views120 pages

Discrete Structures - Section 2

The document is a comprehensive overview of set theory, which serves as the foundation of modern mathematics. It covers definitions, operations, subsets, universal and empty sets, Venn diagrams, and relations, providing a structured approach to understanding sets and their properties. The content is aimed at engineers and students, emphasizing a naive set theory approach to avoid paradoxes while still being rigorous.

Uploaded by

berefo81
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 120

SET THEORY

DISCRETE STRUCTURES - COE 253


P. A. KWABI (Ph.D.)
TABLE OF CONTENTS
0
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 1/119
Table of Contents
1 INTRODUCTION
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 2/119
INTRODUCTION
1 INTRODUCTION

Set theory is generally considered to be the foundation of all modern mathematics. This
means that most mathematical objects (numbers, relations, functions, etc.) are defined in
terms of sets.
Unfortunately for engineers, set theory is not quite as simple as it seems. It turns out that
simple approaches to set theory include paradoxes (e.g., statements which are both true
and false). These paradoxes can be resolved by putting set theory in a firm axiomatic
framework, but that exercise is rather unproductive for engineers.
Instead, we adopt what is called naive set theory which rigorously defines the operations
of set theory without worrying about possible contradictions.
This approach is sufficient for most of mathematics and also acts as a stepping-stone to
more formal treatments.

P. A. KWABI (Ph.D.) SET THEORY 3/119


Table of Contents
2 DEFINITION OF SETS THEORY
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 4/119
SETS AND ELEMENTS
2 DEFINITION OF SETS THEORY

Definition
A set is taken to be any collection of objects, mathematical or otherwise. For example,
one can think of “the set of all KNUST students admitted in 2023”. The only thing that
matters to a set is the elements in it. The objects in a set are referred to as elements or
members of the set. One usually uses capital letters, A, B, X, Y, . . . , to denote sets, and
lowercase letters, a, b, x, y, . . . , to denote elements of sets.
A set is uniquely defined by its elements.
The logical statement “a is a member of the set A” is written

a ∈ A.

Likewise, its logical negation “a is not a member of the set A” is a ∈


/ A.

P. A. KWABI (Ph.D.) SET THEORY 5/119


Therefore, exactly one of these two statements is true. In naive set theory, one assumes
the existence of any set that can be described in words.

Mathematical examples of sets are N, the set of natural numbers, Z, the set of integers,
Q, the set of all rational numbers (i.e fractions) and R, the set of all real numbers.
Definition
Two sets are equal if and only if they have the same elements. Therefore, if A and B are
sets, then A and B are equal if and only if ∀x(x ∈ A ↔ x ∈ B). We write A = B if A and B
are equal sets.

P. A. KWABI (Ph.D.) SET THEORY 6/119


Table of Contents
3 DESCRIBING A SET
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 7/119
DESCRIBING A SET
3 DESCRIBING A SET

There are several ways to describe a set. One way is to list all the members of a set, when
this is possible. We use a notation where all members of the set are listed between
braces. For example, the notation {a, b, c, d} represents the set with the four elements a,
b, c, and d. This way of describing a set is known as the roster method.
Example 1
The set V of all vowels in the English alphabet can be written as V = {a, e, i, o, u}.

Example 2
The set O of odd positive integers less than 10 can be expressed by O = {1, 3, 5, 7, 9}.

P. A. KWABI (Ph.D.) SET THEORY 8/119


Example 3
Although sets are usually used to group together elements with common properties, there
is nothing that prevents a set from having seemingly unrelated elements. For instance,
{a, 2, Fred, NewJersey} is the set containing the four elements a, 2, Fred, and New Jersey

Example 4
The set of positive integers less than 100 can be denoted by {1, 2, 3, ..., 99}.

P. A. KWABI (Ph.D.) SET THEORY 9/119


DESCRIBING A SET
3 DESCRIBING A SET

Another way to describe a set is to use set builder notation. We characterize all those
elements in the set by stating the property or properties they must have to be members.
The general form of this notation is {x|x has property P} and is read ”the set of all x such
that x has property P.” For instance, the set O of all odd positive integers less than 10 can
be written as

O = {x|x is an odd positive integer less than 10} ,


or, specifying the universe as the set of positive integers, as

O = x ∈ Z+ |x is odd andx < 10




We often use this type of notation to describe sets when it is impossible to list all the
elements of the set.

P. A. KWABI (Ph.D.) SET THEORY 10/119


For instance, the set Q+ of all positive rational numbers can be written as
 
+ p
Q = x ∈ R|x = , for some positive integers p and q .
q
These sets, each denoted using a boldface letter, play an important role in discrete
mathematics:
N = {0, 1, 2, 3, ...} , the set of all natural numbers
Z = ..., −2, −1, 0, 1, 2, ..., the set of all integers
Z+ =n{1, 2, 3, }, the set of all positive
o integers
p
Q = q |p ∈ Z, q ∈ Z, andq ̸= 0 , the set of all rational numbers
R, the set of all real numbers
R+ , the set of all positive real numbers
C, the set of all complex numbers.
P. A. KWABI (Ph.D.) SET THEORY 11/119
Table of Contents
4 SUBSETS
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 12/119
SUBSETS
4 SUBSETS

Definition
Suppose A and B are sets. Then A is called a subset of B (denoted A ⊆ B) if, for every
element x, if x ∈ A we also have that x ∈ B. This means that
A ⊆ B ⇔ ∀x((x ∈ A) → (x ∈ B)).

We also say that B contains A. By B ⊃ A or B ⊇ A


If for each set B we find B to be a subset of itself, then B ⊆ B. Moreover the empty set ϕ,
that is the set with no elements, is a subset of B (every set).
A subset A of set B which is not the empty set or the set itself is called a proper subset of
B.

P. A. KWABI (Ph.D.) SET THEORY 13/119


Proposition
Suppose A, B and and C are sets. Then the following hold:
1. If A ⊆ B and B ⊆ C then A ⊆ C
2. If A ⊆ B and B ⊆ A then A = B

P. A. KWABI (Ph.D.) SET THEORY 14/119


Proof.
We prove the first statement. Suppose that A ⊆ B and B ⊆ C. Let a ∈ A. Since A ⊆ B, we
find a ∈ B. Now since we also have B ⊆ C, the element a is also in C.

This shows that for every element a ∈ A, we also have a ∈ C. hence A ⊆ C.

As for the second statement. Every element of A is in B and every element of B is in A. But
as a set is uniquely defined by its elements, we find A = B. The statement
A ⊆ B and B ⊆ A then A = B may seem to be a trivial observation but it will be prove to
be very useful.
To prove this we first have to show that A ⊆ B by proving that each element x ∈ A is also
an element of B and then that B ⊆ A then A = B by proving that each y ∈ B is also in
A.
P. A. KWABI (Ph.D.) SET THEORY 15/119
Example
It is true that 1 ∈ {1, 2, 3} and {1} ⊆ {1, 2, 3} but not that 1 ⊆ {1, 2, 3} or
{1} ∈ {1, 2, 3}

Example
Notice that ϕ ∈ {ϕ} and ϕ ⊆ {ϕ}

P. A. KWABI (Ph.D.) SET THEORY 16/119


Table of Contents
5 UNIVERSAL SET AND EMPTY SETS
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 17/119
UNIVERSAL SETS AND EMPTY SETS
5 UNIVERSAL SET AND EMPTY SETS

All sets under investigation in any application of set theory are assumed to belong to some
fixed large set called the universal set denoted by U unless otherwise stated or implied.
Given a universal set U and a property P, there may not be any elements of U which have
property P. For example, the following set has no elements:

S = {x|x is a positive integer, 2x = 3}

Such a set with no elements is called the empty set or null set and is denoted by ϕ

The empty set ϕ is also regarded as a subset of every other set. Thus we have the
following simple result which we state formally.

P. A. KWABI (Ph.D.) SET THEORY 18/119


A set with one element is called a singleton set. A common error is to confuse the empty
with the set {ϕ}, which is a singleton set. The set {ϕ} has one more element than ϕ. The
single element of the set {ϕ} is the empty set itself! A useful analogy for remembering
this difference is to think of folders in a computer file system.
ILLUSTRATIVE EXAMPLE
The empty set can be thought of as an empty folder and the set consisting of just the
empty set can be thought of as a folder with exactly one folder inside, namely, the empty
folder.

P. A. KWABI (Ph.D.) SET THEORY 19/119


Theorem
For any set A, we have ϕ ⊆ A ⊆ U.

Proof.
We will prove the first part and leave the proof of the second part as an exercise.
Let A be a set. To show that ϕ ⊆ A, we must show that ∀x(x ∈ ϕ → x ∈ A) is true.
Because the empty set contains no elements, it follows that x ∈ ϕ is always false. It
follows that the conditional statement x ∈ ϕ → x ∈ A is always true, because its
hypothesis is always false and a conditional statement with a false hypothesis is true.
Therefore, ∀x(x ∈ ϕ → x ∈ A) is true. This completes the proof of the first. Note that
this is an example of a vacuous proof.

P. A. KWABI (Ph.D.) SET THEORY 20/119


Table of Contents
6 VENN DIAGRAMS
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 21/119
VENN DIAGRAMS
6 VENN DIAGRAMS

John Venn, (4 August 1834 – 4 April 1923) was an English mathematician, logician and
philosopher noted for introducing Venn diagrams, which are used in logic, set theory,
probability, statistics, and computer science.

Figure 1: 1: John Venn (1834-1923)

P. A. KWABI (Ph.D.) SET THEORY 22/119


Definition
A Venn diagram is a pictorial representation of sets in which sets are represented by
enclosed areas in the plane.
The universal set U is represented by the interior of a rectangle, and the other sets are
represented by disks lying within the rectangle. If A ⊆ B, then the disk representing A will
be entirely within the disk representing B as in Fig. 2(a). If A and B are disjoint, then the
disk representing A will be separated from the disk representing B as in Fig. 2(b).
However, if A and B are two arbitrary sets, it is possible that some objects are in A but not
in B, some are in B but not in A, some are in both A and B, and some are in neither A nor
B; hence in general we represent A and B as in Fig. 2(c).

P. A. KWABI (Ph.D.) SET THEORY 23/119


Figure 2: 2

P. A. KWABI (Ph.D.) SET THEORY 24/119


Table of Contents
7 OPERATIONS ON SET
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 25/119
UNION AND INTERSECTION OF SETS
7 OPERATIONS ON SET

There are also a number of operations between sets. Let A, B be any two sets.
Definition
The union of A and B (denoted A ∪ B) is the set of elements in either A or B. This is
illustrated with a Venn diagram in figure 3.

Definition
The intersection of A and B (denoted A ∩ B) is the set of all elements contained in both A
and B. This is illustrated with a Venn diagram in figure 4.

P. A. KWABI (Ph.D.) SET THEORY 26/119


Figure 3: 3: A U B shaded
P. A. KWABI (Ph.D.) SET THEORY 27/119
Figure 4: 4: A n B shaded
P. A. KWABI (Ph.D.) SET THEORY 28/119
Example
Let A = {1, 2, 3, 4}, B = {3, 4, 5, 6, 7}, C = {2, 3, 8, 9}. Then

A ∪ B = {1, 2, 3, 4, 5, 6, 7} , A ∪ C = {1, 2, 3, 4, 8, 9}

B ∪ C = {2, 3, 4, 5, 6, 7, 8, 9} ,
A ∩ B = {3, 4} , A ∩ C = {2, 3} , B ∩ C = {3} .

P. A. KWABI (Ph.D.) SET THEORY 29/119


Definition
Two sets are called disjoint if their intersection is the empty set.

Example
Let A = {1, 3, 5, 7, 9} and B = {2, 4, 6, 8, 10}.

A∩B=ϕ

, A and B are disjoint.

P. A. KWABI (Ph.D.) SET THEORY 30/119


GENERALIZED UNION AND INTERSECTIONS
7 OPERATIONS ON SET

Because unions and intersections of sets satisfy associative laws, the sets A ∪ B ∪ C and
A ∩ B ∩ C are well defined; that is, the meaning of this notation is unambiguous when A,
B, and C are sets. That is, we do not have to use parentheses to indicate which operation
comes first because A ∪ (B ∪ C) = (A ∪ B) ∪ C and A ∩ (B ∩ C) = (A ∩ B) ∩ C. Note that
A ∪ B ∪ C contains those elements that are in at least one of the sets A, B, and C, and that
A ∩ B ∩ C contains those elements that are in all of A, B, and C. These combinations of the
three sets, A, B, and C, are shown in Figure 5.

P. A. KWABI (Ph.D.) SET THEORY 31/119


Figure 5: 5
P. A. KWABI (Ph.D.) SET THEORY 32/119
Example
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?

Solution: The set A ∪ B ∪ C contains those elements in at least one of A, B, and C. Hence,
A ∪ B ∪ C = {0, 1, 2, 3, 4, 6, 8, 9}. The set A ∩ B ∩ C contains those elements in all three
of A, B, and C. Thus, A ∩ B ∩ C = {0}

P. A. KWABI (Ph.D.) SET THEORY 33/119


Definition
The union of a collection of sets is the set that contains those elements that are members
of at least one set in the collection.
We use the notation
n
[
A1 ∪ A2 ∪ . . . ∪ An = Ai
i=1

to denote the union of the sets A1 , A2 , . . . , An

P. A. KWABI (Ph.D.) SET THEORY 34/119


Definition
The intersection of a collection of sets is the set that contains those elements that are
members of all the sets in the collection.
We use the notation
n
\
A1 ∩ A2 ∩ . . . ∩ An = Ai
i=1

to denote the union of the sets A1 , A2 , . . . , An

P. A. KWABI (Ph.D.) SET THEORY 35/119


EXAMPLE
Suppose that Ai = {1, 2, 3, ..., i} for i = 1, 2, 3... Then,

[ ∞
[
Ai = {1, 2, 3, ..., i} = {1, 2, 3, ...} = Z+
i=1 i=1

and

\ ∞
\
Ai = {1, 2, 3, ..., i} = 1
i=1 i=1

P. A. KWABI (Ph.D.) SET THEORY 36/119


PROPERTIES OF INTERSECTION AND UNION OF A SET
7 OPERATIONS ON SET
1. Every element x in A ∩ B belongs to both A and B; hence x belongs to A and x belongs
to B. Thus A ∩ B is a subset of A and of B; namely
A ∩ B ⊆ A and A ∩ B ⊆ B
2. An element x belongs to the union A ∪ B if x belongs to A or x belongs to B; hence
every element in A belongs to A ∪ B, and every element in B belongs to A ∪ B. That is,
A ⊆ A ∪ B and B ⊆ A ∪ B
We state the above results formally:
Theorem
For any sets A and B, we have:
1. A ∩ B ⊆ A ⊆ A ∪ B and
2. A ∩ B ⊆ B ⊆ A ∪ B.

P. A. KWABI (Ph.D.) SET THEORY 37/119


The operation of set inclusion is closely related to the operations of union and
intersection, as shown by the following theorem.:
Theorem
The following are equivalent:
1. A ⊆ B,
2. A ∩ B = A,
3. A ∪ B = B.

P. A. KWABI (Ph.D.) SET THEORY 38/119


Inclusion-Exclusion Principle
7 OPERATIONS ON SET

Theorem
Suppose A and B are finite sets. Then A ∪ B and A ∩ B are finite and

n(A ∪ B) = n(A) + n(B) − n(A ∩ B)

That is, we find the number of elements in A or B (or both) by first adding n(A) and n(B)
(inclusion) and then subtracting n(A ∩ B) (exclusion) since its elements were counted twice.

We can apply this result to obtain a similar formula for three sets:
Suppose A, B, C are finite sets. Then A ∪ B ∪ C is finite and
n(A ∪ B ∪ C)
= n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C)
P. A. KWABI (Ph.D.) SET THEORY 39/119
EXERCISE
Suppose a list A contains the 30 students in a mathematics class, and a list B contains the
35 students in an English class, and suppose there are 20 names on both lists. Find the
number of students:
1. only on list A,
2. only on list B,
3. on list A or B (or both),
4. on exactly one list.

P. A. KWABI (Ph.D.) SET THEORY 40/119


Table of Contents
8 COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 41/119
Complements, Differences, Symmetric Differences
8 COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE

Lets assume A is a subset of a certain universal set U.


Definition
The absolute complement or, simply, complement of a set A, denoted by Ac , is the set of
elements which belong to U but which do not belong to A. That is,

Ac = {x|x ∈ U, x ∈
/ A}

Definition
The relative complement of a set B with respect to a set A or, simply, the difference of A
and B, denoted by A \ B, is the set of elements which belong to A but which do not belong
to B; that is
A\B = {x|x ∈ A, x ∈
/ B}

P. A. KWABI (Ph.D.) SET THEORY 42/119


The set A \ B is read “A minus B.” Many texts denote A \ B by A − B or A ∼ B.

Definition
The symmetric difference of sets A and B, denoted by A B, consists of those elements
L
which belong to A or B but not to both. That is,
M M
A B = (A ∪ B)\(A ∩ B) or A B = (A\B) ∪ (B\A)

P. A. KWABI (Ph.D.) SET THEORY 43/119


Figure 6: 6: Complements, Differences, Symmetric Differences

P. A. KWABI (Ph.D.) SET THEORY 44/119


EXAMPLE
Suppose U = N = {1, 2, 3, ...} is the universal set. Let

A = {1, 2, 3, 4} , B = {3, 4, 5, 6, 7} , C = {2, 3, 8, 9} , E = {2, 4, 6, ...}

(Here E is the set of even integers.) Then:

Ac = {5, 6, 7, ...} , Bc = {1, 2, 8, 9, 10, ...} , Ec = {1, 3, 5, 7, ...}


That is, Ec is the set of odd positive integers. Also:

A\B = {1, 2} , A\C = {1, 4} , B\C = {4, 5, 6, 7} , A\E = {1, 3}

P. A. KWABI (Ph.D.) SET THEORY 45/119


EXAMPLE cont.
B\A = {5, 6, 7} , C\A = {8, 9} , C\B = {2, 8, 9} ,
E\A = {6, 8, 10, 12, ...} .
Furthermore: M
A B = (A\B) ∪ (B\A) = {1, 2, 5, 6, 7} ,
M
B C = {2, 4, 5, 6, 7, 8, 9} ,
M
A C = (A\C) ∪ (B\C) = {1, 4, 8, 9} ,
M
A E = {1, 3, 6, 8, 10, ...} .

P. A. KWABI (Ph.D.) SET THEORY 46/119


Table of Contents
9 ORDERED PAIR AND CARTESIAN PRODUCTS
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 47/119
ORDERED PAIR AND CARTESIAN PRODUCTS
9 ORDERED PAIR AND CARTESIAN PRODUCTS

The Cartesian product is named after René Descartes, whose formulation of analytic
geometry gave rise to the concept, which is further generalized in terms of direct product.

Figure 7: 7: 800px-franshals-portretvanrenedescartes

P. A. KWABI (Ph.D.) SET THEORY 48/119


An ordinary pair {a, b} is a set with two elements. In a set the order of the elements is
irrelevant, so {a, b} = {b, a}. If the order of the elements is relevant, then we use a
different object called ordered pair, represented (a, b).
Now (a, b) ̸= (b, a) (unless a = b). In general (a, b) = (a′ , b′ ) iff a = a′ and b = b′ .
Given two sets A, B, their Cartesian product A×B is the set of all ordered pairs (a, b) such
that a ∈ A and b ∈ B:
A × B = {(a, b)|(a ∈ A) ∧ (b ∈ B)} .
Analogously we can define triples or 3-tuples (a, b, c), 4-tuples (a, b, c, d),. . . , n-tuples
(a1 , a2 , . . . , a1 ), and the corresponding 3-fold, 4-fold,. . . , n-fold Cartesian products:

P. A. KWABI (Ph.D.) SET THEORY 49/119


A1 × A2 ×, ... × An =

{(a1 , a2 , ..., an )|(a1 ∈ A1 ) ∧ (a2 ∈ A2 ) ∧ ... ∧ (an ∈ An )} .


If all the sets in a Cartesian product are the same, then we can use an exponent:
A2 = A × A, A3 = A × A × A, etc. In general:
ntimes
z }| {
n
A = A × A × ... × A.

An example of Cartesian product is the real plane R2 , where R is the set of real numbers
(R is sometimes called real line)

P. A. KWABI (Ph.D.) SET THEORY 50/119


Example
If A = {a, b}, then the set of all 3-tuples from A is given by
A3 = {(a, a, a), (a, a, b), (a, b, a), (a, b, b), (b, a, a), (b, a, b), (b, b, a), (b, b, b)} .

P. A. KWABI (Ph.D.) SET THEORY 51/119


Table of Contents
10 SET IDENTITIES AND DUALITY
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 52/119
SET IDENTITIES AND DUALITY
10 SET IDENTITIES AND DUALITY

Sets under the operations of union, intersection, and complement satisfy various laws
(identities) which are listed in the table below:
Associative Laws: A ∪(B ∪ C) = (A ∪ B)∪ C
A ∩(B ∩ C) = (A ∩ B)∩ C
Commutative Law: A ∪B = B ∪ A
A ∩B = B ∩ A
Distributive Laws: A ∪(B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
Identity Laws: A∪ϕ=A
A∩U =A

P. A. KWABI (Ph.D.) SET THEORY 53/119


Complement Laws: A∪A=U
A∩A=ϕ
Idempotent Laws: A∪A=A
A∩A=A
Bound Laws: A ∪U = U
A ∩ϕ = ϕ
Absorption Laws: A ∪(A ∩ B) = A
A ∩(A ∪ B) = A
Involution Law: A=A
0/1 Laws: ϕ=U
U=ϕ
DeMorgan’s Laws: A∪B=A∩B
A∩B=A∪B
P. A. KWABI (Ph.D.) SET THEORY 54/119
Duality
10 SET IDENTITIES AND DUALITY

Taking a careful look at the laws of algebra listed in the table above, you realize that all the
laws are two with exception to the Involution law. One may ask why is it so?.

Definition
Suppose P is an equation of set algebra. The dual P∗ of P is the equation obtained by
replacing each occurrence of ∪, ∩, U and ϕ in P by ∩, ∪, ϕ, and U, respectively.
For example, the dual of (U ∩ A) ∪ (B ∩ A) = A is (ϕ ∪ A) ∩ (B ∪ A) = A

Observe that the pairs of laws in the tables above are duals of each other. It is a fact of set
algebra, called the principle of duality, that if any equation P is an identity then its dual P∗
is also an identity.

P. A. KWABI (Ph.D.) SET THEORY 55/119


Example
Prove that A ∩ B = A ∪ B (first DeMorgan’s Law)

Proof.
We will prove that the two sets A ∩ B and A ∪ B are equal by showing that each set is a
subset of the other.
First, we will show that A ∩ B ⊆ A ∪ B We do this by showing that if x is in A ∩ B, then it
must also be in A ∪ B Now suppose that x ∈ A ∪ B. By the definition of complement,
x∈ / A ∩ B Using the definition of intersection, we see that ¬((x ∈ A) ∧ (x ∈ B)) is true.
By applying De Morgan’s law for propositions, we see that ¬(x ∈ A) or ¬(x ∈ B). Using
the definition of negation of propositions, we have x ∈/ A or x ∈
/ B. Using the definition of
the complement of a set, we see that this implies that x ∈ A or x ∈ B. Consequently, by
the definition of union, we see that x ∈ A ∪ B. We have now shown that A ∩ B ⊆ A ∪ B
P. A. KWABI (Ph.D.) SET THEORY 56/119
Proof (Cont.)
Next, we will show that A ∪ B ⊆ A ∩ B. We do this by showing that if x is in A ∪ B then it
must also be in A ∩ B. Now suppose that x ∈ A ∪ B. By the definition of union, we know
that x ∈ A or x ∈ B. Using the definition of complement, we see that x ∈ / A or x ∈/ B..
Consequently, the proposition ¬(x ∈ A) ∨ ¬(x ∈ B) is true. By De Morgan’s law for
propositions, we conclude that ¬((x ∈ A) ∧ (x ∈ B)) is true. By the definition of
intersection, it follows that ¬(x ∈ A ∩ B). We now use the definition of complement to
conclude that x ∈ A ∩ B This shows that A ∪ B ⊆ A ∩ B
Because we have shown that each set is a subset of the other, the two sets are equal, and
the identity is proved.

P. A. KWABI (Ph.D.) SET THEORY 57/119


Example
Prove the second distributive law from Duality Table , which states that
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) for all sets A, B, and C.

Proof.
We will prove this identity by showing that each side is a subset of the other side.
Suppose that x ∈ A ∩ (B ∪ C). Then x ∈ A and x ∈ B ∪ C. By the definition of union, it
follows that x ∈ A, and x ∈ B or x ∈ C (or both). In other words, we know that the
compound proposition (x ∈ A) ∧ ((x ∈ B) ∨ (x ∈ C)) is true. By the distributive law for
conjunction over disjunction, it follows that ((x ∈ A) ∧ (x ∈ B)) ∨ ((x ∈ A) ∧ (x ∈ C)). We
conclude that either x ∈ A and x ∈ B, or x ∈ A and x ∈ C.

P. A. KWABI (Ph.D.) SET THEORY 58/119


Proof (cont).
By the definition of intersection, it follows that x ∈ A ∩ B or x ∈ A ∩ C. Using the
definition of union, we conclude that x ∈ (A ∩ B) ∪ (A ∩ C).We conclude that
A ∩ (B ∪ C) ⊆ (A ∩ B) ∪ (A ∩ C).
Now suppose that x ∈ (A ∩ B) ∪ (A ∩ C). Then, by the definition of union, x ∈ A ∩ B or
x ∈ A ∩ C. By the definition of intersection, it follows that x ∈ A and x ∈ B or that x ∈ A
and x ∈ C. From this we see that x ∈ A, and x ∈ Bor x ∈ C. Consequently, by the
definition of union we see that x ∈ A and x ∈ B ∪ C. Furthermore, by the definition of
intersection, it follows that x ∈ A ∩ (B ∪ C). We conclude that
(A ∩ B) ∪ (A ∩ C) ⊆ A ∩ (B ∪ C). This completes the proof of the identity

P. A. KWABI (Ph.D.) SET THEORY 59/119


Example
Let A, B, and C be sets. Show that A ∪ (B ∩ C) = (C ∪ B) ∩ A.

Proof.
We have

A ∪ (B ∩ C) = A ∩ B ∩ C. by the first De Morgan law

= A ∩ (B ∪ C) by the second De Morgan law

= (B ∪ C) ∩ A by the commutative law for intersections

= (C ∪ B) ∩ A by the commutative law for unions.


P. A. KWABI (Ph.D.) SET THEORY 60/119
Table of Contents
11 METHOD OF PROVING SET IDENTITIES
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 61/119
METHOD OF PROVING SET IDENTITIES
11 METHOD OF PROVING SET IDENTITIES

There are three different methods for proving set identities, namely:
1. Subset method: Show that each side of the identity is a subset of the other side.

2. Membership table or Truth table: For each possible combination of the atomic sets,
show that an element in exactly these atomic sets must either belong to both sides
or belong to neither side

3. Apply existing identities: Start with one side, transform it into the other side using a
sequence of steps by applying an established identity.

P. A. KWABI (Ph.D.) SET THEORY 62/119


Obviously the first and the second methods have been demonstrated from the examples
above.

We will encounter the second method which is membership or truth table when we start
Logic and propositional calculus.

P. A. KWABI (Ph.D.) SET THEORY 63/119


Table of Contents
12 FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 64/119
FINITE SETS AND COUNTABILITY
12 FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES

Definition
Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative
integer, we say that S is a finite set and that n is the cardinality of S. The cardinality of S is
denoted by —S—.
Remark : The term cardinality comes from the common usage of the term cardinal
number as the size of a finite set.
Example
Let A be the set of odd positive integers less than 10. Then |A| = 5.

Example
Let S be the set of letters in the English alphabet. Then |S| = 26.

P. A. KWABI (Ph.D.) SET THEORY 65/119


FINITE SETS AND COUNTABILITY
12 FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES

Every set falls withing these two categories; finite and infinite.
Definition
A set S is said to be finite provided either it is empty or there is a natural number n for
which S is equipotent to {1, ..., n}; otherwise S is infinite. If S is said to be equipotent to
1, 2, ..., n it means S is one-to-one to the set.
We say that, S is countably infinite provided S is equipotent to the set N of natural
numbers. A set that is either finite or countably infinite is said to be countable. A set that
is not countable is called uncountable.

If a set is equipotent to a countable set, then it is countable.

P. A. KWABI (Ph.D.) SET THEORY 66/119


Examples
1. The set of rational numbers is countably infinite while the set of real numbers is
uncountably infinite.
2. The set A of the letters of the English alphabet and the set D of the days of the week
are finite sets. Specifically, A has 26 elements and D has 7 elements.
3. Let E be the set of even positive integers, and let I be the unit interval, that is,
E = {2, 4, 6, ...} and I = [0, 1] = {x|0 ≤ x ≤ 1}
Then both E and I are infinite.

P. A. KWABI (Ph.D.) SET THEORY 67/119


Counting Elements in Finite Sets
12 FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES

Definition
The number of elements in a set is known as the cardinality of the set.
The notation n(S) or —S— will denote the number of elements in a set S. (Some texts use
#(S) or card(S) instead of n(S).) Thus n(A) = 26, where A is the letters in the English
alphabet, and n(D) = 7, where D is the days of the week. Also n(ϕ) = 0 since the empty
set has no elements.

The following lemma applies.

P. A. KWABI (Ph.D.) SET THEORY 68/119


Lemma
Suppose A and B are finite disjoint sets. Then A ∪ B is finite and

n(A ∪ B) = n(A) + n(B)

This lemma may be restated as follows:

Lemma
Suppose S is the disjoint union of finite sets A and B. Then S is finite and

n(S) = n(A) + n(B)

P. A. KWABI (Ph.D.) SET THEORY 69/119


For any sets A and B, the set A is the disjoint union of A\B and A ∩ B. Thus the previous
lemma gives us the following useful result.
Corollary
Let A and B be finite sets. Then

n(A\B) = n(A) − n(A ∩ B)

For example, suppose an art class A has 25 students and 10 of them are taking a biology
class B. Then the number of students in class A which are not in class B is:

n(A\B) = n(A) − n(A ∩ B) = 25 − 10 = 15

P. A. KWABI (Ph.D.) SET THEORY 70/119


Corollary
Let A be a subset of a finite universal set U. Then

n(Ac ) = n(U) − n(A)

P. A. KWABI (Ph.D.) SET THEORY 71/119


Table of Contents
13 CLASSES OF SETS POWER SETS AND PARTITIONS
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 72/119
CLASSES OF SETS
13 CLASSES OF SETS POWER SETS AND PARTITIONS

Definition
Suppose S = {a, b, c, d}, then

A = [{a, b, c} {a, b, d} {a, c, d} {b, c, d}]

is said to be a class of subsets of S. Thus the elements of A are


{a, b, c} , {a, b, d} , {a, c, d} , {b, c, d}.
Let B be the class of subsets of S, each which contains b and two other elements of S. Then

B = [{a, b, c} , {a, b, d} , {b, c, d}]

The elements of B are the sets {a, b, c} , {a, b, d} , {a, c, d}. Thus B is a subclass of A,
since every element of B is also an element of A.

P. A. KWABI (Ph.D.) SET THEORY 73/119


Power Sets
13 CLASSES OF SETS POWER SETS AND PARTITIONS

Definition
Given a set S, the classes of all subsets of S is called the power set of S denoted by P(S).
The number of elements in P(S) is determined by 2 raised to the power n(S). That is,

n(P(S)) = 2n(S)

EXAMPLE
Given that S = {1, 2, 3}. Then

P(S) = [ϕ, {1} , {2} , {3} , {1, 2} , {1, 3} , {2, 3} , S]

Note that the empty set ϕ belongs to P(S) since ϕ is a subset of S. Similarly, S belongs to
P(S). As expected from the above remark, P(S) has 23 = 8 elements.

P. A. KWABI (Ph.D.) SET THEORY 74/119


Example
What is the power set of the empty set? What is the power set of the set {ϕ}?

Solution: The empty set has exactly one subset, namely, itself. Consequently,

P(ϕ) = {ϕ} .

The set {ϕ}? has exactly two subsets, namely, ϕ and the set {ϕ} itself. Therefore,

P({ϕ}) = ϕ, {ϕ}.

P. A. KWABI (Ph.D.) SET THEORY 75/119


Partitions
13 CLASSES OF SETS POWER SETS AND PARTITIONS

Definition
Let S be a nonempty set. A partition of S is a subdivision of S into nonoverlapping,
nonempty subsets. Precisely, a partition of S is a collection Ai of nonempty subsets of S
such that:
1. Each a in S belongs to one of the Ai .
2. The sets of {Ai } are mutually disjoint; that is, if

Aj ̸= Ak then Aj ∩ Ak = ϕ

The subsets in a partition are called cells. Figure 8 is a Venn diagram of a partition of the
rectangular set S of points into five cells, A1 , A2 , A3 , A4 , A5 .

P. A. KWABI (Ph.D.) SET THEORY 76/119


Set Theory
13 CLASSES OF SETS POWER SETS AND PARTITIONS

Partitions

Figure 8: 8
P. A. KWABI (Ph.D.) SET THEORY 77/119
EXERCISE
Consider the following collections of subsets of S = {1, 2, ..., 8, 9}:
1. [{1, 3, 5} , {2, 6} , {4, 8, 9}]
2. [{1, 3, 5} , {2, 4, 6, 8} , {5, 7, 9}]
3. [{1, 3, 5} , {2, 4, 6, 8} , {7, 9}]
Verify as to whether each of them is a partition of S or not.

P. A. KWABI (Ph.D.) SET THEORY 78/119


Table of Contents
14 RELATIONS
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 79/119
RELATIONS
14 RELATIONS

Assume that we have a set of men M and a set of women W, some of whom are married.
We want to express which men in M are married to which women in W. One way to do
that is by listing the set of pairs (m, w) such that m is a man, w is a woman, and m is
married to w. So, the relation “married to” can be represented by a subset of the
Cartesian product M × W.
Definition
In general, a relation ℜ from a set A to a set B will be understood as a subset of the
Cartesian product A × B, i.e., ℜ ⊆ A × B. If an element a ∈ A is related to an element
b ∈ B, we often write aℜb instead of (a, b) ∈ ℜ.

P. A. KWABI (Ph.D.) SET THEORY 80/119


The set
{a ∈ A|a ℜ b for some b ∈ B}
is called the domain of ℜ. The set
{b ∈ B|a ℜ b for some a ∈ A}
is called the range of ℜ.
For instance, in the relation “married to” above, the domain is the set of married men,
and the range is the set of married women.
If A and B are the same set, then any subset of A × A will be a binary relation in A. For
instance, assume A = 1, 2, 3, 4. Then the binary relation “less than” in A will be:
<A = {(x, y) ∈ A × A|x < y}
= {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}
.
P. A. KWABI (Ph.D.) SET THEORY 81/119
Notation: A set A with a binary relation R is sometimes represented by the pair (A, ℜ). So,
for instance, (Z, ≤) means the set of integers together with the relation of non-strict
inequality.

P. A. KWABI (Ph.D.) SET THEORY 82/119


Representation of Relations
14 RELATIONS

• Arrow diagrams, Venn diagrams and arrows can be used for representing relations
between given sets.
• As an example, the figure below represents the relation from A = a, b, c, d to
B = 1, 2, 3, 4 given by R = (a, 1), (b, 1), (c, 2), (c, 3). In the diagram an arrow from
x to y means that x is related to y.

a 1

b 2

c 3

d 4
P. A. KWABI (Ph.D.) SET THEORY 83/119
• This kind of graph is called directed graph or digraph.
• Matrix of a Relation. Another way of representing a relation ℜ from A to B is with a
matrix.
• Its rows are labeled with the elements of A, and its columns are labeled with the
elements of B. If a ∈ A and b ∈ B then we write 1 in row a column b if a ℜ b,
otherwise we write 0.
• For instance the relation R = {(a, 1),(b, 1),(c, 2),(c, 3)} from A = {a, b, c, d} to B = {1, 2,
3, 4} has the following matrix.
 1234 
1 0 0 0
1 0 0 0
abcd 0 1 1 0

0 0 0 0

P. A. KWABI (Ph.D.) SET THEORY 84/119


Inverse Relations and Composition of Relation
14 RELATIONS

Definition
Given a relation ℜ from A to B, the inverse of R, denoted ℜ−1 , is the relation from B to A
defined as
bℜ−1 a ⇔ aℜb
.
• For instance, if ℜ is the relation “being a son or daughter of”, then ℜ−1 is the relation
“being a parent of”.
Definition
Let A, B and C be three sets. Given a relation R from A to B and a relation S from B to C,
then the composition S ◦ ℜ of relations ℜ and S is a relation from A to C defined by:
a(S ◦ ℜ)c ⇔there exists some b ∈ B such that a ℜ b and b S c .

P. A. KWABI (Ph.D.) SET THEORY 85/119


• For instance, if ℜ is the relation “to be the father of”, and S is the relation “to be
married to”, then S ◦ ℜ is the relation “to be the father in law of”.

P. A. KWABI (Ph.D.) SET THEORY 86/119


Properties of Binary Relations
14 RELATIONS

A binary relation R on A is called:


1. Reflexive if for all x ∈ A, x ℜ x. For instance on Z the relation “equal to” (=) is
reflexive.
2. Transitive if for all x, y, z ∈ A, x ℜ y and y ℜ z implies x ℜ z. For instance equality (=)
and inequality (¡) on Z are transitive relations.
3. Symmetric if for all x, y ∈ A, x ℜ y ⇒ y ℜ x. For instance on Z, equality (=) is
symmetric, but strict inequality (¡) is not.
4. Antisymmetric if for all x, y ∈ A, x ℜ y and y ℜ x implies x = y. For instance,
non-strict inequality (≤) on Z is antisymmetric.

P. A. KWABI (Ph.D.) SET THEORY 87/119


Partial Orders
14 RELATIONS

A partial order, or simply, an order on a set A is a binary relation “≼” on A with the
following properties:
1. Reflexive: for all x ∈ A, x ≼ x.
2. Antisymmetric: (x ≼ y) ∧ (y ≼ x) ⇒ x = y.
3. Transitive: (x ≼ y) ∧ (y ≼ z) ⇒ x ≼ z.
ExampleS
1. The non-strict inequality (≤) in Z.
2. Relation of divisibility on Z+ : a|b ⇔ ∃t, b = at.
3. Set inclusion (⊆) on P(A) (the collection of subsets of a given set A).

EXERCISE
EXERCISE: prove that the aforementioned relations are in fact partial orders.

P. A. KWABI (Ph.D.) SET THEORY 88/119


As an example we prove that integer divisibility is a partial order:
1. Reflexive: a = a1 ⇒ a|a.
2. Antisymmetric: a|b ⇒ b = at for some t and b|a ⇒ a = bt′ for some t′ . Hence
a = att′ , which implies tt′ = 1 ⇒ t′ = t−1 . The only invertible positive integer is 1,
so t = t′ = 1 ⇒ a = b.
3. Transitive: a—b and b—c implies b = at for some t and c = bt′ for some t′ , hence
c = att′ , i.e., a—c.

QUESTION
QUESTION: is the strict inequality (¡) a partial order on Z?

P. A. KWABI (Ph.D.) SET THEORY 89/119


Comparable Elements
14 RELATIONS

Definition
Two elements a, b ∈ A are said to be comparable if either x ≼ y or y ≼ x, otherwise they
are said to be non comparable.

• The order is called total or linear when every pair of elements x, y ∈ A are
comparable.
• For instance (Z, ≤) is totally ordered, but (Z+ , |), where “|” represents integer
divisibility, is not.
• A totally ordered subset of a partially ordered set is called a chain; for instance the
set {1, 2, 4, 8, 16, ...} is a chain in (Z+ , |).

P. A. KWABI (Ph.D.) SET THEORY 90/119


Hasse Diagrams
14 RELATIONS

Definition
A Hasse diagram is a graphical representation of a partially ordered set in which each
element is represented by a dot (node or vertex of the diagram). Its immediate successors
are placed above the node and connected to it by straight line segments.

Example
As an example, figure 9 represents the Hasse diagram for the relation of divisibility on
{1, 2, 3, 4, 5, 6, 7, 8, 9}.

P. A. KWABI (Ph.D.) SET THEORY 91/119


Relations and Functions
14 RELATIONS

Figure 9:
P. A. KWABI (Ph.D.) SET THEORY 92/119
QUESTION
QUESTION: Question: How does the Hasse diagram look for a totally ordered Set?

P. A. KWABI (Ph.D.) SET THEORY 93/119


Equivalence Relation
14 RELATIONS

An equivalence relation on a set A is a binary relation “∼” on A with the following


properties:
1. Reflexive: for all x ∈ A, x ∼ x.
2. Symmetric: x ∼ y ⇒ y ∼ x.
3. Transitive: (x ∼ y) ∧ (y ∼ z) ⇒ x ∼ z.

Example
1. For instance, on Z, the equality (=) is an equivalence relation.
2. Another example, also on Z, is the following: x ≡ y(mod 2) (“x is congruent to y
modulo 2”) iff x − y is even. For instance, 6 ≡ 2(mod 2) because 6 − 2 = 4 is even,
but 7 ̸≡ 4(mod 2), because 7 − 4 = 3 is not even. Congruence modulo 2 is in fact an
equivalence relation.

P. A. KWABI (Ph.D.) SET THEORY 94/119


Showing that Congruence modulo 2 is in fact an equivalence relation:
1. Reflexive: for every integer x, x − x = 0 is indeed even, so x ≡ x (mod 2).
2. Symmetric: if x ≡ y (mod 2) then x − y = t is even, but y − x = −t is also even,
hence y ≡ x (mod 2).
3. Transitive: assume x ≡ y (mod 2) and y ≡ z (mod 2). Then x − y = t and y − z = u are
even. From here, x − z = (x − y) + (y − z) = t + u is also even, hence x ≡ z (mod 2).

P. A. KWABI (Ph.D.) SET THEORY 95/119


Equivalent classes, Quotient Set, Partitions
14 RELATIONS

Definition
Given an equivalence relation ∼ on a set A, and an element x ∈ A, the set of elements of
A related to x are called the equivalence class of x, represented [x] = y ∈ A|y ≡ x.
Element x is said to be a representative of class x [x].
The collection of equivalence classes, represented A/ ∼= [x]| ∈ A, is called quotient set
of A by ∼.
Exercise
Find the equivalence classes on Z with the relation of congruence modulo 2.

P. A. KWABI (Ph.D.) SET THEORY 96/119


One of the main properties of an equivalence relation on a set A is that the quotient set,
i.e. the collection of equivalence classes, is a partition of A. Recall that a partition of a set
A is a collection of non-empty subsets A1 , A2 , A3 , ... of A which are pairwise disjoint and
whose union equals A:
1. Ai ∩ Aj = ϕ for i ̸= j,
2. n An = A
S

Example
In Z with the relation of congruence modulo 2 (call it “∼2 ”), there are two equivalence
classes: the set E of even integers and the set O of odd integers. The quotient set of Z by
the relation “∼2 ” of congruence modulo 2 is“Z ∼2 ”) = {E, O}. We see that it is in fact a
partition of Z, because E ∩ O = ϕ, and Z = E ∪ O

P. A. KWABI (Ph.D.) SET THEORY 97/119


Exercise
Let m be an integer greater than or equal to 2. On Z we define the relation x ∼ y (mod m)
⇔ m|(y − x) (i.e., m divides exactly y − x). Prove that it is an equivalence relation. What
are the equivalence classes? How many are there?

Exercise
On the Cartesian product Z × Z∗ we define the relation (a, b) ℜ (c, d) ⇔ ad = bc. Prove
that ℜ is an equivalence relation. Would it still be an equivalence relation if we extend it
to Z × Z∗

P. A. KWABI (Ph.D.) SET THEORY 98/119


Table of Contents
15 FUNCTION
▶ INTRODUCTION
▶ DEFINITION OF SETS THEORY
▶ DESCRIBING A SET
▶ SUBSETS
▶ UNIVERSAL SET AND EMPTY SETS
▶ VENN DIAGRAMS
▶ OPERATIONS ON SET
▶ COMPLEMENTS, DIFFERENCES AND SYMMETRIC DIFFERENCE
▶ ORDERED PAIR AND CARTESIAN PRODUCTS
▶ SET IDENTITIES AND DUALITY
▶ METHOD OF PROVING SET IDENTITIES
▶ FINITE SETS, CARDINALITY AND COUNTING PRINCIPLES
▶ CLASSES OF SETS POWER SETS AND PARTITIONS
▶ RELATIONS
▶ FUNCTION
P. A. KWABI (Ph.D.) SET THEORY 99/119
FUNCTIONS
15 FUNCTION

In elementary mathematics, functions are typically described in terms of graphs and


formulas. The drawback of this approach is that one tends to picture only “nice”
functions. In fact, Cauchy himself published in 1821 an incorrect proof of the false
assertion that “a sequence of continuous functions that converges everywhere has a
continuous limit function.” Nowadays, every teacher warns their students that one must
be careful because the world is filled with “not so nice” functions.
The modern approach to defining functions is based on set theory.
Definition
Correspondence. Suppose that to each element of a set A we assign some elements of
another set B. For instance, A = N, B = Z, and to each element x ∈ N we assign all
elements y ∈ Z such that y2 = x.

P. A. KWABI (Ph.D.) SET THEORY 100/119


0 0

−1 1

1 4

2 16

−2 9

Domain Range

P. A. KWABI (Ph.D.) SET THEORY 101/119



Correspondence x 7−→ ± x. This operation is called a correspondence
Definition
A function or mapping f from a set A to a set B, denoted f : A → B, is a correspondence in
which to each element x of A corresponds exactly one element y = f (x) of B.

P. A. KWABI (Ph.D.) SET THEORY 102/119


a 0

b 1

c 2

d 3

e 4

P. A. KWABI (Ph.D.) SET THEORY 103/119


• Sometimes we represent the function with a diagram like this:
f : A → B, x 7−→ y
or
f
A→
− B, x 7−→ y
• For instance, the following represents the function from Z to Z defined by
f (x) = 2x + 1:
f :Z→Z
x 7−→ 2x + 1
• The element y = f (x) is called the image of x, and x is a preimage of y. For instance,
if f (x) = 2x + 1 then f (7) = 2(7) + 1 = 15.
• The set A is the domain of f, and B is its codomain.
P. A. KWABI (Ph.D.) SET THEORY 104/119
• If A′ ⊆ A, the image of A′ by f is f (A′ ) = f (x)|x ∈ A′ , i.e., the subset of B consisting of
all images of elements of A′ .
• The subset f(A) of B consisting of all images of elements of A is called the range of f.
• For instance, the range of f (x) = 2x + 1 is the set of all integers of the form 2x + 1
for some integer x, i.e., all odd numbers.
Examples
Two useful functions from R to Z are the following:
1. The floor function:
[x] = greatest integer less than or equal to x.
For instance: [2] = 2, [2.3] = 2, [π] = 3, [−2.5] = −3.
2. The ceiling function:
[x] = least integer greater than or equal to x.
For instance: [2] = 2, [2.3] = 3, [π] = 4, [−2.5] = −2.
P. A. KWABI (Ph.D.) SET THEORY 105/119
Types of Functions
15 FUNCTION

1. one-to-one or injective
2. onto or surjective
3. one-to-one correspondence or bijective

one-to-one or injective
A function f : A → B is called one-to-one or injective if each element of B is the image of
at most one element of A.

∀x, x′ ∈ A, f (x) = f (x′ ) ⇒ x = x′

For instance, f (x) = 2x from Z to Z is injective.

P. A. KWABI (Ph.D.) SET THEORY 106/119


a 0
8
b 1
7
c 2
6
d 3
5
e 4

Figure 10: One-to-one function


P. A. KWABI (Ph.D.) SET THEORY 107/119
Onto or Surjective
15 FUNCTION

Definition
A function f : A → B is called onto or surjective if every element of B is the image of some
element of A.
∀y ∈ B, ∃x ∈ A such that y = f (x).
For instance, f (x) = x2 from R to R2 ∪ {0} is onto.

P. A. KWABI (Ph.D.) SET THEORY 108/119


Relations and Functions
15 FUNCTION

a 0
e
b 1
f
c 2
g
d 3
h
e 4

Figure 11: Onto or Surjective function


P. A. KWABI (Ph.D.) SET THEORY 109/119
One-To-One Correspondence or Bijective Functions
15 FUNCTION

Definition
A function f : A → B is said to be a one-to-one correspondence, or bijective, or a
bijection, if it is one-to-one and onto.
For instance, f (x) = x + 3 from Z to Z is a bijection.

P. A. KWABI (Ph.D.) SET THEORY 110/119


a 0

b 1

c 2

d 3

e 4

Figure 12: Bijective Function


P. A. KWABI (Ph.D.) SET THEORY 111/119
Other Important Functions
15 FUNCTION

There are other important functions one needs to know;


• Identity function
• Function composition
• Inverse function
• Operator

Identity Function
Given a set A, the function 1A : A → A defined by 1A (x) = x for every x in A is called the
identity function for A.

P. A. KWABI (Ph.D.) SET THEORY 112/119


Function Composition and Iteration
15 FUNCTION

Definition
Given two functions f : A → B and g : B → C, the composite function of f and g is the
function g ◦ f : A → C defined by (g ◦ f )(x) = g(f (x)) for every x in A.
f g
A→
− B→
− C
For instance, if A = B = C = Z, f (x) = x + 1, g(x) = x2 , then
(g ◦ f )(x) = f (x)2 = (x + 1)2 . Also (f ◦ g)(x) = g(x) + 1 = x2 + 1 (the composition of
functions is not commutative in general).

Some properties of function composition are the following:


1. If f : A → B is a function from A to B, we have that f ◦ 1A = 1B ◦ f = f .

P. A. KWABI (Ph.D.) SET THEORY 113/119


Some properties of function composition are the following:
1.
2. Function composition is associative, i.e., given three functions
f g h
A→
− B→
− C→
− D,
we have that h ◦ (g ◦ f ) = (h ◦ g) ◦ f .
• Function iteration: If f : A → A is a function from A to A, then it makes sense to
compose it with itself: f 2 = f ◦ f .
• For instance, if f : Z → Z is f (x) = 2x + 1, then f 2 (x) = 2(2x + 1) + 1 = 4x + 3.
• Analogously we can define f 3 = f ◦ f ◦ f , and so on,
ntimes
z }| {
f n = f ◦ ... ◦ f

P. A. KWABI (Ph.D.) SET THEORY 114/119


Inverse Function
15 FUNCTION

• If f : A → B is a bijective function, its inverse, f −1 : B → A such that f −1 (y) = x if


and only if f (x) = y.
• For instance, if f : Z → Z is defined by f(x) = x + 3, then its inverse is f −1 (x) = x − 3.
• The arrow diagram of f −1 is the same as the arrow diagram of f but with all arrows
reversed.
• A characteristic property of the inverse function is that

f −1 ◦ f = 1A

and
f ◦ f −1 = 1B .

P. A. KWABI (Ph.D.) SET THEORY 115/119


Operators
15 FUNCTION

Definition
A function from A × A to A is called a binary operator on A. For instance the addition of
integers is a binary operator + : Z × Z → Z.

• In the usual notation for functions the sum of two integers × and y would be
represented +(x, y). This is called prefix notation. The infix notation consists of
writing the symbol of the binary operator between its arguments: x + y (this is the
most common).
• There is also a postfix notation consisting of writing the symbol after the arguments:
(x y) +.
• Another example of binary operator on Z is (x, y) 7→ x · y.

P. A. KWABI (Ph.D.) SET THEORY 116/119


Definition
A monary or unary operator on A is a function from A to A. For instance the change of
sign x 7→ −x on Z is a unary operator on Z. An example of unary operator on R∗
(non-zero real numbers) is x 7→ 1x .

P. A. KWABI (Ph.D.) SET THEORY 117/119


SET THEORY
Thank you for listening!
Any questions?

P. A. KWABI (Ph.D.) SET THEORY 118/119


End of Lesson
15 FUNCTION

P. A. KWABI (Ph.D.) SET THEORY 119/119

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