Skip to content
The Lumenary
Research pathwaysResearch orientation (graph theory, the probabilistic method and elementary number theory assumed) 140 min

Extremal and additive combinatorics

How much structure is forced by size alone? Enough edges force a clique, enough integers force a progression, and even the primes — a set of density zero — contain progressions of every finite length.

Formally verified · 14 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review
MotivationH

Size forces structure

Four questions, each of the form "how large must an object be before some structure is unavoidable?"

  • Cliques. How many edges can a graph on nn vertices have without containing a triangle? Without a K4K_4? (Mantel, 1907; Turán, 1941.)
  • Homogeneous sets. How many people must be at a party before there are kk who all know each other or kk who are all strangers? For k=3k = 3 the answer is 66; for k=4k = 4 it is 1818; for k=5k = 5 nobody knows — it lies between 4343 and 4646.
  • Progressions. How large can a subset of {1,…,N}\{1, \dots, N\} be with no three terms in arithmetic progression? Roth (1953) proved: o(N)o(N). Szemerédi (1975) proved the same for progressions of any length kk.
  • Primes. The primes have density zero, so Szemerédi's theorem does not apply to them. Yet Green and Tao (2004) proved that they contain arithmetic progressions of every finite length: 7,37,67,97,127,1577, 37, 67, 97, 127, 157 is one of length six.

Extremal combinatorics asks for the maximum size of an object avoiding a forbidden substructure (Turán numbers, Ramsey numbers); additive combinatorics studies the additive structure of sets of integers or of abelian groups (progressions, sumsets, sum–product phenomena). Szemerédi's theorem belongs to both, and the methods that grew around it — the regularity lemma, Fourier analysis and its higher-order generalisation, ergodic theory, the probabilistic method and the polynomial method — form one of the most active areas of modern mathematics. This lesson builds on graph theory (where R(3,3)=6R(3,3) = 6, Mantel's theorem and the basic Ramsey bounds are proved), the probabilistic method and elementary number theory.

IntuitionH

Structure versus randomness

A useful slogan (popularised by Tao): every large object is a mixture of structure and randomness, and both parts force patterns. A random set of integers of density α\alpha contains about α3N2/4\alpha^3 N^2/4 three-term progressions in {1,…,N}\{1, \dots, N\}, simply by counting. A structured set — say all integers in a sub-progression, or all integers xx with xθ mod 1x\theta \bmod 1 in a short interval — contains progressions for structural reasons. The proofs make this dichotomy precise:

  • Graphs. Szemerédi's regularity lemma splits any large graph into boundedly many pieces between which the edges look random. Counting then works as in a random graph.
  • Integers. Fourier analysis detects structure: if a set has few three-term progressions, its indicator function correlates with a character x↦e2πirx/Nx \mapsto e^{2\pi i r x/N}, so it is denser on some long sub-progression. Iterating this density increment proves Roth's theorem. Longer progressions need "higher-order" Fourier analysis (Gowers norms).
  • Lower bounds go the other way: random objects are unstructured. A random red–blue colouring of KnK_n has no large monochromatic clique, which is why Ramsey numbers grow exponentially. Ironically, nobody can construct colourings explicitly that are as good as random ones.
DefinitionsH

Definitions

Definition— Turán number and Turán graph

The Turán number ex(n,H)\mathrm{ex}(n, H) is the maximum number of edges of an nn-vertex graph containing no copy of HH. The Turán graph T(n,r)T(n, r) is the complete rr-partite graph on nn vertices with parts of sizes ⌊n/r⌋\lfloor n/r \rfloor or ⌈n/r⌉\lceil n/r \rceil; it contains no Kr+1K_{r+1}, and has t(n,r)≤(1−1r)n22t(n, r) \le \left(1 - \tfrac1r\right)\tfrac{n^2}{2} edges.

Definition— Ramsey number

The Ramsey number R(s,t)R(s, t) is the least nn such that every red–blue colouring of the edges of KnK_n contains a red KsK_s or a blue KtK_t. Equivalently: every graph on nn vertices contains a clique of size ss or an independent set of size tt.

Definition— density, progressions and Roth numbers

A set A⊆ZA \subseteq \Z has positive upper density if lim sup⁡N→∞∣A∩[1,N]∣/N>0\limsup_{N \to \infty} |A \cap [1, N]|/N > 0. A kk-term arithmetic progression (kk-AP) is a,a+d,…,a+(k−1)da, a + d, \dots, a + (k-1)d with d≠0d \neq 0. The Roth number rk(N)r_k(N) is the largest size of a subset of {1,…,N}\{1, \dots, N\} with no kk-AP; we write r3(N)r_3(N) for three-term progressions.

Definition— sumsets and doubling

For finite sets A,BA, B in an abelian group, A+B={a+b:a∈A,b∈B}A + B = \{a + b : a \in A, b \in B\} and A⋅BA \cdot B similarly. The doubling constant of AA is ∣A+A∣/∣A∣|A + A|/|A|. A generalised arithmetic progression of dimension dd is a set {a0+x1d1+⋯+xddd:0≤xi<Li}\{a_0 + x_1d_1 + \cdots + x_dd_d : 0 \le x_i \lt L_i\}.

Definition— ε-regular pairs and partitions

For disjoint vertex sets X,YX, Y of a graph, the density is d(X,Y)=e(X,Y)/(∣X∣∣Y∣)d(X, Y) = e(X, Y)/(|X||Y|). The pair is ε\varepsilon-regular if ∣d(X′,Y′)−d(X,Y)∣≤ε|d(X', Y') - d(X, Y)| \le \varepsilon for all X′⊆XX' \subseteq X, Y′⊆YY' \subseteq Y with ∣X′∣≥ε∣X∣|X'| \ge \varepsilon|X|, ∣Y′∣≥ε∣Y∣|Y'| \ge \varepsilon|Y|. A partition V=V1∪⋯∪VkV = V_1 \cup \dots \cup V_k into parts of almost equal size is ε\varepsilon-regular if all but at most εk2\varepsilon k^2 of the pairs (Vi,Vj)(V_i, V_j) are ε\varepsilon-regular.

Definition— Fourier transform on ℤ/Nℤ

For f:Z/NZ→Cf : \Z/N\Z \to \C put f^(r)=Exf(x)e(−rx/N)\hat f(r) = \mathbb{E}_{x} f(x) e(-rx/N), where e(t)=e2πite(t) = e^{2\pi i t} and Ex=1N∑x\mathbb{E}_x = \frac1N\sum_x. Then f(x)=∑rf^(r)e(rx/N)f(x) = \sum_r \hat f(r) e(rx/N) and Parseval's identity holds: ∑r∣f^(r)∣2=Ex∣f(x)∣2\sum_r |\hat f(r)|^2 = \mathbb{E}_x |f(x)|^2.

Definition— cap set

A cap set is a subset of F3n\mathbb{F}_3^n containing no three distinct points on a line, i.e. no x,y,zx, y, z, not all equal, with x+y+z=0x + y + z = 0 — the F3n\mathbb{F}_3^n analogue of a 3-AP-free set.

Worked examplesH

Examples

Example— Turán graphs

T(6,2)=K3,3T(6, 2) = K_{3,3} has 99 edges and no triangle; T(6,3)=K2,2,2T(6, 3) = K_{2,2,2} (the octahedron) has 1212 edges and no K4K_4. The first experiment checks all 3276832768 graphs on six vertices: these are the maxima, and the only graphs attaining them are copies of the Turán graphs (1010 labelled copies of K3,3K_{3,3}, 1515 of K2,2,2K_{2,2,2}).

Example— The Paley graph and R(4, 4) > 17

Join x,y∈Z/17x, y \in \Z/17 when x−yx - y is a non-zero square (±1,±2,±4,±8\pm1, \pm2, \pm4, \pm8). This graph is 88-regular, it is isomorphic to its complement (multiply by the non-square 33), every adjacent pair has exactly 33 common neighbours and every non-adjacent pair 44 — a "pseudo-random" graph. It has no K4K_4 and, by self-complementarity, no independent set of size 44. So R(4,4)≥18R(4, 4) \ge 18; Greenwood and Gleason (1955) showed R(4,4)=18R(4, 4) = 18.

Example— Sets without three-term progressions

The integers whose base-33 digits are all 00 or 11 contain no 3-AP: if a+c=2ba + c = 2b with such digits, then adding a+ca + c digit by digit produces no carries and neither does doubling bb, so the digits agree and a=b=ca = b = c. Below 3m3^m there are 2m2^m of them, about N0.63N^{0.63}. Behrend (1946) did much better: lattice points on a sphere in a high-dimensional box, read as base-bb digits, give r3(N)≥Ne−clog⁡Nr_3(N) \ge N e^{-c\sqrt{\log N}}. This is larger than N1−εN^{1-\varepsilon} for every ε\varepsilon, yet still o(N)o(N), as Roth's theorem requires. The squares, by contrast, contain many 3-APs (1,25,491, 25, 49; in general (a2−2ab−b2)2(a^2 - 2ab - b^2)^2, (a2+b2)2(a^2 + b^2)^2, (a2+2ab−b2)2(a^2 + 2ab - b^2)^2), but no 4-term progression (Fermat, proved by Euler).

Example— Sums versus products

For A={1,…,n}A = \{1, \dots, n\}, ∣A+A∣=2n−1|A + A| = 2n - 1 but ∣A⋅A∣|A \cdot A| is much larger (asymptotically n2/(log⁡n)c+o(1)n^2/(\log n)^{c+o(1)} with c=1−1+log⁡log⁡2log⁡2c = 1 - \frac{1 + \log\log 2}{\log 2}, by Ford's work on the multiplication table). For A={1,2,4,…,2n−1}A = \{1, 2, 4, \dots, 2^{n-1}\}, ∣A⋅A∣=2n−1|A \cdot A| = 2n - 1 but ∣A+A∣=(n+12)|A + A| = \binom{n+1}{2}. The second experiment computes both for n=20n = 20: in each case one of the two is large.

Example— Cap sets

In F32\mathbb{F}_3^2 the largest cap set has 44 points (e.g. (0,0),(0,1),(1,0),(1,1)(0,0), (0,1), (1,0), (1,1)). The maximum sizes for n=1,…,6n = 1, \dots, 6 are 2,4,9,20,45,1122, 4, 9, 20, 45, 112, the last found by Potechin (2008). They are the maximum numbers of cards in the game SET (for n=4n = 4) with no "set" among them.

ProofH

Extremal graph theory and Ramsey numbers

Theorem— Theorem 1 (Turán 1941)

Let r≥1r \ge 1. Every graph on nn vertices with no Kr+1K_{r+1} has at most t(n,r)t(n, r) edges, with equality only for T(n,r)T(n, r). In particular ex(n,Kr+1)≤(1−1r)n22\mathrm{ex}(n, K_{r+1}) \le \left(1 - \frac1r\right)\frac{n^2}{2}.

Proof

(Zykov symmetrisation.) Let GG be Kr+1K_{r+1}-free on nn vertices with the maximum number of edges. For a vertex vv, "replacing uu by a copy of vv" means deleting uu and adding a new vertex v′v' adjacent exactly to N(v)N(v). The new graph is still Kr+1K_{r+1}-free: a clique cannot contain both vv and v′v' (they are not adjacent), and a clique through v′v' but not vv becomes a clique through vv when v′v' is replaced by vv.

Step 1: non-adjacency is transitive. Suppose u≁vu \not\sim v and v≁wv \not\sim w but u∼wu \sim w (so u≠wu \neq w). If d(v)<d(u)d(v) \lt d(u), replace vv by a copy of uu: since v≁uv \not\sim u, this changes the edge count by d(u)−d(v)>0d(u) - d(v) \gt 0, contradicting maximality; similarly if d(v)<d(w)d(v) \lt d(w). Otherwise d(v)≥d(u)d(v) \ge d(u) and d(v)≥d(w)d(v) \ge d(w); replace both uu and ww by copies of vv (neither is a neighbour of vv, so N(v)N(v) is unchanged). We lose d(u)+d(w)−1d(u) + d(w) - 1 edges (the edge uwuw is counted twice) and gain 2d(v)2d(v), a net gain of at least 11 — again a contradiction.

So "equal or non-adjacent" is an equivalence relation, and GG is complete multipartite. It has at most rr parts, since one vertex from each of r+1r + 1 parts would form a Kr+1K_{r+1}.

Step 2: the parts are balanced. A complete multipartite graph with parts of sizes n1,…,nrn_1, \dots, n_r has 12(n2−∑ni2)\frac12\left(n^2 - \sum n_i^2\right) edges. If ni≥nj+2n_i \ge n_j + 2, moving a vertex from part ii to part jj changes the edge count by (ni−1)−nj>0(n_i - 1) - n_j \gt 0. So in the extremal graph all parts differ in size by at most one: G≅T(n,r)G \cong T(n, r). Finally ∑ni2≥n2/r\sum n_i^2 \ge n^2/r by the Cauchy–Schwarz inequality, giving the bound (1−1r)n22\left(1 - \frac1r\right)\frac{n^2}{2}.

∎

Mantel's theorem is the case r=2r = 2. Turán's theorem is the starting point of a large theory. The Erdős–Stone theorem (1946), in the form noted by Erdős and Simonovits (1966), says ex(n,H)=(1−1χ(H)−1+o(1))n22\mathrm{ex}(n, H) = \left(1 - \frac{1}{\chi(H) - 1} + o(1)\right)\frac{n^2}{2}: the chromatic number of HH alone determines the asymptotics — except when HH is bipartite, where it only says o(n2)o(n^2). Bipartite Turán problems are much harder: the Kővári–Sós–Turán theorem gives ex(n,Ks,t)=O(n2−1/s)\mathrm{ex}(n, K_{s,t}) = O(n^{2 - 1/s}), and ex(n,C4)∼12n3/2\mathrm{ex}(n, C_4) \sim \frac12 n^{3/2}, but even the order of magnitude of ex(n,C8)\mathrm{ex}(n, C_8) is unknown.

Theorem— Theorem 2 (Ramsey 1930; Erdős–Szekeres 1935)

R(s,t)≤R(s−1,t)+R(s,t−1)R(s, t) \le R(s - 1, t) + R(s, t - 1) for s,t≥2s, t \ge 2, and R(s,t)≤(s+t−2s−1)R(s, t) \le \binom{s + t - 2}{s - 1}. In particular R(k,k)≤(2k−2k−1)<4k−1R(k, k) \le \binom{2k - 2}{k - 1} \lt 4^{k-1}.

Proof

Colour KnK_n with n=R(s−1,t)+R(s,t−1)n = R(s-1, t) + R(s, t-1) and pick a vertex vv. Its n−1n - 1 other vertices split into red neighbours and blue neighbours, and by the pigeonhole principle there are at least R(s−1,t)R(s - 1, t) of the first or at least R(s,t−1)R(s, t - 1) of the second. In the first case they contain a blue KtK_t (done) or a red Ks−1K_{s-1}, which with vv is a red KsK_s; the second case is symmetric. The binomial bound follows by induction on s+ts + t from R(1,t)=R(s,1)=1R(1, t) = R(s, 1) = 1 and Pascal's rule. (The formal section proves exactly this in Lean, for graphs on any vertex type.)

∎

Theorem— Theorem 3 (Erdős 1947; Spencer 1975)

For k≥3k \ge 3, R(k,k)>2k/2R(k, k) \gt 2^{k/2}. More precisely R(k,k)≥(1+o(1))2e k 2k/2R(k, k) \ge (1 + o(1))\frac{\sqrt 2}{e}\, k\, 2^{k/2}.

Proof

(First part.) Colour the edges of KnK_n, n=⌊2k/2⌋n = \lfloor 2^{k/2} \rfloor, independently at random. A fixed kk-set is monochromatic with probability 21−(k2)2^{1 - \binom k2}, so the expected number of monochromatic KkK_k is (nk)21−(k2)<nkk!21−k(k−1)2≤21+k/2k!<1\binom nk 2^{1 - \binom k2} \lt \frac{n^k}{k!}2^{1 - \frac{k(k-1)}{2}} \le \frac{2^{1 + k/2}}{k!} \lt 1. Some colouring therefore has none. (Optimising nn in the same computation gives R(k,k)>(1+o(1))1e2k2k/2R(k, k) \gt (1 + o(1))\frac{1}{e\sqrt 2}k2^{k/2}; the deletion method — take nn larger, then delete one vertex from each monochromatic KkK_k — improves the constant to 1e\frac1e, and Spencer's application of the Lovász local lemma to 2e\frac{\sqrt 2}{e}.)

∎

So 2 k<R(k,k)<4k\sqrt2^{\,k} \lt R(k, k) \lt 4^k. The lower bound has not been improved exponentially since 1947, and no explicit construction comes close to it. On the upper side, Thomason (1988), Conlon (2009) and Sah (2020) improved the lower-order factors, but the exponential base 44 stood for 88 years until Campos, Griffiths, Morris and Sahasrabudhe (2023) proved R(k,k)≤(4−ε)kR(k, k) \le (4 - \varepsilon)^k for some ε>0\varepsilon \gt 0; subsequent work by Gupta, Ndiaye, Norin and Wei (2024) brought the base down to about 3.83.8.

ProofH

Progressions: regularity, Fourier analysis and beyond

Theorem— Theorem 4 (Szemerédi's regularity lemma, 1975–78)

For every ε>0\varepsilon \gt 0 there is M(ε)M(\varepsilon) such that every graph has an ε\varepsilon-regular partition into kk parts with 1/ε≤k≤M(ε)1/\varepsilon \le k \le M(\varepsilon).

The proof refines partitions step by step, using an "energy" (mean square density) that is bounded by 11 and increases by ε5\varepsilon^5 at each refinement as long as the partition is not regular; the resulting M(ε)M(\varepsilon) is a tower of 22's of height polynomial in 1/ε1/\varepsilon, and Gowers (1997) showed that tower-type growth is necessary. Its most famous consequence:

Theorem— Theorem 5 (triangle removal lemma; Ruzsa–Szemerédi 1978)

For every δ>0\delta \gt 0 there is ε>0\varepsilon \gt 0 such that every graph on nn vertices with at most εn3\varepsilon n^3 triangles can be made triangle-free by deleting at most δn2\delta n^2 edges.

(Apply the regularity lemma, delete the edges inside parts, between irregular pairs and between sparse pairs — at most δn2\delta n^2 in all — and observe that a triangle surviving among three dense regular pairs would force, by the counting lemma, >εn3\gt \varepsilon n^3 triangles.)

Theorem— Theorem 6 (Roth 1953)

r3(N)=o(N)r_3(N) = o(N): for every δ>0\delta \gt 0, every A⊆{1,…,N}A \subseteq \{1, \dots, N\} with ∣A∣≥δN|A| \ge \delta N contains a three-term progression once NN is large enough.

Proof

(Via the removal lemma, Ruzsa–Szemerédi.) Let A⊆{1,…,N}A \subseteq \{1, \dots, N\} contain no 3-AP, and let M=2N+1M = 2N + 1, so that 22 is invertible in Z/M\Z/M and no progression of elements of {1,…,N}\{1, \dots, N\} wraps around. Build a tripartite graph with parts X,Y,ZX, Y, Z, each a copy of Z/M\Z/M, joining x∈Xx \in X to y∈Yy \in Y if y−x∈Ay - x \in A, y∈Yy \in Y to z∈Zz \in Z if z−y∈Az - y \in A, and x∈Xx \in X to z∈Zz \in Z if (z−x)/2∈A(z - x)/2 \in A. A triangle (x,y,z)(x, y, z) gives a=y−xa = y - x, b=z−yb = z - y, c=(z−x)/2c = (z - x)/2 in AA with a+b≡2c(modM)a + b \equiv 2c \pmod M, hence a+b=2ca + b = 2c (all three lie in [1,N][1, N] and 2N<M2N \lt M): this is the progression a,c,ba, c, b, which is trivial only if a=b=ca = b = c. So the only triangles are the M∣A∣M|A| "trivial" ones (x,x+a,x+2a)(x, x + a, x + 2a), and they are edge-disjoint (each edge determines xx and aa). Fix δ>0\delta \gt 0 and let ε\varepsilon be as in the removal lemma. The graph has n=3Mn = 3M vertices and M∣A∣≤M2≤ε(3M)3M|A| \le M^2 \le \varepsilon(3M)^3 triangles once M≥1/(27ε)M \ge 1/(27\varepsilon), so deleting at most δ(3M)2=9δM2\delta(3M)^2 = 9\delta M^2 edges destroys all of them. Each deleted edge destroys at most one of the edge-disjoint triangles, so M∣A∣≤9δM2M|A| \le 9\delta M^2, i.e. ∣A∣≤9δM≤27δN|A| \le 9\delta M \le 27\delta N. As δ\delta was arbitrary, ∣A∣=o(N)|A| = o(N).

∎

Roth's original proof was Fourier-analytic, and it gives quantitative bounds (r3(N)≪N/log⁡log⁡Nr_3(N) \ll N/\log\log N) that the removal lemma cannot. Its heart is the following lemma, which we prove in full.

Theorem— Lemma 7 (the key lemma of Roth's argument)

Let NN be odd and A⊆Z/NZA \subseteq \Z/N\Z have density α=∣A∣/N\alpha = |A|/N with N≥2/α2N \ge 2/\alpha^2. If AA contains no non-trivial 3-AP x,x+d,x+2dx, x + d, x + 2d (d≠0d \neq 0), then ∣1^A(r)∣≥α2/2|\hat{1}_A(r)| \ge \alpha^2/2 for some r≠0r \neq 0.

Proof

Let f=1Af = 1_A and Λ=Ex,df(x)f(x+d)f(x+2d)\Lambda = \mathbb{E}_{x, d} f(x)f(x + d)f(x + 2d). Substituting y=x+dy = x + d, z=x+2dz = x + 2d (so x+z=2yx + z = 2y), and expanding each ff by Fourier inversion,

Λ=1N2∑x+z=2yf(x)f(y)f(z)=∑rf^(r)2 f^(−2r),\Lambda = \frac{1}{N^2}\sum_{x + z = 2y} f(x)f(y)f(z) = \sum_{r} \hat f(r)^2\, \hat f(-2r),

because 1N2∑x+z=2ye((r1x+r2y+r3z)/N)\frac{1}{N^2}\sum_{x + z = 2y} e\big((r_1x + r_2y + r_3z)/N\big) is 11 when r1=r3=rr_1 = r_3 = r and r2=−2rr_2 = -2r, and 00 otherwise. If AA has no non-trivial 3-AP, only d=0d = 0 contributes to Λ\Lambda, so Λ=α/N≤α3/2\Lambda = \alpha/N \le \alpha^3/2. The r=0r = 0 term is f^(0)3=α3\hat f(0)^3 = \alpha^3. Hence

α32≤∣∑r≠0f^(r)2 f^(−2r)∣≤max⁡s≠0∣f^(s)∣∑r∣f^(r)∣2=αmax⁡s≠0∣f^(s)∣,\frac{\alpha^3}{2} \le \Big|\sum_{r \neq 0} \hat f(r)^2\, \hat f(-2r)\Big| \le \max_{s \neq 0}|\hat f(s)| \sum_r |\hat f(r)|^2 = \alpha \max_{s \neq 0}|\hat f(s)|,

using that r↦−2rr \mapsto -2r is a bijection of the non-zero residues (NN odd) and Parseval's identity ∑r∣f^(r)∣2=E∣f∣2=α\sum_r |\hat f(r)|^2 = \mathbb{E}|f|^2 = \alpha. So some ∣f^(s)∣≥α2/2|\hat f(s)| \ge \alpha^2/2.

∎

The density increment (outline). A large coefficient 1^A(s)\hat 1_A(s) means that AA correlates with the character x↦e(sx/N)x \mapsto e(sx/N). By Dirichlet's approximation theorem one can partition {1,…,N}\{1, \dots, N\} into progressions of length about N\sqrt N on each of which sx/Nsx/N is nearly constant modulo 11; averaging, AA has density at least α+cα2\alpha + c\alpha^2 on one of them, for an absolute constant c>0c \gt 0 (after a standard reduction to avoid wrap-around). Restrict to that progression, rescale it to {1,…,N′}\{1, \dots, N'\} with N′≈NN' \approx \sqrt N, and repeat. The density cannot exceed 11, so after O(1/α)O(1/\alpha) steps the process must stop — which can only happen because AA contains a 3-AP or NN has become too small. This gives r3(N)≪N/log⁡log⁡Nr_3(N) \ll N/\log\log N.

Theorem— Theorem 8 (Szemerédi 1975)

Every subset of the integers with positive upper density contains arbitrarily long arithmetic progressions; equivalently rk(N)=o(N)r_k(N) = o(N) for every kk.

There are four fundamentally different proofs: Szemerédi's combinatorial proof (which introduced the regularity lemma); Furstenberg's ergodic-theoretic proof (1977), via a multiple recurrence theorem for measure-preserving systems; Gowers's proof (1998–2001) by "higher-order Fourier analysis" with the norms ∥f∥Uk\|f\|_{U^k}, the first with reasonable bounds; and proofs via the hypergraph removal lemma (Gowers; Nagle, Rödl, Schacht and Skokan, 2004–07).

Theorem— Theorem 9 (Green–Tao 2004, published 2008)

The primes contain arbitrarily long arithmetic progressions.

The proof is a transference principle: Szemerédi's theorem holds not only for dense subsets of the integers but for dense subsets of suitably pseudorandom sparse sets. Green and Tao show that the primes are a dense subset of the "almost primes", weighted by a majorant built from the sieve weights of Goldston and Yıldırım, which is pseudorandom in the required sense. The theorem gives arbitrarily long finite progressions — the primes contain no infinite one (see the misconceptions). Tao and Ziegler (2008) extended it to polynomial progressions.

Theorem— Theorem 10 (Dvir 2008: finite-field Kakeya)

If K⊆FqnK \subseteq \mathbb{F}_q^n contains a line in every direction, then ∣K∣≥(q+n−1n)≥qn/n!|K| \ge \binom{q + n - 1}{n} \ge q^n/n!.

Proof

The polynomials of degree at most q−1q - 1 in nn variables over Fq\mathbb{F}_q form a vector space of dimension (q−1+nn)\binom{q - 1 + n}{n}. If ∣K∣|K| were smaller, the ∣K∣|K| linear conditions "P(k)=0P(k) = 0 for k∈Kk \in K" would have a non-zero solution: a polynomial P≠0P \neq 0 of degree d≤q−1d \le q - 1 vanishing on KK. Since K≠∅K \neq \emptyset, PP is not a non-zero constant, so d≥1d \ge 1. Write P=Pd+(lower terms)P = P_d + (\text{lower terms}) with Pd≠0P_d \neq 0 homogeneous of degree dd. For every direction v≠0v \neq 0, KK contains a line {x+tv:t∈Fq}\{x + tv : t \in \mathbb{F}_q\}, so g(t)=P(x+tv)g(t) = P(x + tv), a polynomial in tt of degree at most d≤q−1d \le q - 1, has qq roots and is identically zero. Its coefficient of tdt^d is Pd(v)P_d(v), so Pd(v)=0P_d(v) = 0 for all v≠0v \neq 0, and Pd(0)=0P_d(0) = 0 by homogeneity. Thus PdP_d vanishes on all of Fqn\mathbb{F}_q^n although its degree in each variable is at most q−1q - 1, which forces Pd=0P_d = 0 (induct on nn: a non-zero one-variable polynomial of degree ≤q−1\le q - 1 has fewer than qq roots). This contradiction proves ∣K∣≥(q+n−1n)|K| \ge \binom{q + n - 1}{n}.

∎

The same philosophy — find a low-degree polynomial vanishing on the set, then exploit the structure — solved several famous problems: the cap set problem (Croot, Lev and Pach for (Z/4)n(\Z/4)^n; Ellenberg and Gijswijt, 2016: every cap set in F3n\mathbb{F}_3^n has size at most 2.756n2.756^n for large nn, using what is now called the slice-rank method), and Guth and Katz's near-solution of Erdős's distinct distances problem (2010). Over Rn\R^n, the Kakeya conjecture is much harder; for n=3n = 3 a proof was announced by Wang and Zahl in 2025.

Theorem— Theorem 11 (Freiman 1964–73; Ruzsa 1994)

If A⊂ZA \subset \Z is finite with ∣A+A∣≤K∣A∣|A + A| \le K|A|, then AA is contained in a generalised arithmetic progression of dimension at most d(K)d(K) and size at most C(K)∣A∣C(K)|A|.

The simplest case is formalised below: ∣A+A∣≥2∣A∣−1|A + A| \ge 2|A| - 1, with equality only for arithmetic progressions. The polynomial Freiman–Ruzsa conjecture asks for bounds polynomial in KK; Gowers, Green, Manners and Tao proved it in F2n\mathbb{F}_2^n in November 2023 (over Z\Z it remains open).

ExplanationH

The landscape: known and open

Recent theorems. Kelley and Meka (2023) proved r3(N)≤Nexp⁡(−c(log⁡N)1/12)r_3(N) \le N\exp\left(-c(\log N)^{1/12}\right), close in shape to Behrend's lower bound Nexp⁡(−c′log⁡N)N\exp(-c'\sqrt{\log N}) (Bloom and Sisask improved 1/121/12 to 1/91/9); an earlier bound of Bloom and Sisask (2020) already settled the case k=3k = 3 of the Erdős–Turán conjecture below. For longer progressions, Leng, Sah and Sawhney (2024) proved rk(N)≤Nexp⁡(−(log⁡log⁡N)ck)r_k(N) \le N\exp\left(-(\log\log N)^{c_k}\right). In Ramsey theory: R(3,t)=Θ(t2/log⁡t)R(3, t) = \Theta(t^2/\log t) (Ajtai–Komlós–Szemerédi, 1980; Kim, 1995); Mattheus and Verstraete (2023) showed R(4,t)≥c t3/log⁡4tR(4, t) \ge c\, t^3/\log^4 t, matching the upper bound up to logarithms; and the exponential improvement of the diagonal upper bound described above.

Open problems (well documented; consult recent surveys for progress):

  • Small Ramsey numbers. R(5,5)R(5, 5) is unknown; it lies between 4343 (Exoo, 1989) and 4646 (Angeltveit and McKay, 2024).
  • Growth of R(k,k)R(k, k). Does lim⁡kR(k,k)1/k\lim_k R(k, k)^{1/k} exist, and what is it? It lies between 2\sqrt 2 and about 3.83.8. Erdős offered a prize for the existence of the limit.
  • Erdős–Turán. If ∑a∈A1/a=∞\sum_{a \in A} 1/a = \infty, must AA contain arbitrarily long progressions? Known for k=3k = 3; open for k≥4k \ge 4 (it would imply Green–Tao).
  • Sum–product. Erdős and Szemerédi (1983) proved max⁡(∣A+A∣,∣A⋅A∣)≥∣A∣1+c\max(|A + A|, |A \cdot A|) \ge |A|^{1 + c} for finite A⊂ZA \subset \Z and conjectured exponent 2−ε2 - \varepsilon. The best exponents known are 43\tfrac43 plus small explicit improvements (Solymosi, 2009; Konyagin–Shkredov; Rudnev–Stevens).
  • Cap sets. The largest cap set in F3n\mathbb{F}_3^n has size cnc^n with 2.2<c≤2.7562.2 \lt c \le 2.756 (roughly); the true base is unknown.
  • Bipartite Turán problems, such as the order of magnitude of ex(n,C8)\mathrm{ex}(n, C_8) or ex(n,K4,4)\mathrm{ex}(n, K_{4,4}); and the polynomial Freiman–Ruzsa conjecture over Z\Z.
Formal mathematicsF

Combinatorics in Lean and Mathlib

Additive combinatorics is one of the best-formalised parts of modern mathematics: Mathlib contains Szemerédi's regularity lemma, the triangle removal lemma, Roth's theorem, the Cauchy–Davenport theorem, Plünnecke–Ruzsa inequalities and Turán's theorem, much of it by Yaël Dillies and Bhavik Mehta. Moreover, the November 2023 proof of the polynomial Freiman–Ruzsa conjecture over F2n\mathbb{F}_2^n was completely formalised in Lean 4 with Mathlib about three weeks after it appeared, in an open collaborative project led by Terence Tao.

Turán's theorem, structural form:

turan_structureLean 4Applies a library theoremFormally verified
/-- **Turán's theorem**, structural form: for `r ≥ 1`, a graph on `n` vertices is
*Turán-maximal* (it has no `K_{r+1}` and as many edges as possible among such graphs) if and
only if it is isomorphic to the Turán graph `T(n, r)`, the complete `r`-partite graph with parts
as equal as possible. This applies Mathlib's `SimpleGraph.isTuranMaximal_iff_nonempty_iso_turanGraph`
(proved there by Zykov symmetrisation). -/
theorem turan_structure {V : Type*} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] {r : ℕ}
    (hr : 0 < r) :
    G.IsTuranMaximal r ↔ Nonempty (G ≃g SimpleGraph.turanGraph (Fintype.card V) r) :=
  SimpleGraph.isTuranMaximal_iff_nonempty_iso_turanGraph hr
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor

Ramsey numbers. We define the Ramsey property for graphs on any vertex type and prove the Erdős–Szekeres recursion and its consequences ourselves, mirroring the proof of Theorem 2 (the graph theory module proves R(3,3)=6R(3, 3) = 6 by a direct argument; here the bounds are general):

RamseyPropLean 4Formally verified
/-- `RamseyProp α s t m` says: in **every** graph `G` on the vertex type `α`, **every** set `W` of
at least `m` vertices contains `s` vertices that are pairwise adjacent (an `s`-clique of `G`) or
`t` vertices that are pairwise non-adjacent (a `t`-clique of the complement `Gᶜ`). Colouring
the edges of `G` red and the non-edges blue, this is "`m ≥ R(s, t)`" for colourings of the
complete graph on `W`. Quantifying over all `W` inside one type avoids induced subgraphs. -/
def RamseyProp (α : Type*) (s t m : ℕ) : Prop :=
  ∀ (G : SimpleGraph α) (W : Finset α), m ≤ W.card →
    ∃ S ⊆ W, G.IsNClique s S ∨ Gᶜ.IsNClique t S
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
ramsey_one_leftLean 4Proved here from basic factsFormally verified
/-- `R(1, t) ≤ 1`: any single vertex is a `1`-clique. -/
theorem ramsey_one_left {α : Type*} (t : ℕ) : RamseyProp α 1 t 1 := by
  intro G W hW
  obtain ⟨v, hv⟩ : W.Nonempty := Finset.card_pos.mp (by omega)
  exact ⟨{v}, Finset.singleton_subset_iff.mpr hv, Or.inl (SimpleGraph.isNClique_one.mpr ⟨v, rfl⟩)⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
ramsey_one_rightLean 4Proved here from basic factsFormally verified
/-- `R(s, 1) ≤ 1`: any single vertex is a `1`-clique of the complement. -/
theorem ramsey_one_right {α : Type*} (s : ℕ) : RamseyProp α s 1 1 := by
  intro G W hW
  obtain ⟨v, hv⟩ : W.Nonempty := Finset.card_pos.mp (by omega)
  exact ⟨{v}, Finset.singleton_subset_iff.mpr hv, Or.inr (SimpleGraph.isNClique_one.mpr ⟨v, rfl⟩)⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
ramsey_stepLean 4Proved here from basic factsFormally verified
/-- **The Erdős–Szekeres recursion** `R(s + 1, t + 1) ≤ R(s, t + 1) + R(s + 1, t)`.
Proof, as in the lesson: pick a vertex `v ∈ W` and split the other `|W| − 1 ≥ a + b − 1` vertices
into neighbours `N` and non-neighbours `M`. By pigeonhole `|N| ≥ a` or `|M| ≥ b`. In `N` we find
an `s`-clique (add `v` to get an `(s + 1)`-clique) or an independent `(t + 1)`-set; in `M` an
`(s + 1)`-clique or an independent `t`-set (add `v`). -/
theorem ramsey_step {α : Type*} [DecidableEq α] {s t a b : ℕ}
    (hA : RamseyProp α s (t + 1) a) (hB : RamseyProp α (s + 1) t b) (hab : 0 < a + b) :
    RamseyProp α (s + 1) (t + 1) (a + b) := by
  classical
  intro G W hW
  obtain ⟨v, hv⟩ : W.Nonempty := Finset.card_pos.mp (by omega)
  -- neighbours and non-neighbours of `v` in `W`
  set N := (W.erase v).filter (G.Adj v) with hN
  set M := (W.erase v).filter (fun w => ¬ G.Adj v w) with hM
  have hcard : N.card + M.card = W.card - 1 := by
    rw [hN, hM, Finset.card_filter_add_card_filter_not, Finset.card_erase_of_mem hv]
  have hNW : N ⊆ W := (Finset.filter_subset _ _).trans (Finset.erase_subset _ _)
  have hMW : M ⊆ W := (Finset.filter_subset _ _).trans (Finset.erase_subset _ _)
  by_cases hNa : a ≤ N.card
  · obtain ⟨S, hSN, hS | hS⟩ := hA G N hNa
    · -- an `s`-clique of neighbours, plus `v`
      refine ⟨insert v S, Finset.insert_subset hv (hSN.trans hNW), Or.inl ?_⟩
      exact hS.insert fun w hw => (Finset.mem_filter.mp (hSN hw)).2
    · exact ⟨S, hSN.trans hNW, Or.inr hS⟩
  · -- pigeonhole: otherwise `M` is large
    have hMb : b ≤ M.card := by omega
    obtain ⟨S, hSM, hS | hS⟩ := hB G M hMb
    · exact ⟨S, hSM.trans hMW, Or.inl hS⟩
    · -- an independent `t`-set of non-neighbours, plus `v`
      refine ⟨insert v S, Finset.insert_subset hv (hSM.trans hMW), Or.inr ?_⟩
      refine hS.insert fun w hw => ?_
      have hw' := Finset.mem_filter.mp (hSM hw)
      rw [SimpleGraph.compl_adj]
      exact ⟨fun h => (Finset.ne_of_mem_erase hw'.1) h.symm, hw'.2⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
ramsey_binomialLean 4Proved here from basic factsFormally verified
/-- **The Erdős–Szekeres bound** (1935): `R(s + 1, t + 1) ≤ C(s + t, s)`, i.e.
`R(s, t) ≤ C(s + t − 2, s − 1)`. Induction on `s` and `t`, with the base cases `R(1, t) = R(s, 1)
= 1` and Pascal's rule `C(s + t + 2, s + 1) = C(s + t + 1, s) + C(s + t + 1, s + 1)` matching
the recursion `ramsey_step`. -/
theorem ramsey_binomial {α : Type*} [DecidableEq α] :
    ∀ s t : ℕ, RamseyProp α (s + 1) (t + 1) ((s + t).choose s) := by
  intro s
  induction s with
  | zero => intro t; simpa using ramsey_one_left (α := α) (t + 1)
  | succ s ihs =>
    intro t
    induction t with
    | zero => simpa using ramsey_one_right (α := α) (s + 1 + 1)
    | succ t iht =>
      have hc : (s + 1 + (t + 1)).choose (s + 1) =
          (s + (t + 1)).choose s + (s + 1 + t).choose (s + 1) := by
        rw [show s + 1 + (t + 1) = (s + t + 1) + 1 by omega, Nat.choose_succ_succ,
          show s + (t + 1) = s + t + 1 by omega, show s + 1 + t = s + t + 1 by omega]
      rw [hc]
      exact ramsey_step (ihs (t + 1)) iht
        (by have := Nat.choose_pos (show s ≤ s + (t + 1) by omega); omega)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
ramsey_diagLean 4Proved here from basic factsFormally verified
/-- The diagonal case: `R(k + 1, k + 1) ≤ C(2k, k) ≤ 4ᵏ`. Every graph on `4ᵏ` vertices contains
`k + 1` vertices that are pairwise adjacent or pairwise non-adjacent. (Erdős's random colourings
show that the base `4` cannot be replaced by anything below `√2`.) -/
theorem ramsey_diag {α : Type*} [DecidableEq α] (k : ℕ) :
    RamseyProp α (k + 1) (k + 1) (4 ^ k) := by
  intro G W hW
  apply ramsey_binomial k k G W
  calc (k + k).choose k ≤ 2 ^ (k + k) := Nat.choose_le_two_pow _ _
    _ = 4 ^ k := by rw [← two_mul, pow_mul]; norm_num
    _ ≤ W.card := hW
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor

Sumsets: an independent proof of ∣A+B∣≥∣A∣+∣B∣−1|A + B| \ge |A| + |B| - 1 in Z\Z, Mathlib's general version, and Cauchy–Davenport in Z/pZ\Z/p\Z:

sumset_lowerLean 4Proved here from basic factsFormally verified
/-- **The simplest inverse-theorem bound**: for non-empty finite `A, B ⊆ ℤ`,
`|A + B| ≥ |A| + |B| − 1` (equality when `A` and `B` are progressions with the same difference).
Proof by induction on `A`, adding its largest element `a` last: `a + max B` is larger than every
sum in `A' + B`, where `A' = A \ {a}`, so `|A + B| ≥ |A' + B| + 1`. -/
theorem sumset_lower (B : Finset ℤ) (hB : B.Nonempty) :
    ∀ A : Finset ℤ, A.Nonempty → A.card + B.card - 1 ≤ (A + B).card := by
  intro A
  induction A using Finset.induction_on_max with
  | empty => intro h; exact absurd h Finset.not_nonempty_empty
  | insert a s hlt ih =>
    intro _
    have has : a ∉ s := fun h => lt_irrefl a (hlt a h)
    rcases s.eq_empty_or_nonempty with rfl | hs
    · simp [Finset.card_singleton_add]
    · set m := B.max' hB
      -- the new sum `a + max B` exceeds every old sum
      have hnot : a + m ∉ s + B := by
        intro h
        obtain ⟨x, hx, y, hy, hxy⟩ := Finset.mem_add.mp h
        have h1 := hlt x hx
        have h2 := Finset.le_max' B y hy
        omega
      have hsub : insert (a + m) (s + B) ⊆ insert a s + B :=
        Finset.insert_subset (Finset.add_mem_add (Finset.mem_insert_self _ _) (Finset.max'_mem _ _))
          (Finset.add_subset_add (Finset.subset_insert _ _) (subset_refl B))
      have := Finset.card_le_card hsub
      rw [Finset.card_insert_of_notMem hnot] at this
      rw [Finset.card_insert_of_notMem has]
      have := ih hs
      omega
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
cauchy_davenport_orderedLean 4Applies a library theoremFormally verified
/-- Mathlib's version of `sumset_lower`, for any linearly ordered cancellative additive
semigroup. This applies `cauchy_davenport_add_of_linearOrder_isCancelAdd`. -/
theorem cauchy_davenport_ordered {α : Type*} [LinearOrder α] [Add α] [IsCancelAdd α]
    [AddLeftMono α] [AddRightMono α] {A B : Finset α} (hA : A.Nonempty) (hB : B.Nonempty) :
    A.card + B.card - 1 ≤ (A + B).card :=
  cauchy_davenport_add_of_linearOrder_isCancelAdd hA hB
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
cauchy_davenport_zmodLean 4Applies a library theoremFormally verified
/-- **The Cauchy–Davenport theorem** (Cauchy 1813, Davenport 1935): for non-empty `A, B ⊆ ℤ/pℤ`
with `p` prime, `|A + B| ≥ min(p, |A| + |B| − 1)`. In `ℤ/pℤ` sums can wrap around, so the
ordering argument fails; Mathlib proves it by DeVos's induction for arbitrary groups. This
applies `ZMod.cauchy_davenport`. -/
theorem cauchy_davenport_zmod {p : ℕ} (hp : p.Prime) {A B : Finset (ZMod p)} (hA : A.Nonempty)
    (hB : B.Nonempty) : min p (A.card + B.card - 1) ≤ (A + B).card :=
  ZMod.cauchy_davenport hp hA hB
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor

Three-term progressions: a base-33 set checked by the kernel, hence r3(14)≥8r_3(14) \ge 8; Roth's theorem; and the regularity lemma.

stanley_three_ap_freeLean 4Proved here from basic factsFormally verified
/-- The numbers below `14` whose base-3 digits are all `0` or `1`,
`{0, 1, 3, 4, 9, 10, 12, 13}`, contain no three-term arithmetic progression `a, b, c` with
`a + c = 2b` and `a ≠ b`. (Doubling a number with digits `0, 1` creates no carries in base 3, so
`a + c = 2b` forces equal digits.) Checked here by the kernel (`decide`) using Mathlib's
`ThreeAPFree`. -/
theorem stanley_three_ap_free :
    ThreeAPFree ((({0, 1, 3, 4, 9, 10, 12, 13} : Finset ℕ)) : Set ℕ) := by
  decide
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
roth_number_14Lean 4Proved here from basic factsFormally verified
/-- Hence `r₃(14) ≥ 8`: `{0, …, 13}` contains a 3AP-free set of size 8. (In fact `r₃(14) = 8`.)
Uses Mathlib's `ThreeAPFree.le_rothNumberNat`. -/
theorem roth_number_14 : 8 ≤ rothNumberNat 14 :=
  ThreeAPFree.le_rothNumberNat _ stanley_three_ap_free (by decide) (by decide)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
roth_theoremLean 4Applies a library theoremFormally verified
/-- **Roth's theorem** (1953): `r₃(N) = o(N)` — for every `δ > 0`, every subset of `{0, …, N − 1}`
with at least `δN` elements contains a non-trivial three-term progression once `N` is large.
Mathlib proves it (Dillies and Mehta) through the triangle removal lemma and the
corners theorem — a different route from Roth's Fourier-analytic proof sketched in the
lesson. This applies `rothNumberNat_isLittleO_id`. -/
theorem roth_theorem :
    (fun N => (rothNumberNat N : ℝ)) =o[Filter.atTop] (fun N => (N : ℝ)) :=
  rothNumberNat_isLittleO_id
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor
szemeredi_regularity_lemmaLean 4Applies a library theoremFormally verified
/-- **Szemerédi's regularity lemma** (1975–78), effective form: for every `ε > 0` and `l`, every
graph on at least `l` vertices has an `ε`-uniform equipartition into at least `l` and at most
`bound ε l` parts, where the bound depends only on `ε` and `l`, not on the graph. (The bound is
a tower of exponentials, and Gowers showed towers are necessary.) This applies Mathlib's
`szemeredi_regularity`, formalised by Dillies and Mehta. -/
theorem szemeredi_regularity_lemma {α : Type*} [DecidableEq α] [Fintype α] (G : SimpleGraph α)
    [DecidableRel G.Adj] {ε : ℝ} {l : ℕ} (hε : 0 < ε) (hl : l ≤ Fintype.card α) :
    ∃ P : Finpartition (Finset.univ : Finset α), P.IsEquipartition ∧ l ≤ P.parts.card ∧
      P.parts.card ≤ SzemerediRegularity.bound ε l ∧ P.IsUniform G ε :=
  szemeredi_regularity G hε hl
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/AdditiveExtremalCombinatorics.leanTry it in the Lean web editor

What is and is not formalised. Formalised here: the Ramsey recursion and the bounds R(s,t)≤(s+t−2s−1)R(s, t) \le \binom{s+t-2}{s-1} and R(k+1,k+1)≤4kR(k+1, k+1) \le 4^k; the sumset bound; an explicit 3-AP-free set. From Mathlib: Turán, Cauchy–Davenport, Roth (via removal, not via Lemma 7), the regularity lemma. Not formalised: Erdős's lower bound and the deletion method, Lemma 7 and the density increment, Szemerédi's theorem for k≥4k \ge 4, Green–Tao, Dvir's theorem and the cap set bound (the latter has been formalised in Lean 3 by Dahmen, Hölzl and Lewis, 2019, but is not in Mathlib), and the sum–product estimates.

ComputationC

Exhaustive searches and what they cannot show

The first experiment confirms Turán's theorem on six vertices by checking all 3276832768 labelled graphs, verifies that the Paley graph on 1717 vertices has no homogeneous 44-set (so R(4,4)>17R(4, 4) \gt 17), and tabulates the probabilistic lower bounds and the Erdős–Szekeres upper bound for R(k,k)R(k, k).

Turan graphs and Ramsey numbers by exhaustive searchPythonExact computationExhaustive finite checkComputationally tested
"""Extremal graphs and Ramsey numbers by exhaustive search.

1. Turan's theorem on 6 vertices: we run through all 2^15 = 32768 labelled
   graphs on 6 vertices, find the maximum number of edges with no triangle and
   with no K4, and check that every extremal graph is a Turan graph
   (complete multipartite with parts as equal as possible).
2. R(4, 4) > 17: the Paley graph on Z/17 (x ~ y when x - y is a non-zero
   square) has no 4-clique and no independent set of 4 vertices; we check all
   2380 four-element subsets.
3. Bounds for diagonal Ramsey numbers: Erdos's first-moment bound, the
   improvement from the deletion method, and the Erdos-Szekeres upper bound.
"""

import itertools
import math

def edge_bits(n):
    """Map each pair {i, j}, i < j, of range(n) to a bit position."""
    return {e: b for b, e in enumerate(itertools.combinations(range(n), 2))}

def clique_masks(n, r, bits):
    """Bit masks of the edge sets of all r-cliques of K_n."""
    masks = []
    for S in itertools.combinations(range(n), r):
        m = 0
        for e in itertools.combinations(S, 2):
            m |= 1 << bits[e]
        masks.append(m)
    return masks

def is_free(graph, masks):
    """True if the graph (an edge bit mask) contains none of the given cliques."""
    return all(graph & m != m for m in masks)

def non_adjacency_classes(graph, n, bits):
    """Sizes of the classes of 'equal or non-adjacent', if it is an equivalence
    relation (i.e. the graph is complete multipartite); otherwise None."""
    def adj(i, j):
        return i != j and graph >> bits[(min(i, j), max(i, j))] & 1
    classes, seen = [], set()
    for i in range(n):
        if i in seen:
            continue
        cls = {j for j in range(n) if not adj(i, j)}
        if any(adj(a, b) for a in cls for b in cls):
            return None
        seen |= cls
        classes.append(len(cls))
    return sorted(classes)

def turan_part_sizes(n, r):
    """Part sizes of the Turan graph T(n, r): as equal as possible."""
    return sorted([n // r + (1 if i < n % r else 0) for i in range(r)])

def turan_edges(n, r):
    """Number of edges of T(n, r)."""
    parts = turan_part_sizes(n, r)
    return (n * n - sum(p * p for p in parts)) // 2

def extremal_graphs(n, r):
    """(max edges, list of extremal graphs) among K_(r+1)-free graphs on n vertices."""
    bits = edge_bits(n)
    masks = clique_masks(n, r + 1, bits)
    best, graphs = -1, []
    for g in range(1 << len(bits)):
        if is_free(g, masks):
            e = bin(g).count("1")
            if e > best:
                best, graphs = e, [g]
            elif e == best:
                graphs.append(g)
    return best, graphs

def paley_graph(q):
    """Adjacency sets of the Paley graph on Z/q (q prime, q = 1 mod 4)."""
    squares = {x * x % q for x in range(1, q)}
    return [{y for y in range(q) if (x - y) % q in squares} for x in range(q)]

def homogeneous_sets(adj, k):
    """Number of k-sets that are cliques or independent sets."""
    count = 0
    for S in itertools.combinations(range(len(adj)), k):
        pairs = [(a, b) for a, b in itertools.combinations(S, 2)]
        edges = sum(1 for a, b in pairs if b in adj[a])
        count += edges == 0 or edges == len(pairs)
    return count

def erdos_bound(k):
    """Largest n with C(n, k) 2^(1 - C(k, 2)) < 1 (so R(k, k) > n)."""
    n = k
    while math.comb(n + 1, k) * 2 < 2 ** math.comb(k, 2):
        n += 1
    return n

def deletion_bound(k):
    """max over n of floor(n - C(n, k) 2^(1 - C(k, 2))) (so R(k, k) > it).

    Exact integer arithmetic: floor(n - x) = n - ceil(x)."""
    best, n, denominator = 0, k, 2 ** math.comb(k, 2)
    while True:
        value = n - (-(-2 * math.comb(n, k) // denominator))
        if value < best - 50:
            return best
        best = max(best, value)
        n += 1

def main():
    n = 6
    bits = edge_bits(n)
    print(f"1. All {2 ** len(bits)} labelled graphs on {n} vertices:")
    for r in (2, 3):
        best, graphs = extremal_graphs(n, r)
        shapes = {tuple(non_adjacency_classes(g, n, bits) or ()) for g in graphs}
        print(f"   no K{r + 1}: max {best} edges (T({n},{r}) has "
              f"{turan_edges(n, r)}); {len(graphs)} extremal graphs,")
        print(f"   all complete multipartite with parts {sorted(shapes)} "
              f"(Turan: {tuple(turan_part_sizes(n, r))})")
    print()
    adj = paley_graph(17)
    print("2. Paley graph on Z/17 (x ~ y iff x - y is a non-zero square):")
    print(f"   degree {len(adj[0])}; 4-sets that are cliques or independent: "
          f"{homogeneous_sets(adj, 4)} of {math.comb(17, 4)}")
    print(f"   triangles or independent 3-sets: {homogeneous_sets(adj, 3)}")
    print("   so R(4, 4) > 17 (and R(4, 4) = 18: Greenwood-Gleason, 1955)")
    print()
    print("3. Bounds for R(k, k):")
    print("    k   first moment   deletion   Erdos-Szekeres C(2k-2, k-1)")
    for k in range(4, 11):
        print(f"   {k:2d}   {erdos_bound(k):12d}   {deletion_bound(k):8d}   "
              f"{math.comb(2 * k - 2, k - 1):27d}")
    print("   (lower bounds: R(k, k) exceeds the number shown)")
    print()
    print("Epistemic status: parts 1 and 2 are exact and exhaustive for 6 and 17")
    print("vertices, so they prove these finite statements if the code is right;")
    print("Turan's and Ramsey's theorems for all n are proved in the lesson. Part")
    print("3 is exact arithmetic applied to proved bounds; it says nothing about")
    print("the true values, which are unknown for k >= 5.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second computes the Roth numbers r3(N)r_3(N) for N≤40N \le 40 exactly by backtracking (each search is pruned using the smaller Roth numbers already computed), finds the progressions of primes of lengths 33 to 77 with the smallest last term, and compares ∣A+A∣|A + A| with ∣A⋅A∣|A \cdot A|.

Roth numbers, prime progressions and the sum-product phenomenonPythonExact computationExhaustive finite checkComputationally tested
"""Progressions in dense sets and in the primes; sums versus products.

1. Roth numbers: r3(N), the size of the largest subset of {0, ..., N-1} with no
   three-term arithmetic progression, computed exactly by backtracking for
   N <= 40. Roth's theorem says r3(N)/N -> 0, but the decay is extremely slow.
   We compare with the "base-3 digits 0 and 1" sets, which are 3AP-free.
2. Green-Tao: the primes contain arbitrarily long (finite) progressions. We
   find, for k = 3, ..., 7, the k-term progression of primes with the smallest
   last term.
3. Sum-product: for A = {1, ..., n}, |A + A| is small and |A . A| is large;
   for a geometric progression it is the other way round. Erdos and
   Szemeredi conjectured that one of the two is always nearly |A|^2.
"""

import math

def roth_number(N, smaller=()):
    """r3(N): the largest size of a subset of {0, ..., N-1} with no 3-term AP.

    `smaller` may list the known values r3(0), r3(1), ..., r3(N - 1). They speed
    up the exhaustive search: the elements still to be chosen lie in an interval
    of length L and form a 3AP-free set, so there are at most r3(L) of them."""
    table = list(smaller)

    def room(length):
        if length < len(table):
            return table[length]
        return length if not table else table[-1] + length - len(table) + 1

    best = table[-1] if table else 0  # a set for N - 1 also works for N
    chosen, member = [], [False] * N

    def ends_progression(x):
        # x is larger than every chosen element: it ends an AP a, b, x iff
        # a = 2b - x was chosen for some chosen b
        for b in chosen:
            a = 2 * b - x
            if a >= 0 and member[a]:
                return True
        return False

    def extend(x, size):
        nonlocal best
        if size + room(N - x) <= best:
            return  # cannot beat the best set known so far
        if x == N:
            best = size
            return
        if not ends_progression(x):
            chosen.append(x)
            member[x] = True
            extend(x + 1, size + 1)
            chosen.pop()
            member[x] = False
        extend(x + 1, size)

    extend(0, 0)
    return best

def roth_numbers(n_max):
    """[r3(1), ..., r3(n_max)], each search using all the smaller values."""
    table = [0]
    for N in range(1, n_max + 1):
        table.append(roth_number(N, table))
    return table[1:]

def has_three_ap(A):
    """True if the set A contains a, b, c with a < b < c and a + c = 2b."""
    s = sorted(set(A))
    members = set(s)
    return any((a + c) % 2 == 0 and (a + c) // 2 in members
               for i, a in enumerate(s) for c in s[i + 2:])

def base3_set(N):
    """Numbers below N whose base-3 digits are all 0 or 1 (a 3AP-free set)."""
    def ok(n):
        while n:
            if n % 3 == 2:
                return False
            n //= 3
        return True
    return [n for n in range(N) if ok(n)]

def prime_sieve(n):
    """sieve[i] is 1 exactly when i < n is prime."""
    sieve = bytearray([1]) * max(n, 2)
    sieve[0] = sieve[1] = 0
    for i in range(2, int(n ** 0.5) + 1):
        if sieve[i]:
            sieve[i * i::i] = bytearray(len(range(i * i, n, i)))
    return sieve

def smallest_prime_progression(k, limit=2000):
    """The k-term AP of primes with the smallest last term below limit, or None."""
    sieve = prime_sieve(limit)
    for last in range(2, limit):
        if not sieve[last]:
            continue
        for d in range(1, (last - 2) // (k - 1) + 1):
            if all(sieve[last - i * d] for i in range(1, k)):
                return [last - i * d for i in range(k - 1, -1, -1)]
    return None

def sum_and_product_sizes(A):
    """(|A + A|, |A . A|) for a finite set of integers A."""
    return (len({a + b for a in A for b in A}),
            len({a * b for a in A for b in A}))

def main():
    values = roth_numbers(40)
    print("1. Roth numbers r3(N), N = 1..40 (exact, exhaustive):")
    print("   " + " ".join(str(v) for v in values[:20]))
    print("   " + " ".join(str(v) for v in values[20:]))
    for N in (10, 20, 40):
        b = base3_set(N)
        print(f"   N = {N}: r3/N = {values[N - 1] / N:.2f}; base-3 set has "
              f"{len(b)} elements, 3AP-free: {not has_three_ap(b)}")
    print("   base-3 sets have about N^0.63 elements; Behrend (1946) does")
    print("   better: N exp(-c sqrt(log N)), still o(N) as Roth requires.")
    print()
    print("2. Progressions of k primes with the smallest last term:")
    for k in range(3, 8):
        ap = smallest_prime_progression(k)
        print(f"   k = {k}: {', '.join(map(str, ap))} (difference {ap[1] - ap[0]})")
    print()
    print("3. Sums versus products, |A| = 20:")
    n = 20
    for name, A in [("{1, ..., 20}", list(range(1, n + 1))),
                    ("{1, 2, 4, ..., 2^19}", [2 ** i for i in range(n)])]:
        s, p = sum_and_product_sizes(A)
        print(f"   A = {name:20s}  |A + A| = {s:3d}   |A . A| = {p:3d}")
    print(f"   (|A|^2 = {n * n}; max(|A+A|, |A.A|) is large in both cases)")
    print()
    print("Epistemic status: exact, exhaustive computations for the sizes shown.")
    print("Roth's theorem (r3(N)/N -> 0) and Green-Tao are theorems about")
    print("N -> infinity; finite tables cannot confirm or refute them, and the")
    print("sum-product conjecture remains open despite such examples.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

These computations are exact and exhaustive for the sizes shown, so they prove finite statements such as R(4,4)>17R(4, 4) \gt 17 or r3(40)=15r_3(40) = 15 (assuming the code is correct). They say nothing reliable about asymptotics: r3(N)/Nr_3(N)/N falls from 0.50.5 to 0.380.38 between N=10N = 10 and N=40N = 40, but Roth's theorem — that it tends to 00 — is invisible at this scale, and Behrend's construction shows the decay is slower than any power of NN. The same caution applies to Ramsey numbers: the exhaustive methods that settle R(4,4)R(4, 4) are hopeless for R(5,5)R(5, 5), where K43K_{43} has 29032^{903} colourings.

Explore

Exploring extremal and pseudo-random graphs

A Turán graph. T(7,3)T(7, 3) has parts of sizes 3,2,23, 2, 2 and 1616 edges. Use the colouring tab: three colours suffice (one per part), so it has no K4K_4; "Fewest possible?" confirms that it needs exactly three. Then try to add an edge mentally: any new edge lies inside a part, and together with one vertex from each of the other two parts it creates a K4K_4 — Turán's theorem says no K4K_4-free graph on 77 vertices has more edges.

The Turán graph T(7, 3)

Complete 3-partite with parts {a}, {b}, {c}: 16 edges and no K₄.

a1a2a3b1b2c1c2
|V| = 7|E| = 16Click a vertex to change its colour (Delete removes it).

0

colours used

0

clashes

7

uncoloured

Give every vertex a colour so that the two ends of each edge differ.

The Paley graph on 17 vertices. Open the matrix tab and look at A2A^2: its off-diagonal entries count common neighbours, and they take only two values — 33 for adjacent pairs, 44 for non-adjacent pairs. Every pair "sees" almost exactly the number of common neighbours a random graph of density 12\tfrac12 would give (≈15/4\approx 15/4). This quasirandomness (in the sense of Chung, Graham and Wilson) is why the graph has no homogeneous 44-set, and why Paley graphs are good, though not optimal for large kk, Ramsey colourings.

The Paley graph on Z/17

x ~ y when x − y is a non-zero square mod 17: no 4-clique and no independent 4-set.

|V| = 17|E| = 68Choose a cell of the matrix below.

Choose a cell: its row is the start vertex, its column the end vertex.

Each row of A adds up to the degree of its vertex.

A
012345678910111213141516
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Exercises

Exercises

1. Extremal and additive combinatorics

Warm-upHuman

How many edges does the Turán graph T(10,3)T(10, 3) have? (By Turán's theorem, this is the maximum number of edges of a K4K_4-free graph on 1010 vertices.)

2. Extremal and additive combinatorics

Warm-upHuman

What is the maximum number of edges in a triangle-free graph on 1111 vertices?

3. Extremal and additive combinatorics

CoreHuman

What upper bound does the Erdős–Szekeres inequality R(s,t)≤(s+t−2s−1)R(s, t) \le \binom{s + t - 2}{s - 1} give for R(4,5)R(4, 5)?

4. Extremal and additive combinatorics

CoreHuman

In the Zykov symmetrisation proof of Turán's theorem, we replace a vertex uu by a copy v′v' of a vertex vv with u≁vu \not\sim v (so v′v' is adjacent exactly to N(v)N(v)). Why does the new graph still contain no Kr+1K_{r+1}?

Choose one

5. Extremal and additive combinatorics

CoreHuman

Szemerédi's theorem assumes positive upper density. Which infinite set shows that being infinite is not enough to force even a three-term progression?

Choose one

6. Extremal and additive combinatorics

Warm-upHuman

What exactly does the Green–Tao theorem say?

Choose one

7. Extremal and additive combinatorics

StretchHuman

In the proof of Lemma 7 (Roth's key lemma) we bounded ∣∑r≠0f^(r)2f^(−2r)∣≤αmax⁡s≠0∣f^(s)∣\left|\sum_{r \neq 0} \hat f(r)^2 \hat f(-2r)\right| \le \alpha \max_{s \neq 0}|\hat f(s)|. Which facts does this step use?

Choose one

8. Extremal and additive combinatorics

CoreFormal

Recall RamseyProp α s t m: in every graph on α, every vertex set W with m ≤ W.card contains an s-clique or an independent t-set. Which statement expresses R(3,3)≤6R(3, 3) \le 6, and which theorem of the lesson proves it?

Choose one

9. Extremal and additive combinatorics

CoreHuman

Dvir's theorem says that a Kakeya set K⊆FqnK \subseteq \mathbb{F}_q^n has ∣K∣≥(q+n−1n)|K| \ge \binom{q + n - 1}{n}. What lower bound does it give for a Kakeya set in F52\mathbb{F}_5^2?

10. Extremal and additive combinatorics

StretchComputational

Write three_ap_free(A) (does the set A of integers contain no a<b<ca \lt b \lt c with a+c=2ba + c = 2b?) and roth_number(N), the largest size of a 3-AP-free subset of range(N), by trying all subsets from the largest size down. Check r3(N)r_3(N) for N≤12N \le 12.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"Small Ramsey numbers are easy to compute." R(3,3)=6R(3, 3) = 6 is a pleasant exercise and R(4,4)=18R(4, 4) = 18 took real work, but R(5,5)R(5, 5) is still unknown: deciding whether every colouring of K43K_{43} contains a monochromatic K5K_5 means, naively, examining 29032^{903} colourings. Erdős's famous quip imagined aliens demanding R(5,5)R(5, 5) on pain of destroying Earth — we should marshal all our computers — but demanding R(6,6)R(6, 6), when we should rather try to destroy the aliens.

Misconception

"Green–Tao says the primes contain an infinite arithmetic progression." They contain arbitrarily long finite progressions, and no infinite one: if a,a+d,a+2d,…a, a + d, a + 2d, \dots are all prime with a≥2a \ge 2, then the term a+ad=a(1+d)a + ad = a(1 + d) is composite. Likewise Szemerédi's theorem gives arbitrarily long finite progressions in dense sets, not infinite ones (the set of numbers with an even number of decimal digits has positive upper density and contains no infinite progression).

Misconception

"An infinite set must contain long progressions." Size in the sense of cardinality is not enough: the powers of 22 contain no 3-AP at all (2a+2c=2b+12^a + 2^c = 2^{b+1} forces a=ca = c). Szemerédi needs positive density; Green–Tao needs the special pseudorandomness of the primes; and the Erdős–Turán conjecture asks whether divergence of ∑1/a\sum 1/a suffices.

Misconception

"The probabilistic method gives constructions." It proves existence: most colourings of KnK_n with n≈2k/2n \approx 2^{k/2} avoid monochromatic KkK_k, but no one can write one down explicitly for large kk. The best explicit constructions — from Frankl and Wilson (1981) to recent work on randomness extractors by Chattopadhyay, Zuckerman, Cohen, Li and others — still give lower bounds far below 2k/22^{k/2}.

Misconception

"The regularity lemma gives good bounds." It gives qualitative theorems with tower-type bounds, and Gowers showed that the towers cannot be avoided in the lemma itself. Quantitative results such as Kelley–Meka's bound for r3(N)r_3(N) come from Fourier-analytic and probabilistic methods instead.

ViewpointsH

Viewpoints

Topology— Borsuk–Ulam, Kneser and recurrence

Topology proves combinatorial theorems that resist combinatorics. Kneser conjectured (1955) that if the kk-subsets of {1,…,n}\{1, \dots, n\} are coloured with n−2k+1n - 2k + 1 colours, two disjoint subsets get the same colour; Lovász (1978) proved it with the Borsuk–Ulam theorem, founding topological combinatorics (Bárány's and Greene's short proofs followed). In the other direction, topological dynamics proves Ramsey-type statements: Furstenberg and Weiss (1978) deduced van der Waerden's theorem — any finite colouring of Z\Z has monochromatic progressions of every length — from a multiple recurrence theorem for commuting homeomorphisms of a compact metric space. See algebraic topology.

Geometry— Incidences and the sum–product theorem

Elekes (1997) proved max⁡(∣A+A∣,∣A⋅A∣)≫∣A∣5/4\max(|A + A|, |A \cdot A|) \gg |A|^{5/4} for finite A⊂RA \subset \R by pure geometry. Consider the point set P=(A+A)×(A⋅A)P = (A + A) \times (A \cdot A) and the ∣A∣2|A|^2 lines ℓa,b:y=a(x−b)\ell_{a,b} : y = a(x - b) for a,b∈Aa, b \in A. Each line contains the ∣A∣|A| points (b+c,ac)(b + c, ac), c∈Ac \in A, of PP, so there are at least ∣A∣3|A|^3 incidences. The Szemerédi–Trotter theorem bounds the incidences between mm points and nn lines in the plane by O(m2/3n2/3+m+n)O(m^{2/3}n^{2/3} + m + n); hence ∣A∣3≪(∣A+A∣∣A⋅A∣)2/3∣A∣4/3|A|^3 \ll (|A + A||A \cdot A|)^{2/3}|A|^{4/3}, so ∣A+A∣∣A⋅A∣≫∣A∣5/2|A + A||A \cdot A| \gg |A|^{5/2}. Geometry over finite fields is subtler (no ordering), which is why the polynomial method and Dvir's theorem were such breakthroughs.

Analysis— Fourier analysis, Gowers norms and ergodic theory

Three-term progressions are controlled by Fourier coefficients (Lemma 7): the count is ∑rf^(r)2f^(−2r)\sum_r \hat f(r)^2\hat f(-2r). Four-term progressions are not — there are sets with uniformly tiny Fourier coefficients but the "wrong" number of 4-APs, such as {x:x2θ mod 1∈[0,ε)}\{x : x^2\theta \bmod 1 \in [0, \varepsilon)\}. Gowers introduced the uniformity norms ∥f∥Uk\|f\|_{U^k} that do control (k+1)(k+1)-APs, and the inverse theorems for these norms (Green–Tao–Ziegler, 2012) identify the obstructions as nilsequences: polynomial phases on nilmanifolds. Furstenberg's correspondence principle translates Szemerédi's theorem into multiple recurrence for a measure-preserving system (X,μ,T)(X, \mu, T): μ(E∩T−nE∩⋯∩T−(k−1)nE)>0\mu(E \cap T^{-n}E \cap \cdots \cap T^{-(k-1)n}E) \gt 0 for some nn whenever μ(E)>0\mu(E) \gt 0; the structure theory of Host–Kra (2005) found the same nilmanifolds. See harmonic analysis and ergodic theory.

Probability— Random graphs and quasirandomness

The random graph G(n,12)G(n, \tfrac12) has clique number and independence number about 2log⁡2n2\log_2 n with high probability — which is exactly why R(k,k)≥2k/2R(k, k) \ge 2^{k/2}. Chung, Graham and Wilson (1989) showed that many "random-like" properties of a graph sequence of density pp are equivalent: the right count of 44-cycles (≈p4n4\approx p^4n^4), the right count of every fixed subgraph, small second eigenvalue, uniform edge distribution. The Paley graphs are quasirandom in this sense. The dichotomy "quasirandom or structured" is the probabilistic face of the regularity lemma, and Lovász and Szegedy's theory of graph limits (graphons) packages it analytically. See the probabilistic method.

Number theory— Primes and pseudorandomness

For number theorists the prize is the primes. Van der Corput (1939) proved that the primes contain infinitely many 3-APs, using the circle method of Hardy and Littlewood; Green and Tao proved arbitrarily long progressions, and Green, Tao and Ziegler (2010–12) then proved the Hardy–Littlewood asymptotic for the number of kk-APs of primes up to NN, and for any "finite complexity" linear pattern. The Möbius function's lack of correlation with nilsequences (Green–Tao) is a key input. Twin primes, a pattern of "infinite complexity" for these methods, remain out of reach, although Zhang (2013) and Maynard–Tao proved bounded gaps between primes.

Logic— Unprovability and ultrafilters

Ramsey's theorem was a lemma in logic (on the decision problem, 1930). A mild strengthening of the finite Ramsey theorem — the homogeneous set must be "large", of size at least its minimum element — is true but unprovable in Peano arithmetic (Paris–Harrington, 1977), because the corresponding Ramsey function grows faster than any function PA can prove total. In the other direction, ultrafilters give slick proofs: Hindman's theorem (any finite colouring of N\N has an infinite set all of whose finite sums have one colour) follows from the existence of an idempotent ultrafilter in βN\beta\N (Galvin–Glazer). See incompleteness.

History & global context

History and global context

  • 1907–1930. Willem Mantel's triangle theorem (1907); Issai Schur (1916) proves that any finite colouring of {1,…,n}\{1, \dots, n\}, nn large, has a monochromatic solution of x+y=zx + y = z, motivated by Fermat's Last Theorem modulo pp; B. L. van der Waerden (1927) proves his theorem on monochromatic progressions; Frank Ramsey (1930) proves his theorem as a lemma in logic.
  • 1935–1947. Erdős and Szekeres rediscover Ramsey's theorem in a geometric problem (1935); Erdős and Turán conjecture that dense sets contain long progressions (1936); Pál Turán proves his theorem (1941), while in a labour camp; Erdős's random colourings found the probabilistic method (1947); Behrend's construction (1946).
  • 1953–1978. Klaus Roth's theorem (1953); Gregory Freiman's structure theory of sets with small doubling (1960s); Endre Szemerédi's theorem (1969 for k=4k = 4, 1975 in general) and the regularity lemma; Hillel Furstenberg's ergodic proof (1977); Ruzsa–Szemerédi's removal lemma (1978); Lovász's proof of Kneser's conjecture (1978).
  • 1983–2008. Erdős–Szemerédi's sum–product theorem (1983); Imre Ruzsa's new proof of Freiman's theorem (1994); Elekes's incidence proof (1997); Timothy Gowers's quantitative Szemerédi theorem (1998–2001); Ben Green and Terence Tao's theorem on primes (2004); Zeev Dvir's Kakeya theorem (2008).
  • 2010–2024. Larry Guth and Nets Katz on distinct distances (2010); Croot–Lev–Pach and Ellenberg–Gijswijt on cap sets (2016); Kelley–Meka on three-term progressions and Campos–Griffiths–Morris–Sahasrabudhe on diagonal Ramsey numbers (2023); the polynomial Freiman–Ruzsa conjecture over F2n\mathbb{F}_2^n (Gowers–Green–Manners–Tao, 2023), formalised in Lean within weeks; R(5,5)≤46R(5, 5) \le 46 (Angeltveit–McKay, 2024).

The subject grew largely from the Hungarian school around Paul Erdős — Turán, Rényi, Sós, Szemerédi, Lovász, Ruzsa, Elekes — and is now pursued worldwide, from Brazil (IMPA, where Morris works) and India to Israel, China and beyond.

Further reading

Further reading

  • Yufei Zhao, Graph Theory and Additive Combinatorics: Exploring Structure and Randomness (2023) — the best modern introduction: Turán, regularity, removal, Roth via Fourier, Freiman, sum–product, with exercises.
  • Terence Tao and Van H. Vu, Additive Combinatorics (2006) — the standard reference for sumsets, Freiman's theorem, Fourier and higher-order methods.
  • Stasys Jukna, Extremal Combinatorics, with Applications in Computer Science (2001; 2nd ed. 2011) — short chapters on Turán, Ramsey, the probabilistic and linear-algebra methods.
  • Noga Alon and Joel H. Spencer, The Probabilistic Method (1992; 4th ed. 2016) — random colourings, deletion, the local lemma.
  • Ronald L. Graham, Bruce L. Rothschild and Joel H. Spencer, Ramsey Theory (2nd ed. 1990).
  • Larry Guth, Polynomial Methods in Combinatorics (2016) — Dvir's theorem, incidences, distinct distances.
  • Ben Green and Terence Tao, "The primes contain arbitrarily long arithmetic progressions", Annals of Mathematics 167 (2008).
  • Jordan S. Ellenberg and Dion Gijswijt, "On large subsets of Fqn\mathbb{F}_q^n with no three-term arithmetic progression", Annals of Mathematics 185 (2017).

A reading path: Zhao, Chapters 1–6 (extremal graph theory, regularity, Roth) → Tao–Vu for the additive theory → Alon–Spencer for probabilistic tools → Guth for the polynomial method → the Green–Tao paper and the survey literature on higher-order Fourier analysis.