Tree Extension Lemma for every two-letter prefix (at most one helper)
ProvedErdos195.two_letter_tree_extensionA tree witness is a function on the nodes , , of the binary tree of residues. For distinct integers with , put iff (two's-complement digits). A finite word of integers is -safe if the sequence "the letters of in order, then all remaining integers in -order" contains no monotone -term arithmetic progression. Let be pairwise distinct integers, , . Then for some tree witness the word
is -safe. This is the Tree Extension Lemma for all two-letter prefixes, with at most one helper letter; it includes the case , , that needs at least two helpers for -orders.
Formalization note: treeLt θ is from Definitions.Def_Erdos195_tree; Safe, bitOne, No3AP, Star, HasMonotoneAP are from Definitions.Def_Erdos195_defs. Positions in a word are List.idxOf; is padicValInt 2.
import Mathlib import Definitions.Def_Erdos195_tree
namespace Erdos195
theorem two_letter_tree_extension (a b t : ℤ) (hab : a ≠ b) (hat : a ≠ t) (hbt : b ≠ t) :
∃ θ : ℕ → ℤ → Bool, Safe (treeLt θ)
(if padicValInt 2 (b - a) = padicValInt 2 (t - b) then [a, b, 2 * t - b, t]
else [a, b, t]) := by sorry
end Erdos195