Prerequisites. Direct starred prerequisites: none. No later core chapter depends on this route.
In a Russell universe, 𝐴:U𝑖 licenses the type judgment 𝐴𝗍𝑦𝑝𝑒 directly. That economy hides a distinction useful to metatheory and implementation: a program may manipulate a code for a type while a separate operation computes the type denoted by that code. A Tarski universe keeps the two roles apart. Its two judgment forms are 𝑎:U𝑖,𝖤𝗅(𝑎)𝗍𝗒𝗉𝖾.
The obstruction is already visible in one hand calculation. We want a code 𝑒:=⌜Π⌝(⌜ℕ⌝,𝑛.⌜ℕ⌝):U0 and a separate computation 𝖤𝗅(𝑒)≡ℕ→ℕ as types. Ordinary Π-formation proves only that ℕ→ℕ is a type; it neither constructs 𝑒 nor supplies the decoding equality. The rules below must account for both steps. The corner brackets ⌜−⌝ denote Tarski constructor codes in this chapter. They share a glyph with the representation brackets of chapter 23, but the two roles use distinct notation macros.
Codes and their decoding
The calculus in this chapter is a presentation alternative to the Russell calculus of chapter 29, not an extension containing both membership rules at once. It has the same ordinary type formers through chapter 28.
Each U𝑖 is a type. A code decodes to a type, and equal codes decode to equal types:
Γ𝖼𝗍𝗑
Γ⊢U𝑖𝗍𝗒𝗉𝖾
TU-Form
Γ⊢𝑎:U𝑖
Γ⊢𝖤𝗅(𝑎)𝗍𝗒𝗉𝖾
TU-El
Γ⊢𝑎≡𝑎′:U𝑖
Γ⊢𝖤𝗅(𝑎)≡𝖤𝗅(𝑎′)𝗍𝗒𝗉𝖾
TU-El-Eq
Rule TU-Form makes each U𝑖 a type; TU-El then turns a code at that level into its decoded type. The hierarchy code and its decoding are separate rules:
Γ𝖼𝗍𝗑𝑗<𝑖
Γ⊢⌜U𝑗⌝:U𝑖
TU-Hier
Γ𝖼𝗍𝗑𝑗<𝑖
Γ⊢𝖤𝗅(⌜U𝑗⌝)≡U𝑗𝗍𝗒𝗉𝖾
TU-Hier-El
The dependent code constructors are
Γ⊢𝑎:U𝑖Γ,𝑥:𝖤𝗅(𝑎)⊢𝑏:U𝑖
Γ⊢⌜Π⌝(𝑎,𝑥.𝑏):U𝑖
TU-Pi
Γ⊢𝑎:U𝑖Γ,𝑥:𝖤𝗅(𝑎)⊢𝑏:U𝑖
Γ⊢⌜Σ⌝(𝑎,𝑥.𝑏):U𝑖
TU-Sig
Γ⊢𝑎:U𝑖Γ,𝑥:𝖤𝗅(𝑎)⊢𝑏:U𝑖
Γ⊢⌜𝖶⌝(𝑎,𝑥.𝑏):U𝑖
TU-W
Their decoding equations are judgmental rules:
Γ⊢𝑎:U𝑖Γ,𝑥:𝖤𝗅(𝑎)⊢𝑏:U𝑖
Γ⊢𝖤𝗅(⌜Π⌝(𝑎,𝑥.𝑏))≡∏𝑥:𝖤𝗅(𝑎)𝖤𝗅(𝑏)𝗍𝗒𝗉𝖾
TU-Pi-El
Γ⊢𝑎:U𝑖Γ,𝑥:𝖤𝗅(𝑎)⊢𝑏:U𝑖
Γ⊢𝖤𝗅(⌜Σ⌝(𝑎,𝑥.𝑏))≡∑𝑥:𝖤𝗅(𝑎)𝖤𝗅(𝑏)𝗍𝗒𝗉𝖾
TU-Sig-El
Γ⊢𝑎:U𝑖Γ,𝑥:𝖤𝗅(𝑎)⊢𝑏:U𝑖
Γ⊢𝖤𝗅(⌜𝖶⌝(𝑎,𝑥.𝑏))≡𝖶𝑥:𝖤𝗅(𝑎)𝖤𝗅(𝑏)𝗍𝗒𝗉𝖾
TU-W-El
The coproduct code and its decoding are
Γ⊢𝑎:U𝑖Γ⊢𝑏:U𝑖
Γ⊢⌜+⌝(𝑎,𝑏):U𝑖
TU-Sum
Γ⊢𝑎:U𝑖Γ⊢𝑏:U𝑖
Γ⊢𝖤𝗅(⌜+⌝(𝑎,𝑏))≡𝖤𝗅(𝑎)+𝖤𝗅(𝑏)𝗍𝗒𝗉𝖾
TU-Sum-El
The four nullary code rules are
Γ𝖼𝗍𝗑
Γ⊢⌜𝟎⌝:U𝑖
TU-Void
Γ𝖼𝗍𝗑
Γ⊢⌜𝟏⌝:U𝑖
TU-Unit
Γ𝖼𝗍𝗑
Γ⊢⌜𝟐⌝:U𝑖
TU-Bool
Γ𝖼𝗍𝗑
Γ⊢⌜ℕ⌝:U𝑖
TU-Nat
Their decoding rules are
Γ𝖼𝗍𝗑
Γ⊢𝖤𝗅(⌜𝟎⌝)≡𝟎𝗍𝗒𝗉𝖾
TU-Void-El
Γ𝖼𝗍𝗑
Γ⊢𝖤𝗅(⌜𝟏⌝)≡𝟏𝗍𝗒𝗉𝖾
TU-Unit-El
Γ𝖼𝗍𝗑
Γ⊢𝖤𝗅(⌜𝟐⌝)≡𝟐𝗍𝗒𝗉𝖾
TU-Bool-El
Γ𝖼𝗍𝗑
Γ⊢𝖤𝗅(⌜ℕ⌝)≡ℕ𝗍𝗒𝗉𝖾
TU-Nat-El
The representative dependent congruence scheme is
Γ⊢𝑎:U𝑖Γ,𝑥:𝖤𝗅(𝑎)⊢𝑏≡𝑏′:U𝑖
Γ⊢⌜Π⌝(𝑎,𝑥.𝑏)≡⌜Π⌝(𝑎,𝑥.𝑏′):U𝑖
TU-Cong
The same scheme applies to every classified argument of every code constructor. When a dependent domain changes, TU-El-Eq and context conversion first put the two bodies in one binder context. There is no eliminator asserting that every element of U𝑖 has one of the displayed constructor shapes.
The code 𝑒:=⌜Π⌝(⌜ℕ⌝,𝑛.⌜ℕ⌝):U0 has decoding 𝖤𝗅(𝑒)𝑇𝑈−𝑃𝑖−𝐸𝑙≡∏𝑛:𝖤𝗅(⌜ℕ⌝)𝖤𝗅(⌜ℕ⌝)𝑡𝑤𝑜𝑢𝑠𝑒𝑠𝑜𝑓𝑇𝑈−𝑁𝑎𝑡−𝐸𝑙≡ℕ→ℕ. Thus 𝜆𝑛.𝑛:𝖤𝗅(𝑒) by conversion. The code 𝑒 and the type 𝖤𝗅(𝑒) are not interchangeable syntax: the former is data at U0; the latter classifies programs.
The nullary pairs are used in the same way. From a well-formed context, TU-Void/TU-Void-El, TU-Unit/TU-Unit-El, TU-Bool/TU-Bool-El, and TU-Nat/TU-Nat-El derive the four base codes and identify their decodings with 𝟎,𝟏,𝟐,ℕ, respectively.
Closure under substitution
The binding signature gives 𝖤𝗅(𝑎) unary nonbinding arity and the product, sum, and W-codes one bound argument in their second component. Capture-free substitution is therefore structural.
If Γ,𝑥:𝐴,Δ⊢𝑎:U𝑖 and Γ⊢𝑠:𝐴, then Γ,Δ[𝑠/𝑥]⊢𝑎[𝑠/𝑥]:U𝑖and(𝖤𝗅(𝑎))[𝑠/𝑥]=𝖤𝗅((𝑎[𝑠/𝑥])). The second conjunct is literal identity of raw expressions; every strict decoding equality is also stable as a judgmental equality under this substitution.
Proof. Use the substitution theorem for the extended binding signature. The only new binder case is representative. Choose 𝑦 fresh for 𝑠: ⌜Π⌝(𝑎,𝑦.𝑏)[𝑠/𝑥]=⌜Π⌝(𝑎[𝑠/𝑥],𝑦.𝑏[𝑠/𝑥]),(𝖤𝗅(⌜Π⌝(𝑎,𝑦.𝑏)))[𝑠/𝑥]=𝖤𝗅((⌜Π⌝(𝑎,𝑦.𝑏)[𝑠/𝑥]))=𝖤𝗅(⌜Π⌝(𝑎[𝑠/𝑥],𝑦.𝑏[𝑠/𝑥])). For stability of the decoding equality, the corresponding judgmental calculation is (𝖤𝗅(⌜Π⌝(𝑎,𝑦.𝑏)))[𝑠/𝑥]≡∏𝑦:𝖤𝗅(𝑎[𝑠/𝑥])𝖤𝗅(𝑏[𝑠/𝑥])≡𝖤𝗅(⌜Π⌝(𝑎[𝑠/𝑥],𝑦.𝑏[𝑠/𝑥])). For Σ, instantiate TU-Sig and TU-Sig-El in place of TU-Pi and TU-Pi-El; for W, use TU-W and TU-W-El (two lines each). Coproduct uses the two nonbinding induction hypotheses, while hierarchy and nullary codes are unchanged (one line each). Applying substitution to the displayed decoding derivation proves its judgmental stability in every case. ◻
The erasure𝐸:𝖳𝑇→𝖳𝑅 sends 𝖤𝗅(𝑎) to 𝐸(𝑎), each code constructor to the corresponding Russell type former, and is homomorphic on ordinary terms and contexts.
The reverse decoration𝑄 is defined on a chosen Russell derivation. A derivation of 𝐴:U𝑖 becomes a code derivation; a final U-Pi, for example, becomes TU-Pi. A type formed by final U-El becomes 𝖤𝗅(𝑄(𝐴)). Direct ordinary type formation remains ordinary type formation. Structural rules act homomorphically.
Two conclusions are comparison-aligned when they have the same judgment form and the following data agree. Their contexts have the same declarations in the same order, with corresponding declaration types judgmentally equal after the preceding context conversions. For a type judgment, the two subjects are equal as types. For a term judgment, the two subjects are judgmentally equal at the corresponding, equal classifiers. For a type- or term-equality judgment, apply the preceding requirement to both endpoints and, in the term case, to the classifier. This definition compares conclusions, not proof trees.
erasure preserves derivability and commutes literally with substitution;
decoration of a chosen derivation preserves derivability, and 𝐸(𝑄(𝐷)) has the literal conclusion of 𝐷;
after fixing the decoration choices, corresponding conclusions in 𝑄(𝐸(𝐷𝑇)) and 𝐷𝑇 are aligned in the sense defined above.
Item (3) uses the judgmental decoding equations of definition 75.1. A claim that 𝑄 is independent of arbitrary Russell derivations additionally requires a coherence theorem equating the decorations produced by different final-rule choices; it is not a consequence of items (1)–(3).
Proof.Proof idea. The three clauses use three different induction hypotheses. For (1), every immediate Tarski premise erases to a derivable Russell premise, and erasure commutes with each substitution in the final rule. For (2), every immediate Russell premise has a decorated derivation whose erasure has the premise’s literal conclusion. For (3), every immediate round-trip conclusion is comparison-aligned with its Tarski premise. We verify the representative formation, binder, substitution, conversion, and mixed decoding cases.
For (1), consider TU-Pi. The premise induction hypotheses give 𝐸(Γ)⊢𝐸(𝑎):U𝑖,𝐸(Γ),𝑥:𝐸(𝑎)⊢𝐸(𝑏):U𝑖. Rule U-Pi derives 𝐸(Γ)⊢∏𝑥:𝐸(𝑎)𝐸(𝑏):U𝑖, which is the erasure of ⌜Π⌝(𝑎,𝑥.𝑏). Under a binder, the required raw equation is 𝐸(𝑏[𝑠/𝑥])=𝐸(𝑏)[𝐸(𝑠)/𝑥]. It follows by the same fresh-binder structural induction as lemma 75.3; in a decoded binder, that lemma supplies the literal equation for 𝖤𝗅. The same calculation aligns the substituted contexts. For the conversion case TU-El-Eq, the premise induction hypothesis gives 𝐸(Γ)⊢𝐸(𝑎)≡𝐸(𝑎′):U𝑖, and U-El-Eq gives 𝐸(Γ)⊢𝐸(𝑎)≡𝐸(𝑎′)𝗍𝗒𝗉𝖾, exactly the erased conclusion. A decoding rule such as TU-Pi-El erases to reflexivity of the Russell Π-type. The Σ-, W-, coproduct-, hierarchy-, and nullary cases instantiate these displays with their named formation and decoding rules (one to three lines each); structural and ordinary term rules are homomorphic. This proves (1).
For (2), induct on the chosen Russell derivation with the literal conclusion hypothesis for every premise. A final U-Pi decorates its premises and applies TU-Pi; erasing the result returns the same raw Π-expression. A final U-El has premise Γ⊢𝐴:U𝑖. Decoration produces a code 𝑄(𝐴) and concludes, by TU-El, 𝑄(Γ)⊢𝖤𝗅(𝑄(𝐴))𝗍𝗒𝗉𝖾. Erasure returns the literal Russell conclusion Γ⊢𝐴𝗍𝗒𝗉𝖾. By contrast, a chosen derivation ending in ordinary Π-formation remains ordinary Π-formation. Thus two derivations of one Russell type may decorate by different routes, but each chosen route separately has the claimed erasure. Conversion uses TU-El-Eq; the remaining closure and structural rules instantiate this induction schema (one line each). This proves (2).
For (3), induct on 𝐷𝑇 with comparison alignment as the induction hypothesis for every premise. In a TU-Pi case, TU-Cong combines the aligned domain and body codes after the binder-context conversion supplied by TU-El-Eq. The substitution case uses the literal identity (𝖤𝗅(𝑏))[𝑠/𝑥]=𝖤𝗅((𝑏[𝑠/𝑥])) from lemma 75.3, so both derivations enter the same converted binder context. In a TU-El-Eq case, congruence of 𝖤𝗅 turns the aligned code endpoints into equal decoded types.
The mixed case is a strict decoding rule. For example, TU-Pi-El erases to reflexivity of ∏𝑥:𝐸(𝑎)𝐸(𝑏). Syntax-directed decoration may rebuild that reflexivity by direct Π-formation rather than by TU-Pi-El. The two left endpoints are nevertheless equal by TU-Pi-El; the two right endpoints are aligned by the premise induction hypotheses, and dependent- product congruence supplies the required context conversion. Hence the conclusions are comparison-aligned even though their final rules differ. The other strict decodings instantiate this calculation with their named rules (two lines each); all remaining cases are homomorphic. This proves (3). ◻
The exact equality strength must remain visible. With only propositional decoding laws, the last composite is at best propositionally related to the input, requires transports at every dependent binder, and needs coherence between composite transports. This chapter has not yet introduced identity types, so it neither states nor imports such a theorem. Likewise, decoding injectivity is a separate property; it does not follow from the rules above.
At the category-with-families signature of Kovács, a Coquand universe has decoding 𝖤𝗅 and an inverse coding operation 𝖢𝗈𝖽𝖾, natural in context substitution. A Russell universe further imposes 𝖳𝗆𝑗Γ(𝑈𝑖𝑗𝑝)=𝖳𝗒𝑖Γ,𝖤𝗅(𝑡)=𝑡, so the code/decode comparison is strictly natural [Kov22]. These equations are the source-level coherence condition behind derivation-independent decoration. The raw calculus of definition 75.1 has no 𝖢𝗈𝖽𝖾 operation or naturality law, so this chapter does not import that stronger conclusion.
A type may be obtained by decoding a code or by a direct ordinary formation rule. Erasure forgets which path was taken. Decorating the erased judgment therefore cannot recover the original path without a convention. The syntax-directed convention in theorem 75.6 fixes a path; derivation-independent recovery would have to prove the two paths coherent.
What the formulation buys
Tarski codes expose the input of a generic decoder. They are useful for interpreters, generic programming, and syntactic metatheory because code construction can be inspected without asserting that the codes exhaust all types. They do not by themselves yield an eliminator for arbitrary universe elements, decidable code equality, injective decoding, or normalization. Kovács’s inductive–recursive semantic universes illustrate a stronger setting in which codes and decoding are defined together [Kov22]; those semantic assumptions are not part of the present syntax.
★★★ Replace the product decoding equation by a chosen definitional isomorphism. Define weak application and abstraction from its two maps. Derive beta from one round trip, then list the additional coherence diagrams needed for nested dependent codes.
Begin with the two-route reconstruction in exercise 75.4, then calculate one tagged-code collision in exercise 75.5. Finish by running the finite checker and replaying its binder-depth mutation in exercise 75.6.
★★☆ In context 𝑎:U0, compare 𝑄(𝐸(𝑎)) and 𝑎. Then compare the two possible decorations of the Russell type 𝐸(𝑎): one following U-El, and one following an assumed direct formation derivation. Identify the extra coherence equation required to equate them.
★★★ Under the inaccessible-cardinal assumptions of lemma 74.14, put 𝐶𝑖:=𝑉𝜅𝑖×{0,1} and 𝖤𝗅𝑖(𝐴,𝑏):=𝐴. Interpret every code constructor by applying the corresponding set operation and attaching tag 0. Check the hierarchy and dependent-product formation and decoding rules. Then exhibit two distinct codes with the same decoded type, and explain why this model refutes decoding injectivity without refuting theorem 75.6.
★★★Practical project.tarski-universe-decoder Run this chapter’s Kappa artifact. Add a dependent code whose body mentions its bound variable, check its decoded scope, and replay the mutation that forgets to shift that body under a binder. State why passing the finite round-trip corpus does not prove theorem 75.6.
Martin-Löf’s predicative universe is historically presented through a reflection between a universe’s objects and types [ML75]. The explicit code-and-decoding split is the Tarski presentation. Generalized hierarchies may require inductive–recursive codes and further strictness hypotheses [Kov22]; those hypotheses explain why the comparison theorem above records its equality assumptions rather than suppressing them.