lanky
Python for math you can check.
lanky is a Python-hosted proof language with Lean 4 and Mathlib as the platform,
shaped like mypy: hints are inert, the body is executable Python, and an external
command does the checking. Theorems are typed Python functions (variables are
parameters, hypotheses are parameters annotated with propositions, the goal is the
return annotation); proofs are Python programs that drive Lean tactics over a live
goal; the recorded tactic script is the certificate; under plain python the
theorems run as property tests. Lean is the platform, lanky is a hosted language on
it (the Kotlin/JVM relationship), so all of Mathlib and every Lean tactic are
reachable. lanky itself is a thin plugin host: it defines a ledger of facts (each
with a status: tested, decided, proved, certified, assumed) and four plugin
interfaces (theories, oracles, executors, CLI verbs).
Status
Work in progress. This is a placeholder release to reserve the name. The architecture is prepared, not implemented: the ledger and the plugin protocols are written down, and nothing behind them works yet.
The sister project loopty (loop + ty for types; a typed polyhedral layer over loopy, with isl as an oracle and loopy as a code generator) will be lanky's first plugin.
Name
- "Lean Annotations Natively Kernel-check Your math".
- LANK + y, where LANK = Lean Annotations, Native Kernel — and lank means long and thin, next to lean.
Planned architecture
- A ledger of facts, each carrying a status: tested, decided, proved, certified, assumed.
- Four plugin interfaces: theories (decorators that turn Python objects into facts), oracles (establish facts and report a trust class), executors (run a decorated object), and verbs (CLI subcommands).
- A live Lean session via PyPantograph as the Lean oracle.
- A property-test executor, so theorems run as tests under plain
python. - A generated Lean file plus a source map back to the Python program as the certificate.
- The command line:
lanky check | certify | watch | shell.
Install
uv add lanky
pip install lanky
Nothing works yet — installing this release gets you a lanky command that prints
its own version and this repository's URL.
AI disclosure
This project is developed with substantial assistance from AI coding agents (Anthropic's Claude, via Claude Code). Design, direction, and review are by Xiaoyu Wei. Generated text and code are reviewed before release, but readers should assume AI involvement throughout.
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lanky-0.0.1.tar.gz.
File metadata
- Download URL: lanky-0.0.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
226031ef9871ed0caafef2ea0dfedfc2f09c68e9aaf76ab86576067d72ea543f
|
|
| MD5 |
0afdc719d0cf167257e85cca39297dd3
|
|
| BLAKE2b-256 |
a393869d1a28e96bcb155189ca4501d2b076a2f3b5576dcb1d47c485a0f90dad
|
File details
Details for the file lanky-0.0.1-py3-none-any.whl.
File metadata
- Download URL: lanky-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21b338c9bbb83b67b945349fa6a6a8d253523364835eec7a74abf1e1ab962e9c
|
|
| MD5 |
6f96e23dddcd3393d4d71f538c65d545
|
|
| BLAKE2b-256 |
84a96e4e9eaaee8fcc75e62976d5fb93e7c04bc115f8239ab08167a3560200d3
|