Lesson 7
Infinite Sets
Taught
Finite Sets
To count a herd is to pair its animals off against and so on, and to report the number we stopped at. Nothing in that procedure asks what the counting numbers are; it asks for a bijection between the herd and an opening stretch of them. Both are now built, so we can count, and the notion of the same size that counting rests on still makes sense for sets far too large to count.
Comparing Sets by Functions
Definition 7.1 (Equinumerous sets).
Sets and are equinumerous, written , if there is a bijection . We also say that and have the same size.
The definition asks for one bijection and says nothing about how many there are; two sets of three elements are matched up in six different ways, and the definition is satisfied by any of them. It also does not mention counting, so it still makes sense for sets we cannot count.
Proposition 7.2 (Equinumerosity is reflexive, symmetric and transitive).
Let , and be sets.
- .
- If then .
- If and then .
Discussion.
Each part is an existence claim about bijections, so each is proved by producing one, and in every case the bijection we need has already been built. For the first, the identity map on is its own inverse, and a map with an inverse is a bijection by the theorem on invertibility. The second and third are conditionals, so we start from the bijections the hypothesis gives: from one bijection, the theorem that the inverse is a bijection; from two, the theorem that bijections compose. No part uses anything about the elements of the sets.
Proof.
For the first, , so is invertible and hence a bijection from to .
For the second, let be a bijection. Its inverse is a bijection, so .
For the third, let and be bijections. Then is a bijection, so .
Remark.
Those are the three properties of an equivalence relation, and yet is not one, because it is not a relation at all in our sense: a relation on is a subset of , and there is no set of all sets for to be. Fix a set , however, and restricted to is an honest equivalence relation on an honest set, so it partitions into classes of subsets of the same size. That is how the notion is used in practice, and the general statement is a convenience of language rather than a claim about a set of pairs.
Write for the cut , so that . If , and are distinct then , witnessed by , , . Any other listing of the three letters gives another bijection, and the definition does not prefer one.
Show that for all sets and , and that .
Show that implies . Which of the theorems on images and preimages does your bijection rest on?
Counting
The cuts are the sets we count against: collects the numbers below . First we record how they grow, which every induction below uses.
Proposition 7.4 (The cuts grow by one point).
, and for every ,
Discussion.
There are three assertions and each is a statement about which elements a cut holds, so each unfolds to a comparison with . That is empty is a negative claim, ruled out by the proposition that every natural number is at least zero together with trichotomy, which forbids once is known. The equation is an equality of sets, so it splits into two inclusions, and both come from asking where sits relative to : to the left, leaves the alternatives and once the proposition that nothing lies strictly between and has removed the third; to the right, or gives because and is transitive. The last assertion is anti-reflexivity read off the definition of the cut.
Proof.
An satisfies , so would violate trichotomy; hence .
Let . Trichotomy gives , or , and the last would place strictly between and , which nothing does. So . Conversely by the corollary that adding a positive element moves you up, so gives , and gives by transitivity. Hence .
Finally , so .
Definition 7.5 (Finite and infinite sets).
A set is finite if for some , and infinite otherwise.
So is finite, since , and each is finite by way of its identity map. The definition offers some , and to speak of the number of elements we must know that no two cuts are matched by a bijection. The next few results prove this. The main tool is the simplest rearrangement: a map exchanging two points and leaving the rest alone.
Definition 7.6 (Transposition).
Let be a set and let . The transposition is the function given by
When the three clauses agree and is the identity map on .
Proposition 7.7 (A transposition is its own inverse).
Let be a set and let . Then , and is a bijection.
Discussion.
Two assertions, the second following from the first. The first is an equality of functions, so by equality of functions we compare values at an arbitrary point of , and the definition splits the points into three cases, each settled by reading the definition twice. The second is then the theorem on invertibility, which makes a map with a two-sided inverse a bijection; the first assertion offers itself as that inverse, so nothing further need be built.
Proof.
Write and let . If then ; if then ; and otherwise . So , and is invertible, hence a bijection from to .
Proposition 7.8 (Bijections remove points).
Let be a bijection and let . Then .
Discussion.
We need a bijection between the two smaller sets, and the only map we have is , so we restrict it and check the two halves of bijectivity. Injectivity is inherited, since a restriction of an injective map is injective. For the values, injectivity is again what we use: a point other than cannot be sent to , so the restriction does land in ; and surjectivity of supplies, for each in that set, a preimage, which cannot be because .
Proof.
Let be the restriction of to . If then by injectivity, so takes its values in , and is injective because is.
Let . By surjectivity for some , and since . So , and is a bijection onto .
Proposition 7.9 (Removing a point from a cut).
Let and let . Then .
Discussion.
The previous proposition removes a point and its image under a bijection, so the plan is to build a bijection of with itself that carries to and then remove , where the result is the cut by the proposition on how cuts grow. The transposition of and does exactly that, and it is a bijection by the proposition just proved, so nothing needs checking. The case is the growth proposition on its own, the transposition there being the identity.
Proof.
If then by the proposition on how cuts grow, and a set is equinumerous with itself.
Suppose and let be the transposition of and on , which is a bijection by the proposition above. Since , the proposition on removing points gives
Theorem 7.10 (No cut injects into a shorter one).
For every there is no injection .
Discussion.
The claim is a universally quantified non-existence statement, so we induct on and argue each case by contradiction. At the target is empty while the source is not, and a function must name a value at every point of its domain, so there is no such function. For the step we assume no injection and suppose one is given from to . The extra point of the source is , and by injectivity no other point is sent to its value , so removing both leaves an injection from into . The previous proposition says that set is a copy of , and composing with a bijection onto gives an injection the inductive hypothesis forbids.
Proof.
We induct on . For the cut is and is empty, so a function would have to give a value . There is none.
Suppose there is no injection , and let be injective. Since , the value is defined. If then , so by injectivity; hence the restriction of to is an injection taking its values in . Composing it with a bijection from onto , which the previous proposition supplies, yields an injection , contrary to the hypothesis. So no such exists, and induction completes the proof.
Corollary 7.11 (Cuts of different length are not equinumerous).
If then .
Proof.
Suppose . Then by transitivity, and , so . A bijection restricted to is then an injection , which the theorem forbids. The same argument with and exchanged rules out , so trichotomy leaves .
Definition 7.12 (Cardinality of a finite set).
Let be finite. The unique with is the cardinality of , written , and we say has elements.
Uniqueness is the corollary, and without it the notation would not be well defined. Some authors write for the same number.
Corollary 7.13 (Cardinality classifies finite sets).
Let and be finite. Then if and only if .
Proof.
Write and , so and . If then by symmetry and transitivity, so by the previous corollary. Conversely if then .
and . A finite set has cardinality exactly when it is empty, since a bijection onto from a non-empty set would have to name an element of . If then and , since and .
Proposition 7.15 (Adjoining a point).
Let be finite and let . Then is finite and .
Discussion.
Both assertions come from one bijection, which we build and check. We hold a bijection from onto , and the set to be counted has exactly one extra point, while the cut has exactly one point more than , namely itself. So we extend by sending to . That the extension is a function uses , which stops the two clauses from disagreeing anywhere; that it is injective uses , which stops the new value from repeating an old one; and that it is surjective is the growth proposition, which says holds nothing beyond and .
Proof.
Put and let be a bijection. Define by for and . Since , every point of the domain falls under exactly one clause, so is a function, and its values lie in .
For injectivity, two points of are separated by , and a point of is separated from because while . For surjectivity, an element of is either , which is , or an element of , which is for some by surjectivity of . So .
Corollary 7.16 (Removing a point).
Let be finite and non-empty and let . Then is finite and .
Proof.
Let be a bijection, where . Since is non-empty, , so the theorem on predecessors gives for some . The proposition on removing points from bijections gives , and the proposition on removing a point from a cut gives . So is finite with cardinality , and .
Subsets and Images
Theorem 7.17 (Subsets of a finite set).
Let be finite and let . Then is finite and . If moreover then .
Discussion.
The first sentence quantifies over all subsets of all finite sets, so we induct on the cardinality, taking for the predicate at the statement that every subset of every set with elements is finite with cardinality at most . At the ambient set is empty and so is the subset. For the step we peel off a point of the ambient set, leaving a set the hypothesis governs, and split on whether belongs to the subset: if not, the subset is already inside the smaller set; if so, we apply the hypothesis to the subset with removed and put back, which raises both cardinalities by one successor.
The second sentence uses properness. A point of outside can be adjoined to without leaving , so the first sentence applies to and yields ; and forces , since and is positive.
Proof.
We first record two small facts about successors, both read off the clauses for addition. If then for some , so by addition from the left, and hence . If then , and is positive, so .
For the first assertion we induct on , proving that every subset of every set of cardinality is finite with cardinality at most . If then the ambient set is empty, so and .
Suppose the claim holds at , let and let . Since , the set is non-empty; choose and put , which has cardinality by the corollary on removing a point. If then , so the hypothesis makes finite with . If then , so is finite with cardinality ; adjoining makes finite with .
For the second assertion, let and choose . Then , so the first assertion gives , and therefore .
Corollary 7.18 (No finite set is equinumerous with a proper subset).
Let be finite and . Then .
Proof.
The theorem gives , so by anti-reflexivity, and finite sets of different cardinality are not equinumerous.
Proposition 7.19 (Images of a finite set).
Let be finite and let be a function. Then the image is finite with , and if and only if is injective.
Discussion.
The inequality is proved by induction on : remove a point from , apply the hypothesis to what remains, and observe that the image gains at most the single value , so it grows by at most one successor.
The biconditional needs no second induction, because each direction is already available. If is injective it is a bijection onto its range, so the two cardinalities agree. If is not injective, two distinct points share a value, so deleting one of them changes nothing about the image; the inequality applied to the smaller set then gives a strict drop, since a proper subset of a finite set is strictly smaller. Those two together are the biconditional, the second read contrapositively.
Proof.
For the inequality we induct on . If then and .
Suppose the claim holds for sets of cardinality and let . Choose and put , of cardinality . Since we have , and is finite with by hypothesis. If then and . Otherwise adjoining the point gives .
If is injective then is a bijection from onto , so . If is not injective, choose in with . Every value of is then already taken on , since and , so and
the second inequality because is a proper subset. So equality holds exactly when is injective.
The Pigeonhole Principle
Theorem 7.20 (Injections, surjections and size).
Let and be finite.
- If there is an injection then .
- If there is a surjection then .
Discussion.
Both parts turn the given function into a statement about the image, and then apply the two results just proved. An injection is a bijection onto its range, so and have the same cardinality, and is a subset of , which the theorem on subsets bounds by . A surjection has range all of , so is the cardinality of an image, which the proposition on images bounds by . Notice that no choice of preimages is made anywhere, so neither part appeals to the axiom of choice.
Proof.
For the first, is a bijection from onto , so ; and , so by the theorem on subsets.
For the second, surjectivity gives , so by the proposition on images.
Corollary 7.21 (Pigeonhole principle).
Let and be finite with . Then no function is injective, and no function is surjective.
Proof.
An injection would give , and a surjection would give as well; either contradicts by trichotomy.
Among thirteen people, two were born in the same month: the map sending each person to the month of their birth goes from a set of thirteen elements to one of twelve, so it cannot be injective, and two people share a value. The principle says the pair exists but gives no way to find it.
Theorem 7.23 (Injective, surjective and bijective agree on a finite set).
Let be finite and let . Then is injective if and only if it is surjective, and either condition makes a bijection.
Discussion.
The statement is a biconditional between two conditions on the same map, so we prove each direction, and the last clause follows: a bijection is by definition an injection that is also a surjection, so once the two conditions are equivalent, each one gives both.
Going forwards, injectivity makes the image as large as the whole, and a subset of a finite set with the full cardinality cannot be proper, so the image is everything. Going backwards we argue by contradiction, because failure of injectivity is what we can compute with: a repeated value lets us delete a point without shrinking the image, so the image of a proper subset would have to be all of , and the proposition on images bounds it by something strictly smaller.
Proof.
Suppose is injective. Then by the proposition on images, and , so by the theorem on subsets, since a proper subset would have strictly smaller cardinality. Hence is surjective.
Suppose is surjective and not injective, so for some . Then , and surjectivity makes this all of , so
which anti-reflexivity forbids. So is injective.
In either case is both injective and surjective, hence a bijection.
Remark.
Finiteness is needed. The successor map is injective by the third Peano condition and is not surjective, since is not a successor. So on the two conditions come apart, and the theorem cannot be extended by weakening its hypothesis.
Let and be finite with and let be injective. Show that is a bijection.
Let be finite and let satisfy . Show that if is injective, and describe what can be otherwise.
Sums and Products
Counting a union means laying one cut after another, so we first say how a cut breaks into an opening piece and a shifted one.
Proposition 7.24 (Splitting a cut).
Let and put . Then
and is a bijection from onto .
Discussion.
Three assertions, each about the position of a number relative to . The equality is a set equality, hence two inclusions. From left to right, trichotomy puts either below , which is the first part, or at or above it, in which case for a difference , and the difference is below because subtracting from both sides of leaves . From right to left, both parts are checked against directly, using that adding a positive element moves you up. Disjointness is trichotomy once more, since the members of are at least and the members of are strictly below it. The last assertion is uniqueness of differences, which says can happen only for ; surjectivity holds because was defined as the set of such values.
Proof.
Let . If then . Otherwise , so for some by the description of the associated order. From we get for some positive , by the laws of addition, so by uniqueness of differences and hence . Thus .
Conversely, , so gives by mixed transitivity. And if then with positive, so and .
If then and , which trichotomy forbids, so the intersection is empty.
Finally, is injective by uniqueness of differences and surjective onto by the definition of .
Theorem 7.25 (Cardinality of a disjoint union).
Let and be finite and disjoint. Then is finite and
Discussion.
We must exhibit a bijection from onto the cut , and the splitting proposition cuts that target into the two pieces we need. So we define the map in two clauses, counting the points of by their own bijection and the points of by theirs, shifted up by so as to land in the second piece. Disjointness of and means each point falls under exactly one clause, so we have a function. Injectivity then has three cases, two inside a piece, which the two bijections handle, and one across the pieces, which the disjointness of the split handles. Surjectivity is the other half of the split.
Proof.
Put and , and let and be bijections. Define
Since , each point of the domain falls under exactly one clause, so is a function, and its values lie in by the splitting proposition.
For injectivity, two points of are separated by ; two points of are separated by together with the injectivity of ; and a point of cannot collide with a point of , since their values lie in the two disjoint pieces of the split. For surjectivity, an element of lies either in , hence is for some , or is with , hence is for some .
So , which is the assertion.
Corollary 7.26 (Cardinality of a union).
Let and be finite. Then is finite and
Proof.
The sets and are subsets of , hence finite. Now with the two parts disjoint, so ; and with the two parts disjoint, so . Adding to the first equation and substituting the second gives
by the laws of addition.
Remark.
The familiar form of that identity subtracts the overlap, and we have written it with everything on the right instead. Subtraction is available to us only when the answer stays in , which it does here, but stating the law as an equation between sums spares us from checking that each time.
Let , and be finite. Show that
Theorem 7.27 (Cardinality of a product).
Let and be finite. Then is finite and , with multiplication as the problems of the natural-numbers chapter defined it.
Discussion.
Multiplication was defined by recursion on its second argument, with the clauses and , so we induct on following them. At the set is empty and so is the product, since a pair needs a second coordinate. For the step we split into a smaller set and a single extra point , which splits into two disjoint pieces, one governed by the inductive hypothesis and one a copy of . The theorem on disjoint unions adds the two cardinalities, and the resulting sum is the right-hand side of the second clause of the multiplication recursion.
Proof.
We induct on . If then , so and .
Suppose the claim holds for every of cardinality , and let . Choose and put , of cardinality . A pair with has either or , and not both, so
using equality of ordered pairs to read off the second coordinate. The map is a bijection from onto , again by equality of ordered pairs, so that piece has cardinality ; and has cardinality by hypothesis. The theorem on disjoint unions gives
the last step being the second clause of the definition of multiplication.
Show that a union of finitely many finite sets is finite. State the claim carefully first: it is an assertion about an indexed family whose index set is a cut.
Let be finite with . Show that , with powers as the problems of the natural-numbers chapter defined them.
Let and be finite. Show that the Cartesian power , the set of functions from to , is finite with .
Extrema of Finite Sets
Proposition 7.28 (Finite subsets of an ordered set have extrema).
Let be a totally ordered set and let be finite and non-empty. Then has a minimum and a maximum.
Discussion.
The hypothesis is about an arbitrary finite non-empty set, so the induction runs on the cardinality and starts at rather than , which is allowed by induction from an arbitrary starting point. A set of cardinality has a single element, which is both extrema by reflexivity of the order. For the step we remove a point , apply the hypothesis to what remains, which is still non-empty, and then compare with the maximum found there: the two are comparable because the order is total, and whichever of the two is the larger is the maximum of the whole. Minima are the same argument with the inequalities reversed, so we write only one of them out.
Proof.
We induct on , beginning at . Then , so for a single , and makes it both the minimum and the maximum.
Suppose every subset of cardinality has both extrema, and let . Choose and put , which has cardinality and so is non-empty. Let be its maximum. Since is totally ordered, and are comparable. If then is an upper bound of lying in , hence its maximum; if then is such a bound, hence the maximum. The argument for the minimum reverses the inequalities.
Corollary 7.29 (The natural numbers are infinite).
and are infinite.
Proof.
The order on is strict and linear, so the associated is a total order. Were finite, it would be non-empty and so would have a maximum ; but and , contradicting that is an upper bound. The same argument applies to , whose element is positive because it is a successor.
Show that a set with an infinite subset is infinite, and that the image of a finite set under any function is finite.
Comparing Sets
For an infinite set there is no counting it, so we cannot compare numbers. Injections and bijections still make sense, though, and for finite sets the next theorem matches each inequality with a condition on functions.
Comparing Finite Sets
Theorem 7.30 (Comparing finite sets).
Let and be finite sets. Then
- if and only if there is an injection ;
- if and only if ;
- if and only if there is an injection but no bijection .
Discussion.
Write and and fix bijections and ; every part is then a matter of conjugating a map between the cuts into a map between the sets, or the other way about.
For the first part, one direction is already the theorem on injections and size. The other builds the injection: gives , whose inclusion map is injective, and is then an injection , being a composite of injections. The second part is the corollary that cardinality classifies finite sets, read in both directions.
The third is the first two put together. If then the first part supplies an injection, and a bijection would force by the second, which trichotomy forbids. Conversely an injection gives and the absence of a bijection gives , and those two are what abbreviates.
Proof.
Write and , and fix bijections and .
For the first part, suppose . Then , since gives , and the inclusion is injective. So is an injection. Conversely an injection gives by the theorem on injections and size.
The second part is the corollary that cardinality classifies finite sets.
For the third, let . The first part gives an injection , and a bijection would give by the second part, contradicting trichotomy. Conversely, an injection gives by the first part and the absence of a bijection gives by the second, so .
The three right-hand sides make sense whether or not the sets are finite, so they may be taken as definitions in general. By the theorem, the new definitions agree with the old ones for finite sets.
Definition 7.31 (Comparing sizes).
Let and be sets, finite or not. We write
- if there is an injection ;
- if ;
- if there is an injection but no bijection .
For finite sets these agree with the numerical readings, by the theorem. The symbol still names a natural number only when is finite; in general the three displays above are single assertions about functions, and it is the assertion, not the symbol standing alone, that has been defined. What may be taken to name in general is settled at the end of the chapter.
Read informally, says that is roomy enough to hold an injective copy of and still has something left over, in the strong sense that every injection misses something.
Proposition 7.32 (Reflexivity and transitivity).
For all sets , , :
- ;
- if and then .
Discussion.
Both parts unfold to claims about injections, and both follow from basic facts about injections. Reflexivity needs an injection , and the identity map is one. Transitivity needs an injection out of injections and , and their composite is injective: if the composite identifies two points, the outer map identifies their images and the inner map identifies them.
Proof.
The identity is injective, so .
Let and be injections. If then by injectivity of , and by injectivity of . So is an injection and .
Prove or refute each of the following, for arbitrary sets , and .
- If then .
- .
Let be non-empty. Show that for every set .
The Schröder–Bernstein Theorem
The last proposition does not give antisymmetry. For finite sets it is immediate, since forces ; in general it is a harder theorem.
Theorem 7.33 (Schröder–Bernstein).
Let and be sets with and . Then .
Discussion.
We are given injections and and must build a bijection out of them. Neither alone will do: may miss part of and may miss part of . The idea is to use on some of and the inverse of on the rest, and the problem is to decide where the boundary falls. The points where we have no choice are those of , which have no -preimage at all, so must be used there; and then must be used at for each such , since otherwise that point would be sent back to , which is already taken. Iterating gives a family built by the recursion theorem, and their union is the region where is used.
With the boundary fixed, three checks remain. The map is defined everywhere, because a point outside is in particular outside , hence has a -preimage, unique by injectivity. It is injective on each of the two regions separately, and the two cannot collide, because a collision would carry a point of one step further along the chain and so put an element of outside . It is surjective by chasing a given backwards: if lies outside it is where comes from, and if it lies inside it lies in some with a successor, which exhibits as a value of .
Proof.
Let and be injections. The recursion theorem, applied in with the map , gives exactly one family with
and we put . The two injections run the pieces alternately into one another,
and is the whole of the top row. On it the bijection will follow the downward arrows; off it every point has a -preimage, and the bijection will run back up them. Define
The second clause makes sense: gives , so , and the preimage is unique because is injective. So is a function.
For injectivity, suppose . If both points lie in then gives ; if neither does then applying to both sides gives . Suppose then and , so and hence . Since we have for some , so , contradicting .
For surjectivity, let and put . If then by the second clause. If then for some , and because ; so by the theorem on predecessors, and gives for some . Injectivity of gives , and , so .
Hence is a bijection and .
The proof gives the bijection in two pieces, one for the chained points and one for the rest, rather than as a single formula. What the applications use is only that it exists.
Assuming you know the real numbers, write for them and consider the closed interval and the open interval . The inclusion of in is an injection one way. In the other direction is injective and carries into , since goes to and to . Schröder–Bernstein therefore supplies a bijection between the two intervals, although neither of the injections we wrote is surjective.
Schröder–Bernstein is sometimes read as saying that injections and are each bijections. Exhibit sets and with injections both ways, neither of which is surjective.
Theorem 7.35 (Transitivity for strict comparison).
Let , and be sets.
- If and then .
- If and then .
- If and then .
Discussion.
Each part asserts the existence of an injection and the non-existence of a bijection, so each splits in two, and the first half is the previous proposition in every case, since a strict comparison contains a weak one. The second half is where Schröder–Bernstein is needed, and it is used contrapositively: a bijection would let us pull an injection back to an injection , and with the injection already in hand the theorem would return , which the strict hypothesis forbids. We write out the first part and leave the other two, which run the same way, to the problems.
Proof.
For the first part, the two hypotheses supply injections and , so by the previous proposition.
Suppose and let be a bijection. Composing with an injection gives an injection , so . Since gives , Schröder–Bernstein yields , contradicting . So no bijection exists and .
Comparability
Reflexive, transitive, antisymmetric: the comparison behaves like an order. What an order on the natural numbers also had was trichotomy, and for sizes that is a separate matter, since nothing so far rules out two sets neither of which injects into the other.
Let and be sets. Then or .
Discussion.
An injection defined on all of is what we want and cannot build directly, so we build the largest injection defined on part of and show that largest one leaves nothing out. The candidates are the injective functions whose domain is a subset of and whose values lie in ; each is a subset of , so comprehension collects them into a set, which inclusion orders.
To apply Zorn’s lemma we must show every chain has an upper bound, and we take the union of the chain: it is a function because two pairs with the same first coordinate lie in a common member of the chain, since members of a chain are comparable, and it is injective for the same reason with the coordinates exchanged. The empty chain is covered by the empty function. Zorn then supplies a maximal element , and maximality is used contrapositively: if missed a point of and also missed a point of , the pair of them could be added to , giving a strictly larger candidate. So one of the two is not missed, and the two cases give the two halves of the conclusion, the second by inverting .
Proof.
Let be the set of that are injective functions whose domain is a subset of , ordered by inclusion. The empty function belongs to , and inclusion is a partial order.
Let be a chain and put , a subset of . If and lie in , they lie in members and of , which are comparable, so both pairs lie in the larger one; that member is a function, so . Hence is a function, with domain the union of the domains. The same argument with the coordinates exchanged shows is injective. So and is an upper bound of , and is inductively ordered.
Zorn’s lemma gives a maximal . Suppose and , and choose and . Then is again an injective function with domain inside , and it properly contains , contradicting maximality.
So , in which case is an injection ; or , in which case the inverse of on its range is an injection .
Corollary 7.37 (Trichotomy for sizes).
For any sets and , exactly one of , , holds.
Proof.
Comparability gives or . If both hold then by Schröder–Bernstein; if only the first holds then , and if only the second then . So at least one of the three holds. No two hold together: makes both strict comparisons fail by definition, and together with would give by Schröder–Bernstein, contradicting either.
Remark.
Comparability was proved from Zorn’s lemma, and it is in fact equivalent to the axiom of choice, so it is not a free consequence of the other axioms. Schröder–Bernstein, by contrast, used nothing but the recursion theorem. So comparability needs the axiom of choice, while Schröder–Bernstein does not.
Cantor’s Theorem
Theorem 7.38 (Cantor's theorem).
For every set we have .
Discussion.
By the definition the claim splits in two: an injection , and no bijection. The injection is the map sending a point to the set holding just that point, and it is injective because a singleton determines its element.
For the second half we take an arbitrary and produce a subset that is not one of its values, which denies surjectivity and so denies bijectivity. A set differs from as soon as it disagrees with it at one element, and the element we use is itself, so we build the subset that disagrees with at for every at once: take those that are outside their own value. Comprehension makes that a set and it is a subset of , so it is eligible to be a value. Supposing it is the value at , the question whether belongs to it has a membership criterion that turns each answer into the other, which is Russell’s argument again.
Proof.
The map sends into , and gives , so it is injective and .
Let be any function and put
a set by comprehension and a subset of , so . Suppose for some . If then the criterion gives . If then, being an element of , the criterion gives . Both are contradictions, so is not a value of and is not surjective.
In particular no bijection exists, so .
Remark.
The diagonal set is the construction that showed there is no set of all sets, used for a different purpose. There it produced a contradiction from an assumption we then dropped; here it produces one from the assumption that is a value, and what we drop is surjectivity. Nothing about was used, so the theorem applies to every set: iterating it gives
a strictly increasing chain with no top, by transitivity for strict comparison.
Show that if and and , then . Transport the injection along the two bijections.
Prove parts 2 and 3 of the theorem on transitivity for strict comparison.
Use Schröder–Bernstein, rather than an explicit pairing, to show that once you have an injection each way.
Show that implies .
Deduce from Cantor’s theorem that for every .
Infinite Sets
A set is infinite when it is not finite, which is a purely negative description: no cut matches it. Cantor found that infinite sets come in different sizes, and Cantor’s theorem above already gives a strictly increasing chain of them. We start with the smallest.
Countable Sets
Definition 7.39 (Countable and uncountable).
A set is countably infinite if , countable if it is finite or countably infinite, and uncountable otherwise.
A bijection is an infinite sequence in , so a countably infinite set is one whose elements can be written as a list
in which every element appears exactly once. Such an is an enumeration of . The list is not part of the set, and a set usually admits many.
That the two cases of countability do not overlap is the corollary that is infinite, since otherwise a finite set could be equinumerous with .
Proposition 7.40 (Dropping zero).
, so is countably infinite.
Discussion.
We must produce a bijection, and we use the successor map, checking three things against the Peano conditions. Its values are positive, since a successor is never , so it does map into . It is injective, which is the third condition verbatim. It is surjective onto , which is the theorem on predecessors: every element other than is a successor.
Proof.
Consider . Its values lie in , since by the fourth Peano condition. It is injective by the third. It is surjective, since an element of is not and is therefore for some by the theorem on predecessors. So is a bijection and .
Remark.
Since , an infinite set can be equinumerous with a proper subset of itself, which the corollary of the last chapter shows no finite set can do. Dedekind turned the observation round and took it as the definition of infinite, and we prove below that his definition agrees with ours.
Subsets of the Natural Numbers
Theorem 7.41 (Infinite subsets of the natural numbers).
Every infinite subset is countably infinite.
Discussion.
We must produce an enumeration of , and there is an obvious rule for one: list the smallest element first, then the smallest of those left, and so on. Two things must be checked before this is a definition. The rule at stage refers to everything listed before , not merely to the previous entry, so it is the general recursion theorem rather than the plain one that builds the function, taking for its rule the map sending a finite list to the least element of not on it. And that least element must exist: the elements listed so far form the image of a cut, hence a finite set, so they cannot exhaust the infinite , and well-ordering then supplies the minimum.
What remains is to check that the enumeration works. It is strictly increasing, because each entry is chosen from a smaller pool than the one before and differs from the entry just removed, and a strictly increasing map is injective by trichotomy. Surjectivity is a least-counterexample argument: if some never appears, look at the first stage whose entry overshoots . Everything listed before that stage is below , so was still in the pool at that stage, and the minimum chosen there cannot have exceeded it.
Proof.
For a finite sequence in , the range is finite, being the image of a cut. So is non-empty: otherwise would make finite. Define
which exists by well-ordering. The general recursion theorem gives exactly one with for every , that is,
Every value of lies in . The map is strictly increasing: the set from which is chosen is contained in the set from which is chosen, so by minimality, and because was removed at the later stage. Induction then gives whenever , and trichotomy makes injective.
Induction also gives : this holds at , and if then , so would place strictly between and , which nothing does; hence .
Suppose some is not a value of . Since , the set of with is non-empty, so well-ordering gives a least such . Every has and , so ; hence belongs to , and minimality of in that set gives , contradicting .
So is a bijection from onto .
Characterising At Most Countable Sets
Theorem 7.42 (Characterising countable sets).
Let be a non-empty set. The following are equivalent.
- is countable.
- There is an injection .
- There is a surjection .
Discussion.
We prove the three conditions equivalent by a cycle of implications.
From the first to the third: a countably infinite has a bijection from , which is a surjection; a finite non-empty has a bijection from a cut, which we extend to all of by parking every later index on one fixed point, and parking spoils nothing because surjectivity asks only that every point be hit.
From the third to the second: a surjection has an injective right inverse, and here we can name one without appealing to choice. Each point of has a non-empty set of preimages inside , so well-ordering picks out its least preimage, and a right inverse is injective because applying the surjection recovers the point.
From the second to the first: an injection makes equinumerous with its image, a subset of , and a subset of is finite or infinite; in the first case is finite, and in the second the theorem just proved makes it countably infinite.
Proof.
Suppose is countable. If , a bijection is a surjection. If is finite and non-empty, let be a bijection with , and define by for and for . Every point of is for some , so is surjective.
Suppose is surjective. For the preimage is a non-empty subset of , so it has a least element; let be that element. Then for every , so gives , and is injective.
Suppose is injective. Then . If is finite then so is . If is infinite then by the theorem on infinite subsets, so by transitivity. Either way is countable.
Corollary 7.43 (Subsets of countable sets).
Every subset of a countable set is countable.
Proof.
Let with countable. If is empty it is finite. Otherwise is non-empty, so there is an injection by the theorem, and its restriction to is injective, so is countable by the theorem again.
Products and Unions
Theorem 7.44 (Pairs of natural numbers).
is countably infinite.
Discussion.
By the characterisation it is enough to find one injection into , and then to observe that the set is not finite. For the injection we enumerate the pairs in diagonals: all pairs with , then those with , and so on. The th diagonal has entries, so a pair on the diagonal should be given the position
where the summation symbol is the one built by recursion in the last chapter but one. Injectivity then rests on the diagonals not overlapping, which is the inequality whenever and ; it follows from the recursion clause . Once the diagonal is known, and then are determined by uniqueness of differences. Infinitude is easy: the pairs form a copy of inside, and a set with an infinite subset is infinite.
Proof.
Write , so that and .
We first record that is non-decreasing: if then , and induction on gives the claim, since is at least , which is at least by the inductive hypothesis.
Define . Laid out with down the side and across, the values run
The boxed entries are the pairs with , and they fill the consecutive block from to . What follows is that observation for a general diagonal.
Suppose and put , . If then for some , so
Also , so for a positive and , giving ; and . Together these give , against the supposition. The same argument rules out , so by trichotomy. Then gives by uniqueness of differences, and gives likewise. So is injective and is countable.
Finally is injective, so has an infinite subset and is therefore infinite.
Corollary 7.45 (Products of countable sets).
If and are countable then so is .
Proof.
If either set is empty the product is empty. Otherwise let and be injections. Then is injective, by equality of ordered pairs, and composing it with the injection of the theorem gives an injection .
Theorem 7.46 (Countable unions of countable sets).
Let be countable and let be an indexed family of countable sets. Then is countable.
Discussion.
The characterisation lets us argue with surjections rather than injections, and a surjection onto the union is easy to describe: run over the indices with one surjection and over each set with another, so that the pair names the th element of the th set. Two points need care. Countability of says only that a surjection onto it exists, and we need one for every at once, and this needs the axiom of choice. And the domain of the resulting map is rather than , which the previous theorem fixes, since a countably infinite set admits a bijection from . Composing the two gives a surjection from onto the union, which is then countable by the characterisation.
Proof.
Discard the indices with ; the union is unchanged and the smaller index set is still countable. If nothing is left the union is empty, hence countable, so suppose and every .
By the characterisation there is a surjection . For each the set of surjections is a non-empty subset of , again by the characterisation, so the axiom of choice applied to gives a function with for every .
The map is a surjection from onto : a point of the union lies in some , and for some while for some . Composing with a bijection , which the previous theorem supplies, gives a surjection from onto the union, which is therefore countable.
Remark (Hilbert's hotel).
A hotel with a room for every natural number, all of them occupied, can still take in a new guest: move the occupant of room to room and give the newcomer room . It can take in countably many new guests at once: move the occupant of room to room and use the odd rooms, which the remainder classes say are exactly the rooms left free. It can even take in countably many coaches each carrying countably many guests, by the theorem on countable unions. Infinite sizes do not behave like finite ones, and here we have to rely on the propositions above rather than on intuition.
Remark (Informal).
Assuming you know the whole numbers and the fractions: the whole numbers are the union of the natural numbers, their negatives and zero, so the theorem on countable unions makes them countable. Every fraction is determined by a pair of whole numbers, so the corollary on products makes the fractions countable as well. Both arguments go through as soon as those systems are built.
Let be countable. Show that is countable, by induction on .
Let be countable. Show that the set of finite sequences in is countable, and that the set of finite subsets of is countable.
Show that the map of the theorem on pairs is a bijection onto , not merely an injection. Well-ordering applied to the set of with will locate the diagonal on which sits.
Let be countably infinite and let be finite and non-empty. Show that and are countably infinite.
Write as the union of a countably infinite family of pairwise disjoint countably infinite sets.
Finite and Infinite
One question is still open. We defined infinite negatively, as the failure of finiteness, and observed that has a proper subset of its own size. Whether every infinite set does is still open, and the answer needs the axiom of choice.
Theorem 7.47 (Every infinite set has a countably infinite subset).
Let be infinite. Then some subset is countably infinite.
Discussion.
The plan copies the enumeration of an infinite subset of : pick an element, then an element not yet picked, and so on. Two things we had there are missing here. There is no order on , so nothing selects an element for us, and the axiom of choice gives a rule that selects one from every non-empty subset at once. And the rule at each stage refers to all the earlier picks, so it is the general recursion theorem that turns the rule into a function. The recursion never stalls, because the elements picked so far form a finite set and is infinite, so something is always left. Injectivity is immediate from the construction, since each value is chosen outside the earlier ones, and an injective map from has range a countably infinite subset.
Proof.
Since is infinite it is non-empty. Apply the axiom of choice to the family of non-empty subsets of , indexed by itself, to obtain a function with for every non-empty .
For a finite sequence in the range is finite, so is non-empty, since otherwise would be a subset of a finite set. Define
and let be the map the general recursion theorem produces, so that
for every . If then is one of the elements excluded at stage , so ; with trichotomy this makes injective. Hence satisfies and .
Theorem 7.48 (Characterising finite sets).
Let be a non-empty set. The following are equivalent.
- is finite.
- There is a surjection for some .
- There is an injection for some .
- There is no injection .
When they hold, is the least of the second kind and equally the least of the third.
Discussion.
We run a cycle again. From the first to the second, a counting of is itself a surjection from a cut. From the second to the third, a surjection has an injective right inverse, obtained as before by sending each point to its least preimage, which well-ordering supplies inside the cut. From the third to the fourth, an injection followed by an injection would inject into , and restricting to would inject a cut into a shorter one. The last step is the theorem just proved, read contrapositively: an infinite carries a copy of , hence an injection .
The minimality clause is the two size theorems. A surjection gives by the proposition on images, an injection gives by the theorem on injections and size, and is achieved in both cases by a counting of and its inverse.
Proof.
Suppose is finite. Being non-empty, for some , and a bijection is a surjection.
Suppose is surjective. For the preimage is a non-empty subset of , so it has a least element; sending to it defines with , and is injective.
Suppose is injective and let be injective. Then is injective, and its restriction to is an injection , which no cut admits. So no such exists.
Suppose finally that is not finite. The previous theorem gives a subset equinumerous with , hence a bijection , which composed with the inclusion of in is an injection . That is the fourth condition denied, which completes the cycle.
For the last claim, a surjection gives , and an injection gives ; both bounds are attained by a counting of , which is a surjection , and by its inverse.
Theorem 7.49 (Dedekind's characterisation of finiteness).
A set is finite if and only if it is not equinumerous with any proper subset of itself.
Discussion.
One direction is much easier than the other. One of them is the corollary of the first chapter, which said that a finite set is strictly larger than each of its proper subsets, so no bijection is available.
The other is best proved contrapositively: given an infinite , we produce a proper subset equinumerous with it. The theorem above puts a copy of inside , and inside it we can shift along successors, as in . So we shift inside the copy and do nothing outside it: the points of off the copy are left where they are, and the th point of the copy is sent to the th. The result misses the initial point of the copy and nothing else, which is the proper subset we wanted.
Proof.
If is finite and then , by the corollary on proper subsets.
Suppose is infinite. The theorem on countably infinite subsets gives an injection ; write and define
Each is for exactly one , since is injective, so is a function; and its values avoid , since by injectivity and gives .
For injectivity, two points of are separated because and are injective, two points outside are unchanged, and a point of cannot collide with one outside because its value lies in . For surjectivity, a point outside is ; and a point with is for the predecessor of , hence .
So , a proper subset of .
Corollary 7.50 (Finiteness by self-maps).
A set is finite if and only if every injection is surjective, and if and only if every surjection is injective.
Proof.
If is finite, the theorem on finite self-maps gives both conditions. If is infinite, the map built in the last proof is an injection whose range omits , so it is injective and not surjective; and its inverse on that range, extended by sending to itself, is a surjection that is not injective.
Remark.
Only the second direction of the theorem used the axiom of choice, and used it twice, once to select elements and once through the recursion that strung the selections together. Dedekind took the property in the theorem as his definition of infinite, and without choice his definition and ours are not known to agree: there is no contradiction in a set that is infinite in our sense and yet admits no bijection with a proper subset. We accept choice, so for us the two notions are one.
Show that a set is infinite if and only if for every there is an injection .
Let be infinite and countable. Show that .
Uncountable Sets
Every infinite set met so far has turned out to be countable, and the closure properties above keep it that way: subsets, products and countable unions of countable sets are all countable. Cantor’s theorem already gives sets that are not, and the same diagonal argument gives an explicit one.
Theorem 7.51 (Cantor's diagonal argument).
Let be a set with at least two elements. Then the Cartesian power , the set of infinite sequences in , is uncountable.
Discussion.
Uncountable means neither finite nor countably infinite, and the characterisation of countable sets turns that into one statement: no surjection exists. So we assume a surjection, write for the sequence it puts at , and build a sequence it has missed.
The sequences are laid out as an infinite array whose th row is , and a sequence differs from the th row as soon as it differs from it in one place. The place we can always name is the th, on the diagonal of the array, so we build by walking down the diagonal and disagreeing at every step. Disagreement is possible because has a second element, and we fix two elements of once and for all rather than choosing at each step, so the axiom of choice is not needed. Then differs from every row, so it is not a value of the surjection.
Proof.
Fix with , and suppose is a surjection. Write and , so the values are laid out as
Define by if , and otherwise. Then for every , since in the second case .
Now , so surjectivity gives for some , and reading both sides at gives , which is false. So no surjection exists, and is neither finite nor countably infinite by the characterisation of countable sets.
The same diagonal argument works for an arbitrary index set.
Theorem 7.52 (A set is smaller than its sequences).
Let be non-empty and let have at least two elements. Then .
Discussion.
The claim splits into an injection and the absence of a bijection. For the injection we must attach to each point of a function on , and we use the point itself: send to the function that takes one fixed value at and the other everywhere else. Two distinct points give functions that disagree at either of them, so the assignment is injective.
For the second half the diagonal argument runs verbatim, with in place of : given , the function that disagrees with at , for every , cannot be a value of . Nothing in that used the order or the countability of the index set, so only the two fixed elements of are needed.
Proof.
Fix with . For let take the value at and elsewhere. If then while , so ; hence is an injection and .
Let be any function and define by if , and otherwise, so that for every . If for some , reading both sides at gives , which is false. So is not a value of , no is surjective, and no bijection exists.
Corollary 7.53 (Power sets as sequences).
For every set we have .
Proof.
Send to its characteristic function , taking the value on and off it. Distinct subsets differ at some point, where their characteristic functions differ, so the map is injective; and any is the characteristic function of , so it is surjective.
So Cantor’s theorem is the previous theorem read at , and the diagonal argument that rules out surjections onto is the one that rules out surjections onto .
Corollary 7.54 (An uncountable set).
is uncountable, and so is .
Proof.
has two elements, so is uncountable by the diagonal argument, and is equinumerous with it by the corollary above; a set equinumerous with an uncountable set is uncountable, since countability is defined by the existence of a bijection.
Remark (Informal).
Assuming you know the real numbers, the same argument shows there are uncountably many. List candidate decimal expansions of the numbers between and and build a new expansion differing from the th in its th digit, avoiding the digit so as not to fall foul of the two expansions some numbers have; the number it names is missing from the list. Since the fractions are countable, the numbers that are not fractions must be uncountable, for otherwise the reals would be a union of two countable sets.
The same counting argument shows something less expected. The polynomials with fractional coefficients are countable, being determined by finite lists of fractions, and each has finitely many roots, so the numbers that are roots of such a polynomial form a countable set. Uncountably many real numbers are therefore roots of no such polynomial at all, although exhibiting even one takes real work.
Let be uncountable and let be countable. Show that is uncountable.
Deduce from Cantor’s theorem that there is no surjection , for any set .
Cardinal Numbers
We have been writing for arbitrary sets without saying what names when is infinite, and so far we have not needed to: the three relations were defined as statements about functions, and the symbol never occurred alone. It can be given a meaning, using the equivalence classes from the remark of the first section.
Definition 7.55 (Cardinal number).
Fix a set . The cardinal number of a subset is its equivalence class under equinumerosity. Two subsets of have the same cardinal number exactly when they are equinumerous.
Remark.
The restriction to a fixed is needed, since the sets equinumerous with a given one do not form a set. For finite nothing is lost by reading as the natural number counting it, because the cardinal numbers of finite subsets of correspond to the cuts, one class for each with . A definition free of the ambient needs the ordinal numbers, which we have not built.
The order has the properties the notation suggests. Reflexivity and transitivity were proved directly, Schröder–Bernstein gives antisymmetry, since two subsets each injecting into the other are equinumerous and so name one class, and comparability makes any two classes comparable. So on the relation is a total order, with the strict comparison as its strict part.
Definition 7.56 (Arithmetic of cardinal numbers).
For sets and define
The tagged copies in the sum are there because and may share elements, and tagging makes disjoint copies of both without disturbing their sizes. That the three operations depend only on the classes and not on the sets chosen to represent them is the transport problem set above. On finite sets they agree with the arithmetic of the first chapter, by the theorems on disjoint unions and products and by the problem on .
Since and , the power set records an exponential:
and Cantor’s theorem reads . Writing for the smallest infinite cardinal number, the chain
climbs for ever, so there is no largest size.
Remark (The continuum hypothesis).
Nothing proved here says whether anything sits between two consecutive terms of that chain. The continuum hypothesis asserts that nothing sits between the first two: there is no set with . Gödel showed in 1938 that it cannot be refuted from the axioms we have listed, choice included, and Cohen showed in 1963 that it cannot be proved from them either, so long as those axioms are consistent at all. It is independent, in the sense the axiom of choice was said to be independent, and one may add it or its negation without introducing a contradiction that was not already there.
Remark.
Cantor’s theorem also settles again a question from the naive chapter. Were there a set holding every set, then would be one of its subsets, so
which trichotomy forbids. That is Cantor’s own argument, and it reaches the conclusion of the proposition on no set of all sets by counting rather than by self-membership.
Show that cardinal addition and multiplication are commutative and associative, and that . Each identity is a bijection between the sets involved.
Show that and , and explain which theorems of this chapter each one is.
Show that and imply .
Show that for all sets , and .
Exercises
Answers are checked in your browser, as often as you like. Nothing is sent anywhere and
nothing is kept but your own work. A formula may be written with the symbols themselves or
with ~ & | -> <-> ^, and \and, \or, \to expand as you type.
Let and .
is:
is:
is:
is:
The sum equals:
Each part asks for a bijection between two subsets of .
A bijection from onto is:
Its inverse is:
A bijection from onto the even elements of is:
A bijection from onto is:
There are seven days in a week.
Among any fifteen people, the largest number that must share a day of the week is:
Among any twenty-two people, that number is:
The least for which any people must include three born on the same day of the week is:
For a function from a set of elements to a set of elements, some value is taken at least this many times:
Of the functions , the injective ones are:
A study of breakfast eaters finds that also eat lunch, floss regularly and take a morning paper. Among the lunch eaters, floss and take the paper, and do both. Four flossers neither eat lunch nor take the paper.
The number who floss and take the paper is:
The number who take the paper but neither floss nor eat lunch is:
The number who do none of the three is:
Classify each set as finite, countably infinite or uncountable.
.
The multiples of in .
.
.
The finite subsets of .
The subsets of that are infinite.
On the comparison of sizes.
Someone reads Schröder–Bernstein as saying that injections and are each bijections. Is that right?
Comparability of any two sets was proved from:
Schröder–Bernstein was proved from:
Suppose there is an injection and no injection . Then:
The pairing of the theorem on pairs of natural numbers, where .
is:
is:
The pair sent to is:
The number of pairs with is:
Finiteness by self-maps and by proper subsets.
A set is finite exactly when every injection is:
The sets equinumerous with a proper subset of themselves are:
The successor is injective and not surjective. That shows:
The theorem that every infinite set has a countably infinite subset rests on:
Cardinal numbers.
The cardinal names:
Is there a largest cardinal number?
The continuum hypothesis is:
Why is the cardinal number of defined only for subsets of a fixed set ?
Exercises in Lean
The proofs below are checked in your browser. Nothing is sent anywhere, and nothing is
stored but your own work. Type \to for →,
\and for ∧, \< and
\> for ⟨ ⟩.
The last sheet gave the checker the order on the carrier and the sets separation carves out. This chapter counts, and counting needs two things the checker has not had: a map read between two sets rather than across the whole universe, and the natural numbers as objects of that universe, so that the cuts have something to hold.
Maps between two sets
A map has so far been an arrow f : Obj → Obj on everything at once, and Injective f and Surjective f asked their conditions everywhere. A map of this chapter has a domain and a codomain, so the same conditions are written on the sets they are asserted of, and each is the statement the definitions of a surjection and an injection make it:
MapsTo f A B is ∀ x, x ∈ A → f x ∈ B
InjOn f A is ∀ x y, x ∈ A → y ∈ A → f x = f y → x = y
SurjOn f A B is ∀ y, y ∈ B → ∃ x, x ∈ A ∧ f x = y
BijOn f A B is MapsTo f A B ∧ InjOn f A ∧ SurjOn f A BBeing those statements and not merely equivalent to them, they are opened with intro and used by applying them, in the way A ⊆ B has been since the sets sheet. A BijOn splits three ways at once, so obtain ⟨hm, hi, hs⟩ takes one apart and refine ⟨?_, ?_, ?_⟩ puts one together.
Example.
A map injective everywhere is injective on any set. The converse fails, which is why the two conditions are kept apart.
Example.
The values of on lie in , which is where is known to do its work.
A restriction of an injection is an injection.
The codomain may be enlarged freely.
The first part of the theorem that bijections compose, read on two sets.
Its second part.
Only the first map need be injective for the composite to be.
The inverse of a bijection is a bijection. The checker cannot choose preimages, so the inverse arrives as a hypothesis rather than being built; what is left is the second part of Proposition 7.2 .
Comparing sizes
Two sets are compared by the functions running between them, which is what Definition 7.1 and Definition 7.31 say, so the two comparisons are typed as the existence statements they are:
A ≈ B is ∃ f : Obj → Obj, BijOn f A B
A ≼ B is ∃ f : Obj → Obj, MapsTo f A B ∧ InjOn f Atyped \approx and \preceq. The second is ; the strict comparison is not notation of its own, being the second together with the denial of the first. A witness is supplied by use or as the first component of refine ⟨_, ?_, ?_⟩, and it is written as a function, fun x => x for the identity.
Example.
The first part of Proposition 7.2 . Each of the three conditions is read at a point, and the identity satisfies all three without any work.
The empty function.
A subset is no larger than the set it sits in.
A bijection is in particular an injection.
The second part of Proposition 7.32 .
The third part of Proposition 7.2 .
Problem 7.13 : a comparison transported along two bijections.
Problem 7.16 . The map sends a subset of to its image. (Harder.)
Cantor’s theorem
The first half of Cantor’s theorem.
And the second, which is Problem 7.26 . The diagonal set is {x ∈ S | x ∉ f x}, and it is a subset of before it is anything else.
The natural numbers as objects
The carrier ℕ of the Peano sheet is a type of its own, and the cuts are sets, so the two have to be brought together before a cut can be written down. ↑n, typed \up, is the object the number n names; ω is the set of all of them, which is ; and L n is the cut. Their criteria are the definitions:
x ∈ ω is ∃ k : ℕ, x = ↑k
x ∈ L n is ∃ k : ℕ, k < n ∧ x = ↑kso a membership is built with use or ⟨_, _, _⟩ and taken apart with obtain ⟨k, hk, he⟩. That distinct numbers name distinct objects is Num.inj, and Finite A is ∃ n : ℕ, A ≈ L n, which is Definition 7.5 verbatim.
Example.
The witness is the number itself, and the equation it has to satisfy is an identity.
Example.
A strict inequality is a positive difference, and no positive difference reaches . It is listed below as Nat.not_lt_zero, so the exercises may lean on it.
The first part of Proposition 7.4 .
Its last part.
Every cut sits inside .
And the cuts grow with their index.
The middle part of Proposition 7.4 , which every induction of this chapter turns on.
A cut counts itself.
And the empty set is counted by the cut that holds nothing.
A set with one point in it. (Harder.)
A finite set injects into , which is the easy half of the characterisation of countability.
What the checker understands
Tactics
| intro h | assume the hypothesis of an implication, naming it h |
| exact e | give the proof outright |
| apply f | reduce the goal to the hypotheses of f |
| assumption | close the goal with a hypothesis already present |
| trivial | close the goal True |
| exfalso | replace the goal with False |
| by_contra h | assume the negation of the goal |
| constructor | split ∧ into both halves, or ↔ into both directions |
| left / right | choose which half of a ∨ to prove |
| rcases h with a | b | argue by cases on a disjunction |
| obtain ⟨a, b⟩ := h | take a conjunction or an existential apart |
| cases h | as above, keeping the name |
| refine e | give the proof with holes left in it |
| have h : p := … | record an intermediate result |
| show p | restate the goal in an equal form |
| use w | give a witness for ∃ |
| specialize h a | instantiate a ∀ hypothesis |
| rw [h] | rewrite with an equation, ← to go backwards |
| rfl | both sides compute to the same thing |
| decide / norm_num | settle a closed computation |
| tauto | close a goal that is true by pure logic |
| induction n with k ih | the fifth Peano condition: prove the goal at 0, then at succ k from ih |
Results you may cite
| Classical.em | ∀ (a : Prop), a ∨ ¬a — the law of excluded middle |
| Classical.byContradiction | ∀ {a : Prop}, (¬a → False) → a — proof by contradiction; the tactic by_contra does this for you |
| Classical.byCases | ∀ {a b : Prop}, (a → b) → (¬a → b) → b — split on whether a holds |
| not_not | ∀ {a : Prop}, ¬¬a ↔ a — double negation |
| not_and_or | ∀ {a b : Prop}, ¬(a ∧ b) ↔ ¬a ∨ ¬b — De Morgan |
| not_or | ∀ {a b : Prop}, ¬(a ∨ b) ↔ ¬a ∧ ¬b — De Morgan |
| not_imp | ∀ {a b : Prop}, ¬(a → b) ↔ a ∧ ¬b |
| and_comm | ∀ {a b : Prop}, a ∧ b ↔ b ∧ a |
| or_comm | ∀ {a b : Prop}, a ∨ b ↔ b ∨ a |
| Set.ext | ∀ {A B : Obj}, (∀ x : Obj, x ∈ A ↔ x ∈ B) → A = B — extensionality: sets with the same elements are equal |
| Set.ext_iff | ∀ {A B : Obj}, A = B ↔ (∀ x : Obj, x ∈ A ↔ x ∈ B) — extensionality and substitution, in one biconditional |
| Set.subset_antisymm | ∀ {A B : Obj}, A ⊆ B → B ⊆ A → A = B — mutual inclusion is equality |
| Set.empty_subset | ∀ {A : Obj}, ∅ ⊆ A — the empty set is a subset of every set |
| Set.pair_eq | ∀ {a b c d : Obj}, ((a, b) = (c, d)) ↔ (a = c ∧ b = d) — two ordered pairs are equal exactly when their coordinates are |
| Nat.succ_inj | ∀ {m n : ℕ}, succ m = succ n → m = n — the third Peano condition: the successor is injective |
| Nat.succ_ne_zero | ∀ (n : ℕ), succ n ≠ 0 — the fourth: zero is nobody's successor |
| Nat.pred | ∀ {n : ℕ}, n ≠ 0 → ∃ m : ℕ, n = succ m — predecessors: everything but zero is a successor |
| Nat.add_zero | ∀ (m : ℕ), m + 0 = m — the first clause of addition |
| Nat.add_succ | ∀ (m n : ℕ), m + succ n = succ (m + n) — the second clause of addition |
| Nat.zero_add | ∀ (n : ℕ), 0 + n = n — addition from the left |
| Nat.succ_add | ∀ (m n : ℕ), succ m + n = succ (m + n) — addition from the left, at a successor |
| Nat.add_assoc | ∀ (m n p : ℕ), (m + n) + p = m + (n + p) — addition is associative |
| Nat.add_comm | ∀ (m n : ℕ), m + n = n + m — addition is commutative |
| Nat.add_ne_zero | ∀ {a : ℕ} (b : ℕ), a ≠ 0 → a + b ≠ 0 — positivity is absorbing |
| Nat.mul_zero | ∀ (m : ℕ), m * 0 = 0 — the first clause of multiplication |
| Nat.mul_succ | ∀ (m n : ℕ), m * succ n = m * n + m — the second clause of multiplication |
| Nat.zero_mul | ∀ (m : ℕ), 0 * m = 0 — multiplication from the left |
| Nat.succ_mul | ∀ (m n : ℕ), succ m * n = m * n + n — multiplication from the left, at a successor |
| Nat.add_right_cancel | ∀ {m n k : ℕ}, m + k = n + k → m = n — cancellation, from the last sheet |
| Nat.add_eq_zero | ∀ {m n : ℕ}, m + n = 0 → m = 0 ∧ n = 0 — a sum is zero only when both parts are, from the last sheet |
| Nat.mul_comm | ∀ (m n : ℕ), m * n = n * m — multiplication is commutative, from the last sheet |
| Nat.mul_add | ∀ (m n p : ℕ), m * (n + p) = m * n + m * p — multiplication distributes over addition, from the last sheet |
| Nat.mul_assoc | ∀ (m n p : ℕ), (m * n) * p = m * (n * p) — multiplication associates, from the problems of the last chapter |
| Nat.add_mul | ∀ (m n p : ℕ), (m + n) * p = m * p + n * p — distributivity on the other side |
| Nat.add_left_cancel | ∀ {a m n : ℕ}, a + m = a + n → m = n — uniqueness of differences |
| Nat.lt_trichotomy | ∀ (m n : ℕ), m < n ∨ m = n ∨ n < m — trichotomy, from the theorem that ℕ is strictly ordered |
| Nat.lt_irrefl | ∀ (n : ℕ), ¬(n < n) — anti-reflexivity, from the last sheet |
| Nat.lt_trans | ∀ {m n p : ℕ}, m < n → n < p → m < p — transitivity of the strict order, from the last sheet |
| Nat.lt_succ_self | ∀ (n : ℕ), n < succ n — every number is below its successor, from the last sheet |
| Nat.not_lt_zero | ∀ {n : ℕ}, ¬(n < 0) — nothing lies below zero |
| Nat.lt_succ_iff | ∀ {m n : ℕ}, m < succ n ↔ m < n ∨ m = n — nothing lies strictly between n and succ n |
| Num.inj | ∀ {m n : ℕ}, ↑m = ↑n → m = n — distinct numbers name distinct objects of ω |
From the logical core
| And.intro | ∀ {a b : Prop}, a → b → a ∧ b |
| And.left | ∀ {a b : Prop}, a ∧ b → a |
| And.right | ∀ {a b : Prop}, a ∧ b → b |
| And.symm | ∀ {a b : Prop}, a ∧ b → b ∧ a |
| Or.inl | ∀ {a b : Prop}, a → a ∨ b |
| Or.inr | ∀ {a b : Prop}, b → a ∨ b |
| Or.elim | ∀ {a b c : Prop}, a ∨ b → (a → c) → (b → c) → c |
| Or.symm | ∀ {a b : Prop}, a ∨ b → b ∨ a |
| Iff.intro | ∀ {a b : Prop}, (a → b) → (b → a) → (a ↔ b) |
| Iff.mp | ∀ {a b : Prop}, (a ↔ b) → a → b |
| Iff.mpr | ∀ {a b : Prop}, (a ↔ b) → b → a |
| Iff.symm | ∀ {a b : Prop}, (a ↔ b) → (b ↔ a) |
| Iff.rfl | ∀ {a : Prop}, a ↔ a |
| Iff.trans | ∀ {a b c : Prop}, (a ↔ b) → (b ↔ c) → (a ↔ c) |
| True.intro | True |
| False.elim | ∀ {a : Prop}, False → a |
| absurd | ∀ {a b : Prop}, a → ¬a → b |
| id | ∀ {a : Prop}, a → a |
| mt | ∀ {a b : Prop}, (a → b) → ¬b → ¬a |
| Eq.refl | ∀ {α : Type} (a : α), a = a |
| Eq.symm | ∀ {α : Type} {a b : α}, a = b → b = a |
| Eq.trans | ∀ {α : Type} {a b c : α}, a = b → b = c → a = c |
| congrArg | ∀ {α : Type} {β : Type} {a b : α} (f : α → β), a = b → f a = f b |
| Exists.intro | ∀ {α : Type} {p : α → Prop} (w : α), p w → ∃ x : α, p x |
| Exists.elim | ∀ {α : Type} {p : α → Prop} {b : Prop}, (∃ x : α, p x) → (∀ y : α, p y → b) → b |