Several ML-DSA lemmas in LatticeCrypto currently carry the challenge–secret
product bound as a hypothesis rather than a theorem, e.g. the
h_s_bound-style binders in
MLDSA/Signature.lean
(also here and
here):
(h_s_bound : LatticeCrypto.cInfNorm ((prims.sampleInBall sig.cTilde • sk.s2).get j) ≤ p.beta)
We have a complete, sorry-free Lean 4 / Mathlib development of exactly this
fact and would like to contribute it. In your vocabulary (canonical vector
backend over ZMod q), the general lemma is:
theorem cInfNorm_mul_le_of_lt {q n} (c s : Poly (ZMod q) n)
(h : 2 * (l1Norm c * cInfNorm s) < q) :
cInfNorm (c * s) ≤ l1Norm c * cInfNorm s
Two points worth making explicit:
-
The size condition is essential, not an artifact. Over centered
representatives the unconditional cInfNorm (c * s) ≤ l1Norm c * cInfNorm s
is false — the centered lift of a product can wrap mod q. The
2·(l1Norm c · cInfNorm s) < q guard is exactly the no-wraparound
condition; for the FIPS 204 parameter sets it holds with 4 orders of
magnitude to spare (2τη = 156 / 392 / 240 against q = 8380417). We
believe this is precisely why the fact sits as a hypothesis today — it is
a real theorem, not a one-liner.
-
The port looks direct. Since
negacyclicMulPure_coeff
makes your product coefficient definitionally a negacyclicConvCoeff, the
proof reduces to (i) an integer-side bound on the negacyclic convolution
(‖c·s‖∞ ≤ ‖c‖₁·‖s‖∞, which we have, sharp — the bound is attained), and
(ii) the centered-lift/no-wrap argument through zmodCenteredCoeffView —
the same uniqueness-of-small-representative fact we proved for
ℤ_q[X]/(X^n+1), which needs only 1 < q (monicity of X^n + 1; no
primality or field structure).
What we hold today, verified with #print axioms = [propext, Classical.choice, Quot.sound] throughout, on Lean 4.22.0 + Mathlib v4.22.0
(we would of course port to your v4.30.0 pin and house idioms per
AGENTS.md): the sharp product bound with an attainment witness; the
∃!-small-representative theorem mod q for any q > 1; and the y + c·s
no-wraparound corollary underpinning the ‖z‖∞ < γ₁ − β check (it
guarantees the centered mod-q representative of z is the faithful integer
value the check inspects), instantiated at all three FIPS 204 parameter
sets. The proof files, an axiom-audit transcript, and build instructions are
in this gist:
https://gist.github.com/jasonsoroko/79dab7c29a148f1766b2721aace8b4c1
(Full repository public with our forthcoming preprint.)
A natural follow-up we could include: l1Norm (sampleInBall x) ≤ τ appears
not to exist yet either — with it, the h_s_bound binders discharge
entirely; without it, they at least reduce to the more primitive sampler
sparsity spec.
Questions before we write any code:
- Would you take this as a PR?
- Preferred home and shape — a general
cInfNorm_mul_le_of_lt in
Ring/Norms.lean (possibly backend-generic via cInfNormOf/l1NormOf),
or specialized lemmas next to their use sites in MLDSA/?
- Is anyone already working on this among the current in-progress items?
Happy to coordinate or stand down if so.
- Any constraints beyond
AGENTS.md, the v4.30.0 pin, and CI we should
know about?
Disclosure: this development is human-directed and AI-assisted, with every
result kernel-checked and axiom-audited — we've read the workflow section of
the VCVio paper and aim to meet the same review bar as any other
contribution.
Several ML-DSA lemmas in
LatticeCryptocurrently carry the challenge–secretproduct bound as a hypothesis rather than a theorem, e.g. the
h_s_bound-style binders inMLDSA/Signature.lean(also here and
here):
We have a complete, sorry-free Lean 4 / Mathlib development of exactly this
fact and would like to contribute it. In your vocabulary (canonical vector
backend over
ZMod q), the general lemma is:Two points worth making explicit:
The size condition is essential, not an artifact. Over centered
representatives the unconditional
cInfNorm (c * s) ≤ l1Norm c * cInfNorm sis false — the centered lift of a product can wrap mod q. The
2·(l1Norm c · cInfNorm s) < qguard is exactly the no-wraparoundcondition; for the FIPS 204 parameter sets it holds with 4 orders of
magnitude to spare (
2τη= 156 / 392 / 240 againstq= 8380417). Webelieve this is precisely why the fact sits as a hypothesis today — it is
a real theorem, not a one-liner.
The port looks direct. Since
negacyclicMulPure_coeffmakes your product coefficient definitionally a
negacyclicConvCoeff, theproof reduces to (i) an integer-side bound on the negacyclic convolution
(
‖c·s‖∞ ≤ ‖c‖₁·‖s‖∞, which we have, sharp — the bound is attained), and(ii) the centered-lift/no-wrap argument through
zmodCenteredCoeffView—the same uniqueness-of-small-representative fact we proved for
ℤ_q[X]/(X^n+1), which needs only1 < q(monicity ofX^n + 1; noprimality or field structure).
What we hold today, verified with
#print axioms=[propext, Classical.choice, Quot.sound]throughout, on Lean 4.22.0 + Mathlib v4.22.0(we would of course port to your v4.30.0 pin and house idioms per
AGENTS.md): the sharp product bound with an attainment witness; the∃!-small-representative theorem mod q for any q > 1; and the
y + c·sno-wraparound corollary underpinning the
‖z‖∞ < γ₁ − βcheck (itguarantees the centered mod-q representative of z is the faithful integer
value the check inspects), instantiated at all three FIPS 204 parameter
sets. The proof files, an axiom-audit transcript, and build instructions are
in this gist:
https://gist.github.com/jasonsoroko/79dab7c29a148f1766b2721aace8b4c1
(Full repository public with our forthcoming preprint.)
A natural follow-up we could include:
l1Norm (sampleInBall x) ≤ τappearsnot to exist yet either — with it, the
h_s_boundbinders dischargeentirely; without it, they at least reduce to the more primitive sampler
sparsity spec.
Questions before we write any code:
cInfNorm_mul_le_of_ltinRing/Norms.lean(possibly backend-generic viacInfNormOf/l1NormOf),or specialized lemmas next to their use sites in
MLDSA/?Happy to coordinate or stand down if so.
AGENTS.md, the v4.30.0 pin, and CI we shouldknow about?
Disclosure: this development is human-directed and AI-assisted, with every
result kernel-checked and axiom-audited — we've read the workflow section of
the VCVio paper and aim to meet the same review bar as any other
contribution.