Learning goals and preparation
Saying “put the elements in a list” hides the main work: describing the order, proving every element appears at a finite index, and accounting for repetitions or empty cases. This section compares increasing listings, diagonal listings and trees of finite strings. It also audits plausible but false arguments about infinite objects. Prerequisites are functions, natural-number well-ordering, finite products, geometric series and the earlier diagonal theorem.
The required finite geometric sums, completeness and tail proof in §5.1 is available before the real-valued constructions below; §3.4 supplies reduced-rational uniqueness and §4.3 supplies the polynomial root bound.
We use . Countable means finite or countably infinite. An empty set is countable, although no map from the nonempty set can be onto it. This small exception matters when reformulating the definition by surjections.
1. Three equivalent tests, with the empty case isolated
For a nonempty set , the following are equivalent: is countable; there is an injection ; there is a surjection .
Proof. A finite nonempty set can be assigned finitely many distinct natural indices, and an infinite enumerated set has a bijection by definition, proving the injection test. Given a surjection , assign to each the least index with . Well-ordering makes that index exist and makes the assignment injective. Conversely suppose is injective. Its image is a subset of . If is finite, is finite. If is infinite, list its elements increasingly by repeatedly selecting the least unused element. This process never stops. Every appears because only finitely many natural numbers are smaller than ; it cannot be passed over forever while smaller unused indices are selected. Applying the inverse of on yields an enumeration of . For a finite nonempty , repeating a fixed entry after its finite list supplies a surjection from . This establishes all cases without requiring the listing itself to be injective.
The least-index construction removes duplicates from an arbitrary listing. It is not generally an efficient algorithm, nor does countability assert that membership or the listing is computable. Existence of a mathematical enumeration and existence of an effective computer program are different claims.
2. An enumeration need not respect numerical order
Every infinite subset of has the increasing enumeration just proved. The same is false for : a strictly increasing sequence has a first value and cannot later reach any smaller integer, so it cannot cover all integers. The familiar enumeration sacrifices increasing order in order to be exhaustive.
Even cannot be enumerated in strictly increasing order. An exhaustive increasing list must begin with zero, since otherwise zero is already missed. Let its next entry be . Then the rational lies strictly between the first two entries and can never occur later in an increasing list. The contradiction is not that rationals are uncountable; it is that this particular order requirement is impossible.
Theorem 5.2.1
(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 5.2.2
(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.
Another explicit listing. List integer numerator and positive denominator pairs by a finite height, such as increasing , and within each height by increasing numerator. Output and remove duplicate values at their first occurrence if desired. Every rational has at least one such pair with finite height and finitely many preceding pairs, proving coverage. Rational density does not obstruct this nonmonotone listing.
Worked example 5.2.3
(Removing duplicates from the height listing)
Run the height listing of the previous paragraph for heights , numbering positions from :
| height | pairs , increasing | output |
|---|---|---|
So the listing begins , a surjection onto with repetitions. The least-index construction of Section 1 assigns to each rational its first position: , , , , , , . Different rationals receive different first positions, which is the injection test. Keeping only first appearances gives the enumeration without repetition ; its order is neither increasing nor the order of the diagonal scan above, and none is needed.
Section 1 compares sets by maps rather than by apparent size, and this section lists and the positive rationals. The lab below collects these comparisons: a finite bijection, an injection that misses a point, the listing of , and the scan of the positive rationals, which is the diagonal scan of this section with non-reduced pairs skipped.
3. Count a family of finite descriptions
All finite integer strings can be listed by a height that controls both length and entry magnitude. For instance, first list the empty string; for each positive height , list all strings of length at most whose entries have magnitude at most , retaining a string only at its first appearance. Each stage has finitely many candidates. Every finite string has some finite length and maximum magnitude, hence appears by a sufficiently large stage.
Integer polynomials are enumerated by the coefficient strings just constructed; trailing zeros may duplicate descriptions. Exclude the zero polynomial when invoking finite root bounds.
Polynomials as finite formal sums
Definition 5.2.4
(Polynomial over R)
A polynomial with real coefficients is a formal sum
where each and all but finitely many coefficients are zero. The set of all such polynomials is denoted by .
The word "formal" matters. A polynomial is not merely a function value at one particular ; it is the whole list of coefficients, with only finitely many nonzero entries. Once the coefficients are fixed, the polynomial expression is fixed.
Concept lensStructural
Coefficients first, values after substitution
Two formal polynomials are equal precisely when every corresponding coefficient agrees, including omitted zero coefficients. Thus and are equal. Evaluating at a real number instead produces the number . The infinite summation notation involves no convergence question: only finitely many summands are nonzero.
An evaluated value contains less information than the coefficient list. For example, and both give at but have different coefficients. Over , agreement at every real input does imply polynomial equality; later in this note the root bound will justify that converse. Until then, coefficient equality is the definition, and evaluation is an operation applied to the already-defined object.
If at least one coefficient is nonzero, the degree of is the largest index for which . If every coefficient is zero, we call the zero polynomial and set
This convention lets degree formulas include the zero polynomial without many exceptional cases.
A nonzero constant has degree , since its constant coefficient is its highest nonzero coefficient. The zero polynomial has no such coefficient and is not a degree-zero polynomial. In degree comparisons is smaller than every nonnegative integer; use and , including . These are conventions for degree bookkeeping, not claims that a polynomial has a negative integer exponent. The zero polynomial has no leading coefficient and is not monic.
A polynomial is monic if its leading coefficient is . For instance, is monic, while is not.
Common mistake
(Do not read the displayed last term as the degree)
If a polynomial is written as
then only when . The notation by itself does not guarantee that the displayed final coefficient is nonzero.
Addition, multiplication, and degree
Let
Their sum is formed coefficient-by-coefficient:
Their product is given by the convolution rule:
Only finitely many terms contribute, so the product is again a polynomial.
Theorem 5.2.5
(Degree rules)
For ,
- ;
- .
The second identity uses the fact that the coefficient field has no zero divisors.
The inequality in the first rule can be strict because leading terms may cancel. For example,
The product rule is stronger: if and are nonzero with leading coefficients and , then the coefficient of in is , which is nonzero.
To see why no higher product term survives, let and . A contribution at an index must have either or , so one coefficient is zero. At index , only the pair , can contribute. Its product is nonzero because the coefficients belong to a field. Consequently a product of two nonzero polynomials cannot be the zero polynomial.
For addition, every coefficient above is zero. If the degrees are unequal, the higher leading term has no counterpart to cancel, so the bound is attained. With equal degrees, cancellation can continue through all coefficients: has degree . If either factor in a product is zero, the product is zero and the stated conventions give the same rule.
Theorem 5.2.6
(Division algorithm for polynomials)
Let with . Then there exist unique polynomials such that
For existence, consider the nonempty set
It contains by taking . If , choose with and take ; the remainder condition follows from . Otherwise every element of has nonnegative integer degree, so well-ordering gives an element of least degree.
Suppose , with leading coefficients and respectively. Since , the field permits the coefficient . Form
The exponent is nonnegative, so the added expression is a polynomial and is still in . The two leading terms cancel and all remaining terms have degree below . If , it contradicts ; otherwise its smaller degree contradicts minimality. Therefore , and supply the required pair.
Uniqueness is just as important as existence. If
with both remainders of degree less than , then
The left side is either zero or has degree at least ; the right side has degree strictly less than . Thus both sides must be zero, so and .
Proof X-ray
Where the uniqueness contradiction occurs
Assume the quotients differ. Their difference is then a nonzero polynomial, whose degree is at least . Multiplying by nonzero makes the left side have degree at least . On the right, subtraction may cancel terms, but cannot increase the degree beyond that of the larger remainder. Thus the two sides cannot be equal. The quotients must agree, and substituting back forces the remainders to agree too. This argument uses the degree bound and the nonzero-divisor hypothesis together.
Remainders from evaluation
When the divisor is linear, the division algorithm becomes especially powerful.
Theorem 5.2.7
(Remainder theorem)
Let and . When is divided by , the remainder is .
Indeed, the remainder has degree less than , so it is a constant . Writing
and substituting gives .
Here is regarded as a constant polynomial in the division identity; it may be zero. We do not divide the identity by and then substitute , since that would divide by zero. Evaluation is legitimate directly in the polynomial identity.
Polynomial divisibility means that if for some polynomial in the same coefficient field. For nonzero , this is equivalent to having zero remainder. In particular, every polynomial divides the zero polynomial, although division with remainder requires a nonzero divisor.
Theorem 5.2.8
(Factor theorem)
For and ,
The factor theorem translates between algebraic factorization and roots. It is one of the main reasons roots become useful: a root supplies a linear factor, and a linear factor supplies a root.
How many roots can a nonzero polynomial have?
The factor theorem gives a degree bound on roots.
Theorem 5.2.9
(Root bound)
A nonzero polynomial of degree over or has at most distinct roots.
The base case is degree : a nonzero constant never evaluates to zero. Assume the bound for degree , and let have degree . If it has no roots, the claim already holds. Otherwise choose a root . The factor theorem gives , where is nonzero and has degree by the product rule.
For any distinct root , evaluation gives . The scalar is nonzero in the coefficient field, so . By induction there are at most such distinct roots, plus the one value . This proves the bound for degree . The argument does not require : even if is also a root of , it is still only one value in the set of roots.
An immediate consequence is that a polynomial of degree at most with distinct roots must be the zero polynomial. This is a uniqueness theorem: too many zeros force every coefficient to vanish.
The root bound also needs its exact hypotheses. The zero polynomial vanishes at every input and is excluded. The word “distinct” counts values, rather than the number of times a factor occurs. Applying the bound to shows that polynomials of degree at most agreeing at distinct inputs are equal: otherwise their nonzero difference would have too many roots. Agreement at every real input is a special case, completing the connection between formal polynomials and their evaluated functions.
Countable products and unions with supplied enumerations
Let . For each , suppose a domain and a surjection are given together as one family of data. Empty sets use ; a finite list may use a finite . Under these hypotheses is countable. Likewise, the product of two sets with supplied enumerations is countable.
Proof. Fix the bijection given by
It scans successive finite diagonals. For a union, retain only pairs with and , and, in order of their -indices, output . Every member of the union occurs because its supplied map is surjective. For each output , the set of indices at which occurs is a nonempty subset of , so it has a unique least member. Assigning that least index is injective: one index corresponds to one pair and hence one output. Thus the union is countable; the empty union is immediate. This construction uses the supplied enumeration of each set.
For a product , use the supplied maps and and retain only pairs . The output reaches every product element; assigning the least valid -index of each output proves countability as above. If either factor is empty, the product is empty.
Uniform rational lists. Fix an enumeration of as . For each fixed , enumerate index tuples in by increasing coordinate sum and then lexicographically, and send to . Every tuple occurs; each diagonal is finite. For use the single empty tuple. These rules supply the lists simultaneously for all , so the union of finite rational strings is countable without choosing unspecified lists.
A nonzero rational-coefficient polynomial has finitely many real roots. For each nonzero polynomial in the supplied countable list, list its real roots in increasing order, using an empty list if it has none. Every finite subset of has a unique increasing listing, so this rule supplies the entire family of root lists without an arbitrary choice of enumerations. Their union is the set of real algebraic numbers, hence it is countable.
A real number described by a particular kind of finite string belongs to at most a countable family of such descriptions. This does not show that every real number has such a description. Uncountability demonstrates why the latter assumption cannot be inserted without proof.
4. Finite tree nodes and infinite branches are different objects
Let be the set of binary strings of length . It has elements. Listing strings by length and then lexicographically shows that is countable. The empty string is the single length-zero node.
An infinite binary sequence is not one of those finite nodes. It is a compatible choice of one node at every level, forming an infinite branch. If a proposed list of branches is , define a new branch by . The new branch differs from branch at its th coordinate, so no entry equals it. Thus infinite branches are uncountable even though the collection of all finite nodes is countable.
Audit a false argument. “Every infinite sequence consists of its countably many finite prefixes, and all finite prefixes form a countable set; therefore all infinite sequences form a countable set.” The premise concerns membership of prefixes in , but the conclusion treats a family of subsets of as though it were a subset of . A branch is a whole compatible subset of nodes, not an individual node. The power set of a countable set can be uncountable. The countable-union theorem would require a countable index set of branches; assuming that index set already assumes the conclusion.
5. A countable basis does not mean countably many open sets
The rational-density input. Let be real. By the Archimedean estimate in §5.1, choose positive naturals with and . The set of naturals is nonempty and has a least member. Since , this is positive; minimality gives . Put the integer . Then , and division by positive gives . This proves the rational endpoint existence used next, including intervals with negative endpoints.
The open intervals with rational endpoints form a countable family. Every open subset is a union of members of that family: around each , find a small contained interval, then use rational density to choose rational endpoints on either side of within it. Taking every rational interval contained in recovers exactly .
Nevertheless there are uncountably many open sets: the map is injective from into that collection. If , a point between them belongs to the first half-line but not the second. There is no contradiction. Each individual open set uses a subcollection of a countable basis, but there are uncountably many subcollections. The distinction is the same nodes-versus-branches error in a different setting.
Worked example 5.2.10
(Running the rational-density construction)
Take and , so . Follow the construction step by step.
- : works, since .
- : here , so works.
- The least natural is , and indeed .
- .
Check the chain : . Dividing by gives
and . The shift by exists only to make positive, so that the least element is taken in ; for an interval of positive numbers it is unnecessary.
6. Optional geometric extension: uncountability can fit inside very short covers
The convergence and tail argument in §5.1 applies to these same digits, with only the index renamed.
For a binary sequence , define . The geometric series bounds it in . Put and ; this is the same map with indices renamed.
To justify injectivity without a false claim that ordinary ternary expansions are always unique, suppose two binary sequences first differ at index . Their leading difference has magnitude , while the largest possible magnitude of the tail is
The leading difference is strictly larger, so it cannot be cancelled.
Thus the set of all these values is uncountable.
Fixing the first digits places each value in one of closed intervals, each of length , because the remaining tail ranges from zero to . Hence has a finite cover with total interval length , tending to zero. This is only a statement about explicit finite cover lengths; no measure-theory terminology is required. It shows why cardinality alone should not be identified with geometric length.
Quick check
(Give a surjection and the injection that the least-index construction produces from it.)
Alternate the two values.
Solution · Answer
Let for even and for odd ; it is onto because and . The least index with value is and the least with value is , so the construction gives , , which is injective.
Quick check
(How many binary strings have length at most , and at which position (from ) does appear when strings are listed by length and then lexicographically?)
Count strings of each length .
Solution · Answer
There are such strings. The listing begins with the empty string (position ), then (positions ), then ; so is at position .
Quick check
(Is the collection of all finite subsets of countable?)
Describe a finite subset by one finite string.
Solution · Answer
Yes. A finite subset has a unique increasing listing, a finite string of rationals, and different subsets give different strings. The finite rational strings form a countable set by the uniform rational lists above, so (its increasing string) is an injection into a countable set, and the collection is countable.
Graded construction and audit tasks
- Definition edge case. Explain why “countable if and only if there is a surjection from ” needs a nonempty qualification, and give a version correct for every set.
- Order. Prove there is no strictly increasing enumeration of , this time without an available minimum zero.
- Coverage. Specify an exhaustive listing of all rational-coefficient polynomials using finite strings, and identify both sources of duplicate descriptions.
- Tree distinction. Prove that the binary sequences eventually equal to zero form a countable set, while all infinite binary sequences do not. State what “eventually” permits to depend on the sequence.
- Open-set audit. A student says a union of members of a countable basis has only countably many possible values. Identify the conflated objects and provide an injective counterexample family.
- Geometric bound. In the optional construction of , show that for every there is a finite interval cover with total length less than . Why does this not provide an enumeration of ?
Full solutions
- The empty set is finite and hence countable, but any function from must assign a value to zero, so it cannot have empty target. A correct formulation is “ is countable if it is empty or is the image of a surjection from .” Equivalently for all sets, countability is the existence of an injection , including the empty function.
- Any proposed increasing enumeration has first term . The rational also belongs to the set but is smaller than that first term and cannot appear later in a strictly increasing sequence. Thus it is not exhaustive. This contradiction uses the first term rather than a minimum of the set.
- First enumerate rationals via integer/positive-denominator pairs. For each finite length, enumerate tuples of rational indices by repeated diagonal enumeration; interleave the lengths. Output the polynomial having that coefficient tuple. Duplicate rational representations can give the same coefficient, and trailing zero coefficients give different-length strings for the same polynomial. Removing repetitions is optional for countability; every polynomial has a finite tuple and is therefore reached.
- For each cutoff , a sequence that is zero from index onward is determined by its first bits, so there are possibilities. Listing by cutoff then finite prefix gives countability of their union. The cutoff can depend on the sequence; no common cutoff is claimed. For unrestricted infinite sequences, the diagonal construction above defeats every proposed listing, giving uncountability. Being a countable union over cutoffs covers only the eventually-zero family, not every branch.
- The basis is a countable set of individual intervals; its subcollections form a power set, not the basis itself. Distinct subcollections can produce many different unions. The open half-lines for real are already an uncountable family by the injectivity argument above, so the claimed count is impossible.
- Choose with . Group the points by their first digits and take the corresponding closed intervals, each of tail width . This finite cover has the required total length. Each interval can still contain uncountably many distinct continuations, and a cover by sets is not a listing of their individual elements. The injective binary-sequence construction independently proves uncountable.
Summary and terms
An exhaustive listing reaches every element at a finite position; it need not be sorted or computable. A finite description is one finite string, while a family of infinite compatible descriptions can be uncountable. A basis is a collection used to generate open sets, not the collection of all its subcollections. Prove the coverage property of a listing and identify the actual objects being counted before applying a countable-union argument.