fix(MLDSA): make Primitives.Laws inhabitable; bank the FIPS-shaped concrete witness#479
fix(MLDSA): make Primitives.Laws inhabitable; bank the FIPS-shaped concrete witness#479alik-eth wants to merge 1 commit into
Conversation
…tness Three Laws fields were jointly unsatisfiable, making every Laws-conditional MLDSA statement vacuously true: - expandS_honest_sampling asserted that the deterministic image of 2^256 seeds is distributed as uniform RqVec l x RqVec k, which fails by cardinality. The field is dropped; the MLWE key-swap hop instead carries an explicit total-variation slack hypothesis honestSamplingSlack idealGap, threaded through nma_keyswap_hop and nma_security as + idealGap (trivially satisfiable at idealGap = 1, quantitative under a ROM reading). - w1Encode_injective demanded injectivity on the full Vector High p.k carrier, false for the truncating packer; weakened to Set.InjOn on vectors of highBits representatives, which is what commitment binding uses. - expandMask_bound used gamma1 - 1 where FIPS 204's ExpandMask coefficients lie in [-gamma1 + 1, gamma1]; corrected to gamma1. Concrete/Laws.lean + Concrete/NonVacuity.lean bank the kernel-checked witness: seedRevealingPrims (concretePrimitives with the rho-component of expandSeed exposed) satisfies all Laws fields for any approved parameter set, so Primitives.Laws is now inhabitable (mldsa_laws_inhabited). Supporting encoding/sampling/rounding lemmas and Ring norm additions included. Claude-Session: https://claude.ai/code/session_01DaNGD9nDo3Grwk58nsjS77
🤖 PR SummaryMLDSA Primitives.Laws Fix and Non-Vacuity Certificate (FIPS 204 Alignment) This PR repairs the Mathematical Formalization
Proof Completion / Sorries Removed No new Protocols / Soundness
Infrastructure / CI
Concrete Witness (Non-Vacuity)
Documentation / Meta
Refactoring
Key Files The core changes are in Statistics
Lean Declarations ✏️ Added: 91 declaration(s)
✏️ Affected: 3 declaration(s) (line number changed)
📋 **Additional Analysis**The diff largely conforms to the project's contributing guidelines, but there are a few items to note. 📄 **Per-File Summaries**
Last updated: 2026-07-12 23:31 UTC. |
Extracts the ML-DSA
Primitives.Lawsrepair and its concrete witness out of #467, per @quangvdao's review there, so it can land independently of the EUF-CMA development. #467 will be rebased on top once this merges.The problem
On
main,Primitives.Lawsis uninhabitable — three fields are jointly (and individually) unsatisfiable — so every Laws-conditional MLDSA statement (nma_security, completeness, HVZK) is vacuously true.#print axiomscannot see this: the theorems are axiom-clean, they just assert nothing at any realizable instance.expandS_honest_samplingasserts the deterministic image of2^256seeds is uniform onRqVec l × RqVec k— false by cardinality (2^256 < |Rq|).w1Encode_injectivedemands injectivity on the fullVector High p.kcarrier — false for the truncating packer.expandMask_boundusesγ₁ − 1where FIPS 204'sExpandMaskcoefficients lie in[-γ₁ + 1, γ₁]— spec drift.The fix
expandS_honest_samplingis dropped. The MLWE key-swap hop instead carries an explicit total-variation slack hypothesishonestSamplingSlack idealGap, threaded throughnma_keyswap_hopandnma_securityas+ idealGap. This is honest: trivially satisfiable atidealGap = 1, quantitative under a ROM reading of the XOF.w1Encode_injectiveweakens toSet.InjOnon vectors ofhighBitsrepresentatives — exactly what commitment binding uses (w₁always arises as such a vector).expandMask_boundcorrected toγ₁.The witness (the non-vacuity certificate)
Concrete/Laws.lean+Concrete/NonVacuity.leanproveMLDSA.mldsa_laws_inhabited: the FIPS-shapedseedRevealingPrims(=concretePrimitiveswith theρ-component ofexpandSeedexposed, a logical-consistency witness only) satisfies all Laws fields for any approved parameter set.Primitives.Lawsis now inhabitable, so the conditional security statements have content.Verification
lake buildof the full CI library set onleanprover/lean4:v4.31.0: green, zero non-sorry warnings.#print axioms MLDSA.nma_security:[propext, Classical.choice, Quot.sound].#print axioms MLDSA.mldsa_laws_inhabited/seedRevealingPrims_laws: the same plus the one pre-existing, disclosednative_decideaxiom for the NTT matrix inversion identity (invNTTMatrix_nttMatrix_entry).The diff outside
Primitives.lean+Concrete/is the key-swap adaptation inSecurityNMA.leanand supporting norm lemmas inRing/.