Elements, subsets, products and operations
Last modified: 2026-10-27 13:24:37 (PDT)
Source
Adapted from Kameron Decker Harris’s Fall 2026 lecture notes “Sets 0” to “Sets 3”, which are typed transcriptions of Scott Wehrwein’s Spring 2025 handwritten lecture notes. These come from those notes:
The exercises are new.
Exercise 1 (Days that begin with T) Let \(W\) be the set of days of the week whose English names begin with the letter T. List the elements of \(W\).
Solution 1. \(W = {\mathopen{}\left\{\text{Tuesday}, \text{Thursday}\right\}\mathclose{}}\).
Definition 1 (Set) A set (Wikipedia contributors 2026n) is a collection of distinct objects, called its elements. We write \(a \in A\) when \(a\) is an element of the set \(A\), and \(a \notin A\) when it is not. Two sets are equal when they have exactly the same elements.
Remark 1 (Naive and formal set theory). Definition 1 is the informal (“naive”) notion of a set, which is all these notes need. Formal set theory states axioms for sets instead (Wikipedia contributors 2026n). For example, the last sentence of Definition 1, that two sets are equal when they have exactly the same elements, is one of those axioms, the axiom of extensionality.
Example 1 (Sets of die rolls) The possible results of rolling a six-sided die form the set \({\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}}\), with \(3 \in {\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}}\) and \(7 \notin {\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}}\). The sets \({\mathopen{}\left\{1, 2, 3\right\}\mathclose{}}\) and \({\mathopen{}\left\{3, 2, 1\right\}\mathclose{}}\) are equal, because they have the same elements; the order in which the elements are listed does not matter.
Definition 2 (Roster notation) Writing a set (Definition 1) by listing its elements between braces, as in \({\mathopen{}\left\{1, 2, 3\right\}\mathclose{}}\), is called roster notation (Wikipedia contributors 2026n). An ellipsis, “\(\ldots\)”, can stand for elements that follow a clear pattern, as in \({\mathopen{}\left\{10, 20, 30, \ldots, 90\right\}\mathclose{}}\).
Example 2 (Order and repetition do not matter) The sets \({\mathopen{}\left\{3, 1, 2\right\}\mathclose{}}\), \({\mathopen{}\left\{1, 2, 3\right\}\mathclose{}}\) and \({\mathopen{}\left\{1, 1, 2, 3, 3\right\}\mathclose{}}\) are equal, because each has exactly the elements \(1\), \(2\) and \(3\) (Definition 1). A roster can list any objects, not only numbers: \({\mathopen{}\left\{\text{red}, \text{green}, \text{blue}\right\}\mathclose{}}\) is a set with three elements.
Definition 3 (Natural numbers (our convention)) In these notes, the natural numbers (Wikipedia contributors 2026j) are the positive integers (Definition: Positive integers):
\[\mathbb{N}\stackrel{\text{def}}{=}\mathopen{}\left\{1, 2, 3, \ldots\right\}\mathclose{}\]
Other conventions for the natural numbers
Other sources may define \(\mathbb{N}\) differently, so check each source’s definition before reading its formulas:
When a formula’s meaning depends on whether \(0\) is included, we write the set out explicitly, for example \(\mathopen{}\left\{0, 1, 2, \ldots\right\}\mathclose{}\) or \(\mathopen{}\left\{1, \ldots, n\right\}\mathclose{}\).
Source: Wikipedia, “Natural number”, “Terminology and notation” and “Zero as natural number”, which cites ISO 80000-2:2019 and the textbooks using each notation.
Definition 4 (Real numbers) A real number (Wikipedia contributors 2026m) is a number that can be written as a decimal expansion: an integer part, followed by a decimal point and a finite or infinite list of decimal places after it. Equivalently, the real numbers are the points on the number line. The set of real numbers is written \(\mathbb{R}\).
Remark 2 (A working definition). Definition 4 is a working definition, not a construction: it does not say what an infinite decimal expansion is, or how to add or multiply two of them. Rudin (1976, Appendix to Chapter 1) constructs the real numbers rigorously. Some real numbers have two decimal expansions: for example, \(0.999\ldots\) and \(1.000\ldots\) are the same real number, \(1\).
Remark 3 (Sets of numbers). These notes use these sets of numbers:
| Symbol | Name | Elements |
|---|---|---|
| \(\mathbb{N}\) | natural numbers (Definition 3) | \(1, 2, 3, \ldots\) |
| \(\mathbb{Z}\) | integers (Definition: Integers) | \(\ldots, -2, -1, 0, 1, 2, \ldots\) |
| \(\mathbb{Q}\) | rational numbers (Definition: Rational numbers) | fractions \(\frac{a}{b}\) of integers with \(b \ne 0\) |
| \(\mathbb{R}\) | real numbers (Definition 4) | decimal expansions |
Exercise 2 (Natural numbers with small cubes) List the natural numbers (Definition 3) \(n\) with \(n^3 < 100\).
Solution 2. \(1\), \(2\), \(3\) and \(4\), whose cubes are \(1\), \(8\), \(27\) and \(64\). Every other natural number \(n\) has \(n \ge 5\), so \(n^3 \ge 125\), which is not less than \(100\).
Definition 5 (Set-builder notation) For a set \(A\) and a statement \(P(x)\) about an element \(x\), set-builder notation (Wikipedia contributors 2026o) \({\mathopen{}\left\{x \in A : P(x)\right\}\mathclose{}}\) denotes the set of elements \(x\) of \(A\) for which \(P(x)\) is true.
Example 3 (Even die rolls in set-builder notation) \({\mathopen{}\left\{x \in {\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}} : x \text{ is even}\right\}\mathclose{}} = {\mathopen{}\left\{2, 4, 6\right\}\mathclose{}}\) is the set of even rolls, and \({\mathopen{}\left\{x \in \mathbb{R}: x > 0\right\}\mathclose{}}\) is the set of positive real numbers.
Definition 6 (Empty set) The empty set (Wikipedia contributors 2026f), denoted \(\emptyset\), is the set that has no elements.
Remark 4 (Other notation for the empty set). Other sources write \({\mathopen{}\left\{\right\}\mathclose{}}\) for \(\emptyset\) (Wikipedia contributors 2026f). Some sources call it the null set, but in measure theory a “null set” usually means a set of measure zero, which need not be empty. For example, the interval \([0, 0] = {\mathopen{}\left\{0\right\}\mathclose{}}\) has length \(0 - 0 = 0\), so it is a null set in that sense, but it is not empty, because \(0 \in {\mathopen{}\left\{0\right\}\mathclose{}}\).
Example 4 (Impossible die rolls) No roll of a six-sided die is greater than 6, so \({\mathopen{}\left\{x \in {\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}} : x > 6\right\}\mathclose{}} = \emptyset\).
Definition 7 (Set-builder notation with an expression) For a set \(A\) and an expression \(f(x)\) that has a value for each element \(x\) of \(A\), the notation \({\mathopen{}\left\{f(x) : x \in A\right\}\mathclose{}}\) denotes the set of the values \(f(x)\) for \(x \in A\) (Wikipedia contributors 2026o). That is, an object \(y\) is an element of \({\mathopen{}\left\{f(x) : x \in A\right\}\mathclose{}}\) when \(y = f(x)\) for some \(x \in A\).
Example 5 (Two ways to build a set)
Exercise 3 (Letters in a word) How many different letters does the word MISSISSIPPI use?
Solution 3. Four: M, I, S and P. The set of its letters is \({\mathopen{}\left\{\text{M}, \text{I}, \text{S}, \text{P}\right\}\mathclose{}}\), and listing a letter again, as the word does, does not add an element (Example 2).
Definition 8 (Finite set) A set \(A\) is finite (Wikipedia contributors 2026g) if it is empty, or if, for some natural number \(n\), its elements can be listed as a finite sequence (Definition: Finite sequence) \(a_1, \ldots, a_n\) in which each element of \(A\) appears exactly once.
Definition 9 (Cardinality) For a finite set \(A\) (Definition 8), the number \(n\) in such a list is the cardinality (Wikipedia contributors 2026b) of \(A\), its number of elements, written \(\mathopen{}\left|A\right|\mathclose{}\); the empty set has cardinality \(\mathopen{}\left|\emptyset\right|\mathclose{} = 0\).
Remark 5 (Two meanings of \(\mathopen{}\left|\cdot\right|\mathclose{}\)). Applied to a set, the bars \(\mathopen{}\left|A\right|\mathclose{}\) mean the cardinality of \(A\). Applied to a number, \(\mathopen{}\left|x\right|\mathclose{}\) means its absolute value, or its modulus when \(x\) is complex. For example, \(\mathopen{}\left|{\mathopen{}\left\{-3\right\}\mathclose{}}\right|\mathclose{} = 1\), but \(\mathopen{}\left|-3\right|\mathclose{} = 3\).
Definition 10 (Infinite set) A set that is not finite (Definition 8) is infinite (Wikipedia contributors 2026h).
Example 6 (Finite and infinite sets)
Remark 6 (Sets can be elements of sets). The elements of a set can themselves be sets. For example, \(S = {\mathopen{}\left\{{\mathopen{}\left\{1, 2\right\}\mathclose{}}, 3, {\mathopen{}\left\{3\right\}\mathclose{}}\right\}\mathclose{}}\) has three elements: the set \({\mathopen{}\left\{1, 2\right\}\mathclose{}}\), the number \(3\), and the set \({\mathopen{}\left\{3\right\}\mathclose{}}\). So \({\mathopen{}\left\{1, 2\right\}\mathclose{}} \in S\), but \(1 \notin S\), because \(1\) is an element of an element of \(S\), not an element of \(S\). And \(3 \ne {\mathopen{}\left\{3\right\}\mathclose{}}\): one is a number, and the other is a set with one element. So \(\mathopen{}\left|S\right|\mathclose{} = 3\) (Definition 9).
Definition 11 (Countable set) A set is countable (Wikipedia contributors 2026e) if it is finite (Definition 8), or if its elements can be listed as a sequence (Definition: Sequence) \(a_1, a_2, a_3, \ldots\) in which every element appears.
Definition 12 (Countably infinite set) A set is countably infinite if it is countable and not finite.
Example 7 (Countable and uncountable sets)
Remark 7 (Numbers with only one decimal expansion). These notes use one more fact about the real numbers without proving it. A real number has two decimal expansions only if one of them ends in repeating \(9\)s and the other in repeating \(0\)s, as \(0.999\ldots\) and \(1.000\ldots\) do (Remark 2). So a number whose decimal places are all \(4\)s and \(5\)s, such as \(0.545454\ldots\), has only one decimal expansion.
Theorem 1 (The real numbers are not countable) The set of real numbers \(\mathbb{R}\) (Definition 4) is not countable (Definition 11) (Wikipedia contributors 2026a).
Example 8 (The diagonal number for a list) Suppose a list of real numbers starts
\[ \begin{aligned} r_1 &= 0.\mathbf{7}071\ldots \\ r_2 &= 3.1\mathbf{4}15\ldots \\ r_3 &= -2.71\mathbf{8}2\ldots \\ r_4 &= 0.555\mathbf{5}\ldots \end{aligned} \]
The bold digits are the \(n\)th decimal places of the \(r_n\): \(7\), \(4\), \(8\) and \(5\). The proof of Theorem 1 builds \(d = 0.5554\ldots\), which differs from \(r_1\) in the first decimal place, from \(r_2\) in the second, from \(r_3\) in the third, and from \(r_4\) in the fourth. However the list continues, \(d\) is not on it.
Exercise 4 (An element that is also a subset) Let \(B = {\mathopen{}\left\{1, {\mathopen{}\left\{1\right\}\mathclose{}}\right\}\mathclose{}}\). A set \(A\) is a subset of \(B\) when every element of \(A\) is an element of \(B\). Find a set that is both an element of \(B\) and a subset of \(B\).
Solution 4. The set \({\mathopen{}\left\{1\right\}\mathclose{}}\) works. It is listed in \(B\), so it is an element of \(B\). And \(1\), the one element of \({\mathopen{}\left\{1\right\}\mathclose{}}\), is also listed in \(B\), so every element of \({\mathopen{}\left\{1\right\}\mathclose{}}\) is an element of \(B\).
Definition 13 (Subset) A set \(A\) is a subset (Wikipedia contributors 2026p) of a set \(B\), written \(A \subseteq B\), if every element of \(A\) is an element of \(B\).
Example 9 (Even die rolls) The even die rolls form a subset of the possible rolls: \({\mathopen{}\left\{2, 4, 6\right\}\mathclose{}} \subseteq {\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}}\), because each of \(2\), \(4\), and \(6\) is a possible roll. The set \({\mathopen{}\left\{2, 4, 7\right\}\mathclose{}}\) is not a subset of \({\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}}\), because \(7\) is not a possible roll.
Remark 8 (The symbol \(\subset\)). Sources disagree about the symbol \(\subset\): some use it for “subset” (\(\subseteq\)), and others for “strict subset” (\(\subsetneq\)) (Wikipedia contributors 2026p). For example, \({\mathopen{}\left\{1, 2\right\}\mathclose{}} \subset {\mathopen{}\left\{1, 2\right\}\mathclose{}}\) is true in the first reading, because \({\mathopen{}\left\{1, 2\right\}\mathclose{}} \subseteq {\mathopen{}\left\{1, 2\right\}\mathclose{}}\), and false in the second, because the two sets are equal. These notes avoid \(\subset\) and write \(\subseteq\) or \(\subsetneq\).
Example 10 (Strict subsets)
Theorem 2 (The empty set is a subset of every set) For every set \(A\), \(\emptyset \subseteq A\).
Proof. By Definition 13, \(\emptyset \subseteq A\) fails only if some element of \(\emptyset\) is not in \(A\). The empty set has no elements, so no such element exists.
Theorem 3 (Every set is a subset of itself) For every set \(A\), \(A \subseteq A\).
Proof. Every element of \(A\) is an element of \(A\), which is Definition 13 with \(B = A\).
Definition 15 (Power set) The power set of a set \(A\), written \(\mathcal{P}(A)\), is the set of all subsets (Definition 13) of \(A\) (Wikipedia contributors 2026l):
\[ \mathcal{P}(A) \stackrel{\text{def}}{=}{\mathopen{}\left\{S : S \subseteq A\right\}\mathclose{}}. \]
Example 11 (The subsets of a three-element set) \[ \mathcal{P}({\mathopen{}\left\{a, b, c\right\}\mathclose{}}) = {\mathopen{}\left\{\emptyset, {\mathopen{}\left\{a\right\}\mathclose{}}, {\mathopen{}\left\{b\right\}\mathclose{}}, {\mathopen{}\left\{c\right\}\mathclose{}}, {\mathopen{}\left\{a, b\right\}\mathclose{}}, {\mathopen{}\left\{a, c\right\}\mathclose{}}, {\mathopen{}\left\{b, c\right\}\mathclose{}}, {\mathopen{}\left\{a, b, c\right\}\mathclose{}}\right\}\mathclose{}}. \]
Each element of \(\mathcal{P}({\mathopen{}\left\{a, b, c\right\}\mathclose{}})\) is a set. For example, \({\mathopen{}\left\{a\right\}\mathclose{}} \in \mathcal{P}({\mathopen{}\left\{a, b, c\right\}\mathclose{}})\), but \(a \notin \mathcal{P}({\mathopen{}\left\{a, b, c\right\}\mathclose{}})\). The list includes \(\emptyset\) (Theorem 2) and \({\mathopen{}\left\{a, b, c\right\}\mathclose{}}\) itself (Theorem 3).
Exercise 5 (Sandwich orders) A sandwich shop makes sandwiches on rye or wheat bread, with a filling of ham, cheese or tomato. List every choice of one bread and one filling, writing each choice as (bread, filling).
Solution 5. (rye, ham), (rye, cheese), (rye, tomato), (wheat, ham), (wheat, cheese) and (wheat, tomato).
Definition 16 (Ordered pair) An ordered pair (Wikipedia contributors 2026k) \((a, b)\) is a pair of objects listed in order, with \(a\) first and \(b\) second; two ordered pairs are equal, \((a, b) = (c, d)\), when \(a = c\) and \(b = d\).
Definition 17 (Tuple) For a natural number \(n\), an \(n\)-tuple \((a_1, a_2, \ldots, a_n)\) is a list of \(n\) objects in order (Wikipedia contributors 2026q). Two \(n\)-tuples are equal when their entries are equal in each position. A \(2\)-tuple is an ordered pair (Definition 16).
Example 12 (Tuples are not sets)
Definition 18 (Cartesian product) The Cartesian product (Wikipedia contributors 2026c) of sets \(A\) and \(B\), written \(A \times B\), is the set of ordered pairs whose first entry is in \(A\) and whose second entry is in \(B\):
\[A \times B \stackrel{\text{def}}{=}{\mathopen{}\left\{(a, b) : a \in A \text{ and } b \in B\right\}\mathclose{}}\]
Definition 19 (Cartesian product of several sets) For a natural number \(n\) and sets \(A_1, A_2, \ldots, A_n\), the Cartesian product \(A_1 \times A_2 \times \cdots \times A_n\) is the set of \(n\)-tuples (Definition 17) whose \(i\)th entry is in \(A_i\) for each \(i\) (Wikipedia contributors 2026c):
\[ A_1 \times \cdots \times A_n \stackrel{\text{def}}{=}{\mathopen{}\left\{(a_1, \ldots, a_n) : a_i \in A_i \text{ for each } i\right\}\mathclose{}}. \]
For \(n = 2\) this is Definition 18.
Example 13 (Cartesian products)
Exercise 6 (Two sets from their overlap) Find sets \(A\) and \(B\) whose common elements are exactly \(2\) and \(3\), and whose elements together are exactly \(1\), \(2\), \(3\) and \(4\).
Solution 6. \(A = {\mathopen{}\left\{1, 2, 3\right\}\mathclose{}}\) and \(B = {\mathopen{}\left\{2, 3, 4\right\}\mathclose{}}\) work: the elements in both are \(2\) and \(3\), and the elements in one or the other are \(1\), \(2\), \(3\) and \(4\). So do \(A = {\mathopen{}\left\{1, 2, 3, 4\right\}\mathclose{}}\) and \(B = {\mathopen{}\left\{2, 3\right\}\mathclose{}}\).
Definition 20 (Union) The union (Wikipedia contributors 2026r) of sets \(A\) and \(B\), written \(A \cup B\), is the set of elements that are in \(A\), in \(B\), or in both:
\[A \cup B \stackrel{\text{def}}{=}{\mathopen{}\left\{x : x \in A \text{ or } x \in B\right\}\mathclose{}}\]
Definition 21 (Intersection) The intersection (Wikipedia contributors 2026i) of sets \(A\) and \(B\), written \(A \cap B\), is the set of elements that are in both \(A\) and \(B\):
\[A \cap B \stackrel{\text{def}}{=}{\mathopen{}\left\{x : x \in A \text{ and } x \in B\right\}\mathclose{}}\]
Definition 22 (Set difference) The set difference (Wikipedia contributors 2026d) of sets \(A\) and \(B\), written \(A \setminus B\), is the set of elements of \(A\) that are not in \(B\):
\[A \setminus B \stackrel{\text{def}}{=}{\mathopen{}\left\{x \in A : x \notin B\right\}\mathclose{}}\]
Remark 9 (Other notation for the set difference). Some sources write \(A - B\) for \(A \setminus B\) (Wikipedia contributors 2026d).
Example 14 (Combining sets of die rolls) Let \(A = {\mathopen{}\left\{2, 4, 6\right\}\mathclose{}}\) (the even rolls) and \(B = {\mathopen{}\left\{1, 2, 3\right\}\mathclose{}}\) (the rolls of at most 3). Then:
Definition 23 (Complement) Let \(A\) be a subset of a set \(S\). The complement (Wikipedia contributors 2026d) of \(A\) in \(S\) is the set difference (Definition 22) \(S \setminus A\): the elements of \(S\) that are not in \(A\). When the set \(S\) is clear from context, the complement of \(A\) is written \(A^c\):
\[A^c \stackrel{\text{def}}{=}S \setminus A = {\mathopen{}\left\{x \in S : x \notin A\right\}\mathclose{}}\]
Remark 10 (The universal set, and other notation for the complement). The set \(S\) in Definition 23 is sometimes called the universal set. Which universal set to use depends on the context: for a set of even integers it might be \(\mathbb{Z}\), and for a set of letters it might be the 26 letters of the alphabet. Some sources write \(\overline{A}\) for \(A^c\) (Wikipedia contributors 2026d).
Example 15 (Complements of sets of die rolls) Let \(S = {\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}}\) be the possible rolls of a die.
The complement depends on \(S\): in \(S = {\mathopen{}\left\{1, 2, 3, 4, 5, 6\right\}\mathclose{}}\), the complement of \({\mathopen{}\left\{2, 4, 6\right\}\mathclose{}}\) is \({\mathopen{}\left\{1, 3, 5\right\}\mathclose{}}\), but in \(S = {\mathopen{}\left\{2, 4, 6, 8\right\}\mathclose{}}\), it is \({\mathopen{}\left\{8\right\}\mathclose{}}\).
Definition 24 (Venn diagram) A Venn diagram draws sets as overlapping circles inside a rectangle, which stands for the set \(S\) that the sets are subsets of, as in Definition 23. Each region of the picture stands for the elements that are in some of the sets and not in the others.
Example 16 (Letters of two words) Let \(L\) be the set of letters in the word LOGIC, and \(M\) the set of letters in the word MAGIC, inside the set \(S\) of the 26 letters of the alphabet. Figure 1 draws them.