MathLabs

Combinatorics and discrete mathematics

Szemerédi's theorem

Any set of integers with positive density contains arbitrarily long arithmetic progressions.

IntuitionIntuition: arithmetic progressions hiding inside crowded sets

Pick any set of positive integers that is not too sparse — say it keeps a fixed fraction of all numbers up to every scale. Intuition suggests such a set cannot avoid all patterns forever: sooner or later it must contain three numbers spaced evenly apart, then four, then any number you like. Szemerédi's theorem makes this precise: it says that mere abundance — a positive fraction of the integers, with no algebraic structure assumed at all — already forces the set to contain arithmetic progressions of every finite length.

Network diagram showing vertices grouped into clusters, with one highlighted pair of clusters whose connecting edges are spread out evenly like a random bipartite graph
Szemerédi's regularity lemma: any large graph splits into a bounded number of parts so that almost every pair of parts looks pseudorandom

UndergraduateDensity and the precise statement

Definition: Upper density

For a set of positive integers AA, the upper density d(A)d(A) measures the largest fraction of {1,…,N}\{1,\dots,N\} that AA can occupy, in the limit as NN grows without bound: d(A)=lim sup⁡N→∞∣A∩[1,N]∣Nd(A) = \limsup_{N \to \infty} \frac{|A \cap [1,N]|}{N}.

d(A)=lim sup⁡N→∞∣A∩[1,N]∣Nd(A) = \limsup_{N \to \infty} \frac{|A \cap [1,N]|}{N}

Here A∩[1,N]A \cap [1,N] is the part of AA inside the first NN integers, and lim sup⁡\limsup takes the largest value the ratio keeps returning to as NN grows — this way d(A)d(A) is well defined even if the fraction oscillates instead of converging.

d(A)>0  ⟹  ∀ k≥1, ∃ a,r>0:{a,a+r,…,a+(k−1)r}⊆Ad(A) > 0 \implies \forall\, k \ge 1,\ \exists\, a, r > 0 : \{a, a+r, \dots, a+(k-1)r\} \subseteq A

This is the full statement: as soon as d(A)>0d(A) > 0, the set contains an arithmetic progression {a,a+r,…,a+(k−1)r}\{a, a+r, \dots, a+(k-1)r\} for every length kk — no matter how large kk is. Setting k=3k=3 already recovers the hardest classical special case, Roth's theorem; letting kk grow gives progressions as long as anyone could ask for, all from the single hypothesis of positive density.

Comparing three theorems about arithmetic progressions
TheoremHypothesis on the setConclusion
Van der Waerden (1927)Finite coloring of Z+\mathbb{Z}^+Some color class contains a length-kk progression for every kk
Szemerédi (1975)d(A)>0d(A) > 0AA contains a length-kk progression for every kk
Green–Tao (2004)AA = the primes (density 0)AA contains a length-kk progression for every kk

AdvancedProof idea: the regularity method

For every integer k≥3k \ge 3 and every δ>0\delta > 0, there is a threshold N(k,δ)N(k,\delta) such that every A⊆{1,…,N}A \subseteq \{1,\dots,N\} with N≥N(k,δ)N \ge N(k,\delta) and ∣A∣≥δN|A| \ge \delta N contains an arithmetic progression of length kk.

Why is it true?

This finite version is logically equivalent to the infinite density statement by a simple compactness argument, and it is the form that is actually proved: instead of one infinite set, one only needs to control finitely many configurations inside a large but finite window.

Proof

Step 1 (reduction to the finite window). Suppose the infinite statement fails for some d(A0)>0d(A_0) > 0 with no length-kk progression at all. Then for every NN, the restriction A0∩[1,N]A_0 \cap [1,N] is a length-kk-AP-free subset of {1,…,N}\{1,\dots,N\} whose size grows like δ\deltaNN for a fixed δ\delta > 0. If the finitary statement were true, no such family could exist for arbitrarily large NN, a contradiction — so the two statements stand or fall together.

Step 2 (regularity partition). View potential kk-term progressions in {1,…,N}\{1,\dots,N\} as edges of a (k−1)(k-1)-uniform hypergraph. The hypergraph regularity lemma partitions the underlying vertex set into a bounded number of pieces so that, apart from a small exceptional fraction, every tuple of pieces is pseudorandom: the density of hyperedges between them is essentially constant, with no denser or sparser sub-clusters.

Step 3 (counting lemma). Once the partition is regular, a matching counting lemma shows that any tuple of pieces with positive relative density must contain the expected number of complete configurations — in particular, at least one genuine length-kk progression, because a regular pseudorandom structure with positive density cannot avoid the pattern it is being tested against.

Step 4 (removal argument). If AA had no length-kk progression at all, the counting lemma would force almost all of the configurations counted by the regular partition to be degenerate, which in turn would let one delete a vanishingly small number of elements from AA to kill every approximate progression — contradicting that AA keeps density δ\delta on a set of size NN as large as we like. Hence a length-kk progression must exist. (Furstenberg's 1977 ergodic-theoretic proof and Gowers' higher-order Fourier-analytic proof reach the same conclusion by entirely different routes, each yielding explicit but astronomically large bounds on N(k,δ)N(k,\delta).)

If A⊆{1,…,N}A \subseteq \{1,\dots,N\} has ∣A∣≥δN|A| \ge \delta N and NN is large enough relative to δ\delta, then AA contains a nontrivial 3-term arithmetic progression.

Why is it true?

This is the first nontrivial case of Szemerédi's theorem, proved by Roth in 1953 using Fourier analysis instead of the heavy regularity machinery needed for general kk. Its "density increment" strategy — either find the pattern, or show the set is unexpectedly structured and pass to a denser sub-progression — became the blueprint later reused, in vastly more sophisticated form, for the general theorem and for Green–Tao.

Proof

Step 1 (Fourier count of progressions). Suppose A⊆{1,…,N}A \subseteq \{1,\dots,N\} has density δ\delta and no nontrivial 3-term progression. Writing 1A^(θ)=∑n∈Ae(θn)\hat{1_A}(\theta) = \sum_{n \in A} e(\theta n) for the Fourier transform of the indicator of AA, the number of triples (x,x+r,x+2r)∈A3(x, x+r, x+2r) \in A^3 can be written as an integral of 1A^(θ)2 1A^(2θ)‾\hat{1_A}(\theta)^2 \, \overline{\hat{1_A}(2\theta)} over θ\theta.

Step 2 (the pseudorandom case). If every nonzero Fourier coefficient of 1A1_A were small compared to δ2\delta^2, the integral would be dominated by the θ=0\theta = 0 term alone, which already forces roughly δ3N2\delta^3 N^2 triples — far more than the trivial ones — contradicting the assumption that AA has none.

Step 3 (density increment). So some nonzero coefficient must be large; this means 1A1_A correlates with the linear phase e(θn)e(\theta n), i.e. AA is noticeably biased on some arithmetic progression (or Bohr set). Restricting to that sub-progression produces a shorter interval on which the density of AA has increased by a fixed multiplicative factor.

Step 4 (iteration and conclusion). Density cannot increase past 1, so after finitely many rounds of this density-increment step the process must terminate — meaning the pseudorandom case of Step 2 is eventually forced, which produces the missing 3-term progression and contradicts the no-progression assumption. Roth's original bookkeeping gives N(3,δ)≲exp⁡(exp⁡(1/δ))N(3,\delta) \lesssim \exp(\exp(1/\delta))-type thresholds; this was improved over decades, and Kelley and Meka's 2023 argument pushes the bound down to nearly Behrend's classical construction, N(3,δ)≲exp⁡ ⁣(−c(log⁡N)1/12)NN(3,\delta) \lesssim \exp\!\big(-c(\log N)^{1/12}\big) N-type density, essentially closing the gap for this case.

UndergraduateReal-World Applications and Worked Examples

Szemerédi's own regularity lemma, invented as a tool inside this proof, went on to become one of the most-used tools in theoretical computer science: it underlies graph property testing algorithms (deciding whether a huge graph is close to satisfying a property by inspecting only a bounded-size random sample), gives lower bounds in communication complexity, and shows up in combinatorial design and coding theory. On the number-theory side, the theorem sits at one end of a spectrum whose other end is the Behrend construction of dense progression-free sets, and its finite form gives the combinatorial engine behind the Green–Tao theorem on primes.

Example: A 3-term progression inside a concrete set

Let A={1,2,4,5,7,8,10,11}⊆{1,…,12}A = \{1,2,4,5,7,8,10,11\} \subseteq \{1,\dots,12\} — this is exactly the numbers from 1 to 12 that are not multiples of 3, so dd restricted to this window is ∣A∣/12=2/3|A|/12 = 2/3. Find an explicit arithmetic progression of length 3 inside AA.

Solution

Step 1: since AA excludes exactly the multiples of 3, every element of AA has residue 1 or 2 modulo 3.

Step 2: pick common difference r=3r=3 (a multiple of 3) so that a,a+r,a+2ra, a+r, a+2r all share the same residue class modulo 3, hence all avoid the missing residue 0.

Step 3: taking a=1a=1 gives 1,4,71, 4, 7, and indeed 1,4,7∈A1,4,7 \in A — a genuine 3-term progression, matching what Szemerédi's theorem guarantees for any set of positive density once the window is large enough.

Example: Pigeonhole forces a dense — hence structured — color class

Color the integers red if odd and blue if even. Among {1,…,9}\{1,\dots,9\} the red class is {1,3,5,7,9}\{1,3,5,7,9\}, already 5/95/9 of the window. Explain why this pigeonhole-style argument, combined with Szemerédi's theorem, guarantees a monochromatic 3-term progression whenever finitely many colors are used on a long enough interval — and exhibit the progression here.

Solution

Step 1: with 2 colors partitioning 9 integers, the color sizes sum to 9, so by pigeonhole the larger class has at least ⌈9/2⌉=5\lceil 9/2 \rceil = 5 elements — here the red class {1,3,5,7,9}\{1,3,5,7,9\} has exactly 5.

Step 2: 5 elements inside a window of 9 means the red class already has density 5/9>05/9 > 0 on this finite window, and in fact the odd numbers have density exactly 1/21/2 over all of Z+\mathbb{Z}^+.

Step 3: since the odd numbers have positive density, Szemerédi's theorem (applied with k=3k=3) guarantees they contain 3-term progressions — and indeed the red class itself, 1,3,51,3,5, is one, with common difference 2. This is exactly the mechanism (positive density forced by pigeonhole, then Szemerédi's theorem) that recovers van der Waerden's finite-coloring theorem as a corollary.

Using d(A)=lim sup⁡N→∞∣A∩[1,N]∣Nd(A) = \limsup_{N \to \infty} \frac{|A \cap [1,N]|}{N}, what is the upper density d(A)d(A) of the set AA of all even positive integers?

What does Szemerédi's theorem conclude about a set A⊆Z+A \subseteq \mathbb{Z}^+ with d(A)>0d(A) > 0?

Why does Szemerédi's theorem imply van der Waerden's theorem on finite colorings?

Why can't Szemerédi's theorem be applied directly to show the primes contain arbitrarily long arithmetic progressions?

References

  1. Endre Szemerédi (1975). On sets of integers containing no k elements in arithmetic progression
  2. Hillel Furstenberg (1977). Ergodic behavior of diagonal measures and a theorem of Szemerédi on arithmetic progressions · DOI:10.1007/BF02813304
  3. Zander Kelley, Raghu Meka (2023). Strong bounds for 3-progressions · arXiv:2302.05537