Nearly all of modern mathematics is written in the language of sets. Numbers, functions, spaces and structures are described as sets, or as sets equipped with extra data. This topic covers the working vocabulary: how sets are described, compared and combined, and how they are used to build new objects.
The approach is naive: a set is taken to be an intuitively understood collection. That is enough for everyday mathematics, and a later section explains where care is needed.
Conventions
- is the set of positive integers, and also includes 0. Many authors instead include 0 in .
- means is a subset of , and means a proper subset. The symbol is avoided because authors use it for either meaning.
- Set-builder notation uses a colon, as in . The form is a common alternative.
- A complement is always taken relative to a stated universe , a fixed set of which all the sets under discussion are subsets.
- is the number of elements of a finite set , used informally here.
- Intervals of real numbers use a square bracket for an included endpoint and a parenthesis for an excluded one: , , and ; and are mixed cases. Context distinguishes the interval from the ordered pair .
- Other common notations are for , or for , for , and for .
- Families are written , and is a common alternative.
- ” contains ” means , though some authors also say that contains when .
- A disjoint union here is the union of a pairwise disjoint family. The term also commonly names a construction that makes any family disjoint by tagging each element with its index, .
Builds on
Informal familiarity with numbers, with proof by induction, and with reading mathematical statements, including “if and only if”, “for all” and “there exists”.
Sets and membership
A set is a collection of objects, called its elements. We write if is an element of , and otherwise.
A set is determined entirely by which elements it has.
Sets and are equal, written , if they have exactly the same elements: for every , we have if and only if .
Small sets can be described by listing their elements between braces. Since only membership matters, order and repetition make no difference: .
The standard number sets are the natural numbers , the integers , the rational numbers and the real numbers .
Larger sets are usually described by a property.
For a set and a property , the set consists of those elements of for which holds.
A related form gives a pattern for the elements, with variables ranging over existing sets: consists of the values of the expression as ranges over , and similarly with several variables.
is the set of even integers, and has no elements. In the pattern form, the even integers are .
The empty set is the set with no elements.
There is only one empty set, since any two sets without elements have the same elements. Sets can themselves be elements of sets, so and are different: the first has no elements, while the second has one.
Subsets
is a subset of , written , if every element of is an element of . It is a proper subset, written , if also . The relation is called inclusion.
Membership and inclusion are different relations. For , we have but , since . We also have but .
For all sets , and :
- ;
- ;
- if and , then .
A counterexample to (1) would be an element of that is not in . Since has no elements, there is none, so the statement holds vacuously. For (2), every element of is an element of . For (3), if , then because , and so because .
if and only if and .
Each side says that and imply one another for every .
This is the standard way to prove that two sets are equal. Take an arbitrary and show , then take an arbitrary and show .
Operations on sets
The union is the set of with or , where “or” includes the case of both. The intersection is the set of with and . Sets and are disjoint if .
The difference is . The symmetric difference is , the set of elements belonging to exactly one of and .
If , the complement of in the universe is .
For and , we get , , , and .
Claims about sets often reduce to logic, because and correspond to “or” and “and”, and, within a universe, complement corresponds to “not”.
For all sets , and :
- and ;
- and ;
- and ;
- and .
We prove the first law in (3); the others follow the same pattern. An element lies in if and only if and either or . By the distributive law of logic, this holds if and only if either is in both and , or is in both and . That says exactly that .
For all sets and :
- ;
- the statements , and are equivalent;
- if and are subsets of a universe , then .
Statement (1) is immediate from the definitions.
For (2), suppose . Every element of then lies in , and by (1) with and interchanged and commutativity, so . Every element of also lies in , and by (1), so . Conversely, if , then . If , then , again by (1) with and interchanged and commutativity.
For (3), an element lies in , so if and only if .
For a subset of a universe :
- ;
- ;
- .
Each lies in exactly one of and . All three laws follow, since , and are subsets of .
For subsets and of a universe :
For the first law, let . Then if and only if , which holds if and only if and . That says exactly that . Both sides are subsets of , so they are equal.
For the second law, apply the first to and . By the complement laws, this gives . Taking complements of both sides and using the same laws gives .
An element-wise argument gives, for any sets , and , the identities and , with no universe needed.
Adding the sizes of two finite sets counts the elements they share twice, which gives a simple formula for the size of a union.
If and are finite, then .
The sum counts each element of twice and every other element of once. Subtracting leaves each element of counted once.
Power sets
The power set of a set is the set of all subsets of .
. Also , which has one element.
A finite set with elements has exactly subsets.
We use induction on . The empty set has exactly one subset, and .
Now suppose every set with elements has subsets, let , choose and let , which has elements. The subsets of not containing are exactly the subsets of . The subsets containing are exactly the sets with . Different give different sets, because means that . By the induction hypothesis, there are of each kind, for a total of .
Indexed families
We often need to combine many sets at once, such as one set for each natural number.
Let be a set, called the index set. A family of sets assigns a set to each . Different indices may be assigned the same set, so a family carries more information than the set .
For a family , the union is the set of with for at least one . If , the intersection is the set of with for every .
For , let . Then and . If instead , then . Both intersections rest on the Archimedean property of : for every there is an with .
For an empty index set, the union is . The intersection is a problem: every vacuously belongs to all , and there is no set of everything. So the intersection requires , unless a universe is fixed, in which case the empty intersection is taken to be .
For a family of subsets of a universe , with :
For , we have if and only if there is no with , which holds if and only if for every . Likewise, if and only if for some , which holds if and only if . In each law both sides are subsets of , so they are equal.
For a family with , a set and any :
- ;
- ;
- .
Statement (1) is immediate from the definitions. For (2), lies in the left side if and only if and for some , which says exactly that for some . For (3), every lies in both sides. If , then lies in the left side if and only if for every , and that holds if and only if for every .
Sets that pairwise do not overlap are especially useful, since each element of their union then lies in exactly one of them.
A family is pairwise disjoint if whenever . A set that is the union of a pairwise disjoint family is called the disjoint union of that family.
A partition of a set is a set of nonempty subsets of such that every element of lies in exactly one of them.
The even integers and the odd integers form a partition of , and the intervals for form a partition of . The sets , and have empty intersection taken all together, but they are not pairwise disjoint.
Ordered pairs and Cartesian products
Sets ignore order, but coordinates and many other constructions depend on it.
An ordered pair is an object determined by its first and second entries, in the sense that if and only if and .
So , but .
Ordered pairs can be built from sets alone. Kuratowski’s definition has the required property. Only the property matters in practice, not the particular construction.
The Cartesian product of and is . More generally, for , an -tuple is an object determined by its entries in order, in the sense that if and only if for every . The product is the set of -tuples with each , and is the product of copies of . A 2-tuple is an ordered pair, and is identified with .
Depending on how tuples are constructed, and may or may not be the same object. It is standard to identify them, and so to treat and as the same set.
, and is the coordinate plane. In general , and .
For all sets , and :
- ;
- .
The corresponding laws hold with the union or intersection in the first factor.
Since a pair determines its entries, a pair lies in if and only if and either or . That says exactly that lies in or in . The other laws are proved the same way.
If and are finite, then .
For each , the pairs in with first entry are the pairs with . By the defining property of pairs, different give different pairs, so there are of them, and pairs with different first entries are different. Summing over the elements of gives the result.
Why naive set theory needs care
It is tempting to assume that every property defines a set. That assumption is inconsistent.
There is no set whose elements are exactly the sets that are not elements of themselves.
Suppose such an exists. By its defining property, if and only if , which is a contradiction.
There is no set that contains every set. In particular, there is no set of everything.
If were such a set, then would be the impossible set .
This is why set-builder notation draws on existing sets, why a complement needs a universe, and why an intersection over an empty index set causes trouble. For the complement, if were a set, then its union with would be a set of everything. Axiomatic systems such as Zermelo-Fraenkel set theory with the axiom of choice (ZFC) state precisely which constructions are allowed. The constructions used in everyday mathematics, including those in this topic, are among them.
Summary
- Sets are determined by their elements, so equality ignores order and repetition.
- The empty set has no elements, and set-builder notation describes a set by a property of its elements or by a pattern for them.
- Membership and inclusion differ: says is an element of , while says every element of is an element of .
- Double inclusion is the standard way to prove sets equal.
- Union and intersection satisfy the algebraic laws. Complements satisfy the complement laws and De Morgan’s laws, and differences satisfy analogous identities.
- The symmetric difference is the set of elements belonging to exactly one of and .
- is equivalent to and to .
- For finite sets, .
- The power set of a set is the set of its subsets, and a finite set with elements has subsets.
- An indexed family has a union and, for a nonempty index set, an intersection, and De Morgan’s laws extend to these, as does distributivity.
- A family is pairwise disjoint if different indices give disjoint sets, and a partition of a set divides it into nonempty subsets so that each element lies in exactly one.
- Ordered pairs remember order, and Cartesian products collect them. Products distribute over union and intersection, and for finite sets .
- Russell’s paradox shows that not every property defines a set.