Quantum order finding recovers the order with probability at least
ProvedShorAlgorithms.OrderFinding.order_recovered_prob_geThere is a threshold such that the following holds for every . Let be coprime to and let be its multiplicative order modulo , the least with . Let be the power of with . Run Shor's order-finding procedure: prepare the state
apply the Fourier transform to the first register, measure, and round to the nearest fraction with denominator smaller than . Then the probability that the observed gives us (the rounded fraction has denominator in lowest terms) is at least
This is the paper's main claim about the quantum part of the factoring algorithm; combined with , it shows that repetitions find with high probability.
Formalization Note The probability of the event is , where is built by applying to the first register of (5.2); summing over all is exact, since values that are not powers of have probability . "Gives us " is yieldsOrder. The threshold comes first and is uniform in and ; it is inherited from the paper's per-state bound, which holds "for sufficiently large ". [NeZero n] makes finite.
import Mathlib import Definitions.Def_ShorAlgorithms_OrderFinding_outcomeProb import Definitions.Def_ShorAlgorithms_OrderFinding_yieldsOrder
namespace ShorAlgorithms.OrderFinding
open Classical in
/-- Shor (1997), §5, p. 1501 (goal). For all sufficiently large `n` (threshold `N` uniform in
`x` and `q`): let `x` be coprime to `n` with order `r`, and `q = 2^l` with `n² ≤ q < 2n²`.
Run the order-finding algorithm (state (5.2), Fourier transform `A_q` on the first register,
measurement). The probability that the observed `c` gives us `r` by rounding `c/q` to the
nearest fraction with denominator smaller than `n` is at least `φ(r)/(3r)`. -/
theorem order_recovered_prob_ge : ∃ N : ℕ, ∀ (n : ℕ) [NeZero n], N ≤ n →
∀ x : ℕ, Nat.Coprime x n → ∀ q l : ℕ, q = 2 ^ l → n ^ 2 ≤ q → q < 2 * n ^ 2 →
(Nat.totient (orderOf (x : ZMod n)) : ℝ) / (3 * (orderOf (x : ZMod n) : ℝ)) ≤
∑ c ∈ (Finset.univ : Finset (Fin q)).filter
(fun c : Fin q => yieldsOrder n q (orderOf (x : ZMod n)) (c : ℕ)),
∑ y : ZMod n, outcomeProb n x q c y := by sorry
end ShorAlgorithms.OrderFinding
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.