Sets & Functions
Introduction
A set is an unordered collection of elements. It can be finite or infinite and the order of the elements does not matter. Repeated elements in the set are only listed once. A set can also be empty.
The ‘cardinality’ of a set is defined as the number of elements in that set. It has the notation . The cardinality of the empty set is 0.
There are also different sets that can be created by combining other sets in some way:
- Union
- Intersection
- Difference
- Complement
- Subset
Ordered pairs
An ordered pair is a set that contains two elements where the order they are in does matter. An example of this you might have seen before is 2-dimensional coordinates.
Cartesian product
This is sometimes also called the ‘cross product’ of two sets. It is a set of ordered pairs.
The order that the sets are crossed in matters as the first element of each ordered pair comes from the first set and the second from the second set.
Functions
Assume and are non-empty sets. is a function from to if assigns to each element of a unique element of . This is written as if assigns to . If this is the case then we would write where is called the domain and is called the codomain.
There are a few different types of functions you need to know:
-
Identity functions
where each element maps to itself. -
Injective functions
is injective iff . -
Surjective functions
is surjective iff . -
Bijections
is a bijection iff it is both injective and surjective.
Function composition
The composition of two functions is itself a function:
Let and . The composition function is
From this, there are a few other mathematical facts we can derive:
- The composition of two injective functions is an injective function.
- The composition of two surjective functions is a surjective function.
- The composition of two bijections is a bijection.
Inverse functions
If is a bijection, then the inverse of , written as is iff .
The inverse of an identity function is itself and the composition of any given function with its inverse is an identity function.
Subsets
A subset is a set of elements, , whose elements are also elements of a larger set, . It has the notation . The empty set is also a subset of every set.
Power sets
A power set is a set of elements, , which contains every possible subset of another set, . Since the empty set is a subset of every set, it is also in the power set.
The cardinality of a power set, , is given by .
Partition of a set
A partition of a set is a collection of disjoint, non-empty subsets that have as their union. The collection of subsets with (where is an index set) forms a partition of iff: