{"id":47300554,"url":"https://github.com/YaelDillies/apap","last_synced_at":"2026-03-31T06:00:41.686Z","repository":{"id":176478939,"uuid":"614287103","full_name":"YaelDillies/apap","owner":"YaelDillies","description":"Formalisation of the Kelley-Meka bound on Roth numbers","archived":false,"fork":false,"pushed_at":"2026-03-20T10:08:27.000Z","size":1671,"stargazers_count":21,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-29T08:35:37.343Z","etag":null,"topics":["additive-combinatorics","combinatorics","lean4"],"latest_commit_sha":null,"homepage":"https://yaeldillies.github.io/apap/","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YaelDillies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-15T09:31:38.000Z","updated_at":"2026-03-20T10:08:31.000Z","dependencies_parsed_at":"2024-01-10T09:43:43.829Z","dependency_job_id":"676f5647-61b1-4f32-ae84-5ef00602015a","html_url":"https://github.com/YaelDillies/apap","commit_stats":null,"previous_names":["yaeldillies/leanapap","yaeldillies/apap"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/YaelDillies/apap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fapap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fapap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fapap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fapap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YaelDillies","download_url":"https://codeload.github.com/YaelDillies/apap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fapap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31223286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-31T04:08:55.938Z","status":"ssl_error","status_checked_at":"2026-03-31T04:08:47.883Z","response_time":111,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["additive-combinatorics","combinatorics","lean4"],"created_at":"2026-03-17T01:38:19.982Z","updated_at":"2026-03-31T06:00:41.681Z","avatar_url":"https://github.com/YaelDillies.png","language":"Lean","funding_links":[],"categories":["Lean"],"sub_categories":[],"readme":"# Arithmetic Progressions - Almost Periodicity\n\n[![.github/workflows/push.yml](https://github.com/YaelDillies/apap/actions/workflows/push.yml/badge.svg)](https://github.com/YaelDillies/apap/actions/workflows/push.yml)\n[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/YaelDillies/apap)\n\nThe purpose of this repository is to *digitise* some mathematical definitions, theorem statements\nand theorem proofs. Digitisation, or formalisation, is a process where the source material,\ntypically a mathematical textbook or a pdf file or website or video, is transformed into definitions\nin a target system consisting of a computer implementation of a logical theory (such as set theory\nor type theory).\n\n## The source\n\nThe definitions, theorems and proofs in this repository are taken from the exposition of Bloom and\nSisask on the Kelley-Meka bound on Roth numbers [2302.07211](https://arxiv.org/abs/2302.07211).\n\nThe main result is that there is some constant `c \u003e 0` such that, if `A ⊆ {1, ..., N}` contains no\nnon-trivial arithmetic progression of length 3, then `|A| ≤ N/exp(c * (log n)^(1/12)))` for some\nconstant `c \u003e 0`. This is an amazing improvement over previous bounds, which were all of the form\n`N/(log n)^c` for some constant `c`.\n\n## The target\n\nThe formal system which we are using as a target system is Lean's dependent type theory. Lean is a\nproject being developed at AWS and Microsoft Research by Leonardo de Moura and his team.\n\n## Content of this project\n\nThis project currently contains about 3k lines of Lean code about the discrete (difference)\nconvolution, discrete Lp norms, discrete Fourier transform. It also contains proofs of a version of\nalmost periodicity and of a quantitative version of the Marcinkiewicz-Zygmund inequality.\n\nOnce finished, this project will contain two main results (here `R` is the Roth number, the maximum\nsize of a set without three term arithmetic progressions):\n* The **finite field case**: A proof that `R(F_q^n) ≤ q ^ (n - c * n ^ (1/9))` for some constant\n  `c`. This is worse than the Ellenberg-Gijswijt bound `R(F_q^n) ≤ q ^ (n - c * n)` which was\n  formalised in [Dahmen, Hölzl, Lewis](https://drops.dagstuhl.de/opus/volltexte/2019/11070/). The\n  goal here is therefore not to improve on the existing bound but instead demonstrate the\n  probability and Fourier analysis techniques, whereas Ellenberg-Gijswijt used the polynomial\n  method.\n* The **integer case**: A proof that `R(n) ≤ N/exp(c * (log n)^(1/9)))`, using the same techniques\n  as in the finite field case, except for the fact that we now use Bohr sets instead of subspaces.\n  This bound is a slight improvement over the Kelley-Meka bound (with `1/12` as the exponent instead\n  of `1/9`). It is due to Bloom and Sisask.\n\n### Code organisation\n\nThe Lean code is contained in the directory `APAP`. The subdirectories are:\n* `Mathlib`: Material missing from existing mathlib developments\n* `Prereqs`: New developments to be integrated to mathlib\n* `Physics`: The physical (as opposed to Fourier space) proof steps that are shared\n  between the finite field cases and integer case\n* `FiniteField`: The proof steps specific to the finite field case\n* `Integer`: The proof steps specific to the integer case\n\n## What next?\n\nAlmost periodicity is nowadays a standard tool in additive combinatorics. The version we formalised is sufficient for many applications. In particular, it gives one of the best known bounds on Freiman's theorem. As a side goal, we might tackle Freiman's theorem.\n\nThe discrete convolution/Lp norm/Fourier transform material belongs in mathlib and we hope to PR it there soon. Almost periodicity should similarly be upstreamed to mathlib given the numerous applications. The rest of the material might forever live in this repository.\n\nOn top of the new developments, there are many basic lemmas needed for this project that are currently missing from mathlib.\n\n## Getting the project\n\nTo build the Lean files of this project, you need to have a working version of Lean.\nSee [the installation instructions](https://lean-lang.org/install/).\nAlternatively, click on the button below to open an Ona workspace containing the project.\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/YaelDillies/mean-fourier)\n\nIn either case, run `lake exe cache get` and then `lake build` to build the project.\n\n## Build the blueprint\n\nSee instructions at https://github.com/PatrickMassot/leanblueprint/.\n\n## Acknowledgements\n\nOur project builds on mathlib. We must therefore thank its numerous contributors without whom this\nproject couldn't even have started.\n\nMuch of the project infrastructure has been adapted from\n* [sphere eversion](https://leanprover-community.github.io/sphere-eversion/)\n* [liquid tensor experiment](https://github.com/leanprover-community/liquid/)\n* [unit fractions](https://github.com/b-mehta/unit-fractions/)\n\n## Source reference\n\n`[BS]` : https://arxiv.org/abs/2302.07211\n\n[BS]: https://arxiv.org/abs/2302.07211\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYaelDillies%2Fapap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYaelDillies%2Fapap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYaelDillies%2Fapap/lists"}