Schwichtenberg's Definability Theorem: λ-Definable Functions over `ν` are Exactly the Extended Polynomials
ProvedSchwichtenberg1976V2.definable_iff_extended_polynomialA k-ary numerical function f : ℕ^k → ℕ is λ-definable over the Church numeral type ν = (0 → 0) → (0 → 0) in the simply typed λ-calculus if and only if f is an extended polynomial (IsExtendedPolyInd f), and if and only if f is definable from polynomials by case distinction on the vanishing or non-vanishing of its arguments (IsPiecewisePolynomial k f).
import Definitions.Def_Schwichtenberg1976V2_Lambda
namespace Schwichtenberg1976V2
/-- **Schwichtenberg's Definability Theorem** (pp. 113–114):
A `k`-ary numerical function `f : (Fin k → Nat) → Nat` is λ-definable over the Church
numeral type `ν = (0 → 0) → (0 → 0)` in the simply typed λ-calculus if and only if
`f` is an extended polynomial (`IsExtendedPolyInd f`), and if and only if `f` is definable
from polynomials by case distinction on the vanishing or non-vanishing of its arguments
(`IsPiecewisePolynomial k f`). -/
theorem definable_iff_extended_polynomial
(k : Nat) (f : (Fin k → Nat) → Nat) :
(IsPiecewisePolynomial k f ↔ IsExtendedPolyInd f) ∧
(IsLambdaDefinable k f ↔ IsExtendedPolyInd f) ∧
(IsLambdaDefinable k f ↔ IsPiecewisePolynomial k f) := by
sorry
end Schwichtenberg1976V2Read-back
What the Lean code literally says, in plain math · Gemini 4 Argon (Independent Blind Auditor)
The theorem definable_iff_extended_polynomial is universally quantified over an arity (with no hypotheses, including ) and a function , and asserts the conjunction of three pairwise logical equivalences:
where the three predicates on and are defined as follows:
-
Piecewise polynomial (): For every Boolean zero-test signature , there exists a function such that holds and for every input tuple , if as Booleans for every , then . Here is the inductive predicate on functions generated by constant functions () and coordinate projections (), and closed under pointwise addition and pointwise multiplication .
-
Inductively defined extended polynomial (): belongs to the smallest indexed family of sets of functions (across all ) closed under the following six rules:
const: for any and , the constant function belongs to the class at arity ;proj: for any and , the projection belongs to the class at arity ;add: if belong to the class, then belongs to the class;mul: if belong to the class, then belongs to the class;cond: if belong to the class, then belongs to the class, where equals if and if ;comp: for any , if belongs to the class at arity and belongs to the class at arity for every , then the composite belongs to the class at arity .
-
-definability (): There exists a term in the simply typed Church-style -calculus such that holds, meaning:
- has type under the inductive typing relation
HasType(where variables carry their own type, base type is , , , , and ); - is closed (
IsClosed t, i.e.,freeVars t = [], meaning has no free variable occurrences); and - for every , the left-associated application reduces via (
ReducesTo) to , where with and , and is the transitive closure of -equivalence (AlphaEq, generated by conflict-free single-binder renaming) and capture-avoiding -reduction closed under application and -abstraction.
- has type under the inductive typing relation
Note on edge cases: When , is empty, so there is a single unique signature and a single unique input , , and all three conditions hold for every function (which is uniquely determined by the single natural number ).
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.