Lefebvre's variations, No. 316 — on a theme by Szemerédi: every 17 elements of an interval of 23 integers contain a 5-term arithmetic progression
ProvedLefebvreVariations.szemeredi_five_ap_forced_in_twentythreeSzemerédi's theorem says every set of positive upper density contains arbitrarily long arithmetic progressions; the quantitative question is how large a subset of must be to contain a 5-term progression. Writing for the largest size of a subset of consecutive integers with no 5-term progression, one has (computed by exhaustive search here; OEIS A003004, agreeing), so any 17 elements force a progression, while a 5-term-progression-free set of size 16 exists. The threshold is therefore sharp at this .
Formalization Note The conclusion is the pattern of the parent gowers_polynomial_pattern with k = 4, copied literally: ∃ (a d : ℕ), 1 ≤ d ∧ a + 4 * d < 23 ∧ ∀ j : Fin 5, ⟨a + j * d, _⟩ ∈ A, with A : Finset (Fin 23). In place of the real hypothesis delta * n ≤ A.card for n ≥ N₀(δ), the density hypothesis is the explicit 17 ≤ A.card on the fixed ambient Fin 23; there are no real numbers and no junk values.
Why this is a variation. A variation of the open platform problem gowers_polynomial_pattern (Szemerédi's theorem for progressions of length k+1, in density form), in the parent's own conclusion with k=4 and the density hypothesis replaced by the explicit threshold 17 <= |A| on Fin 23, which is sharp since r_5(23)=16 (exhaustive search in Python, agreeing with the OEIS table. A finite quantitative instance of the parent; no formal link to the general theorem is claimed. The parent is open on the platform; Szemerédi's theorem itself is proved in the literature, and the platform's proved qualitative statements (e.g. Erdos142.erdos_139_szemeredi) do not give these exact values.
Attribution. This statement belongs to Lefebvre's variations, a series proposed by Erwan Lefebvre: each variation plays an open problem of the platform at its first non-trivial size, so that it can be settled and then reused to attack the open problem itself.
import Mathlib set_option autoImplicit false
namespace LefebvreVariations
theorem szemeredi_five_ap_forced_in_twentythree (A : Finset (Fin 23)) (hA : 17 ≤ A.card) :
∃ (a d : ℕ) (_ : 1 ≤ d) (_ : a + 4 * d < 23),
∀ j : Fin 5,
∃ hlt : a + j.val * d < 23, ⟨a + j.val * d, hlt⟩ ∈ A := by
sorry
end LefebvreVariations