Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Sphere images are mmm-sparse

Proved
BehrendWindows.atMostTwoPerAP_image_sphere

by pitimespi · Nov 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

additive-combinatoricsarithmetic-progressions

Let S,d,m,k∈NS,d,m,k\in\mathbb{N}S,d,m,k∈N with d≥1d\ge 1d≥1 and m≥3m\ge 3m≥3. Let Σk\Sigma_kΣk​ be the set of vectors x∈{0,…,d−1}Sx\in\{0,\dots,d-1\}^Sx∈{0,…,d−1}S with ∑ixi2=k\sum_i x_i^2=k∑i​xi2​=k, and let

T={∑i<Sxi (md)i : x∈Σk}⊂Z.T=\Big\{\textstyle\sum_{i<S} x_i\,(md)^i\ :\ x\in\Sigma_k\Big\}\subset\mathbb{Z}.T={∑i<S​xi​(md)i : x∈Σk​}⊂Z.

Then TTT is mmm-sparse (no mmm-term arithmetic progression with non-zero common difference contains three elements of TTT), and T⊆{0,1,…,(md)S−1}T\subseteq\{0,1,\dots,(md)^S-1\}T⊆{0,1,…,(md)S−1}.

Formalization Note Σk\Sigma_kΣk​ is Mathlib's Behrend.sphere S d k and the digit map is Behrend.map (m * d), cast to Z\mathbb{Z}Z.

Preamble
import Mathlib
import Definitions.Def_BehrendWindows_AtMostTwoPerAP
Formal statement
namespace BehrendWindows

theorem atMostTwoPerAP_image_sphere (S d m k : ℕ) (hd : 1 ≤ d) (hm : 3 ≤ m) :
    AtMostTwoPerAP ((Behrend.sphere S d k).image (fun x => (Behrend.map (m * d) x : ℤ))) m ∧
      (Behrend.sphere S d k).image (fun x => (Behrend.map (m * d) x : ℤ)) ⊆
        Finset.Ico (0 : ℤ) ((m * d) ^ S : ℕ) := by sorry

end BehrendWindows
Source
No published source states the version uniform in m; statement from the mission proposal, milestone 3; generalises Behrend.threeAPFree_sphere and F. A. Behrend, On sets of integers which contain no three terms in arithmetical progression, PNAS 32 (1946) 331-332, https://doi.org/10.1073/pnas.32.12.331
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Let S,d,m,k∈NS, d, m, k \in \mathbb{N}S,d,m,k∈N with d≥1d \ge 1d≥1 and m≥3m \ge 3m≥3.

Let Σ\SigmaΣ be Mathlib's Behrend "sphere" (with S=0S = 0S=0 allowed):

Σ={x∈NS:xi<d for all i, ∑ixi2=k},\Sigma = \Big\{ x \in \mathbb{N}^S : x_i < d \text{ for all } i,\ \sum_{i} x_i^2 = k \Big\},Σ={x∈NS:xi​<d for all i, i∑​xi2​=k},

the vectors with every coordinate in {0,…,d−1}\{0, \dots, d-1\}{0,…,d−1} and sum of squares exactly kkk.

Let T⊆ZT \subseteq \mathbb{Z}T⊆Z be the image of Σ\SigmaΣ under

x↦∑i=0S−1xi (md)i,x \mapsto \sum_{i=0}^{S-1} x_i\,(md)^{i},x↦i=0∑S−1​xi​(md)i,

computed in N\mathbb{N}N and then viewed as an integer. The theorem states two things.

  1. TTT has the "at most two per progression" property with parameter mmm. Fix any a∈Za \in \mathbb{Z}a∈Z and any common difference δ∈Z\delta \in \mathbb{Z}δ∈Z with δ≠0\delta \ne 0δ=0; δ\deltaδ may be negative. Fix any natural numbers k1<k2<k3<mk_1 < k_2 < k_3 < mk1​<k2​<k3​<m. Then the three integers
a+k1δ,a+k2δ,a+k3δa + k_1\delta,\quad a + k_2\delta,\quad a + k_3\deltaa+k1​δ,a+k2​δ,a+k3​δ

are not all in TTT. Equivalently, no mmm-term arithmetic progression a,a+δ,…,a+(m−1)δa, a+\delta, \dots, a+(m-1)\deltaa,a+δ,…,a+(m−1)δ with non-zero difference contains three of its terms, at distinct positions, in TTT.

  1. T⊆[0,(md)S)T \subseteq [0, (md)^S)T⊆[0,(md)S), that is, every element ttt of TTT is an integer with 0≤t<(md)S0 \le t < (md)^S0≤t<(md)S.

Edge cases:

  • TTT is empty whenever Σ\SigmaΣ is, for example when kkk cannot be written as such a sum of squares. Both claims then hold trivially.
  • If S=0S = 0S=0, then Σ\SigmaΣ is {()}\{()\}{()} when k=0k = 0k=0 and empty otherwise. So T⊆{0}T \subseteq \{0\}T⊆{0} and the bound is (md)0=1(md)^0 = 1(md)0=1.
Human review
  • Endorsed by Shuze Chen · Nov 21, 2026

    Confirmed by the moderator at approval.

  • Endorsed by pitimespi · Nov 21, 2026

    Confirmed by the mission captain (proposal self-audit).

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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me