A safe word in one residue class mod absorbs any finite set outside it
ProvedErdos195.epsLt_residue_insertFix and the -adic total order on given by iff and the -th two's-complement digit of equals , where . A finite word of distinct integers is -safe if the sequence "the letters of in order, then all remaining integers in -order" contains no monotone -term arithmetic progression. Let , , and let be an -safe word all of whose letters are . Define by for and for . Then every finite set of integers can be listed as so that
In particular a word supported on a single residue class mod can absorb any finite set of targets outside that class (e.g. a word of even integers can absorb any finite set of odd integers), at the cost of changing only the first digits of . This is a step towards extension lemmas for constructing -AP-free permutations of (Erdős Problem 195).
Formalization note: Safe, epsLt are from Definitions.Def_Erdos195_defs; is written as fun k => if k < m then decide (r / 2 ^ k % 2 = 0) else ε k; is a duplicate-free list and the ordering is a permutation S' of it; prefixes are S'.take j.
import Mathlib import Definitions.Def_Erdos195_defs
namespace Erdos195
theorem epsLt_residue_insert (ε : ℕ → Bool) (m : ℕ) (r : ℤ) (P : List ℤ)
(hS : Safe (epsLt ε) P) (hP : ∀ p ∈ P, (2 : ℤ) ^ m ∣ p - r)
(S : List ℤ) (hSnd : S.Nodup) (hSr : ∀ s ∈ S, ¬ (2 : ℤ) ^ m ∣ s - r) :
∃ S' : List ℤ, S'.Perm S ∧
(∀ s ∈ S, ∀ p ∈ P,
epsLt (fun k => if k < m then decide (r / 2 ^ k % 2 = 0) else ε k) s p) ∧
∀ j : ℕ, Safe (epsLt (fun k => if k < m then decide (r / 2 ^ k % 2 = 0) else ε k))
(P ++ S'.take j) := by sorry
end Erdos195