Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5: gate precision and computation error

Open
QAlgorithms.Papers.Independent.Intakethird100.P03.computation_error

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

prove2quantum

Suppose LLL unitary operations compute a promised function with worst-case error at most 0≤ϵ<1/20\le\epsilon<1/20≤ϵ<1/2, using clean initial work and a specified output register. Replace each operation by a unitary within phase-sensitive operator distance δ≥0\delta\ge0δ≥0. For every promised input,

Pr⁡[correct output after replacement]≥1−(ϵ+2Lδ).\Pr[\text{correct output after replacement}]\ge1-(\epsilon+2L\delta).Pr[correct output after replacement]≥1−(ϵ+2Lδ).

The bound is retained even when its right side is nonpositive or the resulting error exceeds one half.

Only the output register is measured, and both operation lists are specified on the actual computer memory.

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.12, Lemma 5: gate errors imply a worst-case success bound on every valid
input, including when the resulting upper bound on error exceeds one half or one. -/
theorem computation_error {n m w L : ℕ}
    (U V : Fin L → Matrix (Qubits (n + w)) (Qubits (n + w)) ℂ)
    (out : Fin m ↪ Fin (n + w)) (N : Set (Qubits n)) (F : Qubits n → Qubits m)
    (epsilon delta : ℝ) (he : 0 ≤ epsilon) (hehalf : epsilon < 1 / 2) (hd : 0 ≤ delta)
    (hU : ∀ j, U j ∈ Matrix.unitaryGroup (Qubits (n + w)) ℂ)
    (hV : ∀ j, V j ∈ Matrix.unitaryGroup (Qubits (n + w)) ℂ)
    (herror : Computes (orderedProd U) out N F epsilon)
    (happrox : ∀ j, specNorm (V j - U j) ≤ delta) :
    Computes (orderedProd V) out N F (epsilon + 2 * (L : ℝ) * delta) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P03

end
Source
Quantum measurements and the Abelian Stabilizer Problem, arXiv:quant-ph/9511026v1, PDF p. 12, Lemma 5: gate precision and computation error
Read-back

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

Let n,m,w,Ln,m,w,Ln,m,w,L be arbitrary natural numbers; let Uj,VjU_j,V_jUj​,Vj​, for 0≤j<L0\le j<L0≤j<L, be unitary complex matrices indexed by bit strings of length n+wn+wn+w; let out:{0,…,m−1}↪{0,…,n+w−1}\mathrm{out}:\{0,\ldots,m-1\}\hookrightarrow\{0,\ldots,n+w-1\}out:{0,…,m−1}↪{0,…,n+w−1} be an injection; let N⊆{0,1}nN\subseteq\{0,1\}^nN⊆{0,1}n; let F:{0,1}n→{0,1}mF:\{0,1\}^n\to\{0,1\}^mF:{0,1}n→{0,1}m; and let real numbers ϵ,δ\epsilon,\deltaϵ,δ satisfy 0≤ϵ<1/20\le\epsilon<1/20≤ϵ<1/2 and 0≤δ0\le\delta0≤δ. Write U∗=UL−1⋯U0U_*=U_{L-1}\cdots U_0U∗​=UL−1​⋯U0​ and V∗=VL−1⋯V0V_*=V_{L-1}\cdots V_0V∗​=VL−1​⋯V0​, with empty products equal to the identity. Suppose ∥Vj−Uj∥op≤δ\|V_j-U_j\|_{\mathrm{op}}\le\delta∥Vj​−Uj​∥op​≤δ for every jjj, where this is the Euclidean operator norm, and suppose for every x∈Nx\in Nx∈N,

∑z∈{0,1}n+wz∘out=F(x)∣(U∗∣x,0w⟩)z∣2≥1−ϵ.\sum_{\substack{z\in\{0,1\}^{n+w}\\z\circ\mathrm{out}=F(x)}} |(U_*|x,0^w\rangle)_z|^2\ge1-\epsilon.z∈{0,1}n+wz∘out=F(x)​∑​∣(U∗​∣x,0w⟩)z​∣2≥1−ϵ.

Then for every x∈Nx\in Nx∈N,

∑z∈{0,1}n+wz∘out=F(x)∣(V∗∣x,0w⟩)z∣2≥1−(ϵ+2Lδ).\sum_{\substack{z\in\{0,1\}^{n+w}\\z\circ\mathrm{out}=F(x)}} |(V_*|x,0^w\rangle)_z|^2 \ge1-(\epsilon+2L\delta).z∈{0,1}n+wz∘out=F(x)​∑​∣(V∗​∣x,0w⟩)z​∣2≥1−(ϵ+2Lδ).

Here ∣x,0w⟩|x,0^w\rangle∣x,0w⟩ is the coordinate vector with the ancillary bits false, and matrix action is ordinary matrix-vector multiplication. The conclusion does not require ϵ+2Lδ<1\epsilon+2L\delta<1ϵ+2Lδ<1. The statement includes zero lengths and L=0L=0L=0, and its conditions and conclusion concerning inputs are vacuous when NNN 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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me