Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Classification of Closed Normal Terms of Type `ν` and Sufficiency for Extended Polynomials

Open
Schwichtenberg1976.combinators_and_sufficiency

by kmehltretter82 · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

church-numeralsdefinabilitylambda-calculuspolynomialstype-theory

Every 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 ν.

Preamble
import Definitions.Def_Schwichtenberg1976_Lambda
Formal statement
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 Schwichtenberg1976
Source
Helmut Schwichtenberg, 'Definierbare Funktionen im λ-Kalkül mit Typen', Archiv für mathematische Logik und Grundlagenforschung 17, 1975/1976, pp. 113-114 (doi:10.1007/BF02011242). pp. 113-114.
Read-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 λ\lambdaλ-term t∈Termt \in \mathsf{Term}t∈Term, suppose that:

  1. ttt has the Church numeral type ν=(0→0)→(0→0)\nu = (0 \to 0) \to (0 \to 0)ν=(0→0)→(0→0) (HasType t Ty.nu),
  2. ttt is closed, i.e., its list of free variables is empty (IsClosed t, meaning FV(t)=[]\mathrm{FV}(t) = []FV(t)=[]), and
  3. ttt is in β\betaβ-normal form, i.e., ttt contains no subterm of the form ((λx. u) s)((\lambda x.\, u)\, s)((λx.u)s) (IsBetaNormal t).

Then at least one of the following two alternatives holds:

  • There exists a natural number n∈Nn \in \mathbb{N}n∈N such that ttt is α\alphaα-equivalent (AlphaEq) to the nnn-th Church numeral
nˉ=λα0. λx0. α0(α0(…(α0⏟n times x0)… )),α0:=(1,0→0),  x0:=(0,0),\bar{n} = \lambda \alpha_0.\, \lambda x_0.\, \underbrace{\alpha_0(\alpha_0(\dots(\alpha_0}_{n\text{ times}}\, x_0)\dots)), \qquad \alpha_0 := (1, 0 \to 0),\; x_0 := (0, 0),nˉ=λα0​.λx0​.n timesα0​(α0​(…(α0​​​x0​)…)),α0​:=(1,0→0),x0​:=(0,0),
  • Or there exists a typed variable α∈Var\alpha \in \mathsf{Var}α∈Var of type ty(α)=(0→0)\mathrm{ty}(\alpha) = (0 \to 0)ty(α)=(0→0) (Ty.endo) such that ttt is α\alphaα-equivalent (AlphaEq) to the identity abstraction λα. α\lambda \alpha.\, \alphaλα.α.

addComb_defines_add (Theorem)

The addition combinator

addComb:=λF. λG. λα. λx. ((F α) ((G α) x)),\mathsf{addComb} := \lambda F.\, \lambda G.\, \lambda \alpha.\, \lambda x.\, ((F\, \alpha)\, ((G\, \alpha)\, x)),addComb:=λF.λG.λα.λx.((Fα)((Gα)x)),

where F:=(3,ν)F := (3, \nu)F:=(3,ν), G:=(4,ν)G := (4, \nu)G:=(4,ν), α:=(1,0→0)\alpha := (1, 0 \to 0)α:=(1,0→0), and x:=(0,0)x := (0, 0)x:=(0,0), defines (DefinesFunction) the binary addition function f:(Fin(2)→N)→Nf : (\mathrm{Fin}(2) \to \mathbb{N}) \to \mathbb{N}f:(Fin(2)→N)→N given by f(v):=v(0)+v(1)f(v) := v(0) + v(1)f(v):=v(0)+v(1). Unfolding DefinesFunction 2, this asserts the conjunction of three conditions:

  1. addComb\mathsf{addComb}addComb has type ν(2)=ν→(ν→ν)\nu^{(2)} = \nu \to (\nu \to \nu)ν(2)=ν→(ν→ν) (HasType addComb (Ty.nuArity 2)),
  2. addComb\mathsf{addComb}addComb is closed (IsClosed addComb), and
  3. for every 222-tuple v:Fin(2)→Nv : \mathrm{Fin}(2) \to \mathbb{N}v:Fin(2)→N, the left-associated application ((addComb v(0)‾) v(1)‾)((\mathsf{addComb}\, \overline{v(0)})\, \overline{v(1)})((addCombv(0)​)v(1)​) reduces via ▹\triangleright▹ (ReducesTo, which combines β\betaβ-reduction steps and α\alphaα-equivalence steps) to the Church numeral v(0)+v(1)‾\overline{v(0) + v(1)}v(0)+v(1)​.

mulComb_defines_mul (Theorem)

The multiplication combinator

mulComb:=λF. λG. λα. (F (G α)),\mathsf{mulComb} := \lambda F.\, \lambda G.\, \lambda \alpha.\, (F\, (G\, \alpha)),mulComb:=λF.λG.λα.(F(Gα)),

where F:=(3,ν)F := (3, \nu)F:=(3,ν), G:=(4,ν)G := (4, \nu)G:=(4,ν), and α:=(1,0→0)\alpha := (1, 0 \to 0)α:=(1,0→0), defines (DefinesFunction) the binary multiplication function f:(Fin(2)→N)→Nf : (\mathrm{Fin}(2) \to \mathbb{N}) \to \mathbb{N}f:(Fin(2)→N)→N given by f(v):=v(0)⋅v(1)f(v) := v(0) \cdot v(1)f(v):=v(0)⋅v(1). Unfolding DefinesFunction 2, this asserts that:

  1. mulComb\mathsf{mulComb}mulComb has type ν(2)=ν→(ν→ν)\nu^{(2)} = \nu \to (\nu \to \nu)ν(2)=ν→(ν→ν),
  2. mulComb\mathsf{mulComb}mulComb is closed, and
  3. for every 222-tuple v:Fin(2)→Nv : \mathrm{Fin}(2) \to \mathbb{N}v:Fin(2)→N, the application ((mulComb v(0)‾) v(1)‾)((\mathsf{mulComb}\, \overline{v(0)})\, \overline{v(1)})((mulCombv(0)​)v(1)​) reduces via ▹\triangleright▹ (ReducesTo) to the Church numeral v(0)⋅v(1)‾\overline{v(0) \cdot v(1)}v(0)⋅v(1)​.

constComb_defines_const (Theorem)

For every natural number c∈Nc \in \mathbb{N}c∈N, the unary constant combinator

constComb(c):=λF. λα. λx. α(α(…(α⏟c times x)… )),\mathsf{constComb}(c) := \lambda F.\, \lambda \alpha.\, \lambda x.\, \underbrace{\alpha(\alpha(\dots(\alpha}_{c\text{ times}}\, x)\dots)),constComb(c):=λF.λα.λx.c timesα(α(…(α​​x)…)),

where F:=(3,ν)F := (3, \nu)F:=(3,ν), α:=(1,0→0)\alpha := (1, 0 \to 0)α:=(1,0→0), and x:=(0,0)x := (0, 0)x:=(0,0), defines (DefinesFunction) the 111-ary constant function f:(Fin(1)→N)→Nf : (\mathrm{Fin}(1) \to \mathbb{N}) \to \mathbb{N}f:(Fin(1)→N)→N given by f(v):=cf(v) := cf(v):=c. Unfolding DefinesFunction 1, this asserts that for every c∈Nc \in \mathbb{N}c∈N:

  1. constComb(c)\mathsf{constComb}(c)constComb(c) has type ν(1)=ν→ν\nu^{(1)} = \nu \to \nuν(1)=ν→ν,
  2. constComb(c)\mathsf{constComb}(c)constComb(c) is closed, and
  3. for every 111-tuple v:Fin(1)→Nv : \mathrm{Fin}(1) \to \mathbb{N}v:Fin(1)→N, the application (constComb(c) v(0)‾)(\mathsf{constComb}(c)\, \overline{v(0)})(constComb(c)v(0)​) reduces via ▹\triangleright▹ (ReducesTo) to the Church numeral cˉ\bar{c}cˉ.

condComb_defines_cond (Theorem)

The ternary conditional combinator

condComb:=λF. λG. λH. λα. λx. ((H (λy. ((G α) x))) ((F α) x)),\mathsf{condComb} := \lambda F.\, \lambda G.\, \lambda H.\, \lambda \alpha.\, \lambda x.\, \bigl((H\, (\lambda y.\, ((G\, \alpha)\, x)))\, ((F\, \alpha)\, x)\bigr),condComb:=λF.λG.λH.λα.λx.((H(λy.((Gα)x)))((Fα)x)),

where F:=(3,ν)F := (3, \nu)F:=(3,ν), G:=(4,ν)G := (4, \nu)G:=(4,ν), H:=(5,ν)H := (5, \nu)H:=(5,ν), α:=(1,0→0)\alpha := (1, 0 \to 0)α:=(1,0→0), x:=(0,0)x := (0, 0)x:=(0,0), and y:=(2,0)y := (2, 0)y:=(2,0), defines (DefinesFunction) the 333-ary zero-test conditional function f:(Fin(3)→N)→Nf : (\mathrm{Fin}(3) \to \mathbb{N}) \to \mathbb{N}f:(Fin(3)→N)→N given by

f(v):=d(v(0),v(1),v(2))={v(0)if v(2)=0,v(1)if v(2)≠0.f(v) := d(v(0), v(1), v(2)) = \begin{cases} v(0) & \text{if } v(2) = 0, \\ v(1) & \text{if } v(2) \neq 0. \end{cases}f(v):=d(v(0),v(1),v(2))={v(0)v(1)​if v(2)=0,if v(2)=0.​

Unfolding DefinesFunction 3, this asserts that:

  1. condComb\mathsf{condComb}condComb has type ν(3)=ν→(ν→(ν→ν))\nu^{(3)} = \nu \to (\nu \to (\nu \to \nu))ν(3)=ν→(ν→(ν→ν)),
  2. condComb\mathsf{condComb}condComb is closed, and
  3. for every 333-tuple v:Fin(3)→Nv : \mathrm{Fin}(3) \to \mathbb{N}v:Fin(3)→N, the application (((condComb v(0)‾) v(1)‾) v(2)‾)(((\mathsf{condComb}\, \overline{v(0)})\, \overline{v(1)})\, \overline{v(2)})(((condCombv(0)​)v(1)​)v(2)​) reduces via ▹\triangleright▹ (ReducesTo) to v(0)‾\overline{v(0)}v(0)​ when v(2)=0v(2) = 0v(2)=0, and to v(1)‾\overline{v(1)}v(1)​ when v(2)≠0v(2) \neq 0v(2)=0.

extended_poly_definable (Theorem)

For every arity k∈Nk \in \mathbb{N}k∈N and every kkk-ary numerical function f:(Fin(k)→N)→Nf : (\mathrm{Fin}(k) \to \mathbb{N}) \to \mathbb{N}f:(Fin(k)→N)→N, if fff belongs to the inductive class of extended polynomials (IsExtendedPolyInd f—that is, fff is generated from constants, coordinate projections, pointwise addition, pointwise multiplication, the zero-test conditional d(n,m,i)d(n, m, i)d(n,m,i), and multivariate composition across arbitrary arities), then fff is λ\lambdaλ-definable (IsLambdaDefinable k f): there exists a closed term t∈Termt \in \mathsf{Term}t∈Term of type ν(k)\nu^{(k)}ν(k) such that for every input tuple v:Fin(k)→Nv : \mathrm{Fin}(k) \to \mathbb{N}v:Fin(k)→N,

appMany(t,[v(0)‾,…,v(k−1)‾])▹f(v)‾.\mathrm{appMany}(t, [\overline{v(0)}, \dots, \overline{v(k-1)}]) \triangleright \overline{f(v)}.appMany(t,[v(0)​,…,v(k−1)​])▹f(v)​.

2. Audit Notes: Edge Cases, Degenerate Cases, and Potential Issues

  1. Identity term λα. α\lambda \alpha.\, \alphaλα.α vs. 1ˉ=λα. λx. (α x)\bar{1} = \lambda \alpha.\, \lambda x.\, (\alpha\, x)1ˉ=λα.λx.(αx) in closed_normal_nu_classification: Because the reduction relation ReducesTo includes β\betaβ-reduction and α\alphaα-equivalence (AlphaEq) but does not include η\etaη-equivalence, the η\etaη-reduced identity term λα0→0. α\lambda \alpha^{0\to 0}.\, \alphaλα0→0.α is a closed β\betaβ-normal term of type ν\nuν that is not α\alphaα-equivalent to 1ˉ=λα0→0. λx0. (α x)\bar{1} = \lambda \alpha^{0\to 0}.\, \lambda x^0.\, (\alpha\, x)1ˉ=λα0→0.λx0.(αx). The theorem closed_normal_nu_classification explicitly accounts for this by separating the two disjuncts. Note also that in the second disjunct, AlphaEq t (.lam α (.var α)) is equivalent to t=λα. αt = \lambda \alpha.\, \alphat=λα.α for some α\alphaα of type 0→00 \to 00→0.
  2. Exact numeral output in DefinesFunction: DefinesFunction k t f requires reduction to the η\etaη-expanded Church numeral f(v)‾=λα. λx. iterApp(α,x,f(v))\overline{f(v)} = \lambda \alpha.\, \lambda x.\, \mathrm{iterApp}(\alpha, x, f(v))f(v)​=λα.λx.iterApp(α,x,f(v)) (and not merely to λα. α\lambda \alpha.\, \alphaλα.α when f(v)=1f(v) = 1f(v)=1). Even in the projection case f(v)=v(i)f(v) = v(i)f(v)=v(i) and the multiplication case v(0)⋅v(1)v(0) \cdot v(1)v(0)⋅v(1) when v(0)=1v(0) = 1v(0)=1, because the input arguments v(i)‾\overline{v(i)}v(i)​ are already η\etaη-expanded Church numerals λα. λx. iterApp(α,x,v(i))\lambda \alpha.\, \lambda x.\, \mathrm{iterApp}(\alpha, x, v(i))λα.λx.iterApp(α,x,v(i)), both (λF1…Fk. Fi) v(0)‾…v(k−1)‾(\lambda F_1 \dots F_k.\, F_i)\, \overline{v(0)} \dots \overline{v(k-1)}(λF1​…Fk​.Fi​)v(0)​…v(k−1)​ and mulComb 1‾ m‾\mathsf{mulComb}\, \overline{1}\, \overline{m}mulComb1m β\betaβ-reduce to η\etaη-expanded Church numerals.
  3. Arity k=0k = 0k=0 in extended_poly_definable: In IsExtendedPolyInd.comp, the inner arity mmm or outer arity kkk can be 000. When k=0k = 0k=0, IsLambdaDefinable 0 f asserts the existence of a closed term t:νt : \nut:ν reducing to f(v0)‾\overline{f(v_0)}f(v0​)​ (where v0:Fin(0)→Nv_0 : \mathrm{Fin}(0) \to \mathbb{N}v0​:Fin(0)→N is the unique empty tuple), which is witnessed by t=f(v0)‾t = \overline{f(v_0)}t=f(v0​)​.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me