Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Dense-set and bounded-weight progression-count predicates

Definition
GreenTaoPort_Wikipedia_SzemeredisTheorem_Szemeredi_Weighted

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

arithmetic-progressionscombinatoricsgreen-tao-port-8822

Fix a progression length kkk, a positive modulus NNN, and real parameters δ,c\delta,cδ,c. The dense-set counting predicate says that every finite set A⊆Z/NZA\subseteq\mathbb Z/N\mathbb ZA⊆Z/NZ with normalized density at least δ\deltaδ has normalized kkk-term progression count at least ccc.

The bounded-weight predicate replaces the indicator of AAA by an arbitrary real function ggg satisfying 0≤g≤10\le g\le10≤g≤1 and mean⁡(g)≥δ\operatorname{mean}(g)\ge\deltamean(g)≥δ, and requires the same lower bound ccc. Their uniform variants quantify over every positive natural modulus with the same k,δ,ck,\delta,ck,δ,c. The progression counts include zero common differences; positivity assumptions on the thresholds belong to later theorems.

Definition code
import Definitions.Def_GreenTaoPort_Wikipedia_SzemeredisTheorem_ArithmeticProgression_Count
import Definitions.Def_GreenTaoPort_Wikipedia_SzemeredisTheorem_Finite_Mean
import Mathlib.Algebra.BigOperators.Expect
import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Finset
import Mathlib.Data.Fintype.Card
import Mathlib.Data.ZMod.Basic
import Mathlib.Tactic

set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3


/-!
# From dense sets to bounded dense weights

The hypergraph-removal layer will first produce a quantitative progression
count for dense finite sets.  This file proves the standard thresholding
step that upgrades such a theorem to functions `g : ZMod N → [0,1]`.
-/

namespace Wikipedia.SzemeredisTheorem

/-- A quantitative dense-set arithmetic-progression counting statement at
one fixed modulus. -/
def HasDenseAPCount (k N : ℕ) [NeZero N]
    (δ c : ℝ) : Prop :=
  ∀ A : Finset (ZMod N),
    δ ≤ mean (finsetIndicator A) →
      c ≤ cyclicAPCount k N (finsetIndicator A)

/-- A quantitative arithmetic-progression counting statement for bounded
nonnegative weights at one fixed modulus. -/
def HasWeightedAPCount (k N : ℕ) [NeZero N]
    (δ c : ℝ) : Prop :=
  ∀ g : ZMod N → ℝ,
    (∀ x, 0 ≤ g x) →
    (∀ x, g x ≤ 1) →
    δ ≤ mean g →
      c ≤ cyclicAPCount k N g

/-- Uniform dense-set AP counting with one lower bound for every nontrivial
cyclic modulus. -/
def HasUniformDenseAPCount (k : ℕ) (δ c : ℝ) : Prop :=
  ∀ (N : ℕ) [NeZero N], HasDenseAPCount k N δ c

/-- Uniform bounded-weight AP counting with one lower bound for every
nontrivial cyclic modulus. -/
def HasUniformWeightedAPCount (k : ℕ) (δ c : ℝ) : Prop :=
  ∀ (N : ℕ) [NeZero N], HasWeightedAPCount k N δ c



end Wikipedia.SzemeredisTheorem
Source
https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/Wikipedia/SzemeredisTheorem/Szemeredi/Weighted.lean#L14-L40

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