Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Metatheoretic Consequences: Constructor Disjointness, Pi-Injectivity, Validity, Normalization, Canonicity, Substitution & Consistency (Theorems 3.24-3.35)

Proved
Abel2018.theorems_3_24_to_3_35_consequences

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

conversion-checkingdecidabilitydependent-typeslogical-relationsnormalizationtype-theory

Section 3.7 (Theorems 3.24, 3.25, 3.26, 3.28, 3.30, 3.31, 3.32 & 3.35): Full suite of 15 metatheoretic consequences of the fundamental theorem instantiated at the declarative EqRelSet instance (synEqRel): type constructor disjointness (U ≠ nat, nat ≠ pi, Theorem 3.24), Pi-type injectivity (Theorem 3.25), syntactic validity for TypeEq, HasType, and TermEq (Theorem 3.26), weak-head normalization for types and terms (Theorem 3.28), canonicity for closed terms of type nat (Theorem 3.30), syntactic substitution preservation and congruence across all 4 judgments (Theorem 3.31), substitution composition well-formedness (Theorem 3.32), and Peano disjointness ¬ TermEq Γ .zero (.succ n) .nat in arbitrary contexts Γ (Theorem 3.35).

Preamble
import Definitions.Def_Abel2018_LogicalRelation
Formal statement
namespace Abel2018

theorem theorems_3_24_to_3_35_consequences :
    (∀ {Γ : Context}, ¬ TypeEq Γ .univ .nat) ∧
    (∀ {Γ : Context} {F G : Term}, ¬ TypeEq Γ .nat (.pi F G)) ∧
    (∀ {Γ : Context} {F G H E : Term}, TypeEq Γ (.pi F G) (.pi H E) →
      TypeEq Γ F H ∧ TypeEq (F :: Γ) G E) ∧
    (∀ {Γ : Context} {A B : Term}, TypeEq Γ A B →
      TypeWf Γ A ∧ TypeWf Γ B) ∧
    (∀ {Γ : Context} {t A : Term}, HasType Γ t A →
      TypeWf Γ A) ∧
    (∀ {Γ : Context} {t u A : Term}, TermEq Γ t u A →
      TypeWf Γ A ∧ HasType Γ t A ∧ HasType Γ u A) ∧
    (∀ {Γ : Context} {A : Term}, TypeWf Γ A →
      ∃ B, Whnf B ∧ TypeStarWf Γ A B) ∧
    (∀ {Γ : Context} {a A : Term}, HasType Γ a A →
      ∃ b, Whnf b ∧ StarWf Γ a b A) ∧
    (∀ {t : Term}, HasType [] t .nat →
      ∃ k, TermEq [] t (suck k) .nat) ∧
    (∀ {Γ Δ : Context} {A : Term} {σ : Subst},
      TypeWf Γ A → SubstWf Δ σ Γ → CtxWf Δ →
      TypeWf Δ (subst σ A)) ∧
    (∀ {Γ Δ : Context} {A B : Term} {σ σ' : Subst},
      TypeEq Γ A B → SubstEq Δ σ σ' Γ → CtxWf Δ →
      TypeEq Δ (subst σ A) (subst σ' B)) ∧
    (∀ {Γ Δ : Context} {t A : Term} {σ : Subst},
      HasType Γ t A → SubstWf Δ σ Γ → CtxWf Δ →
      HasType Δ (subst σ t) (subst σ A)) ∧
    (∀ {Γ Δ : Context} {t u A : Term} {σ σ' : Subst},
      TermEq Γ t u A → SubstEq Δ σ σ' Γ → CtxWf Δ →
      TermEq Δ (subst σ t) (subst σ' u) (subst σ A)) ∧
    (∀ {σ σ' : Subst} {Γ Δ Δ' : Context},
      CtxWf Γ → CtxWf Δ → CtxWf Δ' →
      SubstWf Δ' σ Δ → SubstWf Δ σ' Γ →
      SubstWf Δ' (compSubst σ σ') Γ) ∧
    (∀ {Γ : Context} {n : Term},
      ¬ TermEq Γ .zero (.succ n) .nat) := 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.7 (Theorems 3.24, 3.25, 3.26, 3.28, 3.30, 3.31, 3.32, and 3.35; `Consequences.agda` and ` Substitution.agda`).
Read-back

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

The theorem Abel2018.theorems_3_24_to_3_35_consequences asserts the conjunction of 15 metatheoretic consequences:

  1. Type constructor disjointness (U≢N\mathcal{U} \not\equiv \mathbb{N}U≡N):
∀Γ:Context,¬ TypeEq(Γ,univ,nat).\forall \Gamma : \mathsf{Context},\quad \neg\,\mathsf{TypeEq}(\Gamma, \mathsf{univ}, \mathsf{nat}).∀Γ:Context,¬TypeEq(Γ,univ,nat).
  1. Type constructor disjointness (N≢ΠF. G\mathbb{N} \not\equiv \Pi F.\,GN≡ΠF.G):
∀Γ:Context,  ∀F,G:Term,¬ TypeEq(Γ,nat,pi(F,G)).\forall \Gamma : \mathsf{Context},\; \forall F, G : \mathsf{Term},\quad \neg\,\mathsf{TypeEq}(\Gamma, \mathsf{nat}, \mathsf{pi}(F, G)).∀Γ:Context,∀F,G:Term,¬TypeEq(Γ,nat,pi(F,G)).
  1. Injectivity of Π\PiΠ-type equality:
∀Γ:Context,  ∀F,G,H,E:Term,TypeEq(Γ,pi(F,G),pi(H,E))→TypeEq(Γ,F,H)∧TypeEq(F::Γ,G,E).\forall \Gamma : \mathsf{Context},\; \forall F, G, H, E : \mathsf{Term},\quad \mathsf{TypeEq}(\Gamma, \mathsf{pi}(F, G), \mathsf{pi}(H, E)) \to \mathsf{TypeEq}(\Gamma, F, H) \land \mathsf{TypeEq}(F :: \Gamma, G, E).∀Γ:Context,∀F,G,H,E:Term,TypeEq(Γ,pi(F,G),pi(H,E))→TypeEq(Γ,F,H)∧TypeEq(F::Γ,G,E).
  1. Syntactic validity of judgmental type equality:
∀Γ:Context,  ∀A,B:Term,TypeEq(Γ,A,B)→TypeWf(Γ,A)∧TypeWf(Γ,B).\forall \Gamma : \mathsf{Context},\; \forall A, B : \mathsf{Term},\quad \mathsf{TypeEq}(\Gamma, A, B) \to \mathsf{TypeWf}(\Gamma, A) \land \mathsf{TypeWf}(\Gamma, B).∀Γ:Context,∀A,B:Term,TypeEq(Γ,A,B)→TypeWf(Γ,A)∧TypeWf(Γ,B).
  1. Syntactic validity of term typing:
∀Γ:Context,  ∀t,A:Term,HasType(Γ,t,A)→TypeWf(Γ,A).\forall \Gamma : \mathsf{Context},\; \forall t, A : \mathsf{Term},\quad \mathsf{HasType}(\Gamma, t, A) \to \mathsf{TypeWf}(\Gamma, A).∀Γ:Context,∀t,A:Term,HasType(Γ,t,A)→TypeWf(Γ,A).
  1. Syntactic validity of judgmental term equality:
∀Γ:Context,  ∀t,u,A:Term,TermEq(Γ,t,u,A)→TypeWf(Γ,A)∧HasType(Γ,t,A)∧HasType(Γ,u,A).\forall \Gamma : \mathsf{Context},\; \forall t, u, A : \mathsf{Term},\quad \mathsf{TermEq}(\Gamma, t, u, A) \to \mathsf{TypeWf}(\Gamma, A) \land \mathsf{HasType}(\Gamma, t, A) \land \mathsf{HasType}(\Gamma, u, A).∀Γ:Context,∀t,u,A:Term,TermEq(Γ,t,u,A)→TypeWf(Γ,A)∧HasType(Γ,t,A)∧HasType(Γ,u,A).
  1. Weak-head normalization of well-formed types:
∀Γ:Context,  ∀A:Term,TypeWf(Γ,A)→∃B:Term,  Whnf(B)∧TypeStarWf(Γ,A,B).\forall \Gamma : \mathsf{Context},\; \forall A : \mathsf{Term},\quad \mathsf{TypeWf}(\Gamma, A) \to \exists B : \mathsf{Term},\; \mathsf{Whnf}(B) \land \mathsf{TypeStarWf}(\Gamma, A, B).∀Γ:Context,∀A:Term,TypeWf(Γ,A)→∃B:Term,Whnf(B)∧TypeStarWf(Γ,A,B).
  1. Weak-head normalization of well-typed terms:
∀Γ:Context,  ∀a,A:Term,HasType(Γ,a,A)→∃b:Term,  Whnf(b)∧StarWf(Γ,a,b,A).\forall \Gamma : \mathsf{Context},\; \forall a, A : \mathsf{Term},\quad \mathsf{HasType}(\Gamma, a, A) \to \exists b : \mathsf{Term},\; \mathsf{Whnf}(b) \land \mathsf{StarWf}(\Gamma, a, b, A).∀Γ:Context,∀a,A:Term,HasType(Γ,a,A)→∃b:Term,Whnf(b)∧StarWf(Γ,a,b,A).
  1. Canonicity for closed terms of type N\mathbb{N}N:
∀t:Term,HasType([],t,nat)→∃k:N,  TermEq([],t,suck(k),nat).\forall t : \mathsf{Term},\quad \mathsf{HasType}([], t, \mathsf{nat}) \to \exists k : \mathbb{N},\; \mathsf{TermEq}([], t, \mathsf{suck}(k), \mathsf{nat}).∀t:Term,HasType([],t,nat)→∃k:N,TermEq([],t,suck(k),nat).
  1. Well-formed type preservation under substitution:
∀Γ,Δ:Context,  ∀A:Term,  ∀σ:Subst,TypeWf(Γ,A)→SubstWf(Δ,σ,Γ)→CtxWf(Δ)→TypeWf(Δ,subst(σ,A)).\forall \Gamma, \Delta : \mathsf{Context},\; \forall A : \mathsf{Term},\; \forall \sigma : \mathsf{Subst},\quad \mathsf{TypeWf}(\Gamma, A) \to \mathsf{SubstWf}(\Delta, \sigma, \Gamma) \to \mathsf{CtxWf}(\Delta) \to \mathsf{TypeWf}(\Delta, \mathsf{subst}(\sigma, A)).∀Γ,Δ:Context,∀A:Term,∀σ:Subst,TypeWf(Γ,A)→SubstWf(Δ,σ,Γ)→CtxWf(Δ)→TypeWf(Δ,subst(σ,A)).
  1. Judgmental type equality congruence under equal substitutions:
∀Γ,Δ:Context,  ∀A,B:Term,  ∀σ,σ′:Subst,TypeEq(Γ,A,B)→SubstEq(Δ,σ,σ′,Γ)→CtxWf(Δ)→TypeEq(Δ,subst(σ,A),subst(σ′,B)).\forall \Gamma, \Delta : \mathsf{Context},\; \forall A, B : \mathsf{Term},\; \forall \sigma, \sigma' : \mathsf{Subst},\quad \mathsf{TypeEq}(\Gamma, A, B) \to \mathsf{SubstEq}(\Delta, \sigma, \sigma', \Gamma) \to \mathsf{CtxWf}(\Delta) \to \mathsf{TypeEq}(\Delta, \mathsf{subst}(\sigma, A), \mathsf{subst}(\sigma', B)).∀Γ,Δ:Context,∀A,B:Term,∀σ,σ′:Subst,TypeEq(Γ,A,B)→SubstEq(Δ,σ,σ′,Γ)→CtxWf(Δ)→TypeEq(Δ,subst(σ,A),subst(σ′,B)).
  1. Term typing preservation under substitution:
∀Γ,Δ:Context,  ∀t,A:Term,  ∀σ:Subst,HasType(Γ,t,A)→SubstWf(Δ,σ,Γ)→CtxWf(Δ)→HasType(Δ,subst(σ,t),subst(σ,A)).\forall \Gamma, \Delta : \mathsf{Context},\; \forall t, A : \mathsf{Term},\; \forall \sigma : \mathsf{Subst},\quad \mathsf{HasType}(\Gamma, t, A) \to \mathsf{SubstWf}(\Delta, \sigma, \Gamma) \to \mathsf{CtxWf}(\Delta) \to \mathsf{HasType}(\Delta, \mathsf{subst}(\sigma, t), \mathsf{subst}(\sigma, A)).∀Γ,Δ:Context,∀t,A:Term,∀σ:Subst,HasType(Γ,t,A)→SubstWf(Δ,σ,Γ)→CtxWf(Δ)→HasType(Δ,subst(σ,t),subst(σ,A)).
  1. Judgmental term equality congruence under equal substitutions:
∀Γ,Δ:Context,  ∀t,u,A:Term,  ∀σ,σ′:Subst,TermEq(Γ,t,u,A)→SubstEq(Δ,σ,σ′,Γ)→CtxWf(Δ)→TermEq(Δ,subst(σ,t),subst(σ′,u),subst(σ,A)).\forall \Gamma, \Delta : \mathsf{Context},\; \forall t, u, A : \mathsf{Term},\; \forall \sigma, \sigma' : \mathsf{Subst},\quad \mathsf{TermEq}(\Gamma, t, u, A) \to \mathsf{SubstEq}(\Delta, \sigma, \sigma', \Gamma) \to \mathsf{CtxWf}(\Delta) \to \mathsf{TermEq}(\Delta, \mathsf{subst}(\sigma, t), \mathsf{subst}(\sigma', u), \mathsf{subst}(\sigma, A)).∀Γ,Δ:Context,∀t,u,A:Term,∀σ,σ′:Subst,TermEq(Γ,t,u,A)→SubstEq(Δ,σ,σ′,Γ)→CtxWf(Δ)→TermEq(Δ,subst(σ,t),subst(σ′,u),subst(σ,A)).
  1. Well-formedness of substitution composition:
∀σ,σ′:Subst,  ∀Γ,Δ,Δ′:Context,CtxWf(Γ)→CtxWf(Δ)→CtxWf(Δ′)→SubstWf(Δ′,σ,Δ)→SubstWf(Δ,σ′,Γ)→SubstWf(Δ′,compSubst(σ,σ′),Γ).\forall \sigma, \sigma' : \mathsf{Subst},\; \forall \Gamma, \Delta, \Delta' : \mathsf{Context},\quad \mathsf{CtxWf}(\Gamma) \to \mathsf{CtxWf}(\Delta) \to \mathsf{CtxWf}(\Delta') \to \mathsf{SubstWf}(\Delta', \sigma, \Delta) \to \mathsf{SubstWf}(\Delta, \sigma', \Gamma) \to \mathsf{SubstWf}(\Delta', \mathsf{compSubst}(\sigma, \sigma'), \Gamma).∀σ,σ′:Subst,∀Γ,Δ,Δ′:Context,CtxWf(Γ)→CtxWf(Δ)→CtxWf(Δ′)→SubstWf(Δ′,σ,Δ)→SubstWf(Δ,σ′,Γ)→SubstWf(Δ′,compSubst(σ,σ′),Γ).
  1. Peano disjointness (0≢succ(n)0 \not\equiv \mathsf{succ}(n)0≡succ(n) in any context Γ\GammaΓ):
∀Γ:Context,  ∀n:Term,¬ TermEq(Γ,zero,succ(n),nat).\forall \Gamma : \mathsf{Context},\; \forall n : \mathsf{Term},\quad \neg\,\mathsf{TermEq}(\Gamma, \mathsf{zero}, \mathsf{succ}(n), \mathsf{nat}).∀Γ:Context,∀n:Term,¬TermEq(Γ,zero,succ(n),nat).
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