Classification of Closed Normal Terms of Type `ν` and Sufficiency for Extended Polynomials
OpenSchwichtenberg1976.combinators_and_sufficiencyEvery closed β-normal term of type ν is α-equivalent to a Church numeral n̄ or λα. α; the explicit combinators addComb, mulComb, constComb, and condComb define +, ·, constants, and d(n, m, i); and every extended polynomial (IsExtendedPolyInd) is λ-definable over ν.
import Definitions.Def_Schwichtenberg1976_Lambda
namespace Schwichtenberg1976
/-- First part of Schwichtenberg's characterization (pp. 113–114):
1. Every closed β-normal term of type `ν = (0 → 0) → (0 → 0)` is α-equivalent to a
Church numeral `n̄` or the identity `λα. α`.
2. `addComb`, `mulComb`, `constComb c`, and `condComb` define addition, multiplication,
the unary constant `c`, and the conditional `d(n, m, i)` on Church numerals.
3. Every function in the inductive class of extended polynomials (`IsExtendedPolyInd`)
is λ-definable over `ν`. -/
theorem combinators_and_sufficiency :
(∀ t : Term,
HasType t Ty.nu →
IsClosed t →
IsBetaNormal t →
(∃ n : Nat, AlphaEq t (churchNumeral n)) ∨
(∃ α : Var, α.ty = Ty.endo ∧ AlphaEq t (.lam α (.var α)))) ∧
DefinesFunction 2 addComb (fun v => v ⟨0, by decide⟩ + v ⟨1, by decide⟩) ∧
DefinesFunction 2 mulComb (fun v => v ⟨0, by decide⟩ * v ⟨1, by decide⟩) ∧
(∀ c : Nat, DefinesFunction 1 (constComb c) (fun _ => c)) ∧
DefinesFunction 3 condComb
(fun v => condNat (v ⟨0, by decide⟩) (v ⟨1, by decide⟩) (v ⟨2, by decide⟩)) ∧
(∀ {k : Nat} {f : (Fin k → Nat) → Nat},
IsExtendedPolyInd f → IsLambdaDefinable 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_combinators_and_sufficiency.lean
All declarations below reside in the namespace Schwichtenberg1976 and depend on Definitions.Def_Schwichtenberg1976_Lambda.
1. Theorem Read-Backs
closed_normal_nu_classification (Theorem)
For every raw -term , suppose that:
- has the Church numeral type (
HasType t Ty.nu), - is closed, i.e., its list of free variables is empty (
IsClosed t, meaning ), and - is in -normal form, i.e., contains no subterm of the form (
IsBetaNormal t).
Then at least one of the following two alternatives holds:
- There exists a natural number such that is -equivalent (
AlphaEq) to the -th Church numeral
- Or there exists a typed variable of type (
Ty.endo) such that is -equivalent (AlphaEq) to the identity abstraction .
addComb_defines_add (Theorem)
The addition combinator
where , , , and , defines (DefinesFunction) the binary addition function given by . Unfolding DefinesFunction 2, this asserts the conjunction of three conditions:
- has type (
HasType addComb (Ty.nuArity 2)), - is closed (
IsClosed addComb), and - for every -tuple , the left-associated application reduces via (
ReducesTo, which combines -reduction steps and -equivalence steps) to the Church numeral .
mulComb_defines_mul (Theorem)
The multiplication combinator
where , , and , defines (DefinesFunction) the binary multiplication function given by . Unfolding DefinesFunction 2, this asserts that:
- has type ,
- is closed, and
- for every -tuple , the application reduces via (
ReducesTo) to the Church numeral .
constComb_defines_const (Theorem)
For every natural number , the unary constant combinator
where , , and , defines (DefinesFunction) the -ary constant function given by . Unfolding DefinesFunction 1, this asserts that for every :
- has type ,
- is closed, and
- for every -tuple , the application reduces via (
ReducesTo) to the Church numeral .
condComb_defines_cond (Theorem)
The ternary conditional combinator
where , , , , , and , defines (DefinesFunction) the -ary zero-test conditional function given by
Unfolding DefinesFunction 3, this asserts that:
- has type ,
- is closed, and
- for every -tuple , the application reduces via (
ReducesTo) to when , and to when .
extended_poly_definable (Theorem)
For every arity and every -ary numerical function , if belongs to the inductive class of extended polynomials (IsExtendedPolyInd f—that is, is generated from constants, coordinate projections, pointwise addition, pointwise multiplication, the zero-test conditional , and multivariate composition across arbitrary arities), then is -definable (IsLambdaDefinable k f): there exists a closed term of type such that for every input tuple ,
2. Audit Notes: Edge Cases, Degenerate Cases, and Potential Issues
- Identity term vs. in
closed_normal_nu_classification: Because the reduction relationReducesToincludes -reduction and -equivalence (AlphaEq) but does not include -equivalence, the -reduced identity term is a closed -normal term of type that is not -equivalent to . The theoremclosed_normal_nu_classificationexplicitly accounts for this by separating the two disjuncts. Note also that in the second disjunct,AlphaEq t (.lam α (.var α))is equivalent to for some of type . - Exact numeral output in
DefinesFunction:DefinesFunction k t frequires reduction to the -expanded Church numeral (and not merely to when ). Even in the projection case and the multiplication case when , because the input arguments are already -expanded Church numerals , both and -reduce to -expanded Church numerals. - Arity in
extended_poly_definable: InIsExtendedPolyInd.comp, the inner arity or outer arity can be . When ,IsLambdaDefinable 0 fasserts the existence of a closed term reducing to (where is the unique empty tuple), which is witnessed by .