test(fields): add Mersenne31 regression coverage#260
Draft
adrienlacombe wants to merge 6 commits into
Draft
Conversation
Add guards for positive subtraction, negation, square, power edge cases, division, inverse products, int powers, and ringEquiv on multiplication. Use a flat Mersenne31.Fast namespace consistent with KoalaBear.Fast tests. Co-authored-by: Cursor <cursoragent@cursor.com>
🤖 PR Summary
Mathematical Formalization
Quality Assurance & Regression Testing
Refactoring & Architecture
Note The draft summary details a comprehensive field implementation and library refactoring, which contradicts the PR title and body characterizing this change strictly as a regression-test layer. Statistics
Lean Declarations ✏️ **Removed:** 3 declaration(s)
✏️ **Added:** 114 declaration(s)
📋 **Additional Analysis**Style and Naming Guidelines
Pull Request Guidelines
Progress and Framework
📄 **Per-File Summaries**
Last updated: 2026-06-26 17:37 UTC. |
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.
Summary
Adds a small regression-test layer on top of #257's Mersenne31 implementation.
Changes
CompPolyTests.Fields.Mersenne31.Mersenne31.Basicprime, field, andNonBinaryFieldinstances.Mersenne31.Fastfield surface and representative/canonical conversion behavior for a few arithmetic paths.CompPolyTests.Validation
lake build CompPolyTests.Fields.Mersenne31lake build CompPolyTests./scripts/lint-style.py tests/CompPolyTests/Fields/Mersenne31.lean./scripts/lint-style.sh./scripts/check-imports.shlake testStack note
This PR is intended as companion regression coverage for #257. The upstream repository does not currently have the fork PR's base branch
pr257-mersenne31-base, and I do not have permission to push that branch toVerified-zkEVM/CompPoly, so this draft is temporarily opened againstmaster. As a result, GitHub's raw diff includes the #257 implementation commits in addition to this PR's two test-file changes.The additive test diff relative to
adrienlacombe:pr257-mersenne31-baseis:tests/CompPolyTests.leantests/CompPolyTests/Fields/Mersenne31.lean