Characterization of the Polynomial-Time Functions by RA and RS
OpenBNS2000.ptime_characterizationimplicit-computational-complexitypolynomial-timeproof-theoryramified-recursiontype-theory
Main Result (Sections 4-5, pp. 21-29): The numerical functions definable by closed level-1 terms of RA, the numerical functions definable by closed level-1 terms of RS, and the polynomial-time computable functions (BCFunc k 0) coincide.
Preamble
import Definitions.Def_BNS2000_Terms
Formal statement
namespace BNS2000
/-- **Characterization of Polynomial-Time Computability by Higher-Type Ramified Affinable Recursion**
(Sections 1 & 5, pp. 18, 26–27):
A numerical function `F : (Fin k → Nat) → Nat` is denoted by a closed `RA`-term `t` of type
`!ι → ⋯ → !ι → ι` if and only if `F` is computable in polynomial time (characterized via the
Bellantoni–Cook safe recursion function algebra `BCFunc k 0` together with a polynomial bound
`p_t` on the normalization complexity of `t (!n₁) ... (!nₖ)`). -/
theorem ptime_characterization
(k : Nat) (F : (Fin k → Nat) → Nat) :
(∃ t : Term, RADenotesTwoSorted (m := k) (n := 0) t (fun xs _ => F xs)) ↔
(∃ f : BCFunc k 0, ∀ xs : Fin k → Nat, F xs = evalBC f xs Fin.elim0) := 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). Sections 4-5, Theorems 5.1 and 5.2, pp. 21-29.
Read-back
What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)
Read-back: Thm_BNS2000_ptime_characterization.lean
ptime_characterization
For every natural number and every -ary numerical function , the following two statements are logically equivalent:
- Representability by a closed -term of type : There exists a term such that holds — that is:
- is a well-typed term satisfying properties
(R)and(A)(), - is closed (),
- has type , and
- for every , writing , the canonical binary numeral is a normal form of the left-associated application
- is a well-typed term satisfying properties
- Representability in the Bellantoni–Cook safe recursion function algebra : There exists a Bellantoni–Cook function syntax tree with normal arguments and safe arguments such that for every ,
Edge-Case and Faithfulness Notes
- In this theorem statement, "polynomial-time computability" of is formalized via representability in the Bellantoni–Cook safe recursion algebra rather than via a direct Turing-machine time-complexity definition.
- The polynomial bound on register-machine normalization steps and register lengths mentioned in the docstring is proved separately in
theorem_5_1for any closed -term of ground-arrow type , and is not part of the equivalence inptime_characterizationitself. - The right-to-left implication () is the case of
theorem_5_2, while the left-to-right implication () states that every -ary function on denoted by a closed -term of type is computable by a Bellantoni–Cook term in .
Human review
Confirmed by the mission captain (proposal self-audit).