Finite Sets and Counting
How many elements does a set have? What does "finitely many" even mean before we can count on our fingers? This question sounds childish, but making it rigorous forces us to confront a subtle circularity. We want to define " elements" using the number . Yet numbers themselves are often built from sets. The resolution, due essentially to Cantor and Dedekind, was sharpened by Peano-style arithmetic. It is to define finiteness through the existence of a bijection with a canonical model. This model is the initial segment . We then prove, from first principles, that this model is essentially unique. We also prove it is internally consistent. This matters because every counting argument you will ever use secretly rests on two facts. This includes arguments from combinatorics to computer science. These two facts must be proved rather than assumed. First, a finite set cannot be put in bijection with two different initial segments. This means "the number of elements" is well-defined. Second, a finite set cannot be put in bijection with one of its own proper subsets. The second fact is the Pigeonhole Principle. It is one of the most quietly powerful tools in all of mathematics. It underlies proofs in number theory, graph theory, computer science, and Ramsey theory. Often, it works in disguise. The big picture is that "finite" is a cardinality notion. It is defined purely in terms of bijections. There is no appeal to intuition about "stopping" a counting process. This sets up the entire theory of Comparing Cardinalities. Once finiteness is nailed down rigorously, we can ask a new question. What happens when we drop the requirement that be a natural number? This leads to Countable Sets and beyond. This article gives the formal definition of a finite set. It does so via bijection with . It proves the well-definedness of cardinality. No set is equinumerous with two different initial segments. It derives the pigeonhole principle as a clean corollary. It works through nontrivial examples showing the machinery in action. This includes cases where it breaks if hypotheses are dropped.
- A set is finite if there is a bijection for some (or , the case ).
- The number is uniquely determined by : this is the well-definedness of cardinality, proved by strong induction.
- The pigeonhole principle says an injection from a finite set into a strictly smaller finite set cannot exist.
- Equivalently: no finite set is equinumerous with a proper subset of itself (unlike infinite sets).
- Finite sets are closed under subsets, unions, products, and images under functions — all provable from the definition.
- Key idea: finiteness is defined by comparison (bijection) with a fixed scale , and all counting facts follow from analyzing maps between these scales.
Where this lives today
The pigeonhole principle proved here as a corollary is a workhorse across mathematics and computer science. In number theory, it underlies proofs like the existence of rational approximations to irrationals (Dirichlet's approximation theorem) and results about repeating decimals. In combinatorics, it is the seed of Ramsey theory: statements like "any 6 people at a party contain 3 mutual friends or 3 mutual strangers" are pigeonhole arguments in disguise, iterated and refined. In computer science, hash table collision analysis, the birthday-paradox estimates in cryptography (collision attacks on hash functions), and lower bounds in information theory and compression (you cannot losslessly compress all strings of length into strings of length ) are direct or statistical descendants of the pigeonhole idea. In statistics and data science, the same finite-cardinality reasoning underlies exact combinatorial probability calculations (counting favorable outcomes over a finite sample space). The well-definedness-of-cardinality theorem is the quiet foundation making the entire enterprise of enumerative combinatorics ("count the elements of this finite set") meaningful — every time you compute or a permutation count, you are implicitly relying on the fact proved here that "the number of elements" is a well-defined invariant of a finite set, not an artifact of how you happened to count it.
Ask the tutor: How does the definition of finiteness via generalize once we allow to range over infinite cardinals, and why does the pigeonhole principle then require the Axiom of Choice in general?
For with , define the initial segment
and set . A set is finite if there exists (with ) and a bijection . If no such exists, is infinite. If is finite and is a bijection, we call a cardinality witness for . (We prove below that is uniquely determined by , which licenses the notation , read "the cardinality of is .") Two sets are equinumerous, written , if there is a bijection . Thus is finite with exactly when .
Intuition
The definition looks almost too simple: a set is finite when you can label its elements without repetition and without missing anything, i.e., a bijection sends "the -th element of ." This is exactly the mental act of counting on your fingers: point to elements one at a time, calling out "one, two, three, ..." and stop when you run out of elements of at the same moment you run out of numbers you intended to use. The definition simply formalizes "the counting process terminates and uses up exactly." The delicate part is proving that the label you stop at doesn't depend on the order in which you counted. If Alice counts the letters in as and Bob counts them as , both must get : no other bijection exists for a different . This is not automatic from the definition — it is a theorem, proved below by strong induction on , and it is exactly what fails for infinite sets (where despite these having "different sizes" intuitively). The pigeonhole principle is the same idea viewed from a different angle: if you try to injectively map into with , two labels must collide on the same target, because there just isn't enough room. The picture below shows pigeons mapped toward holes; by counting, some hole receives two pigeons.
Let . If (i.e., there is a bijection ), then . Consequently, if is a finite set, the number such that is unique; we may unambiguously write .
For every , there is no bijection where is a proper subset.
Technique: strong induction on . Base case : has no proper subsets, so the claim holds vacuously. Inductive step. Suppose the claim holds for all (strong induction hypothesis), and suppose toward contradiction that is a bijection with . Consider . We construct a new function as follows. First define by swapping the values and :
(If , take to be the identity; the swap is well-defined and is a bijection in either case, since it is its own inverse.) Let . Since and are both bijections, is a bijection , and . Also since is a bijection and (bijections preserve strict containment sizes: if then , because injective means is nonempty and disjoint from ). Now restrict: since and is injective, restricts to a bijection
This is a bijection because is a bijection sending , and removing from both sides (domain , codomain ) preserves bijectivity of the restriction. Since and would require checking, we split into cases:
- If : then , and . Since and , we get in the sense that is a subset of ; it may equal or be proper. If then is a bijection, contradicting nothing yet — but we must show is impossible to rule out directly; instead we handle both cases uniformly below.
- If : then (removing from a subset of containing lands inside , and since , we have is not immediate either — we need combined with to force , which holds precisely because means some element of , necessarily in since , is missing from , hence missing from too).
In both cases we conclude: is a subset of that is proper — i.e. misses at least one element of . Let us verify this cleanly: since , pick . Since omits as well (as already), and is possible or ; but if then , putting us in the first case where and would need a separate witness. To avoid this case split entirely, argue directly: Since "should" exceed by one omitted element : if , then and , showing directly. If , i.e. , then since and is the only possibly-omitted element identified so far, we still know ; since and , compare sizes: , and we ask whether is possible. If it were, then , so would be exactly minus the single point — this is a legitimate proper subset of , and there is no contradiction at this stage from properness alone. In this sub-case would be a bijection, which is not a contradiction by itself — we need the induction hypothesis to rule out something else. Let us restart this final step more carefully and directly, avoiding the case explosion above.
Cleaner argument. We show directly that maps into a proper subset of , using only that . Since , there exists . Let (recall is the transposition swapping , identity elsewhere). We claim : if then , and since is an involution with , applying to both sides gives (as trivially since is in the range of , which is ). This contradicts . So indeed , i.e. . Now . Since is a bijection , , so . As , also , i.e. is not in the range of . Since , this exhibits , so . Thus is a bijection onto a proper subset of . This contradicts the strong induction hypothesis applied at . This contradiction shows our assumption was false: no bijection with can exist. By strong induction, the lemma holds for all .
∎Proof of the Theorem (well-definedness of cardinality), technique: reduction to the Lemma. Suppose is a bijection. We show . Suppose toward contradiction that ; without loss of generality (by symmetry, replacing with if necessary, which is also a bijection since Bijections and Inverse Functions guarantees bijections have bijective inverses) assume . Since , we have (indeed because ). So is a bijection from onto , and is a proper subset of . This directly contradicts the Lemma (with ). Hence no such can occur: . This proves the theorem's first statement. For the "consequently" clause: suppose is finite and and via bijections and . Then is a composition of bijections, hence a bijection (composition of bijections is a bijection, a basic fact about Bijections and Inverse Functions). By the first part, . So the witnessing is unique, justifying the notation .
∎Let with . Then there is no injection . More generally: if are finite sets with , then there is no injective function .
Technique: direct consequence of the Lemma. First prove the statement for initial segments. Suppose toward contradiction is injective with . Then is a bijection from onto its image (every function is a bijection onto its range once restricted in codomain; injectivity gives injectivity onto the range, and surjectivity onto the range is automatic). Since , as shown above, so , giving (a subset of a proper subset of is a proper subset of — using composed with ). So is a bijection onto a proper subset of , contradicting the Lemma. This proves the initial-segment case. Now for general finite with : let and be the witnessing bijections (which exist and are essentially unique by the Theorem). Suppose toward contradiction is injective. Then
is a composition of injective functions ( bijective hence injective, injective by assumption, bijective hence injective), and composition of injections is an injection (a standard fact from Images and Preimages / basic function theory: if injective, then for , injectivity of gives , then injectivity of gives ). So is an injection with , contradicting the initial-segment case just proved. Hence no injective exists.
∎Worked examples
Example 1 (a finite set with an asymmetric labeling, and computing two ways). Let , a five-element set of symbols. Define two bijections witnessing finiteness:
Both and are bijections (check: each hits all five symbols exactly once — direct inspection of the five images in each list, all distinct and covering ). The Theorem guarantees that any bijection witness must use ; indeed is the permutation
(computed by tracing , so , and similarly for the rest), which is indeed a bijection as the Theorem's proof requires — consistent with regardless of which labeling one uses. Now suppose we did not know a priori, and someone proposed a bijection . By the theorem, this is impossible, since it would force . Concretely, any attempted must fail to be surjective or injective: e.g. omits from its range, so it is not surjective — illustrating the Lemma's content that you cannot cover a 5-element set by bijecting from a 4-element scale.
Example 2 (pigeonhole with an explicit non-trivial function, showing the forced collision). Let (so ) and let (so ). Since , the Pigeonhole Corollary guarantees every function fails to be injective — but let's verify this concretely with a specific interesting function rather than an obviously-collapsing one. Define by (remainder of upon division by 8). Compute:
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 4 | 9 | 16 | 25 | 36 | 49 | 64 | 81 | 100 | |
| 1 | 4 | 1 | 0 | 1 | 4 | 1 | 0 | 1 | 4 |
Indeed — five elements collide on the single value ! The range of is in fact only , a set of size , far short of injective. This is consistent with (much stronger than what) the Pigeonhole Corollary guarantees: it only promises some collision must occur since , but the actual function here has drastically more collisions than the bare minimum. To see the theorem is tight, contrast with a function that collides only "just enough": let
Here hits every element of exactly once via , with the two extra inputs both dumped onto the already-used value . This function has exactly one "extra" collision (two inputs, and , wait — check: and and , so actually three inputs map to ). Adjusting to make the minimal-collision case precise: with "excess" elements mapping into slots already filled bijectively by , at least more elements must reuse existing slots, so at least collisions beyond a bijection are forced — the Corollary's guarantee (existence of at least one pair colliding) is the minimal content, always implied regardless of how the excess is distributed.
The Pigeonhole Corollary requires and to be finite sets with . Drop finiteness of (or of ) and the conclusion fails completely. Take (infinite) and as well, but consider the map
This is injective: if then so . Yet is a bijection from onto , a proper subset of — the exact phenomenon the Lemma forbids for finite sets. Here and are not even well-defined as natural numbers (there is no with , since is infinite by definition), so the hypothesis " finite" of the Corollary is not merely unused — it is essential: with it removed, the statement " forces no injection " doesn't even parse, and the natural analogue (injection onto a proper subset) becomes not just possible but characteristic of infinite sets. This also shows why the Lemma (no bijection proper subset of ) genuinely needs the induction to bottom out at a finite stage: the inductive step reduces to , a process that must terminate, and it is exactly this termination — guaranteed by and strong induction / well-ordering of (see Well-Orders and Least Elements) — that fails to have any analogue when is replaced by "."
Scope, edge cases & common traps
| Situation | What holds | What fails / must be checked |
|---|---|---|
| , ; is finite | Some texts index initial segments from only and treat as a separate base case — must define explicitly | |
| finite, | is finite and | Requires a short separate proof (restrict a bijection witness and use the Lemma's idea); not automatic from the definition alone |
| injective, finite, | is automatically surjective, hence bijective | Only true when are equal finite numbers; false for infinite sets (Example: on ) |
| , infinite | Pigeonhole conclusion may fail entirely | Do not apply pigeonhole-style reasoning ("more inputs than outputs forces collision") to infinite index sets without separate justification |
| Comparing | forced (Theorem) | Do not confuse this with comparing arbitrary finite sets of possibly different underlying elements but same size — the theorem is about the scale itself |
The mathematician behind it
Origins · 1 minRichard Dedekind and how this was discovered
Dedekind was a German mathematician who, alongside Cantor, pioneered the rigorous set-theoretic treatment of number and infinity. His 1888 monograph Was sind und was sollen die Zahlen? ("What are numbers and what should they be?") gave one of the first careful analyses of finiteness purely in terms of mappings — proposing that a set is infinite precisely when it can be put into bijection with a proper subset of itself, the mirror image of the Lemma proved above. Dedekind also gave the first rigorous construction of the natural numbers via what are now called Dedekind–Peano axioms, and his work directly underlies the strong induction argument used to prove the Lemma in this article.
Why define "finite" using bijections with instead of just saying "you can count its elements"?
"You can count its elements" is intuitive but not rigorous: it presupposes an informal notion of a counting process terminating, which is exactly what we're trying to formalize. By instead demanding an explicit bijection , we reduce "finiteness" to a precise, checkable mathematical statement (existence of a specific kind of function) built entirely from concepts already established: sets, functions, injectivity, and surjectivity. This lets us prove — rather than assume — facts like the uniqueness of and the pigeonhole principle, using only induction on natural numbers, with no hidden appeals to intuition about processes or time.
Is it circular to define finiteness using natural numbers, when natural numbers are sometimes built from finite sets (e.g., von Neumann ordinals)?
It can look circular but isn't, if you keep the levels separate. The natural numbers with their arithmetic and well-ordering (see Well-Orders and Least Elements) are set up first, via the Peano axioms or a specific construction, independently of any general theory of "finite sets." Only afterward do we use this already-built to index the sets and define finiteness for arbitrary sets via bijection with some . The construction of itself does not appeal to the general definition of finiteness being given here, so there is no circularity — just a careful order of development.
Does the pigeonhole principle require the function to be defined on all of , or can it be partial?
The Corollary as stated is about a total function , meaning assigns an output to every element of (the full domain). This matters: if you only demand a partial injective matching (some elements of unmatched), you could match at most elements of injectively even when , without any contradiction, since you'd simply be choosing an injective function from a subset of into , not from all of . The forced collision only appears when every element of the strictly larger set must be assigned somewhere in .
How does this relate to comparing cardinalities of infinite sets?
This article deliberately restricts to finite , where "" is an honest natural number and comparisons reduce to comparing natural numbers. When sets are allowed to be infinite, "" is instead defined via existence of an injection (with no natural number in sight), and "" via existence of a bijection — this is the subject of Comparing Cardinalities. The striking fact, foreshadowed by the counterexample above, is that infinite sets can be equinumerous with proper subsets of themselves (e.g. ), which is precisely the property the Lemma shows is impossible for finite sets. This impossibility is sometimes taken as an alternative (Dedekind) definition of finiteness.
Can two different bijections give different "orderings" of , and does that matter for finiteness?
Yes — as Example 1 shows, there can be many different bijections (in fact exactly of them, corresponding to the permutations of , once one exists), each giving a different labeling/ordering of 's elements. This multiplicity does not threaten well-definedness of cardinality: the value is the same no matter which bijection you use, as the Theorem proves, even though the specific correspondence (which element gets which label) can vary freely. Cardinality is a coarser invariant than "the" labeling.
What goes wrong if we tried to prove the Lemma by ordinary (weak) induction instead of strong induction?
The proof's inductive step for reduces the problem to a bijection-onto-a-proper-subset statement about specifically (not some smaller for arbitrary ), so in this particular argument, ordinary induction assuming only the case actually suffices — we used "strong induction" language mainly to be safe and explicit, but the reduction genuinely only ever needs the immediately preceding case. This is worth noticing: not every induction that looks like it needs strong induction actually does, and checking exactly which prior cases get used is good practice for verifying non-circularity.
Does the pigeonhole principle tell us how many collisions must occur, not just that at least one does?
No — the bare Corollary only guarantees existence of at least one collision (two distinct inputs with the same output) whenever for finite . Worked Example 2 shows this bound can be far from tight: the function produces five inputs collapsing onto a single value, vastly more collision than the minimum. Sharper "quantitative pigeonhole" statements — e.g., some output must be hit by at least inputs — do follow from a refined counting argument, but they are a separate, stronger result built on top of the basic principle proved here.