Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Escape chains terminate: o + 3^n(w−o) ends in a reflection or precedes o (root bit 1)

Proved
Erdos195.escape_chain_terminates

by Ethan Cheung Wang · Oct 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

arithmetic-progressionscombinatoricserdos-problems

A tree witness θ:N×Z→{0,1}\theta:\mathbb N\times\mathbb Z\to\{0,1\}θ:N×Z→{0,1} defines a strict total order ≺θ\prec_\theta≺θ​ on Z\mathbb ZZ (milestone framework); it satisfies Ho's identity (∗)(*)(∗): x≺x+r  ⟺  x+2r≺x+3rx\prec x+r \iff x+2r\prec x+3rx≺x+r⟺x+2r≺x+3r. A finite word QQQ of integers is θ\thetaθ-safe if the sequence "letters of QQQ in order, then all remaining integers in ≺θ\prec_\theta≺θ​-order" has no monotone 4-term arithmetic progression; positions are first occurrences. With root bit θ(0,0)=1\theta(0,0)=1θ(0,0)=1, every odd ooo before an even vvv is either reflected (2v−o2v-o2v−o occurs before vvv) or escapes (3v−2o3v-2o3v−2o occurs). The escape 3v−2o3v-2o3v−2o is again even.

Theorem (escape chains terminate). Let θ(0,0)=1\theta(0,0)=1θ(0,0)=1, let QQQ be θ\thetaθ-safe, and let ooo odd come before www even in QQQ. Put em=o+3m(w−o)e_m=o+3^m(w-o)em​=o+3m(w−o), so e0=we_0=we0​=w and em+1=3em−2oe_{m+1}=3e_m-2oem+1​=3em​−2o is the escape of ooo at eme_mem​. Then there is n≥0n\ge 0n≥0 such that e0,…,en∈Qe_0,\dots,e_n\in Qe0​,…,en​∈Q, ooo comes before each of e0,…,en−1e_0,\dots,e_{n-1}e0​,…,en−1​, and either (i) ooo comes before ene_nen​ and 2en−o∈Q2e_n-o\in Q2en​−o∈Q comes before ene_nen​ (a genuine reflection), or (ii) n>0n>0n>0 and ene_nen​ comes before ooo.

So escapes cannot be used indefinitely. Each inverted (odd, even) pair starts a geometric chain of escapes with ratio 3 about ooo, and the chain must end in a reflection or in a letter placed before ooo. In particular, if no even letter precedes ooo, some ene_nen​ is genuinely reflected. This is a structural lemma for Erdős #195, not a construction or an impossibility result.

Formalization note: words are List ℤ, positions via List.idxOf, safety is Safe (treeLt θ).

Preamble
import Mathlib
import Definitions.Def_Erdos195_tree
Formal statement
namespace Erdos195

theorem escape_chain_terminates (θ : ℕ → ℤ → Bool) (h00 : θ 0 0 = true) (Q : List ℤ)
    (hS : Safe (treeLt θ) Q) (o w : ℤ) (ho : o ∈ Q) (hw : w ∈ Q) (hoo : o % 2 = 1)
    (hwe : w % 2 = 0) (hi : Q.idxOf o < Q.idxOf w) :
    ∃ n : ℕ, (∀ m ≤ n, o + 3 ^ m * (w - o) ∈ Q) ∧
      (∀ m < n, Q.idxOf o < Q.idxOf (o + 3 ^ m * (w - o))) ∧
      ((Q.idxOf o < Q.idxOf (o + 3 ^ n * (w - o)) ∧
          2 * (o + 3 ^ n * (w - o)) - o ∈ Q ∧
          Q.idxOf (2 * (o + 3 ^ n * (w - o)) - o) < Q.idxOf (o + 3 ^ n * (w - o))) ∨
        (0 < n ∧ Q.idxOf (o + 3 ^ n * (w - o)) < Q.idxOf o)) := by sorry

end Erdos195
Source
Erdős Problem 195 (https://www.erdosproblems.com/195); tree-witness framework; Lean-verified by Grok Bot for Ethan Cheung (Oct 23 2026)

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me