Cslib.SKI
inductiveimported Lean
An SKI expression is built from the primitive combinators S, K and I, and application.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in inductive Cslib.SKI
- Defined in
- CSLib, `Cslib.SKI`
- Lean proof
- By Thomas Waring, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2025 Thomas Waring. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.SKI← Cslib.SKI (Cslib/Languages/CombinatoryLogic/Defs.lean:43): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Used by 16
- Cslib.SKI.Church_succCslib.SKI.Church_succ
- Cslib.SKI.ChurchFunction form of the church numerals.
- Cslib.SKI.OneChurch one := λ f x. f x
- Cslib.SKI.FFStandard false: FF := λ x y. y
- Cslib.SKI.applyList_concatCslib.SKI.applyList_concat
- Cslib.SKI.TTStandard true: TT := λ x y. x
- Cslib.SKI.Polynomial.varFreeToSKIA polynomial with no free variables is a term
- Cslib.SKI.PolynomialA polynomial is an SKI terms with free variables.
- Cslib.SKI.Polynomial.toSKIBracket abstraction, by induction using
SKI.Polynomial.elimVar - Cslib.SKI.Polynomial.evalSubstitute terms for the free variables of a polynomial
- Cslib.SKI.Polynomial.elimVarInductively define a polynomial
Γ'so that (up to the fact that we haven't defined reduction on polynomials)Γ' ⬝ t ↠ Γ[xₙ ← t]. - Cslib.SKI.ZeroChurch zero := λ f x. x
- Cslib.SKI.CoeTermPolynomialCslib.SKI.CoeTermPolynomial
- Cslib.SKI.applyListApply a term to a list of terms
- Cslib.SKI.sizeThe size of an SKI term is its number of combinators.
- Cslib.SKI.Church_zeroCslib.SKI.Church_zero
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in /-- An SKI expression is built from the primitive combinators `S`, `K` and `I`, and application. -/ inductive Cslib.SKI where /-- `S`-combinator, with semantics $λxyz.xz(yz)$ -/ | S /-- `K`-combinator, with semantics $λxy.x$ -/ | K /-- `I`-combinator, with semantics $λx.x$ -/ | I /-- Application $x y ↦ xy$ -/ | app : SKI → SKI → SKI deriving Repr, DecidableEq