§5, p. 1498 — the 2-parts of all k local orders agree with probability at most 1/2^{k−1}
ProvedShorAlgorithms.Reduction.card_all_agree_lechinese-remainder-theoremnumber-theoryorder-findingp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1
Let be odd with distinct prime factors , and for a unit modulo let be the order of . Then the proportion of units for which is at most :
By the Chinese remainder theorem a uniform unit modulo corresponds to independent uniform units modulo each , and each successive 2-part agrees with the previous ones with probability at most .
Formalization Note is n.primeFactors.card, which is at least for , so k - 1 does not truncate. The event is "the 2-adic valuations of localOrder n u p coincide for all p, q ∈ n.primeFactors".
Preamble
import Mathlib import Definitions.Def_ShorAlgorithms_Reduction_localOrder
Formal statement
namespace ShorAlgorithms.Reduction
/-- Shor (1997), §5, p. 1498: for odd `n > 1` with `k` distinct prime factors, the units `x`
for which the 2-adic valuations of all the local orders `r_p` agree form a proportion at most
`1/2^{k-1}` of the `φ(n)` units mod `n`. -/
theorem card_all_agree_le (n : ℕ) (hodd : Odd n) (hn : 1 < n) :
2 ^ (n.primeFactors.card - 1) *
Nat.card {u : (ZMod n)ˣ // ∀ p ∈ n.primeFactors, ∀ q ∈ n.primeFactors,
padicValNat 2 (localOrder n u p) = padicValNat 2 (localOrder n u q)}
≤ Nat.totient n := by sorry
end ShorAlgorithms.Reduction
Source
Shor, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer, SIAM J. Comput. 26(5) (1997), p. 1498, §5, "Thus each of these powers of 2 has at most a 50% probability of agreeing with the previous ones, so all k of them agree with probability at most 1/2^{k−1}."
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.