is Mathlib's Roth number
OpenErdos142.r_three_eq_rothNumberNatFor every ,
Here is the largest size of a subset of with no non-trivial three-term arithmetic progression, as defined in this mission, and is Mathlib's Roth number: the largest size of a subset of satisfying Mathlib's ThreeAPFree condition, namely that with in the set forces .
The two definitions differ in two respects — the ground set is shifted by one, and progression-freeness is expressed by a forbidden triple rather than by a forbidden pair with — and this identity says that neither difference matters. Its role in the mission is to anchor the definition: it certifies that the mission's APFree and r agree with an independently written, widely used formalization, so that no mis-quantified or vacuous definition can propagate into the harder milestones. It also makes the whole of Mathlib's three-term theory, including Behrend's construction, directly available to this mission.
import Mathlib import Definitions.Def_Erdos142Basic
namespace Erdos142 theorem r_three_eq_rothNumberNat (N : ℕ) : r 3 N = rothNumberNat N := by sorry end Erdos142
Read-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back: Erdos142.r_three_eq_rothNumberNat
The statement
For every natural number (an explicit universally quantified variable; there are no hypotheses of any kind, and no typeclass assumptions beyond those baked into the two definitions below), the claim is the equality of two natural numbers:
Both sides are natural numbers, so this is an equation in . Everything hinges on what the two sides unfold to, so each is expanded in full below.
The left-hand side:
is a bundle-local (non-standard, non-Mathlib) function defined by
where ranges over finite subsets of , the ambient interval is the closed integer interval (note: it starts at , and it is empty when ), is the number of elements of , and the supremum is the supremum of a set of natural numbers taken in the conditionally complete lattice . That last point carries the usual junk-value convention: if the set of cardinalities were empty or unbounded above, the supremum would be by fiat. Here neither degeneracy arises for a genuine reason — the empty set always qualifies, contributing the value , and every satisfies — so the supremum is an attained maximum. The definition is marked noncomputable.
The freeness condition, again bundle-local, is the following chain of definitions, instantiated at (the natural number is coerced into , the type in which the "length" parameter lives).
For a set in an additive commutative monoid, a length , and elements :
where denotes the cardinality of as an element of (equal to when is infinite), is the -fold monoid multiple of , and compares the coerced natural with in .
Note that is not required to be nonzero here; the constraint is the only thing that can force distinctness.
The conclusion of that implication is a statement about alone, not about or . Consequently: when the predicate holds vacuously for every ; when — in particular for the value used here — the conclusion is false, so the predicate says exactly that no subset satisfies .
Putting this together for over : a finite set is counted by exactly when there is no subset of (the underlying set of) and no pair with
Because the cardinality of is required to be exactly , the difference is forced to be nonzero (in , has three elements only if ), and the three terms are the set — the pattern is captured up to set equality, not as an ordered triple. So is the largest size of a subset of containing no three distinct elements forming an arithmetic progression with .
The right-hand side:
This is the Mathlib declaration rothNumberNat, a bundled monotone map , applied to . It is defined as the additive Roth number of the finite set — note this interval starts at and ends at , and is empty when . Unfolding the additive Roth number:
where denotes the largest satisfying , and if no such exists (the bound here is ). Since the predicate holds at via the empty set, this is the largest for which some -element -AP-free subset of exists.
Mathlib's -AP-freeness predicate for a set of naturals is:
(The three membership arguments and , , themselves are strict-implicit binders; the conclusion is literally .) This formulation admits the degenerate solution , and it is stated over the coercion of the finite set to a set.
What the equality therefore asserts
For every natural , the largest cardinality of a subset of having no subset that is a -element arithmetic progression equals the largest such that has an -element subset with the property that and together imply .
The two sides are computed over different ground intervals: on the left and on the right. Both are empty when , in which case the equation reads .
Notes on the surrounding bundle
The bundle also defines the predicates
and proves three auxiliary facts (the empty set is for every length; every progression-free satisfies ; and ). Neither nor appears in the statement being read back, and as written asks only for membership of the terms in , without requiring them to be distinct or to exhaust .
The proof body of the theorem is a placeholder (sorry); nothing about the truth of the equality is established by this file.