Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Failure of the second backward step is located by level

Proved
Erdos195.second_step_failure_levels

by Ethan Cheung · Oct 24, 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: for x≠yx\ne yx=y with k=ν2(y−x)k=\nu_2(y-x)k=ν2​(y−x), x≺θyx\prec_\theta yx≺θ​y iff the kkk-th binary digit of xxx is 111 exactly when θ(k,x mod 2k)=1\theta(k,x \bmod 2^k)=1θ(k,xmod2k)=1. A finite word TTT of integers is θ\thetaθ-safe if the sequence "letters of TTT in order, then all remaining integers in ≺θ\prec_\theta≺θ​-order" has no monotone 4-term arithmetic progression (positions are first occurrences); TTT is tree-safe if it is θ\thetaθ-safe for some θ\thetaθ. For an in-order pair (a,b)(a,b)(a,b) of TTT (aaa before bbb) call 2b−a2b-a2b−a its third term and 3b−2a3b-2a3b−2a its fourth term. An open path in TTT is a family of in-order pairs (ai,bi)(a_i,b_i)(ai​,bi​), 0≤i<m0\le i<m0≤i<m, m≥1m\ge1m≥1, with 3bi−2ai=2bi+1−ai+13b_i-2a_i=2b_{i+1}-a_{i+1}3bi​−2ai​=2bi+1​−ai+1​ for i<m−1i<m-1i<m−1 and no third term 2bi−ai2b_i-a_i2bi​−ai​ in TTT. Its sink fourth term w′=3bm−1−2am−1w'=3b_{m-1}-2a_{m-1}w′=3bm−1​−2am−1​ is a true-sink fourth term of TTT if w′∉Tw'\notin Tw′∈/T and every in-order pair (x,y)(x,y)(x,y) of TTT with 2y−x=w′2y-x=w'2y−x=w′ has 3y−2x∈T3y-2x\in T3y−2x∈T (condition C1 for appending w′w'w′).

Theorem. Let TTT be a finite word, b∈Tb\in Tb∈T, a≠ba\ne ba=b, k=ν2(b−a)k=\nu_2(b-a)k=ν2​(b−a), w=3b−2a∉Tw=3b-2a\notin Tw=3b−2a∈/T, t=2b−a∉Tt=2b-a\notin Tt=2b−a∈/T, and let Q=T wQ=T\,wQ=Tw be θ\thetaθ-safe. Assume ttt passes C1 in QQQ (every in-order pair (x,y)(x,y)(x,y) of QQQ with 2y−x=t2y-x=t2y−x=t has 3y−2x∈Q3y-2x\in Q3y−2x∈Q). If Q tQ\,tQt is not tree-safe for any witness, then there exist x∈Tx\in Tx∈T with (x,t)(x,t)(x,t) fully open in Q tQ\,tQt (2t−x, 3t−2x∉Q2t-x,\,3t-2x\notin Q2t−x,3t−2x∈/Q) and a fully open in-order pair (a′,b′)(a',b')(a′,b′) of QQQ (third and fourth terms not in QQQ, neither equal to ttt) at the same level j=ν2(b′−a′)=ν2(t−x)j=\nu_2(b'-a')=\nu_2(t-x)j=ν2​(b′−a′)=ν2​(t−x) and node a′≡x(mod2j)a'\equiv x\pmod{2^j}a′≡x(mod2j) with opposite digits of b′b'b′ and ttt at level jjj; moreover exactly one of:

  1. (high) j>kj>kj>k and x≡a(mod2k+1)x\equiv a\pmod{2^{k+1}}x≡a(mod2k+1);
  2. (level kkk) j=kj=kj=k, x≡b(mod2k+1)x\equiv b\pmod{2^{k+1}}x≡b(mod2k+1), and the kkk-th digits of b′b'b′ and bbb agree (the blocker has the orientation of (a,b)(a,b)(a,b));
  3. (low) j<kj<kj<k and www is already released at xxx in TTT: 2w−x∈T2w-x\in T2w−x∈T or 3w−2x∈T3w-2x\in T3w−2x∈T.

The low case uses that b,t,wb,t,wb,t,w agree modulo 2k2^k2k, so below level kkk the pair (x,w)(x,w)(x,w) of QQQ would sit at the same node with the orientation of (x,t)(x,t)(x,t) and conflict with (a′,b′)(a',b')(a′,b′) unless released. This covers blockers among old pairs of TTT as well as new pairs (x′,w)(x',w)(x′,w), extending milestone #161 (new pairs only, level kkk) towards a full criterion for the second step of #158–#159.

Preamble
import Mathlib
import Definitions.Def_Erdos195_tree
Formal statement
namespace Erdos195

theorem second_step_failure_levels (θ : ℕ → ℤ → Bool) (T : List ℤ) (a b : ℤ) (hab : a ≠ b)
    (hb : b ∈ T) (hwT : 3 * b - 2 * a ∉ T) (htT : 2 * b - a ∉ T)
    (hS : Safe (treeLt θ) (T ++ [3 * b - 2 * a]))
    (hC1 : ∀ x y : ℤ, x ∈ T ++ [3 * b - 2 * a] → y ∈ T ++ [3 * b - 2 * a] →
      (T ++ [3 * b - 2 * a]).idxOf x < (T ++ [3 * b - 2 * a]).idxOf y →
      2 * b - a = 2 * y - x → 3 * y - 2 * x ∈ T ++ [3 * b - 2 * a])
    (hbad : ¬ ∃ θ' : ℕ → ℤ → Bool, Safe (treeLt θ') (T ++ [3 * b - 2 * a] ++ [2 * b - a])) :
    ∃ x a' b' : ℤ, x ∈ T ∧ 2 * (2 * b - a) - x ∉ T ++ [3 * b - 2 * a] ∧
      3 * (2 * b - a) - 2 * x ∉ T ++ [3 * b - 2 * a] ∧
      a' ∈ T ++ [3 * b - 2 * a] ∧ b' ∈ T ++ [3 * b - 2 * a] ∧
      (T ++ [3 * b - 2 * a]).idxOf a' < (T ++ [3 * b - 2 * a]).idxOf b' ∧
      2 * b' - a' ∉ T ++ [3 * b - 2 * a] ∧ 3 * b' - 2 * a' ∉ T ++ [3 * b - 2 * a] ∧
      2 * b - a ≠ 2 * b' - a' ∧ 2 * b - a ≠ 3 * b' - 2 * a' ∧
      padicValInt 2 (b' - a') = padicValInt 2 ((2 * b - a) - x) ∧
      a' % 2 ^ padicValInt 2 (b' - a') = x % 2 ^ padicValInt 2 (b' - a') ∧
      ¬ (bitOne b' (padicValInt 2 (b' - a')) ↔ bitOne (2 * b - a) (padicValInt 2 (b' - a'))) ∧
      ((padicValInt 2 (b - a) < padicValInt 2 (b' - a') ∧
          x % 2 ^ (padicValInt 2 (b - a) + 1) = a % 2 ^ (padicValInt 2 (b - a) + 1)) ∨
        (padicValInt 2 (b' - a') = padicValInt 2 (b - a) ∧
          x % 2 ^ (padicValInt 2 (b - a) + 1) = b % 2 ^ (padicValInt 2 (b - a) + 1) ∧
          (bitOne b' (padicValInt 2 (b - a)) ↔ bitOne b (padicValInt 2 (b - a)))) ∨
        (padicValInt 2 (b' - a') < padicValInt 2 (b - a) ∧
          (2 * (3 * b - 2 * a) - x ∈ T ∨ 3 * (3 * b - 2 * a) - 2 * x ∈ T))) := 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 24 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