The density converges
OpenErdos142.exists_density_limitFor every there is a real number with
The sequence is subadditive and non-negative, so Fekete's subadditivity lemma applies and the ratios converge to their infimum, which lies in .
The existence of this limit is what turns Szemerédi's theorem into a sharp statement rather than a vague one: the upper density of a progression-free set is automatically well defined, and Szemerédi's theorem is exactly the assertion that the limit equals for every . Proving convergence first, without identifying the value, isolates the soft part of the story from the hard part and gives later milestones a stable object to work with.
import Mathlib import Definitions.Def_Erdos142Basic
namespace Erdos142
theorem exists_density_limit (k : ℕ) (hk : 0 < k) :
∃ c : ℝ, Filter.Tendsto (fun N : ℕ => (r k N : ℝ) / (N : ℝ)) Filter.atTop (nhds c) := by sorry
end Erdos142Read-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back: Erdos142.exists_density_limit
The statement
For every natural number satisfying , there exists a real number such that the sequence of real numbers
converges to as (convergence along the "eventually large" filter on , towards the standard neighbourhood filter of in ).
Here ranges over the natural numbers, is an unconstrained real number (no sign, size, or membership condition is imposed on it — in particular it is not required to lie in ), and is the natural number defined in the accompanying bundle, coerced into , divided by the coercion of into . The assertion is purely the existence of a limit; no value, no formula, no rate, and no monotonicity for the sequence is claimed, and the existential is a plain , not a uniqueness statement.
Expansion of the quantity
is not a standard imported notion; it is defined in the bundle as a supremum of a set of natural numbers:
where:
- ranges over finite subsets of with (the integer interval from to inclusive, which is empty when ), and is its cardinality;
- the length parameter is the natural number regarded as an element of ;
- the supremum is the order-theoretic supremum inside . This is a total operation with a junk value: the supremum of the empty set, or of a set unbounded above, is . (For this particular set neither degeneracy occurs: the empty set always qualifies, contributing the value , and every candidate value is bounded by ; the bundle records this as .)
Expansion of "AP-of-length- free"
The freeness predicate applied to (viewed as a set of naturals) unfolds, in the bundle, to:
for every subset , if is an arithmetic progression of length , then .
Note the exact shape: the conclusion of the implication is a statement about the length parameter alone, not about . Consequently, when the predicate is satisfied by every set vacuously (the conclusion is already true), and when the predicate says exactly that no subset of is an arithmetic progression of length . Since the theorem's hypothesis is , the case is permitted and falls into the first, degenerate regime: there is the supremum of over all , i.e. .
" is an arithmetic progression of length " itself unfolds to: there exist a first term and a common difference such that
where denotes the cardinality of as an element of , and is the -fold sum of (in , ordinary multiplication). Two things this literally requires: the set must be equal to the displayed set (not merely contain it), and its cardinality must be exactly . The difference is allowed to be and no positivity is assumed of it; however, when the value makes the displayed set equal to , of cardinality , so the cardinality clause rules it out. The subsets quantified over are arbitrary subsets of (all of them finite, since is).
The bundle also defines an elementary predicate — "there exist and with for all " — and its negation, but neither of these appears in the definition of nor anywhere in the theorem statement; they play no role in what is asserted here.
Degenerate and edge cases the statement silently includes
- is excluded by the hypothesis ; is included, and in that case, as noted, the freeness condition is vacuous.
- Division by zero. The quotient is real division, which in this setting is a total function with by convention. The term at is therefore , regardless of the numerator. (Here is empty, so as well.) Because the convergence is along the filter of large , any finite set of initial terms — including this one — is irrelevant to the truth of the claim.
- Empty sets. is always an admissible competitor in the supremum defining , and the bundle records that the empty set is free of arithmetic progressions of every length.
- The hypothesis is satisfiable, so the statement is not vacuous on that account; it is a claim about every positive .
Ambient conventions
The declaration lives in the namespace Erdos142. The definitions of arithmetic progressions in the bundle are stated for a general commutative additive monoid, but , and hence this theorem, instantiate them at . The limit is taken in with its usual topology; the index set is with its order filter at infinity.