Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 12, p. 28 — for φ not an n-bit number, θ after iteration j is the (n − j)-digit rounding of 0.φ_{[j+1:]}, up to a carry, with error ≤ 2^{j−n−1}

Proved
QSVTPhaseEst.BitSearch.lemma_12

by mikedeng1 · Oct 14, 2026 · Mathlib 0df444a (Lean v4.33.1)

p2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1phase-estimationqsvtquantum-algorithmsrounding

Let 0≤φ<10 \le \varphi < 10≤φ<1 be an mmm-bit number with m>n≥1m > n \ge 1m>n≥1 (including m=∞m = \inftym=∞), and consider any run of the loop of phase estimation by QSVT with the exact sign function. Then at the end of every iteration jjj, 0≤j<n0 \le j < n0≤j<n:

  1. θj=0.φ~j+1…φ~n\theta_j = 0.\tilde\varphi_{j+1}\ldots\tilde\varphi_nθj​=0.φ~​j+1​…φ~​n​ is an (n−j)(n-j)(n−j)-digit binary fraction, θj=k/2n−j\theta_j = k/2^{n-j}θj​=k/2n−j with 0≤k<2n−j0 \le k < 2^{n-j}0≤k<2n−j;
  2. there is a carry bit r~j∈{0,1}\tilde r_j \in \{0,1\}r~j​∈{0,1} such that
∣r~j.φ~[j+1:]−0.φ[j+1:]∣≤2j−n−1,\bigl|\tilde r_j.\tilde\varphi_{[j+1:]} - 0.\varphi_{[j+1:]}\bigr| \le 2^{j-n-1},​r~j​.φ~​[j+1:]​−0.φ[j+1:]​​≤2j−n−1,

where r~j.φ~[j+1:]=r~j+θj\tilde r_j.\tilde\varphi_{[j+1:]} = \tilde r_j + \theta_jr~j​.φ~​[j+1:]​=r~j​+θj​ and 0.φ[j+1:]0.\varphi_{[j+1:]}0.φ[j+1:]​ is the fractional part of 2jφ2^j\varphi2jφ.

Since r~j+θj\tilde r_j + \theta_jr~j​+θj​ is a multiple of 2−(n−j)2^{-(n-j)}2−(n−j) within half a grid step of 0.φ[j+1:]0.\varphi_{[j+1:]}0.φ[j+1:]​, it is a rounding of 0.φ[j+1:]0.\varphi_{[j+1:]}0.φ[j+1:]​ to n−jn - jn−j binary digits, as the lemma states. It is the induction behind Theorem 7.

Formalization Note "m>nm > nm>n" is encoded as "φ≠k/2n\varphi \ne k/2^nφ=k/2n for every k∈Nk \in \mathbb Nk∈N". The bound 2j−n−12^{j-n-1}2j−n−1 is written 1/2n−j+11/2^{n-j+1}1/2n−j+1 (with j<nj < nj<n). At a tie of the rounding either rounding is allowed, as on p. 29.

Preamble
import Mathlib
import Definitions.Def_QSVTPhaseEst_BitSearch_Procedure
Formal statement
namespace QSVTPhaseEst.BitSearch

theorem lemma_12 (φ : ℝ) (hφ0 : 0 ≤ φ) (hφ1 : φ < 1) (n : ℕ) (hn : 1 ≤ n)
    (hm : ¬ ∃ k : ℕ, φ = (k : ℝ) / 2 ^ n) (b : ℕ → Bool) (hrun : IsLoopRun 0 φ n b) :
    ∀ j < n,
      (∃ k : ℕ, k < 2 ^ (n - j) ∧ thetaAfter n b j = (k : ℝ) / 2 ^ (n - j)) ∧
      ∃ r : ℕ, r ≤ 1 ∧
        |(r : ℝ) + thetaAfter n b j - Int.fract ((2 : ℝ) ^ j * φ)| ≤
          ((2 : ℝ) ^ (n - j + 1))⁻¹ := by sorry

end QSVTPhaseEst.BitSearch
Source
Martyn, Rossi, Tan & Chuang, A Grand Unification of Quantum Algorithms, arXiv:2105.02859v5, p. 28, Lemma 12 (Appendix B 1 b); proof pp. 28–29
Human review
  • Endorsed by Shuze Chen · Oct 15, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 15, 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