Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Kelley–Meka (2023): r3(N)≤Ne−c(log⁡N)1/12r_3(N) \le N e^{-c(\log N)^{1/12}}r3​(N)≤Ne−c(logN)1/12

Open
Erdos142.kelley_meka

by Zexuan Liu · Sep 10, 2026 · Mathlib 0df444a (Lean v4.33.1)

additive-combinatoricsarithmetic-progressionscombinatoricsnumber-theory

There is a constant c>0c > 0c>0 such that, for all sufficiently large NNN,

r3(N)  ≤  N e−c(log⁡N)1/12.r_3(N) \;\le\; N\,e^{-c(\log N)^{1/12}} .r3​(N)≤Ne−c(logN)1/12.

This is the theorem of Kelley and Meka: a subset of {1,…,N}\{1,\dots,N\}{1,…,N} of size at least Nexp⁡(−c(log⁡N)1/12)N\exp(-c(\log N)^{1/12})Nexp(−c(logN)1/12) must contain a non-trivial three-term arithmetic progression. It was the first bound of quasipolynomial type for the three-term problem, superseding the logarithmic-barrier bound r3(N)≪N(log⁡N)−1−cr_3(N) \ll N(\log N)^{-1-c}r3​(N)≪N(logN)−1−c of Bloom and Sisask, itself the first improvement past N/log⁡NN/\log NN/logN.

Set against Behrend's lower bound Nexp⁡(−4log⁡N)N\exp(-4\sqrt{\log N})Nexp(−4logN​), this result narrows the three-term problem to determining the exponent of log⁡N\log NlogN in the exponential, somewhere between 1/121/121/12 and 1/21/21/2; the constant 1/21/21/2 is widely believed to be the truth. Kelley and Meka's argument rests on a sifting technique together with almost-periodicity results for convolutions, and it is the only route currently known to a density increment with polynomial dependence on the density.

Formalization Note. The implied constant of the usual ≪\ll≪ notation is absorbed into the statement: for large NNN any constant multiple can be traded for a slightly smaller ccc, so the displayed form with ∃c>0\exists c > 0∃c>0 and an eventual inequality is equivalent to the paper's, and fixes no arbitrary constant.

Preamble
import Mathlib
import Definitions.Def_Erdos142Basic
Formal statement
namespace Erdos142

theorem kelley_meka :
    ∃ c : ℝ, 0 < c ∧ ∀ᶠ N : ℕ in Filter.atTop,
      (r 3 N : ℝ) ≤ (N : ℝ) * Real.exp (-c * (Real.log N) ^ ((1 : ℝ) / 12)) := by sorry

end Erdos142
Source
Z. Kelley and R. Meka, Strong bounds for 3-progressions, arXiv:2302.05537, https://arxiv.org/abs/2302.05537 (abstract: if A is a subset of {1,...,N} with no non-trivial three-term arithmetic progression then |A| <= exp(-c(log N)^{1/12}) N). Cited as the best known upper bound for k=3 on Erdős Problem #142, https://www.erdosproblems.com/142 (cited there as [Er80, p.92], [Er81, p.4], [Er97c], [Va99, 1.27])
Read-back

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

Read-back: Erdos142.kelley_meka

The literal assertion

The theorem asserts the existence of a single real constant ccc such that

c>0andr(3,N)  ≤  N⋅exp⁡ ⁣(−c⋅(log⁡N)1/12)for all sufficiently large N∈N.c > 0 \qquad\text{and}\qquad r(3, N) \;\le\; N \cdot \exp\!\big(-c \cdot (\log N)^{1/12}\big) \quad\text{for all sufficiently large } N \in \mathbb{N}.c>0andr(3,N)≤N⋅exp(−c⋅(logN)1/12)for all sufficiently large N∈N.

Here r(3,N)r(3,N)r(3,N) is a natural number that is cast into R\mathbb{R}R before the comparison, NNN on the right-hand side is likewise the real cast of the natural number NNN, log⁡\loglog is the natural logarithm on R\mathbb{R}R, and exp⁡\expexp is the real exponential.

Quantifier order matters and is exactly this: first a real ccc is chosen, then positivity of ccc is asserted, and only then the "eventually" claim is made. The filter used is the "at infinity" filter on N\mathbb{N}N, so "eventually" unfolds to: there exists a threshold N0∈NN_0 \in \mathbb{N}N0​∈N such that the displayed inequality holds for every natural N≥N0N \ge N_0N≥N0​. Because the threshold is introduced after ccc, N0N_0N0​ is allowed to depend on ccc. Nothing constrains ccc from above, nothing constrains N0N_0N0​, and no lower bound on r(3,N)r(3,N)r(3,N) is claimed. The inequality is non-strict (≤\le≤).

The statement is made only for the value 333 in the first argument of rrr; nothing is asserted about r(k,N)r(k,N)r(k,N) for any other kkk.

What r(3,N)r(3,N)r(3,N) means in this bundle

rrr is defined in the imported bundle, not taken from any standard library, as

r(k,N)  =  sup⁡  { ∣S∣  :  S⊆{1,2,…,N} a finite set, S is "AP-of-length-k free" },r(k,N) \;=\; \sup\;\Big\{\, |S| \;:\; S \subseteq \{1,2,\dots,N\} \text{ a finite set, } S \text{ is "AP-of-length-}k\text{ free"} \,\Big\},r(k,N)=sup{∣S∣:S⊆{1,2,…,N} a finite set, S is "AP-of-length-k free"},

where {1,…,N}\{1,\dots,N\}{1,…,N} is the integer interval from 111 to NNN inclusive, ∣S∣|S|∣S∣ is the cardinality of the finite set SSS, and the supremum is the supremum in N\mathbb{N}N. The index set of the supremum always contains 000 (take S=∅S = \emptysetS=∅) and is bounded above by NNN, so the supremum is an honest maximum; in particular the degenerate supremum convention (value 000 for an empty or unbounded index set) is never triggered. Two auxiliary lemmas in the bundle, both fully proved, record exactly this: every progression-free S⊆{1,…,N}S \subseteq \{1,\dots,N\}S⊆{1,…,N} satisfies ∣S∣≤r(k,N)|S| \le r(k,N)∣S∣≤r(k,N), and r(k,N)≤Nr(k,N) \le Nr(k,N)≤N for all k,Nk,Nk,N.

What "AP-of-length-kkk free" means in this bundle

The freeness predicate applied to the set SSS (viewed as a subset of N\mathbb{N}N) with length parameter 333 is defined as:

for every subset t⊆St \subseteq St⊆S, if ttt is an arithmetic progression of length 333, then 3≤13 \le 13≤1.

Since 3≤13 \le 13≤1 is false, this is equivalent to: no subset of SSS is an arithmetic progression of length 333.

"ttt is an arithmetic progression of length lll" is in turn defined as: there exist a,da, da,d (elements of the ambient additive commutative monoid, here a,d∈Na, d \in \mathbb{N}a,d∈N) such that

  1. the cardinality of ttt, measured in N∪{∞}\mathbb{N} \cup \{\infty\}N∪{∞}, equals lll; and
  2. ttt is exactly the set { a+n⋅d  :  n∈N, n<l }\{\, a + n\cdot d \;:\; n \in \mathbb{N},\ n < l \,\}{a+n⋅d:n∈N, n<l}.

For l=3l = 3l=3 this says t={a, a+d, a+2d}t = \{a,\ a+d,\ a+2d\}t={a, a+d, a+2d} and ∣t∣=3|t| = 3∣t∣=3. The cardinality clause is a genuine extra requirement: it forces aaa, a+da+da+d, a+2da+2da+2d to be three distinct elements, which over N\mathbb{N}N rules out d=0d = 0d=0. So the common difference is never zero in the progressions that are forbidden, even though the definition itself never mentions d≠0d \ne 0d=0; and the definition requires ttt to equal the three-element progression, not merely to contain it.

Note that this is the set-theoretic notion of a progression: an unordered three-element subset {a,a+d,a+2d}⊆N\{a, a+d, a+2d\} \subseteq \mathbb{N}{a,a+d,a+2d}⊆N. Also note that the length parameter of the freeness predicate has type N∪{∞}\mathbb{N} \cup \{\infty\}N∪{∞}, and the natural number 333 appearing in r(3,N)r(3,N)r(3,N) is coerced into it.

The real-exponent power

The expression (log⁡N)1/12(\log N)^{1/12}(logN)1/12 uses the exponent 1/121/121/12 as a real number, so the power is the real-exponent power (rpow), not iterated multiplication. For a base x>0x > 0x>0 this is the ordinary exp⁡(112log⁡x)\exp\big(\tfrac{1}{12}\log x\big)exp(121​logx), i.e. the real twelfth root. Its total-function conventions matter only at small NNN: for N=0N = 0N=0 and N=1N = 1N=1 the logarithm is 000 (with log⁡0=0\log 0 = 0log0=0 by the library's convention), and 01/12=00^{1/12} = 001/12=0 since the exponent is nonzero, so the bound degenerates to r(3,N)≤Nr(3,N) \le Nr(3,N)≤N there. For every N≥2N \ge 2N≥2 the base log⁡N\log NlogN is strictly positive, so the negative-base branch of the real power (where xy=∣x∣ycos⁡(πy)x^y = |x|^y \cos(\pi y)xy=∣x∣ycos(πy) for x<0x < 0x<0) is never reached at any N≥1N \ge 1N≥1. Because the claim is only made eventually, none of these small values is actually asserted about.

Degenerate and edge cases folded into the statement

  • r(3,0)=0r(3,0) = 0r(3,0)=0, since {1,…,0}\{1,\dots,0\}{1,…,0} is empty; r(3,N)r(3,N)r(3,N) is always at least 000 and at most NNN, so the asserted inequality is a statement strictly stronger than the trivial bound r(3,N)≤Nr(3,N) \le Nr(3,N)≤N exactly because the exponential factor exp⁡(−c(log⁡N)1/12)\exp(-c(\log N)^{1/12})exp(−c(logN)1/12) is <1< 1<1 for N≥2N \ge 2N≥2 and c>0c > 0c>0.
  • The freeness hypothesis inside the definition of rrr is satisfiable (the empty set is progression-free, and this is proved in the bundle), so the supremum's index set is nonempty; the theorem is not vacuous on that account.
  • The theorem carries no hypotheses of its own: there are no variables bound outside it and no typeclass assumptions beyond those built into R\mathbb{R}R and N\mathbb{N}N. The bundle's definitions are stated for a general additive commutative monoid α\alphaα, but the theorem instantiates them at α=N\alpha = \mathbb{N}α=N only.

Items present in the bundle but not used by this statement

The bundle also defines an "elementary" pair of predicates: HasAP(k,A)\mathrm{HasAP}(k, A)HasAP(k,A), saying there exist aaa and ddd with d>0d > 0d>0 such that a+i d∈Aa + i\,d \in Aa+id∈A for every i<ki < ki<k (a containment condition on an indexed progression, with no distinctness or exact-equality requirement), and APFree(k,A)\mathrm{APFree}(k,A)APFree(k,A), its negation. Neither of these appears in the definition of rrr nor in the theorem; the theorem's notion of progression-freeness is solely the set-equality-plus-cardinality one described above.

Proof status

The proof of the theorem is left unfilled in the file (sorry); only the auxiliary bundle lemmas about the empty set, the lower bound ∣S∣≤r(k,N)|S| \le r(k,N)∣S∣≤r(k,N), and the upper bound r(k,N)≤Nr(k,N) \le Nr(k,N)≤N carry complete proofs.

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.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me