{"id":47577471,"url":"https://github.com/YaelDillies/cam-combi","last_synced_at":"2026-04-15T03:00:59.947Z","repository":{"id":63855013,"uuid":"567778665","full_name":"YaelDillies/cam-combi","owner":"YaelDillies","description":"Formalisation of the Cambridge Part II and Part III courses Graph Theory, Combinatorics, Extremal and Probabilistic Combinatorics in Lean","archived":false,"fork":false,"pushed_at":"2026-04-14T06:03:35.000Z","size":1019,"stargazers_count":76,"open_issues_count":21,"forks_count":21,"subscribers_count":10,"default_branch":"master","last_synced_at":"2026-04-14T08:11:06.164Z","etag":null,"topics":["additive-combinatorics","combinatorics","lean4"],"latest_commit_sha":null,"homepage":"https://yaeldillies.github.io/LeanCamCombi/","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":"2022-11-18T14:58:29.000Z","updated_at":"2026-04-14T06:03:39.000Z","dependencies_parsed_at":"2024-05-23T09:27:16.559Z","dependency_job_id":"cf7a2fbc-f752-43bd-8f8a-f7ccb35054ff","html_url":"https://github.com/YaelDillies/cam-combi","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/YaelDillies/cam-combi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fcam-combi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fcam-combi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fcam-combi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fcam-combi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YaelDillies","download_url":"https://codeload.github.com/YaelDillies/cam-combi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YaelDillies%2Fcam-combi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31824118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-31T06:00:36.064Z","updated_at":"2026-04-15T03:00:59.931Z","avatar_url":"https://github.com/YaelDillies.png","language":"Lean","funding_links":[],"categories":["Lean"],"sub_categories":[],"readme":"# Cambridge combinatorics in Lean\n\n[![.github/workflows/push.yml](https://github.com/YaelDillies/cam-combi/actions/workflows/push.yml/badge.svg)](https://github.com/YaelDillies/cam-combi/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/cam-combi)\n\nThis repository aims at formalising the mathematics courses relevant to combinatorics that are lectured in Cambridge, UK.\n\n## What is formalisation?\n\nThe purpose of this repository is to *digitise* some mathematical definitions, theorem statements and theorem proofs. Digitisation, or formalisation, is a process where the source material, typically a mathematical textbook or a PDF file is transformed into definitions in a target system consisting of a computer implementation of a logical theory (such as set theory or type theory).\n\n### The source\n\nThe definitions, theorems and proofs in this repository are (mostly) taken from six Cambridge courses, as well as a course from ETH Zürich:\n* Part IV Connections between Model Theory and Combinatorics, Lent 2019, lectured by Julia Wolf\n* Part II Graph Theory, Michaelmas 2022, lectured by Julian Sahasrabudhe\n* Part III Combinatorics, Michaelmas 2022 \u0026 [Michaelmas 2023](https://github.com/YaelDillies/maths-notes/blob/master/combinatorics.pdf), lectured by Béla Bollobás\n* Part III Extremal and Probabilistic Combinatorics, Michaelmas 2023, lectured by Julian Sahasrabudhe\n* Part III [Ramsey Theory on Graphs, Michaelmas 2024](https://github.com/YaelDillies/maths-notes/blob/master/ramsey_theory.pdf), lectured by Julian Sahasrabudhe\n* Part III [Additive Combinatorics, Lent 2024](https://github.com/YaelDillies/maths-notes/blob/master/additive_combinatorics.pdf), lectured by Julia Wolf\n* ETH Math-D [Growth in Groups, Winter 2024](https://sites.google.com/view/simonmachado/teaching), lectured by Simon Machado\n\n### The target\n\nThe formal system which we are using as a target is [Lean 4](https://lean-lang.org). Lean is a dependently typed theorem prover and programming language based on the Calculus of Inductive Constructions. It is being developed at the [Lean Focused Research Organization](https://lean-fro.org) by Leonardo de Moura and his team.\n\nOur project is backed by [mathlib](https://leanprover-community.github.io), the major classical maths library written in Lean 4.\n\n## Content\n\nThe Lean code is located within the `LeanCamCombi` folder. Within it, one can find:\n* One subfolder for each course, containing **formal lecture transcripts** in the files named `Lecture1`, `Lecture2`, etc... and **formal example sheet translations** in the files named `ExampleSheet1`, `ExampleSheet2`, etc... We follow the mathlib philosophy of aiming for the most general result within reach. This means that not all proofs follow the lecture notes, and might instead derive a result proved in the lectures from a general theorem. Those general theorems and prerequisite lemmas are proved in other folders. Read below.\n* A `Mathlib` subfolder for the **prerequisites** to be upstreamed to mathlib. Lemmas that belong in an existing mathlib file `Mathlib.X` will be located in `LeanCamCombi.Mathlib.X`. We aim to preserve the property that `LeanCamCombi.Mathlib.X` only imports `Mathlib.X` and files of the form `LeanCamCombi.Mathlib.Y` where `Mathlib.X` (transitively) imports `Mathlib.Y`. Prerequisites that do not belong in any existing mathlib file are placed in subtheory folders. See below.\n* One folder for each **theory development**. The formal lecture transcripts only contain what was stated in the lectures, but sometimes it makes sense for a theory to be developed as a whole before being incorporated by the prerequisites or imported in the formal lecture transcripts.\n* An `Archive` subfolder for **archived results**. It sometimes happens in mathlib that a long argument gets replaced by a shorter one, with a different proof. When the long argument was proved in a lecture, we salvage it to `LeanCamCombi` for conservation purposes.\n\n### Content under development\n\nThe following topics are under active development in LeanCamCombi.\n\n* The Erdős-Rényi model for random graphs, aka binomial random graph\n* The Littlewood-Offord problem\n* The van den Berg-Kesten-Reimer inequality\n* Approximate subgroups\n* Model theoretic stability and its relation to additive combinatorics\n\nSee the [upstreaming dashboard](https://yaeldillies.github.io/cam-combi/upstreaming) for more information.\n\n### Current content\n\nThe following topics are covered in LeanCamCombi and could be upstreamed to Mathlib.\n\n* Kneser's addition theorem\n* The Sylvester-Chvatal theorem\n* Containment of graphs\n\nSee the [upstreaming dashboard](https://yaeldillies.github.io/cam-combi/upstreaming) for more information.\n\nThe following topics are archived because they are already covered by mathlib, but nevertheless display interesting proofs:\n* The Cauchy-Davenport theorem for `ℤ/pℤ` as a corollary of Kneser's theorem.\n\n### Past content\n\nThe following topics have been upstreamed to mathlib and no longer live in LeanCamCombi.\n\n* The Ahlswede-Zhang inequality\n* The four functions theorem and related discrete correlation inequalities: FKG inequality, Holley inequality, Daykin inequality, Marica-Schönheim inequality\n* The Marica-Schönheim proof of the squarefree special case of Graham's conjecture\n* The Cauchy-Davenport theorem for general groups, and also for linearly ordered cancellative semigroup\n* The Erdős-Ginzburg-Ziv theorem\n* Chevalley's theorem about constructible sets with and without a complexity bound\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/cam-combi)\n\nIn either case, run `lake exe cache get` and then `lake build` to build the project.\n\n### Contributing\n\n**This project is open to contribution**. You are in fact encouraged to have a look at the example sheet translations and try your hand at one of the problems. If you manage to prove one of them, please open a PR!\n\nIf you want to contribute a theorem or theory development, please open a PR! Note however that the standard of code is pretty high and that is not because you have formalised a concept/proved a theorem that it can be included into LeanCamCombi as is. Nonetheless I am willing to review your code and put it in shape for incorporation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYaelDillies%2Fcam-combi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYaelDillies%2Fcam-combi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYaelDillies%2Fcam-combi/lists"}