1.2 Sets, Subsets, and Power Sets
The previous section wrote an elevator’s allowed floors as but treated the braces as a simple state list. We now study that structure formally. The purpose is not to accumulate symbols; it is to answer precise questions: Does an object occur in the list? Are two lists identical? Is one list contained entirely in another?
The section proceeds in three stages:
- Read and write a set, then decide whether an object belongs to it.
- Compare sets using equality, cardinality, and the subset relation.
- Collect every possible subset into a new object called a power set.
A set organizes distinct objects into one collection. The objects inside it are elements. If belongs to set , write ; if it does not, write .
Translate the notation directly when reading it:
- says “3 belongs to the set .”
- says “5 does not belong to the set .”
- gives this set the name .
Elements do not need to be numbers. is a set of colors; is a set of machine modes; an element may even be another set.
A set cares about membership, not writing order or repetition. Therefore,
The last notation is redundant but does not create extra elements. All three sets have exactly the same members and are equal.
The number of elements in a set is its cardinality, written . If , then . Repetition does not increase cardinality, so is still 3.
Use a reliable two-direction test for equality of finite sets:
- Check that every element on the left occurs on the right.
- Check that every element on the right occurs on the left.
The sets are equal only when both checks pass. Equal cardinality alone is insufficient: and have the same size but different members.
Two common ways to write sets
So far we have used roster notation, listing elements directly inside braces. When a collection is larger, a condition may be clearer. For example,
The vertical bar reads “such that.” The entire expression says: “ is the set of all such that is even and lies from 1 through 8.” Checking the values gives . This is called set-builder notation.
Elements, sets, and subsets
Do not confuse an element belonging to a set with one set being contained in another. If
then , while . The object is an element; is a set containing one element. They are not the same object.
Treat the two symbols as answers to different kinds of questions:
| Notation | What is on the left? | What is on the right? | Question asked |
|---|---|---|---|
| One object | One set | Is this object a member? | |
| One set | One set | Is every left-side member also on the right? |
When , both and are true, but is false. The three elements of are ; the set is not one of them.
Set is a subset of when every element of also belongs to . Write
To refute this claim, one witness is sufficient: an with . If and , then is a proper subset of , written .
For finite sets, apply the definition mechanically:
- Take the first element from the left set.
- Search for it on the right. If it is absent, stop; this element is a counterexample.
- If it is present, continue with the next left-side element.
- If every left-side element passes, the subset claim is true.
For example, let and . We find 1 in , then find 3, so . In the reverse test , element 2 is missing from , so 2 witnesses that the claim is false.
Every set is a subset of itself: each of its elements obviously belongs to it. Thus is always true, but is false because a proper subset must also be unequal to the larger set.
The forge turns the definition into a constraint system. Instead of merely reporting “wrong,” it searches for a witness that breaks . This pattern will return throughout the course: proving a universal claim requires covering every case, while refuting it often needs only one counterexample.
Try the forge’s incomparable target. If contains something missing from and also contains something missing from , both subset directions fail. Sets do not always nest neatly as one smaller collection inside another.
The empty set and power sets
The empty set contains no elements and is written or . It is a subset of every set. This is not because the empty set is physically hidden inside every collection. It is because no element of the empty set can violate the subset condition.
Apply the checking procedure: when testing , there is no first left-side element and therefore no possible failure witness. The procedure finishes immediately, so the claim is true. Logic will later give this type of reasoning a formal explanation.
The power set of is the set containing every subset of :
The elements of a power set are themselves sets. If , then
Every original element has two independent choices: include it in a subset or leave it out. If , then
Do not memorize the formula before constructing a small case. For :
- Choose neither element to obtain .
- Choose only to obtain .
- Choose only to obtain .
- Choose both to obtain .
Represent include by 1 and exclude by 0:
| Choice bits | Resulting subset |
|---|---|
| 00 | |
| 10 | |
| 01 | |
| 11 |
Two positions with two choices each create results. With elements there are binary positions, which explains the count .
The constellation layers subsets by cardinality. Layer contains every subset of size , for a total of . Combining every layer must cover the entire power set:
For now, read the left side as grouping subsets by size and the right side as counting independent switches. Chapter 6 will develop these counting methods systematically.
The symbol is only a preview here. It means “the number of ways to choose exactly objects from distinct objects.” You do not yet need its general formula. In the lab, simply observe that subsets with equal cardinality occupy the same layer. Chapter 6 will derive the calculation from the beginning.
Bridge to the next section
We can now create sets, test membership, compare subsets, and enumerate every subset. Real questions often combine two lists: students attending course A or course B, or actions available to each user. The next section builds union, intersection, difference, and Cartesian products directly from the membership ideas and learned here.