A single source generates everything here. Placing a mark and reading it back form an adjunction whose two triangle identities are the two directions of \(a=a\), and the same two identities are Yoneda at \(\mathrm {id}\). From this source the following are derived as corollaries, each using only the ones before it:
the floor: identity, the diagonal, the swap, extensionality, order, logic, sums and products, currying, distributivity, quantifiers, fixed points, induction, recursion, arithmetic and infinity (C1–C21);
type theory: judgements, the \(\beta \)- and \(\eta \)-rules of every type former, identity types, the interval, function extensionality and univalence (C22–C27).
The intensional, extensional, cubical, directed and univalent type theories differ only in the level at which the second triangle identity is available (C28). Each of them returns the floor in turn (C29).
S (the source). Placing a mark in a place and reading it back are adjoint, with the two triangle identities
So S, the two directions of \(a=a\), and Yoneda at \(\mathrm {id}\) are one source.
C1 (identity). Placing a mark in one place and reading it is \(\mathrm {id}_A\), by (i) at one place.
C2 (diagonal). Placing one mark in two places gives \(\Delta (a)=(a,a)\). Reading either place returns the mark, so \(\pi _1\Delta =\mathrm {id}=\pi _2\Delta \) by (i). The two places are named \(\mathbf 2=\{\text {first},\text {second}\}\).
C3 (swap). Reading the two places in the opposite order and placing gives \(\sigma (x,y)=(y,x)\). Then
C4 (extensionality of pairs).
C5 (extensionality of families). A map \(f:A\to B\) is a filling of \(A\) places. C4 at \(A\) places gives
C6 (parts and their meet). A part is a map \(p:A\to \mathbf 2\) (C5). Place two parts on one mark by C2 and read “both first”:
Commutative: the condition is unchanged under \(\sigma \) (C3), so \(pq=qp\).
Idempotent: asking the same question twice is asking it once, so \(p^2=p\). The law \(x^2=x\) first appears here.
Associative: “all three first” does not depend on grouping.
Each identity is checked place by place, by C5.
C7 (order). Put \(p\le q\iff pq=p\).
Reflexive: \(pp=p\) (C6).
Transitive: \(pr=(pq)r=p(qr)=pq=p\).
Antisymmetric: \(p=pq=qp=q\).
C8 (complement, meet, join). Let \(\neg p=\sigma \circ p\), which exchanges first and second.
\(\neg \neg p=p\), since \(\sigma ^2=\mathrm {id}\) (C3).
\(p\,\neg p=\varnothing \), since one name cannot be both first and second.
\(pq\) is the meet: \((pq)p=pq\), and \(r\le p,q\) gives \(r(pq)=(rp)q=r\).
\(\neg \) reverses order: if \(pq=p\), then \(q(a)=\text {second}\) forces \(p(a)=\text {second}\), so \(\neg q\le \neg p\). Hence \(p\vee q=\neg (\neg p\,\neg q)\) is the least upper bound.
C9 (sums; tags are injective). A mark of \(A\sqcup B\) is a pair \((t,c)\) of a place name and a content. By C4,
C10 (an inverse forces injectivity). If \(gf=\mathrm {id}\) and \(f(x)=f(y)\), then substituting into \(g\) gives \(x=gf(x)=gf(y)=y\).
C11 (currying). The places of \(A\times B\) are pairs of places. Put \(\hat F(a)(b)=F(a,b)\) and \(\check G(a,b)=G(a)(b)\). Then
C12 (distributivity). Put \(\varphi (a,(t,c))=(t,(a,c))\) and \(\psi (t,(a,c))=(a,(t,c))\). Both composites \(\psi \varphi \) and \(\varphi \psi \) are \(\mathrm {id}\) by C4, so
C13 (some \(\dashv \) weakening \(\dashv \) all). For \(\pi :A\times B\to A\), put
C13\('\) (dependent types: some and all along a family). Let \(B\) be a family over \(A\), so that each \(a\) has its own kind \(B(a)\), and let
C14 (fixed points, algebras, coalgebras). With \(\Delta \) the part of \(X\times X\) whose two readings agree (C2, C4),
| Half | As a map | On parts |
| algebra | \(\Phi X\to X\) | \(\Phi P\le P\) (closed) |
| coalgebra | \(X\to \Phi X\) | \(P\le \Phi P\) (self-sustaining) |
| both | \(X\cong \Phi X\) | \(\Phi P=P\), by antisymmetry (C7) |
C15 (least and greatest; leastness is the counit). Index the closed parts by \(C\) with membership \(M\subseteq C\times A\), and put \(\mu \Phi =\forall _CM\) and \(\nu \Phi =\exists \) over self-sustaining parts.
The counit \(\pi ^*\forall M\le M\) of C13, read at one closed \(P\), is \(\mu \Phi \le P\): leastness.
Then \(\Phi \mu \Phi \le \Phi P\le P\) for each closed \(P\), so \(\Phi \mu \Phi \le \mu \Phi \). Hence \(\Phi \mu \Phi \) is closed and \(\mu \Phi \le \Phi \mu \Phi \). By antisymmetry, \(\Phi \mu \Phi =\mu \Phi \).
Dually, the unit of \(\exists \dashv \pi ^*\) gives \(P\le \nu \Phi \) for self-sustaining \(P\), and \(\Phi \nu \Phi =\nu \Phi \).
C16 (finite kinds, induction, Peano). With \(\Phi (\mathcal X)=\{\varnothing \}\cup \{K\sqcup 1:\ K\in \mathcal X\}\), the finite kinds are \(\mu \Phi \), and induction is the counit of C15. Let \(\mathbb N\) be their sizes, with \(0=|\varnothing |\) and \(S|K|=|K\sqcup 1|\).
\(0\neq Sn\): \(K\sqcup 1\) has the mark \((\text {second},\ast )\) and \(\varnothing \) has none (C9).
\(S\) is injective: given \(f:K\sqcup 1\cong L\sqcup 1\) with \(f(\ast )\neq \ast \), compose with the swap \(\sigma \) exchanging \(f(\ast )\) and \(\ast \) (C3). Now \(f\) and \(f^{-1}\) both fix \(\ast \), and their restrictions are mutually inverse, so \(K\cong L\) (C10).
\(Sn\neq n\): \(0\neq S0\), and \(Sn\neq n\) gives \(SSn\neq Sn\) by injectivity. Apply induction.
C17 (\([0,S]\) is an isomorphism). The map \([0,S]:1\sqcup \mathbb N\to \mathbb N\) is onto, since \(\mu \Phi \le \Phi \mu \Phi \) says every finite kind is \(\varnothing \) or \(K\sqcup 1\). It is one-to-one by C16. Its inverse, the coalgebra that reads “zero, or successor of which number”, gives unique decomposition.
C18 (the closed graph is a subalgebra). Place the two algebra structures side by side on \(\mathbb N\times A\) (C2):
C19 (initiality).
Functional. The set \(Q\) of \(n\) with exactly one partner in \(G\) is closed, by unique decomposition (C17). At \(0\), no pair \((Sn',\cdot )\) intervenes, so the partner is \(a\). At \(Sn\), \(Sn'=Sn\) forces \(n'=n\), so the partner is \(s(x_n)\). By C15, \(Q=\mathbb N\).
Existence. \(G\) is the graph of a map \(h\), and \(G=\Phi G\) gives \(h(0)=a\) and \(h(Sn)=s(h(n))\).
Uniqueness. The graph \(H\) of any other algebra map is closed, so \(G\subseteq H\). If \((n,y)\in H\) and \((n,x)\in G\subseteq H\), then \(y=x\), since \(H\) is single-valued. So \(H=G\).
C20 (addition, multiplication, laws). Sizes are isomorphism classes, so an isomorphism of kinds is \(a=a\) on sizes.
Each pair of equations has exactly one solution, by C19. Commutativity is C3, associativity is regrouping (C4), and distributivity is C12.
C21 (infinity). A mark of \(\nu (1\sqcup X)\) is determined by the tags read off at each unfolding, which is C5 applied to the places “step \(1\), step \(2\), …”. So
C22 (judgements). \(a:A\) is the mark \(a\) placed in a place of kind \(A\). A context is a row of places. Judgemental equality \(a\equiv b\) is S at the level of judgements. Substitution is (i), and weakening is \(\pi ^*\) (C13).
C23 (\(\beta \) and \(\eta \) are the triangle identities). Each type former is an adjunction already derived.
| Former | Adjunction | Source |
| \(\times \) | \(\Delta \dashv \times \) | C2, C4 |
| \(\to \) | \(-\times A\dashv A\to -\) | C11 |
| \(\Sigma \), \(\Pi \) | \(\exists \dashv \pi ^*\dashv \forall \) | C13 |
| \(+\) | \(\sqcup \dashv \Delta \) | C9 |
| \(\mathbb N\) | initial algebra | C15–C19 |
| coinductive types | terminal coalgebra | C21 |
An adjunction has two triangle identities, and these are \(\beta \) and \(\eta \). For \(\to \), the unit is \(\eta _X:X\to (A\to X\times A)\), \(x\mapsto \lambda a.(x,a)\), and the counit is \(\mathrm {ev}:(A\to B)\times A\to B\).
For \(\times \), \(\beta \) is \(\pi _1(a,b)\equiv a\) and \(\eta \) is \((\pi _1p,\pi _2p)\equiv p\). In every case \(\beta \) is (i) and \(\eta \) is (ii).
C24 (identity types). \(\mathrm {Id}_A=\Sigma _\Delta 1\), some along the diagonal (C13 at \(\Delta \)).
\(\mathrm {refl}\) is the unit.
\(J\) is the adjunction \(\mathrm {Hom}(\mathrm {Id}_A,C)\cong \prod _aC(a,a)\).
The computation rule \(J(d)(\mathrm {refl}_a)\equiv d(a)\) is the first triangle, (i).
The second triangle says that a map out of \(\mathrm {Id}_A\) equals the \(J\)-extension of its value at \(\mathrm {refl}\). In Martin-Löf type theory this holds only up to identification, as a consequence of \(J\), and not judgementally. This is where the type theories part.
C25 (the interval is the shape of \(a=a\)). The interval \(I\) has the two places \(0,1\) of C2 joined by one link. The operations \(\wedge ,\vee ,\neg \) of C6–C8 extend to it, giving a De Morgan algebra with connections \(i\wedge j\) and reversal \(1-i\). Put
C26 (function extensionality is currying). Given \(h:\prod _x\mathrm {Path}(f\,x,g\,x)\), regroup the places \(I\) and \(A\) (C11):
C27 (univalence is (ii) on the universe). Read a type through its equivalences, and place a path from an equivalence. The second triangle on the universe is
C28 (five type theories, one choice).
| Theory | (i) | Where (ii) holds | Consequence |
| intensional MLTT | judgements, \(J\) | judgements only (\(\eta \)) | funext not derivable |
| extensional MLTT | judgements | identity, by reflection | funext; UIP, level \(0\) |
| cubical (CCHM) | judgements | paths, maps out of \(I\) | funext (C26), univalence (C27) |
| directed (Riehl–Shulman) | judgements | maps out of \(\mathbb 2\) | hom types, Segal and Rezk types |
| HoTT Book | judgements, \(J\) | universe, by axiom | univalence, hence funext |
Intensional. \(J\) transports along \(\mathrm {refl}\) but gives no path in \(A\to B\) from paths in \(B\). Function extensionality is not derivable, and it holds in the extensional and univalent extensions.
Extensional. From \(h:\prod _xf\,x=g\,x\), reflection gives \(f\,x\equiv g\,x\) for a variable \(x\). Substituting under \(\lambda \) gives \(\lambda x.f\,x\equiv \lambda x.g\,x\), and \(\eta \) gives \(f\equiv g\), so \(\mathrm {refl}_f:f=g\). The cost is that identity proofs become unique, which cuts the identity tower at level \(0\), and type checking becomes undecidable.
Directed. Currying along \(\mathbb 2\) gives pointwise extensionality for hom types. In Riehl and Shulman’s system, extensionality for extension types is taken as an axiom.
The five are one source with (ii) placed at different levels: in judgements only, forced into identity by reflection, unfolded along an interval, or imposed on the universe.
C29 (the converse: every type theory returns the floor).
| Floor | In any of the type theories |
| S | \(\beta \), \(\eta \) (C23) and the computation rule of \(J\) (C24) |
| Yoneda | based path induction \(J\) |
| \(\Delta \), \(\sigma \) | \(\lambda x.(x,x)\), \(\lambda (x,y).(y,x)\); \(\sigma \sigma \equiv \mathrm {id}\) by \(\beta \) and \(\eta \) |
| C4, C5 | \(\eta \) for pairs; for functions, C26, reflection or univalence |
| C6–C8 | propositions (\((-1)\)-types), truncation \(\|A\|\) |
| C13 | \(\Sigma \), weakening, \(\Pi \) |
| C15–C19 | the eliminator of \(\mathbb N\): induction and recursion |
| C21 | conatural numbers |
| categories, \((\infty ,n)\) | Segal and Rezk types |
C30 (one statement).
A proof assistant mechanises the judgements of C22. Its kernel checks each step by the two triangle identities of S, as conversion. Libraries such as Lean’s mathlib are built from type formers that are already corollaries (C13, C15–C19, C23, C24). What separates one system from another is where the second identity (ii) is made available (C28): in judgements only, by reflection, by an interval, on the universe, by a quotient, or by axioms of set theory. Lean obtains function extensionality from a quotient, obtains univalence for propositions as propext, cuts the identity tower at level \(0\) by proof irrelevance, and becomes Boolean through choice.
C31 (a kernel is C22 run by a machine). A proof is a term, that is, a placement \(t:A\) (C22). Checking it means deciding judgemental equality \(\equiv \), which the kernel does with
| Conversion | What it checks | Source |
| \(\beta \) | reading a placement | (i), C23 |
| \(\eta \) | placing what is read | (ii), C23 |
| \(\delta \) | unfolding a definition | \(a=a\) on names (C1) |
| \(\iota \) | a recursor applied to a constructor | initiality (C19) |
Propositions are types and proofs are their marks, which is LG10 read through C23.
C32 (Lean’s core, piece by piece).
Primitive of Lean 4 | What it is | Source |
\(\Pi \)-types, \(\lambda \), application | right adjoint of weakening | C13, C23 |
inductive types, recursors | initial algebras, initiality | C15–C19 |
structures with \(\eta \) | products with (ii) judgemental | C4, C23 |
Eq and Eq.rec | identity type and \(J\) | C24 |
Prop, proof irrelevance | \((-1)\)-types, judgementally truncated | S2, IC9 |
Quot, Quot.sound | related marks become equal | (ii) for a relation |
propext | \((p\leftrightarrow q)\to p=q\) | (ii) on the universe at level \(-1\) (C27) |
Classical.choice | a mark from inhabitation | LG3 |
|
The three axioms of Lean 4 are propext, Quot.sound and Classical.choice. Each is a placement of (ii) or of choice at a definite level.
C33 (function extensionality from a quotient). In Lean 4, funext is a theorem, not an axiom. Given \(h:\forall x,\ f\,x=g\,x\):
form the quotient of \((x:A)\to B\,x\) by pointwise equality;
Quot.sound\(h\) identifies the classes of \(f\) and \(g\);
evaluation lifts to the quotient, because pointwise-equal functions have equal values;
applying the lifted evaluation to both classes and using \(\eta \) returns \(f=g\).
This is C5 obtained a fifth way. (ii) is supplied by declaring related marks equal, and evaluation, which is (i), carries it back to functions.
C34 (proof irrelevance cuts the tower at level \(0\)). Eq lives in Prop, and any two proofs of a proposition are judgementally equal. So any \(p,q:a=b\) satisfy \(p\equiv q\), which is uniqueness of identity proofs. Every type is a set in the sense of IC9. Univalence cannot be added, since it would identify the two distinct automorphisms of \(\mathbf 2\) with distinct paths in the universe, while UIP makes all such paths equal. Definitional proof irrelevance together with an impredicative Prop is also known to break normalisation in corner cases (Abel–Coquand).
C35 (propext is univalence for propositions). For \((-1)\)-types, an equivalence is a pair of implications. C27 at level \(-1\) reads
C36 (excluded middle from choice). In Lean 4 core, Classical.em is proved from choice, propext and funext, which is Diaconescu’s argument. So \(\Omega \) is Boolean (LG3), and Lean’s logic is the first row of LG11.
C37 (mathlib’s mathematics, read as corollaries).
| mathlib | Construction | Source |
| Set \(\alpha \) \(:=\alpha \to \) Prop | parts as maps to truth values | C6 |
| order classes, lattices | \(\le \), \(\sqcap \), \(\sqcup \), complements | C6–C8 |
| \(\mathbb N\) | inductive, Nat.rec | C15–C19 |
| \(\mathbb Z\) | two tagged copies, ofNat, negSucc | C9 |
| \(\mathbb Q\) | reduced numerator and denominator | normal form of pairs |
| \(\mathbb R\) | completion of Cauchy sequences, a quotient | C33, V3 |
| \(\mathbb C\) | \(\mathbb R\times \mathbb R\) with \(J^2=-1\) | D9, D10 |
| category theory | yoneda, Adjunction | D0, FL4 |
Each definition in the library is a choice of presentation for an object already fixed by a universal property (V1), so the library and the chain agree up to unique isomorphism.
C38 (other assistants: one table).
System | Base | Where (ii) lives |
Lean 4 | CIC, impredicative Prop | quotients, propext; UIP by proof irrelevance |
Rocq (Coq) | CIC | judgements; funext and propext as optional axioms |
Agda | intensional MLTT | judgements; pattern matching gives axiom K by default |
Cubical Agda | cubical type theory | interval: funext and univalence are theorems |
Isabelle/HOL, HOL Light | classical higher-order logic | extensionality and choice as axioms |
Metamath (set.mm) | first-order ZFC | extensionality axiom of set theory |
Mizar | Tarski–Grothendieck set theory | extensionality axiom of set theory |
|
The set-theoretic systems place (ii) as the axiom of extensionality, which is C5 for membership. The higher-order systems place it as an axiom on functions. The cubical system obtains it by currying (C26). Lean obtains it from a quotient (C33).
C39 (the converse). Each system returns the floor: \(\mathrm {refl}\) and its eliminator give \(a=a\) and \(J\); the recursor of \(\mathbb N\) gives induction and recursion; \(\eta \) gives C4; its form of (ii) gives C5. From these, C1–C21 follow as before (C29).
C40 (one statement). A formal library is S run by a machine, with a chosen level for (ii).
Remark 13.1 (CIC and HOL in the classification). Both are already points of C28.
CIC (Lean, Rocq) is the intensional base of C24, with inductive types as initial algebras (C15–C19) and an impredicative \(\mathsf {Prop}\) at level \(-1\) (S2). Rocq keeps (ii) in judgements only, and adds funext or propext as axioms when needed. Lean obtains (ii) from quotients (C33) and from \(\texttt {propext}\) (C35), and is cut at level \(0\) by proof irrelevance (C34).
HOL (Isabelle/HOL, HOL Light) is simple type theory, with only the formers \(\to \) and \(\times \) (C11, C23). Its type of propositions is \(\mathsf {bool}\), the two places \(\mathbf 2\) of C2. (ii) is an extensionality axiom on functions, which is the extensional cell of C28. Hilbert’s choice makes it Boolean (LG3), as in C36.
CIC is intensional, inductive and impredicative at level \(-1\). HOL is the \(\to \)-fragment with (ii) as an axiom and \(\Omega =\mathbf 2\). Both are S with (ii) placed at a different level.