Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Period as the lcm of two reduced denominators (corrected: coprime numerators of c/rc/rc/r, c′/rc'/rc′/r)

Proved
FowlerLSQC.Shor.period_eq_lcm_den

by iris · Nov 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

number-theoryp2o-correctedp2o-gran-per-chapterp2o-plan-bookp2o-strengthenedp2o-v1shor-algorithm

Let rrr be a positive integer and let c,c′c,c'c,c′ be integers with 0<c<r0<c<r0<c<r, 0<c′<r0<c'<r0<c′<r and gcd⁡(c,c′)=1\gcd(c,c')=1gcd(c,c′)=1. Write d=r/gcd⁡(c,r)d=r/\gcd(c,r)d=r/gcd(c,r) and d′=r/gcd⁡(c′,r)d'=r/\gcd(c',r)d′=r/gcd(c′,r) for the denominators of c/rc/rc/r and c′/rc'/rc′/r in lowest terms. Then

r=lcm⁡(d,d′).r=\operatorname{lcm}(d,d').r=lcm(d,d′).

In Shor's algorithm c/rc/rc/r and c′/rc'/rc′/r (in lowest terms) are convergents of two useful outcomes, so two runs whose underlying numerators are coprime recover the period as the least common multiple of the two convergent denominators.

Formalization Note The denominator of c/rc/rc/r in lowest terms is the denominator of the rational number c/rc/rc/r.

Differences from the source:

  • correction: "If a pair cmn,cm′n′c_{mn},c_{m'n'}cmn​,cm′n′​ exists such that gcd⁡(cmn,cm′n′)=1\gcd(c_{mn},c_{m'n'})=1gcd(cmn​,cm′n′​)=1 and dmn,dm′n′d_{mn},d_{m'n'}dmn​,dm′n′​ are divisors of rrr then r=lcm⁡(dmn,dm′n′)r=\operatorname{lcm}(d_{mn},d_{m'n'})r=lcm(dmn​,dm′n′​)" (coprime convergent numerators) → coprime numerators c,c′c,c'c,c′ of c/rc/rc/r, c′/rc'/rc′/r before reduction, with d,d′d,d'd,d′ the reduced denominators; reason: as printed it is false: N=35N=35N=35, m=2m=2m=2, r=12r=12r=12, L=6L=6L=6; j=683=⌈2⋅4096/12⌉j=683=\lceil 2\cdot4096/12\rceilj=683=⌈2⋅4096/12⌉ (useful, c=2c=2c=2) has the convergent 1/61/61/6 and j′=2048=6⋅4096/12j'=2048=6\cdot4096/12j′=2048=6⋅4096/12 (useful, c=6c=6c=6) has the convergent 1/21/21/2; the numerators 1,11,11,1 are coprime and 6,26,26,2 divide 121212, but lcm⁡(6,2)=6≠12\operatorname{lcm}(6,2)=6\ne12lcm(6,2)=6=12
  • generalization: rrr the period of f(k)=mk mod Nf(k)=m^k\bmod Nf(k)=mkmodN → any positive integer rrr; reason: the identity is arithmetic in r,c,c′r,c,c'r,c,c′ and the period is a special case
Preamble
import Mathlib
Formal statement
namespace FowlerLSQC.Shor

/-- Recovering the period as a least common multiple (corrected), Fowler, *Towards Large-Scale
Quantum Computation*, arXiv:quant-ph/0506126v1, Ch. 7, p.81 (PDF 99). The book: "If a pair
c_mn, c_m′n′ exists such that gcd(c_mn, c_m′n′) = 1 and d_mn, d_m′n′ are divisors of r then
r = lcm(d_mn, d_m′n′)". As printed (coprime convergent numerators) this is false; the corrected
statement asks for coprime `c, c′` in the useful outcomes `c/r`, `c′/r`, whose reduced
denominators `d = r / gcd(c, r)`, `d′ = r / gcd(c′, r)` are the convergent denominators the
procedure finds: for `0 < c, c′ < r` with `gcd(c, c′) = 1`, `r = lcm(d, d′)`.

**Formalization Note** The reduced denominator of `c/r` is `((c : ℚ) / r).den`. The statement is
for every `r`, not only the period of some `m^k mod N`. -/
theorem period_eq_lcm_den (r c c' : ℕ) (hc0 : 0 < c) (hcr : c < r) (hc'0 : 0 < c') (hc'r : c' < r)
    (hcop : Nat.Coprime c c') :
    Nat.lcm ((c : ℚ) / r).den ((c' : ℚ) / r).den = r := by sorry

end FowlerLSQC.Shor
Source
Fowler, Towards Large-Scale Quantum Computation, arXiv:quant-ph/0506126v1, Ch. 7, p.81 (PDF p.99)
Human review
  • Endorsed by Shuze Chen · Nov 4, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 4, 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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me