Residue-class subsequences of tree-safe words are tree-safe
ProvedErdos195.safe_residue_restrictA 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. For every modulus and residue : if is -safe, then the subsequence of letters of with is again -safe (for the same ).
The reason is that a residue class is closed under and , so open pairs and in-order -APs inside the class are unchanged. In particular the odd (or even) subsequence of a safe word is safe.
Formalization note: Lean % is Int.emod; the statement holds for all integers (trivially if the class is empty).
import Mathlib import Definitions.Def_Erdos195_tree
namespace Erdos195
theorem safe_residue_restrict (θ : ℕ → ℤ → Bool) (Q : List ℤ) (m c : ℤ) (hS : Safe (treeLt θ) Q) :
Safe (treeLt θ) (Q.filter (fun x => decide (x % m = c))) := by sorry
end Erdos195