Repository navigation
perf(BF64): check the Rabin certificate on GF(2) bitmasks - #412
Merged
alexanderlhicks merged 4 commits intoNov 18, 2026
Merged
Conversation
`by rfl` evaluated each runChain certificate twice: once in the elaborator's isDefEq, then again in the kernel. `decide +kernel` skips the elaborator pass. BF64/Basic.lean goes from 51.2 s and 46.0 s to 26.4 s and 26.0 s (alternating runs, same orb). Statement and axioms of basePoly_irreducible are unchanged. Co-authored-by: Parithosh Jayanthi <parithosh@forkchoice.ai> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a66d-72db-7532-b204-db0dff8754a6
Over GF(2) a polynomial is a bitmask, addition is xor and multiplication is carry-less. CompPoly.RabinCert.Binary checks a square-and-multiply chain that way, with the same soundness statements as the list checker (dvd_X_pow_sub_X_of_runChain, isCoprime_X_pow_sub_X_of_runChain), so the Rabin wrappers are unchanged. gen_rabin_certificate.py --binary emits the data; BF64.BaseCert is regenerated with it. BF64/Basic.lean: 27.4 s, 27.1 s -> 2.9 s, 2.6 s; BF64/BaseCertificate.lean: 5.1 s, 5.3 s -> 2.2 s, 2.3 s (alternating runs, same orb, against the decide +kernel version). The file-level maxHeartbeats/maxRecDepth options are no longer needed. basePoly_irreducible keeps its statement and axioms; the list-encoding helpers baseCoeffs, toPoly_baseCoeffs and toPoly_replicate_zero are removed. Co-authored-by: Parithosh Jayanthi <parithosh@forkchoice.ai> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a66d-72db-7532-b204-db0dff8754a6
Contributor
🤖 PR SummaryMathematical Formalization
Proof Completion (sorries removed)
Protocols / Soundness
Infrastructure / CI
Refactoring
Documentation
Performance
Notable side effects
Statistics
Lean Declarations ✏️ Removed: 3 declaration(s)
✏️ Added: 26 declaration(s)
✏️ Affected: 4 declaration(s) (line number changed)
📋 **Additional Analysis**FindingsPerformance contribution requirements
Syntax errors
Style and naming
Documentation
Other checks
Summary 📄 **Per-File Summaries**
Last updated: 2026-11-18 01:20 UTC. |
alexanderlhicks
enabled auto-merge (squash)
November 18, 2026 00:40
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.
Stacked on #410; the diff shrinks to one commit once #410 merges.
Over GF(2) a polynomial is a bitmask: addition is
xorand multiplication is carry-less. The newCompPoly.RabinCert.Binary(Data/Polynomial/RabinCertificateBinary.lean) checks a square-and-multiply chain that way. It provestoPoly_clmul(carry-less product is polynomial multiplication) and providesdvd_X_pow_sub_X_of_runChain/isCoprime_X_pow_sub_X_of_runChainwith the same shape as the list versions, so the Rabin wrappers are unchanged.gen_rabin_certificate.py --binary(p = 2 only) emits the data, andBF64.BaseCertis regenerated with it; list mode stays byte-identical.BF64/Basic.leanBF64/BaseCertificate.leanThe file-level
maxHeartbeats 400000/maxRecDepth 4000inBF64/Basic.leanare no longer needed. A deliberately wrong claimed result is rejected.Checks.
lake build --wfail,lake build --wfail CompPolyTests,lake exe axiomsweep --check. Per-declaration diff:basePoly_irreduciblekeeps its statement and axioms (propext,Classical.choice,Quot.sound); no existing axiom set changes.Tradeoffs.
BF64.baseCoeffs,BF64.toPoly_baseCoeffs,BF64.toPoly_replicate_zero. A downstream user of these would break.BF64.BaseCertchange type fromList ℕ/List Steptoℕ/List Binary.Step, and the data reads as large decimals rather than coefficient lists.modulusthat would clash with the generated one).