The trial circuit as an explicit list of natural-number gate fields
ProvedOPI.Lay.trialCirc_NLet with and bits per field symbol, let and describe the code (row space of if , kernel of otherwise), and let . Let be the computed basis of (with rows) and the pairwise Schur products of its rows. For parameters , , a fixed wire layout (with system wires and its natural-number description ) and a target , the trial circuit over is
where is the full decoder circuit (per-coordinate gadgets using the table of , two gadgets per coordinate, then the compiled classical relinearization decoder with constants , ), and subtracts each decoder output register from the corresponding register . Gates are written as lists of naturals (: , : , : CNOT).
Statement. For every and , the gate-field list of equals
where inverts a gate field (, and CNOT unchanged), is the explicit decoder gate list built from the shared data, the controlled-swap tables, the coordinate data for , and the first-order classical decoder , and is the explicit subtraction gate list with output registers , target registers , layout blocks and the tables of .
All wire indices and the decoder program are now natural-number data computed from ; only some lookup tables are still given by functions on (they are replaced by budgeted twins in a later step). This connects the abstract trial circuit to the gate list output by the generator.
import Definitions.Def_TwoFoldOPI_CL_Part04
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.Lay
open QAlgorithms QAlgorithms.OPI TwoFoldOPI SymEnc
local notation "vl" => List.map Fin.val
variable (F : AvgCaseTI.FieldPres) (m t b' : ℕ) {r : ℕ} (gen : Bool) (H : Matrix (Fin r) (Fin m) F.F)
local notation "KD" => kdOf F m gen H
local notation "nJ" => SymEnc.nIds m (kdOf F m gen H) (kdOf F m gen H * kdOf F m gen H)
local notation "PQ" => parOf F m t (b' + 1) (SymEnc.nIds m (kdOf F m gen H) (kdOf F m gen H * kdOf F m gen H))
local notation "XQ" => toN (parOf F m t (b' + 1) (SymEnc.nIds m (kdOf F m gen H) (kdOf F m gen H * kdOf F m gen H)))
local notation "NN" => total (parOf F m t (b' + 1) (SymEnc.nIds m (kdOf F m gen H) (kdOf F m gen H * kdOf F m gen H)))
local notation "BB" => GEP.Bd m (kdOf F m gen H + kdOf F m gen H * kdOf F m gen H)
variable (ht : 1 ≤ t) (htb : t ≤ b' + 1)
set_option maxHeartbeats 1000000
theorem OPI.Lay.trialCirc_N (Nf : ℕ) (hNf : F.p ^ F.f.natDegree ≤ Nf) (β : Fin m → F.F) :
(trialCirc F m t b' gen H ht htb β).map gfields =
trialCN
(decCircN (shOf F NN (b' + 1) t)
(pgTab (1 + (bitsPerSymbol F + bitsPerSymbol F)) 1 (cswF (bitsPerSymbol F)))
(pgTab (1 + 2 * bitsPerSymbol F) 1 (cswF (bitsPerSymbol F)))
((List.range m).map (fun i => cDataN XQ
(pgTab (bitsPerSymbol F) 0 (pFun (elemBits F) (fun x => (if h : i < m then β ⟨i, h⟩ else 0) - x))) i))
(clsCN (RSN XQ m BB nJ) (blkN XQ 27) (offN XQ 28)
(FM.clsTabs (FM.ctxOf F Nf) (Fq.w F) (bitsPerSymbol F)
(FM.progI m (KD + KD * KD) KD (fun j o => FM.matI F.f.natDegree KD m (FM.matE F (basisOf gen H).G) j o)
(RelinProg.a0src m KD (KD * KD))
(FM.a0opI F.f.natDegree KD (KD * KD) m (FM.matE F (basisOf gen H).G) (FM.matE F (bWof gen H)))))))
(subAllCN ((List.range m).map (fun i => rsOfN XQ m BB nJ (RelinProg.outId (m := m) (k := KD) (k2 := KD * KD) i)))
((List.range m).map (RrN XQ)) (blkN XQ 12) (blkN XQ 13) (offN XQ 14)
(pgTab (bitsPerSymbol F + bitsPerSymbol F) (bitsPerSymbol F) (fShift F (-1)))
(pgTab (bitsPerSymbol F + bitsPerSymbol F) (bitsPerSymbol F) (fShift F 1))) := by sorry