IMOSLLean4

Formalization of IMO Shortlist Problems in Lean 4.

This repository stores formalization of IMO Shortlist problems from 2006 onwards in Lean 4. It mainly covers problems in the Algebra and Number Theory category, with some problems in the Combinatorics category included as well. All problems formalized here include their complete solutions.

Aside from formalizing the IMO Shortlist problems, this repository also formalizes attempts to generalize a few of these problems. For example, after rephrasing, the IMO Shortlist 2012 N8 problem reads as follows.

For any prime power , let be the finite field of elements. Prove that for every prime and for every , there exist two elements such that .

Then we prove more:

For any finite field of cardinality not equal to and for every , there exist two elements such that (and that this fails for cardinality ).

Installation and Dependencies

Please follow the instructions at https://leanprover-community.github.io/install/project.html about working on an existing project.

This project depends on Mathlib4 and is currently using version 4.28.0.

Documentation

The documentation of this project is available on this webpage. This documentation is built using doc-gen4.

The folder IMOSLLean4/Main contains the formalization of the IMO Shortlist problems. The files here are organized by year. The formalization of the main statement to be proved is named final_solution. If there are multiple parts to the problem, then part 1 is named final_solution_part1, part 2 is named final_solution_part2, and so on.

Meanwhile, the folder IMOSLLean4/Generalization contains formalization of generalized versions of some IMO Shortlist problems, such as the aforementioned IMO Shortlist 2012 N8 problem. The files here are organized by the problem they generalize.

Contributing

Thank you for your interest in contributing to this project! This repository is a personal project, so currently I am not looking for external contributions. That being said, feel free to fork this repository for your needs.

Progress

Below are some statistics on the number of problems formalized in this repository as of March 11, 2026. Here, "A" stands for Algebra, "C" stands for Combinatorics, and "N" stands for Number Theory.

Year Number of problems
Formalized All
A C N Total A C N Total
2006 4 0 6 10 6 7 7 20
2007 5 1 5 11 7 8 7 22
2008 5 3 2 10 7 6 6 19
2009 7 4 6 17 7 8 7 22
2010 5 1 3 9 8 7 6 21
2011 5 0 4 9 7 7 8 22
2012 4 2 5 11 7 7 8 22
2013 2 0 4 6 6 8 7 21
2014 3 2 3 8 6 9 8 23
2015 3 0 4 7 6 7 8 21
2016 4 1 2 7 8 8 8 24
2017 7 1 3 11 8 8 8 24
2018 1 1 4 6 7 7 7 21
2019 2 1 3 6 7 9 8 24
2020 3 0 3 6 8 8 7 23
2021 6 2 2 10 8 8 8 24
2022 3 2 2 7 8 9 8 25
2023 3 0 6 9 7 7 8 22
2024 2 1 4 7 8 8 7 23
Total 74 22 71 167 136 146 141 423