Repository navigation
Bump Clean to current main (f3abad7c) and Lean to v4.35.0 in formal/ - #1030
Conversation
…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.
|
/ai-review |
AI ReviewPR #1030 · 18 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: Clean bump to f3abad7c + Lean v4.35.0 I found no correctness or safety problems. This PR only touches proofs and a test harness, so it has no runtime or GPU impact. Checked
Low / cleanup
Note for CI and users: the toolchain moves to v4.35.0, so local 🤖 Generated with Claude Code |
… 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.
|
/ai-review |
| /// `(bus id, signed multiplicity, bus elements)` of a Rust interaction on a row. A sender | ||
| /// adds `+m`, a receiver `−m`; Clean's pull is `−e` and push `+e`, so the signs agree once a | ||
| /// receiver (the table that answers the lookup, Clean's push) keeps its multiplicity. | ||
| /// adds `+m`, a receiver `−m`; Clean's pull of multiplicity `e` counts `−e` and its push `+e`, | ||
| /// so the signs agree once a receiver (the table that answers the lookup, Clean's push) keeps | ||
| /// its multiplicity. |
There was a problem hiding this comment.
Low (readability): You rewrote this doc comment, but it still opens with "a sender adds +m, a receiver −m". Two lines below, the code does the opposite: if i.is_sender { -m } else { m }. Only the closing clause hints that the convention is flipped. Consider stating the convention the comparison actually uses, for example:
| /// `(bus id, signed multiplicity, bus elements)` of a Rust interaction on a row. A sender | |
| /// adds `+m`, a receiver `−m`; Clean's pull is `−e` and push `+e`, so the signs agree once a | |
| /// receiver (the table that answers the lookup, Clean's push) keeps its multiplicity. | |
| /// adds `+m`, a receiver `−m`; Clean's pull of multiplicity `e` counts `−e` and its push `+e`, | |
| /// so the signs agree once a receiver (the table that answers the lookup, Clean's push) keeps | |
| /// its multiplicity. | |
| /// `(bus id, signed multiplicity, bus elements)` of a Rust interaction on a row, signed the way | |
| /// Clean signs it: a sender (Clean's pull) counts `−m`, a receiver (the table that answers the | |
| /// lookup, Clean's push) counts `+m`. `lean_interaction_at` signs Lean's pulls the same way. |
ReviewNo Critical/High/Medium issues found. This is a mechanical port to the new Clean API: it doesn't weaken any proof and doesn't change prover or executor code. What I checked:
Minor (one inline comment): the rewritten doc comment on |
…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.
Motivation
formal/pins Clean at1a6c2842. Since then Clean removedStaticLookupChannelin favour ofAir.Flat.Lookup(#446), tagged every interaction as a push or a pull with a nonnegativemultiplicity, where a pull must have multiplicity 0 or 1 (#493), made the interaction-count bound of
a balance check explicit (
Balance.fits, anInteractionsFitpremise ofTableSoundness) and movedto Lean v4.35.0. Moving to current Clean main breaks every table, so this PR updates Clean and adapts
the model, with no change in what is proven.
Description
f3abad7c(current main) and Lean to v4.35.0.StaticLookupChannelintoformal/(LambdaVM/StaticLookup.lean); BITWISE reads itstables through
toChannel.constraints; guarantees are now stated for multiplicity
1instead of-1.EqLookup: rewritten for the currentSoundEnsembleAPI (balance parameter, channels addedbefore tables, unique table names, a demand generation mode per component);
eq_rows_correcttakes the
InteractionsFitpremise.Channels/Counted.lean: ported to directions.not_consistentnow needs only two interactions,since
BalancedInteractionscounts a pull of multiplicityN ≥ 2as a push.if_*/dif_*lemmas and replace agrindcall that no longercloses its goal.
export/*.json(interactions now carrydirectionand a nonnegative multiplicity)and sign Lean multiplicities by direction in
lean_diff.rs.How to Test
cd formal && lake buildlake env lean --run LambdaVM/Export.lean && git diff --exit-code -- exportcargo test -p lambda-vm-prover --lib lean_diffNote
The Lean toolchain moves from v4.33.1 to v4.35.0 (it comes with Clean), so local environments and anything that depends on
formal/needlake update. The first CI run downloads a new Mathlib cache and takes longer.