Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Pair encoding yields a range-three simulation

Open
QAlgorithms.Papers.Independent.Intakethird100.P77.pairEncoding_rangeThree

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

prove2quantum

Let CsC_sCs​ be an effectively uniform circuit family in nearest-neighbour controlled-ZZZ/one-qubit normal form, with positive logical width and first-wire output. Encode ∣0⟩|0\rangle∣0⟩ as ∣00⟩|00\rangle∣00⟩ and ∣1⟩|1\rangle∣1⟩ as ∣11⟩|11\rangle∣11⟩, extending the encoding E2E_2E2​ linearly. A target family of allowable matchgates on two physical wires per logical wire can be fixed before the quantum input so that, for an absolute C>0C>0C>0,

∣Gs∣≤C∣Cs∣,range⁡(Gs)≤3,pb(Gs,E2ψ,1)=pb(Cs,ψ,1).|G_s|\le C|C_s|,\qquad \operatorname{range}(G_s)\le3,\qquad p_b(G_s,E_2\psi,1)=p_b(C_s,\psi,1).∣Gs​∣≤C∣Cs​∣,range(Gs​)≤3,pb​(Gs​,E2​ψ,1)=pb​(Cs​,ψ,1).

The probability equality holds for every normalized logical input ψ\psiψ and both output values bbb. Effective descriptions of target structure and gate entries are included. This is an upper bound from the alternative construction; it asserts no minimality of range three.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P77
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakethird100.P77

open QAlgorithms

open QAlgorithms.Complexity (Str)

open QAlgorithms.Papers.Independent.Advance50.P19 (Major CARSystem)

open QAlgorithms.Papers.Independent.Information100.P32 (Op)

open scoped BigOperators Matrix ComplexConjugate

attribute [local instance] Classical.propDecidable Classical.decEq

/-- PDF p.6 closing remark: the alternative two-wire encoding admits a uniform
range-three upper bound and constant gate overhead. No minimality of range
three is asserted. The first physical line is the logical output line. -/
theorem pairEncoding_rangeThree :
    ∃ C : ℕ, 0 < C ∧ ∀ F : SourceFamily, F.Effective →
      (∀ s, 0 < F.width s) →
      ∃ G : (s : Str) → List (ParityApp (2 * F.width s)),
        (ParityFamily.mk (fun s => 2 * F.width s) G).Effective ∧
        (∀ s g, g ∈ G s → g.Allowable) ∧
        (∀ s, RangeBound 3 (G s) ∧ (G s).length ≤ C * (F.gates s).length) ∧
        ∀ s (k : Fin (F.width s)), k.val = 0 →
          ∀ (q : Fin (2 * F.width s)), q.val = 0 →
            ∀ psi : EuclideanSpace ℂ (Qubits (F.width s)), IsState psi →
              ∀ b, singleWireProbability (parityCircuit (G s)).unitary
                  (encodeState encodeTwoBits psi) q b =
                singleWireProbability (sourceCircuit (F.gates s)).unitary psi k b := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P77

end
Source
Matchgates and classical simulation of quantum circuits, arXiv:0804.4050v2, PDF p. 6, Section 2 closing remark: pair encoding gives range three
Read-back

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

There exists a positive natural number CCC such that every effective source family FFF with positive width nsn_sns​ for every finite Boolean string sss admits a family of ordered gate lists GsG_sGs​ on 2ns2n_s2ns​ wires satisfying the following conditions. Source gates are arbitrary one-qubit unitaries on specified wires or controlled-ZZZ gates on specified wires i,ji,ji,j satisfying i+1=ji+1=ji+1=j. Here effectiveness uses the following encoding: u(r)u(r)u(r) is rrr true bits, and τ([v1,…,vℓ])\tau([v_1,\ldots,v_\ell])τ([v1​,…,vℓ​]) concatenates u(∣vj∣)u(|v_j|)u(∣vj​∣), a false bit, and vjv_jvj​ for each jjj. The source code τ([u(ns),u(Ls)]+ ⁣ ⁣+gate descriptions)\tau([u(n_s),u(L_s)]\mathbin{+\!\!+}\text{gate descriptions})τ([u(ns​),u(Ls​)]++gate descriptions) must be polynomial-time computable, where a one-qubit description is τ([[false],u(i)])\tau([[{\rm false}],u(i)])τ([[false],u(i)]) and a controlled-ZZZ description is τ([[true],u(i),u(j)])\tau([[{\rm true}],u(i),u(j)])τ([[true],u(i),u(j)]). The numerical list records each one-qubit matrix’s entries in order (00,01,10,11)(00,01,10,11)(00,01,10,11) and no entries for controlled-ZZZ; a polynomial-time function on τ([s,u(j),u(r),[b]])\tau([s,u(j),u(r),[b]])τ([s,u(j),u(r),[b]]) must approximate the real part of data entry jjj for false bbb and its imaginary part for true bbb, within 2−r2^{-r}2−r for every valid jjj and every r∈Nr\in\mathbb Nr∈N. Its output represents a signed binary integer divided by 2r2^r2r, with a true initial bit denoting a negative sign and the tail giving the binary magnitude, with missing bits read as false. Each gate of GsG_sGs​ specifies distinct target wires and two 2×22\times22×2 unitary matrices A,BA,BA,B; the local matrix entry from yyy to xxx is zero between different parities, is Ax0,y0A_{x_0,y_0}Ax0​,y0​​ on even parity, and is Bx0,y0B_{x_0,y_0}Bx0​,y0​​ on odd parity. Every target gate satisfies det⁡A=det⁡B\det A=\det BdetA=detB, its two wire indices differ by at most 333, and ∣Gs∣≤CLs|G_s|\le C L_s∣Gs​∣≤CLs​. The target code τ([u(2ns),u(∣Gs∣)]+ ⁣ ⁣+[τ([u(ig),u(jg)])]g)\tau([u(2n_s),u(|G_s|)]\mathbin{+\!\!+}[\tau([u(i_g),u(j_g)])]_g)τ([u(2ns​),u(∣Gs​∣)]++[τ([u(ig​),u(jg​)])]g​) is polynomial-time computable, and its numerical list, comprising the four entries of each AgA_gAg​ followed by the four entries of BgB_gBg​, has a polynomial-time approximation procedure with the same convention. For every sss, source wire kkk with index 000, target wire qqq with index 000, unit vector ψ\psiψ on length-nsn_sns​ bit strings, and Boolean bbb,

∑z:zq=b∣(WsE2ψ)z∣2=∑x:xk=b∣(Vsψ)x∣2,E2ψ=∑xψx ∣x0x0x1x1⋯xns−1xns−1⟩.\sum_{z:z_q=b}|(W_sE_2\psi)_z|^2 = \sum_{x:x_k=b}|(V_s\psi)_x|^2, \qquad E_2\psi=\sum_x\psi_x\,|x_0x_0x_1x_1\cdots x_{n_s-1}x_{n_s-1}\rangle.z:zq​=b∑​∣(Ws​E2​ψ)z​∣2=x:xk​=b∑​∣(Vs​ψ)x​∣2,E2​ψ=x∑​ψx​∣x0​x0​x1​x1​⋯xns​−1​xns​−1​⟩.

The operators Vs,WsV_s,W_sVs​,Ws​ apply their gate lists in listed order, each gate acting identically on untouched wires. Empty parameter strings and empty source gate lists are included; the length bound forces the target list to be empty when the source list is empty.

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