Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Appending a large auxiliary letter that follows the committed path keeps a released tree-safe word safe and released

Proved
Erdos195.large_aux_append

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

arithmetic-progressionscombinatoricserdos-problems

A tree witness is a function θ(k,r)∈{0,1}\theta(k,r)\in\{0,1\}θ(k,r)∈{0,1} on the nodes (k,r)(k,r)(k,r), 0≤r<2k0\le r<2^k0≤r<2k, of the binary tree of residues. For distinct integers x,yx,yx,y with k=ν2(y−x)k=\nu_2(y-x)k=ν2​(y−x), put x≺θyx\prec_\theta yx≺θ​y iff bitk(x)=θ(k, x mod 2k)\mathrm{bit}_k(x)=\theta(k,\,x\bmod 2^k)bitk​(x)=θ(k,xmod2k). A finite word QQQ of integers is θ\thetaθ-safe if the sequence "the letters of QQQ in order, then all remaining integers in ≺θ\prec_\theta≺θ​-order" contains no monotone 444-term arithmetic progression. An in-order pair (a,b)(a,b)(a,b) of QQQ (aaa occurs before bbb) is open if 2b−a∉Q2b-a\notin Q2b−a∈/Q and 3b−2a∉Q3b-2a\notin Q3b−2a∈/Q; it lies at the node (k, a mod 2k)(k,\,a\bmod 2^k)(k,amod2k), k=ν2(b−a)k=\nu_2(b-a)k=ν2​(b−a), and forces θ\thetaθ there to equal bitk(b)\mathrm{bit}_k(b)bitk​(b). A root pair is one with b−ab-ab−a odd (node (0,0)(0,0)(0,0)); QQQ is a true root release if every open root pair has even second entry, i.e. no open pair forces the value 111 at the root. Let QQQ be θ\thetaθ-safe and a true root release, with θ(0,0)=0\theta(0,0)=0θ(0,0)=0. Suppose every open in-order pair (a,b)(a,b)(a,b) of QQQ has ν2(b−a)≤L\nu_2(b-a)\le Lν2​(b−a)≤L, ∣a∣≤R|a|\le R∣a∣≤R for all a∈Qa\in Qa∈Q, and zzz is an integer with ∣z∣>3R|z|>3R∣z∣>3R that follows the committed path: θ(h, z mod 2h)=bith(z)\theta(h,\,z\bmod 2^h)=\mathrm{bit}_h(z)θ(h,zmod2h)=bith​(z) for all h≤Lh\le Lh≤L. Then Q zQ\,zQz (the word QQQ with zzz appended) is θ′\theta'θ′-safe and a true root release for the tree witness θ′\theta'θ′ that agrees with θ\thetaθ on all levels ≤L\le L≤L (in the Lean proof, θ′(k,r)=bitk(z)\theta'(k,r)=\mathrm{bit}_k(z)θ′(k,r)=bitk​(z) for k>Lk>Lk>L). Because ∣z∣>3R|z|>3R∣z∣>3R, zzz is not a 333-AP completion of letters of QQQ, and no 333-AP (a,b,z)(a,b,z)(a,b,z) or (a,z,⋅)(a,z,\cdot)(a,z,⋅) lies inside Q zQ\,zQz. Every new open pair (a,z)(a,z)(a,z) forces θ′\theta'θ′ at its node to equal bit(z)\mathrm{bit}(z)bit(z), which agrees with the committed values on levels ≤L\le L≤L and defines the values above. A new root pair has z−az-az−a odd, and the path condition at the root (θ(0,0)=0\theta(0,0)=0θ(0,0)=0) makes zzz even, so the release is preserved.

Formalization note: treeLt θ is from Definitions.Def_Erdos195_tree; Safe, bitOne are from Definitions.Def_Erdos195_defs. Positions are List.idxOf; the release property is stated as: every open in-order pair (a,b)(a,b)(a,b) with (b−a) mod 2=1(b-a) \bmod 2 = 1(b−a)mod2=1 has b mod 2=0b \bmod 2 = 0bmod2=0.

Preamble
import Mathlib
import Definitions.Def_Erdos195_tree
Formal statement
namespace Erdos195

theorem large_aux_append (θ : ℕ → ℤ → Bool) (Q : List ℤ) (L : ℕ) (R z : ℤ)
    (hS : Safe (treeLt θ) Q)
    (hrel : ∀ a b : ℤ, a ∈ Q → b ∈ Q → Q.idxOf a < Q.idxOf b → 2 * b - a ∉ Q →
      3 * b - 2 * a ∉ Q → (b - a) % 2 = 1 → b % 2 = 0)
    (hroot : θ 0 0 = false)
    (hdepth : ∀ a b : ℤ, a ∈ Q → b ∈ Q → Q.idxOf a < Q.idxOf b → 2 * b - a ∉ Q →
      3 * b - 2 * a ∉ Q → padicValInt 2 (b - a) ≤ L)
    (hR : ∀ a ∈ Q, |a| ≤ R)
    (hz : 3 * R < |z|)
    (hpath : ∀ h ≤ L, (θ h (z % 2 ^ h) = true ↔ bitOne z h)) :
    ∃ θ' : ℕ → ℤ → Bool, (∀ k ≤ L, ∀ r, θ' k r = θ k r) ∧
      Safe (treeLt θ') (Q ++ [z]) ∧
      ∀ a b : ℤ, a ∈ Q ++ [z] → b ∈ Q ++ [z] → (Q ++ [z]).idxOf a < (Q ++ [z]).idxOf b →
        2 * b - a ∉ Q ++ [z] → 3 * b - 2 * a ∉ Q ++ [z] → (b - a) % 2 = 1 → b % 2 = 0 := by sorry

end Erdos195
Source
Erdős Problem 195 (https://www.erdosproblems.com/195); tree-witness framework; batch words by Sol, 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