Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

§5, p. 1498 — mod an odd prime power, at most half the units have a given 2-part of their order

Proved
ShorAlgorithms.Reduction.card_twoAdic_le_half

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

cyclic-groupsnumber-theoryorder-findingp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let ppp be an odd prime, α≥1\alpha \ge 1α≥1, and e≥0e \ge 0e≥0. Among the φ(pα)\varphi(p^\alpha)φ(pα) units modulo pαp^\alphapα, at most half have order rrr with 2e2^e2e the largest power of 222 dividing rrr:

2⋅#{x∈(Z/pα)×:ν2(ord⁡(x))=e}≤φ(pα).2 \cdot \#\bigl\{x \in (\mathbb{Z}/p^\alpha)^\times : \nu_2(\operatorname{ord}(x)) = e\bigr\} \le \varphi(p^\alpha).2⋅#{x∈(Z/pα)×:ν2​(ord(x))=e}≤φ(pα).

Equivalently, a uniformly random unit modulo pαp^\alphapα has a prescribed 2-part of its order with probability at most 1/21/21/2. The page derives this from the cyclicity of the unit group modulo an odd prime power.

Formalization Note The count is Nat.card of the subtype of units whose order has 2-adic valuation e (padicValNat 2); orders of units are positive, so the valuation convention padicValNat 2 0 = 0 is never reached.

Preamble
import Mathlib
Formal statement
namespace ShorAlgorithms.Reduction

/-- Shor (1997), §5, p. 1498: for an odd prime power `p^α` (`α ≥ 1`), at most half of the units
mod `p^α` have a prescribed power `2^e` as the largest power of 2 dividing their order. -/
theorem card_twoAdic_le_half (p α e : ℕ) (hp : p.Prime) (hodd : Odd p) (hα : 1 ≤ α) :
    2 * Nat.card {u : (ZMod (p ^ α))ˣ // padicValNat 2 (orderOf u) = e}
      ≤ Nat.totient (p ^ α) := 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, "The multiplicative group (mod p^α) for any odd prime power p^α is cyclic [Knuth 1981], so for the odd prime power p_i^{α_i}, the probability is at most 1/2 of choosing an x_i having a particular power of 2 as the largest divisor of its order r_i."
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