Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§V tic-tac-toe: D4-invariant nine-qubit prediction model

Open
QAlgorithms.Papers.Independent.Extend50.P01.tic_tac_toe_construction

by Gohan · Oct 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Number the perimeter sites 0,…,70,\ldots,70,…,7 with even corners and odd edges, and center 888. A quarter turn and the vertical reflection (02)(73)(64)(02)(73)(64)(02)(73)(64) generate the eight-element board group D4D_4D4​, represented by the wire permutations. Encode board data gi∈{−1,0,1}g_i\in\{-1,0,1\}gi​∈{−1,0,1} by ⨂iRX(2πgi/3)\bigotimes_iR_X(2\pi g_i/3)⨂i​RX​(2πgi​/3) and initialize ∣09⟩|0^9\rangle∣09⟩. In each complete trainable block use shared corner/edge/center one-qubit unitaries, followed by complete commuting controlled-RYR_YRY​ layers corner-to-neighboring-edge, edge-to-center and center-to-corner. Their parameters and the number of re-uploading layers are arbitrary. Define O∘=(Z0+Z2+Z4+Z6)/4O_\circ=(Z_0+Z_2+Z_4+Z_6)/4O∘​=(Z0​+Z2​+Z4​+Z6​)/4, O−=Z8O_-=Z_8O−​=Z8​, and O×=(Z1+Z3+Z5+Z7)/4O_\times=(Z_1+Z_3+Z_5+Z_7)/4O×​=(Z1​+Z3​+Z5​+Z7​)/4. The blocks commute with the represented group, the input and observables are invariant, and

y^(σg)=y^(g)(σ∈D4),y^=(⟨O∘⟩,⟨O−⟩,⟨O×⟩).\widehat y(\sigma g)=\widehat y(g)\quad(\sigma\in D_4),\qquad\widehat y=(\langle O_\circ\rangle,\langle O_-\rangle,\langle O_\times\rangle).y​(σg)=y​(g)(σ∈D4​),y​=(⟨O∘​⟩,⟨O−​⟩,⟨O×​⟩).

The entire prediction vector is invariant, so no tie-breaking convention is required. The single-qubit factor in every complete block is RY(theta[c,1]) RX(theta[c,0]) for the vertex class c, with two real angles per class shared on all its sites, exactly as in Figure 3. The nine real angles of a board block consist of these six angles and three controlled-Y orbit angles; a vehicle block has these six angles and four controlled-Z orbit angles.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P01
Formal statement
noncomputable section

open scoped Matrix Kronecker ComplexConjugate Matrix.Norms.L2Operator Manifold ContDiff

open MeasureTheory

namespace QAlgorithms.Papers.Independent.Extend50.P01

attribute [local instance] Classical.propDecidable Classical.decEq

-- PDF pp.3,8: reuse the accepted operator type, exp(-itH), and A X A†.
-- Notation specializes the imported interfaces without introducing duplicate declarations.

local notation "Op" => (fun n : ℕ => QAlgorithms.Papers.Independent.Information100.P21.Op (Qubits n))

local notation "evolve" => QAlgorithms.Papers.Independent.Information100.P32.evolution

local notation "conjugate" => QAlgorithms.conjSuperop

-- PDF pp.3,10–11: the imported quadratic form is Re(psi† A psi).

local notation "expectation" => QAlgorithms.Papers.Independent.Information100.P21.quad

-- PDF pp.5,16–19: accepted active-wire operator, with identities on all spectators.

local notation "onWire" => QAlgorithms.Papers.Independent.Advance50.P49.onWire

-- PDF p.5: the imported phase-free Pauli tensor uses 0=I,1=X,2=Y,3=Z.

local notation "pauliWord" => QAlgorithms.Papers.Independent.Gap48.P33.pauliWord

/-- PDF pp.11–13, Fig.3 and Eqs.(88)–(90): the constructed nine-qubit D4-invariant predictor.
Orbit rotations are complete commuting layers; arbitrary overlapping sequential layouts are excluded. -/
theorem tic_tac_toe_construction
    (W : List (List ((Fin 3 → Fin 2 → ℝ) × (Fin 3 → ℝ)))) :
    boardGroup.carrier.ncard = 8 ∧
    (∀ s ∈ boardGroup, ∀ t ∈ boardGroup, wireMatrix (s * t) = wireMatrix s * wireMatrix t) ∧
    (∀ s ∈ boardGroup, wireMatrix s ∈ Matrix.unitaryGroup (Qubits 9) ℂ ∧
      act (wireMatrix s) (zeroKet 9) = zeroKet 9 ∧
      (∀ p, Commute (boardLayer p) (wireMatrix s)) ∧
      (∀ a, conjugate (wireMatrix s) (boardObservable a) = boardObservable a)) ∧
    (∀ x : Fin 9 → ℝ, (∀ i, x i ∈ ({-1,0,1} : Set ℝ)) → ∀ s ∈ boardGroup,
      boardPrediction W (featurePullback s x) = boardPrediction W x) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P01

end
Source
Exploiting symmetry in variational quantum machine learning, arXiv:2205.06217v1, PDF p. 11, §V tic-tac-toe: D4-invariant nine-qubit prediction model
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every finite list WWW of finite lists of real parameter pairs (α,θ)(\alpha,\theta)(α,θ), where α:{0,1,2}×{0,1}→R\alpha:\{0,1,2\}\times\{0,1\}\to\mathbb Rα:{0,1,2}×{0,1}→R and θ:{0,1,2}→R\theta:\{0,1,2\}\to\mathbb Rθ:{0,1,2}→R, the following assertions hold. Let GGG be the subgroup of permutations of {0,…,8}\{0,\ldots,8\}{0,…,8} generated by

r=(0 2 4 6)(1 3 5 7),f=(0 2)(7 3)(6 4),r=(0\,2\,4\,6)(1\,3\,5\,7),\qquad f=(0\,2)(7\,3)(6\,4),r=(0246)(1357),f=(02)(73)(64),

with unlisted sites fixed. For s∈Gs\in Gs∈G, let PsP_sPs​ have entries (Ps)y,z=1yi=zs−1(i) ∀i(P_s)_{y,z}=\mathbf1_{y_i=z_{s^{-1}(i)}\ \forall i}(Ps​)y,z​=1yi​=zs−1(i)​ ∀i​. Let X,Y,ZX,Y,ZX,Y,Z be the Pauli matrices, P1=diag⁡(0,1)P_1=\operatorname{diag}(0,1)P1​=diag(0,1), and AiA_iAi​ mean AAA on wire iii and identities elsewhere. Define D={(8,0),(8,2),(8,4),(8,6)}D=\{(8,0),(8,2),(8,4),(8,6)\}D={(8,0),(8,2),(8,4),(8,6)}, I={(1,8),(3,8),(5,8),(7,8)}I=\{(1,8),(3,8),(5,8),(7,8)\}I={(1,8),(3,8),(5,8),(7,8)}, C={(0,1),(2,3),(4,5),(6,7)}C=\{(0,1),(2,3),(4,5),(6,7)\}C={(0,1),(2,3),(4,5),(6,7)}, A={(0,7),(2,1),(4,3),(6,5)}A=\{(0,7),(2,1),(4,3),(6,5)\}A={(0,7),(2,1),(4,3),(6,5)}, and KY(F)=∑(i,j)∈F(P1)iYjK_Y(F)=\sum_{(i,j)\in F}(P_1)_iY_jKY​(F)=∑(i,j)∈F​(P1​)i​Yj​. Give wire 888 class 000, even wires below 888 class 111, and odd wires class 222, denoting the class by c(i)c(i)c(i). Put

L(α,θ)=e−iθ(2)KY(D)/2e−iθ(1)KY(I)/2e−iθ(0)KY(C∪A)/2⨂i(e−iα(c(i),1)Y/2e−iα(c(i),0)X/2).L(\alpha,\theta)=e^{-i\theta(2)K_Y(D)/2}e^{-i\theta(1)K_Y(I)/2} e^{-i\theta(0)K_Y(C\cup A)/2} \bigotimes_i\left(e^{-i\alpha(c(i),1)Y/2}e^{-i\alpha(c(i),0)X/2}\right).L(α,θ)=e−iθ(2)KY​(D)/2e−iθ(1)KY​(I)/2e−iθ(0)KY​(C∪A)/2i⨂​(e−iα(c(i),1)Y/2e−iα(c(i),0)X/2).

Let O0=(Z0+Z2+Z4+Z6)/4O_0=(Z_0+Z_2+Z_4+Z_6)/4O0​=(Z0​+Z2​+Z4​+Z6​)/4, O1=Z8O_1=Z_8O1​=Z8​, O2=(Z1+Z3+Z5+Z7)/4O_2=(Z_1+Z_3+Z_5+Z_7)/4O2​=(Z1​+Z3​+Z5​+Z7​)/4, and E(x)=⨂ie−iπxiX/3E(x)=\bigotimes_i e^{-i\pi x_iX/3}E(x)=⨂i​e−iπxi​X/3. For each block b=(pb,1,…,pb,mb)b=(p_{b,1},\ldots,p_{b,m_b})b=(pb,1​,…,pb,mb​​) of WWW, form Fb=L(pb,mb)⋯L(pb,1)E(x)F_b=L(p_{b,m_b})\cdots L(p_{b,1})E(x)Fb​=L(pb,mb​​)⋯L(pb,1​)E(x), and set QW(x)=Fr⋯F1Q_W(x)=F_r\cdots F_1QW​(x)=Fr​⋯F1​ over its rrr blocks. Empty products are identities. Define bW(x)a=expectation⁡(Oa,QW(x)∣09⟩)b_W(x)_a=\operatorname{expectation}(O_a,Q_W(x)|0^9\rangle)bW​(x)a​=expectation(Oa​,QW​(x)∣09⟩); the defining formula for expectation is absent from the supplied code. Then GGG has exactly eight elements; Pst=PsPtP_{st}=P_sP_tPst​=Ps​Pt​ for every s,t∈Gs,t\in Gs,t∈G; and every PsP_sPs​ is unitary, fixes ∣09⟩|0^9\rangle∣09⟩, commutes with L(p)L(p)L(p) for every parameter pair ppp, and satisfies C(Ps,Oa)=Oa\mathcal C(P_s,O_a)=O_aC(Ps​,Oa​)=Oa​ for every aaa, where C\mathcal CC denotes the matrix operation named conjugate, whose definition is also absent from the supplied code. Finally, for every feature vector xxx with each coordinate in {−1,0,1}\{-1,0,1\}{−1,0,1}, and every s∈Gs\in Gs∈G,

bW(x∘s−1)=bW(x).b_W(x\circ s^{-1})=b_W(x).bW​(x∘s−1)=bW​(x).

The last equality is equality of all three output coordinates, and the statement includes empty outer and inner lists WWW.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

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