Skip to the content.

Cambridge combinatorics in Lean

.github/workflows/push_master.yml Gitpod Ready-to-Code

This repository aims at formalising the mathematics courses relevant to combinatorics that are lectured in Cambridge, UK.

What is formalisation?

The 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).

The source

The definitions, theorems and proofs in this repository are (mostly) taken from five Cambridge courses:

The target

The formal system which we are using as a target is Lean 4. Lean is a dependently typed theorem prover and programming language based on the Calculus of Inductive Constructions. It is being developed at AWS and Microsoft Research by Leonardo de Moura and his team.

Our project is backed by mathlib, the major classical maths library written in Lean 4.

Content

The project contains

Content under development

The following topics are under active development in LeanCamCombi.

Here is a precise list of the files containing unfinished material, along with their number of sorry:

| File | Sorries | | —- | ——- |

Current content

The following topics are covered in LeanCamCombi and could be upstreamed to mathlib.

Here is the list of files that do not depend on any other LeanCamCombi file, indicating they are good candidates for upstreaming to mathlib:

The following topics are archived because they are already covered by mathlib, but nevertheless display interesting proofs:

Past content

The following topics have been upstreamed to mathlib and no longer live in LeanCamCombi.

Interacting with the project

Getting the project

At the moment, the recommended way of browsing this repository is by using a Lean development environment. Crucially, this will allow you to introspect Lean’s “Goal state” during proofs, and easily jump to definitions or otherwise follow paths through the code.

We are looking into ways to setup an online interactive website that will provide the same experience without the hassle of installing a complete Lean development environment.

For the time being: please use the installation instructions to install Lean and a supporting toolchain. After that, download and open a copy of the repository by executing the following commands in a terminal:

git clone https://github.com/YaelDillies/LeanCamCombi
cd LeanCamCombi
lake exe cache get
cd ../
code LeanCamCombi

If you are interested, here are detailed instructions on how to work with Lean projects.

Browsing the project

With the project opened in VScode, you are all set to start exploring the code. There are two pieces of functionality that help a lot when browsing through Lean code:

Contributing

This project is open to contribution. You are in fact encouraged to have a look at the example sheet formalisations and try your hand at one of the problems. If you manage to prove one of them, please open a PR!

If 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.