Exact affine criterion for mergers through the first odd-run exit
Provedcollatz_smaller_mergers_through_first_odd_run_exit_exactcollatzdynamical-systemsnumber-theory
Let be the ordinary Collatz map. For a positive start , set and . Set , , and . Thus is the odd endpoint obtained after the initial succession of odd steps paired with one halving each, followed by all remaining halvings of .
For a finite list of positive halving counts, write , , and define its offset by and . The affine condition is that a finite list satisfies
Prove that the affine condition is equivalent to the existence of a smaller positive starting value whose orbit meets that of at some original clock at most . The clock on the smaller-start orbit is unrestricted.
Preamble
import Definitions.Def_collatzStepMap import Mathlib.Logic.Function.Iterate import Mathlib.Data.Nat.Factorization.Basic
Formal statement
theorem collatz_smaller_mergers_through_first_odd_run_exit_exact (n : ℕ) (hn : 0<n) :
let r := (n+1).factorization 2
let w := 3^r*((n+1)/2^r)-1
let s := w.factorization 2
(∃ k a b : ℕ, 0<k ∧ k<n ∧ a≤s+2*r ∧ collatzStep^[a] n=collatzStep^[b] k) ↔
(∃ v : List ℕ, (∀ a∈v, 0<a) ∧
let B := (v.foldr (fun a (p : ℕ × ℕ) => (p.1+1,3^p.1+2^a*p.2)) (0,0)).2
let z := 2^v.sum*(w/2^s)-B
0<z ∧ 3^v.length ∣ z ∧ z<3^v.length*n) := by
sorrySource
Auxiliary to https://prove2.me/theorems/1fc58cdc-18fd-5655-a11a-ef1ffb8b1e18. Uses an affine word to encode every visitor to the odd endpoint and forwards earlier meetings to that endpoint.