Implement sumToIter for CMvPolynomial#136
Open
eliasjudin wants to merge 1 commit intoVerified-zkEVM:masterfrom
Open
Implement sumToIter for CMvPolynomial#136eliasjudin wants to merge 1 commit intoVerified-zkEVM:masterfrom
eliasjudin wants to merge 1 commit intoVerified-zkEVM:masterfrom
Conversation
Clarify the intended behavior of sumToIter and implement it as an iterative fold over monomial-coefficient pairs in CMvPolynomial. Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
🤖 Gemini PR SummaryImplementation of
|
| Metric | Count |
|---|---|
| 📝 Files Changed | 1 |
| ✅ Lines Added | 6 |
| ❌ Lines Removed | 4 |
Lean Declarations
- No declarations were added, removed, or affected.
sorry Tracking
✅ **Removed:** 1 `sorry`(s)
def sumToIter {n : ℕ} {R : Type} [CommSemiring R] [BEq R] [LawfulBEq R]inCompPoly/Multivariate/CMvPolynomial.lean
🎨 **Style Guide Adherence**
The following lines violate the style guide:
- Line 310: The arrow syntax
=>is used instead of the preferred maps-to symbol↦.- Rule: "Functions: Prefer
fun x ↦ ...overλ x, ...."
- Rule: "Functions: Prefer
- Line 310: The variable name
accis used for an element of a type, which does not follow the standard naming convention.- Rule: "Variable Conventions: ...
x,y,z, ... : Elements of a generic type"
- Rule: "Variable Conventions: ...
- Line 310: The variable name
mis used for a monomial (likely a list or multi-index), but this identifier is reserved for natural numbers.- Rule: "Variable Conventions: ...
m,n,k, ... : Natural numbers"
- Rule: "Variable Conventions: ...
- Line 310: The variable name
cis used for a coefficient, but this identifier is reserved for propositions.- Rule: "Variable Conventions: ...
a,b,c, ... : Propositions" and "x,y,z, ... : Elements of a generic type" (for the coefficient).
- Rule: "Variable Conventions: ...
📄 **Per-File Summaries**
- CompPoly/Multivariate/CMvPolynomial.lean: Implements the
sumToIterdefinition to provide a Horner-style iterative reconstruction of a multivariate polynomial by folding over its internal monomial–coefficient representation.
Last updated: 2026-03-02 12:03 UTC.
7ef57e3 to
c857cff
Compare
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.
This PR adds proofs autoformalised by @Aristotle-Harmonic.
Implements CMvPolynomial.sumToIter by folding monomial-coefficient pairs into an iterative reconstruction path and clarifies the function behavior in its docstring.
Closes #56.
Co-authored-by: Aristotle (Harmonic) aristotle-harmonic@harmonic.fun