Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Exact polar transform with O(N log N) CNOT/SWAP gates

Open
QAlgorithms.Papers.Independent.Intakethird100.P10.polarTransform_circuit_complexity

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

prove2quantum

For N=2nN=2^nN=2n, let GN=BNF2⊗nG_N=B_NF_2^{\otimes n}GN​=BN​F2⊗n​ over F2\mathbb F_2F2​, acting on row bit vectors. There is a family CnC_nCn​ of circuits consisting of CNOT and SWAP gates, together with an absolute constant C>0C>0C>0 and an integer n0n_0n0​, such that

Cn∣u⟩=∣uGN⟩for every n,u,size⁡(Cn)≤C 2nn(n≥n0).C_n|u\rangle=|uG_N\rangle\quad\text{for every }n,u,\qquad \operatorname{size}(C_n)\le C\,2^n n\quad(n\ge n_0).Cn​∣u⟩=∣uGN​⟩for every n,u,size(Cn​)≤C2nn(n≥n0​).

The action is extended linearly to superpositions, and circuit size is the actual gate-list length. At n=0n=0n=0, the one-wire circuit is empty. The bound counts the polar transform; complete encoder phase preparation is a separate node.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P10
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakethird100.P10

open scoped BigOperators Matrix ComplexConjugate

open Filter

-- Accepted definitions, without paper-local aliases.

open QAlgorithms.Papers.Independent.Information100.P58 (basisDensity)

open QAlgorithms.Papers.Independent.Information100.P67 (squaredFidelity)

open QAlgorithms.Papers.Independent.Claimed50.P48 (indexedKrausDilation)

/-- PDF pp.3,7: the transform has an exact CNOT/SWAP implementation and O(N log N)
elementary gates. One absolute constant and one eventual threshold precede n.
At n=0, N=1 and the circuit is empty. This counts no phase-preparation gates. -/
theorem polarTransform_circuit_complexity :
    ∃ C : ℝ, 0 < C ∧ ∃ n0 : ℕ,
      ∃ circuits : (n : ℕ) → List (PolarGate (2 ^ n)),
        circuits 0 = [] ∧
        (∀ n, circuitOperator (circuits n) = polarOperator n) ∧
        (∀ n, n0 ≤ n → ((circuits n).length : ℝ) ≤ C * ((2 : ℝ) ^ n) * (n : ℝ)) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P10

end
Source
Polar codes for degradable quantum channels, arXiv:1109.5346v3, PDF p. 3, §II/IV, unnumbered complexity of the polar transform
Read-back

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

There exist a real constant C>0C>0C>0, a natural number n0n_0n0​, and, for every natural number nnn, a finite gate list LnL_nLn​ on 2n2^n2n Boolean wires, such that L0L_0L0​ is empty, the matrix with entry 111 precisely at (v,u)(v,u)(v,u) satisfying v=Ln(u)v=L_n(u)v=Ln​(u) equals the matrix with entry 111 precisely when v=Tn(u)v=T_n(u)v=Tn​(u), and

length⁡(Ln)≤C 2nn(n≥n0).\operatorname{length}(L_n)\le C\,2^n n\qquad(n\ge n_0).length(Ln​)≤C2nn(n≥n0​).

Each gate is either a controlled-NOT with distinct control and target, updating the target by XOR, or a swap of two wires; lists act in their listed order. The transformation TnT_nTn​ has output bit kkk equal to the parity of those input bits uj=1u_j=1uj​=1 for which every 111-digit at position ttt of the nnn-bit binary expansion of kkk corresponds to a 111-digit at position n−1−tn-1-tn−1−t of jjj, with position 000 most significant. Matrix equality is required for every nnn, including 000; only the length bound is restricted to n≥n0n\ge n_0n≥n0​.

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me