Syracuse valuation vector and its sum
DefinitionsyracuseValuationFor a natural number , let denote the 2-adic valuation. The Syracuse valuation at is , the exponent of removed in one accelerated Collatz step. For , the valuation vector of length at records these valuations along the first Syracuse iterates:
and the valuation sum is the sum of its coordinates.
These are the basic random variables in Tao's analysis of Syracuse orbits (the heuristic is that they behave like independent geometric random variables of mean ), so they are shared infrastructure for any formalization of Proposition 1.9 and its consequences.
Formalization Note syrVal is Nat.factorization (3 * n + 1) 2, valVec is the vector above as a function on Fin n_0, and valSum is its coordinate sum. The Syracuse map itself is syracuseStep.
import Mathlib.Logic.Function.Iterate import Mathlib.Data.Nat.Factorization.Basic import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Definitions.Def_syracuseStep /-- The 2-adic valuation of `3n+1` (Tao 2022, section 1.2). -/ def syrVal (n : ℕ) : ℕ := Nat.factorization (3 * n + 1) 2 /-- The Syracuse valuation vector of length `n₀` (Tao 2022, (1.8)). -/ def valVec (n₀ : ℕ) (n : ℕ) : Fin n₀ → ℕ := fun j => syrVal (syracuseStep^[j.val] n) /-- The valuation-vector sum (Tao 2022, (1.4)). -/ def valSum (n₀ n : ℕ) : ℕ := Finset.sum Finset.univ (fun j => valVec n₀ n j)