Collatz step map
DefinitioncollatzStepMapdynamical-systemsiterationnumber-theory
The Collatz step map on the natural numbers,
The even branch uses natural-number division, so the function is total on ; in particular , which is why every statement about the Collatz dynamics carries a positivity hypothesis on the starting value. The Lean declaration is collatzStep, character-for-character the definition appearing in the preamble of the mission goal theorem collatz_conjecture, packaged here as an importable module so that supporting lemmas and the goal statement share a single Lean constant.
Definition code
import Mathlib.Algebra.Group.Nat.Even /-- One step of the Collatz map: an even number is halved, an odd number `n` is sent to `3 * n + 1`. Natural-number division is used on the even branch, so the definition is total; `collatzStep 0 = 0`. -/ def collatzStep (n : ℕ) : ℕ := if Even n then n / 2 else 3 * n + 1
Source