Sets [01DB]
- October 12, 2026
- Marcelo Fiore, Jon Sterling
Very roughly, sets are simplest of the mathematician’s data structures: although mathematicians concern themselves with more complex structures, like groups and rings and vector spaces, these are all (at the end of the day) defined in terms of sets.
Sets for mathematics, not mathematics for sets! [01DC]
- October 12, 2026
- Jon Sterling
Set theory is a mathematical subfield, just like group theory or finite model theory or geometry. Set theorists study concrete mathematical models of the abstract concept of a set, often embodied in formalisms like Zermelo–Fraenkel Set Theory, and many others. Set theory is an interesting and important field, but it is focused on a certain aspect of the concept of a set that is not the main one for its application in general mathematics, namely the tree structure of the \in -relation.
Sets in general mathematics, the kind of mathematics that you will need to know, behave a little differently from their incarnation in formal set theory. Some of you may know about things like the union and intersection of sets: in formal set theory, you can take the union of any two sets, but in actual mathematics, one never takes the union of two unrelated sets: the union is only a sensible operation to do on sets A and B that arose first as subsets of a common set C. So, if we are viewing \mathbb {N} and \mathbb {Q}^+ as subsets of \mathbb {R}, we can take the union \mathbb {N}\cup \mathbb {Q}^+ but otherwise it would be very unusual to do so.
The formal set theorists aren‘t wrong, but the way they think about sets is different from how sets are used in mathematics. Because this is a course on mathematics and not a course on set theory, we will favour the point of view of mathematics. You will not be penalised for using your pre-existing knowledge of set theory, if you have it: but you can think of this as an opportunity to learn how mathematicians actually work.
A warning: most mathematicians will tell you that they are using a set theory like ZFC. This is more of a catechism than a reality; what they mean is that they generally accept the mathematical consequences of the ZFC model of sets, not that they are actually using ZFC sets. You should do as mathematicians do, not as they say.
Sets, membership, and subsets [01DD]
- October 12, 2026
- Jon Sterling, with contributions from Marcelo Fiore
Primitive sets [01DF]
- October 12, 2026
- Marcelo Fiore, Jon Sterling
Although only implicitly, we have already encountered many sets so far, like the sets of natural numbers \mathbb {N}, the integers \mathbb {Z}, the positive integers, the even integers, the primes, the rationals \mathbb {Q}, the reals \mathbb {R}, the booleans, and even finite initial segments of the naturals \mathbb {Z}_m. It is fine to think of these sets as primitive or built-in to the vernacular of mathematics.
Notation Set membership [01DG]
- October 12, 2026
- Jon Sterling
We have already been writing a\in A to mean that a is an element of the set A. This notation is slightly more subtle than it may seem; sometimes you may see the notation used to introduce or bind an arbitrary element of the set A, as in:
Let a\in A be an element such that…
Other times, we are writing “a\in A” as a mathematical statement, as in:
For an integer x, we have x\in \mathbb {Z}^+ if and only if x is both natural and non-zero.
These two uses are not the same. In the first usage, it is better (but not mandatory) to write a:A, in keeping with our notation for universal quantification. On the other hand, the second usage is only meaningful when we already know that x is the kind of thing that can be an element of a given set: if we are viewing \mathbb {Z}^+ as a subset of the integers, a statement like x\in \mathbb {Z}^+ is only meaningful if we have already introduced x as an integer.
If this feels a little dizzying, don’t worry. You will get the hang of it soon.
Beyond the primitive sets, there are many other ways to build up more complex sets.
We will study several of them in this course. But the first and most important one is the subset.
Definition Subset [01DH]
- October 12, 2026
- Jon Sterling
A subset of a set A is a set whose elements are the elements of A that satisfy some condition. For example, the naturals can be thought of as the subset of the integers whose elements are precisely the non-negative integers.
We write U\subseteq A to mean that U is a subset of A; we may write U\subset A to mean that U is a strict subset of A, i.e. one that does not contain every element of A.
Given x:A and U\subseteq A, we will write x\in U to mean the statement that x satisfies the condition of being an element of U.
Notation Subset comprehension [01DI]
- October 12, 2026
- Marcelo Fiore, Jon Sterling
To actually write down a specific subset of a set A, we use the subset comprehension notation. Given a predicate P(x) ranging over an element x:A, we will write {\mathopen {}\left \{x: A\,\middle \vert \,P(x)\right \}\mathclose {}} to mean the subset of A that consists of all the elements satisfying P.
To give an element of {\mathopen {}\left \{x: A\,\middle \vert \,P(x)\right \}\mathclose {}}, you just have to give an element of A that satisfies P. If you assume an element of {\mathopen {}\left \{x: A\,\middle \vert \,P(x)\right \}\mathclose {}}, is equivalent to assuming an element x:A followed by an additional assumption P(x).
Example Examples of subset comprehension [01DJ]
- October 12, 2026
- Marcelo Fiore, Jon Sterling
- \mathbb {N} = {\mathopen {}\left \{n:\mathbb {Z}\,\middle \vert \,n\geq 0\right \}\mathclose {}}
- \mathbb {N}^+ = {\mathopen {}\left \{n: \mathbb {N}\,\middle \vert \,n \geq 1\right \}\mathclose {}}
- \mathbb {Q} = {\mathopen {}\left \{x:\mathbb {R}\,\middle \vert \,\exists p:\mathbb {Z}\mathpunct {.}\exists q:\mathbb {N}^+\mathpunct {.} x = p/q\right \}\mathclose {}}
- \mathbb {Z}_{\mathrm {googolplex}} = {\mathopen {}\left \{n:\mathbb {N}\,\middle \vert \,n<\mathrm {googolplex}\right \}\mathclose {}}
Being a subset is reflexive and transitive [01DK]
- October 12, 2026
- Jon Sterling
Reflexivity: For any set A, we may think of A as a subset of itself, as a shorthand for the subset comprehension {\mathopen {}\left \{x: A\,\middle \vert \,\mathrm {true}\right \}\mathclose {}}.
Transitivity: Now, suppose we have a subset U\subseteq A and a subset V\subseteq U. We can think of V also as a subset of A, writing V\subseteq A as a shorthand for the subset comprehension {\mathopen {}\left \{x: A\,\middle \vert \,x\in U \land x\in V\right \}\mathclose {}}.
We will not belabour this point in our notation. The point is that you may view a subset of a subset of A as a subset of A without any further a-do.
In mathematics, we do not talk about two unrelated sets being “equal”. If, however, we are thinking of these two sets as being subsets of a third set, then it makes sense to speak of them being equal.
The principle of subset extensionality [01DL]
- October 12, 2026
- Marcelo Fiore, Jon Sterling
Let A and B be two subsets of a set X. Then we say that A and B are equal when they have the same elements. In other words:
A = B \Longleftrightarrow \forall x:X\mathpunct {.} x\in A \Longleftrightarrow x\in BExample Examples of equal subsets [01DM]
- October 12, 2026
- Marcelo Fiore, Jon Sterling
- As subsets of \mathbb {N}, {\mathopen {}\left \{x:\mathbb {N}\,\middle \vert \,2\mid x \land \mathsf {isPrime}(x)\right \}\mathclose {}} and {\mathopen {}\left \{2\right \}\mathclose {}} are equal.
- For any positive integer m, {\mathopen {}\left \{x:\mathbb {Z}\,\middle \vert \,m\mid x\right \}\mathclose {}} and {\mathopen {}\left \{x:\mathbb {Z}\,\middle \vert \,x\equiv 0 \mod m\right \}\mathclose {}} are equal as subsets of \mathbb {Z}.
- As subsets of \mathbb {N}, {\mathopen {}\left \{d:\mathbb {N}\,\middle \vert \,d\mid 0\right \}\mathclose {}} and \mathbb {N} itself are equal.