Bounding Theorem — Polynomial-Time Normalization of Closed Level-1 RA-Terms (Theorem 5.1)
OpenBNS2000.theorem_5_1implicit-computational-complexitypolynomial-timeproof-theoryramified-recursiontype-theory
Theorem 5.1 (p. 26): Every closed RA-term t of first-order type σ₁ → ⋯ → σ_k → τ normalizes on numerals n₁, ..., n_k in polynomial time (≤ p_t(∑ |n_i|) steps and register size) via reduction to an equivalent closed R-free RS-term of length ≤ p_t(∑ |n_i|).
Preamble
import Definitions.Def_BNS2000_Terms
Formal statement
namespace BNS2000
/-- **Theorem 5.1 (Bounding)** (Section 5, p. 26):
Let `t` be a closed `RA`-term of type `σ₁ → ⋯ → σₖ → τ`, where `σ₁, ..., σₖ, τ` are all
ground types. Then there exists a polynomial `p_t : Nat → Nat` (`IsUnivariatePoly p_t`)
such that for all numerals `n₁, ..., nₖ` of types `σ₁, ..., σₖ` respectively, there exists
a closed `R`-free `RS`-term `u` of type `τ` equivalent to `t n₁ ... nₖ` of length
`|u| ≤ p_t(∑ |nᵢ|)` whose numeral normal form `nf(t n⃗) = nf(u)` is computed by `NFEval`
in at most `p_t(∑ |nᵢ|)` steps using registers of size at most `p_t(∑ |nᵢ|)`. -/
theorem theorem_5_1
(k : Nat) (σs : Fin k → Ty) (τ : Ty) (t : Term)
(ht : IsRATerm t)
(hclosed : IsClosed t)
(hty : HasType t (Ty.arrMany (List.ofFn σs) τ))
(hσs : ∀ i : Fin k, (σs i).isGround = true)
(hτ : τ.isGround = true) :
∃ p_t : Nat → Nat,
IsUnivariatePoly p_t ∧
∀ ns : Fin k → Term,
(∀ i : Fin k, HasType (ns i) (σs i) ∧ isNumeral (ns i) = true) →
let m := (List.finRange k).foldr (fun i acc => termLength (ns i) + acc) 0
∃ (u nf_val : Term) (steps regs maxLen : Nat),
IsRSTerm u ∧
isRFree u = true ∧
IsClosed u ∧
HasType u τ ∧
TermEquiv u (Term.appMany t (List.ofFn ns)) ∧
NFEval u [] nf_val steps regs maxLen ∧
IsNormalFormOf (Term.appMany t (List.ofFn ns)) nf_val ∧
isNumeral nf_val = true ∧
termLength u ≤ p_t m ∧
steps ≤ p_t m ∧
regs ≤ p_t m ∧
maxLen ≤ p_t m := by
sorry
end BNS2000Source
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 5, Theorem 5.1, p. 26.
Read-back
What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)
Read-back: Thm_BNS2000_theorem_5_1.lean
theorem_5_1
Let be a natural number, be a family of types indexed by , be a return type, and be a term such that:
- is an -term (, meaning is well-typed and satisfies both
(R)and(A)), - is closed (, i.e., ),
- has the iterated arrow type (),
- for every , is a ground type (, i.e., ), and
- is a ground type (, i.e., ).
Then there exists a function such that:
- is a univariate polynomial with natural-number coefficients (); and
- for every -tuple of terms such that for each , and (meaning for a binary numeral ), setting
there exist terms and natural numbers such that:
- is a closed -free -term of type (),
- and the left-associated application are term-equivalent (, i.e., they share a common normal form),
- the register-machine evaluation relation holds in the empty environment ,
- is a normal form of (),
- is a numeral (), and
- the length of and the evaluation cost parameters are all bounded by :
Edge-Case and Faithfulness Notes
- When , , , , and .
- Every clause in the docstring (
|u| ≤ p_t(∑ |nᵢ|),steps ≤ p_t(∑ |nᵢ|),regs ≤ p_t(∑ |nᵢ|), andmaxLen ≤ p_t(∑ |nᵢ|)) is explicitly represented as a conjunct in the formal statement.
Human review
Confirmed by the mission captain (proposal self-audit).