Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Polynomial evaluation tables: column sums, interpolants, moment maps and constraints (Construction A.4)

Definition
LatticePrepro_Tables_Construction

by WizardOfMenlo · Nov 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

coding-theorycvp-ncp-preprocessinghardness-of-approximationlatticespreprocessing

Fix a prime ppp, a field setup with sample field S\mathbb{S}S of size q=∣S∣q=|\mathbb{S}|q=∣S∣ and moment field K=S(γ)K=\mathbb{S}(\gamma)K=S(γ) of degree δ\deltaδ over S\mathbb{S}S, and natural numbers mmm (the number of axes) and BBB (the base). An evaluation table is a vector y∈Fp Sm×Sy\in\mathbb{F}_p^{\,\mathbb{S}^m\times\mathbb{S}}y∈FpSm×S​. The bundle defines the objects of steps 2–5 of Construction A.4.

  1. Coordinates (Coord): pairs (λ,s)∈Sm×S(\lambda,s)\in\mathbb{S}^m\times\mathbb{S}(λ,s)∈Sm×S of a label λ=(λ0,…,λm−1)\lambda=(\lambda_0,\dots,\lambda_{m-1})λ=(λ0​,…,λm−1​) and a column sss. The qqq columns {(λ,s):λ∈Sm}\{(\lambda,s):\lambda\in\mathbb{S}^m\}{(λ,s):λ∈Sm} are the blocks, each of size qmq^mqm.
  2. Weighted column sums (colSum): for an exponent vector η∈Nm\eta\in\mathbb{N}^mη∈Nm and s∈Ss\in\mathbb{S}s∈S,
colSum(y,η,s)=∑λ∈Smy(λ,s) λη∈S,λη=∏h=0m−1λhηh,\mathrm{colSum}(y,\eta,s)=\sum_{\lambda\in\mathbb{S}^m}y_{(\lambda,s)}\,\lambda^{\eta}\in\mathbb{S},\qquad \lambda^{\eta}=\prod_{h=0}^{m-1}\lambda_h^{\eta_h},colSum(y,η,s)=λ∈Sm∑​y(λ,s)​λη∈S,λη=h=0∏m−1​λhηh​​,

where y(λ,s)∈Fpy_{(\lambda,s)}\in\mathbb{F}_py(λ,s)​∈Fp​ acts on S\mathbb{S}S by scalar multiplication. 3. Interpolants (interp): Pηy∈S[X]P^y_\eta\in\mathbb{S}[X]Pηy​∈S[X] is the Lagrange interpolant of s↦colSum(y,η,s)s\mapsto\mathrm{colSum}(y,\eta,s)s↦colSum(y,η,s) on all of S\mathbb{S}S, i.e. the unique polynomial of degree <q<q<q with Pηy(s)=colSum(y,η,s)P^y_\eta(s)=\mathrm{colSum}(y,\eta,s)Pηy​(s)=colSum(y,η,s) for every s∈Ss\in\mathbb{S}s∈S. 4. Moment maps (mom): μ^k(y)=PdigitsB,m(k)y(γ)∈K\hat\mu_k(y)=P^y_{\mathrm{digits}_{B,m}(k)}(\gamma)\in Kμ^​k​(y)=PdigitsB,m​(k)y​(γ)∈K for k∈Nk\in\mathbb{N}k∈N, where digitsB,m\mathrm{digits}_{B,m}digitsB,m​ is the generalized digit vector of Definition A.1. 5. Parameters: the index set I={0,…,2p(B−1)}m\mathcal{I}=\{0,\dots,2p(B-1)\}^mI={0,…,2p(B−1)}m (IdxSet, with IdxSet.toNat reading an index as an exponent vector), the degree bound Δ=2pm(B−1)(δ−1)\Delta=2pm(B-1)(\delta-1)Δ=2pm(B−1)(δ−1) (degBound), and the largest moment order 2p(Bm−1)2p(B^m-1)2p(Bm−1) (maxOrder), which equals 2ℓ−22\ell-22ℓ−2 for the Hankel length ℓ=p(Bm−1)+1\ell=p(B^m-1)+1ℓ=p(Bm−1)+1. 6. Constraints (constraintFun): yyy is sent to a triple in the space ConstrW =SI×{0,…,q−1}×KI×K{0,…,2p(Bm−1)}=\mathbb{S}^{\mathcal{I}\times\{0,\dots,q-1\}}\times K^{\mathcal{I}}\times K^{\{0,\dots,2p(B^m-1)\}}=SI×{0,…,q−1}×KI×K{0,…,2p(Bm−1)} with components

  • low degree: (η,u)↦(\eta,u)\mapsto(η,u)↦ the coefficient of XuX^uXu in PηyP^y_\etaPηy​ if u>Δu>\Deltau>Δ, and 000 otherwise;
  • index consistency: η↦Pηy(γ)−μ^valB(η)(y)\eta\mapsto P^y_\eta(\gamma)-\hat\mu_{\mathrm{val}_B(\eta)}(y)η↦Pηy​(γ)−μ^​valB​(η)​(y);
  • Frobenius: k↦μ^pk(y)−μ^k(y)pk\mapsto\hat\mu_{pk}(y)-\hat\mu_k(y)^pk↦μ^​pk​(y)−μ^​k​(y)p if pk≤2p(Bm−1)pk\le2p(B^m-1)pk≤2p(Bm−1), and 000 otherwise.

The table satisfies the paper's evaluation table constraints T⋅y=0T\cdot y=0T⋅y=0 exactly when constraintFun(y)=0\mathrm{constraintFun}(y)=0constraintFun(y)=0.

These are the evaluation tables, moment maps and constraint system of the explicit moment representation. Together with the element tables of step 6 they form the moment representation of Theorem A.8.

Formalization Note: The constraints are a map into a product of spaces rather than a matrix over Fp\mathbb{F}_pFp​. Expanding each component in fixed Fp\mathbb{F}_pFp​-bases gives the paper's matrix TTT, and the source module shows that constraintFun and mom are Fp\mathbb{F}_pFp​-linear. Low-degree rows are indexed by all u<qu<qu<q (Fin (Fintype.card 𝕊)), and the rows with u≤Δu\le\Deltau≤Δ are 000. mom is defined for every k∈Nk\in\mathbb{N}k∈N, though only orders k≤2p(Bm−1)k\le2p(B^m-1)k≤2p(Bm−1) are used. The definitions take an arbitrary field setup and arbitrary m,Bm,Bm,B; the paper's choices of δ\deltaδ and qqq enter only in Theorem A.8. The paper writes K,E,τ,c,ζ,a,d,Wdeg⁡,ν\mathbb{K},\mathbb{E},\tau,c,\zeta,\mathsf a,\mathsf d,W_{\deg},\nuK,E,τ,c,ζ,a,d,Wdeg​,ν for S,K,q,δ,γ,m,B,Δ,ℓ\mathbb{S},K,q,\delta,\gamma,m,B,\Delta,\ellS,K,q,δ,γ,m,B,Δ,ℓ.

Definition code
import Mathlib
import Definitions.Def_LatticePrepro_Basic_Blocks
import Definitions.Def_LatticePrepro_Moments_Basic
import Definitions.Def_LatticePrepro_Moments_Representation
import Definitions.Def_LatticePrepro_Tables_Digits
import Definitions.Def_LatticePrepro_Tables_FieldSetup

/-!
# Polynomial evaluation tables: the construction (Construction A.4)

Fix a field setup `FS` (sample field `𝕊` of size `q`, moment field `K = 𝕊(γ)` of degree `δ`)
and integers `m ≥ 1`, `B ≥ 2`. An evaluation table is a vector `y : (Fin m → 𝕊) × 𝕊 → 𝔽_p`;
its coordinates `(λ, s)` are partitioned into the `q` columns `s ∈ 𝕊`, each of size `q^m`.

* `colSum y η s = ∑ λ, y (λ, s) • λ^η` is the weighted column sum for the exponent vector `η`.
* `interp y η ∈ 𝕊[X]` is the polynomial of degree `< q` interpolating `s ↦ colSum y η s`.
* `mom y k = (interp y (gdigits B m k)) (γ)` is the `k`-th moment map.
* `constraintFun y` collects the low-degree, index-consistency and Frobenius constraints.

All of these are `𝔽_p`-linear in `y`.
-/

namespace LatticePrepro

open Polynomial

namespace ExplicitTables

variable {p : ℕ} [Fact p.Prime] {d δ : ℕ} (FS : FieldSetup p d δ) (m B : ℕ)

/-- Coordinates of an evaluation table: a label `λ ∈ 𝕊^m` and a column `s ∈ 𝕊`. -/
abbrev Coord : Type := (Fin m → FS.𝕊) × FS.𝕊

/-- The weighted column sum `∑ λ, y (λ, s) • λ^η`. -/
def colSum (y : Coord FS m → ZMod p) (η : Fin m → ℕ) (s : FS.𝕊) : FS.𝕊 :=
  ∑ lam : Fin m → FS.𝕊, y (lam, s) • ∏ h, lam h ^ η h

/-- The interpolating polynomial of the column sums (degree `< q`). -/
noncomputable def interp (y : Coord FS m → ZMod p) (η : Fin m → ℕ) : FS.𝕊[X] :=
  Lagrange.interpolate (Finset.univ : Finset FS.𝕊) id (fun s => colSum FS m y η s)

/-- The `k`-th moment map `M̂_k(y) = P^y_{digits(k)}(γ)`. -/
noncomputable def mom (y : Coord FS m → ZMod p) (k : ℕ) : FS.K :=
  aeval FS.γ (interp FS m y (gdigits B m k))

/-! ### Parameters -/

/-- The exponent index set `I = {0, …, 2p(B-1)}^m`. -/
abbrev IdxSet (p m B : ℕ) : Type := Fin m → Fin (2 * p * (B - 1) + 1)

/-- An index as an exponent vector. -/
def IdxSet.toNat {p m B : ℕ} (η : IdxSet p m B) : Fin m → ℕ := fun h => (η h).val

/-- The degree bound `Δ = 2 p m (B - 1) (δ - 1)`. -/
def degBound (p m B δ : ℕ) : ℕ := 2 * p * m * (B - 1) * (δ - 1)

/-- The largest moment order carried by a table, `2ℓ - 2 = 2 p (B^m - 1)` where
`ℓ = p (B^m - 1) + 1` is the Hankel length. -/
def maxOrder (p m B : ℕ) : ℕ := 2 * p * (B ^ m - 1)

/-- The codomain of the constraint map: low-degree rows, index-consistency rows and
Frobenius rows. -/
abbrev ConstrW : Type :=
  (IdxSet p m B × Fin (Fintype.card FS.𝕊) → FS.𝕊) × (IdxSet p m B → FS.K) ×
    (Fin (maxOrder p m B + 1) → FS.K)

/-- The evaluation table constraints (Construction A.4, step 5), as a function of `y`. -/
noncomputable def constraintFun (y : Coord FS m → ZMod p) : ConstrW FS m B :=
  (fun ηu => if degBound p m B δ < ηu.2.val then (interp FS m y ηu.1.toNat).coeff ηu.2.val else 0,
   fun η => aeval FS.γ (interp FS m y η.toNat) - mom FS m B y (digitVal B η.toNat),
   fun k => if p * k.val ≤ maxOrder p m B then
     mom FS m B y (p * k.val) - (mom FS m B y k.val) ^ p else 0)

/-! ### Unpacking the constraints -/

end ExplicitTables

end LatticePrepro
Source
G. Fenzi, G. Weissenberg, Nearly Optimal Hardness for CVP and NCP with Preprocessing (STOC 2027 submission #847; IACR ePrint 2026/2634, https://eprint.iacr.org/2026/2634), Construction A.4 (\label{con:moment-representation}), steps 2–5; Lean: LatticePrepro/Tables/Construction.lean, LatticePrepro.ExplicitTables.{Coord, colSum, interp, mom, IdxSet, IdxSet.toNat, degBound, maxOrder, ConstrW, constraintFun}

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me