AFTD Auto-Formalizing Theoretical Domains

is_eventual_period

def

A positive integer $p$ is an eventual period of a sequence $w : \mathbb{N} \to \text{Bool}$ if there exists $N \in \mathbb{N}$ such that $w(n + p) = w(n)$ for all $n \ge N$.

Statement

def is_eventual_period (w : ℕ → Bool) (p : ℕ) : Prop
Defined in
folklore
Verified
08 Nov 2026
Axioms
none listed
Used by 4

Read back from the Lean

For a sequence of Booleans w : ℕ → Bool and a natural number p : ℕ, is_eventual_period w p asserts that p > 0 and there exists a natural number N such that for all natural numbers n ≥ N, w (n + p) = w n.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- A positive integer p is an eventual period of a binary sequence w if w repeats with period p from some point onwards. -/
def is_eventual_period (w : ℕ → Bool) (p : ℕ) : Prop := 0 < p ∧ ∃ N : ℕ, ∀ n ≥ N, w (n + p) = w n
See it in the graphDiscuss this resultChallenge it