Schwichtenberg's Definability Theorem: λ-Definable Functions over `ν` are Exactly the Extended Polynomials
OpenSchwichtenberg1976.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_Schwichtenberg1976_Lambda
namespace Schwichtenberg1976
/-- **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 Schwichtenberg1976Read-back
What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)
Mathematical Read-Back: Thm_Schwichtenberg1976_definable_iff_extended_polynomial.lean
All declarations below reside in the namespace Schwichtenberg1976 and depend on Definitions.Def_Schwichtenberg1976_Lambda.
1. Theorem Read-Backs
piecewise_polynomial_iff_extended_poly (Theorem)
For every arity and every -ary numerical function , the following two conditions are equivalent:
- Piecewise polynomial by vanishing/non-vanishing of arguments (
IsPiecewisePolynomial k f): For every Boolean sign pattern , there exists a -ary polynomial with natural-number coefficients (IsPolynomial P, generated from constants and projections by pointwise addition and multiplication) such that for every input tuple ,
- Inductive extended polynomial (
IsExtendedPolyInd f): The function belongs to the smallest family of multivariate functions (across all arities ) closed under constants , coordinate projections , pointwise addition , pointwise multiplication , the zero-test conditional
and multivariate composition for any , , and ().
definable_iff_extended_polynomial (Theorem)
For every arity and every -ary numerical function , both of the following equivalences hold:
- is -definable over the Church numeral type (
IsLambdaDefinable k f) if and only if belongs to the inductive class of extended polynomials (IsExtendedPolyInd f). - is -definable over (
IsLambdaDefinable k f) if and only if is a piecewise polynomial by vanishing/non-vanishing of its arguments (IsPiecewisePolynomial k f).
Here IsLambdaDefinable k f means that there exists a closed -term (IsClosed t, i.e., ) of type (HasType t (Ty.nuArity k)) such that for every input tuple , the left-associated application
reduces via (ReducesTo) to the Church numeral .
2. Audit Notes: Edge Cases, Degenerate Cases, and Potential Issues
- Confluence of
ReducesToand uniqueness of normal forms: BecauseAlphaEq.lam_renamerequires andsubstTermrenames captured binders to fresh variables with , the reduction relationReducesToimplements capture-avoiding -reduction modulo -equivalence. By confluence (Church-Rosser) of the simply typed -calculus, for any closed term and any input tuple , the normal form of is unique up toAlphaEq, and coincides with the normal form obtained by first reducing to its -normal form and then substituting . - Closure of
IsPiecewisePolynomialundercondNatand composition: On each fixed sign pattern , a polynomial with coefficients in (IsPolynomial P) is either identically on the cell or strictly positive () everywhere on that cell. Consequently, the zero/nonzero status of any piecewise polynomial is constant on each sign-pattern cell, which ensures thatIsPiecewisePolynomialis closed under bothcondNatand multivariate composition, matchingIsExtendedPolyInd. - Arity edge case:
For , there is a single sign pattern (the empty map) and a single input , so every -ary function is constant and satisfies
IsLambdaDefinable 0 f,IsPiecewisePolynomial 0 f, andIsExtendedPolyInd f.