§5, p. 1498 — the reduction fails only if the 2-parts of all the local orders r_i agree
ProvedShorAlgorithms.Reduction.twoAdic_eq_of_failLet be odd with prime factorization , let be a unit modulo and let be the order of . Write for the exponent of the largest power of dividing . If the procedure does not yield a nontrivial factor of at — that is, is odd or — then
Contrapositively, whenever two of the local orders have different 2-adic valuations, is a good choice. Combined with the estimate that the valuations all agree for at most a fraction of units, this gives the mission's goal.
Formalization Note Only the direction "failure implies agreement" is stated, which is the direction the page's "The algorithm only fails if all of these powers of 2 agree" asserts and the goal needs; the converse (also true for odd ) is the page's description of the two agreeing cases and is not part of this statement. Oddness of is needed: modulo a power of , and can coincide.
import Mathlib import Definitions.Def_ShorAlgorithms_Reduction_successEvent import Definitions.Def_ShorAlgorithms_Reduction_localOrder
namespace ShorAlgorithms.Reduction
/-- Shor (1997), §5, p. 1498: the algorithm only fails if the largest powers of 2 dividing the
local orders `r_i` all agree. For odd `n > 1` and a unit `x` for which the procedure does not
yield a nontrivial factor, the 2-adic valuations of `r_p` coincide for all prime factors `p`. -/
theorem twoAdic_eq_of_fail (n : ℕ) (hodd : Odd n) (hn : 1 < n) (u : (ZMod n)ˣ)
(hfail : ¬ successEvent n u) :
∀ p ∈ n.primeFactors, ∀ q ∈ n.primeFactors,
padicValNat 2 (localOrder n u p) = padicValNat 2 (localOrder n u q) := by sorry
end ShorAlgorithms.Reduction
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.