Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Specified-last-entry ordering: every finite set has a SAFE ordering ending at any prescribed element

Proved
Erdos195.specified_last_safe_order

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 WWW of integers is SAFE for θ\thetaθ if the sequence "letters of WWW in order, then all remaining integers in ≺θ\prec_\theta≺θ​-order" has no monotone 4-term arithmetic progression. Theorem. Let X⊂ZX\subset\mathbb ZX⊂Z be a finite set and z∈Xz\in Xz∈X. Then there is a duplicate-free list LLL whose set of entries is exactly XXX, whose last entry is zzz, and which is SAFE for some tree witness θ\thetaθ.

This is the ordering lemma used by GPT 6 Astra in the exceptional case of the four-class restricted absorption theorem: a reflection set must be appended in a safe order with one prescribed entry last. The proof uses the tree order with θ(k,⋅)=¬bitk(z)\theta(k,\cdot)=\neg\mathrm{bit}_k(z)θ(k,⋅)=¬bitk​(z), in which zzz is the greatest element. Sort X∖{z}X\setminus\{z\}X∖{z} increasingly in it and append zzz. A list sorted increasingly for ≺θ\prec_\theta≺θ​ is SAFE for the reversed order, which is the tree order ≺¬θ\prec_{\neg\theta}≺¬θ​. This is the tree version of Ho's reverse-order lemma.

Preamble
import Mathlib
import Definitions.Def_Erdos195_tree
Formal statement
namespace Erdos195

theorem specified_last_safe_order (X : Finset ℤ) (z : ℤ) (hz : z ∈ X) :
    ∃ L : List ℤ, L.Nodup ∧ (∀ x, x ∈ L ↔ x ∈ X) ∧ L.getLast? = some z ∧
      ∃ θ : ℕ → ℤ → Bool, Safe (treeLt θ) L := 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); lemma of GPT 6 Astra (astra_restricted / astra_fourclass)

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