lean-containers is a Lean 4 library for container signatures, polynomial functors, and W-types.
The package is intentionally small, mathlib-free, and focused on a clear core API.
Add this to your Lakefile.lean:
require lean-containers from git
"https://github.com/fraware/lean-containers.git" @ "v0.1.0"Then import:
import Containersimport Containers
open Containers
def p : Poly ListSig Nat :=
{ shape := some (), children := fun _ => 42 }
#check Poly.map (fun n => n + 1) pContainer: container signatures (shape,pos)Poly sig α: polynomial functor representationPoly.map: functorial map onPolyW sig,W.fold: inductive W-types and foldM sig: nominal placeholder for future coalgebra-oriented expansion- example signatures:
ListSig,TreeSig
| Item | Value |
|---|---|
| Lean toolchain | leanprover/lean4:v4.15.0 (lean-toolchain) |
| Lake manifest | root lake-manifest.json |
| Package version | 0.1.0 (VERSION) and v!"0.1.0" in Lakefile.lean |
| SPDX license | MIT |
lake build
lake env lean FinalProductionTest.lean
lake exe lean-containersWindows release checks:
scripts\check-release-consistency.batUnix release checks:
bash scripts/check-release-consistency.shdocker build -t lean-containers .
docker run --rm lean-containers Main.lean
docker run --rm lean-containers FinalProductionTest.lean- No mathlib dependency
- No category-theory bridge layer yet
M sigis not a full final-coalgebra development
See CONTRIBUTING.md.
See DISTRIBUTION_README.md.
MIT license in LICENSE.