Cardinality, finite and infinite sets, countable sets, uncountable sets, and Cantor diagonal arguments.
Cardinality is the part of set theory that compares the sizes of sets. For finite sets this agrees with ordinary counting, but for infinite sets the idea becomes more subtle, because two infinite sets may have the same size even when one appears to sit inside the other as a proper subset.
Size by Correspondence
The basic idea is that two sets have the same size when their elements can be paired without omission or repetition. This avoids relying on ordinary counting, which works only for finite sets.
For example, the sets:
and:
have the same size because we can pair:
In finite cases this means both sets have the same number of elements. In infinite cases this becomes the definition of having the same cardinality.
Definition 7.42 (Equipotence)
Two sets and are equipotent if there exists a bijection:
In this case we say that and have the same cardinality, and we write:
The notation denotes the cardinality of , meaning the size of considered up to bijection.
Example 7.43
The set:
and the set of even natural numbers:
have the same cardinality.
Define:
by:
This function is injective because:
It is surjective because every even natural number has the form for some .
Thus is a bijection, and therefore:
This example shows that an infinite set can have the same cardinality as one of its proper subsets.
Lemma 7.44 (Equipotence Is an Equivalence Relation)
Equipotence is an equivalence relation on sets.
That is, for all sets , , and :
if:
then:
and if:
then:
Proof
Reflexivity follows from the identity function:
which is a bijection, so has the same cardinality as itself.
Symmetry follows because if is a bijection, then by Lemma 7.37 there exists an inverse bijection:
so has the same cardinality as .
Transitivity follows because if and are bijections, then the composition:
is also a bijection. Hence and have the same cardinality.
Finite Sets
A set is finite when its elements can be counted by some natural number. We define this using bijections with initial segments of the natural numbers.
For , write:
Thus:
Definition 7.45 (Finite Set)
A set is finite if there exists some and a bijection:
In this case we say that has elements and write:
A set is infinite if it is not finite.
Example 7.46
The set:
is finite because there is a bijection:
given by:
Therefore:
The empty set is finite because:
and the identity map:
is a bijection.
Lemma 7.47 (Finite Cardinality Is Unique)
If a set is in bijection with and also in bijection with , then:
Proof
It is enough to show that there is no bijection between and when .
Assume without loss of generality that . Then has fewer positions than . A function from to can assign at most one output to each of the inputs, so its image contains at most elements. Since has elements and , at least one element of cannot be in the image. Therefore no function can be surjective.
Hence no bijection exists between and when , so the number of elements of a finite set is well defined.
Countable Sets
Countability extends the idea of listing elements. A set is countable if its elements can be arranged in a sequence, possibly with repetitions removed, so that every element eventually appears.
Definition 7.48 (Countable Set)
A set is countable if there exists a surjection:
Equivalently, is countable if it is finite or there exists a bijection:
When there exists a bijection , the set is called countably infinite.
Example 7.49
The set is countably infinite, since the identity function:
is a bijection.
The set of even natural numbers is countably infinite by the bijection:
The set of odd natural numbers is countably infinite by the bijection:
Lemma 7.50 (Every Subset of a Countable Set Is Countable)
If is countable and , then is countable.
Proof
Since is countable, there exists a surjection:
If , then is finite and hence countable.
Assume is nonempty, and choose an element:
Define a function:
as follows. For each , if , set:
If , set:
Then maps into . We claim that is surjective. Let . Since is surjective onto , there exists such that:
Because , the definition gives:
Therefore every element of is hit by , so is countable.
Countability of the Integers
The integers extend the natural numbers by adding negative numbers:
Although appears larger than , it is still countable because its elements can be listed in a sequence.
Lemma 7.51 (The Integers Are Countable)
The set is countably infinite.
Proof
Define:
by:
and for :
This gives the listing:
Every integer appears exactly once in this list. The number appears at index . If , then . If , then . Therefore is surjective.
One may also check that no two indices give the same integer, so is injective. Hence is a bijection, and:
Countability of Products
A key fact is that the product of two countable sets is countable. The main example is:
This means that all ordered pairs of natural numbers can be listed in a single sequence.
Lemma 7.52 (The Product of Two Countable Sets Is Countable)
If and are countable, then:
is countable.
Proof
It is enough to prove that:
is countable, because if and are countable, then their elements can be listed using natural numbers, and pairs of elements can be listed by first listing pairs of indices.
We list the pairs by increasing value of:
The list begins:
Every pair appears in the finite block where:
Since every natural number eventually appears, every pair appears somewhere in the list. Therefore there is a surjection:
Hence:
is countable.
Since any product of countable sets is the image of a countable set under a suitable map, it is also countable.
Corollary 7.53 (Finite Products of Countable Sets Are Countable)
If:
are countable sets, then:
is countable.
Proof
The proof is by induction on .
For , the statement is the definition of countability.
Assume the result holds for . Then:
is countable by the induction hypothesis. Since is countable, Lemma 7.52 implies:
is countable. This set is naturally identified with:
Thus the result holds for .
Countability of the Rational Numbers
The rational numbers are fractions:
There are infinitely many rational numbers between any two distinct rational numbers, but the whole set is still countable.
Lemma 7.54 (The Rational Numbers Are Countable)
The set is countable.
Proof
Every rational number can be represented by a pair:
where:
is the corresponding rational number.
The set is countable by Lemma 7.51, and the subset:
is countable by Lemma 7.50.
Therefore:
is countable by Lemma 7.52.
The map:
is a surjection from this countable product onto . Hence is countable.
This proof does not require each rational number to have a unique representation, because countability only requires that every rational number appears at least once in some list.
Countable Unions
A countable union of countable sets is countable. This result is one of the main tools for proving that large looking sets are still countable.
Lemma 7.55 (Countable Union of Countable Sets)
Let:
be countable sets. Then:
is countable.
Proof
Since each is countable, for each there exists a surjection:
Define:
by:
This function is surjective. Indeed, if:
then there exists such that:
Since is surjective, there exists such that:
Therefore:
By Lemma 7.52, the set is countable. Since the union is the image of a countable set under , it is countable.
Uncountable Sets
A set is uncountable if it is not countable. The first and most important example is the power set of the natural numbers.
Definition 7.56 (Uncountable Set)
A set is uncountable if there is no surjection:
Equivalently, is uncountable if its elements cannot be listed in a sequence indexed by the natural numbers.
Theorem 7.57 (Cantor Diagonal Theorem)
The power set:
is uncountable.
Proof
Suppose, for contradiction, that:
is countable.
Then there exists a surjection:
Thus every subset of appears somewhere in the list:
Define a subset by:
Since is a subset of , it is an element of:
Since is assumed to be surjective, there exists some such that:
Now ask whether:
By definition of :
But:
so:
This is impossible. Therefore the assumption that such a surjection exists must be false. Hence:
is uncountable.
Corollary 7.58
There are different sizes of infinity.
Proof
The set is infinite and countable. The set:
is infinite and uncountable by Theorem 7.57. Therefore:
Thus not all infinite sets have the same cardinality.
Cantor Theorem
The diagonal argument works for every set, not only for .
Theorem 7.59 (Cantor Theorem)
For every set , there is no surjection:
In particular:
in the sense that the power set has strictly larger cardinality than .
Proof
Suppose, for contradiction, that:
is surjective.
Define:
Then:
so:
Since is surjective, there exists such that:
Now:
if and only if:
Since:
this becomes:
if and only if:
This contradiction shows that no such surjection exists.
Real Numbers and Uncountability
The real numbers are uncountable. One way to prove this is to show that the interval:
is uncountable.
The proof uses a diagonal construction similar to Cantor theorem.
Theorem 7.60 (Uncountability of the Unit Interval)
The interval:
is uncountable.
Proof
Suppose, for contradiction, that:
is countable.
Then the real numbers in can be listed as:
Write each in decimal form:
To avoid ambiguity from decimal expansions ending in repeated digits, choose decimal expansions that do not eventually become all .
Now define a new real number:
where each digit is chosen so that:
and also:
For instance, one may choose:
Then is a real number in . Moreover, for each , the number differs from in the th decimal digit. Therefore:
for every .
This contradicts the assumption that the list contains every real number in . Hence:
is uncountable.
Corollary 7.61
The set of real numbers is uncountable.
Proof
The interval:
is a subset of:
If were countable, then every subset of would be countable by Lemma 7.50. But Theorem 7.60 shows that is uncountable. Therefore is uncountable.
Comparing Cardinalities
Cardinality can be compared using injections and surjections.
Definition 7.62 (Cardinality Comparison)
We write:
if there exists an injection:
We write:
if:
and:
This definition says that has size at most if can be embedded into without identifying distinct elements.
Example 7.63
There is an injection:
given by:
Thus:
There is also an injection:
because is countable.
Therefore:
Theorem 7.64 (Cantor Schroeder Bernstein)
If there is an injection:
and an injection:
then there exists a bijection:
Consequently:
Proof
We give the standard construction.
Since and are injections, think of as sitting inside through , and as sitting inside through .
Define:
These are the elements of that are not hit by .
For each , define:
Let:
Now define:
by:
if:
and:
if:
This is well defined in the second case because if , then in particular , so , and since is injective there is a unique such that:
One checks that is injective and surjective.
On the part , the map uses to move elements from to . Outside , the map uses the inverse of on its image. The construction separates the elements that must move forward by from the elements that can move backward by .
Thus is a bijection from to .