Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Classification of ε\varepsilonε-safe three-letter words (a,b,t)(a,b,t)(a,b,t)

Proved
Erdos195.three_letter_safe_iff

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

arithmetic-progressionscombinatoricserdos-problems

Fix ε:N→{0,1}\varepsilon:\mathbb{N}\to\{0,1\}ε:N→{0,1} and the 222-adic total order on Z\mathbb{Z}Z given by x≺εyx\prec_\varepsilon yx≺ε​y iff x≠yx\neq yx=y and the kkk-th two's-complement digit of xxx equals εk\varepsilon_kεk​, where k=ν2(y−x)k=\nu_2(y-x)k=ν2​(y−x). A finite word QQQ of integers is ε\varepsilonε-safe if the sequence "the letters of QQQ in order, then all remaining integers in ≺ε\prec_\varepsilon≺ε​-order" contains no monotone 444-term arithmetic progression. Let a,b,ta,b,ta,b,t be distinct integers. Then the three-letter word (a,b,t)(a,b,t)(a,b,t) is ε\varepsilonε-safe for some ε\varepsilonε if and only if

t≠2b−aand(ν2(b−a)≠ν2(t−b)  or  3t−2b=a).t\neq 2b-a\qquad\text{and}\qquad\bigl(\nu_2(b-a)\neq\nu_2(t-b)\ \text{ or }\ 3t-2b=a\bigr).t=2b−aand(ν2​(b−a)=ν2​(t−b)  or  3t−2b=a).

This completely classifies which third letters can follow a two-letter safe word in Ho-style constructions of 444-AP-free permutations of Z\mathbb{Z}Z (Erdős Problem 195). For example, 3b−2a3b-2a3b−2a can always be appended to (a,b)(a,b)(a,b), since ν2((3b−2a)−b)=ν2(b−a)+1\nu_2((3b-2a)-b)=\nu_2(b-a)+1ν2​((3b−2a)−b)=ν2​(b−a)+1.

Formalization note: ν2\nu_2ν2​ is padicValInt 2; Safe, epsLt come from Definitions.Def_Erdos195_defs.

Preamble
import Mathlib
import Definitions.Def_Erdos195_defs
Formal statement
namespace Erdos195

theorem three_letter_safe_iff (a b t : ℤ) (hab : a ≠ b) (hat : a ≠ t) (hbt : b ≠ t) :
    (∃ ε : ℕ → Bool, Safe (epsLt ε) [a, b, t]) ↔
      t ≠ 2 * b - a ∧ (padicValInt 2 (b - a) ≠ padicValInt 2 (t - b) ∨ 3 * t - 2 * b = a) := by sorry

end Erdos195
Source
Erdős Problem 195 (https://www.erdosproblems.com/195); side result found while working on this mission (statement suggested by GPT 6 Astra, 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