Repository navigation
feat(formal): Clean/Lean model of BITWISE, LT, EQ and SHIFT with proo… - #1027
ColoCarletti wants to merge 26 commits into
Conversation
…fs and a differential check against the prover
|
/review-ai |
|
/ai-review |
|
Review summary No critical, high or medium issues. The Rust changes are test-only, apart from making
Minor notes (two are posted inline):
🤖 Generated with Claude Code |
…el to its channel API. Clean removed StaticLookupChannel in favour of Air.Flat.Lookup, so the structure moves to LambdaVM/StaticLookup.lean and BITWISE reads its tables through toChannel. Interactions now carry a direction and a nonnegative multiplicity, and a pull must have multiplicity 0 or 1: EQ, LT and SHIFT discharge that from their existing bit constraints, and their guarantees are stated for multiplicity 1 instead of -1. EqLookup is rewritten for the current SoundEnsemble API (a balance parameter, channels added before tables, unique table names, a demand generation mode per component), and eq_rows_correct takes the InteractionsFit premise that TableSoundness now has. Channels/Counted.lean is ported to directions; not_consistent needs only two interactions, since a pull of multiplicity N >= 2 counts as a push. A grind call in IsByte that no longer closes its goal is replaced by a direct proof. The export now records each interaction's direction, so the JSON files are regenerated and lean_diff.rs signs Lean multiplicities by direction. Nothing that is proven changes.
…p fallback the linter flags. if_true, if_false, if_pos, if_neg, dif_pos and dif_neg become ite_true, ite_false, ite_eq_left, ite_eq_right, dite_eq_left and dite_eq_right, as in Clean. In SHIFT, first | ... | skip becomes try first | ..., which behaves the same. The build has no warnings left.
… the bump, and the renames left in SHIFT's completeness proof. Both lemmas discharged a pull requirement stated with the old multiplicity -1 (`¬ -e = -1 → ¬ e = 0 → P`), which the directed interactions no longer produce. In SHIFT, the hypotheses that needed neg_inj.mp to go from `-x = -1` to `x = 1` now arrive as `x = 1`, so they are introduced under their final names instead of being copied.
…tates the sign the comparison uses: a sender (Clean's pull) counts −m and a receiver (Clean's push) +m. The old first sentence described the prover's LogUp sum, where a sender adds +m, and read as if it contradicted the code below it. Comment only, no code change.
Clean's Demand.direction is the net sign of a message, pushes minus pulls, so a demand of direction .pull is one that was pulled more often than pushed and needs a component that pushes to answer it. EQ pushes its result on the ALU bus, so its generation mode has to trigger on .pull, the same way pushStaticComponent does and the same way Clean's own add8Component and lookup provider do. The field is inert today, since generation is not part of TableSoundness and nothing here runs Clean's witness generator, but .push described a component that answers pushes by pulling, which EQ never does.
The Clean bump changed the things this file documents: pulls carry a nonnegative multiplicity with an explicit direction instead of a negative one, a pull owes a multiplicity of 0 or 1, BalancedInteractions no longer carries the interaction count bound (it moved to the Balance's fits, reaching soundness as the InteractionsFit premise), and not_consistent is now a two-interaction witness instead of the p/N construction. Also lists LambdaVM/StaticLookup.lean, which the bump added, and records that the export format carries the direction.
Bump Clean to current main (f3abad7c) and Lean to v4.35.0 in formal/
…ked export check, BITWISE note in README
… credit EqLookup to its PR. The section linked the fork by branch name while lakefile.toml pins by sha, so the two could drift, and the link dies when the branch is renamed or deleted once the upstream PRs land. It also said "Clean main f3abad7c plus three commits", which was true of the old pin and not of 73309694: that one is the three commits plus the four review fixes answering the audit of them. And EqLookup, described there as "in this same PR", is already in the model from PR #1027.
|
/ai-review |
AI ReviewPR #1027 · 35 changed files
FindingsNo non-rejected structured findings were reported. Reviewer Lanes
Native Codex and Claude reviews run separately and post their own comments. They are not included in this structured provenance report. Raw lane outputs, candidates, final issues, and model metrics are uploaded as workflow artifacts. |
Review: Lean formal model +
|
…ed elan, export fails on a missing table entry
|
Review notes, checked at f927f3e. Not proven: fine to leave out, but please say so in the READMEThese are scope limits, not bugs. Please add a short "What is intentionally not proven" section to
The differential test
CI
Minor
|
…n in README, slimmer lake cache, review fixes
Thanks for the review. Addressed in the latest push, checked at 04449f1: Not proven (1–4): new README section "What is intentionally not proven" listing the four limits in one place. Differential test
CI
Minor: Follow-up, not in this PR: the shared limb lemma, keying |
… credit EqLookup to its PR. The section linked the fork by branch name while lakefile.toml pins by sha, so the two could drift, and the link dies when the branch is renamed or deleted once the upstream PRs land. It also said "Clean main f3abad7c plus three commits", which was true of the old pin and not of 73309694: that one is the three commits plus the four review fixes answering the audit of them. And EqLookup, described there as "in this same PR", is already in the model from PR #1027.
This reverts commit 10856f8.
…fs and a differential check against the prover