§4.1 — the base- expansion of is strictly periodic with period the order of
ProvedCarryRNG.AWC.expansion_period_iffnumber-theoryp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1periodic-expansion
Let be a base and a modulus with , and let be a reduced residue, with . Write for the base- digits of after the point, and for the multiplicative order of modulo . Then for every ,
In words: the expansion of is strictly periodic (periodic from the first digit after the point on), and its least period is exactly . This is the number-theoretic fact through which the periods of the add-with-carry generators are computed: once the generated digits are identified with those of some , their period is the order of .
Formalization Note The order is orderOf (b : ZMod m). Stating the period as " is a period iff " pins down the least period, rather than only saying that is a period.
Preamble
import Mathlib import Definitions.Def_CarryRNG_AWC_digit
Formal statement
namespace CarryRNG.AWC
theorem expansion_period_iff (b m k : ℕ) (hb : 2 ≤ b) (hm : 1 < m) (hk : k < m)
(hkm : Nat.Coprime k m) (hbm : Nat.Coprime b m) (p : ℕ) (hp : 0 < p) :
(∀ j, 1 ≤ j → digit b m k (j + p) = digit b m k j) ↔ orderOf (b : ZMod m) ∣ p := by sorry
end CarryRNG.AWC
Source
G. Marsaglia and A. Zaman, A new class of random number generators, Ann. Appl. Probab. 1 (1991), p. 467, Section 4.1
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.