Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Behrend's lower bound: r3(N)≥Ne−4log⁡Nr_3(N) \ge N e^{-4\sqrt{\log N}}r3​(N)≥Ne−4logN​

Open
Erdos142.behrend_lower_bound

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

additive-combinatoricsarithmetic-progressionscombinatoricsnumber-theory

For every NNN,

N e−4log⁡N  ≤  r3(N).N\,e^{-4\sqrt{\log N}} \;\le\; r_3(N).Ne−4logN​≤r3​(N).

Behrend's 1946 construction produces a subset of {1,…,N}\{1,\dots,N\}{1,…,N} of this size containing no non-trivial three-term arithmetic progression, by taking integers whose digits in a suitable base are the coordinates of lattice points on a sphere; strict convexity of the sphere prevents any point from being the midpoint of two others, which is exactly the three-term condition. The explicit constant 444 in the exponent is the one carried by the formalized version in Mathlib.

This bound is the reason the problem is hard rather than merely unsolved. It shows the truth at k=3k = 3k=3 is of the shape Nexp⁡(−Θ(log⁡N))N\exp(-\Theta(\sqrt{\log N}))Nexp(−Θ(logN​)), so no asymptotic formula can be a power of log⁡N\log NlogN, and it places an absolute ceiling on how strong an upper bound can be: no argument may prove r3(N)≤Nexp⁡(−(log⁡N)1/2+ε)r_3(N) \le N\exp(-(\log N)^{1/2+\varepsilon})r3​(N)≤Nexp(−(logN)1/2+ε). Together with the monotonicity milestone it yields the same lower bound for every k≥3k \ge 3k≥3.

Preamble
import Mathlib
import Definitions.Def_Erdos142Basic
Formal statement
namespace Erdos142

theorem behrend_lower_bound (N : ℕ) :
    (N : ℝ) * Real.exp (-4 * Real.sqrt (Real.log N)) ≤ (r 3 N : ℝ) := by sorry

end Erdos142
Source
F. A. Behrend, On sets of integers which contain no three terms in arithmetical progression, Proc. Nat. Acad. Sci. USA 32 (1946), 331-332, https://doi.org/10.1073/pnas.32.12.331; formalized in Mathlib as `Behrend.roth_lower_bound` (Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean), whose explicit constant this statement reproduces. Cited 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.behrend_lower_bound

The statement

The declaration asserts a single claim, universally quantified over every natural number NNN, with no hypotheses whatsoever (in particular N=0N = 0N=0 and N=1N = 1N=1 are included):

N⋅exp⁡ ⁣(−4 log⁡N)  ≤  r(3,N).N \cdot \exp\!\left(-4\,\sqrt{\log N}\right) \;\le\; r(3, N).N⋅exp(−4logN​)≤r(3,N).

Here NNN on the left is the image of the natural number NNN under the canonical embedding N↪R\mathbb{N} \hookrightarrow \mathbb{R}N↪R, log⁡\loglog is the real natural logarithm, ⋅\sqrt{\cdot}⋅​ is the real square root, exp⁡\expexp is the real exponential, and the right-hand side is the natural number r(3,N)r(3,N)r(3,N) (defined below) likewise cast into R\mathbb{R}R. The inequality is non-strict (≤\le≤), and it is a lower bound on r(3,N)r(3,N)r(3,N). The exponent is the product of the real constant −4-4−4 with log⁡N\sqrt{\log N}logN​.

What r(k,N)r(k, N)r(k,N) means in this file

The quantity r(k,N)r(k,N)r(k,N) is not a Mathlib notion; it is defined in the imported bundle as a natural number given by a supremum of a set of natural numbers:

r(k,N)  =  sup⁡{ ∣S∣  ∣  S⊆{1,2,…,N},  S is APFreek },r(k, N) \;=\; \sup\Bigl\{\, |S| \;\Bigm|\; S \subseteq \{1, 2, \ldots, N\},\ \ S \text{ is } \mathrm{APFree}_k \,\Bigr\},r(k,N)=sup{∣S∣​S⊆{1,2,…,N},  S is APFreek​},

where SSS ranges over finite subsets of N\mathbb{N}N, ∣S∣|S|∣S∣ is its cardinality, and {1,…,N}\{1,\dots,N\}{1,…,N} is the integer interval from 111 to NNN inclusive (which is empty when N=0N = 0N=0). The supremum is taken in N\mathbb{N}N; the defining set is always non-empty (it contains ∣∅∣=0|\emptyset| = 0∣∅∣=0) and is bounded above by NNN, so this is a genuine maximum. The bundle also records, as separate already-proved facts, that the empty set is progression-free for every length, that any 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 that r(k,N)≤Nr(k,N) \le Nr(k,N)≤N for all k,Nk, Nk,N. The theorem instantiates k=3k = 3k=3.

What "progression-free" means in this file

The predicate applied to SSS above is, unfolded completely, the following. Working in an arbitrary additive commutative monoid α\alphaα (instantiated here at α=N\alpha = \mathbb{N}α=N, with SSS viewed as a set of naturals), and with a length parameter lll living in the extended naturals N∪{∞}\mathbb{N} \cup \{\infty\}N∪{∞} (here l=3l = 3l=3, the natural number 333 coerced into the extended naturals):

  • A set t⊆αt \subseteq \alphat⊆α is an arithmetic progression of length lll with first term aaa and difference ddd when both
#t=landt={ a+n⋅d  :  n∈N, n<l },\#t = l \qquad\text{and}\qquad t = \{\, a + n \cdot d \;:\; n \in \mathbb{N},\ n < l \,\},#t=landt={a+n⋅d:n∈N, n<l},

where #t\#t#t is the extended-natural cardinality of ttt and n⋅dn \cdot dn⋅d is the nnn-fold monoid multiple of ddd (ordinary multiplication when α=N\alpha = \mathbb{N}α=N).

  • A set ttt is an arithmetic progression of length lll when such aaa and ddd exist.
  • A set sss is progression-free of length lll when
∀ t⊆s,(t is an arithmetic progression of length l)  ⟹  l≤1.\forall\, t \subseteq s,\quad \bigl(t \text{ is an arithmetic progression of length } l\bigr) \;\Longrightarrow\; l \le 1 .∀t⊆s,(t is an arithmetic progression of length l)⟹l≤1.

Because the theorem fixes l=3l = 3l=3, the conclusion l≤1l \le 1l≤1 of that implication is false, so for l=3l = 3l=3 the predicate is equivalent to: no subset ttt of sss is an arithmetic progression of length 333, i.e. there are no a,da, da,d with {a,a+d,a+2d}⊆s\{a, a+d, a+2d\} \subseteq s{a,a+d,a+2d}⊆s and #{a,a+d,a+2d}=3\#\{a, a+d, a+2d\} = 3#{a,a+d,a+2d}=3. The cardinality clause forces the three terms to be distinct, hence d≠0d \ne 0d=0; a constant "progression" with d=0d = 0d=0 has cardinality 111 and is therefore not excluded. Note the second clause demands set equality t={a,a+d,a+2d}t = \{a, a+d, a+2d\}t={a,a+d,a+2d}, not merely containment, so ttt is exactly the three-term progression.

The bundle additionally defines two elementary predicates — "AAA contains a kkk-term progression" (∃ a,d\exists\, a, d∃a,d with d>0d > 0d>0 and a+id∈Aa + i d \in Aa+id∈A for all i<ki < ki<k) and its negation — but neither of these is used by rrr or by the theorem; the theorem's notion of progression-freeness is exclusively the set-and-cardinality one spelled out above.

Degenerate and edge cases the quantifier silently includes

  • N=0N = 0N=0. The cast of 000 into R\mathbb{R}R is 000, so by Mathlib's convention log⁡0=0\log 0 = 0log0=0 (the logarithm is a total function taking the junk value 000 at 000 and at all non-positive reals), hence log⁡0=0=0\sqrt{\log 0} = \sqrt{0} = 0log0​=0​=0 and exp⁡(0)=1\exp(0) = 1exp(0)=1. The left-hand side is therefore 0⋅1=00 \cdot 1 = 00⋅1=0. Meanwhile {1,…,0}\{1,\dots,0\}{1,…,0} is empty, so the only admissible SSS is ∅\emptyset∅ and r(3,0)=0r(3,0) = 0r(3,0)=0. The claim in this case reads 0≤00 \le 00≤0.
  • N=1N = 1N=1. Again log⁡1=0\log 1 = 0log1=0, 0=0\sqrt{0} = 00​=0, exp⁡(0)=1\exp(0) = 1exp(0)=1, so the left-hand side is exactly 111, and the claim reads 1≤r(3,1)1 \le r(3,1)1≤r(3,1).
  • Square root at small arguments. Mathlib's Real.sqrt is total and returns 000 on every non-positive input. Since log⁡N≥0\log N \ge 0logN≥0 for every natural N≥1N \ge 1N≥1 and log⁡0=0\log 0 = 0log0=0 by the convention above, the argument of the square root is never negative for any NNN in this statement, so the ⋅\sqrt{\cdot}⋅​ junk-value branch is never reached; only the log⁡\loglog convention at N=0N = 0N=0 is load-bearing.
  • Sign of the exponent. For N≥2N \ge 2N≥2 the exponent −4log⁡N-4\sqrt{\log N}−4logN​ is strictly negative, so the exponential factor lies strictly between 000 and 111 and the left-hand side is strictly less than NNN; the claim is thus weaker than N≤r(3,N)N \le r(3,N)N≤r(3,N) for those NNN.
  • No hypothesis restricts NNN to be large, positive, or of any particular form, and no hypothesis in the statement is vacuous or unsatisfiable — the statement is a bare universally quantified inequality.

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