Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Exterior records can be appended as the new tree-order minimum

Proved
Erdos195.exterior_record

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

arithmetic-progressionscombinatoricserdos-problems

Tree orders: for a tree witness θ(k,r)∈{0,1}\theta(k,r)\in\{0,1\}θ(k,r)∈{0,1} and distinct integers x,yx,yx,y with k=ν2(y−x)k=\nu_2(y-x)k=ν2​(y−x), 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 is θ\thetaθ-safe if "QQQ in order, then all other integers in ≺θ\prec_\theta≺θ​-order" has no monotone 444-term arithmetic progression; it is tree-safe if it is θ\thetaθ-safe for some θ\thetaθ. An in-order pair aaa before bbb in QQQ is open if 2b−a,3b−2a∉Q2b-a,3b-2a\notin Q2b−a,3b−2a∈/Q. Let P∗=(0,1,−1,−5)P^*=(0,1,-1,-5)P∗=(0,1,−1,−5). Let PPP be θ\thetaθ-safe, KKK larger than every ν2(b−a)\nu_2(b-a)ν2​(b−a) (a≠b∈Pa\ne b\in Pa=b∈P), p∈Pp\in Pp∈P the ≺θ\prec_\theta≺θ​-minimum of PPP, and w≡p+2K(mod2K+1)w\equiv p+2^K\pmod{2^{K+1}}w≡p+2K(mod2K+1) with w≠2b−aw\ne 2b-aw=2b−a for all aaa before bbb in PPP. Let θ′′\theta''θ′′ equal θ\thetaθ except θ′′(K,p mod 2K)=1−bitK(p)\theta''(K,p\bmod 2^K)=1-\mathrm{bit}_K(p)θ′′(K,pmod2K)=1−bitK​(p). Then

P⋅w is θ′′-safe and w≺θ′′a for all a∈P.P\cdot w\ \text{is}\ \theta''\text{-safe and}\ w\prec_{\theta''}a\ \text{for all}\ a\in P.P⋅w is θ′′-safe and w≺θ′′​a for all a∈P.

(Exterior records: a new letter in a fresh residue class at level KKK can be appended as the new minimum.)

Formalization note: treeLt is from Definitions.Def_Erdos195_tree; Safe, bitOne from Definitions.Def_Erdos195_defs; positions are List.idxOf, ν2\nu_2ν2​ is padicValInt 2, L <+: Q means LLL is a prefix of QQQ.

Preamble
import Mathlib
import Definitions.Def_Erdos195_tree
Formal statement
namespace Erdos195

theorem exterior_record (θ : ℕ → ℤ → Bool) (P : List ℤ) (hP : Safe (treeLt θ) P) (K : ℕ)
    (hK : ∀ a ∈ P, ∀ b ∈ P, a ≠ b → padicValInt 2 (b - a) < K) (p : ℤ) (hp : p ∈ P)
    (hmin : ∀ a ∈ P, a ≠ p → treeLt θ p a) (w : ℤ)
    (hw : w % 2 ^ (K + 1) = (p + 2 ^ K) % 2 ^ (K + 1))
    (hw2 : ∀ a b : ℤ, a ∈ P → b ∈ P → P.idxOf a < P.idxOf b → w ≠ 2 * b - a) :
    Safe (treeLt (fun k r => if k = K ∧ r = p % 2 ^ K then !decide (p / 2 ^ K % 2 = 1) else θ k r))
        (P ++ [w]) ∧
      ∀ a ∈ P, treeLt (fun k r => if k = K ∧ r = p % 2 ^ K then !decide (p / 2 ^ K % 2 = 1)
        else θ k r) w a := by sorry

end Erdos195
Source
Erdős Problem 195 (https://www.erdosproblems.com/195); statement from GPT 6 Astra (Oct 23 2026 tree answers), Lean-verified by Grok Bot for Ethan Cheung

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