refactor(binary-tower): rewrite towerAlgebraMap using Fin.dfoldl#141
Open
erdkocak wants to merge 2 commits intoVerified-zkEVM:masterfrom
Open
refactor(binary-tower): rewrite towerAlgebraMap using Fin.dfoldl#141erdkocak wants to merge 2 commits intoVerified-zkEVM:masterfrom
erdkocak wants to merge 2 commits intoVerified-zkEVM:masterfrom
Conversation
🤖 Gemini PR SummaryRefactors the binary tower's Key Changes
Technical Impact
Analysis of Changes
Lean Declarations
🎨 **Style Guide Adherence**Based on the style guide provided, here are the violations found in the diff:
📄 **Per-File Summaries**
Last updated: 2026-03-05 10:35 UTC. |
Contributor
Author
|
Linter seems to be failing because of the line count. I guess we can add an exception to linter, but I did not wanted to do that without discussing first. |
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.
I moved the main logic to
towerAlgebraMapCore,towerAlgebraMapis now just a wrapper around it. Existing callers oftowerAlgebraMaprequire no API changes. I kept the current if else branching logic intowerAlgebraMapbecause it helps with proofs. But if preferred I can also do something like:def towerAlgebraMap (l r : ℕ) (h_le : l ≤ r) : BTField l →+* BTField r := cast (BTField.RingHom_eq_of_dest_eq (k:=l) (m:=l + (r - l)) (n:=r) (Nat.add_sub_of_le h_le)) (towerAlgebraMapCore l (r - l))Also, I changed the name of the hypothesis in the
towerAlgebraMapbranch to h_eq because it made more sense.Fixes #130
Co-authored-by: GPT-5.3-Codex