Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Exact safety criterion for (0,1)(0,1)(0,1) extended by one even target t≡0(mod4)t\equiv0\pmod 4t≡0(mod4): reflection closure

Proved
Erdos195.prop3_char

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 t>0t>0t>0 with 4∣t4\mid t4∣t, and let QQQ be a word that begins with 0,10,10,1, contains ttt, and whose only even letters are 000 and ttt. Let QoddQ_{\mathrm{odd}}Qodd​ be the word of odd letters of QQQ (in order) rescaled by y↦(y−1)/2y\mapsto (y-1)/2y↦(y−1)/2, and εk′=εk+1\varepsilon'_k=\varepsilon_{k+1}εk′​=εk+1​. Then QQQ is ε\varepsilonε-safe if and only if

ε0=1,εν2(t)=1,Qodd is ε′-safe,and for every odd letter y before t: 2t−y∈Q and it occurs before t.\varepsilon_0=1,\quad \varepsilon_{\nu_2(t)}=1,\quad Q_{\mathrm{odd}}\text{ is }\varepsilon'\text{-safe},\quad\text{and for every odd letter } y \text{ before } t:\ 2t-y\in Q \text{ and it occurs before } t.ε0​=1,εν2​(t)​=1,Qodd​ is ε′-safe,and for every odd letter y before t: 2t−y∈Q and it occurs before t.

So, for a single even target, safety reduces exactly to a one-digit-lower problem for the odd letters together with closure of the odd letters placed before ttt under the reflection y↦2t−yy\mapsto 2t-yy↦2t−y. This sharpens the necessary conditions ε0=1\varepsilon_0=1ε0​=1, 2t−12t-12t−1 before ttt (Ho-style constructions of 444-AP-free permutations of Z\mathbb{Z}Z, Erdős Problem 195).

Formalization note: Safe, epsLt are from Definitions.Def_Erdos195_defs; "begins with 0,10,10,1" is [0, 1] <+: Q; "before" is comparison of List.idxOf; QoddQ_{\mathrm{odd}}Qodd​ is (Q.filter (· % 2 = 1)).map (fun x => (x - 1) / 2); ν2\nu_2ν2​ is padicValInt 2.

Preamble
import Mathlib
import Definitions.Def_Erdos195_defs
Formal statement
namespace Erdos195

theorem prop3_char (ε : ℕ → Bool) (Q : List ℤ) (hpre : [0, 1] <+: Q)
    (t : ℤ) (ht0 : 0 < t) (ht4 : 4 ∣ t) (htQ : t ∈ Q)
    (hev : ∀ x ∈ Q, x % 2 = 0 → x = 0 ∨ x = t) :
    Safe (epsLt ε) Q ↔
      ε 0 = true ∧ ε (padicValInt 2 t) = true ∧
      Safe (epsLt (fun k => ε (k + 1)))
        ((Q.filter (fun x => decide (x % 2 = 1))).map (fun x => (x - 1) / 2)) ∧
      ∀ y ∈ Q, y % 2 = 1 → Q.idxOf y < Q.idxOf t →
        2 * t - y ∈ Q ∧ Q.idxOf (2 * t - y) < Q.idxOf t := by sorry

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