Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Fundamental Theorem of the Logical Relation (Theorems 3.21 & 3.23)

Proved
Abel2018.theorems_3_21_and_3_23_fundamental

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

conversion-checkingdecidabilitydependent-typeslogical-relationsnormalizationtype-theory

Section 3.6 (Theorem 3.21 & Theorem 3.23): Fundamental theorem of the logical relation parameterized by eqrel : EqRelSet for all 5 declarative judgments (FundCtxMotive, FundTypeMotive, FundTermMotive, FundTypeEqMotive, FundTermEqMotive) and identity substitution validity, implying reducibility of well-formed types, well-typed terms, and judgmentally equal types and terms in any abstract equality system eqrel.

Preamble
import Definitions.Def_Abel2018_LogicalRelation
Formal statement
namespace Abel2018

theorem theorems_3_21_and_3_23_fundamental (eqrel : EqRelSet) :
    (∀ {Γ : Context}, CtxWf Γ → FundCtxMotive eqrel Γ) ∧
    (∀ {Γ : Context} {A : Term}, TypeWf Γ A → FundTypeMotive eqrel Γ A) ∧
    (∀ {Γ : Context} {t A : Term}, HasType Γ t A → FundTermMotive eqrel Γ t A) ∧
    (∀ {Γ : Context} {A B : Term}, TypeEq Γ A B → FundTypeEqMotive eqrel Γ A B) ∧
    (∀ {Γ : Context} {t u A : Term}, TermEq Γ t u A → FundTermEqMotive eqrel Γ t u A) ∧
    (∀ {Γ Δ : Context} {σ : Subst}, CtxWf Γ → CtxWf Δ → SubstWf Δ σ Γ →
      ValidCtx eqrel Γ ∧ ValidSubst eqrel Δ σ Γ) ∧
    (∀ {Γ Δ : Context} {σ σ' : Subst}, CtxWf Γ → CtxWf Δ → SubstEq Δ σ σ' Γ →
      ValidCtx eqrel Γ ∧ ValidSubst eqrel Δ σ Γ ∧ ValidSubst eqrel Δ σ' Γ ∧
      ValidSubstEq eqrel Δ σ σ' Γ) := 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 3.6 (Theorems 3.21 and 3.23; `Fundamental.agda`).
Read-back

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

Given any parameter eqrel:EqRelSet\mathit{eqrel} : \mathsf{EqRelSet}eqrel:EqRelSet, the theorem Abel2018.theorems_3_21_and_3_23_fundamental asserts the conjunction of 7 fundamental validity implications:

  1. Fundamental theorem for contexts:
∀Γ:Context,CtxWf(Γ)→ValidCtx(eqrel,Γ).\forall \Gamma : \mathsf{Context},\quad \mathsf{CtxWf}(\Gamma) \to \mathsf{ValidCtx}(\mathit{eqrel}, \Gamma).∀Γ:Context,CtxWf(Γ)→ValidCtx(eqrel,Γ).
  1. Fundamental theorem for types:
∀Γ:Context,  ∀A:Term,TypeWf(Γ,A)→ValidCtx(eqrel,Γ)∧ValidType(eqrel,one,Γ,A).\forall \Gamma : \mathsf{Context},\; \forall A : \mathsf{Term},\quad \mathsf{TypeWf}(\Gamma, A) \to \mathsf{ValidCtx}(\mathit{eqrel}, \Gamma) \land \mathsf{ValidType}(\mathit{eqrel}, \mathsf{one}, \Gamma, A).∀Γ:Context,∀A:Term,TypeWf(Γ,A)→ValidCtx(eqrel,Γ)∧ValidType(eqrel,one,Γ,A).
  1. Fundamental theorem for terms:
∀Γ:Context,  ∀t,A:Term,HasType(Γ,t,A)→ValidCtx(eqrel,Γ)∧∃(hA:ValidType(eqrel,one,Γ,A)),  ValidTerm(hA,t).\forall \Gamma : \mathsf{Context},\; \forall t, A : \mathsf{Term},\quad \mathsf{HasType}(\Gamma, t, A) \to \mathsf{ValidCtx}(\mathit{eqrel}, \Gamma) \land \exists (\mathit{hA} : \mathsf{ValidType}(\mathit{eqrel}, \mathsf{one}, \Gamma, A)),\; \mathsf{ValidTerm}(\mathit{hA}, t).∀Γ:Context,∀t,A:Term,HasType(Γ,t,A)→ValidCtx(eqrel,Γ)∧∃(hA:ValidType(eqrel,one,Γ,A)),ValidTerm(hA,t).
  1. Fundamental theorem for type equality:
∀Γ:Context,  ∀A,B:Term,TypeEq(Γ,A,B)→ValidCtx(eqrel,Γ)∧∃(hA:ValidType(eqrel,one,Γ,A)),  ValidType(eqrel,one,Γ,B)∧ValidTypeEq(hA,B).\forall \Gamma : \mathsf{Context},\; \forall A, B : \mathsf{Term},\quad \mathsf{TypeEq}(\Gamma, A, B) \to \mathsf{ValidCtx}(\mathit{eqrel}, \Gamma) \land \exists (\mathit{hA} : \mathsf{ValidType}(\mathit{eqrel}, \mathsf{one}, \Gamma, A)),\; \mathsf{ValidType}(\mathit{eqrel}, \mathsf{one}, \Gamma, B) \land \mathsf{ValidTypeEq}(\mathit{hA}, B).∀Γ:Context,∀A,B:Term,TypeEq(Γ,A,B)→ValidCtx(eqrel,Γ)∧∃(hA:ValidType(eqrel,one,Γ,A)),ValidType(eqrel,one,Γ,B)∧ValidTypeEq(hA,B).
  1. Fundamental theorem for term equality:
∀Γ:Context,  ∀t,u,A:Term,TermEq(Γ,t,u,A)→ValidCtx(eqrel,Γ)∧ModelsTermEq(eqrel,one,Γ,t,u,A).\forall \Gamma : \mathsf{Context},\; \forall t, u, A : \mathsf{Term},\quad \mathsf{TermEq}(\Gamma, t, u, A) \to \mathsf{ValidCtx}(\mathit{eqrel}, \Gamma) \land \mathsf{ModelsTermEq}(\mathit{eqrel}, \mathsf{one}, \Gamma, t, u, A).∀Γ:Context,∀t,u,A:Term,TermEq(Γ,t,u,A)→ValidCtx(eqrel,Γ)∧ModelsTermEq(eqrel,one,Γ,t,u,A).
  1. Fundamental theorem for well-formed substitutions:
∀Γ,Δ:Context,  ∀σ:Subst,CtxWf(Γ)→CtxWf(Δ)→SubstWf(Δ,σ,Γ)→ValidCtx(eqrel,Γ)∧ValidSubst(eqrel,Δ,σ,Γ).\forall \Gamma, \Delta : \mathsf{Context},\; \forall \sigma : \mathsf{Subst},\quad \mathsf{CtxWf}(\Gamma) \to \mathsf{CtxWf}(\Delta) \to \mathsf{SubstWf}(\Delta, \sigma, \Gamma) \to \mathsf{ValidCtx}(\mathit{eqrel}, \Gamma) \land \mathsf{ValidSubst}(\mathit{eqrel}, \Delta, \sigma, \Gamma).∀Γ,Δ:Context,∀σ:Subst,CtxWf(Γ)→CtxWf(Δ)→SubstWf(Δ,σ,Γ)→ValidCtx(eqrel,Γ)∧ValidSubst(eqrel,Δ,σ,Γ).
  1. Fundamental theorem for equal substitutions:
∀Γ,Δ:Context,  ∀σ,σ′:Subst,CtxWf(Γ)→CtxWf(Δ)→SubstEq(Δ,σ,σ′,Γ)→ValidCtx(eqrel,Γ)∧ValidSubst(eqrel,Δ,σ,Γ)∧ValidSubst(eqrel,Δ,σ′,Γ)∧ValidSubstEq(eqrel,Δ,σ,σ′,Γ).\forall \Gamma, \Delta : \mathsf{Context},\; \forall \sigma, \sigma' : \mathsf{Subst},\quad \mathsf{CtxWf}(\Gamma) \to \mathsf{CtxWf}(\Delta) \to \mathsf{SubstEq}(\Delta, \sigma, \sigma', \Gamma) \to \mathsf{ValidCtx}(\mathit{eqrel}, \Gamma) \land \mathsf{ValidSubst}(\mathit{eqrel}, \Delta, \sigma, \Gamma) \land \mathsf{ValidSubst}(\mathit{eqrel}, \Delta, \sigma', \Gamma) \land \mathsf{ValidSubstEq}(\mathit{eqrel}, \Delta, \sigma, \sigma', \Gamma).∀Γ,Δ:Context,∀σ,σ′:Subst,CtxWf(Γ)→CtxWf(Δ)→SubstEq(Δ,σ,σ′,Γ)→ValidCtx(eqrel,Γ)∧ValidSubst(eqrel,Δ,σ,Γ)∧ValidSubst(eqrel,Δ,σ′,Γ)∧ValidSubstEq(eqrel,Δ,σ,σ′,Γ).
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