Prerequisites. Direct starred prerequisites: none. No later core chapter depends on this route.
A logical framework can represent an object theory while failing to compute with it. If natural-number addition is encoded by a constant, the term 𝗉𝗅𝗎𝗌(𝗌𝗓)(𝗌𝗓) is stuck until a proof explicitly rewrites it. The 𝜆Π-calculus modulo rewriting instead admits selected equations as part of conversion. This makes an encoded theory calculate, but it transfers a proof obligation to the signature: an ill-typed, nonconfluent, or nonterminating rule set can destroy the kernel properties on which checking depends.
The obstruction is therefore not the absence of computation but the absence of a disciplined boundary around computation. A typed rewrite signature supplies that boundary: its rules preserve classifiers, its overlaps are joinable, and its reduction relation terminates whenever conversion is to be decided by normal forms.
Terms are 𝑡,𝑢,𝐴,𝐵::=𝑥∣𝑐∣𝖳𝗒𝗉𝖾∣∏𝑥:𝐴𝐵∣𝜆𝑥:𝐴.𝑡∣𝑡𝑢. A global signature Σ is an ordered list of constant declarations 𝑐:𝐴 and rewrite rules ℓ⟼𝑟. A local context Γ is an ordered list of variable declarations. Constants declared later may use earlier constants but not conversely.
The core typing rules are
𝑥:𝐴∈Γ
Σ;Γ⊢𝑥:𝐴
Mod-Var
𝑐:𝐴∈Σ
Σ;Γ⊢𝑐:𝐴
Mod-Const
Σ;Γ𝖼𝗍𝗑
Σ;Γ⊢𝖳𝗒𝗉𝖾:𝖪𝗂𝗇𝖽
Mod-Type
Σ;Γ⊢𝐴:𝖳𝗒𝗉𝖾Σ;Γ,𝑥:𝐴⊢𝐵:𝑠
Σ;Γ⊢∏𝑥:𝐴𝐵:𝑠
Mod-Pi
Σ;Γ⊢𝐴:𝖳𝗒𝗉𝖾Σ;Γ,𝑥:𝐴⊢𝑡:𝐵𝐵≠𝖪𝗂𝗇𝖽
Σ;Γ⊢𝜆𝑥:𝐴.𝑡:∏𝑥:𝐴𝐵
Mod-Lam
Σ;Γ⊢𝑓:∏𝑥:𝐴𝐵Σ;Γ⊢𝑢:𝐴
Σ;Γ⊢𝑓𝑢:𝐵[𝑢/𝑥]
Mod-App
where 𝑠∈{𝖳𝗒𝗉𝖾,𝖪𝗂𝗇𝖽}. The product rule therefore forms both ordinary dependent functions and kind-level families such as 𝗉𝗋𝗈𝗉→𝖳𝗒𝗉𝖾. The symbol 𝖪𝗂𝗇𝖽 itself receives no type, which is why Mod-Lam excludes 𝐵=𝖪𝗂𝗇𝖽. Conversion is
Σ;Γ⊢𝑡:𝐴𝐴≡𝛽Σ𝐵Σ;Γ⊢𝐵:𝑠
Σ;Γ⊢𝑡:𝐵
Mod-Conv
The relation ≡𝛽Σ is the compatible, reflexive, symmetric, transitive closure of beta reduction and the user rules in Σ. It is a judgment of the framework, not an object-level equality type.
For a first derivation, assume 𝖭𝖺𝗍:𝖳𝗒𝗉𝖾,𝗓:𝖭𝖺𝗍,𝗌:𝖭𝖺𝗍→𝖭𝖺𝗍,𝗉𝗅𝗎𝗌:𝖭𝖺𝗍→𝖭𝖺𝗍→𝖭𝖺𝗍. Rule Mod-Const types 𝗉𝗅𝗎𝗌, Mod-App twice types 𝗉𝗅𝗎𝗌𝗓𝑛, and Mod-Var supplies the final argument. Rule Mod-Pi forms the arrow types, while Mod-Lam types the beta redex (𝜆𝑥:𝖭𝖺𝗍.𝑥)𝑛. Thus every rule on the card has a concrete use before rewrite rules enter the signature.
A rule ℓ⟼𝑟 is admitted to the local algebraic fragment when there are a telescope Δ and a type 𝑇 such that FV(ℓ)=dom(Δ),Σ;Δ⊢ℓ:𝑇,Σ;Δ⊢𝑟:𝑇. The head of ℓ is a constant, ℓ contains no lambda abstraction, no variable from Δ occurs in function position, and each variable of Δ occurs exactly once in ℓ. The last two conditions are algebraicity and left-linearity, respectively. Raw reduction is independent of typing:
ℓ⟼𝑟∈Σ𝜃:dom(Δ)→𝖳𝖾𝗋𝗆
𝐶[ℓ𝜃]⟶Σ𝐶[𝑟𝜃]
Mod-Rewrite
𝐶[(𝜆𝑥:𝐴.𝑡)𝑢]⟶𝛽𝐶[𝑡[𝑢/𝑥]]
Mod-Beta
Here 𝐶[−] is a capture-avoiding one-hole raw-term context and 𝜃 is an arbitrary capture-avoiding raw substitution. Write ⟶𝛽Σ for ⟶𝛽∪⟶Σ. Typing constrains these raw steps only in the preservation theorem.
Add the two rules 𝗉𝗅𝗎𝗌𝗓𝑛⟼𝑛,𝗉𝗅𝗎𝗌(𝗌𝑚)𝑛⟼𝗌(𝗉𝗅𝗎𝗌𝑚𝑛). The first telescope is 𝑛:𝖭𝖺𝗍; the second is 𝑚:𝖭𝖺𝗍,𝑛:𝖭𝖺𝗍. Both sides of each rule have type 𝖭𝖺𝗍. The two roots are disjoint and left-linear. The calculation 𝗉𝗅𝗎𝗌(𝗌𝗓)(𝗌𝗓)⟶Σ𝗌(𝗉𝗅𝗎𝗌𝗓(𝗌𝗓))⟶Σ𝗌(𝗌𝗓) uses Mod-Rewrite twice. By contrast, 𝗉𝗅𝗎𝗌𝑥𝑛 is stuck when 𝑥 is neutral: neither left-hand side matches. Rule Mod-Beta separately contracts (𝜆𝑥:𝖭𝖺𝗍.𝗌𝑥)𝗓 to 𝗌𝗓.
Proof. Induct on the typing derivation. The variable case is the supplied judgment when the variable is 𝑥, and otherwise follows from the correspondingly substituted declaration. Constants and sorts are unchanged. For Mod-Pi and Mod-Lam, alpha-rename the bound variable away from FV(𝑢), apply the induction hypothesis to the domain and body premises, and rebuild the same rule. The Mod-App case uses (𝐵[𝑣/𝑦])[𝑢/𝑥]=𝐵[𝑢/𝑥][𝑣[𝑢/𝑥]/𝑦], the capture-avoiding substitution-composition equation. In the Mod-Conv case, compatibility of ≡𝛽Σ with substitution transports 𝐴≡𝛽Σ𝐵 to 𝐴[𝑢/𝑥]≡𝛽Σ𝐵[𝑢/𝑥], after which Mod-Conv rebuilds the conclusion. ◻
Under definition 97.2, write 𝜃:Δ⇒Γ when every declaration in Δ is sent to a term of its successively substituted type in Γ. If 𝜃:Δ⇒Γ, then Σ;Γ⊢ℓ𝜃:𝑇𝜃andΣ;Γ⊢𝑟𝜃:𝑇𝜃.
Proof of Lemma 97.4 — A typed rule remains typed after matching
Proof. Apply lemma 97.3 once for each declaration in the telescope Δ, from left to right. Dependency forces this order: a later component of 𝜃 is checked only after the earlier components have been substituted into its type. ◻
Let Σ be a well-formed global context in Saillard’s sense: every rewrite declaration is permanently well typed in product-compatible well-formed extensions. Assume product compatibility: ∏𝑥:𝐴1𝐵1≡𝛽Σ∏𝑥:𝐴2𝐵2⟹𝐴1≡𝛽Σ𝐴2and𝐵1≡𝛽Σ𝐵2. If Σ;Γ⊢𝑡:𝐴 and 𝑡⟶𝛽Σ𝑡′, then Σ;Γ⊢𝑡′:𝐴.
Proof of Theorem 97.5 — Subject reduction for the algebraic fragment
Proof. This is Saillard’s Subject Reduction Theorem 2.1 at the raw relation ⟶𝛽Σ[Sai15]. Its induction is on the raw reduction derivation. Product compatibility supplies beta preservation under binders, and permanent well-typedness supplies user-rule preservation in every enclosing declaration context. Lemma 97.3, Lemma 97.4 are the corresponding local substitution mechanisms; they do not replace the permanent-extension hypothesis. ◻
The product-compatibility premise is not decoration. Without injectivity of dependent products modulo conversion, inversion of application does not identify the argument domain required by the lambda body. Likewise, well-typedness of a rule only in its declaration context is insufficient when later declarations can change conversion; Saillard therefore uses permanent well-typedness over well-formed extensions.
For a well-formed global context in Saillard’s calculus:
confluence of the combined beta-and-rule relation implies product compatibility;
product compatibility and permanently well-typed rules imply subject reduction and uniqueness of types modulo ≡𝛽Σ;
if ⟶𝛽Σ is confluent and terminating and the finite set of one-step reducts of each term is computable, conversion is decidable by comparing normal forms.
None of the first two items implies the termination premise of the third.
Proof of Theorem 97.6 — The conditional metatheorem chain
Proof. For (1), reduce convertible products to a common reduct. A product at the head cannot be erased by an algebraic root; comparing the common product gives convertible domains and codomains. Item (2) is theorem 97.5 plus induction on two typing derivations: after conversion is pushed to their leaves, product compatibility makes the function domains agree. For (3), termination produces a normal form, confluence makes it unique up to alpha-equivalence, and computable finite branching makes normalization effective. Conversely, a confluent relation may admit an infinite reduction path, so confluence alone supplies no normalizer. Items (1) and (2) are Saillard’s Theorems 2.3 and 2.1–2.2; item (3) is the effective normal-form corollary, whose extra hypotheses are stated here explicitly [Sai15]. ◻
For the addition rules, the number of leading successors in the first argument decreases at the recursive root, so the user-rule relation ⟶Σ terminates. The rules are left-linear and have no critical pair, so that relation is confluent. Saillard’s imported Theorem 2.4 states that a left-algebraic, left-linear, confluent user relation makes the combined beta-and-user relation confluent [Sai15]. It does not transfer termination: no termination proof for ⟶𝛽Σ has been supplied here, so the normal-form decision procedure in item (3) is not discharged for this signature.
Left-hand lambdas require rewriting modulo beta
Ordinary matching treats beta-equivalent left sides as different syntax. A rule headed by a pattern containing an abstraction can therefore overlap with beta reduction even when its intended higher-order pattern is unambiguous. Writing the combined relation merely as ⟶𝛽∪⟶Σ hides that overlap.
Translate a 𝜆Π-pattern and its candidate instance to Nipkow’s higher-order rewrite-system representation. Define 𝑡⟶Σ𝑏𝑢 when the translations make one higher-order rewrite step at base term type. For a source rule ℓ⟼𝑟, the three admissibility conditions are: ℓ is a lambda-Pi pattern; FV(𝑟)⊆FV(ℓ); and every free variable in ℓ and 𝑟 is applied to the same number of arguments. In particular, each pattern-variable occurrence is applied only to distinct bound variables. This is not matching after arbitrary beta normalization; the HRS translation fixes the binding discipline and the substitution recovered from a match.
For a well-formed global context of lambda-Pi patterns:
⟶Σ𝑏 preserves typing;
the union ⟶𝛽∪⟶Σ𝑏 generates the same congruence ≡𝛽Σ;
confluence of the translated HRS implies product compatibility;
the paper’s pattern-typing hypotheses make an added rule permanently well typed.
Consequently subject reduction and uniqueness of types follow under those combined hypotheses. No claim is made for an arbitrary higher-order left-hand side.
Proof. Item (1) is Saillard’s Theorem 6.1: the HRS step factors into beta expansions, one typed rule instance, and beta contractions, with a well-typed intermediate chosen for a well-typed source. Lemma 6.1 defines the combined relation used in item (2), and Theorem 6.2 proves that it generates ≡𝛽Σ. Confluence then gives product compatibility by Theorem 6.3, and the lambda-Pi-pattern criterion is Theorem 6.4 [Sai15]. Combining these results with theorem 97.6 gives the conclusion. The proof does not replace HRS confluence by ordinary union confluence. ◻
An implicational encoding
Let the signature contain 𝗉𝗋𝗈𝗉:𝖳𝗒𝗉𝖾,𝗉𝗋𝖿:𝗉𝗋𝗈𝗉→𝖳𝗒𝗉𝖾,𝗂𝗆𝗉:𝗉𝗋𝗈𝗉→𝗉𝗋𝗈𝗉→𝗉𝗋𝗈𝗉 and the rule 𝗉𝗋𝖿(𝗂𝗆𝗉𝐴𝐵)⟼𝗉𝗋𝖿(𝐴)→𝗉𝗋𝖿(𝐵).(𝐼𝑚𝑝) The rule is typed in 𝐴:𝗉𝗋𝗈𝗉,𝐵:𝗉𝗋𝗈𝗉. A natural- deduction introduction Γ,𝐴⊢𝐵Γ⊢𝐴⇒𝐵 is represented by lambda abstraction. If 𝑝:𝗉𝗋𝖿(𝐴)⊢𝑡:𝗉𝗋𝖿(𝐵), then Mod-Lam gives 𝜆𝑝:𝗉𝗋𝖿(𝐴).𝑡:𝗉𝗋𝖿(𝐴)→𝗉𝗋𝖿(𝐵), and Mod-Conv with (Imp) gives it type 𝗉𝗋𝖿(𝗂𝗆𝗉𝐴𝐵). Elimination is ordinary Mod-App. A neutral proof variable remains stuck; only an application of an introduced implication produces a beta redex.
Let Ξ=𝐴1:𝗉𝗋𝗈𝗉,…,𝐴𝑚:𝗉𝗋𝗈𝗉 declare the propositional atoms, and let Γ=Ξ,𝑝1:𝗉𝗋𝖿(𝐻1),…,𝑝𝑛:𝗉𝗋𝖿(𝐻𝑛), where every 𝐻𝑖 and 𝐴 is an implicational formula over Ξ. Alpha-equivalence classes of term-level beta-eta-long normal terms Σ;Γ⊢𝑡:𝗉𝗋𝖿(𝐴), with classifiers normalized by rule (Imp), are in bijection with normal natural-deduction derivations of 𝐴 from hypotheses 𝐻1,…,𝐻𝑛.
Proof of Theorem 97.9 — Adequacy for normal implicational derivations
Proof. Map hypothesis 𝐻𝑖 to its proof variable 𝑝𝑖, implication introduction to lambda, and implication elimination to application. Rule (Imp) makes the introduction and elimination classifiers definitionally equal to the corresponding function types. Conversely, canonical-form inversion at 𝗉𝗋𝖿(𝗂𝗆𝗉𝐴𝐵) exposes a lambda, while a neutral proof exposes a head assumption followed by applications. Induction on the normal term reconstructs the unique normal derivation. The two maps commute with alpha-renaming; beta-eta-longness removes the administrative redex and eta-short alternatives. The theorem is restricted to this signature and normal forms, so it asserts neither conservativity of every encoding nor normalization of arbitrary rewrite signatures. ◻
A concrete rule-registration boundary
Cockx’s Agda interface accepts a declaration with schema ∀Δ.𝑓¯𝑝:𝐴⟼𝑣. Patterns are unapplied variables or applications of declared symbols to patterns. Registration checks that the pattern binds the variables of Δ, that both sides have the displayed type 𝐴, and that the left side is neutral. Non-linear occurrences become equality constraints during matching. These are the source’s concrete syntax and local admissibility checks [Coc20].
In the retained observational-type-theory Agda case, a proved equality is registered so that its left head and argument patterns populate 𝑓¯𝑝, its right side populates 𝑣, and its equality proof supplies the same-type check. The example then computes coercion equations through the registered rules. Registration establishes scope, typing, and a usable head pattern; it establishes neither confluence nor termination. Those global obligations remain exactly the hypotheses separated in theorem 97.6.
Dedukti and Lambdapi impose their own concrete parser and rule-admissibility contracts [Ded22, Ded25]. Their retained accept/reject tests are implementation evidence, not proofs of confluence, termination, adequacy, or conservativity. The Kappa companion below checks a finite first-order certificate boundary; it does not implement dependent conversion or higher-order matching.
★★☆ Prove lemma 97.4 for a two-variable dependent telescope 𝑥:𝐴,𝑦:𝐵(𝑥). State the type required of the second substitution component after the first is installed.
★★☆ Add the rule 𝗉𝗅𝗎𝗌𝑚𝗓⟼𝑚. List every root overlap with the two original addition rules and join the resulting critical pairs. Explain why this calculation alone does not prove termination.
★★★Practical project.lambda-pi-modulo-certificate-checker Run the chapter’s Kappa certificate checker. Require acceptance of the orthogonal addition card, rejection of an ill-typed right side, detection of one dishonest certificate containing an unjoinable root overlap at fuel 12, and refusal to advertise decidable conversion when termination is absent. Mutate the overlap traversal to return true without normalization; the named dishonest-certificate oracle must fail. Explain why the finite checker proves none of theorem 97.5, theorem 97.8.
The rule and theorem boundary follows Saillard’s public EPTCS paper [Sai15]; its printed pp. 92 and 98 were inspected directly for Theorems 2.1–2.5 and 6.1–6.4. Blanqui’s course provides the longer implementation sequence [Bla25]. Dedukti and Lambdapi are pinned implementation evidence, not theorem owners. Cockx owns the Agda rule-registration boundary [Coc20]. Rewriting in conversion is not tactic rewriting, a quotient path constructor, or permission to add unchecked recursive equations.