Skip to content

[codex] Add Mersenne31 circle domain skeleton#3

Draft
adrienlacombe wants to merge 3 commits into
pr257-mersenne31-basefrom
feat/mersenne31-circle-domain
Draft

[codex] Add Mersenne31 circle domain skeleton#3
adrienlacombe wants to merge 3 commits into
pr257-mersenne31-basefrom
feat/mersenne31-circle-domain

Conversation

@adrienlacombe

Copy link
Copy Markdown
Owner

Summary

Adds a STWO-style circle-domain skeleton on top of the Mersenne31 field work in Verified-zkEVM#257.

Changes

  • Adds CompPoly.Fields.Mersenne31.Circle.
  • Defines Mersenne31 circle points as pairs satisfying x^2 + y^2 = 1.
  • Records STWO's M31 circle generator (2, 1268011823) and proves it lies on the circle.
  • Adds circle point conjugation, antipode, addition, and repeated addition.
  • Defines CirclePointIndex modulo 2^31, subgroup generator indices, cosets, conjugate cosets, circle domains, and canonical cosets.
  • Proves structural domain facts: coset size/index stepping, conjugate index ordering, domain size, and canonical-domain log size.
  • Adds regression tests for generator, subgroup index, coset, domain, and canonical-domain behavior.

Non-goals

This intentionally does not prove the generator has order 2^31, nor does it formalize FRI or circle polynomial evaluation. Those are follow-on PRs after the domain skeleton stabilizes.

Validation

  • lake build CompPoly.Fields.Mersenne31.Circle
  • lake build CompPolyTests.Fields.Mersenne31.Circle
  • ./scripts/check-imports.sh
  • ./scripts/lint-style.sh
  • lake build CompPolyTests
  • lake build CompPoly
  • lake test

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Build Timing Report

  • Commit: fbad85c
  • Message: Merge fac0909 into 5742dfa
  • Ref: feat/mersenne31-circle-domain
  • Comparison baseline: e246f2e from the previous successful PR update.
  • Measured on ubuntu-latest with /usr/bin/time -p.
  • Commands: clean build rm -rf .lake/build && lake build; warm rebuild lake build; test path lake test.
Measurement Baseline (s) Current (s) Delta (s) Status
Clean build 400.30 443.35 +43.05 ok
Warm rebuild 1.37 1.40 +0.03 ok
Test path 38.83 38.20 -0.63 ok

Incremental Rebuild Signal

  • Warm rebuild saved 441.95s vs clean (316.68x faster).

This compares a clean project build against an incremental rebuild in the same CI job; it is a lightweight variability signal, not a full cross-run benchmark.

Slowest Current Clean-Build Files

Showing 20 slowest current targets, with comparison against the selected baseline when available.

Current (s) Baseline (s) Delta (s) Path
52.00 41.00 +11.00 CompPoly/Fields/Binary/Tower/Abstract/Basis.lean
50.00 51.00 -1.00 CompPoly/Fields/Binary/BF128Ghash/XPowTwoPowModCertificate.lean
49.00 39.00 +10.00 CompPoly/Univariate/DivisionCorrectness.lean
35.00 30.00 +5.00 CompPoly/Bivariate/Factor.lean
31.00 26.00 +5.00 CompPoly/Fields/Binary/BF128Ghash/Impl.lean
30.00 24.00 +6.00 CompPoly/Bivariate/GuruswamiSudan/Root/RothRuckenstein/Correctness.lean
28.00 26.00 +2.00 CompPoly/Bivariate/ToPoly.lean
28.00 26.00 +2.00 CompPoly/Bivariate/Deriv.lean
26.00 23.00 +3.00 CompPoly/Univariate/Raw/Proofs.lean
21.00 17.00 +4.00 CompPoly/Univariate/NTTFast/Correctness/Radix4DIT.lean
18.00 13.00 +5.00 CompPoly/Fields/Binary/AdditiveNTT/Intermediate.lean
17.00 17.00 +0.00 CompPoly/Univariate/NTTFast/Correctness/Radix4DIF.lean
16.00 14.00 +2.00 CompPoly/Univariate/NTT/Forward.lean
16.00 14.00 +2.00 CompPoly/Bivariate/GuruswamiSudan/Interpolation/LeeOSullivan/Correctness/Divisibility.lean
16.00 14.00 +2.00 CompPoly/Bivariate/GuruswamiSudan/Root/Alekhnovich/Correctness.lean
15.00 14.00 +1.00 CompPoly/Fields/KoalaBear/Fast.lean
15.00 13.00 +2.00 CompPoly/Fields/Binary/AdditiveNTT/NovelPolynomialBasis.lean
15.00 12.00 +3.00 CompPoly/Univariate/NTTFast/Correctness/DIF.lean
15.00 20.00 -5.00 CompPoly/Fields/Binary/Tower/Support/Preliminaries.lean
14.00 9.70 +4.30 CompPoly/Multilinear/Basic.lean

adrienlacombe and others added 2 commits June 26, 2026 19:32
Require logSize bounds on subgroupGen, document toPoint limitations,
add toPoint/add_zero lemmas, and expand circle regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Rename `Point.add_zero` (proves `0 + p = p`) to `Point.zero_add` to
  match the repo's Mathlib-style naming convention.
- Drop the discarded `logSize ≤ logOrder` argument from
  `CirclePointIndex.subgroupGen`; the body is total, and callers
  (`Coset.new`, `odds`, `halfOdds`) carry the bound where it is needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant