feat(ReedSolomon): certify the forward NTT as a Reed-Solomon encoder#266
Open
Abraxas1010 wants to merge 1 commit into
Open
feat(ReedSolomon): certify the forward NTT as a Reed-Solomon encoder#266Abraxas1010 wants to merge 1 commit into
Abraxas1010 wants to merge 1 commit into
Conversation
🤖 PR SummaryMathematical Formalization
Proof Architecture
Documentation
Infrastructure
Statistics
Lean Declarations ✏️ Added: 5 declaration(s)
📋 **Additional Analysis**The diff introduces a new file 📄 **Per-File Summaries**
Last updated: 2026-07-10 15:58 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
CompPoly/Univariate/ReedSolomon/NTTEncode.lean, tying two existing developments together: over the evaluation domain induced by a radix-2 NTT domain, the forward NTT of a message polynomial's coefficients is exactly the Reed–Solomon encoding.nttDomainToRS : NTT.Domain F → ReedSolomon.Domain F— the node array#[ω⁰, …, ω^(n-1)], nodup viaIsPrimitiveRoot.pow_inj.forwardImpl_eq_encode—Forward.forwardImpl D (messagePoly msg).val = (encode (nttDomainToRS D) msg).toArray, for everymsg : Vector F kwithk ≤ D.n. No padding is needed:messagePolytrims, so the degree bound suffices; the degree obligation forforwardImpl_eq_evalOnDomainis discharged frommessagePoly_degree_lt+degree_toPoly(with thep = 0case from2^logN > 0).nttCodeword/nttCodeword_eq_encode— the vector-level packaging.#print axioms forwardImpl_eq_encode:[propext, Classical.choice, Quot.sound].Why
This gives the
O(n log n)evaluation path a certified encoder semantics: fast-encoded words provably live in the code the definitional encoder generates. Downstream (in ArkLib, where we are separately bridgingReedSolomon.encodeto the abstractReedSolomon.code— see the coordination note on ArkLib#574) this composes to "the NTT output is a member of the abstract Reed–Solomon code", the runnable content FRI-style proximity statements quantify over.The module docstring records the natural-order caveat explicitly:
NTTFast.forwardImplis bit-reversed (forwardImpl_eq_bitRevPermute_evalOnDomain), so this file deliberately usesNTT.Forward.forwardImpl; the fast variant composes withbitRevPermuteas follow-up.Validation performed (not in the diff)
Full
lake build CompPolygreen at heade95ba1b(2517 jobs, warning-free). Concrete corpus overZMod 17(ω = 2, n = 8, k = 4, with a fully constructiveIsPrimitiveRootwitness — bounded case split, no order-of machinery): forward NTT andencodeagree byte-for-byte (#[10, 15, 7, 13, 15, 11, 6, 16]). Mutation check: perturbing the induced domain's node order makesforwardImpl_eq_encodefail to compile (3 errors) — the equality is genuinely order-sensitive, not definitional coincidence.Contributed by The Institute for Ontological Mathematics (IAOM) / Equation Capital dba Apoth3osis.