AFTD Auto-Formalizing Theoretical Domains

recurrence_b_map

def

The state transition map T : (ℤ/3ℤ)^k → (ℤ/3ℤ)^k for recurrence (B), sending (w_0, ..., w_{k-1}) to (w_1, ..., w_{k-1}, w_0 + w_{k-1}^2).

Statement

def recurrence_b_map (k : ℕ) (w : Fin k → ZMod 3) : Fin k → ZMod 3
Defined in
arXiv:2610.34300 Proposition 7
Verified
29 Oct 2026
Axioms
none listed
Used by 5

Read back from the Lean

recurrence_b_map defines a function which takes a natural number $k$ and a map $w : \mathrm{Fin}\ k \to \mathbb{Z}/3\mathbb{Z}$, and returns a map $\mathrm{Fin}\ k \to \mathbb{Z}/3\mathbb{Z}$. For each $i \in \mathrm{Fin}\ k$, the output at $i$ is: - $w(i + 1)$ if $i + 1 < k$; - $w(0) + (w(k - 1))^2$ otherwise (that is, when $i = k - 1$, where the operations are in $\mathbb{Z}/3\mathbb{Z}$).

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

/-- State transition map for recurrence B on (ZMod 3)^k. -/
def recurrence_b_map (k : ℕ) (w : Fin k → ZMod 3) : Fin k → ZMod 3 := fun i =>
  if h : (i : ℕ) + 1 < k then
    w ⟨i.val + 1, h⟩
  else
    w ⟨0, by omega⟩ + (w ⟨k - 1, by omega⟩)^2
See it in the graphDiscuss this resultChallenge it