Discrete Structures
§1 Sets
Sets, subsets, set-builder notation, set equality, and Russell's paradox.
A set is a group of objects. The objects inside it are called elements.
Here, , , and are elements of .
- means “ is in .”
- means “ is not in .”
The empty set
The empty set has nothing in it. We write it as
Since it has no elements,
no matter what is. Even the empty set is not inside itself:
But is different. It is a set with one element, and that element happens to be the empty set:
Number sets
These symbols show up often:
| Symbol | Numbers it contains |
|---|---|
| fractions such as , , and | |
| every number on the real number line |
In these notes, is included in . Some books start at , so it is always worth checking which convention is being used.
Each set fits inside the next one:
and are discrete: their values come in separate steps. is continuous: there are always more real numbers between any two different real numbers.
Elements and subsets are not the same thing
The symbols and describe two different relationships.
- asks whether one object is inside .
- asks whether every element of is also in .
For example,
This is true because , , and are all natural numbers.
More generally,
means that anything in must also be in .
The empty set is a subset of every set:
Why? For this to be false, we would need to find something in that is missing from . There is nothing in , so there can be no counterexample.
That does not mean is an element of every set:
Sometimes both relationships can be true. If
then
because appears as one element of . We also have
because both and are elements of .
Two ways to write a set
List the elements
The simplest way is to list everything inside braces:
Order does not matter, and writing something twice does not add a new element:
A set only remembers whether an element is there. It does not remember its position or how many times it was written.
Describe a rule
For a large or infinite set, listing everything is not practical. Instead, we can describe which values belong:
Read the vertical bar as “such that.” The set tells us where is allowed to come from.
For example,
This says: take the integers, then keep the ones that are at least zero.
The odd natural numbers can be written as
or
As runs through , the expression gives .
Rational numbers
A rational number is any number that can be written as a fraction of two integers:
The same number can have many fraction forms:
We usually clean this up by reducing the fraction and keeping the denominator positive. That is why
is normally written as
When are two sets equal?
Two sets are equal when they contain exactly the same elements. The way they are written does not matter.
A common way to prove that is to prove both directions:
This works because the first direction says has nothing extra, while the second says has nothing extra.
Example: two forms of the odd integers
Consider
and
They look different, but both produce every odd integer.
First, take any . Then for some integer . We can rewrite it as
Since is still an integer, has the form used in . Therefore,
Now go the other way. Take any . Then for some integer . Rewrite it as
Since is an integer, has the form used in . Therefore,
Both directions are true, so
The only real difference is where the integer counter starts. Shifting an integer by still gives an integer, so neither description misses any odd numbers.
Why a rule does not always create a valid set
It is tempting to think that any rule can define a set. Russell's paradox shows why that causes trouble.
Imagine trying to define
In words, contains every set that does not contain itself.
Now ask: does contain itself?
- Suppose . Then should satisfy its own rule, which says .
- Suppose . Then does satisfy the rule, so .
Either answer gives the opposite answer:
That contradiction is Russell's paradox.
The safe approach is to start with a set that already exists, then choose some of its elements:
This builds a subset of . It does not try to create a giant “set of everything.”
Keep these straight
- : is one element of .
- : every element of is also in .
- is always true.
- is only true if actually contains the empty set.
- Sets ignore order and repeated entries.
- To prove , prove both and .
- In set-builder notation, start with a set and select elements from it.