Computational Adequacy of the Fuel-Bounded Lean Conversion Checkers (Based on Theorem 4.12)
ProvedAbel2018.theorem_4_12_computationalby kmehltretter82 · Nov 7, 2026 · Mathlib 0df444a (Lean v4.33.1)
conversion-checkingdecidabilitydependent-typeslogical-relationsnormalizationtype-theory
Main Goal — Computational adequacy of the fuel-bounded Lean conversion checkers compareTypeUp and compareTermUp (based on Theorem 4.12): for all well-formed types TypeWf Γ A, TypeWf Γ B and well-typed terms HasType Γ t A, HasType Γ u A, there exists a finite fuel budget at which compareTypeUp / compareTermUp terminates with some b, and for every fuel budget at which it returns some b, b = true holds if and only if declarative equality (TypeEq Γ A B / TermEq Γ t u A) holds.
Preamble
import Definitions.Def_Abel2018_LogicalRelation
Formal statement
namespace Abel2018
theorem theorem_4_12_computational :
(∀ (Γ : Context) (A B : Term), TypeWf Γ A → TypeWf Γ B →
(∃ fuel b, compareTypeUp fuel Γ A B = some b) ∧
(∀ fuel b, compareTypeUp fuel Γ A B = some b →
(b = true ↔ TypeEq Γ A B))) ∧
(∀ (Γ : Context) (t u A : Term), HasType Γ t A → HasType Γ u A →
(∃ fuel b, compareTermUp fuel Γ t u A = some b) ∧
(∀ fuel b, compareTermUp fuel Γ t u A = some b →
(b = true ↔ TermEq Γ t u A))) := by sorry
end Abel2018Source
Andreas Abel, Joakim Öhman, and Andrea Vezzosi, 'Decidability of Conversion for Type Theory in Type Theory', Proceedings of the ACM on Programming Languages (PACMPL), Vol. 2, No. POPL, Article 23, January 2018, pp. 23:1-23:29 (doi:10.1145/3158111). Mechanized Agda artifact: https://github.com/mr-ohman/logrel-mltt (commit eb2b15ab1c4b45923025834d3bb798943cb44b8e). Section 4.3 (Theorem 4.12; computational adequacy of the fuel-bounded Lean conversion checker).
Read-back
What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)
The theorem Abel2018.theorem_4_12_computational asserts the conjunction of 2 computational adequacy properties (based on Theorem 4.12) for the executable fuel-indexed checkers compareTypeUp and compareTermUp:
- Computational adequacy of type conversion (
compareTypeUp):
For all Γ:Context and A,B:Term, if TypeWf(Γ,A) and TypeWf(Γ,B), then:
- Termination: ∃fuel:N,∃b:Bool,compareTypeUp(fuel,Γ,A,B)=some(b), and
- Soundness and Completeness at any terminating fuel:
∀fuel:N,∀b:Bool,compareTypeUp(fuel,Γ,A,B)=some(b)→(b=true↔TypeEq(Γ,A,B)).
- Computational adequacy of term conversion (
compareTermUp):
For all Γ:Context and t,u,A:Term, if HasType(Γ,t,A) and HasType(Γ,u,A), then:
- Termination: ∃fuel:N,∃b:Bool,compareTermUp(fuel,Γ,t,u,A)=some(b), and
- Soundness and Completeness at any terminating fuel:
∀fuel:N,∀b:Bool,compareTermUp(fuel,Γ,t,u,A)=some(b)→(b=true↔TermEq(Γ,t,u,A)).View graph
Confirmed by the moderator at approval.