Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Inversion, Normalization, and Strong Completeness Theorem for pr-Models

Open
BergerSchwichtenberg1991.completeness_pr_models

by kmehltretter82 · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

completenesslambda-calculusnormalization-by-evaluationsemanticstype-theory

In any pr-model M, there is a λ-definable functional inv_ρ : M^ρ → M^o computing the Gödel number of the long β-normal form of any closed λ-term denoting a ∈ M^ρ, and M ⊨ r = s implies r =_{βη} s (Section 4, p. 208).

Preamble
import Definitions.Def_BergerSchwichtenberg1991_Models
Formal statement
namespace BergerSchwichtenberg1991

universe u

theorem completeness_pr_models :
    (∀ (M : PRModel.{u}) (N : EffectiveNumbering)
       (hExtractComb :
         ∀ indextBar : M.Dom (.arr .base (.arr .base .base)),
           ∃ extractBar : M.Dom (.arr (.arr .base .base) .base),
             ∀ a : M.Dom (.arr .base .base),
               M.eqM .base (M.appM extractBar a)
                 (M.appM a
                   (M.appM
                     (M.appM indextBar (M.appM a (M.nu (N.natOfIdx epsIdx))))
                     (M.appM a (M.nu (N.natOfIdx zeroIdx))))))
       (hStepComb :
         ∀ (abstBar : Ty → M.Dom (.arr .base (.arr .base .base)))
           (funBar appendBar : M.Dom (.arr .base (.arr .base .base)))
           (ρ : Ty) (body : M.Dom .base → M.Dom .base),
           (∀ p₁ p₂ : M.Dom .base, M.eqM .base p₁ p₂ → M.eqM .base (body p₁) (body p₂)) →
           ∃ step : M.Dom (.arr .base .base),
             ∀ p : M.Dom .base,
               M.eqM .base (M.appM step p)
                 (M.appM (M.appM (abstBar ρ) p)
                   (M.appM (M.appM funBar (body p))
                     (M.appM (M.appM appendBar p) (M.nu (N.natOfIdx zeroIdx))))))
       (hIF :
         ∀ A : AdmissibleModel.{u},
           A.toLambdaModel = M.toLambdaModel →
           Nonempty (InversionFunctionals A)),
      ∃ (A : AdmissibleModel.{u}) (IF : InversionFunctionals A),
        A.toLambdaModel = M.toLambdaModel ∧
        (∀ t : Term, HEq (A.codeTerm t) (M.nu (N.natOfTerm t))) ∧
        (∀ (ρ : Ty) (a : A.Dom ρ),
          A.IsLambdaDefinable ρ a →
          ∃ r : Term,
            HasType r ρ ∧
            IsClosed r ∧
            IsLongBetaNormal ρ r ∧
            A.eqM .base (IF.invCode ρ a) (A.codeTerm r) ∧
            ∀ η : A.Env, A.eqM ρ (A.eval r η ρ) a) ∧
        (∀ (ρ : Ty) (r s : Term),
          HasType r ρ →
          HasType s ρ →
          M.ModelsEq ρ r s →
          BetaEtaEq r s)) := by sorry

end BergerSchwichtenberg1991
Source
Ulrich Berger and Helmut Schwichtenberg, 'An inverse of the evaluation functional for typed λ-calculus', Proceedings of the Sixth Annual IEEE Symposium on Logic in Computer Science (LICS 1991), pp. 203-211 (doi:10.1109/LICS.1991.151645). Inversion and Normalization Theorem & Completeness Theorem, p. 208.
Read-back

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

Read-back: Thm_BergerSchwichtenberg1991_completeness_pr_models.lean

completeness_pr_models — For every primitive recursive λ\lambdaλ-model M:PRModelM : \mathrm{PRModel}M:PRModel in universe uuu and every effective numbering N:EffectiveNumberingN : \mathrm{EffectiveNumbering}N:EffectiveNumbering, given three combinator- and functional-existence hypotheses:

  1. (hExtractComb) for every binary operation indext‾∈Mo→o→o\overline{\mathrm{indext}} \in M^{o \to o \to o}indext∈Mo→o→o, there exists extract‾∈M(o→o)→o\overline{\mathrm{extract}} \in M^{(o \to o) \to o}extract∈M(o→o)→o such that for all a∈Mo→oa \in M^{o \to o}a∈Mo→o,
extract‾ a=oa (indext‾ (a (ν(natOfIdx(ε)))) (a (ν(natOfIdx(0)))));\overline{\mathrm{extract}}\ a =_o a\ \Bigl(\overline{\mathrm{indext}}\ \bigl(a\ (\nu(\mathrm{natOfIdx}(\varepsilon)))\bigr)\ \bigl(a\ (\nu(\mathrm{natOfIdx}(0)))\bigr)\Bigr);extract a=o​a (indext (a (ν(natOfIdx(ε)))) (a (ν(natOfIdx(0)))));
  1. (hStepComb) for every type-indexed family abst‾:Ty→Mo→o→o\overline{\mathrm{abst}} : \mathrm{Ty} \to M^{o \to o \to o}abst:Ty→Mo→o→o, elements fun‾,append‾∈Mo→o→o\overline{\mathrm{fun}}, \overline{\mathrm{append}} \in M^{o \to o \to o}fun,append​∈Mo→o→o, simple type ρ∈Ty\rho \in \mathrm{Ty}ρ∈Ty, and meta-level function body:Mo→Mo\mathrm{body} : M^o \to M^obody:Mo→Mo satisfying ∀p1,p2∈Mo,  p1=op2  ⟹  body(p1)=obody(p2)\forall p_1, p_2 \in M^o,\; p_1 =_o p_2 \implies \mathrm{body}(p_1) =_o \mathrm{body}(p_2)∀p1​,p2​∈Mo,p1​=o​p2​⟹body(p1​)=o​body(p2​), there exists step∈Mo→o\mathrm{step} \in M^{o \to o}step∈Mo→o such that for all p∈Mop \in M^op∈Mo,
step p=oabst‾ρ p (fun‾ (body(p)) (append‾ p (ν(natOfIdx(0)))));\mathrm{step}\ p =_o \overline{\mathrm{abst}}_\rho\ p\ \Bigl(\overline{\mathrm{fun}}\ (\mathrm{body}(p))\ \bigl(\overline{\mathrm{append}}\ p\ (\nu(\mathrm{natOfIdx}(0)))\bigr)\Bigr);step p=o​abstρ​ p (fun (body(p)) (append​ p (ν(natOfIdx(0)))));
  1. (hIF) for every admissible model A:AdmissibleModelA : \mathrm{AdmissibleModel}A:AdmissibleModel in universe uuu with A.toLambdaModel=M.toLambdaModelA.\mathrm{toLambdaModel} = M.\mathrm{toLambdaModel}A.toLambdaModel=M.toLambdaModel, the type InversionFunctionals(A)\mathrm{InversionFunctionals}(A)InversionFunctionals(A) is nonempty;

the theorem asserts that there exist an admissible model A:AdmissibleModelA : \mathrm{AdmissibleModel}A:AdmissibleModel in universe uuu and an inversion functional package IF:InversionFunctionals(A)\mathrm{IF} : \mathrm{InversionFunctionals}(A)IF:InversionFunctionals(A) such that:

  • AAA's underlying LambdaModel\mathrm{LambdaModel}LambdaModel equals MMM's underlying LambdaModel\mathrm{LambdaModel}LambdaModel (A.toLambdaModel=M.toLambdaModelA.\mathrm{toLambdaModel} = M.\mathrm{toLambdaModel}A.toLambdaModel=M.toLambdaModel);
  • for every raw term t∈Termt \in \mathrm{Term}t∈Term, A.codeTerm(t)A.\mathrm{codeTerm}(t)A.codeTerm(t) is heterogeneously equal (HEq\mathrm{HEq}HEq) to M.ν(N.natOfTerm(t))M.\nu(N.\mathrm{natOfTerm}(t))M.ν(N.natOfTerm(t));
  • (Inversion and normalization) for every simple type ρ∈Ty\rho \in \mathrm{Ty}ρ∈Ty and every element a∈Aρa \in A^\rhoa∈Aρ satisfying IsLambdaDefinable(A,ρ,a)\mathrm{IsLambdaDefinable}(A, \rho, a)IsLambdaDefinable(A,ρ,a) (meaning there exists a closed term t:ρt : \rhot:ρ with ∀η∈A.Env,  A.eval(t,η,ρ)=ρa\forall \eta \in A.\mathrm{Env},\; A.\mathrm{eval}(t, \eta, \rho) =_\rho a∀η∈A.Env,A.eval(t,η,ρ)=ρ​a), there exists a term r∈Termr \in \mathrm{Term}r∈Term such that HasType(r,ρ)\mathrm{HasType}(r, \rho)HasType(r,ρ), IsClosed(r)\mathrm{IsClosed}(r)IsClosed(r), IsLongBetaNormal(ρ,r)\mathrm{IsLongBetaNormal}(\rho, r)IsLongBetaNormal(ρ,r), IF.invCode(ρ,a)=oA.codeTerm(r)\mathrm{IF.invCode}(\rho, a) =_o A.\mathrm{codeTerm}(r)IF.invCode(ρ,a)=o​A.codeTerm(r) in AoA^oAo, and ∀η∈A.Env,  A.eval(r,η,ρ)=ρa\forall \eta \in A.\mathrm{Env},\; A.\mathrm{eval}(r, \eta, \rho) =_\rho a∀η∈A.Env,A.eval(r,η,ρ)=ρ​a; and
  • (Completeness) for every simple type ρ∈Ty\rho \in \mathrm{Ty}ρ∈Ty and all raw terms r,s∈Termr, s \in \mathrm{Term}r,s∈Term, if HasType(r,ρ)\mathrm{HasType}(r, \rho)HasType(r,ρ), HasType(s,ρ)\mathrm{HasType}(s, \rho)HasType(s,ρ), and M.ModelsEq(ρ,r,s)M.\mathrm{ModelsEq}(\rho, r, s)M.ModelsEq(ρ,r,s) (i.e., ∀η∈M.Env,  M.eval(r,η,ρ)=ρM.eval(s,η,ρ)\forall \eta \in M.\mathrm{Env},\; M.\mathrm{eval}(r, \eta, \rho) =_\rho M.\mathrm{eval}(s, \eta, \rho)∀η∈M.Env,M.eval(r,η,ρ)=ρ​M.eval(s,η,ρ)), then BetaEtaEq(r,s)\mathrm{BetaEtaEq}(r, s)BetaEtaEq(r,s).

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