Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

§6, eq. (6.17) — each good state is observed with probability at least 1/(20q2)1/(20q^2)1/(20q2)

Proved
ShorAlgorithms.DiscreteLog.good_state_prob_ge

by mikedeng1 · Sep 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

discrete-logarithmp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1quantum-algorithms

Throughout, ppp is a prime, ggg is a generator of the multiplicative group (Z/pZ)×(\mathbb Z/p\mathbb Z)^\times(Z/pZ)× (an element of order p−1p-1p−1), rrr is an integer with 0≤r<p−10\le r<p-10≤r<p−1 and x=grx=g^rx=gr (so rrr is the discrete logarithm of xxx), and q=2lq=2^lq=2l is a power of 222 with p<q<2pp<q<2pp<q<2p.

Let 0≤c,d<q0\le c,d<q0≤c,d<q be such that (c,d)(c,d)(c,d) is good, i.e. satisfies conditions (6.10) and (6.11), and let yyy be any nonzero residue modulo ppp. Then the probability of observing ∣c,d,y⟩|c,d,y\rangle∣c,d,y⟩ when the final state (6.3) is measured satisfies

Pr⁡[c,d,y] ≥ 120q2.\Pr[c,d,y]\ \ge\ \frac{1}{20q^2}.Pr[c,d,y] ≥ 20q21​.

This per-state lower bound, combined with a count of good pairs, gives the constant success probability of the algorithm.

Formalization Note The paper derives the bound from the integral approximation (6.16), whose error term O(W/(pq))O(W/(pq))O(W/(pq)) has an unspecified constant, and then states 1/(20q2)1/(20q^2)1/(20q2) without a threshold on ppp. The statement here is the page's unconditional claim, for every prime ppp.

Preamble
import Mathlib
import Definitions.Def_ShorAlgorithms_DiscreteLog_outcomeProb
import Definitions.Def_ShorAlgorithms_DiscreteLog_IsGood
Formal statement
namespace ShorAlgorithms.DiscreteLog

/-- Shor (1997), §6, eq. (6.17), p. 1504: under the hypotheses of §6, every state `|c, d, y⟩`
whose `(c, d)` satisfies (6.10) and (6.11) is observed with probability at least `1/(20 q²)`. -/
theorem good_state_prob_ge (p : ℕ) [hp : Fact p.Prime] (g : (ZMod p)ˣ) (hg : orderOf g = p - 1)
    (r : ℕ) (hr : r < p - 1) (q l : ℕ) (hq : q = 2 ^ l) (hpq : p < q) (hqp : q < 2 * p)
    (c d : Fin q) (hgood : IsGood p q r c d) (y : (ZMod p)ˣ) :
    1 / (20 * (q : ℝ) ^ 2) ≤ outcomeProb p g (g ^ r) q c d y := by sorry

end ShorAlgorithms.DiscreteLog
Source
Shor, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer, SIAM J. Comput. 26(5) (1997), p. 1504, §6, eq. (6.17) and the sentence after it ("or at least .054/q2>1/(20q2).054/q^2 > 1/(20q^2).054/q2>1/(20q2)")
Human review
  • Endorsed by Shuze Chen · Oct 1, 2026

    Confirmed by the moderator at approval.

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