Introduction to set theory
Learn to describe which values belong to a set, then use that description to count and select. Try the questions as you go.
Constructing a set
We will use $S=\{-2,-1,0,1,2\}$ throughout the next sections. Listing the members inside braces is called roster notation. A roster is easy to inspect, but a rule is more useful when a collection is large or infinite.
Here is a rule that makes $S$: take each of the inputs $0,1,2,3,4$ and subtract 2. The letter $n$ stands for whichever input we are using. The expression $n-2$ produces an output.
| Input $n$ | Calculation $n-2$ | Output |
|---|---|---|
| 0 | $0-2$ | $-2$ |
| 1 | $1-2$ | $-1$ |
| 2 | $2-2$ | 0 |
| 3 | $3-2$ | 1 |
| 4 | $4-2$ | 2 |
$$S=\{n-2:n\in\{0,1,2,3,4\}\}$$
Read: the set of outputs n minus 2, where n runs through the listed inputs.
This is a constructive definition: the expression before the colon constructs members from the allowed inputs after it. Those inputs form the indexing set. Replacing $n$ with $k$ everywhere leaves the set unchanged. Changing the allowed inputs or the expression can change its members.
Different inputs can produce the same member
- Choose inputs $n\in\{-2,-1,0,1,2\}$ and the rule $n^2$, meaning n multiplied by itself.
- The outputs are $4,1,0,1,4$. As a set, they become $\{0,1,4\}$.
- There were five inputs but only three distinct outputs. The equality rule from the previous section removes the repetitions.
An infinite input set works too: $\{2n:n\in\mathbb N\}=\{2,4,6,\ldots\}$. Here the dots mean “continue doubling each positive whole number”. Stating the rule removes the guesswork that an unfinished list could leave.
Defining a set by a condition
There is another way to describe $S$. Start with the integers and keep those at least $-2$ but less than 3. This time we select candidates directly, rather than transform inputs into new values.
$$S=\{x\in\mathbb Z:-2\le x<3\}$$
Read: the set of integers x such that minus 2 is less than or equal to x, and x is less than 3.
The candidate domain is $\mathbb Z$. The condition $-2\le x<3$ makes two demands at once: $x\ge-2$ and $x<3$. A candidate must satisfy both. This condition is called a predicate: supplying a particular number gives a statement that is true or false. The resulting set collects the candidates for which that statement is true.
Check the endpoints and the domain
- At $x=-2$, both $-2\le-2$ and $-2<3$ are true, so $-2$ is included.
- At $x=3$, the test $3<3$ is false. The upper endpoint is excluded.
- The fraction $1/2$ satisfies both inequalities, but it is not an integer. It fails the domain requirement.
- The accepted integers are exactly $-2,-1,0,1,2$, recovering the roster for $S$.
The condition has a truth value once a candidate is supplied. The set itself does not: $S$ is a collection, while $2\in S$ is a true statement about that collection.