Unique typing for the typed definitional equality system

Prove that in the Lean4Lean typed definitional equality system, if Γ ⊢ e : α and Γ ⊢ e : β, then there exists a universe level ℓ such that Γ ⊢ α ≡ β : U_ℓ.

Background

Unique typing (sometimes called principal typing) ensures that a term’s type is unique up to definitional equality, which significantly simplifies metatheoretic reasoning. The paper lists several corollaries that follow from unique typing, such as type-agnostic transitivity of definitional equality and an equivalence between typed and untyped formulations of equality.

In earlier work, these results were claimed as theorems, but here they are presented as conjectures because of a discovered error in a technical lemma used by the original proof. Establishing unique typing is important for proving correctness properties of the kernel and for simplifying the metatheory.

References

Conjecture [Unique typing] If Γ ⊢ e : α and Γ ⊢ e : β, then Γ ⊢ α ≡ β : U_ℓ for some ℓ.

Lean4Lean: Towards a Verified Typechecker for Lean, in Lean  (2403.14064 - Carneiro, 2024) in Section 2.4 (Conjectured properties of the typing judgment)