Equivalence of single-judgment and mutually inductive typing formulations

Establish the equivalence between (i) the single all-in-one typed definitional equality judgment Γ ⊢ e₁ ≡ e₂ : α used in Lean4Lean (with Γ ⊢ e : α defined as Γ ⊢ e ≡ e : α and Γ ⊢ e₁ ≡ e₂ defined as ∃α. Γ ⊢ e₁ ≡ e₂ : α) and (ii) the mutually inductive two-judgment formulation used in the Lean type theory formalization, consisting of Γ ⊢ e : α and Γ ⊢ e₁ ≡ e₂, where Γ ⊢ e₁ ≡ e₂ : α is defined as the conjunction Γ ⊢ e₁ ≡ e₂ ∧ Γ ⊢ e₁ : α ∧ Γ ⊢ e₂ : α.

Background

The paper contrasts two formulations of the typing and definitional equality judgments used to specify Lean’s metatheory. The original formulation (as in the Lean type theory formalization) uses two mutually inductive judgments: Γ ⊢ e : α and Γ ⊢ e₁ ≡ e₂, with a defined notion of typed equality Γ ⊢ e₁ ≡ e₂ : α requiring both terms to have type α and to be definitionally equal. Lean4Lean instead adopts a single, typed definitional equality relation Γ ⊢ e₁ ≡ e₂ : α and defines Γ ⊢ e : α and untyped equality Γ ⊢ e₁ ≡ e₂ in terms of it.

The authors conjecture that these two formulations are equivalent, noting the single-judgment approach simplifies structural proofs and avoids Lean’s poor support for mutual inductive predicates. Proving this equivalence would justify using the simpler single-judgment framework without losing generality.

References

We conjecture the two formulations to be equivalent, but this version seems to be easier to prove basic structural properties about (see Section 2.3). Moreover Lean does not have good support for mutual inductive predicates, so keeping it as a single inductive makes induction proofs easier.

Lean4Lean: Towards a Verified Typechecker for Lean, in Lean  (2403.14064 - Carneiro, 2024) in Section 2.2 (Typing and definitional equality), first remark after Figure 1