Skip to content

M0 scaffold + M1 start: Lake project, Goldilocks field, bus semantics, air2lean exporter, AluOp spec, ALU infrastructure - #1

Merged
dendisuhubdy merged 6 commits into
mainfrom
feat/m0-m1-alu
Nov 20, 2026
Merged

dendisuhubdy merged 6 commits into
mainfrom
feat/m0-m1-alu

Conversation

@dendisuhubdy

Copy link
Copy Markdown
Member

Plan docs/plans/2026-10-21-m0-m1-scaffold-and-alu.md, Tasks 1–4 and half of Task 5:

  • build: Lake project (Lean v4.35.0, Mathlib), Goldilocks field, axiom audit, public pages
  • docs: ASSUMPTIONS lists the Poseidon2 dev-seed gap first
  • bus: interaction semantics and RV32 lookup contracts
  • exporter: air2lean, generated RV32 ALU constraints and tables
  • spec: AluOp.eval matching rand_zkvm isa.rs, with Rust vectors
  • alu: Alu/Basic.lean, the shared lemmas and extraction tactics for the ALU soundness proofs

Not included: Alu/Adder.lean (add/sub/slt/sltu/eq soundness). It still has 9 elaboration errors and stays local and untracked.

Local: lake build OK (1720 jobs), scripts/audit.sh OK.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GFs5gyuBMf1nCmyHCP3AT8

dendisuhubdy and others added 6 commits October 21, 2026 01:01
Lean v4.35.0 / Mathlib v4.35.0. Goldilocks F = ZMod p with a Lucas primality
certificate (7 generates, p-1 = 2^32*3*5*17*257*65537), val_add/mul/natCast
lemmas with explicit < p bounds, axiom audit script, CI, ASSUMPTIONS/PROVEN/README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0115Rg3mXUag58dbDTsH1h4d
air2lean runs the ALU chip's Air::eval through Plonky3's
InteractionSymbolicBuilder and prints its 72 base constraints and 77 bus
interactions as Lean (shared DAG nodes as lets), the range/nibble
preprocessed tables, and 42 honest rows from the real emulator +
alu_trace. It fails on any untranslated leaf, bus, interaction shape,
local interaction or extension constraint. scripts/check-generated.sh
regenerates and diffs; CI job `generated` runs it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0115Rg3mXUag58dbDTsH1h4d
AluOp/ofCode?/eval/eval_lt in Rand/RV32/AluSpec.lean; exporter alu-vectors
(19 ops x 145 pairs = 2755 vectors) checked by decide; check-generated covers
AluVectors.lean. Exporter hardenings: provide only on the owned bus, negated
count on a lookup is an error; RandTest guards lookup bus names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0115Rg3mXUag58dbDTsH1h4d
…ic.lean)

Column names of research/src/tables/alu.rs as Fin 64 constants, the AluRowOk hypothesis
bundle, cons_at / alu_look extraction from the generated constraint and interaction lists,
alu_flags, field-to-N lifting (nat_eq_of_cast, lift_eq), flags_onehot, a_lt, b_lt.
Imported from Rand.lean so CI builds it. Plan Task 5 is half done: Alu/Adder.lean
(add sub slt sltu eq) does not build yet and stays out of this commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GFs5gyuBMf1nCmyHCP3AT8
@dendisuhubdy
dendisuhubdy merged commit a95004e into main Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant