Computable noun fingerprint #
NPR.fn (Nock/NPR.lean, def:ion_univariate, main.tex:1180–1184) evaluates the noun
polynomials with Mathlib's Polynomial, which is noncomputable. This module gives the
extractable Horner evaluation fnHorner and proves it equals NPR.fn
(fnHorner_eq_fn), so the collision-soundness bounds of Nock/NPR.lean apply to the code that
actually runs. Instantiated at a concrete prime field ZMod q (with [Fact (Nat.Prime q)]
supplied by the caller — never as an axiom), fnHorner compiles and evaluates.
Horner evaluation of a coefficient list: hornerEval r [a₀,…,aₙ] = a₀ + r·(a₁ + r·(…)),
i.e. Σᵢ aᵢ rⁱ. Computable (no Polynomial); the extractable core of the fingerprint.
Equations
- Nock.NPR.hornerEval r [] = 0
- Nock.NPR.hornerEval r (a :: l) = a + r * Nock.NPR.hornerEval r l
Instances For
Horner = polynomial evaluation. hornerEval r l = (listPoly l).eval r: the computable
Horner scheme agrees with evaluating the coefficient polynomial Σᵢ lᵢ Xⁱ at r.
The computable fingerprint (def:ion_univariate, main.tex:1180–1184). fnHorner r n = (r^{|dt|}, Σ dtᵢ rⁱ, Σ wᵢ rⁱ) via Horner, with no Polynomial. Equal to NPR.fn
(fnHorner_eq_fn), so it inherits the collision bounds.
Equations
- Nock.NPR.fnHorner r n = (r ^ n.leaves, Nock.NPR.hornerEval r (Nock.NPR.leafF n), Nock.NPR.hornerEval r (Nock.NPR.dyckBits n))
Instances For
fnHorner computes NPR.fn. The extractable Horner fingerprint equals the polynomial
fingerprint fn (main.tex:1180–1184), so lem:ion_univariate_sec /
corr:ion_single_security
(Nock/NPR.lean) transfer verbatim to the running code.