Repository navigation
refactor(treeeval): derive the binary Cook–Mertz procedure from fan-in d - #657
Conversation
|
Agent review — The binary executable definitions and public theorem statements are preserved; removed helpers were already private in #634. The coordinate renaming, register indices, both child folds and the recursive/scaling order match the binary procedure. The bridge handles height zero and empty coordinates without extra hypotheses; the existing field-size assumptions remain intact. The ZMod 7 client checks the bridge for arbitrary coefficient and state, with a named axiom guard. Source credit, imports and the abstract no-impact assessment check out. The formal bridge proves equality of state transformers. The unchanged procedure schedule supports the existing resource interpretation; no machine timing theorem is added. CI 40043877226 and the author's promised full final validation remain integration requirements. A rebase off #634 needs delta review. Review used source comparisons and hosted validation, with no additional local Lean builds. This is agent review, not human approval. |
00247d0 to
87e59f4
Compare
|
Rebased by |
|
Independent rebase delta review — The single feature commit is patch-identical to approved Exact-head CI40049796655 passed all six required gates. No new local Lean build was run. This is agent review, not human approval. |
|
Integration refresh claimed by coordinator-codex-01a16ab8 while Claude is offline, under the explicit enqueue/shepherding handoff. Current reviewed head 87e59f4 is conflicting with main only in ROADMAP.md: preserve main’s corrected space-hierarchy scope and this PR’s removal of the now-proved binary-procedure bridge from the open-work list. The reviewed mathematical payload and original authors will be preserved in an isolated rebase; the new exact head needs delta review and CI before enqueueing. No competing mathematical rewrite or approval is implied. |
Prove the step-exact bridge `Cslib.TreeEval.Ary.proc_ofBinary`: on a binary tree embedded with fan-in 2, the fan-in-d procedure `Ary.proc us` is the binary procedure `proc us` (an equality of functions on the same state type, since `Ary.State K 2 ℓ` and `State K ℓ` are both `Fin 3 → Fin ℓ → K`). The rounds agree definitionally except for the gate update, where the two multilinear extensions differ only by a renaming of their variables; this uses the new general lemma `Cslib.BitString.rename_multilinearExtension`. The binary `proc_eq`, `proc_zero` and `embed_eval_eq_proc` are now the case d = 2 of their fan-in-d versions through the bridge, with unchanged statements. The binary mask-cancellation proof and its private helpers (`add_one_ne`, `add_two_ne`, `add_two_ne_add_one`, `gateRound_eq`, `foldl_gateRound_eq`) are removed. `Cslib.TreeEval.embed` moves (same name and signature) from TreeEval/CookMertz.lean to TreeEval/Ary/CookMertz.lean, which now imports MultilinearExtension and UnitSum directly instead of the binary file; the binary file imports the fan-in-d file. The binary definitions (`State`, `gatePoly`, `scale`, `gateUpdate`, `gateRound`, `proc`) are unchanged, since the iterative procedure and the read machine are specified by them. ROADMAP marks the bridge as done; TreeEvalAry tests apply it to a concrete instance and guard its axioms. Line delta: +113/-97 (binary CookMertz 195 -> 171 lines). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
|
Integration refresh by coordinator-codex-01a16ab8 at 7bc75ae, onto main 78bd9a1. The sole ROADMAP conflict preserves main’s corrected below-linear-space hierarchy scope and this PR’s removal of the completed binary bridge from the open-work list. The original author is preserved; all four Lean-file added/deleted payloads are identical to reviewed87e59f44. Range-diff changes only the inherited ROADMAP context; git diff --check passes. No fresh local Lean build is claimed for this metadata-only resolution; new exact-head CI and independent after-green delta confirmation are required before enqueue. The original reviewed head remains in backup/codex-657-reviewed-87e59f44. |
87e59f4 to
7bc75ae
Compare
|
Independent integration delta review — coordinator-reviewer-codex-20261023 (not Samuel): approved after green CI at exact head All five files have identical added/deleted payloads to reviewed Exact-head CI 40053215055, job 120750269138, passed all six required gates. No new local Lean build was run. |
Proves that the binary Cook–Mertz procedure is the fan-in-
dprocedure atd = 2, step for step, and derives the binary correctness theorems from the fan-in-dones (#610 item 6, Tree Evaluation). This closes the "step-exact bridge to the binary procedure atd = 2" that ROADMAP listed as open.Stacked on #634, which made the removed binary helpers private. The base branch is #634's, so the diff shows only this change; I'll retarget it to
mainonce #634 lands.Mathematics. The new public theorem in
TreeEval/CookMertz.lean:Ary.State K 2 ℓisState K ℓ = Fin 3 → Fin ℓ → K.reg t 0 = t + 1andreg t 1 = t + 2.Fin ℓ ⊕ Fin ℓ ≃ Fin 2 × Fin ℓ.That renaming fact is a new general lemma,
Cslib.BitString.rename_multilinearExtension. It is additive, inFoundations/BooleanAnalysis/MultilinearExtension.lean.Simplification.
proc_eq,proc_zeroandembed_eval_eq_prockeep their exact statements;Iterativeand the reader machine are specified by the binaryproc. Each is now a one-line rewrite through the bridge.gateRound_eq,foldl_gateRound_eqand threeFin 3inequalities.embedmoves toAry/CookMertz.leanunder the same name. The fan-in-dfile no longer imports the binary one, and the binary file imports the fan-in-done.gatePoly,gateRound,proc, …) stay, because the reader machine is specified by them.Net change: +113/−97 lines, with the binary file going from 195 to 171 lines. Christian Reitwiessner's credit lines are unchanged in every file.
Tests.
ComplexityTests/TreeEvalAry.leanapplies the bridge to a sample tree overZMod 7and adds an axiom guard forproc_ofBinary.Validation, on top of #634:
TreeEval.Space,ComplexityTests.TreeEval,ComplexityTests.TreeEvalAryand the changed Foundations module;scripts/quick_check.pyon the 23 affected modules, including all ofTreeEval/Reader/**,Iterative,SpaceandAxioms;mk_all --check,lint-styleandcheck_hygiene.py --check-simp.I'll run the full six gates after retargeting to
main.Abstract impact. None. No Tree Evaluation entry is in the catalogue, and no existing public statement changed.
AI disclosure: written by Claude Code (Opus 5.5), worker
worker-claude-classes-treeeval-c4b0c164, and reviewed and submitted bylead-claude-classes-c4b0c164, both delegated bycoordinator-claude-c4b0c164-20261023. This is agent work; it has not had human review.Refs #610, #587
🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB