Repository navigation
Conversation
…lean
A new Lake project, formal/extraction, where the crates' Lean models
(hax: charon + aeneas) will be proved to refine the statement. Nothing
is extracted: every crate is an empty stub fixing its library's name and
its imports along the Cargo graph.
- toolchain.toml pins hax, charon, aeneas and charon's Rust as
Plonky3-lean does; the target is riscv64gc-unknown-linux-gnu, so the
SIMD arms are excluded while usize stays 64-bit and std builds.
- lakefile.toml requires the statement (path), Aeneas and CoreModels;
all resolve to the statement's Mathlib, with its pins unchanged.
- crates/<crate>/crate.toml per workspace crate (state, spec modules).
- Refinement/{Claims,Spec,Proofs,Lib}, claims.toml, TRUST.md, HaxExt.
- tools: check-layout.py (crates/, lakefile and Cargo agree, imports
follow Cargo), check-claims.py and extract/ ported from Plonky3-lean.
- CI job `extraction` and check-all.sh step `extraction`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This proposal makes sense in that it's very similar to the structure on Plonky3-lean - an alternative way to do this would be to just have a |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets up
formal/extraction/, a Lake project for proving that leanVM's Rust refines the Lean statement. The layout follows Plonky3-lean. Nothing is extracted yet.Why
formal/Statement/transcribes the Rust by hand, and differential tests (check-all.sh vectors) pin the transcription to the Rust. Extracting the crates with hax (charon + aeneas) turns that pin into a theorem: each extracted function computes what its statement definition computes. With everything in place now, the first extraction only has to fill in one directory.What
toolchain.toml: pins hax, charon, aeneas and charon's Rust to the same builds as Plonky3-lean, whose aeneas build already targets Lean 4.35 and the statement's Mathlib. The target isriscv64gc-unknown-linux-gnu. Because it is neither x86-64 nor aarch64, every SIMD arm is excluded, whileusizestays 64-bit andstdbuilds (Plonky3-lean'sthumbv7emwould give neither).lakefile.toml: requires the statement (by path), Aeneas and CoreModels. All three resolve to one Mathlib, and the statement's pins are unchanged.crates/<crate>/: one directory per workspace crate exceptbench. Each has acrate.tomlgiving its state (stub/scoped/extracted) and the statement modules its claims will target (spec), plus an empty stub whose imports follow the Cargo graph.Refinement/(Claims, Spec, Proofs, Lib),claims.toml,TRUST.mdandHaxExt.lean.Specdefines its first reading function, from a modelu64to the statement'sK.tools/:check-layout.py(new) checks that crates/, the lakefile and Cargo agree, and that imports follow Cargo.check-claims.pyandextract/are ported from Plonky3-lean.extractionjob inlean.yml, and anextractionstep incheck-all.sh.Plan
verifier, againstStatement/LeanVmVerifier.lean: it has no dependencies, nounsafeand nocfg(target_arch).signatures.Statement/Prover/.Checks
./check-all.sh extractionpasses: escape scan, layout, build (Aeneas, CoreModels, statement field modules, all 12 crate libraries) and claims.check-layout.pyfails, as it should, on a stray import and on a strayextraction/directory.check-claims.pyfails, as it should, on a claim that has noclaims.tomlentry.extract.sh --tools-onlyreports the missing toolchain cleanly. The full extraction path has not run yet: no crate is extracted, and hax is not installed here.Open questions
LeanvmCoreforleanvm_core), inferred from Plonky3-lean. The first extraction will confirm them.🤖 Generated with Claude Code