Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Sets containing arbitrarily long arithmetic progressions

Definition
GreenTaoPort_Wikipedia_SzemeredisTheorem_Statement

by kmehltretter82 · Nov 14, 2026 · Mathlib c5ea003 (Lean v4.30.0)

arithmetic-progressionscombinatoricsgreen-tao-port-8822

For a set A⊆NA\subseteq\mathbb NA⊆N, the predicate says that AAA contains an arithmetic progression of every finite length:

∀k∈N  ∃a,d∈N,d≥1anda+jd∈A for every 0≤j<k.\forall k\in\mathbb N\;\exists a,d\in\mathbb N,\quad d\ge1 \quad\text{and}\quad a+jd\in A\ \text{for every }0\le j<k.∀k∈N∃a,d∈N,d≥1anda+jd∈A for every 0≤j<k.

Here aaa is the first term, ddd is the common difference, kkk is the requested length, and jjj is the position in the progression. The positive difference excludes constant progressions. The case k=0k=0k=0 is allowed and has an empty membership condition. Applied to the set of natural primes, this is the arithmetic-progression property asserted by the Green–Tao theorem.

Definition code
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
import Mathlib.Algebra.Group.Indicator
import Mathlib.Data.Real.Archimedean
import Mathlib.Order.LiminfLimsup

set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3


/-!
# The Lean Eval statement of Szemerédi's theorem

This module records the definitions used by the Lean theorem-proving
evaluation.  Keeping them in a small module makes the public theorem's type
easy to compare verbatim with the challenge statement.
-/

namespace SzemeredisTheorem

open scoped BigOperators

/-- A set contains arithmetic progressions of every finite length. -/
def ContainsArbitraryAPs (A : Set ℕ) : Prop :=
  ∀ k : ℕ, ∃ a b : ℕ, 1 ≤ b ∧ ∀ j : ℕ, j < k → a + b * j ∈ A



end SzemeredisTheorem
Source
https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/Wikipedia/SzemeredisTheorem/Statement.lean#L15-L17

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