Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Corollary 2: full ancilla-free determinant characterization

Open
QAlgorithms.Papers.Independent.Intakethird100.P85.ancillaFree_characterization

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let UUU be a unitary operator on n≥0n\ge0n≥0 qubits. Put R=Z[1/2,i]R=\mathbb Z[1/\sqrt2,i]R=Z[1/2​,i] and ω=eiπ/4\omega=e^{i\pi/4}ω=eiπ/4. Then UUU is exactly representable by an ancilla-free Clifford+T circuit if and only if every entry belongs to RRR and

det⁡U∈{{1},n≥4,{−1,1},n=3,{i,−1,−i,1},n=2,{ω,i,ω3,−1,ω5,−i,ω7,1},n≤1.\det U\in \begin{cases} \{1\},&n\ge4,\\ \{-1,1\},&n=3,\\ \{i,-1,-i,1\},&n=2,\\ \{\omega,i,\omega^3,-1,\omega^5,-i,\omega^7,1\},&n\le1. \end{cases}detU∈⎩⎨⎧​{1},{−1,1},{i,−1,−i,1},{ω,i,ω3,−1,ω5,−i,ω7,1},​n≥4,n=3,n=2,n≤1.​

The gate set includes the scalar ω\omegaω and preserves absolute phase. The final regime is retained even though the entry and unitary conditions already imply it. This characterizes the ancilla-free group in every qubit dimension.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P85
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakethird100.P85

open scoped Classical BigOperators

open QAlgorithms

open QAlgorithms.Papers.Independent.Gap48.P10
  (InZomega InDomega Residue bits residue residueMultiply Reducible)

open QAlgorithms.Papers.Independent.Support21.P13
  (synthesisRing integralRing coordinateValue HTLetter htWordMatrix EntriesInRing cliffordTLibrary)

local notation "omega" => QAlgorithms.gateT true true

local notation "sqrtTwo" => ((Real.sqrt 2 : ℝ) : ℂ)

/-- Corollary 2, PDF p.6: all four exact ancilla-free determinant regimes. -/
theorem ancillaFree_characterization (n : ℕ) (U : Matrix (Qubits n) (Qubits n) ℂ)
    (unitary : U ∈ Matrix.unitaryGroup (Qubits n) ℂ) :
    (∃ c : Circuit gateSet n, c.unitary = U) ↔
      EntriesInRing U ∧
      (4 ≤ n → U.det = 1) ∧
      (n = 3 → U.det ∈ ({-1, 1} : Set ℂ)) ∧
      (n = 2 → U.det ∈ ({Complex.I, -1, -Complex.I, 1} : Set ℂ)) ∧
      (n ≤ 1 → U.det ∈ ({omega, Complex.I, omega ^ 3, -1,
        omega ^ 5, -Complex.I, omega ^ 7, 1} : Set ℂ)) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P85

end
Source
Exact synthesis of multiqubit Clifford+T circuits, arXiv:1212.0506v3, PDF p. 6, Corollary 2: full ancilla-free determinant characterization
Read-back

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

For every natural number nnn, let QnQ_nQn​ be the Boolean strings of length nnn, let ω=eiπ/4\omega=e^{i\pi/4}ω=eiπ/4, and let R\mathcal RR be the smallest subring of C\mathbb CC containing 1/21/\sqrt21/2​ and iii. For every unitary matrix UUU indexed by Qn×QnQ_n\times Q_nQn​×Qn​, there exists a finite circuit on exactly nnn wires with matrix exactly UUU if and only if every entry of UUU lies in R\mathcal RR and all the following implications hold:

n≥4 ⇒ det⁡U=1,n=3 ⇒ det⁡U∈{−1,1},n=2 ⇒ det⁡U∈{i,−1,−i,1},n≤1 ⇒ det⁡U∈{ω,i,ω3,−1,ω5,−i,ω7,1}.\begin{aligned} n\ge4&\ \Rightarrow\ \det U=1,\\ n=3&\ \Rightarrow\ \det U\in\{-1,1\},\\ n=2&\ \Rightarrow\ \det U\in\{i,-1,-i,1\},\\ n\le1&\ \Rightarrow\ \det U\in \{\omega,i,\omega^3,-1,\omega^5,-i,\omega^7,1\}. \end{aligned}n≥4n=3n=2n≤1​ ⇒ detU=1, ⇒ detU∈{−1,1}, ⇒ detU∈{i,−1,−i,1}, ⇒ detU∈{ω,i,ω3,−1,ω5,−i,ω7,1}.​

The allowed circuit gates are H=2−1/2(111−1)H=2^{-1/2}\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)H=2−1/2(11​1−1​), S=diag⁡(1,i)S=\operatorname{diag}(1,i)S=diag(1,i), T=diag⁡(1,ω)T=\operatorname{diag}(1,\omega)T=diag(1,ω), CNOT sending (a,b)(a,b)(a,b) to (a,bxora)(a,b\mathbin{\mathrm{xor}}a)(a,bxora), and a zero-wire gate with sole entry ω\omegaω. Each gate is embedded on an injectively chosen set of wires by preserving all other bits; the circuit matrix is the reverse-ordered product of the embedded matrices, and the empty circuit gives III. The zero-wire gate embeds as ωI\omega IωI. In particular, the last determinant implication applies both to n=1n=1n=1 and to n=0n=0n=0; the space indexed by Q0Q_0Q0​ is one-dimensional.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 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