Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Blockwise QFTp\mathrm{QFT}_pQFTp​ after trace-dual re-encoding equals QFTq\mathrm{QFT}_qQFTq​

Proved
OPI.Fq.prod_qftP

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

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Let K=Fp[X]/(f)K=\mathbb F_p[X]/(f)K=Fp​[X]/(f) with e=deg⁡fe=\deg fe=degf and q=peq=p^eq=pe, and let w=⌈log⁡2p⌉w=\lceil\log_2 p\rceilw=⌈log2​p⌉. A field element xxx is encoded on e⋅we\cdot we⋅w qubits by enc(x)\mathrm{enc}(x)enc(x): block jjj (0≤j<e0\le j<e0≤j<e) holds, in binary, the jjj-th coordinate of xxx in the power basis 1,X,…,Xe−11,X,\dots,X^{e-1}1,X,…,Xe−1. Let tr=TrK/Fp\mathrm{tr}=\mathrm{Tr}_{K/\mathbb F_p}tr=TrK/Fp​​ and let ψ(a)=e2πi tr(a)/p\psi(a)=e^{2\pi i\,\mathrm{tr}(a)/p}ψ(a)=e2πitr(a)/p be the canonical additive character. Two matrices enter:

  • QFTp[a,y]=ωpay/p\mathrm{QFT}_p[a,y]=\omega_p^{ay}/\sqrt pQFTp​[a,y]=ωpay​/p​ for www-bit strings with values a,y<pa,y<pa,y<p, and 000 otherwise;
  • Qq[z,z′]=ψ(dec(z) dec(z′))/qQ_q[z,z']=\psi(\mathrm{dec}(z)\,\mathrm{dec}(z'))/\sqrt qQq​[z,z′]=ψ(dec(z)dec(z′))/q​ if both symbols are valid (every block <p<p<p), and 000 otherwise.

Statement. For every bit string zzz of length ewewew, with blocks z0,…,ze−1z_0,\dots,z_{e-1}z0​,…,ze−1​, and every x∈Kx\in Kx∈K,

∏j=0e−1QFTp[zj, binw(tr(xXj))]=Qq[z, enc(x)].\prod_{j=0}^{e-1}\mathrm{QFT}_p\big[z_j,\ \mathrm{bin}_w(\mathrm{tr}(x X^j))\big]=Q_q\big[z,\ \mathrm{enc}(x)\big].j=0∏e−1​QFTp​[zj​, binw​(tr(xXj))]=Qq​[z, enc(x)].

In words: if the input symbol is first re-encoded from power-basis coordinates to its trace-dual coordinates (tr(xXj))j(\mathrm{tr}(xX^j))_j(tr(xXj))j​, then applying QFTp\mathrm{QFT}_pQFTp​ to each block yields exactly the QFT over Fq\mathbb F_qFq​ in the power-basis encoding. This is how the QFTq\mathrm{QFT}_qQFTq​ gadget is built from eee QFTp\mathrm{QFT}_pQFTp​ gadgets and one reversible re-encoding.

Preamble
import Definitions.Def_TwoFoldOPI_CL_Part01
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 OPI.Fq
open QAlgorithms TwoFoldOPI Matrix
variable (F : AvgCaseTI.FieldPres)
Formal statement
theorem OPI.Fq.prod_qftP (z : Qubits (bitsPerSymbol F)) (x : F.F) :
    ∏ j, qftP F.p (w F) (z ∘ blk F j) (natToBits (w F) (sco F x j).val) =
      Qq F z (elemBits F x) := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/db81d0d4e3fa008609ed37789a2eb2f6f08ee48d/WorkInProgress/QuantumOPIVariants/OPI/QFTq.lean#L229-L279

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