Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Scalar-twisted semigroup of relations

Open
QAlgorithms.Papers.Independent.Extend50.P30.relationSemigroup

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

prove2quantum

Let ddd be prime and t≥1t\geq1t≥1. Relational composition of stochastic Lagrangians is again a stochastic Lagrangian, is associative, and has the diagonal relation as identity. For arbitrary T1,T2T_1,T_2T1​,T2​, set K=(T1)RD∩(T2)LDK=(T_1)_{RD}\cap(T_2)_{LD}K=(T1​)RD​∩(T2​)LD​, the space of differences between intermediate solutions. Its cardinality gives the scalar in the physical tensor multiplication law.

R(T1)R(T2)=∣K∣nR(T1∘T2)=dndim⁡KR(T1∘T2).R(T_1)R(T_2)=|K|^nR(T_1\circ T_2)=d^{n\dim K}R(T_1\circ T_2).R(T1​)R(T2​)=∣K∣nR(T1​∘T2​)=dndimKR(T1​∘T2​).

This gives the source's scalar-twisted semigroup of relations in the fixed computational-basis and phase conventions.

Formalization Note Pure states carry norm one; stabilizer averages use density matrices to discard global phases. All finite tensor indices are explicitly ordered by copy, then physical qudit.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P30
Formal statement
noncomputable section

open scoped BigOperators ComplexConjugate Matrix

namespace QAlgorithms.Papers.Independent.Extend50.P30

open QAlgorithms.Papers.Independent.Information100.P63 (tensorPower)

open QAlgorithms.Papers.Independent.Gap20.P06 (ketBra)

attribute [local instance] Classical.propDecidable

/-- PDF pp.40--41: associative relational semigroup with its scalar-twisted multiplication.
For general relations the fiber is rightDefect(T1) intersect leftDefect(T2). -/
theorem relationSemigroup (d t : ℕ) [NeZero d] [Fact (Nat.Prime d)] (ht : 1 ≤ t) :
    (∀ A B : Lagrangian d t, IsStochasticLagrangian (composeRelation A.val B.val) ∧
      ((↑(composeRelation A.val B.val) : Set (ResidueRegister d t × ResidueRegister d t)) = {z | ∃ y, (z.1, y) ∈ A.val ∧ (y, z.2) ∈ B.val})) ∧
    (∀ A B C : Lagrangian d t,
      composeRelation (composeRelation A.val B.val) C.val = composeRelation A.val (composeRelation B.val C.val)) ∧
    (∀ A : Lagrangian d t,
      composeRelation (graphRelation (1 : Matrix (Fin t) (Fin t) (ZMod d))) A.val = A.val ∧
      composeRelation A.val (graphRelation (1 : Matrix (Fin t) (Fin t) (ZMod d))) = A.val) ∧
    (∀ n : ℕ, ∀ A B : Lagrangian d t,
      tensorRelation n A.val * tensorRelation n B.val =
        ((Nat.card ↥(rightDefect A.val ⊓ leftDefect B.val) : ℂ) ^ n) •
          tensorRelation n (composeRelation A.val B.val) ∧
      tensorRelation n A.val * tensorRelation n B.val =
        ((d : ℂ) ^ (n * Module.finrank (ZMod d) ↥(rightDefect A.val ⊓ leftDefect B.val))) •
          tensorRelation n (composeRelation A.val B.val)) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P30

end
Source
Schur-Weyl Duality for the Clifford Group with Applications: Property Testing, a Robust Hudson Theorem, and de Finetti Representations, arXiv:1712.08628v3, PDF p. 40, semigroup
Read-back

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

For every nonzero prime natural number ddd and natural number t≥1t\ge1t≥1, put V=(Z/dZ)tV=(\mathbb Z/d\mathbb Z)^tV=(Z/dZ)t and define q(x)=∑jxj~ 2q(x)=\sum_j\widetilde{x_j}^{\,2}q(x)=∑j​xj​​2 modulo 2d2d2d for even ddd and modulo ddd otherwise. Let L\mathcal LL consist of subspaces T⊆V×VT\subseteq V\times VT⊆V×V having dtd^tdt elements, containing (1,1)(\mathbf1,\mathbf1)(1,1), and satisfying q(x)=q(y)q(x)=q(y)q(x)=q(y) on TTT. Define A∘BA\circ BA∘B as the linear span of {(x,z):∃y, (x,y)∈A, (y,z)∈B}\{(x,z):\exists y,\ (x,y)\in A,\ (y,z)\in B\}{(x,z):∃y, (x,y)∈A, (y,z)∈B}, and write LA={x:(x,0)∈A}L_A=\{x:(x,0)\in A\}LA​={x:(x,0)∈A} and RA={y:(0,y)∈A}R_A=\{y:(0,y)\in A\}RA​={y:(0,y)∈A}. For all A,B∈LA,B\in\mathcal LA,B∈L, A∘BA\circ BA∘B belongs to L\mathcal LL, and its underlying set is exactly the set whose linear span defines it. For all A,B,C∈LA,B,C\in\mathcal LA,B,C∈L, (A∘B)∘C=A∘(B∘C)(A\circ B)\circ C=A\circ(B\circ C)(A∘B)∘C=A∘(B∘C), and the diagonal relation Δ={(x,x):x∈V}\Delta=\{(x,x):x\in V\}Δ={(x,x):x∈V} satisfies Δ∘A=A=A∘Δ\Delta\circ A=A=A\circ\DeltaΔ∘A=A=A∘Δ. For a relation SSS, define the complex matrix Rn(S)\mathcal R_n(S)Rn​(S), indexed by u,v:{0,…,t−1}→(Z/dZ)nu,v:\{0,\ldots,t-1\}\to(\mathbb Z/d\mathbb Z)^nu,v:{0,…,t−1}→(Z/dZ)n, by Rn(S)(u,v)=∏j=0n−11S((ui(j))i,(vi(j))i)\mathcal R_n(S)(u,v)=\prod_{j=0}^{n-1}\mathbf1_S((u_i(j))_i,(v_i(j))_i)Rn​(S)(u,v)=∏j=0n−1​1S​((ui​(j))i​,(vi​(j))i​). Then, for every natural number nnn and every A,B∈LA,B\in\mathcal LA,B∈L,

Rn(A)Rn(B)=∣RA∩LB∣nRn(A∘B)=d ndim⁡(RA∩LB)Rn(A∘B).\mathcal R_n(A)\mathcal R_n(B) =|R_A\cap L_B|^n\mathcal R_n(A\circ B) =d^{\,n\dim(R_A\cap L_B)}\mathcal R_n(A\circ B).Rn​(A)Rn​(B)=∣RA​∩LB​∣nRn​(A∘B)=dndim(RA​∩LB​)Rn​(A∘B).

The case n=0n=0n=0 is included: the indexing set is a singleton, the entry product is 111, and both scalar factors are 111.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 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