Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Open paths close from the sink backwards: closing one pair forces the whole tail, fourth terms first

Proved
Erdos195.open_path_closes_backwards

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). 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. For an in-order pair (a,b)(a,b)(a,b) of a word (aaa before bbb), call t=2b−at=2b-at=2b−a its third term and w=3b−2aw=3b-2aw=3b−2a its fourth term. An open path in a word TTT is a family of in-order pairs (ai,bi)(a_i,b_i)(ai​,bi​), 0≤i<m0\le i<m0≤i<m, of letters of TTT with

3bi−2ai  =  2bi+1−ai+1(0≤i<m−1)3b_i-2a_i \;=\; 2b_{i+1}-a_{i+1}\qquad(0\le i<m-1)3bi​−2ai​=2bi+1​−ai+1​(0≤i<m−1)

(the fourth term of each pair is the third term of the next) and no third term 2bi−ai2b_i-a_i2bi​−ai​ in TTT. Theorem. Let TTT contain such an open path and let T⋅RT\cdot RT⋅R be θ\thetaθ-safe for some tree witness θ\thetaθ (any extension RRR). If the third term ti=2bi−ait_i=2b_i-a_iti​=2bi​−ai​ of some pair iii occurs in T⋅RT\cdot RT⋅R, then for every jjj with i≤j<mi\le j<mi≤j<m both tjt_jtj​ and wj=3bj−2ajw_j=3b_j-2a_jwj​=3bj​−2aj​ occur in T⋅RT\cdot RT⋅R, and wjw_jwj​ comes before tjt_jtj​.

Since wj=tj+1w_j=t_{j+1}wj​=tj+1​, the closing order is forced: wm−1w_{m-1}wm−1​ first, then tm−1,tm−2,…,tit_{m-1}, t_{m-2},\dots,t_itm−1​,tm−2​,…,ti​. So the tail of an open path can only be closed from the sink backwards. The reason is the tree criterion: an in-order pair whose third term appears later must already have its fourth term, placed before the third term. This is the acyclic counterpart of milestone 143 (open cycles never close): for a path the closure must start at the sink's fourth term wm−1w_{m-1}wm−1​. It is a structural lemma about the tree-witness approach to Erdős #195, not a construction or an impossibility result.

Formalization note: words are List ℤ, positions via List.idxOf, pairs are a b : ℕ → ℤ on indices i < m; safety is Safe (treeLt θ) (T ++ R).

Preamble
import Mathlib
import Definitions.Def_Erdos195_tree
Formal statement
namespace Erdos195

theorem open_path_closes_backwards (θ : ℕ → ℤ → Bool) (T R : List ℤ) (m : ℕ) (a b : ℕ → ℤ)
    (ha : ∀ i < m, a i ∈ T) (hb : ∀ i < m, b i ∈ T)
    (hi : ∀ i < m, T.idxOf (a i) < T.idxOf (b i))
    (hpath : ∀ i, i + 1 < m → 3 * b i - 2 * a i = 2 * b (i + 1) - a (i + 1))
    (ht : ∀ i < m, 2 * b i - a i ∉ T) (hS : Safe (treeLt θ) (T ++ R))
    (i : ℕ) (hti : 2 * b i - a i ∈ T ++ R) :
    ∀ j, i ≤ j → j < m →
      2 * b j - a j ∈ T ++ R ∧ 3 * b j - 2 * a j ∈ T ++ R ∧
        (T ++ R).idxOf (3 * b j - 2 * a j) < (T ++ R).idxOf (2 * b j - a j) := 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