Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Appendix A.1: lookup–rotate–uncompute additive loading cost (90)–(91)

Open
QAlgorithms.Papers.Independent.Extend50.P44.additiveDataLoading

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

prove2quantum

Let D>0D>0D>0 real table items have positive maximum magnitude, and let 0<ϵ<1/20<\epsilon<1/20<ϵ<1/2. Pad the table with known zeros to its minimal binary register. Given the reusable normalized phase-gradient resource used in Appendix A.1, a Clifford+T circuit can approximate the ideal multiplexed RX loader, returning the resource and clean work coherently, with

∥CJ−JOdata∥op≤ϵ,T(C)≤K[D+ln⁡(1/ϵ)].\|CJ-JO_{\rm data}\|_{\rm op}\le\epsilon,\qquad T(C)\le K[D+\ln(1/\epsilon)].∥CJ−JOdata​∥op​≤ϵ,T(C)≤K[D+ln(1/ϵ)].

Here JJJ appends the resource and clean work, and K>0K>0K>0 is absolute, preceding DDD, data values and accuracy. The resource uses b≤K[1+ln⁡(1/ϵ)]b\le K[1+\ln(1/\epsilon)]b≤K[1+ln(1/ϵ)] qubits. Its separate reusable-state preparation is not charged on each invocation. The result is the paper's assembled lookup/rotate/uncompute cost, with the small-D cases handled directly rather than by natural subtraction of two.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P44
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Extend50.P44

open scoped BigOperators ComplexConjugate Matrix

open QAlgorithms.Papers.Independent.Frontier18.P11 (complexMatrix)

open QAlgorithms.Papers.Independent.Information100.P34 (permutationMatrix)

open QAlgorithms.Papers.Independent.Next46.P21 (tCount)

variable {n s d m : ℕ}

local instance : DecidableEq QAlgorithms.Gate := Classical.decEq _

/-- PDF pp.25-26, (90)-(91): given a reusable phase-gradient resource, lookup,
rotation, and uncomputation have additive T cost O(D+log(1/epsilon)).
The circuit's action includes coherent return of the supplied resource and clean
work. All constants are absolute, before the table size, values and accuracy.
The source's D-2 primitive count is not used for the small-D cases. -/
theorem additiveDataLoading :
    ∃ K : ℝ, 0 < K ∧ ∀ D : ℕ, 0 < D → ∀ a : Fin D → ℝ, 0 < tableMax a →
      ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 →
      ∃ b work : ℕ,
      ∃ c : QAlgorithms.Circuit cliffordTSet (1 + Nat.clog 2 D + b + work),
        1 ≤ b ∧ (b : ℝ) ≤ K * (1 + Real.log (1 / epsilon)) ∧
        QAlgorithms.specNorm
          (QAlgorithms.Circuit.unitary c * loaderEmbedding (Nat.clog 2 D) b work -
            loaderEmbedding (Nat.clog 2 D) b work * idealLoader (paddedTable a)) ≤ epsilon ∧
        (tCount (loaderTWord c) : ℝ) ≤ K * ((D : ℝ) + Real.log (1 / epsilon)) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P44

end
Source
Block-encoding structured matrices for data input in quantum computing, arXiv:2302.10949v2, PDF p. 25, Appendix A.1: lookup–rotate–uncompute additive loading cost (90)–(91)
Read-back

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

There exists a real constant K>0K>0K>0 such that, for every positive natural number DDD, every real table a=(aj)j<Da=(a_j)_{j<D}a=(aj​)j<D​ with A=max⁡({0}∪{∣aj∣:j<D})>0A=\max(\{0\}\cup\{|a_j|:j<D\})>0A=max({0}∪{∣aj​∣:j<D})>0, and every real 0<ϵ<1/20<\epsilon<1/20<ϵ<1/2, there exist natural numbers b,workb,\mathrm{work}b,work and a circuit ccc on 1+db+b+work1+d_b+b+\mathrm{work}1+db​+b+work wires, where db=clog⁡2Dd_b=\operatorname{clog}_2Ddb​=clog2​D, such that

1≤b,b≤K(1+log⁡(1/ϵ)),∥UcJ−JV∥op≤ϵ,NT(c)≤K(D+log⁡(1/ϵ)).1\le b,\qquad b\le K\bigl(1+\log(1/\epsilon)\bigr),\qquad \|U_cJ-JV\|_{\mathrm{op}}\le\epsilon,\qquad N_T(c)\le K\bigl(D+\log(1/\epsilon)\bigr).1≤b,b≤K(1+log(1/ϵ)),∥Uc​J−JV∥op​≤ϵ,NT​(c)≤K(D+log(1/ϵ)).

The logarithms here are natural logarithms. The circuit is a finite list of applications of H=2−1/2(111−1)H=2^{-1/2}\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)H=2−1/2(11​1−1​), T=diag⁡(1,eiπ/4)T=\operatorname{diag}(1,e^{i\pi/4})T=diag(1,eiπ/4), T†T^\daggerT†, X=(0110)X=\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right)X=(01​10​), or controlled-NOT, with distinct ordered wires for each application; each matrix acts on its selected wires and as the identity on the others. Its matrix UcU_cUc​ is the product in execution order, with later applications multiplying on the left, and an empty product is the identity. The number NT(c)N_T(c)NT​(c) counts precisely applications whose gate equals TTT or T†T^\daggerT†. To define the other matrices in the bound, pad aaa with zeros to a table a~\widetilde aa of length 2db2^{d_b}2db​. The matrix VVV, indexed by (f,j)∈{false,true}×{0,…,2db−1}(f,j)\in\{\mathrm{false},\mathrm{true}\}\times\{0,\ldots,2^{d_b}-1\}(f,j)∈{false,true}×{0,…,2db​−1}, preserves jjj and has flag block with diagonal a~j/A\widetilde a_j/Aaj​/A and both off-diagonal entries −i1−(a~j/A)2-i\sqrt{1-(\widetilde a_j/A)^2}−i1−(aj​/A)2​. The rectangular matrix JJJ sends a column (f,j)(f,j)(f,j) to amplitudes on strings split as (f′,z,q,anc)(f',z,q,\mathrm{anc})(f′,z,q,anc): its entry is 2−b/2e−2πival⁡(q)/2b2^{-b/2}e^{-2\pi i\operatorname{val}(q)/2^b}2−b/2e−2πival(q)/2b if f′=ff'=ff′=f, zzz is the dbd_bdb​-bit binary encoding of jjj, and all work bits are false, and is zero otherwise; val⁡\operatorname{val}val reads bits in most significant first order. The norm in the bound is the Euclidean operator norm of the resulting rectangular matrix. The case D=1D=1D=1, with an empty address register, is included; the statement gives no upper bound on work\mathrm{work}work or the total circuit length.

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

    Confirmed by the moderator at approval.

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