4.2 Set Operations
4.2.1 Subsets and Power Sets
Given a set , we can consider other sets whose elements are contained in .
Definition 4.7.
We call a subset of if every element in the set also belongs to the set . We then write .
Notice that this definition also means the set is a subset of itself. A subset which is not equal to the set that contains it is called a proper or strict subset. The notation denotes that is either a proper subset of or equal to . When we want to denote that is a proper subset of , we can write .
Beware that some people will use the notation to mean is a subset of while others use the same notation to mean is a proper subset of . In this course, we will not use the notation because of this ambiguity.
Several of the sets we’ve already come across are subsets of each other and can be nested:
Exercise 4.8.
Find an example element from each of these sets which does not belong to its subsets.
Solution (please try for yourself before looking)
There are lots of examples here but, for example:
-
is an element which belongs to but not ;
-
is an element which belongs to but not ;
-
is an element which belongs to but not .
We often break down a larger set into smaller subsets when proving properties about sets. When every pair of these subsets do not share a common element, we call this collection of subsets a partition. For example, if , and then are a partition of .
This can be generalised into a partition of into many sets:
Definition 4.9.
Let be a (possibly infinite) set of subsets of the set such that
-
1.
and
-
2.
for every .
Then we call the collection a partition of the set .
Note, that every element belongs to exactly one of the subsets . Note also that according to this definition, one or more of the could be the empty set.
Sometimes it’s useful to be able to denote the set of elements which do not belong in a particular subset.
Definition 4.10 (Set difference and Complement).
Let . Then the set difference of and is
Let be the universal set of . Then the complement of is .
Notice that most sets will have many different possibilities for their universal set. For instance, the set may have , , or as its universal set. So it’s very important that we state what our universal set is if we are taking the set difference or complement of a set.
Example 4.11.
Let and . Then and, taking the universal set to be , .
Note that any set and its complement form a partition of the universal set .
Exercise 4.12.
Describe the set . What about the other set differences in Figure 4.1?
Solution (please try for yourself before looking)
The set comprises the non-positive integers.
The set consists of fractions which cannot be simplified to an integer.
The set consists of the irrational numbers.
Exercise 4.13.
What is the complement of the universal set? What is the complement of the empty set?
Solution (please try for yourself before looking)
The complement of the universal set is .
Conversely, for the empty set, we have .
So far, when given a set , we have been describing other sets whose elements are the same type of object as the set : be that numbers or days of the week. However, we can also use to form other sets whose elements are a different type of object.
Definition 4.14 (Power Set).
The power set of a set is the set of all subsets of .
Note the elements of are all sets: it is a set of sets. This includes the empty set (which is a subset of every set) and the set itself.
Example 4.15.
Let , then .
4.2.2 The number of elements in a set
It can often be useful to compare the size of two different sets. The following definition lets us do that.
Definition 4.16 (Cardinality).
Let and be two sets. If every element of corresponds uniquely to an element of and vice versa, we say and have the same cardinality and write .
If is a finite set of elements, we write .
This definition also gives us a way of comparing infinite sets. We call a set countable if it is either finite or . Otherwise, is uncountable or uncountably infinite.
Example 4.17.
A standard deck of cards consists of 13 black spade cards, 13 black club cards, 13 red heart cards and 13 red diamond cards. If denotes the set of red cards from the standard deck of cards, then .
Exercise 4.18.
Let Prove that
Solution (please try for yourself before looking)
There are many different proofs to this but here’s one of the simplest informal arguments. Consider listing the elements of in the following way:
-
1.
2
-
2.
4
-
3.
6
-
4.
8
-
5.
10
So the th number in this list is given by . According to this rule, every number in can be assigned to a unique natural number and vice versa. By Definition 4.16, we therefore have .
You may be surprised to see cardinality listed under “operations” as it doesn’t involve the combining of two objects like you’re used to when adding or multiplying numbers together. Instead, it only involves one object so we call it a unary operation. The operations we’re used to where two objects are combined are called binary operations.
4.2.3 Combining sets
There are several ways in which we can combine two or more general sets to make a new set. Unlike set difference, the following operations can be applied to any two sets regardless of their relation to each other.
Cartesian Product
This first operation may be unfamiliar. It is called a product and uses the symbol but should not be confused with multiplication of two numbers.
Definition 4.19 (Cartesian Product of two sets).
The Cartesian Product of two sets and is
Example 4.20.
Let and , then
Notice that is a set which consists of pairs of objects. The order of the elements in each pair matters. In the previous example, the pair does not belong to but is an element of .
You may have already seen a Cartesian product before: the Cartesian plane consists of ordered pairs of real numbers. We know that is a different point to . We can describe the Cartesian plane as or .
Definition 4.19 can be generalised to more than two sets which leads to sets consisting of -tuples.
Definition 4.21 (Cartesian Product for many sets).
The Cartesian Product of the sets is
Often when we take a Cartesian product of a set with itself, we use a superscript so and .
Unions and Intersections
You may be more familiar with the following operations.
Definition 4.22 (Union and Intersection).
Let be sets.
The union of and (written as ) is the set of elements that are elements of or elements of . i.e.
To take the union of all sets , we can write
The intersection of and (written as ) is the set of elements that are elements of and elements of . i.e.
The intersection of all sets is written
Example 4.23.
Let and , then and .
Note that and for all sets .
If the intersection of two sets is the empty set, we say that the sets are disjoint.
Notice that both the intersection and union consist of the same type of elements as the original sets that produce them. However, these sets do not all have to consist of similar objects. For example, let be the set of the days of the week and be the set of one digit integers. These are disjoint sets whose union is a set with elements that are days of the week or integers.
Theorem 4.24 (Inclusion-Exclusion for two sets).
Let and be two finite sets, then
Proof.
We first note that any two disjoint sets and partition the set . Therefore,
Now observe that and are disjoint sets and and are disjoint sets. Thus,
and
Hence,
as stated.