Odd affine maps transport tree orders and tree safety exactly
ProvedErdos195.safe_odd_affine_iffA tree witness is a function on the nodes of the binary tree of residues. For distinct integers with , put iff ( is the -th two's-complement binary digit). A finite word of integers is -safe if the completion "the letters of in order, then all remaining integers in -order" contains no monotone -term arithmetic progression (positions of increasing, ). Positions in are first occurrences. Let be an odd integer (of either sign) and any integer, and let . Call an -transport of if for every and every
Then (1) an -transport exists (it is unique on the residues , since is a bijection of ); and for every -transport : (2) is an order isomorphism, ; (3) for every finite word , is -safe iff is -safe.
So tree safety is exactly invariant under the odd affine group ; with this is the mirror , under which an open pair of at node becomes an open pair of at node . Together with the scaling lemma for this covers all maps .
Formalization note: the xor condition is written as ; % is Int.emod; bitOne x k is .
import Mathlib import Definitions.Def_Erdos195_tree
namespace Erdos195
theorem safe_odd_affine_iff (θ : ℕ → ℤ → Bool) (m s : ℤ) (hm : m % 2 = 1) :
(∃ θ' : ℕ → ℤ → Bool, ∀ (k : ℕ) (r : ℤ), 0 ≤ r → r < 2 ^ k →
(θ' k ((m * r + s) % 2 ^ k) = true ↔ (θ k r = true ↔ ¬ bitOne (m * r + s) k))) ∧
∀ θ' : ℕ → ℤ → Bool, (∀ (k : ℕ) (r : ℤ), 0 ≤ r → r < 2 ^ k →
(θ' k ((m * r + s) % 2 ^ k) = true ↔ (θ k r = true ↔ ¬ bitOne (m * r + s) k))) →
(∀ x y : ℤ, treeLt θ x y ↔ treeLt θ' (m * x + s) (m * y + s)) ∧
(∀ Q : List ℤ, Safe (treeLt θ) Q ↔ Safe (treeLt θ') (Q.map (fun x => m * x + s))) := by sorry
end Erdos195