Skip to content

feat: add Szemerédi's theorem eval problem#285

Open
kim-em wants to merge 1 commit into
mainfrom
eval/szemeredi
Open

feat: add Szemerédi's theorem eval problem#285
kim-em wants to merge 1 commit into
mainfrom
eval/szemeredi

Conversation

@kim-em
Copy link
Copy Markdown
Collaborator

@kim-em kim-em commented May 21, 2026

This PR adds Szemerédi's theorem as a new lean-eval challenge problem — §37 of Oliver Knill's Some Fundamental Theorems in Mathematics, the section's first additional statement (generalizing Roth's theorem from 3-APs to k-APs).

Every subset of of positive upper density contains arbitrarily long arithmetic progressions.

mathlib has Roth's theorem (roth_3ap_theorem_nat, the k = 3 case) but not the full Szemerédi theorem. As of 2026 it has not been formalized in any major proof assistant — a well-known open formalization target.

🤖 Prepared with Claude Code

This PR adds Szemerédi's theorem (§37 of Knill's "Some Fundamental
Theorems in Mathematics", the section's first additional statement
generalizing Roth's theorem from 3-APs to k-APs) as a new eval problem:
every subset of ℕ of positive upper density contains arbitrarily long
arithmetic progressions. Mathlib has Roth's theorem (the k=3 case) but
not the full Szemerédi theorem, which has not yet been formalized in
any major proof assistant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment on lines +31 to +34
Filter.limsup
(fun n : ℕ =>
(∑ k ∈ Finset.range (n + 1), A.indicator (fun _ => (1 : ℝ)) k) / (n + 1))
Filter.atTop
Copy link
Copy Markdown
Contributor

@alreadydone alreadydone May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a roundabout way to define it. How about

Suggested change
Filter.limsup
(fun n : ℕ =>
(∑ k ∈ Finset.range (n + 1), A.indicator (fun _ => (1 : ℝ)) k) / (n + 1))
Filter.atTop
Filter.atTop.limsup fun n : ℕ ↦ (A ∩ .Iio n).ncard / n

and you can then remove open scoped BigOperators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants