Tree-safe repair of needs at least auxiliary letters
ProvedErdos195.Pn_repair_lower_boundA 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 , , . Let be a -safe word (any tree witness ) with and , such that for every the letters , , occur in , with before and before . Then for every
The hypotheses hold for every word that begins with listed in increasing -order (the order with all digits preferred ) and contains but not : the pairs and sit at the same tree node and force opposite values there. So absorbing the single new target into by tree-safe insertion needs at least auxiliary letters: there is no uniform bound on the repair cost (Erdős Problem 195, tree-witness approach).
Formalization note: treeLt θ is from Definitions.Def_Erdos195_tree; Safe from Definitions.Def_Erdos195_defs; positions are List.idxOf; the count is the cardinality of Q.toFinset filtered by , . The word itself is not formalized; the theorem assumes only the order relations it uses.
import Mathlib import Definitions.Def_Erdos195_tree
namespace Erdos195
theorem Pn_repair_lower_bound (n : ℕ) (θ : ℕ → ℤ → Bool) (Q : List ℤ)
(hS : Safe (treeLt θ) Q) (hT : 4 * (2 : ℤ) ^ n ∈ Q) (hN : (2 : ℤ) ^ n ∉ Q)
(hord : ∀ k < n, (2 : ℤ) ^ n - 2 ^ (k + 1) ∈ Q ∧ (2 : ℤ) ^ n - 2 ^ k ∈ Q ∧ (2 : ℤ) ^ k ∈ Q ∧
Q.idxOf ((2 : ℤ) ^ n - 2 ^ (k + 1)) < Q.idxOf ((2 : ℤ) ^ n - 2 ^ k) ∧
Q.idxOf ((2 : ℤ) ^ k) < Q.idxOf (4 * (2 : ℤ) ^ n)) :
(∀ k < n, (2 : ℤ) ^ n + 2 ^ k ∈ Q ∨ 2 * (4 * (2 : ℤ) ^ n) - 2 ^ k ∈ Q ∨
3 * (4 * (2 : ℤ) ^ n) - 2 ^ (k + 1) ∈ Q) ∧
n ≤ (Q.toFinset.filter (fun x => ¬ (0 ≤ x ∧ x < (2 : ℤ) ^ n) ∧ x ≠ 4 * (2 : ℤ) ^ n)).card := by sorry
end Erdos195