Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§2.2 Corollaries, item 1: wire permutation

Open
QAlgorithms.Papers.Independent.Intakethird100.P03.wire_permutation

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

prove2quantum

For any permutation π\piπ of the nnn wire positions, there is a CNOT operation sequence with clean auxiliary work that performs the corresponding bit permutation using at most 4n4n4n gates:

∣x,0⟩⟼∣x∘π−1,0⟩.|x,0\rangle\longmapsto |x\circ\pi^{-1},0\rangle.∣x,0⟩⟼∣x∘π−1,0⟩.

The assertion includes n=0n=0n=0, when the empty computation is the identity. It concerns wire positions, rather than arbitrary permutations of Boolean words.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P03
Formal statement
noncomputable section

open scoped Matrix ComplexConjugate Kronecker

namespace QAlgorithms.Papers.Independent.Intakethird100.P03

open QAlgorithms.Papers.Independent.Renew46.P01 (cleanVector)

attribute [local instance] Classical.propDecidable

/-- PDF p.8, Corollary 1: permutation of wire positions, with clean work; the source's
4n is an upper bound on actual CNOT applications. The n=0 case is the identity. -/
theorem wire_permutation (n : ℕ) (p : Equiv.Perm (Fin n)) :
    ∃ (w : ℕ) (c : Circuit {Gate.ofMatrix2 cnot} (n + w)),
      c.size ≤ 4 * n ∧ ∀ x : Qubits n,
        act c.unitary (inputState x w) = inputState (fun i => x (p.symm i)) w := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P03

end
Source
Quantum measurements and the Abelian Stabilizer Problem, arXiv:quant-ph/9511026v1, PDF p. 8, §2.2 Corollaries, item 1: wire permutation
Read-back

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

For every natural number nnn, including 000, and every permutation ppp of {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, there exist a natural number www and a circuit ccc on n+wn+wn+w bits containing at most 4n4n4n gates, all controlled-NOT gates, such that for every bit string x∈{0,1}nx\in\{0,1\}^nx∈{0,1}n,

Uc∣x,0w⟩=∣(xp−1(i))i=0n−1,0w⟩.U_c|x,0^w\rangle = |(x_{p^{-1}(i)})_{i=0}^{n-1},0^w\rangle.Uc​∣x,0w⟩=∣(xp−1(i)​)i=0n−1​,0w⟩.

Here ∣x,0w⟩|x,0^w\rangle∣x,0w⟩ is the coordinate vector supported at the concatenation of xxx with www false bits; each gate acts on an ordered pair of distinct wires by (a,b)↦(a,b⊕a)(a,b)\mapsto(a,b\mathbin{\oplus}a)(a,b)↦(a,b⊕a), leaving other wires unchanged; and UcU_cUc​ is the product of the embedded gate matrices, with gates applied in their list order. The ancillary bits return to false exactly. For n=0n=0n=0, the gate bound requires an empty circuit.

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