Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Unnumbered §V: normalization preserves the gate and minimizes T-cost

Open
QAlgorithms.Papers.Independent.Intakenext100.P82.normalized_t_optimal

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

prove2quantum

All circuits are single-qubit circuits without ancillas or measurements. Products act from right to left. Let H=i 2−1/2(111−1)H=i\,2^{-1/2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}H=i2−1/2(11​1−1​), T=diag⁡(e−iπ/8,eiπ/8)T=\operatorname{diag}(e^{-i\pi/8},e^{i\pi/8})T=diag(e−iπ/8,eiπ/8), S=T2S=T^2S=T2, and C=⟨H,S⟩⊂PSU⁡(2)C=\langle H,S\rangle\subset\operatorname{PSU}(2)C=⟨H,S⟩⊂PSU(2). The two distinct syllable letters are a=THa=THa=TH and b=SHb=SHb=SH. A normalized word is empty, or ends in aaa with no adjacent bbb letters. A canonical word is normalized and its first four syllables, when present, are all aaa. Write τ(c)\tau(c)τ(c) for the number of aaa letters in ccc; Clifford gates have zero charged cost.

Let o=Hh[c]go=H^h[c]go=Hh[c]g be a normalized presentation. For every competing Clifford/T word www representing the same projective gate,

[w]=[o] ⟹ τ(c)≤cost⁡T(w).[w]=[o]\ \Longrightarrow\ \tau(c)\le\operatorname{cost}_T(w).[w]=[o] ⟹ τ(c)≤costT​(w).

If www is an ϵ\epsilonϵ-approximation of a unitary target UUU, with ϵ>0\epsilon>0ϵ>0, the exactly equivalent presentation ooo still satisfies d([o],U)<ϵd([o],U)<\epsilond([o],U)<ϵ. Thus normalization minimizes charged T-cost within an exact gate-equivalence class; optimization among distinct nearby gates is a separate problem.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P82
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P82

open scoped BigOperators

local notation "Mat" => Matrix Bool Bool ℂ

/-- Unnumbered §V, PDF p.6. Every normalized presentation has minimum
charged T-cost among all exact Clifford/T presentations of the same gate.
The epsilon clause preserves approximation and asserts no optimum over neighbors. -/
theorem normalized_t_optimal (o : NormalOutput) (hc : BsNormalized o.body) :
    (∀ w : List CTLetter, SameGate (ctValue w) (bsNormalValue o) →
      bsTCount o.body ≤ chargedT w) ∧
    (∀ (U : Mat), U ∈ Matrix.unitaryGroup Bool ℂ → ∀ epsilon : ℝ, 0 < epsilon →
      ∀ w : List CTLetter, SameGate (ctValue w) (bsNormalValue o) →
        gateDistance (ctValue w) U < epsilon → gateDistance (bsNormalValue o) U < epsilon) := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P82

end
Source
A Depth-Optimal Canonical Form for Single-qubit Quantum Circuits, arXiv:1206.3223v1, PDF p. 6, Unnumbered §V: normalization preserves the gate and minimizes T-cost
Read-back

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

Let H=12(111−1)H=\frac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}H=2​1​(11​1−1​), S=diag⁡(1,i)S=\operatorname{diag}(1,i)S=diag(1,i), T=diag⁡(1,eiπ/4)T=\operatorname{diag}(1,e^{i\pi/4})T=diag(1,eiπ/4), and define C0,…,C23C_0,\ldots,C_{23}C0​,…,C23​, in order, by

(I,H,HS2H,S2,S,S3,HS2,S2H,SH,S3H,S2HS2H,SHS2H,S3HS2H,HS,HS3,S2HS2,SHS2,S3HS2,HSH,HS3H,HSHS2H,HS3HS2H,S3HS,SHS3).\bigl( I,H,HS^2H,S^2,S,S^3,HS^2,S^2H,SH,S^3H, S^2HS^2H,SHS^2H,S^3HS^2H,HS,HS^3,S^2HS^2, SHS^2,S^3HS^2,HSH,HS^3H,HSHS^2H,HS^3HS^2H,S^3HS,SHS^3 \bigr).(I,H,HS2H,S2,S,S3,HS2,S2H,SH,S3H,S2HS2H,SHS2H,S3HS2H,HS,HS3,S2HS2,SHS2,S3HS2,HSH,HS3H,HSHS2H,HS3HS2H,S3HS,SHS3).

For matrices write X∼YX\sim YX∼Y when X=zYX=zYX=zY for some complex zzz with ∣z∣=1|z|=1∣z∣=1, and define D(X,Y)=(2−∣tr⁡(XY∗)∣)/2D(X,Y)=\sqrt{(2-|\operatorname{tr}(XY^*)|)/2}D(X,Y)=(2−∣tr(XY∗)∣)/2​, using conjugate transpose and the real square root, which is zero on negative inputs. Consider any output ooo consisting of a Boolean hhh, a finite body ccc of syllables a=THa=THa=TH or b=SHb=SHb=SH, and an index g∈{0,…,23}g\in\{0,\ldots,23\}g∈{0,…,23}. Assume ccc is empty, or ends in aaa and contains no consecutive bbb's. Let Na(c)N_a(c)Na​(c) count its occurrences of aaa, let V(c)V(c)V(c) be its list-order product with empty product III, and put

N(o)={H,h=true,I,h=falseV(c)Cg.N(o)= \begin{cases}H,&h=\mathrm{true},\\I,&h=\mathrm{false}\end{cases} V(c)C_g.N(o)={H,I,​h=true,h=false​V(c)Cg​.

Then both of the following hold: for every finite word www with letters TTT or indexed letters CjC_jCj​, if its product WWW satisfies W∼N(o)W\sim N(o)W∼N(o), then Na(c)N_a(c)Na​(c) is at most the number of TTT-letters in www; and, for every unitary complex 2×22\times22×2 matrix UUU, every real ϵ>0\epsilon>0ϵ>0, and every such word www, if W∼N(o)W\sim N(o)W∼N(o) and D(W,U)<ϵD(W,U)<\epsilonD(W,U)<ϵ, then D(N(o),U)<ϵD(N(o),U)<\epsilonD(N(o),U)<ϵ. Words www may be empty, and only letters explicitly of type TTT contribute to their count.

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