Polynomial-Time Normalization of First-Order Ramified Terms
OpenBNS2000.theorem_3_1implicit-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 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 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 be a term satisfying — that is:
- is well-typed ();
- satisfies property
(R)(: for every subterm of whose inferred type is of the form , every free variable has a complete type ); and - satisfies property
(A)(: for every subterm of whose bound variable has an incomplete type , there exists a term such that and is affinable in ).
Then both of the following statements hold:
-
Closure of -terms under one-step reduction: For every term , if (, meaning is obtained from by contracting a single redex occurrence inside any term context), then holds.
-
Persistence of affinability in normal forms: For every typed variable and every term , if:
- is an incomplete type (, i.e., is or an arrow type ),
- is affinable in (, meaning either , or there exist a well-typed ground-type term with and a non-empty list of scope-equivalent occurrences of in along which is unshadowed and which cover all free occurrences of in ), and
- is a normal form of (, meaning and has no one-step reductions), then is affinable in ().
Edge-Case and Faithfulness Notes
- In part (2), the hypothesis assumes that is a normal form of (it does not assert existence or uniqueness of normal forms on its own).
- If does not occur free in (or occurs at most once), then satisfies directly without requiring an affination subterm .
Human review
Confirmed by the mission captain (proposal self-audit).