Lectures onType Theory
Chapter 210
Chapter 210Core route

Set-Level Mathematics in Univalent Foundations

Cardinals and ordinals

A cardinal remembers a set only up to equivalence. We obtain that quotient internally by taking the set truncation of the universe of sets.

Definition 74.48 — Cardinals

The type of cardinals is Card:=Set0; a cardinal is therefore a set remembered only up to mere equivalence. The cardinality of a set A is its class |A|:Card. Arithmetic is defined by induction on 0-truncation: |A|+|B|:=|A+B|,|A||B|:=|A×B|,|A||B|:=|BA|. To define addition, fix A and eliminate the truncation in the second argument. For a representative B, set |A|+|B|:=|A+B|. The codomain Card is a set, so the result is independent of the representative. Eliminate the first truncation in the same way. Products and exponentials are well defined by the same two eliminations, using A×B and BA.

Lemma 74.49

(Card,0,1,+,) is a commutative semiring, with 0:=|0| and 1:=|1|. Moreover, α0=1,α1=α,αβ+γ=αβαγ,(αβ)γ=αγβγ,αβγ=(αβ)γ.

Proof of Lemma 74.49

Proof. Every asserted equality is a mere proposition, so truncation induction reduces it to representatives. The additive laws are induced by the equivalences (A+B)+CA+(B+C),A+BB+A,0+AA. The multiplicative laws are induced by (A×B)×CA×(B×C),A×BB×A,1×AA,0×A0. Distributivity is induced by A×(B+C)(A×B)+(A×C),(B+C)×A(B×A)+(C×A). Univalence turns each equivalence into the required cardinal equality. Finally, the displayed exponentiation laws are induced respectively by (0A)1,(1A)A,(B+CA)(BA)×(CA), C(A×B)(CA)×(CB),B×CAC(BA). ◻

Definition 74.50

For sets A,B let inj(A,B) be the type of injections AB. Cardinal inequality is defined by truncation induction: |A||B|:=inj(A,B).

Theorem 74.51 — Cantor

For any set A there is no surjection A(A2).

Proof of Theorem 74.51 — Cantor

Proof. Let f:A(A2) and define g(a):=¬f(a)(a), with ¬ the Boolean negation. A surjection would merely provide a0 with f(a0)=g; applying both sides to a0 gives f(a0)(a0)=¬f(a0)(a0), contradicting ttff (theorem 29.14) after case analysis on f(a0)(a0). Since 0 is a mere proposition, mere existence suffices for the contradiction. ◻

Theorem 74.52 — Schr"oder–Bernstein; LEM

Assuming the law of excluded middle for mere propositions, for sets A,B there is a map inj(A,B)inj(B,A)(AB); hence, assuming LEM, on Card is a partial order.

Proof of Theorem 74.52 — Schr"oder–Bernstein; LEM

Proof. Let f:AB and g:BA be injections. Define subsets of A by C0:=Aim(g),qquadCn+1:=g(f(Cn)),qquadC:=n:NCn. Membership in each subset is a mere proposition, and LEM decides membership in C. If aC, put h(a):=f(a). If aC, then aC0, so there is a unique b:B with g(b)=a; put h(a):=b.

Suppose h(a)=h(a). If a,aC, injectivity of f gives a=a. If neither lies in C, applying g to the equality gives a=a. In the remaining case, say aCn and aC, the equality f(a)=h(a) gives a=g(f(a))Cn+1, a contradiction. Thus h is injective.

For surjectivity, take b:B. If g(b)C, the unique inverse clause gives h(g(b))=b. If g(b)C, then g(b)C0 and its membership witness has successor form: g(b)=g(f(a)) for some aCn. Injectivity of g gives b=f(a)=h(a). Hence h:AB.

Reflexivity and transitivity of cardinal inequality come from identity and composition of injections. Given both |A||B| and |B||A|, eliminate the two propositional truncations into the proposition |A|=|B|, apply the construction above, and use univalence. Thus is antisymmetric. ◻

Definition 74.53 — Accessibility

Let A be a set with a mere relation <:AAProp. The family acc:AU is inductively generated by the single rule

Γa:AΓh:b:A(b<a)acc(b)
Γacc<(a,h):acc(a)
Acc-Intro

with the corresponding induction principle for an indexed inductive family (cf. chapter 28). An inhabitant of acc(a) is an accessibility witness: it contains accessibility witnesses for every predecessor of a. The relation < is well-founded if a:Aacc(a).

Lemma 74.54

Each acc(a) is a mere proposition; hence well-foundedness is a mere proposition.

Proof of Lemma 74.54

Proof. Fix a and an accessibility witness u:acc(a). Induct on u with motive P(a,u):=v:acc(a)u=v. In the constructor case u=acc<(a,h1), take v=acc<(a,h2). For every b:A and r:b<a, the induction hypothesis at h1(b,r) gives h1(b,r)=h2(b,r). Function extensionality first in r and then in b gives h1=h2. Congruence of acc<(a,) therefore gives u=v. Hence every two witnesses of acc(a) are equal. A dependent product of mere propositions is a mere proposition, so well-foundedness is one as well. ◻

Theorem 74.55 — Well-founded induction

Let < be well-founded on A and P:AU. If a:A(b:A(b<a)P(b))P(a), then a:AP(a).

Proof of Theorem 74.55 — Well-founded induction

Proof. By acc-induction P holds at every accessible element, and well-foundedness makes every element accessible. ◻

Definition 74.56 — Ordinals

A well-founded mere relation < on a set A is extensional if a:Ab:A(c:A(c<a)(c<b))(a=b). An ordinal is a set with an extensional, well-founded, transitive mere relation; Ord denotes the type of ordinals in U.

Theorem 74.57

The type of sets equipped with extensional well-founded relations is a set; in particular Ord is a set.

Proof of Theorem 74.57

Proof. By univalence and the machinery of theorem 74.44 it suffices to show that the only automorphism f of an extensional well-founded (A,<) is the identity. By well-founded induction suppose f(a)=a for all a<a. For c<a we get f(c)=c, so c<f(a) (as f preserves <). Conversely, if c<f(a), preservation by f1 gives f1(c)<a. The induction hypothesis gives f1(c)=c, hence c<a. Thus a and f(a) have the same predecessors, so extensionality gives f(a)=a. ◻

Definition 74.58 — Simulation

For ordinals (A,<), (B,<), a simulation is a map f:AB such that (i) a<a implies f(a)<f(a), and (ii) whenever b<f(a) there merely exists a<a with f(a)=b. We write AB for the mere proposition that one exists, and A<B if some simulation identifies A with an initial segment {b:Bb<b} of B.

Lemma 210.12 — Uniqueness of simulations

A simulation between two ordinals is injective, and any two simulations f,g:AB are equal. If simulations exist in both directions, they form an isomorphism of the underlying extensional well-founded relations.

Proof of Lemma 210.12 — Uniqueness of simulations

Proof. Fix a simulation f:AB. Prove by well-founded induction on a:A the strengthened motive P(a):=a:A(f(a)=f(a))(a=a). Suppose f(a)=f(a). If c<a, then f(c)<f(a); the initial-segment clause at a gives, under propositional truncation, c<a with f(c)=f(c). The target c=c is a mere proposition, so eliminate the truncation and apply the induction hypothesis P(c) to obtain it. Conversely, if c<a, the same clause at a gives c<a with f(c)=f(c), and P(c) again gives c=c. Thus a and a have the same predecessors. Extensionality of A gives a=a, completing the induction and proving that f is injective.

For uniqueness, induct on a:A. If b<f(a), the initial-segment clause gives a<a with f(a)=b. The induction hypothesis gives f(a)=g(a), so b<g(a). The converse is symmetric. Extensionality of B yields f(a)=g(a), and function extensionality gives f=g.

Given f:AB and g:BA, both gf and idA are simulations; uniqueness in A gives gf=idA. Both fg and idB are simulations, so uniqueness in B gives fg=idB. Hence f and g are inverse isomorphisms preserving the relations. ◻

Theorem 74.59

(OrdU,<) is an ordinal in the next universe.

Proof of Theorem 74.59

Proof. Write Aa for the ordinal on {a:Aa<a}.

Transitivity. Suppose A<B is represented by a simulation identifying A with Bb, and B<C by one identifying B with Cc. Their composite identifies A with Cf(b), where f(b)<c; hence A<C.

Extensionality. Suppose X<A if and only if X<B for every small ordinal X. For each a:A, the relation Aa<A gives a unique b:B such that Aa=Bb. Uniqueness follows from extensionality of B, so propositional elimination defines f(a):=b. If a<a, then Aa<Aa; transporting across the displayed equalities gives f(a)<f(a). Conversely, every b<f(a) determines the predecessor ordinal Bb<Bf(a) and therefore a unique a<a with f(a)=b. Thus f:AB is a simulation. The symmetric construction gives a simulation BA, so lemma 210.12 and the structure identity principle give A=B.

Well-foundedness. Fix A and prove acc(Aa) by well-founded induction on a:A. The proposition X<Aa is, by definition, the truncation of a pair u:(Aa) and a relation isomorphism X(Aa)u. Write u=(a,r), where r:a<a. There is a relation isomorphism (Aa)(a,r)Aa whose forward map sends ((b,s),t) to (b,t) and whose inverse sends (b,t) to ((b,trans(t,r)),t). The structure identity principle therefore gives X=Aa. Because accessibility is a mere proposition, we may eliminate the truncation; the induction hypothesis at a<a then gives acc(X). Hence Acc-Intro gives acc(Aa).

Finally, an element of X<A is exactly a truncated pair of a:A and a relation isomorphism XAa. Eliminate it into the proposition acc(X) and use the result just proved. One more use of Acc-Intro gives acc(A). Thus the relation on OrdU is well founded. Its carrier belongs to the next universe by construction. ◻

No Burali–Forti contradiction follows. The type OrdU belongs to the next universe, and the assignment A{BB<A} does not lower that universe level.

Exercise 74.14

★★★ For each equivalence used in lemma 74.49, write its inverse and verify both composites. Then show that is compatible with + and , and that exponentiation is monotone in its base: αβ implies αγβγ.

Exercise 74.15

★★☆ Write out the proof of lemma 74.54, using the induction principle of acc with a motive depending on the accessibility witness.

Exercise 74.16

★★★ Reconstruct lemma 210.12. Identify where well-founded induction is used for injectivity and where extensionality is used for uniqueness.

Suggested first pass.

None of these problems is a prerequisite for a later chapter. Begin with exercise 210.4, then complete exercise 210.5.

Exercise 210.4

★★☆ Let e:A(A2) be arbitrary and define d(a):=not(e(a)(a)). Prove that no a:A satisfies e(a)=d, and conclude that no map A(A2) is surjective. State precisely where function congruence and Boolean separation enter the argument, and explain why excluded middle is not used.

Exercise 210.5

★★★ Practical project.finite-cardinal-evaluator Implement in Agda or Kappa a finite evaluator for cardinal expressions built from 0, 1, natural-number constants, sum, product, and exponentiation. Check a sum, distributivity, (ab)c=abc, and the finite Cantor inequality n<2n on named inputs. Mutation test: replace the sum clause by its left operand; the sum or distributivity acceptance test must then fail. The program tests finite representatives only and must not claim to decide equality of arbitrary cardinals.

Bibliographic notes

The set-level and ordinal developments follow Chapter 10 of the HoTT Book [Uni13]. In particular, ordinals are sets with extensional, well-founded, transitive relations, and the type of small ordinals is itself an ordinal one universe higher. None of the cardinal or ordinal constructions depends on the optional real-number completion.

Search the book

Type to search the local edition.