Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Polynomial-Time Normalization of First-Order Ramified Terms

Open
BNS2000.theorem_3_1

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

implicit-computational-complexitypolynomial-timeproof-theoryramified-recursiontype-theory

Theorem 3.1 (p. 20): Every first-order ramified term can be normalized in time polynomial in the lengths of its free variables, and every ground-type term without free variables of higher type reduces to a unique normal form.

Preamble
import Definitions.Def_BNS2000_Terms
Formal statement
namespace BNS2000

/-- **Theorem 3.1 (Closure under reduction)** (Section 3, p. 21):
Let `r` be an `RA`-term.
(1) If `r → r'`, then `r'` is an `RA`-term.
(2) If `x` is affinable in `r` (with `x` incomplete) and `nf_r` is the normal form `nf(r)`,
    then `x` is affinable in `nf(r)`. -/
theorem theorem_3_1 (r : Term) (hr : IsRATerm r) :
    (∀ r' : Term, Step r r' → IsRATerm r') ∧
    (∀ (x : Var) (nf_r : Term),
      x.ty.isIncomplete = true →
      IsAffinable x r →
      IsNormalFormOf r nf_r →
      IsAffinable x nf_r) := by
  sorry

end BNS2000
Source
Stephen Bellantoni, Karl-Heinz Niggl, and Helmut Schwichtenberg, 'Higher type recursion, ramification and polynomial time', Annals of Pure and Applied Logic 104, 2000, pp. 17-30 (doi:10.1016/S0168-0072(00)00006-3). Section 3, Theorem 3.1, p. 20.
Read-back

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

Read-back: Thm_BNS2000_theorem_3_1.lean

theorem_3_1

Let r∈Termr \in \mathsf{Term}r∈Term be a term satisfying IsRATerm(r)\mathsf{IsRATerm}(r)IsRATerm(r) — that is:

  • rrr is well-typed (∃τ∈Ty,  HasType(r,τ)\exists \tau \in \mathsf{Ty},\; \mathsf{HasType}(r, \tau)∃τ∈Ty,HasType(r,τ));
  • rrr satisfies property (R) (SatisfiesR(r)\mathsf{SatisfiesR}(r)SatisfiesR(r): for every subterm uuu of rrr whose inferred type inferTy(u)\mathsf{inferTy}(u)inferTy(u) is of the form !σ!\sigma!σ, every free variable v∈freeVars(u)v \in \mathsf{freeVars}(u)v∈freeVars(u) has a complete type v.ty=!ρv.\mathsf{ty} = !\rhov.ty=!ρ); and
  • rrr satisfies property (A) (SatisfiesA(r)\mathsf{SatisfiesA}(r)SatisfiesA(r): for every subterm λx. s\lambda x.\, sλx.s of rrr whose bound variable xxx has an incomplete type x.ty≠!ρx.\mathsf{ty} \ne !\rhox.ty=!ρ, there exists a term s′s's′ such that s→∗s′s \to^* s's→∗s′ and xxx is affinable in s′s's′).

Then both of the following statements hold:

  1. Closure of RA\mathsf{RA}RA-terms under one-step reduction: For every term r′∈Termr' \in \mathsf{Term}r′∈Term, if r→r′r \to r'r→r′ (Step(r,r′)\mathsf{Step}(r, r')Step(r,r′), meaning r′r'r′ is obtained from rrr by contracting a single redex occurrence inside any term context), then IsRATerm(r′)\mathsf{IsRATerm}(r')IsRATerm(r′) holds.

  2. Persistence of affinability in normal forms: For every typed variable x∈Varx \in \mathsf{Var}x∈Var and every term nf_r∈Term\mathsf{nf\_r} \in \mathsf{Term}nf_r∈Term, if:

    • x.tyx.\mathsf{ty}x.ty is an incomplete type (isIncomplete(x.ty)=true\mathsf{isIncomplete}(x.\mathsf{ty}) = \mathsf{true}isIncomplete(x.ty)=true, i.e., x.tyx.\mathsf{ty}x.ty is ι\iotaι or an arrow type σ→τ\sigma \to \tauσ→τ),
    • xxx is affinable in rrr (IsAffinable(x,r)\mathsf{IsAffinable}(x, r)IsAffinable(x,r), meaning either FO(x,r)≤1\mathsf{FO}(x, r) \le 1FO(x,r)≤1, or there exist a well-typed ground-type term aaa with FO(x,a)=1\mathsf{FO}(x, a) = 1FO(x,a)=1 and a non-empty list of scope-equivalent occurrences of aaa in rrr along which xxx is unshadowed and which cover all free occurrences of xxx in rrr), and
    • nf_r\mathsf{nf\_r}nf_r is a normal form of rrr (IsNormalFormOf(r,nf_r)\mathsf{IsNormalFormOf}(r, \mathsf{nf\_r})IsNormalFormOf(r,nf_r), meaning r→∗nf_rr \to^* \mathsf{nf\_r}r→∗nf_r and nf_r\mathsf{nf\_r}nf_r has no one-step reductions), then xxx is affinable in nf_r\mathsf{nf\_r}nf_r (IsAffinable(x,nf_r)\mathsf{IsAffinable}(x, \mathsf{nf\_r})IsAffinable(x,nf_r)).

Edge-Case and Faithfulness Notes

  • In part (2), the hypothesis IsNormalFormOf(r,nf_r)\mathsf{IsNormalFormOf}(r, \mathsf{nf\_r})IsNormalFormOf(r,nf_r) assumes that nf_r\mathsf{nf\_r}nf_r is a normal form of rrr (it does not assert existence or uniqueness of normal forms on its own).
  • If xxx does not occur free in rrr (or occurs at most once), then FO(x,r)≤1\mathsf{FO}(x, r) \le 1FO(x,r)≤1 satisfies IsAffinable(x,r)\mathsf{IsAffinable}(x, r)IsAffinable(x,r) directly without requiring an affination subterm aaa.
Human review
  • Endorsed by Shuze Chen · Nov 20, 2026

  • Endorsed by kmehltretter82 · Nov 20, 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