Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Uniqueness and optimality of the canonical form

Open
QAlgorithms.Papers.Independent.Intakenext100.P03.canonical_unique_optimal

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

prove2quantum

Let nnn be a positive even integer. Put ζm=e2πi/m\zeta_m=e^{2\pi i/m}ζm​=e2πi/m, Rn=Z[ζ2n,1/2]R_n=\mathbb Z[\zeta_{2n},1/2]Rn​=Z[ζ2n​,1/2], Uz(θ)=diag⁡(1,eiθ)U_z(\theta)=\operatorname{diag}(1,e^{i\theta})Uz​(θ)=diag(1,eiθ), and Gn=⟨C,Uz(π/n)⟩G_n=\langle C,U_z(\pi/n)\rangleGn​=⟨C,Uz​(π/n)⟩, where C=⟨H0,S⟩C=\langle H_0,S\rangleC=⟨H0​,S⟩, H0=1+i2(111−1)H_0=\frac{1+i}{2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}H0​=21+i​(11​1−1​) and S=diag⁡(1,i)S=\operatorname{diag}(1,i)S=diag(1,i).

For an axis p∈{x,y,z}p\in\{x,y,z\}p∈{x,y,z} with Pauli matrix PPP, write Up(θ)=1+eiθ2I+1−eiθ2PU_p(\theta)=\frac{1+e^{i\theta}}2I+\frac{1-e^{i\theta}}2PUp​(θ)=21+eiθ​I+21−eiθ​P. A canonical pair consists of an ordered finite list (pi,ai)i=1m(p_i,a_i)_{i=1}^m(pi​,ai​)i=1m​ and an actual matrix DDD, with consecutive axes distinct, 1≤ai<n/21\le a_i<n/21≤ai​<n/2, DDD proportional to an element of CCC, and U=(∏i=1mUpi(aiπ/n))DU=(\prod_{i=1}^m U_{p_i}(a_i\pi/n))DU=(∏i=1m​Upi​​(ai​π/n))D. Products have the printed left-to-right order, and the empty list is permitted. Let Tn(U)T_n(U)Tn​(U) be the minimum number of positive elementary Uz(π/n)U_z(\pi/n)Uz​(π/n) occurrences among Clifford/rotation words implementing UUU up to one global phase; Clifford gates have zero cost. Every U∈GnU\in G_nU∈Gn​ has exactly one canonical pair, and every canonical pair satisfies

∑i=1mmin⁡(ai,n/2−ai)=Tn(U).\sum_{i=1}^m\min(a_i,n/2-a_i)=T_n(U).i=1∑m​min(ai​,n/2−ai​)=Tn​(U).

Uniqueness includes the actual residual matrix DDD, not the phase and Clifford witnesses separately. The empty form has cost zero. This identifies canonical cost with optimal synthesis cost.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P03
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P03

open scoped BigOperators Classical

-- Reuse the Mathlib matrix type without declaring a second Mat.

local notation "Mat" => Matrix Bool Bool ℂ

/-- Canonical data: the axis/exponent list and the actual residual matrix D,
not a nonunique phase/Clifford witness pair, PDF pp.6-7. -/
local notation "CanonicalData" => List (Fin 3 × ℕ) × Matrix Bool Bool ℂ

/-- Corollary 4.2, PDF pp.10-11: uniqueness of the entire data pair including
D, and optimality modulo one global phase, including the empty form. -/
theorem canonical_unique_optimal (n : ℕ) (hn : 0 < n) (heven : Even n)
    (U : Mat) (hU : U ∈ cyclotomicGroup n) :
    (∃! d : CanonicalData, IsCyclotomicCanonical n U d) ∧
    ∀ d : CanonicalData, IsCyclotomicCanonical n U d →
      canonicalCost n d = minimumRotationCost n U := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P03

end
Source
Exact synthesis of single-qubit unitaries over Clifford-cyclotomic gate sets, arXiv:1501.04944v2, PDF p. 10, Corollary 4.2
Read-back

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

For every positive even natural number nnn and every complex 2×22\times22×2 matrix UUU in the following submonoid GnG_nGn​, there exists exactly one pair d=(L,C)d=(L,C)d=(L,C) satisfying the canonical conditions below, and every pair satisfying those conditions has the stated cost equality. Put H0=1+i2(111−1)H_0=\frac{1+i}{2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}H0​=21+i​(11​1−1​), S=diag⁡(1,i)S=\operatorname{diag}(1,i)S=diag(1,i), Z(θ)=diag⁡(1,eiθ)Z(\theta)=\operatorname{diag}(1,e^{i\theta})Z(θ)=diag(1,eiθ), let C\mathcal CC be the submonoid generated by H0,S,H0∗,S∗H_0,S,H_0^*,S^*H0​,S,H0∗​,S∗, and let GnG_nGn​ be generated by C,Z(π/n),Z(π/n)∗\mathcal C,Z(\pi/n),Z(\pi/n)^*C,Z(π/n),Z(π/n)∗. A canonical pair consists of a finite list LLL of coordinate–natural-number pairs (p,a)(p,a)(p,a) and a complex 2×22\times22×2 matrix CCC, such that 1≤a<⌊n/2⌋1\le a<\lfloor n/2\rfloor1≤a<⌊n/2⌋ for every pair, adjacent coordinates differ, eiϕC∈Ce^{i\phi}C\in\mathcal CeiϕC∈C for some real ϕ\phiϕ, and

U=(∏(p,a) in L[1+eiaπ/n2I+1−eiaπ/n2 σp])C,∑(p,a) in Lmin⁡{a,⌊n/2⌋−a}=minimumRotationCost⁡(n,U).U=\left(\prod_{(p,a)\text{ in }L} \left[\frac{1+e^{ia\pi/n}}2 I+ \frac{1-e^{ia\pi/n}}2\,\sigma_p\right]\right)C, \qquad \sum_{(p,a)\text{ in }L}\min\{a,\lfloor n/2\rfloor-a\} =\operatorname{minimumRotationCost}(n,U).U=​(p,a) in L∏​[21+eiaπ/n​I+21−eiaπ/n​σp​]​C,(p,a) in L∑​min{a,⌊n/2⌋−a}=minimumRotationCost(n,U).

The coordinates use σX=(0110)\sigma_X=\begin{pmatrix}0&1\\1&0\end{pmatrix}σX​=(01​10​), σY=(0−ii0)\sigma_Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix}σY​=(0i​−i0​), and σZ=diag⁡(1,−1)\sigma_Z=\operatorname{diag}(1,-1)σZ​=diag(1,−1); products follow list order. On the right, the minimum rotation cost is the least number of Z(π/n)Z(\pi/n)Z(π/n) letters in any finite word whose other letters are arbitrary elements of C\mathcal CC, and whose matrix product VVV satisfies U=eiθVU=e^{i\theta}VU=eiθV for some real θ\thetaθ; the definition assigns zero if no such word exists. Uniqueness is equality of the entire pair (L,C)(L,C)(L,C). Empty words and lists are allowed, and the subtraction in the cost is natural subtraction; when n=2n=2n=2, the canonical list must be empty.

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

    Confirmed by the moderator at approval.

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