Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Decidability of Algorithmic and Declarative Conversion (Theorems 4.5 & 4.12)

Proved
Abel2018.theorems_4_5_and_4_12_decidability

by kmehltretter82 · Nov 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

conversion-checkingdecidabilitydependent-typeslogical-relationsnormalizationtype-theory

Section 4.2 (Theorem 4.5) & Section 4.3 (Theorem 4.12): Fuel-bounded executable decidability of algorithmic conversion (compareTypeUp, compareTermUp) on algorithmically reflexive inputs (ConvTypeUp Γ A A, ConvTermUp Γ t t A) and decidability (P ∨ ¬P) of declarative type and term equality (TypeEq, TermEq, corresponding to dec and decTerm in Decidability.agda).

Preamble
import Definitions.Def_Abel2018_LogicalRelation
Formal statement
namespace Abel2018

theorem theorems_4_5_and_4_12_decidability :
    (∀ {Γ Δ : Context} {A B : Term},
      ConvTypeUp Γ A A → ConvTypeUp Δ B B → CtxEq Γ Δ →
      ∃ fuel b, compareTypeUp fuel Γ A B = some b ∧
        (b = true ↔ ConvTypeUp Γ A B)) ∧
    (∀ {Γ Δ : Context} {t u A B : Term},
      ConvTermUp Γ t t A → ConvTermUp Δ u u B → CtxEq Γ Δ → TypeEq Δ A B →
      ∃ fuel b, compareTermUp fuel Γ t u A = some b ∧
        (b = true ↔ ConvTermUp Γ t u A)) ∧
    (∀ {Γ : Context} {A B : Term},
      TypeWf Γ A → TypeWf Γ B →
      TypeEq Γ A B ∨ ¬ TypeEq Γ A B) ∧
    (∀ {Γ : Context} {t u A : Term},
      HasType Γ t A → HasType Γ u A →
      TermEq Γ t u A ∨ ¬ TermEq Γ t u A) := by sorry

end Abel2018
Source
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.2 (Theorem 4.5) and Section 4.3 (Theorem 4.12; `Decidability.agda`, `dec` and `decTerm`).
Read-back

What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)

The theorem Abel2018.theorems_4_5_and_4_12_decidability asserts the conjunction of 4 decidability properties for algorithmic conversion and declarative judgmental equality:

  1. Executable decidability of algorithmic type conversion (compareTypeUp):
∀Γ,Δ:Context,  ∀A,B:Term,ConvTypeUp(Γ,A,A)→ConvTypeUp(Δ,B,B)→CtxEq(Γ,Δ)→∃fuel:N,  ∃b:Bool,  compareTypeUp(fuel,Γ,A,B)=some(b)∧(b=true↔ConvTypeUp(Γ,A,B)).\forall \Gamma, \Delta : \mathsf{Context},\; \forall A, B : \mathsf{Term},\quad \mathsf{ConvTypeUp}(\Gamma, A, A) \to \mathsf{ConvTypeUp}(\Delta, B, B) \to \mathsf{CtxEq}(\Gamma, \Delta) \to \exists \mathit{fuel} : \mathbb{N},\; \exists b : \mathsf{Bool},\; \mathsf{compareTypeUp}(\mathit{fuel}, \Gamma, A, B) = \mathsf{some}(b) \land \big(b = \mathsf{true} \leftrightarrow \mathsf{ConvTypeUp}(\Gamma, A, B)\big).∀Γ,Δ:Context,∀A,B:Term,ConvTypeUp(Γ,A,A)→ConvTypeUp(Δ,B,B)→CtxEq(Γ,Δ)→∃fuel:N,∃b:Bool,compareTypeUp(fuel,Γ,A,B)=some(b)∧(b=true↔ConvTypeUp(Γ,A,B)).
  1. Executable decidability of algorithmic term conversion (compareTermUp):
∀Γ,Δ:Context,  ∀t,u,A,B:Term,ConvTermUp(Γ,t,t,A)→ConvTermUp(Δ,u,u,B)→CtxEq(Γ,Δ)→TypeEq(Δ,A,B)→∃fuel:N,  ∃b:Bool,  compareTermUp(fuel,Γ,t,u,A)=some(b)∧(b=true↔ConvTermUp(Γ,t,u,A)).\forall \Gamma, \Delta : \mathsf{Context},\; \forall t, u, A, B : \mathsf{Term},\quad \mathsf{ConvTermUp}(\Gamma, t, t, A) \to \mathsf{ConvTermUp}(\Delta, u, u, B) \to \mathsf{CtxEq}(\Gamma, \Delta) \to \mathsf{TypeEq}(\Delta, A, B) \to \exists \mathit{fuel} : \mathbb{N},\; \exists b : \mathsf{Bool},\; \mathsf{compareTermUp}(\mathit{fuel}, \Gamma, t, u, A) = \mathsf{some}(b) \land \big(b = \mathsf{true} \leftrightarrow \mathsf{ConvTermUp}(\Gamma, t, u, A)\big).∀Γ,Δ:Context,∀t,u,A,B:Term,ConvTermUp(Γ,t,t,A)→ConvTermUp(Δ,u,u,B)→CtxEq(Γ,Δ)→TypeEq(Δ,A,B)→∃fuel:N,∃b:Bool,compareTermUp(fuel,Γ,t,u,A)=some(b)∧(b=true↔ConvTermUp(Γ,t,u,A)).
  1. Decidability of declarative type equality:
∀Γ:Context,  ∀A,B:Term,TypeWf(Γ,A)→TypeWf(Γ,B)→(TypeEq(Γ,A,B)∨¬ TypeEq(Γ,A,B)).\forall \Gamma : \mathsf{Context},\; \forall A, B : \mathsf{Term},\quad \mathsf{TypeWf}(\Gamma, A) \to \mathsf{TypeWf}(\Gamma, B) \to \big(\mathsf{TypeEq}(\Gamma, A, B) \lor \neg\,\mathsf{TypeEq}(\Gamma, A, B)\big).∀Γ:Context,∀A,B:Term,TypeWf(Γ,A)→TypeWf(Γ,B)→(TypeEq(Γ,A,B)∨¬TypeEq(Γ,A,B)).
  1. Decidability of declarative term equality:
∀Γ:Context,  ∀t,u,A:Term,HasType(Γ,t,A)→HasType(Γ,u,A)→(TermEq(Γ,t,u,A)∨¬ TermEq(Γ,t,u,A)).\forall \Gamma : \mathsf{Context},\; \forall t, u, A : \mathsf{Term},\quad \mathsf{HasType}(\Gamma, t, A) \to \mathsf{HasType}(\Gamma, u, A) \to \big(\mathsf{TermEq}(\Gamma, t, u, A) \lor \neg\,\mathsf{TermEq}(\Gamma, t, u, A)\big).∀Γ:Context,∀t,u,A:Term,HasType(Γ,t,A)→HasType(Γ,u,A)→(TermEq(Γ,t,u,A)∨¬TermEq(Γ,t,u,A)).
Human review
  • Endorsed by Shuze Chen · Nov 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by kmehltretter82 · Nov 7, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me