Functions used for comparing sets
Let be a function. Its image is
and its preimage of is
The notation can mean the preimage of the singleton ; it does not mean that an inverse function exists. An inverse function exists only when the map is bijective.
Definition
Injection, surjection, and bijection
The function is injective if
Thus every element of has at most one preimage. It is surjective if
or equivalently ; every element of the codomain is hit. It is a bijection if it is both injective and surjective.
The codomain matters. For example, defined by is injective but not surjective because is not hit. If its codomain were , the same rule would be bijective. A claim about cardinality must therefore state both the domain and codomain.
Worked example
Checking the three properties
Consider with
The map is not injective because although . It is not surjective because and are not outputs. This small example separates the two conditions: injectivity concerns repeated outputs, whereas surjectivity concerns omitted codomain elements.
Same cardinality and countability
Concept lensStructural
Cardinality as counting and as matching
With finite sets, size can feel like an inventory: count the elements. For arbitrary sets, the definition replaces inventory with a matching test: can every element of be paired with exactly one element of , and vice versa? This is why and the even natural numbers have the same cardinality via , even though is a proper subset of . The bijection records equal size; proper containment alone does not imply strictly smaller cardinality.
Definition
Same cardinality
Sets and have the same cardinality, written
if there is a bijection .
The elements being paired need not be alike. A pairing between numbers and ordered pairs is just as legitimate as a pairing between two lists of numbers. For finite sets this agrees with ordinary counting.
Definition
Finite set
A set is finite if for some , where we represent by the finite label set ; when , this means . We then write . The empty set is finite, with .
Definition
Countable and at most countable
A set is countable in this course if it is finite or if
Equivalently, it is at most countable when it is finite or countably infinite. Some texts use “countable” only for the infinite case, so the phrase “at most countable” removes that convention ambiguity. A set that is not at most countable is uncountable.
For a countably infinite set, an enumeration is a sequence containing every element exactly once. Saying “exactly once” combines surjectivity of the listing with injectivity of its index map. Merely writing down an infinite sequence is not enough: it must be clear why no element is omitted and why repetitions do not occur.
Explicit countable sets
The integers
Theorem
The integers are countable
.
Assume . Define
This gives the list .
Proof. Every integer is either , a positive integer , or a negative integer with . These occur respectively at index , index , and index . Hence is surjective. The three cases have disjoint values, and within the positive or negative cases the displayed indices determine uniquely, so is injective. Therefore is a bijection. If is indexed from , shift the indices by one; the cardinality statement is unchanged.
This is the basic infinite-set surprise: adding all negative integers to does not create a larger cardinality. The comparison concerns the existence of a bijection, not whether one set contains the other.
The rationals
Theorem
The rationals are countable
The set of rational numbers is at most countable, and in fact countably infinite.
Every positive rational has a unique lowest-terms representation , where and . Put in row and column of a grid. Scan the grid by the finite diagonals . Within each diagonal, scan in increasing numerator (any fixed order would do), and retain only coprime pairs. The beginning is
Worked example
Why the rational diagonal scan works
Take . It is already in lowest terms and lies on the diagonal . Only finitely many diagonals precede diagonal , and diagonal contains only finitely many pairs. Thus is reached at a finite position. Conversely, retaining only coprime pairs means that two recorded pairs cannot represent the same positive rational: uniqueness of lowest terms forces to be the same pair. The scan is therefore both onto and one-to-one.
The same argument explicitly proves both directions. No positive rational is missed because it has a lowest-terms pair, and no positive rational is repeated because that pair is unique. If the resulting list is , then
lists all of exactly once. Zero occurs once, and every nonzero rational has one sign and one positive absolute value. Hence is countable. It is not finite: the inclusion from into is injective, so contains infinitely many distinct integers.

Figure. The diagonal scan turns a two-dimensional grid into one sequence; the lowest-terms condition removes duplicate names for the same rational.
Density is a different property. The rationals meet every nonempty open interval of the real line, but the diagonal procedure still places them in a single list. Dense does not mean uncountable.
Products of countable sets
The grid argument also gives a useful explicit pairing of two copies of . For , let
All pairs with fixed form a finite diagonal, and the triangular number skips exactly the preceding diagonals. Therefore lists every pair once. More formally, from one recovers the unique diagonal satisfying , then and . Thus is a bijection.
Theorem
A countable triple is countable
.
Proof. Define
Both applications of are bijections, so their composition is a bijection from to . The inverse first recovers and then recovers . This is the concrete content of “countable times countable times countable”: a finite-dimensional grid can be scanned by successive finite diagonals. The argument also handles empty factors in the usual way: if one factor is empty, the product is empty and therefore finite; the displayed bijection concerns three copies of .
The same pairing handles a finite number of labelled copies of a countable set. For example, map and into by . The map is injective, so two copies of can be stored in one copy of ; applying the inverse pairing to the appropriate coordinates recovers the label and the original number. This explains why an infinite list can absorb a finite amount of extra bookkeeping. It does not say that every enlargement has the same size: the existence of the particular map must still be proved.
More generally, cardinality comparisons can be transported through maps. If and are injections, their composition gives . If both maps are bijections, the composition is a bijection. These two simple rules are the bookkeeping behind the integer, rational, and triple enumerations in this section.
Cardinal inequalities
Definition
Cardinal inequality
For sets and , write
if there exists an injection . Write if and .
The arrow direction is essential: an injection from into says that has enough distinct locations to store every element of , so the domain is the no-larger side. The inclusion , , proves ; it does not alone prove equality. The enumeration of supplies the reverse size comparison, or the explicit bijection above supplies equality directly.
Worked example
A finite comparison with unused codomain elements
The map given by , , is injective. Thus . It is not surjective because is unused, which is exactly why the inequality may be strict.
Theorem
Cardinal inequalities form a partial-order pattern
The relation is reflexive, transitive, and antisymmetric on cardinalities. Consequently is irreflexive and transitive.
Proof. Reflexivity follows from the injective identity map . For transitivity, if and are injections, then is injective: equality of its outputs first gives equality of the outputs, then equality of inputs. Antisymmetry is precisely the Cantor-Bernstein theorem below. Finally, is impossible because ; transitivity of strict inequality follows by combining transitivity of with the unequal-cardinality conditions.
There is no set whose elements are all sets. Assuming such a universal set would permit a Russell-type self-membership construction and a contradiction. Accordingly, is not being presented as one relation with a global “set of all sets” as its domain. The partial-order statements are about any chosen collection of sets, or the cardinalities represented by that collection, that we are comparing. This qualification is foundational bookkeeping; it does not change any of the maps or proofs above.
A surjection intuitively says that is no larger than , but turning that intuition into an injection requires selecting one preimage for each . The next note examines that choice issue; here we use injections and bijections directly, without assuming a choice function.
Cantor-Bernstein: the two injections fit together
Theorem
Cantor-Bernstein theorem
If and are injections, then .
Using everywhere may leave elements of uncovered; using everywhere may fail because it is defined only on . A point outside must therefore use . Once a point uses , the point cannot use : the two branches would have the same output. The layers below propagate this requirement through repeated applications of .
Start with
then define successive sets recursively, using the initial-value-and-successor pattern of 3.2 Induction and recursive arithmetic:
Because , these sets are nested:
The inclusions are inductive: , then , and the preceding inclusion gives . If or is empty, the two injections force both sets to be empty and the unique empty map is the required bijection; the construction below also covers that case.
The layer is the part on which we will use ; the remaining points lie in and will use the inverse of on its image.
Proof. First note that is injective. For every , it maps bijectively onto . Indeed, injectivity gives one-to-one behavior. If , write with ; if , then , a contradiction. Therefore , proving onto behavior between the layers.
Define by
Here means the inverse of the bijection , not an inverse on all of . The second case is defined: a point outside every layer cannot be in , so it belongs to . The layers are disjoint because they come from a nested sequence, so is well-defined.
To prove injectivity, suppose . If both points lie in layers, injectivity of gives . If both are in the second case, injectivity of gives equality. In the mixed case, say and , the equality implies . The layer mapping just proved puts in , contradicting that was in the second case.
For surjectivity, take and put . If is in no layer, then . Otherwise . It cannot be in the zeroth layer, since while . Hence ; the layer bijection gives an with . Since is injective, , and therefore . Thus is surjective and bijective, proving . No choice function is used: the construction is determined by the given and .
Power sets and Cantor's theorem
Definition
Power set notation
For a set , the notation denotes the set of all subsets of .
Thus
means exactly that .
The notation is suggestive: if has elements, then its power set has subsets. Cantor's theorem says that the power set is larger not only for finite sets, but for every set.
For the empty set this notation is already informative:
There is one subset of the empty set, namely the empty set itself. Thus the finite pattern starts with . The theorem below is stronger than this finite counting rule: it compares cardinalities even when there is no finite number that counts the elements.
A subset missing from a proposed list
Suppose a function assigns one subset to each element of . To find a subset omitted by , it is enough to make it differ from at one element for each . The index itself supplies that element: include precisely when excludes it. Each row of the proposed list then has a specific reason to disagree with the constructed subset.
Here is a finite illustration with . Each row records one proposed value of ; a means that the column element belongs to that subset, and a means that it does not. The bold entries in the first three rows lie on the diagonal.
| Subset | |||
|---|---|---|---|
| 1 | 0 | 1 | |
| 1 | 0 | 0 | |
| 0 | 1 | 1 | |
| Constructed | 0 | 1 | 0 |
Read the diagonal as and reverse each decision to obtain . Thus . It differs from at , from at , and from at . Agreement at other positions cannot repair even one of these differences.
For an arbitrary set, the same rule is exactly when . It makes one membership decision for each element of , without requiring a numerical ordering of or an infinite scanning procedure.
Cantor's theorem
Theorem
Cantor's theorem
Let be a set. Then
The proof has two parts.
First, there is an injection
So . For example, when , this map selects two of the four subsets ; it need not hit every subset.
Second, there is no bijection from to . Suppose, for contradiction, that were a bijection. Define the diagonal set
Since is a subset of , we have . If were surjective, there would be some such that
Now ask whether .
- If , then by definition of , , a contradiction.
- If , then by definition of , , again a contradiction.
Both cases are impossible. Therefore no bijection exists, and hence .
When , the power set has one element and no function from can hit it. Thus the same conclusion includes the empty-set case.
Proof X-Ray
Where surjectivity enters
The equation is the decisive use of surjectivity. The diagonal argument does not use injectivity: it rules out every surjection from onto . The singleton injection supplies the other part of the strict cardinal inequality.
The real numbers are uncountable
Theorem
The reals are uncountable
The set of real numbers is uncountable. In particular,
The proof uses Cantor's theorem and an injection from into .
By Cantor's theorem,
So it is enough to show
Given a subset , encode it by a sequence of zeros and ones:
Then define
This sends each subset of to a real number.
Worked example
Encoding a subset of N
If
then the beginning of the sequence is
The corresponding real number begins as
The partial sums are nondecreasing and bounded above by , so completeness gives a real limit. This is the same passage from finite approximations to a real number used in 4.6 Decimal expansions and irrational numbers; no conversion to decimal notation is needed.
Why use base rather than base ? Base is useful so that distinct zero-one sequences cannot be cancelled by the tail.
If , let be the first index where the two associated sequences differ. At index , the two sums differ by exactly
The total possible contribution from all later terms is at most
which is strictly smaller than the first differing contribution. Therefore the two real numbers are not equal. Hence is injective, and .
Combining this with Cantor's theorem gives
so is uncountable.
Common mistake
The proof only needs an injection into R
To prove , we do not need every real number to be hit by . We only need distinct subsets of to produce distinct real numbers.
Worked example
A finite version of the ternary separation
Take two binary sequences which first differ at index . The contribution at that index has size . Even if every later binary digit favours the other sequence, the total later contribution is
which is only half as large. Thus the first disagreement cannot be cancelled. The same geometric-series estimate works for any first differing index.
In the other direction, fix an enumeration and define
This records the rationals below by their indices. The rational-density result in 4.4 Axioms for the reals and first approximations ensures that if , some satisfies . Hence . Thus is injective.
Identifying the continuum cardinal
Write for the set of all subsets of , and set . The zero–one ternary construction above is an injection , while the rational-index construction is an injection . Applying the proved Cantor–Bernstein theorem to these two specific maps gives
Here denotes cardinal exponentiation: functions from to correspond bijectively to subsets by their indicator functions. This equality does not assert ; is the least uncountable cardinal in the usual aleph ordering.
The continuum hypothesis
Hypothesis — Continuum hypothesis.
The continuum hypothesis says that there is no set such that
This is a natural guess after seeing that is larger than : perhaps there is no intermediate size between the countably infinite cardinality and the cardinality of the continuum.
This guess has a surprising formal status. The continuum hypothesis is independent of the usual axioms of set theory, ZFC. More precisely, if ZFC is consistent, then neither CH nor its negation is provable from ZFC: Godel's result gives the relative consistency of ZFC+CH, and Cohen's forcing result gives the relative consistency of . These are metamathematical consistency results, not proofs of CH or of its negation inside this course.
For this course, the point is not to prove those metamathematical results but to recognize where axioms matter. Cantor's theorem and real uncountability remain ZFC theorems; CH asks for a sharper comparison between them. In later proofs, record map directions and mark any use of choice or maximality.
Thus “independent” does not mean that CH is meaningless or that every cardinal statement is undecidable. It means that the usual ZFC axioms do not settle this particular intermediate-size question; CH itself is an additional hypothesis.
Countable unions of countable sets
Theorem
A countable union of countable sets is countable
Assuming the axiom of choice, if is a countable family of countable sets, then
is countable.
The empty-union case is immediate: if , the empty function is an injection into . Now assume is nonempty. Since each is countable, for each index there exists an injection
When , the unique empty function is such an injection. We use the axiom of choice to choose the whole family of injections simultaneously, including those empty-member cases. This is a choice issue about the family of witnesses; it is not a claim that a countable union of arbitrary uncountable sets is countable.
Now define
where
The index set is nonempty because belongs to the union, and the well-ordering of gives its least element. This consequence of induction is proved in 6.3 Intervals, Cantor set, density, and well-ordering. The map is injective. If , equality of the first coordinates gives . Equality of the second coordinates then gives , and the injectivity of gives .
Finally, diagonal enumeration gives an injection , so composing it with makes countable. List , then the pairs whose coordinates sum to , then those whose coordinates sum to , and so on; each pair appears at a finite stage. The index set and every member must be countable: an uncountable index set of singletons, or one uncountable member, can make the union uncountable. Empty members contribute no element.
Common mistake
Countable union is not the same as arbitrary union
The theorem here is about a countable family . It does not say that an arbitrary union of countable sets must be countable.
Work in the usual classical set-theoretic setting, including the axiom of choice for ordered aleph cardinals. Use the definitions and results on countability, Cantor’s theorem, cardinal comparison, and the continuum hypothesis developed in the preceding material.
Examples
Intervals have continuum size. The map bijects with ; its inverse is . Direct substitution verifies both identities and the square-root domains. An affine map then bijects with any nonempty bounded open interval. Thus a short interval has the same cardinality as the whole real line, without assuming CH.
Irrationals even have continuum size. Let , a countably infinite set of irrational numbers. The union is countably infinite, so choose its enumeration and an enumeration of to obtain a bijection between them. Extend that bijection to by fixing every point outside . Its range is exactly the irrationals: the original rational points and are reassigned bijectively onto , and every remaining irrational stays fixed. Thus . This explicit countable reassignment is stronger than merely proving irrational uncountability, and still says nothing about all other uncountable subsets.
Density is unrelated to the missing cardinal gap. The rationals are dense and countable; the irrationals are dense and continuum-sized. Neither property forces a claim about every possible intermediate subset. Exhibiting many particular uncountable sets of size is not a proof of CH, whose quantifier concerns every potential intermediate size.
Exercises
P01. Statement. State CH using cardinal inequalities and in a sentence about infinite subsets of . Explain the role of .
P02. Required proof. Prove the irrationals are uncountable using only real uncountability and rational countability. Identify the invalid step in “irrationals are dense, therefore uncountable.”
P03. Inverse verification. Check both compositions for and its stated inverse, including signs of square roots.
P04. Proof audit. A student argues “the reals are uncountable and is uncountable, so their cardinalities agree.” Explain the missing comparison.
P05. Injection versus bijection. Explain why the map is injective, and why that fact alone does not prove . Name the additional ingredients supplied above.
P06. Consequence distinction. Decide which follow without assuming CH: rational countability; real uncountability; irrational continuum size; every uncountable subset of having continuum size. Justify each classification without claiming to prove or disprove CH.
Full solutions
P01. CH is the assertion that no cardinal lies strictly between and , equivalently no infinite subset of is both uncountable and smaller than the continuum. In the usual aleph ordering, is the least uncountable cardinal, so CH is . The symbol is defined independently of whether that equality holds.
P02. If both and its real complement were countable, their union would be countable, contradicting real uncountability. Density alone does not imply uncountability because itself is a dense countable counterexample.
P03. For , , whose positive square root is . Therefore . Conversely for , setting gives , so . Both inverses are valid for negative as well as positive inputs because each denominator square root is positive.
P04. Uncountable is not a single cardinal value; it merely excludes countable sizes. Minimality of proves . The reverse inequality or a bijection is missing, and its equality conclusion is precisely CH rather than an automatic inference.
P05. For , choose rational with . It lies below but not below , so the assigned subsets differ. This gives only an injection from reals into a rational power set. The reverse injection from subsets of the natural numbers (encoded by 0–1 indicator sequences) to ternary real numbers using digits 0 and 1, the enumeration-induced equivalence of the two power sets, and Cantor–Schroeder–Bernstein together establish equality.
P06. The first three follow from the explicit enumeration, diagonal and countable-reassignment arguments in the preceding canonical material and examples, without CH. The final universal assertion is an equivalent formulation of CH in the stated setting, so it is not obtained from those earlier proofs. The distinction is between specific constructed bijections and a claim ruling out every possible intermediate-size subset.