Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

p. 472 — every add-with-carry sequence is periodic after at most rrr iterations

Proved
CarryRNG.AWC.iterate_r_mem_periodicPts

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

add-with-carryp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1random-number-generation

Let b≥2b \ge 2b≥2 be a base, 0<s<r0 < s < r0<s<r lags, and fff the add-with-carry map. For every seed xxx, the state fr(x)f^r(x)fr(x) is a periodic point of fff: there is p≥1p \ge 1p≥1 with

fp(fr(x))=fr(x).f^{p}\bigl(f^r(x)\bigr) = f^r(x).fp(fr(x))=fr(x).

Hence the generated sequence x,f(x),f2(x),…x, f(x), f^2(x), \dotsx,f(x),f2(x),… is periodic from the rrr-th iterate on, possibly after a short preperiod: "after a few iterations (at most rrr), the periodic cycle begins". Without the bound rrr the statement would hold for any self-map of a finite set; the content is that the preperiod never exceeds rrr.

Formalization Note Periodicity is Mathlib's Function.periodicPts.

Preamble
import Mathlib
import Definitions.Def_CarryRNG_AWC_step
Formal statement
namespace CarryRNG.AWC

theorem iterate_r_mem_periodicPts (b : ℕ) (L : Lags) (hb : 2 ≤ b) (z : State b L.r) :
    (step b L)^[L.r] z ∈ Function.periodicPts (step b L) := by sorry

end CarryRNG.AWC
Source
G. Marsaglia and A. Zaman, A new class of random number generators, Ann. Appl. Probab. 1 (1991), p. 472, Section 4.5
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 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