A Lean formalization of Huzita--Hatori origami constructions, accompanied by a web interface for composing fold operations and checking the resulting Lean trace.
- Origami/ : Lean formalization (including
lightweight_definitions) - origami_api.py : stacks Huzita axiom calls and generates the Lean construction
- origami_server.py : routes the web UI to the Python API and to
lake env lean - origami-sim/ : Web UI (crease pattern viewer as the picking surface) + Rust/WASM core
You need a Rust toolchain installed (cargo + rustc). First run can take a while because it downloads Mathlib and compiles Rust/WASM.
From the repository root, run:
chmod +x run-origami.sh
./run-origami.shOpen http://localhost:8000/, then:
- (Optional) Upload a
.foldfile as the paper — a unit square loads by default. - In the Huzita Axioms panel, pick an axiom (A1–A7), then click
Pickfor each required point/line and click it on the canvas. - Click
Add to stack— the call is validated, sent to the Python API, and appended to the Construction Stack. - Repeat to stack more axiom calls; picked entities are reused when you click the same point/crease again, so later axioms can build on earlier folds.
- Click
Build Lean sequenceto write the generated Lean file and compile it withlake env lean; the result is reported back in the panel.
Use ./make-anonymous-archive.sh to create origami-anonymous.zip next to
the repository. The archive excludes Git metadata, editor settings, local
environments, generated build artefacts, and local notes; it contains the
source required to build and run the project.