Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Multiplication of polynomials over Fp\mathbb{F}_pFp​ on coefficient lists has a polynomial realizer

Proved
OPI.W6.IsPR.mulL_pr

by sragavan · Nov 11, 2026 · Mathlib 0df444a (Lean v4.33.1)

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Polynomials over Fp\mathbb{F}_pFp​ are represented by lists of natural numbers, constant coefficient first. addLp(a,b)\mathrm{addL}_p(a, b)addLp​(a,b) adds two lists coefficientwise modulo ppp (keeping the tail of the longer one), and scaleLp(c,l)\mathrm{scaleL}_p(c, l)scaleLp​(c,l) multiplies every entry by ccc modulo ppp. The product is computed by Horner's scheme:

mulLp(a,b)=foldr((ai,acc)↦addLp(scaleLp(ai,b), 0::acc)) [ ] a,\mathrm{mulL}_p(a, b) = \mathrm{foldr}\big((a_i, \mathrm{acc}) \mapsto \mathrm{addL}_p(\mathrm{scaleL}_p(a_i, b),\ 0 :: \mathrm{acc})\big)\ [\,]\ a,mulLp​(a,b)=foldr((ai​,acc)↦addLp​(scaleLp​(ai​,b), 0::acc)) [] a,

which represents the product of the two polynomials.

IsPR(h)\mathrm{IsPR}(h)IsPR(h) means that hhh has a polynomial realizer: a program of the underlying machine model whose running charge and output size are bounded by a monotone polynomial in the input size (natural numbers coded in unary).

Statement. The map (p,a,b)↦mulLp(a,b)(p, a, b) \mapsto \mathrm{mulL}_p(a, b)(p,a,b)↦mulLp​(a,b) has a polynomial realizer.

Followed by reduction modulo fff, this realizes multiplication in F=Fp[x]/(f)F = \mathbb{F}_p[x]/(f)F=Fp​[x]/(f) on coordinates, used by the generator for all of its field computations.

Preamble
import Definitions.Def_TwoFoldOPI_CL_Part03
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Circuit
import Definitions.Def_QAlgorithms_Defs_GradientMethods
import Definitions.Def_QAlgorithms_Defs_OPIOraclePrograms
import Definitions.Def_QAlgorithms_Defs_OPIUniformity
import Definitions.Def_QAlgorithms_Defs_Fourier
import Definitions.Def_TwoFoldOPI_elemBits
import Definitions.Def_TwoFoldOPI_schurSquare
import Definitions.Def_TwoFoldOPI_schurFailureSum
import Definitions.Def_CodingTheory
import Definitions.Def_OAIThreeMachineSched01
import Definitions.Def_CookLevin_Cost
import Definitions.Def_TwoFoldOPI_codeOf
import Definitions.Def_TwoFoldOPI_solves
import Definitions.Def_TwoFoldOPI_Input
import Definitions.Def_TwoFoldOPI_CLSerializableF
open OPI.W6.IsPR
open OAI.ThreeMachine.StackCompiler OPI.FM
variable {α : Type} [Coding α]
Formal statement
theorem OPI.W6.IsPR.mulL_pr : IsPR (fun x : ℕ × List ℕ × List ℕ => mulL x.1 x.2.1 x.2.2) := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/f7224a159e790347c1a83c5ac23c63e5094a6a2c/WorkInProgress/QuantumOPIVariants/OPI/PRField.lean#L164-L183

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