Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Uniform valid symbols on the pivot registers equal a sum over pivot words

Proved
OPI.SymEnc.pivRes_sum

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

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Let the word register RRR consist of mmm symbol registers R1,…,RmR_1,\dots,R_mR1​,…,Rm​ of LLL qubits each, with pairwise distinct wires. Let piv:{1..kD}→{1..m}\mathrm{piv}:\{1..k_D\}\to\{1..m\}piv:{1..kD​}→{1..m} be injective. A bit pattern vvv of length LLL is valid if each of its deg⁡f\deg fdegf blocks encodes a number <p<p<p, i.e. v=enc(y)v=\mathrm{enc}(y)v=enc(y) for some field element yyy. For a∈FkDa\in\mathbb F^{k_D}a∈FkD​ let vPiv(a)∈Fm\mathrm{vPiv}(a)\in\mathbb F^mvPiv(a)∈Fm be the word with aja_jaj​ at coordinate piv(j)\mathrm{piv}(j)piv(j) and 000 elsewhere, and ∣vPiv(a)⟩R|\mathrm{vPiv}(a)\rangle_R∣vPiv(a)⟩R​ its encoding on RRR.

Let c0∈Cc_0\in\mathbb Cc0​∈C, and let G0G_0G0​ be a vector on the whole system that vanishes unless all of RRR is 000.

Statement. Placing the factor v↦c0[v valid]v\mapsto c_0[v\text{ valid}]v↦c0​[v valid] on each pivot register Rpiv(j)R_{\mathrm{piv}(j)}Rpiv(j)​ of G0G_0G0​ gives

(⨂j(c0[ ⋅ valid])Rpiv(j)) G0  =  ∑a∈FkDc0 kD  ∣vPiv(a)⟩R⊗G0∣R=0.\Bigl(\textstyle\bigotimes_{j}\bigl(c_0[\,\cdot\text{ valid}]\bigr)_{R_{\mathrm{piv}(j)}}\Bigr)\,G_0\;=\;\sum_{a\in\mathbb F^{k_D}}c_0^{\,k_D}\;|\mathrm{vPiv}(a)\rangle_R\otimes G_0|_{R=0}.(⨂j​(c0​[⋅ valid])Rpiv(j)​​)G0​=∑a∈FkD​​c0kD​​∣vPiv(a)⟩R​⊗G0​∣R=0​.

The repeat-until-success stage on the pivot registers thus prepares the uniform superposition over all words supported on the pivot coordinates. The reversible linear map R↦RGR\mapsto RGR↦RG, with GGG an RREF basis of DDD, then sends it to the uniform superposition over DDD without an extra coefficient register.

Preamble
import Definitions.Def_TwoFoldOPI_CL_Part02
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.SymEnc
open QAlgorithms
variable {N : ℕ}
open TwoFoldOPI
variable {F : AvgCaseTI.FieldPres} {n m kd : ℕ}
set_option hygiene false in
local notation "L" => bitsPerSymbol F
variable (Rr : Fin m → (Fin L ↪ Fin n)) (hRd : ∀ i i' j j', Rr i j = Rr i' j' → i = i' ∧ j = j')
  (piv : Fin kd → Fin m) (hpivi : Function.Injective piv)
open Classical
include hRd hpivi
Formal statement
theorem OPI.SymEnc.pivRes_sum (c0 : ℂ) (G0 : Qubits n → ℂ)
    (hG0 : ∀ z, G0 z ≠ 0 → z ∘ wRof (F := F) Rr hRd = fun _ => false) :
    bfacL (pivRes Rr piv (fun v => if Fq.Valid F v then c0 else 0)) G0 =
      ∑ a : Fin kd → F.F, c0 ^ kd • bfac (wRof (F := F) Rr hRd)
        (fun y => if y = encW F m (vPiv piv a) then 1 else 0) G0 := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/db81d0d4e3fa008609ed37789a2eb2f6f08ee48d/WorkInProgress/QuantumOPIVariants/OPI/PrepState.lean#L136-L244

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