Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The residual program is independent of the data

Open
QAlgorithms.Papers.Independent.Extend50.P43.output_program_independence

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

prove2quantum

Let GGG be a fixed unitary on mmm data qubits and nnn program qubits, let UUU be a unitary on the data register, and let PPP be a normalized program. Assume that for every normalized data vector ddd there exists a normalized residual program qdq_dqd​ satisfying G(d⊗P)=Ud⊗qdG(d\otimes P)=Ud\otimes q_dG(d⊗P)=Ud⊗qd​. Then there is one normalized residual program qqq such that

G(d⊗P)=Ud⊗qfor every normalized d.G(d\otimes P)=Ud\otimes q\qquad\text{for every normalized }d.G(d⊗P)=Ud⊗qfor every normalized d.

This justifies using one residual program for a selected operation. In particular, the hypothesis allows the residual witness to depend on the input, while the conclusion removes that dependence.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P43
Formal statement
namespace QAlgorithms.Papers.Independent.Extend50.P43

open scoped ComplexConjugate

noncomputable section

/-- PDF p.1, paragraph after Eqs.(3)–(5): the output program is independent
of the data. The source's inner-product cancellation omits orthogonal inputs;
linearity and a superposition connect those inputs without a new hypothesis. -/
theorem output_program_independence (m n : ℕ)
    (G : Matrix (Qubits m × Qubits n) (Qubits m × Qubits n) ℂ)
    (hG : G ∈ Matrix.unitaryGroup (Qubits m × Qubits n) ℂ)
    (U : Matrix (Qubits m) (Qubits m) ℂ)
    (hU : U ∈ Matrix.unitaryGroup (Qubits m) ℂ)
    (P : EuclideanSpace ℂ (Qubits n)) (hImplements : ImplementsProgramUnitary G U P) :
    ∃ q : EuclideanSpace ℂ (Qubits n), IsState q ∧
      ∀ d : EuclideanSpace ℂ (Qubits m), IsState d →
        act G (tensorVec d P) = tensorVec (act U d) q := by sorry

end

end QAlgorithms.Papers.Independent.Extend50.P43
Source
Programmable quantum gate arrays, arXiv:quant-ph/9703032v1, PDF p. 1, Unnumbered supporting result after Eqs.(3)-(5): residual program is independent of data
Read-back

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

For any natural numbers m,nm,nm,n, any unitary complex matrix GGG on C{0,1}m×{0,1}n\mathbb C^{\{0,1\}^m\times\{0,1\}^n}C{0,1}m×{0,1}n, any unitary complex matrix UUU on C{0,1}m\mathbb C^{\{0,1\}^m}C{0,1}m, and any vector P∈C{0,1}nP\in\mathbb C^{\{0,1\}^n}P∈C{0,1}n, suppose that ∥P∥2=1\|P\|_2=1∥P∥2​=1 and that every unit vector d∈C{0,1}md\in\mathbb C^{\{0,1\}^m}d∈C{0,1}m admits some unit vector qd∈C{0,1}nq_d\in\mathbb C^{\{0,1\}^n}qd​∈C{0,1}n with G(d⊗P)=(Ud)⊗qdG(d\otimes P)=(Ud)\otimes q_dG(d⊗P)=(Ud)⊗qd​. Then there exists a single vector q∈C{0,1}nq\in\mathbb C^{\{0,1\}^n}q∈C{0,1}n with ∥q∥2=1\|q\|_2=1∥q∥2​=1 such that

∀d∈C{0,1}m,∥d∥2=1 ⟹ G(d⊗P)=(Ud)⊗q.\forall d\in\mathbb C^{\{0,1\}^m},\qquad \|d\|_2=1\ \Longrightarrow\ G(d\otimes P)=(Ud)\otimes q.∀d∈C{0,1}m,∥d∥2​=1 ⟹ G(d⊗P)=(Ud)⊗q.

Matrix action is ordinary matrix-vector multiplication, and (v⊗w)(a,b)=v(a)w(b)(v\otimes w)(a,b)=v(a)w(b)(v⊗w)(a,b)=v(a)w(b). Both zero values of m,nm,nm,n are included, giving one-dimensional spaces for the corresponding registers.

Human review
  • Endorsed by Shuze Chen · Oct 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 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