Three binders have appeared with three separate typing rules. In the simply typed calculus of chapter 2, 𝜆𝑥 :𝐴. 𝑥 abstracts a term variable. The uniform PTS syntax writes the same abstraction as 𝜆(𝑥 :𝐴). 𝑥. In System F (chapter 5), Λ𝑋.𝜆(𝑥:𝑋).𝑥:∀𝑋.𝑋→𝑋 abstracts a type variable in a term. In 𝐹𝜔 (chapter 9), the expression 𝜆𝑋 ::𝖳𝗒. 𝑋 →𝑋 abstracts a type variable in a type operator. The three rules differ only in the classes of the domain, the body, and the resulting product. A uniform product rule must therefore expose all three classes; one structural argument can then cover every admitted triple.
One product rule with three classifiers
Write ∗ for the class of ordinary types and ◻ for the class of kinds. These two symbols are sorts: primitive classifiers that may occur on the right of a typing judgment. A product whose domain has sort 𝑠1, whose codomain has sort 𝑠2, and which itself has sort 𝑠3 is controlled by the triple (𝑠1,𝑠2,𝑠3).
Let 𝐴 : ∗ and 𝖭𝖺𝗍 : ∗. The following products separate the baseline from two optional directions. ∏𝑎:𝐴𝐴:∗uses (∗,∗,∗),∏𝑋:∗𝑋:∗uses (◻,∗,∗),∏𝐹:∗∗:◻uses (◻,◻,◻). The second product classifies polymorphic terms. The third classifies type operators. A fourth possibility, ( ∗,◻,◻), allows a type or kind to depend on a term. For example, the declaration 𝖵𝖾𝖼 :∏𝑛:𝖭𝖺𝗍 ∗ requires that fourth triple. The word direction records dependency: it does not assert that every well-sorted body mentions its bound variable.
Referenced from 2 locations
The examples force a syntax in which terms, types, and kinds are not separate grammatical categories.
Fix a set 𝐶 of constants. A pure-type-system specification, abbreviated PTS specification, is a triple S =(𝑆,A,R) consisting of:
a set 𝑆 ⊆𝐶 of sorts;
a set A ⊆𝐶 ×𝑆 of axioms, written 𝑐 :𝑠;
a set R ⊆𝑆 ×𝑆 ×𝑆 of product triples.
For every 𝑠 ∈𝑆, fix an infinite set 𝑉𝑠 of variables. The sets 𝐶,𝑉𝑠 are pairwise disjoint, and 𝑉:=⋃𝑠∈𝑆𝑉𝑠. Here R is the PTS product-triple set; it is unrelated to the rule sets and reducibility candidates denoted by the same calligraphic letter in earlier chapters. The pseudo-terms of S are generated by 𝑀,𝑁,𝐴,𝐵::=𝑥∣𝑐∣𝑀𝑁∣𝜆(𝑥:𝐴).𝑀∣∏𝑥:𝐴𝐵. Here 𝑥 ∈𝑉 and 𝑐 ∈𝐶. The binder 𝑥 binds in 𝑀 or 𝐵, respectively. Expressions identify alpha-equivalent pseudo-terms. We write 𝑀[𝑁/𝑥] for capture-avoiding replacement of the free occurrences of 𝑥 in 𝑀 by 𝑁, renaming bound variables first when necessary. When 𝑥 ∉FV(𝐵), write 𝐴 →𝐵 for ∏𝑥:𝐴𝐵. Compatible beta-reduction is the least relation closed under every pseudo-term constructor and containing 𝑋(𝜆(𝑥:𝐴).𝑀)𝑁⟶𝛽𝑀[𝑁/𝑥]Beta. Write ⟶∗𝛽 for its reflexive-transitive closure and 𝑀 =𝛽𝑁 when 𝑀 and 𝑁 are related by the equivalence relation it generates.
Referenced from 5 locations
Allowing 𝑐 :𝑠 with 𝑐 ∈𝐶 is intentional. It is the general PTS schema of [Bar92], not a later signature extension, and permits a base-type constant such as 𝖭𝖺𝗍 : ∗. The common sort-only specialization has A ⊆𝑆 ×𝑆. The lambda-cube instances below use that specialization with the sole axiom ∗ :◻; adding a base-type constant changes the signature but not its cube vertex.
The typography of a name does not determine whether it is a constant or a variable. Thus a displayed family name such as 𝖵𝖾𝖼 may denote a member of some 𝑉𝑠; its context declaration must then be justified by Var. It may occur in A only when its declared type is a sort. This distinction prevents a family declaration such as 𝖵𝖾𝖼 :∏𝑛:𝖭𝖺𝗍 ∗ from bypassing Prod.
In this chapter, the letter 𝑀 ranges over arbitrary PTS expressions, not merely program terms.
For a specification S =(𝑆,A,R), the judgment Γ ⊢S𝑀 :𝐴 is generated by the following rules. Contexts are finite lists of declarations with distinct subjects. 𝑐:𝑠∈A⋅⊢S𝑐:𝑠AxΓ⊢S𝐴:𝑠𝑥∈𝑉𝑠𝑥∉dom(Γ)Γ,𝑥:𝐴⊢S𝑥:𝐴Var Γ⊢S𝑀:𝐴Γ⊢S𝐵:𝑠𝑥∈𝑉𝑠𝑥∉dom(Γ)Γ,𝑥:𝐵⊢S𝑀:𝐴Weak Γ⊢S𝐴:𝑠1Γ,𝑥:𝐴⊢S𝐵:𝑠2(𝑠1,𝑠2,𝑠3)∈RΓ⊢S∏𝑥:𝐴𝐵:𝑠3Prod Γ,𝑥:𝐴⊢S𝑀:𝐵Γ⊢S∏𝑥:𝐴𝐵:𝑠Γ⊢S𝜆(𝑥:𝐴).𝑀:∏𝑥:𝐴𝐵Lam Γ⊢S𝐹:∏𝑥:𝐴𝐵Γ⊢S𝑁:𝐴Γ⊢S𝐹𝑁:𝐵[𝑁/𝑥]App Γ⊢S𝑀:𝐴Γ⊢S𝐵:𝑠𝐴=𝛽𝐵Γ⊢S𝑀:𝐵Conv The specification determines which instances of Prod exist; the other rules are fixed.
Referenced from 8 locations
The sort premise in Conv prevents an unclassified expression from being installed as a type. Removing it leaves a well-formed rule, but destroys the presupposition that the right side of every typing judgment is a sort or has a sort.
Let 𝑆={∗,◻},A={∗:◻},R={(∗,∗,∗),(◻,∗,∗)}. Write the short subderivations D𝑋:=∗:◻∈A⋅⊢S∗:◻Ax𝑋:∗⊢S𝑋:∗Var,D+𝑥𝑋:=D𝑋D𝑋𝑥≠𝑋𝑋:∗,𝑥:𝑋⊢S𝑋:∗Weak,DΠ:=D𝑋D+𝑥𝑋(∗,∗,∗)∈R𝑋:∗⊢S∏𝑥:𝑋𝑋:∗Prod,D𝗂𝖽:=D𝑋𝑋:∗,𝑥:𝑋⊢S𝑥:𝑋VarDΠ𝑋:∗⊢S𝜆(𝑥:𝑋).𝑥:∏𝑥:𝑋𝑋Lam,D∀𝗂𝖽:=∗:◻∈A⋅⊢S∗:◻AxDΠ(◻,∗,∗)∈R⋅⊢S∏𝑋:∗∏𝑥:𝑋𝑋:∗Prod. Every leaf of the required derivation is now visible: D𝗂𝖽D∀𝗂𝖽⋅⊢S𝜆(𝑋:∗).𝜆(𝑥:𝑋).𝑥:∏𝑋:∗∏𝑥:𝑋𝑋Lam. The outer product uses (◻, ∗, ∗); the inner product uses ( ∗, ∗, ∗). Thus the derivation records exactly which axis polymorphism requires.
Referenced from 5 locations
The application rule can now be read on a closed constructor. Put 𝐼:=𝜆(𝑋:∗).𝜆(𝑥:𝑋).𝑥, and work in the legal context 𝐴 : ∗,𝑎 :𝐴. Weakening the final judgment of example 60.4 into this context and applying App gives 𝐴:∗,𝑎:𝐴⊢S𝐼:∏𝑋:∗∏𝑥:𝑋𝑋𝐴:∗,𝑎:𝐴⊢S𝐴:∗𝐴:∗,𝑎:𝐴⊢S𝐼𝐴:∏𝑥:𝐴𝐴App. A second use of App derives 𝐴:∗,𝑎:𝐴⊢S𝐼𝐴𝑎:𝐴. The corresponding computation performs two compatible beta-steps: 𝐼𝐴𝑎𝐵𝑒𝑡𝑎⟶𝛽(𝜆(𝑥:𝐴).𝑥)𝑎𝐵𝑒𝑡𝑎⟶𝛽𝑎. Conversion should do real work rather than rename an alpha-bound variable. In 𝜆2𝜔, put 𝐹0:=𝜆(𝑌:∗).𝑌→𝑌. The triple (◻,◻,◻) forms the outer product in the type of 𝐹0, while ( ∗, ∗, ∗) forms its body 𝑌 →𝑌; hence 𝐹0 :∏𝑌:∗ ∗. In the legal context 𝐴:∗,𝑎:𝐴,𝑔:∏𝑌:∗𝐹0𝑌, rule App first derives 𝑔 𝐴 :𝐹0 𝐴. Since 𝐹0𝐴⟶𝛽𝐴→𝐴, and 𝐴 →𝐴 : ∗, rule Conv derives 𝑔 𝐴 :𝐴 →𝐴; another application derives 𝑔 𝐴 𝑎 :𝐴. This is conversion at a type-level beta-redex.
By contrast, in a legal context containing 𝑓 :∏𝑦:𝐴𝐵 and 𝑁 :𝐴, the application 𝑓 𝑁 is neutral: App gives it type 𝐵[𝑁/𝑦], but no beta-step applies because its head is the variable 𝑓.
★☆☆ Delete (◻, ∗, ∗) from the specification in example 60.4. Mark the first premise in its derivation that can no longer be discharged. Verify that the monomorphic term 𝜆(𝑥 :𝑋). 𝑥 remains typable in the context 𝑋 : ∗. (Six lines.)
Referenced from 3 locations
The eight vertices
For the lambda cube, fix 𝑆 ={ ∗,◻} and A ={ ∗ :◻}. Write 𝑟→:=(∗,∗,∗),𝑟2:=(◻,∗,∗),𝑟𝜔:=(◻,◻,◻),𝑟𝑃:=(∗,◻,◻). The baseline 𝑟→ forms ordinary function types. Adding 𝑟2 permits terms to depend on types, adding 𝑟𝜔 permits type operators to depend on types, and adding 𝑟𝑃 permits types to depend on terms. All four cube triples satisfy 𝑠3 =𝑠2; general PTS specifications need not have that property.
For 𝐼 ⊆{2,𝜔,𝑃}, let 𝜆𝐼 be the PTS with product triples {𝑟→} ∪{𝑟𝑖 ∣𝑖 ∈𝐼}. We use the following compact subscripts throughout this chapter: 𝐼systemR∅𝜆→𝑟→{2}𝜆2𝑟→,𝑟2{𝜔}𝜆𝜔𝑟→,𝑟𝜔{𝑃}𝜆𝑃𝑟→,𝑟𝑃{2,𝜔}𝜆2𝜔𝑟→,𝑟2,𝑟𝜔{2,𝑃}𝜆𝑃2𝑟→,𝑟2,𝑟𝑃{𝜔,𝑃}𝜆𝑃𝜔𝑟→,𝑟𝜔,𝑟𝑃{2,𝜔,𝑃}𝜆𝐶𝑟→,𝑟2,𝑟𝜔,𝑟𝑃. The top system 𝜆𝐶 is the Calculus of Constructions. Barendregt’s conventional names distinguish the vertices by writing 𝜆𝜔―― for our 𝜆𝜔, 𝜆𝜔 for our 𝜆2𝜔, 𝜆𝑃𝜔―― for our 𝜆𝑃𝜔, and 𝜆𝑃𝜔 =𝜆𝐶 for the top vertex [Bar92]. Thus our subscript 𝑃𝜔 is a set-valued axis label, not Barendregt’s name 𝜆𝑃𝜔.
Referenced from 6 locations
Let S =(𝑆,A,R) and S′ =(𝑆,A,R′), with R ⊆R′. Then Γ⊢S𝑀:𝐴⟹Γ⊢S′𝑀:𝐴.
Referenced from 5 locations
Proof of Lemma 60.6 — Monotonicity in product triples
Proof. Induct on the displayed derivation. Rebuild every rule with the induction hypotheses. In the Prod case, its triple lies in R′ by the inclusion; no other rule inspects the product-triple set. ◻
The cube below records these inclusions. A solid edge labeled 2 or 𝜔 adds the indicated triple; a dashed edge labeled 𝑃 adds 𝑟𝑃. A crossing without a node is not a vertex. If 𝐼 ⊆𝐽 ⊆𝐾, write 𝜄𝐼,𝐽 for the inclusion proved by lemma 60.6; each square asserts 𝜄𝐽,𝐾∘𝜄𝐼,𝐽=𝜄𝐼,𝐾. Both sides preserve the same derivation tree and merely regard every Prod membership witness in the larger set.
Diagram
The syntax translations from Church-style STLC with type variables, System F, and 𝐹𝜔 with term polymorphism into 𝜆→, 𝜆2, and 𝜆2𝜔, respectively, preserve typing and beta-reduction. Conversely, a derivation-directed decoding maps every derivable judgment in the image of one of these translations back to its source calculus, up to alpha-equivalence, and maps beta-steps between such image expressions to source beta-steps. The top vertex 𝜆𝐶 is exactly the PTS presentation of the Calculus of Constructions.
Referenced from 2 locations
Proof of Proposition 60.7 — Recovery of the familiar systems
Proof. Map every arrow 𝐴 →𝐵 to ∏𝑥:𝐴𝐵 with 𝑥 ∉FV(𝐵), every term abstraction to the PTS abstraction, every System F type abstraction Λ𝑋. 𝑀 to 𝜆(𝑋 : ∗). 𝑀, and every kind abstraction to the same PTS constructor. Applications are unchanged; type application becomes ordinary application.
For preservation, rule induction on the source derivation replaces each source formation rule by the indicated product triple. The three non-structural cases are source rulePTS triple𝐴→𝐵 𝗍𝗒𝗉𝖾𝑟→∀𝑋.𝐵 𝗍𝗒𝗉𝖾𝑟2𝐾→𝐾′ 𝗄𝗂𝗇𝖽𝑟𝜔 The abstraction and application rules then coincide with Lam and App. Substitution is unchanged, so source beta-contraction maps to PTS beta-contraction.
For reflection, do not attempt to invert the translation on arbitrary pseudo-terms. Define the decoding simultaneously on PTS derivations and their premises. Its invariant assigns each decoded expression the source syntactic class determined by its typing derivation and returns a source derivation whose translation is alpha-equivalent to the PTS conclusion.
Rules Ax, Var, and Weak decode their premises and reconstruct the corresponding source rules. In a Prod derivation in the translated fragment, the final triple is one row of the table, so it determines whether the source constructor is an ordinary arrow, a universal type, or a kind arrow. In a Lam derivation, its product premise has fixed the class of the bound variable and the body. In an App derivation, the decoded product type of the function determines whether the source step is term application, type application, or kind application; this resolves the two applications present in 𝜆2. Rule Conv reconstructs source conversion after decoding its sort premise. These clauses cover every rule whose conclusion is in the translated fragment and preserve the invariant.
A legal beta-redex is an application whose function derivation decodes to an abstraction with the same source class for its binder and argument. Decoding its contraction therefore gives source capture-avoiding substitution, and the source beta-rule translates back to the original PTS contraction. Congruence cases follow by decoding the derivation of the reduced subexpression. This proves reflection without claiming a syntactic inverse on untyped pseudo-terms. ◻
The qualification with type variables is necessary at the bottom vertex. The axiom ∗ :◻ permits declarations 𝑋 : ∗. A fixed-base STLC is obtained by restricting contexts and adding named base-type constants; that restriction is not a different cube vertex.
The fourth clause is not an adequacy theorem for a separately defined surface language. Rather, 𝜆𝐶 is the PTS presentation called the Calculus of Constructions in [Bar92]. The primary presentation of the calculus, with dependent products and two classifier levels, is [CH88]. Relating either presentation to a different surface language would require a separate encoding theorem.
Extend the constant axioms by 𝖭𝖺𝗍 : ∗, and work in 𝜆𝑃. Choose 𝑛 ∈𝑉∗. The family kind is derived by ⋅⊢𝖭𝖺𝗍:∗𝑛:𝖭𝖺𝗍⊢∗:◻𝑟𝑃=(∗,◻,◻)⋅⊢∏𝑛:𝖭𝖺𝗍∗:◻Prod. The middle premise is Weak applied to ⋅ ⊢ ∗ :◻. Consequently a context declaration 𝖵𝖾𝖼 :∏𝑛:𝖭𝖺𝗍 ∗, with 𝖵𝖾𝖼 ∈𝑉◻, is legal only when the 𝑃-axis is present. Choose a fresh 𝑣 ∈𝑉∗, with 𝖵𝖾𝖼,𝑛,𝑣 pairwise distinct, and put Γ0:=(𝖵𝖾𝖼:∏𝑛:𝖭𝖺𝗍∗), 𝑛:𝖭𝖺𝗍,Γ1:=Γ0,𝑣:𝖵𝖾𝖼𝑛. Rules Var, App, Prod, and Lam derive Γ1⊢𝑣:𝖵𝖾𝖼𝑛,Γ0⊢𝜆(𝑣:𝖵𝖾𝖼𝑛).𝑣:∏𝑣:𝖵𝖾𝖼𝑛𝖵𝖾𝖼𝑛. The type depends on the neutral term 𝑛; no beta-step removes that dependency. Abstracting 𝑛 once more gives the displayed dependent judgment 𝖵𝖾𝖼:∏𝑛:𝖭𝖺𝗍∗ ⊢𝜆(𝑛:𝖭𝖺𝗍).𝜆(𝑣:𝖵𝖾𝖼𝑛).𝑣:∏𝑛:𝖭𝖺𝗍∏𝑣:𝖵𝖾𝖼𝑛𝖵𝖾𝖼𝑛. The inner and outer term abstractions use 𝑟→, while formation of the family’s context declaration uses 𝑟𝑃. The only constant added to the axiom set is 𝖭𝖺𝗍 : ∗; 𝖵𝖾𝖼 enters the context through Var, not Ax.
Referenced from 3 locations
★★☆ For each of the following products, give the least vertex of the lambda cube in which it is formable and name the decisive product triple: ∏𝑋:∗𝑋→𝑋,∏𝐹:(∗→∗)∏𝑋:∗𝐹𝑋→𝐹𝑋,∏𝑛:𝖭𝖺𝗍𝖵𝖾𝖼𝑛→𝖵𝖾𝖼𝑛. A name may be added as an axiom only with a sort on its right. Every other declaration must have its type derived in the candidate vertex; in particular, derive 𝖵𝖾𝖼 :∏𝑛:𝖭𝖺𝗍 ∗ as in example 60.8. Prove minimality by deleting one triple in each case and use lemma 60.6 for the upward inclusions. (Half a page.)
Referenced from 6 locations
The PTS rules are uniform enough that their structural proofs use only capture-avoiding substitution and the placement of declarations in a context. No normalization hypothesis is needed.
A context Γ is legal when it occurs in a derivable judgment. An expression 𝑀 is legal in Γ when either Γ ⊢S𝑀 :𝐴 or Γ ⊢S𝐴 :𝑀 for some expression 𝐴.
Referenced from 2 locations
If 𝑥1 :𝐴1,…,𝑥𝑛 :𝐴𝑛 is legal, then for every 𝑖 there is a sort 𝑠𝑖 such that 𝑥1:𝐴1,…,𝑥𝑖−1:𝐴𝑖−1⊢S𝐴𝑖:𝑠𝑖.
Referenced from 3 locations
Proof of Lemma 60.10 — Context validity
Proof. Choose a derivation in which the context occurs and induct on that derivation. Rules Ax, Prod, Lam, App, and Conv either have empty context or have a premise with the same context; apply the induction hypothesis to that premise. A final Var has context Θ,𝑥 :𝐴 and premise Θ ⊢𝐴 :𝑠. A final Weak has context Θ,𝑥 :𝐵, first premise in Θ, and declaration premise Θ ⊢𝐵 :𝑠. In either case the induction hypothesis gives the claims for Θ, and the declaration premise gives the last claim. These are all possible final rules. ◻
If Γ =𝑥1 :𝐴1,…,𝑥𝑛 :𝐴𝑛 and Γ ⊢S𝑀 :𝐵, then
the variables 𝑥1,…,𝑥𝑛 are pairwise distinct;
FV(𝑀) ∪FV(𝐵) ⊆{𝑥1,…,𝑥𝑛};
FV(𝐴𝑖) ⊆{𝑥1,…,𝑥𝑖−1} for every 1 ≤𝑖 ≤𝑛.
Referenced from 5 locations
Proof of Lemma 60.11 — Free variables
Proof. Proceed by rule induction on the typing derivation. Rule Ax has empty context. Rules Var and Weak append a name outside the context domain, and their sort premise gives the induction hypotheses for the new declaration. Rules Prod and Lam bind 𝑥 in the second premise; removing 𝑥 from that premise’s free-variable set gives the claimed set for the conclusion. Rule App takes the union of the two premise bounds and then substitutes 𝑁 for 𝑥; the capture-avoiding substitution equation FV(𝐵[𝑁/𝑥])⊆(FV(𝐵)∖{𝑥})∪FV(𝑁) gives the result. Rule Conv uses the two premise bounds. These are all rule families. ◻
Capture-avoiding substitution on pseudo-terms satisfies 𝐷[𝑁/𝑥][𝑃[𝑁/𝑥]/𝑦]=𝐷[𝑃/𝑦][𝑁/𝑥](𝑦∉FV(𝑁)∪{𝑥}).
Referenced from 3 locations
Proof of Lemma 60.12 — Composition of substitution
Proof. This equation follows by structural induction on 𝐷; at either binder, first choose a representative whose bound name avoids FV(𝑁) ∪FV(𝑃) ∪{𝑥,𝑦}. ◻
Capture-avoiding substitution respects beta-equivalence in both inputs: 𝑀=𝛽𝑁⟹𝑀[𝑃/𝑥]=𝛽𝑁[𝑃/𝑥],𝑃=𝛽𝑄⟹𝑀[𝑃/𝑥]=𝛽𝑀[𝑄/𝑥].
Referenced from 5 locations
Proof of Lemma 60.13 — Beta-equivalence and substitution
Proof. For the first implication, induct over the compatible beta reductions and their symmetric, transitive closure. A contracted redex is preserved after choosing its binder fresh; lemma 60.12 identifies the contractum. Congruence reconstructs every surrounding constructor. For the second implication, perform structural induction on 𝑀. Each free occurrence of 𝑥 contributes the given beta-equivalence, while constructor congruence combines the induction hypotheses; at a binder, first choose its name fresh for 𝑃 and 𝑄. ◻
Suppose Γ,Δ ⊢S𝑀 :𝐴 and Γ ⊢S𝐵 :𝑠. If 𝑥 ∉dom(Γ,Δ), then Γ,𝑥:𝐵,Δ⊢S𝑀:𝐴.
Referenced from 3 locations
Proof of Lemma 60.14 — Weakening
Proof. Generalize over the split Γ,Δ and perform rule induction on the first derivation. Keep the declaration-legality derivation Γ ⊢𝐵 :𝑠 as an explicit second input.
Rules Prod, Lam, App, and Conv are reconstructed after applying the induction hypothesis to every premise with context Γ,Δ. In a product or lambda premise under 𝑦 :𝐶, choose 𝑦∉FV(𝐵)∪{𝑥}∪dom(Γ,Δ) and apply the induction hypothesis at the enlarged suffix Δ,𝑦 :𝐶. This inserts 𝑥 :𝐵 before that binder, as required.
The two context-extending rules expose why the split was generalized. If a final Var concludes in Γ,Δ0,𝑦 :𝐶 with Δ =Δ0,𝑦 :𝐶, apply the induction hypothesis to its premise Γ,Δ0 ⊢𝐶 :𝑠𝐶 and then reapply Var: Γ,𝑥:𝐵,Δ0⊢𝐶:𝑠𝐶𝑦∉dom(Γ,𝑥:𝐵,Δ0)Γ,𝑥:𝐵,Δ0,𝑦:𝐶⊢𝑦:𝐶Var. A final Weak with the same nonempty suffix is identical: apply the two induction hypotheses to its typing and declaration-sort premises and reapply Weak. If Δ is empty, either final rule already has conclusion in Γ; one application of Weak, justified by the fixed premise Γ ⊢𝐵 :𝑠, appends 𝑥 :𝐵 to that conclusion.
Finally, an Ax conclusion has empty context, so both parts of the split are empty. Reapply Weak to Ax using ⋅ ⊢𝐵 :𝑠. Every recursive call is on a proper premise of the original derivation, and the freshness condition follows from the theorem’s hypothesis. This exhausts the typing rules. ◻
If Γ,𝑥:𝐴,Δ⊢S𝑀:𝐵andΓ⊢S𝑁:𝐴, then Γ,Δ[𝑁/𝑥]⊢S𝑀[𝑁/𝑥]:𝐵[𝑁/𝑥]. The simultaneous substitution Δ[𝑁/𝑥] acts on every declaration type.
Referenced from 5 locations
Proof of Theorem 60.15 — Substitution
Proof. The proof is by rule induction on the first derivation. Keep the second derivation fixed.
Variable cases. If the conclusion selects 𝑥 :𝐴, substitution changes it to 𝑁 :𝐴, which is the fixed second premise: a final Var selecting 𝑥 forces Δ = ⋅. Moreover, lemma 60.11 gives 𝑥 ∉FV(𝐴), so 𝐴[𝑁/𝑥] =𝐴. If the conclusion selects a different declaration 𝑦 :𝐶, the induction hypothesis for the derivation of 𝐶 :𝑠 gives 𝐶[𝑁/𝑥] :𝑠; Var derives 𝑦 :𝐶[𝑁/𝑥] in the substituted context.
Product case. The last rule has premises Γ,𝑥:𝐴,Δ⊢𝐶:𝑠1,Γ,𝑥:𝐴,Δ,𝑦:𝐶⊢𝐷:𝑠2, and (𝑠1,𝑠2,𝑠3) ∈R. Choose the representative with 𝑦∉FV(𝑁)∪{𝑥}∪dom(Γ,Δ). The induction hypotheses give Γ,Δ[𝑁/𝑥]⊢𝐶[𝑁/𝑥]:𝑠1,Γ,Δ[𝑁/𝑥],𝑦:𝐶[𝑁/𝑥]⊢𝐷[𝑁/𝑥]:𝑠2. Rule Prod yields the required product. The fresh choice gives ∏𝑦:𝐶[𝑁/𝑥]𝐷[𝑁/𝑥]=(∏𝑦:𝐶𝐷)[𝑁/𝑥].
Abstraction case. Use the same fresh choice for the bound variable 𝑦. The induction hypotheses derive the substituted body and the substituted product. Rule Lam then derives Γ,Δ[𝑁/𝑥]⊢𝜆(𝑦:𝐶[𝑁/𝑥]).𝑀0[𝑁/𝑥]:∏𝑦:𝐶[𝑁/𝑥]𝐷[𝑁/𝑥].
Application case. Suppose the final premises type 𝐹 :∏𝑦:𝐶𝐷 and 𝑃 :𝐶. The induction hypotheses type 𝐹[𝑁/𝑥] and 𝑃[𝑁/𝑥]. Rule App gives the type 𝐷[𝑁/𝑥][𝑃[𝑁/𝑥]/𝑦]𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛60.2=𝐷[𝑃/𝑦][𝑁/𝑥], where the representative has 𝑦 ∉FV(𝑁) ∪{𝑥}.
Weakening and conversion cases. A final Ax is impossible because the context of the first derivation contains the declaration 𝑥 :𝐴. Suppose a final Weak appends 𝑦 :𝐶. If 𝑦 ≠𝑥, then the context has the form Γ,𝑥 :𝐴,Δ0,𝑦 :𝐶; the two induction hypotheses type the weakened judgment and 𝐶[𝑁/𝑥], and Weak reconstructs the conclusion. If the appended declaration is 𝑥 :𝐴, then Δ is empty and the premise of Weak is the required target judgment. Indeed, lemma 60.11 gives 𝑥 ∉FV(𝑀) ∪FV(𝐵), so 𝑀[𝑁/𝑥] =𝑀 and 𝐵[𝑁/𝑥] =𝐵. For Conv, the induction hypotheses give the substituted typing and sort premises; lemma 60.13 gives 𝐶[𝑁/𝑥] =𝛽𝐷[𝑁/𝑥], so Conv applies. These cases exhaust the typing rules. ◻
★☆☆ Let Γ be legal and contain 𝐹 :∏𝑦:𝐴𝐷. Assume Γ ⊢𝐴 :𝑠, Γ ⊢𝑁 :𝐴, and 𝑥 ∉dom(Γ), choosing 𝑦 ∉FV(𝑁) ∪{𝑥}. Instantiate theorem 60.15 with 𝑀:=𝐹 𝑥. Write the complete derivation of 𝐹 𝑁 :𝐷[𝑁/𝑦], including the weakening needed to type 𝐹 in the source context. Name the free-variable fact that simplifies the substituted result type. (Ten lines.)
Referenced from 3 locations
Suppose the displayed judgment is derivable.
If Γ ⊢𝑐 :𝐶, then 𝑐 :𝑠 ∈A and 𝐶 =𝛽𝑠 for some 𝑠 ∈𝑆.
If Γ ⊢𝑥 :𝐶, then 𝑥 :𝐴 ∈Γ and 𝐶 =𝛽𝐴 for some 𝐴 with Γ ⊢𝐴 :𝑠.
If Γ ⊢∏𝑥:𝐴𝐵 :𝐶, then for some (𝑠1,𝑠2,𝑠3) ∈R, Γ⊢𝐴:𝑠1,Γ,𝑥:𝐴⊢𝐵:𝑠2,𝐶=𝛽𝑠3.
If Γ ⊢𝜆(𝑥 :𝐴). 𝑀 :𝐶, then for some 𝐵 and 𝑠, Γ,𝑥:𝐴⊢𝑀:𝐵,Γ⊢∏𝑥:𝐴𝐵:𝑠,𝐶=𝛽∏𝑥:𝐴𝐵.
If Γ ⊢𝐹 𝑁 :𝐶, then for some 𝐴,𝐵, Γ⊢𝐹:∏𝑥:𝐴𝐵,Γ⊢𝑁:𝐴,𝐶=𝛽𝐵[𝑁/𝑥].
The subscripts S are suppressed in this statement.
Referenced from 3 locations
Proof of Lemma 60.16 — Generation
Proof. Follow the derivation upward past every final Weak or Conv; neither rule changes the subject. The first rule that constructs the subject must be Ax, Var, Prod, Lam, or App, respectively. Its premises give the displayed judgments. Each skipped Conv contributes one beta-equality, whose composite gives the asserted equality. For each skipped Weak, the constructing rule’s premises hold in a prefix Γ0 of Γ; repeated applications of lemma 60.14 reinsert the declarations of Γ ∖Γ0 in their original order. The required sort premises are the declaration premises of those skipped Weak rules, equivalently the corresponding instances of lemma 60.10. This proves all five clauses. ◻
If Γ ⊢S𝑀 :𝐴, then either 𝐴 ∈𝑆 or there is a sort 𝑠 ∈𝑆 such that Γ⊢S𝐴:𝑠.
Referenced from 3 locations
Proof of Lemma 60.17 — Correctness of types
Proof. Proceed by rule induction. Rule Ax concludes with the sort on the right, and Prod concludes with its result sort. The declaration-sort premise of Var gives the second alternative. In Weak, the induction hypothesis either says that the unchanged type is a sort or gives its sort derivation; in the second case, Weak extends that derivation.
The product premise of Lam gives the sort of its result type. In App, the function type is a product expression and therefore is not a sort constant. The induction hypothesis for the function premise must therefore give a sort derivation for that product. Generation applied to that derivation gives Γ⊢𝐴:𝑠1,Γ,𝑥:𝐴⊢𝐵:𝑠2. The argument premise and theorem 60.15 therefore give Γ ⊢𝐵[𝑁/𝑥] :𝑠2. Finally, the sort premise of Conv gives the second alternative directly. Notice that the Ax branch may end at a top sort with no classifier; this is why the statement has two alternatives. ◻
For the pseudo-terms of definition 60.2, if 𝑀 ⟶∗𝛽𝑁1 and 𝑀 ⟶∗𝛽𝑁2, then some pseudo-term 𝑃 satisfies 𝑁1⟶∗𝛽𝑃and𝑁2⟶∗𝛽𝑃. No typing hypothesis is required.
Referenced from 4 locations
Proof of Lemma 60.18 — Confluence of beta-reduction on pseudo-terms
Proof. Define 𝑀𝗉𝖺𝗋𝑁, read as parallel reduction from 𝑀 to 𝑁, by reflexivity on variables and constants, componentwise clauses for application, annotated abstraction, and product, and the contracting clause 𝐴𝗉𝖺𝗋𝐴′𝑀𝗉𝖺𝗋𝑀′𝑁𝗉𝖺𝗋𝑁′(𝜆(𝑥:𝐴).𝑀)𝑁𝗉𝖺𝗋𝑀′[𝑁′/𝑥]. The only binder side condition is the choice of an alpha-representative whose bound variable avoids the free variables of the substituted argument. Structural induction proves the substitution property 𝑀𝗉𝖺𝗋𝑀′ ∧ 𝑁𝗉𝖺𝗋𝑁′⟹𝑀[𝑁/𝑥]𝗉𝖺𝗋𝑀′[𝑁′/𝑥]. The abstraction and product cases choose the same fresh representative on both sides; the variable, constant, and application cases are the defining clauses.
Define the complete development 𝑀⋆ recursively by developing every component and contracting every redex visible in 𝑀. Thus ((𝜆(𝑥:𝐴).𝑀)𝑁)⋆:=𝑀⋆[𝑁⋆/𝑥], while a non-redex application develops its two components, and abstractions and products develop their annotations and bodies. Induction on a derivation of 𝑀𝗉𝖺𝗋𝑁, using the substitution property in the contracting case, gives the triangle property 𝑀𝗉𝖺𝗋𝑁⟹𝑁𝗉𝖺𝗋𝑀⋆. Hence parallel reduction is diamond. One beta-step is a parallel step, and every parallel step is a finite compatible beta-reduction, as induction on its derivation shows. Replacing the two finite beta-reductions by their parallel factorizations and using the diamond property proves the stated confluence. ◻
If 𝑀 =𝛽𝑁, then some 𝑃 satisfies 𝑀⟶∗𝛽𝑃and𝑁⟶∗𝛽𝑃.
Referenced from 3 locations
Proof of Corollary 60.19 — Church–Rosser
Proof. Induct on the length of a reflexive, symmetric, transitive beta-conversion chain from 𝑀 to 𝑁. The reflexive case chooses 𝑃 =𝑀. For one more forward or backward beta segment, apply lemma 60.18 to the common endpoint obtained by the induction hypothesis. This tiles the new segment with a common reduct. ◻
If ∏𝑥:𝐴𝐵 =𝛽∏𝑥:𝐴′𝐵′, then 𝐴 =𝛽𝐴′ and 𝐵 =𝛽𝐵′.
Referenced from 3 locations
Proof of Lemma 60.20 — Product compatibility
Proof. By corollary 60.19, the two products reduce to a common expression 𝑃. No beta-step removes an outer product constructor, so 𝑃 =∏𝑥:𝐶𝐷 for some 𝐶,𝐷. The left reductions give 𝐴 ⟶∗𝛽𝐶 and 𝐵 ⟶∗𝛽𝐷; the right reductions give 𝐴′ ⟶∗𝛽𝐶 and 𝐵′ ⟶∗𝛽𝐷. The two beta-equalities follow. ◻
Subject reduction must account for reduction in a context declaration as well as reduction in the subject. The mutual statement makes that dependency explicit.
For every PTS specification S:
if Γ ⊢S𝑀 :𝐴 and 𝑀 ⟶𝛽𝑀′, then Γ ⊢S𝑀′ :𝐴;
if Γ ⊢S𝑀 :𝐴 and one declaration type in Γ takes a beta-step, producing a legal context Γ′, then Γ′ ⊢S𝑀 :𝐴.
Referenced from 5 locations
Proof of Theorem 60.21 — Subject reduction
Proof. Prove the two clauses simultaneously by rule induction on the typing derivation. For every proper premise derivation, the first induction hypothesis preserves its type after one compatible step in its subject. The second preserves the judgment after one declaration type in its context steps, provided the resulting context is legal. We display computation, product, abstraction, application, conversion, and context-extension cases.
Beta-redex. Suppose the final App has premises Γ⊢𝜆(𝑥:𝐴0).𝑀0:∏𝑥:𝐶𝐷,Γ⊢𝑁:𝐶, and its subject contracts to 𝑀0[𝑁/𝑥]. Generation for the abstraction gives a family 𝐵 and a sort 𝑠 such that Γ,𝑥:𝐴0⊢𝑀0:𝐵,Γ⊢∏𝑥:𝐴0𝐵:𝑠,∏𝑥:𝐴0𝐵=𝛽∏𝑥:𝐶𝐷. Product compatibility gives 𝐴0 =𝛽𝐶 and 𝐵 =𝛽𝐷. Generation for the displayed product gives Γ ⊢𝐴0 :𝑠0, so Conv derives Γ ⊢𝑁 :𝐴0. Substitution gives Γ⊢𝑀0[𝑁/𝑥]:𝐵[𝑁/𝑥]. The type ∏𝑥:𝐶𝐷 is not a sort, so lemma 60.17 applied to the function premise gives Γ ⊢∏𝑥:𝐶𝐷 :𝑠′. Generation and substitution with Γ ⊢𝑁 :𝐶 then give Γ ⊢𝐷[𝑁/𝑥] :𝑠𝐷. By lemma 60.13, 𝐵[𝑁/𝑥]=𝛽𝐷[𝑁/𝑥](𝐵=𝛽𝐷). Rule Conv, with the derived sort premise for 𝐷[𝑁/𝑥], restores the exact App result type.
Product formation. Suppose the final rule derives Γ ⊢∏𝑥:𝐴𝐵 :𝑠3. If 𝐴 ⟶𝛽𝐴′, the first induction hypothesis gives Γ ⊢𝐴′ :𝑠1. Rule Var establishes that Γ,𝑥 :𝐴′ legal, so the second induction hypothesis changes the codomain premise to Γ,𝑥 :𝐴′ ⊢𝐵 :𝑠2. Reapplying Prod gives Γ⊢∏𝑥:𝐴′𝐵:𝑠3. If the step is in 𝐵, the first induction hypothesis on the codomain premise followed by Prod gives the result. If a declaration in Γ steps, the second induction hypothesis repairs both formation premises before Prod is reapplied.
Lambda annotation. Suppose 𝐴 ⟶𝛽𝐴′ inside 𝜆(𝑥 :𝐴). 𝑀. The first induction hypothesis on the product premise changes Γ⊢∏𝑥:𝐴𝐵:𝑠toΓ⊢∏𝑥:𝐴′𝐵:𝑠. Generation of the latter judgment shows that Γ,𝑥 :𝐴′ is legal. The second mutual induction hypothesis therefore changes the body premise from Γ,𝑥 :𝐴 ⊢𝑀 :𝐵 to Γ,𝑥 :𝐴′ ⊢𝑀 :𝐵. Rule Lam derives Γ⊢𝜆(𝑥:𝐴′).𝑀:∏𝑥:𝐴′𝐵. Because ∏𝑥:𝐴′𝐵 =𝛽∏𝑥:𝐴𝐵, Conv restores the original type, using the original product premise as its required sort premise. Reduction in the body uses the first induction hypothesis under the freshly chosen binder.
For App, a step in the function is handled by the first induction hypothesis and reapplication of App. If the argument changes from 𝑁 to 𝑁′, the first induction hypothesis and App derive Γ ⊢𝐹 𝑁′ :𝐵[𝑁′/𝑥]. Correctness of types for 𝐹 :∏𝑥:𝐴𝐵, followed by generation and substitution with 𝑁 :𝐴, gives Γ ⊢𝐵[𝑁/𝑥] :𝑠𝐵. Since 𝐵[𝑁′/𝑥] =𝛽𝐵[𝑁/𝑥], Conv restores the stated type. Rules Ax and Var have no principal redex in the subject-reduction clause.
For the context-reduction clause, Var has one additional principal case. Suppose its selected declaration changes from 𝑥 :𝐶 to 𝑥 :𝐶′ with 𝐶 ⟶𝛽𝐶′. Subject reduction on the declaration-sort premise gives Θ ⊢𝐶′ :𝑠. Hence Var gives Θ,𝑥 :𝐶′ ⊢𝑥 :𝐶′. Weakening the old sort derivation Θ ⊢𝐶 :𝑠 across 𝑥 :𝐶′ gives Θ,𝑥 :𝐶′ ⊢𝐶 :𝑠, and Conv, using 𝐶′ =𝛽𝐶, restores Θ,𝑥:𝐶′⊢𝑥:𝐶. If the changed declaration is earlier than the selected one, the mutual induction hypothesis first repairs the selected declaration’s sort premise and Var is reapplied. For a final Weak, distinguish a change in its newly appended declaration from a change in its prefix. In the former case subject reduction repairs its declaration-sort premise; in the latter the mutual induction hypotheses repair both premises. Rule Ax has empty context. For clause 1, Weak applies the first induction hypothesis to its typing premise and reattaches the unchanged declaration. Rule Conv applies the first induction hypothesis to its typing premise and, if the step is in the chosen result type, to its sort premise before reapplying conversion. For clause 2, both rules use the second induction hypothesis on every premise with the changed context. These cases exhaust compatible beta-reduction in subjects and contexts. ◻
Suppose Γ is legal and one declaration type in Γ takes a beta-step, producing Γ′. Then Γ′ is legal. Moreover, Γ⊢S𝑀:𝐴⟹Γ′⊢S𝑀:𝐴.
Referenced from 2 locations
Proof of Corollary 60.22 — Legality under declaration reduction
Proof. Write Γ=Θ,𝑥:𝐶,Δ,Γ′=Θ,𝑥:𝐶′,Δ,𝐶⟶𝛽𝐶′. Context validity gives Θ ⊢𝐶 :𝑠, and the first clause of theorem 60.21 gives Θ ⊢𝐶′ :𝑠. Hence Θ,𝑥 :𝐶′ is legal.
Proceed from left to right through the declarations of Δ. Suppose the target prefix constructed so far is legal. Context validity gives a sort derivation for the next declaration type in the corresponding source prefix. The second clause of theorem 60.21, applied to that derivation and the legal target prefix, gives the same declaration-sort judgment in the target prefix. Appending it preserves legality. Induction on the length of Δ proves that Γ′ is legal. The second clause of theorem 60.21 now gives the final implication. ◻
★★☆ Complete the App argument-reduction case in the subject-reduction proof. If 𝑁 ⟶𝛽𝑁′, derive the type 𝐵[𝑁′/𝑥] of 𝐹 𝑁′ and then derive the original type 𝐵[𝑁/𝑥]. Put the reason for the final conversion on the equality step. (Half a page.)
Referenced from 3 locations
Normalization and decisions belong to instances
The rules of definition 60.3 also describe specifications with ∗ : ∗. Structural uniformity therefore cannot imply normalization.
For each of the eight systems 𝜆𝐼 of definition 60.5, if Γ ⊢𝜆𝐼𝑀 :𝐴, then every compatible beta-reduction sequence from 𝑀, 𝐴, or a declaration type in Γ is finite.
Referenced from 6 locations
Proof of Theorem 60.23 — Strong normalization of the lambda cube
Proof. This is the exact strong-normalization theorem for the lambda cube proved by Barendregt, [Bar92]. Its proof interprets the strongest vertex 𝜆𝐶 in a marked calculus, proves normalization of the marked constructors and objects, and transfers the result to every subsystem. The import applies here because definition 60.5 has the same sorts, axiom, four product triples, compatible beta-reduction, and Church-style typing rules. No claim about an arbitrary triple (𝑆,A,R) is imported. ◻
The schema itself admits the one-sort specification 𝑆={∗},A={∗:∗},R={(∗,∗,∗)}. It is not a lambda-cube vertex. Its circular axiom invalidates the reducibility construction used by the theorem.
In the displayed one-sort specification there is a closed term 𝐺 such that ⋅⊢𝐺:∏𝐴:∗𝐴. Consequently every type of sort ∗ is inhabited. In addition, some typable term has no beta-normal form. Thus the specification is logically inconsistent under propositions-as-types and is not strongly normalizing.
Referenced from 3 locations
Proof of Theorem 60.24 — Girard's boundary for the one-sort PTS
Proof. This is the contraction to 𝜆 ∗ of Girard’s paradox, imported with the exact one-sort signature from [Bar92]. The contraction from Girard’s system 𝜆𝑈 to 𝜆 ∗ preserves the displayed inhabitation result; the same corollary separately states that 𝜆 ∗ has typable terms without normal form. We do not use Proposition 5.2.31, whose hypothesis requires an extension of 𝜆2. No claim about a different ∗ : ∗ specification is imported. ◻
A PTS specification is functional when each constant has at most one axiom sort and every pair (𝑠1,𝑠2) has at most one product-result sort 𝑠3. It is lookup-effective when equality of constants and sorts is decidable and there are total computable procedures 𝗂𝗌𝖲𝗈𝗋𝗍:𝐶→𝖡𝗈𝗈𝗅,𝖺𝗑𝗂𝗈𝗆𝖲𝗈𝗋𝗍:𝐶→𝖮𝗉𝗍𝗂𝗈𝗇(𝑆),𝗉𝗋𝗈𝖽𝗎𝖼𝗍𝖲𝗈𝗋𝗍:𝑆×𝑆→𝖮𝗉𝗍𝗂𝗈𝗇(𝑆) such that 𝗂𝗌𝖲𝗈𝗋𝗍(𝑐) is true exactly when 𝑐 ∈𝑆, 𝖺𝗑𝗂𝗈𝗆𝖲𝗈𝗋𝗍(𝑐) =𝗌𝗈𝗆𝖾(𝑠) exactly when (𝑐,𝑠) ∈A, and 𝗉𝗋𝗈𝖽𝗎𝖼𝗍𝖲𝗈𝗋𝗍(𝑠1,𝑠2) =𝗌𝗈𝗆𝖾(𝑠3) exactly when (𝑠1,𝑠2,𝑠3) ∈R. Every lookup-effective specification is functional: the last two biconditionals imply uniqueness because each procedure returns at most one option value.
Referenced from 2 locations
The partition 𝑉 =⋃𝑠𝑉𝑠 and the side conditions on Var and Weak are exactly the naming convention of Barendregt’s Section 5.2 presentation. Consequently the uniqueness and decidability results cited below apply to the displayed rules directly; no erasure or renaming transfer is being assumed.
If S is functional, Γ ⊢S𝑀 :𝐴, and Γ ⊢S𝑀 :𝐵, then 𝐴 =𝛽𝐵.
Referenced from 5 locations
Proof of Lemma 60.26 — Uniqueness of types modulo beta
Proof. This is Barendregt’s uniqueness lemma for functional PTSs [Bar92]; our functionality and typing rules are its hypotheses. Its induction is on the structure of the common subject 𝑀, not on either derivation. Apply lemma 60.16 to both derivations. Constants and variables select the same axiom or context declaration; products use functionality after their domain and codomain sorts have been identified; applications use lemma 60.20 and lemma 60.13; abstractions use generation on both bodies. Final Weak and Conv steps have already been absorbed by generation. This yields 𝐴 =𝛽𝐵 without a context-condensing premise. ◻
Let S be lookup-effective and let 𝑆 be finite. Assume every legal expression is strongly beta-normalizing. There is a total computable procedure that, on input finite encodings of Γ, 𝑀, and 𝐴, decides whether Γ⊢S𝑀:𝐴 is derivable. Consequently, type checking is decidable at every lambda-cube vertex.
Referenced from 3 locations
Proof of Theorem 60.27 — Conditional decidable checking
Proof. The imported result is Corollary 5.2.18 of Barendregt’s treatment [Bar92]. Here is the decision procedure under our more explicit effectiveness hypotheses. First validate the context from left to right. For each declaration, recursively synthesize an actual sort for its type, then extend the already validated prefix; an untyped top sort cannot be a declaration type. On terms, synthesize by the outer constructor. Constants and variables use the two finite lookups. A product synthesizes sorts for its domain and codomain and consults 𝗉𝗋𝗈𝖽𝗎𝖼𝗍𝖲𝗈𝗋𝗍. An abstraction first classifies its annotation, synthesizes its body in the extended context, and consults the same product table for the type thereby assembled. An application synthesizes its function, normalizes that already legal type to product form, checks the argument against the domain, and returns the substituted codomain. Checking first synthesizes, validates the proposed type as either a sort itself or an expression having a synthesized sort, and then compares the two types modulo beta. The terminal “is a sort” alternative is needed here because a derivable right-hand side may be the untyped top sort; it is not used when validating context declarations or binder annotations.
This mutual synthesis-and-classification procedure recurses on proper raw subterms. Its only subsidiary computation is normalization of expressions already established to be legal, which terminates by hypothesis; beta confluence from lemma 60.18 makes comparison of their normal forms decisive. Soundness rebuilds the rules of definition 60.3. Generation proves completeness constructor by constructor, product compatibility handles the application case, and lemma 60.26 proves completeness of the final conversion test. Thus the paragraph supplies a syntax-directed reconstruction of the corollary, not an attribution of this algorithm to one of the source’s intermediate lemmas.
Barendregt attributes the unprinted proof of the corollary to van Benthem Jutting’s method for the preceding condensing lemma; the statement of that lemma is not an algorithm or a termination measure. The source also leaves effective access to A and R implicit. Our lookup-effective hypothesis makes those finite decisions explicit.
Each cube system has finite lookup tables, and theorem 60.23 discharges the normalization hypothesis. ◻
Functionality is used only in completeness of synthesis. Without it, one subject may have two non-convertible product sorts, so an algorithm returning a single inferred type need not find the requested derivation. A finite search algorithm can still decide some nonfunctional specifications, but that is a different theorem. The normalization hypothesis is essential: type checking for the one-sort system 𝜆 ∗ is undecidable [Bar92].
★★☆ Construct a finite PTS with sorts 𝑠0,𝑠1,𝑠2,𝑠3, decidable membership in its three specification sets, and two triples (𝑠0,𝑠1,𝑠2) and (𝑠0,𝑠1,𝑠3) such that one product receives both 𝑠2 and 𝑠3. Identify the exact step of lemma 60.26 that fails. Do not use 𝑠 :𝑠. (Half a page.)
Referenced from 3 locations
The boundary of the classification
For a PTS specification S, the data (𝑆,A,R) and a derivation Γ ⊢S𝑀 :𝐴 establish only formation and typing by the PTS rules. They do not, without separate rules and proofs, establish:
adequacy of an encoding of another syntax or logic;
formation or elimination principles for inductive or indexed families;
an intensional identity type and its path-induction eliminator;
a cumulative hierarchy of Martin–Löf universes or large elimination;
a particular judgmental computation discipline beyond beta-conversion;
normalization, consistency, canonicity, or decidable checking for an arbitrary PTS specification.
Referenced from 2 locations
Proof of Proposition 60.28 — What a cube placement does not establish
Proof. The conclusion is about what follows from the displayed signature, not about what can be encoded by its terms. For example, an impredicative vertex may form Church data or Leibniz equality, but the PTS rules give those encodings no primitive induction rule, large eliminator, or judgmental computation rule beyond beta. Establishing that an encoding represents exactly the intended objects and eliminations is a separate adequacy theorem.
Likewise, neither A nor R contains induction constructors, an identity eliminator, or universe levels. Such rules must be added to a larger signature and their metatheory proved there. Theorem 60.24 separates the arbitrary PTS schema from the normalizing cube instances of theorem 60.23. Hence the last group of properties also requires instance hypotheses rather than cube placement alone. ◻
Suggested first pass.
None of these problems is a prerequisite for a later chapter. Begin with exercise 60.6, then complete exercise 60.9.
★★☆ Choose one term witnessing each of the three optional cube axes. Give its complete PTS derivation, then delete the corresponding product triple and prove by generation that the term is no longer typable at that vertex.
Referenced from 4 locations
★★☆ Reconstruct the beta-redex case of subject reduction without suppressing the types 𝐴0,𝐴,𝐵,𝐶,𝐷. Mark the uses of product compatibility, conversion, and substitution. Then give a malformed variant obtained by deleting the sort premise from Conv and identify the presupposition that fails.
Referenced from 3 locations
★★☆ Compare 𝜆𝐶 with the one-sort system ∗ : ∗ at the level of specifications. Exhibit the common product rule and the differing axiom, and explain why inclusion in the PTS schema transfers theorem 60.15 but not theorem 60.23.
Referenced from 3 locations
★★★ Practical project.pts-cube-checker Implement in Agda or Kappa two bounded entry points. The first checks the finite, beta-normal fragment of the lambda-cube specifications in definition 60.3; the second admits one declared conversion stage in which visible type redexes are developed once. Globally fresh numeric binder names may stand for alpha-classes; state and check that invariant on every input, and use alpha-aware structural comparison for the beta-normal entry point. Preserve the invariant that every synthesized right-hand side is either a sort or has a derived sort. The program must print a trace annotated by the product triple used at each binder. It must accept the polymorphic identity of example 60.4 in 𝜆2, reject it in 𝜆→ at the outer product, accept the second product of exercise 60.2 in 𝜆2𝜔, and reject the family declaration 𝖵𝖾𝖼 :∏𝑛:𝖭𝖺𝗍 ∗ required by the third product when 𝑟𝑃 is absent. Finally, admit one redex in a type, develop it, and accept an application whose argument type agrees with its domain only after that conversion. These five outcomes are the decidable acceptance test.
Referenced from 6 locations
Sources. The PTS specification, generation and substitution arguments, subject reduction, cube vertices, and instance normalization theorem follow the exact systems in [Bar92]. A modern derivational route through the cube is given by [NG14, Geu09]. These references provide provenance and the imported strong-normalization theorem; the structural proofs used in this chapter are printed above. Barendregt’s earlier generalized-type- system paper gives the historical three-part specification and cube classification [Bar91]; its displayed rule sheet is not substituted for the 1992 PTS rules fixed in definition 60.3.
A bounded strength comparison.
Setzer analyzes Martin–Löf type theory with one universe and W-types, not a PTS or the Calculus of Constructions. For 𝖬𝖫𝐽, 𝖬𝖫[𝑇𝐷], and their two auxiliary presentations, Theorem 4.41 proves transfinite induction below 𝜓Ω1(Ω𝐼+𝑛) for every 𝑛 ∈ℕ. Corollary 4.42 then includes the stated extensional extension and uses the separately cited upper bound to obtain the exact ordinal 𝜓Ω1(Ω𝐼+𝜔), where 𝐼 belongs to the paper’s notation system. The theorem and corollary cover the named intensional and extensional presentations. Setzer’s abstract separately states the same strength for the Tarski- and Russell-style universe presentations [Set98]. The well-ordering construction is not reproduced here, and no book result depends on it.