- The paper formalizes IMO problems by generating machine-checked proofs using Isabelle/HOL's Isar language.
- It demonstrates the application of formal methods to algebra, combinatorics, and number theory through structured proofs and automated tactics.
- The work integrates formal verification into educational courses, contributing to the IMO Grand Challenge and promoting advanced theorem proving skills.
This paper explores the formalization of solutions to problems from the International Mathematical Olympiad (IMO) within the Isabelle/HOL interactive theorem prover. The effort aims to establish a public repository of machine-checked IMO solutions, maintained by students at the University of Belgrade. This work is motivated by the IMO Grand Challenge, which seeks to develop AI capable of winning a gold medal at the IMO, with a specific focus on the formal-to-formal (F2F) variant.
The paper details the formalization process, emphasizing the use of the Isabelle/Isar proof language. It offers a concise overview of Isabelle/HOL's syntax and semantics, covering aspects such as type definitions (e.g., bool, nat, int, real), set theory, function types, and logical connectives. The Isar language is presented as a means of constructing human-readable, structured proofs. Definitions are introduced using keywords like definition, primrec, and fun, while lemmas and theorems are stated using lemma and theorem. Proof structures, including automated proofs (using methods like simp, auto, blast) and structured proofs, are also discussed.
The paper showcases the formalization of three IMO problems, each representing a different area of mathematics: algebra, combinatorics, and number theory.
Algebra Problem: IMO 2006 A2
The paper presents the official solution to problem A1 from 2006, which involves a recursively defined sequence of real numbers. The objective is to prove that an​>0 for n≥1. The formalization in Isabelle/HOL involves defining the sequence as a function mapping natural numbers to real values. The proof proceeds by strong induction, utilizing the less_induct rule in Isabelle/HOL. The formal proof mirrors the informal proof, with some additional verbosity to accommodate the automated provers.
Combinatorics Problem: IMO 2017 C1
The paper tackles problem C1 from 2017, a combinatorics problem involving a rectangle divided into smaller rectangles. The objective is to prove the existence of a small rectangle whose distances from the sides of the large rectangle are either all odd or all even. A key challenge lies in formalizing the problem statement, particularly the notion of a tiling. The authors introduce definitions for rectangles, squares, overlap, non-overlapping rectangles, and coverage. They then formalize the main theorem, requiring the existence of a rectangle within the tiling that satisfies the distance parity condition. The formal proof involves defining green and yellow squares in a checkerboard pattern, and proving lemmas about the number of green and yellow squares in different types of rectangles (green, yellow, and mixed).

Figure 1: Tiling of a rectangle.
Number Theory Problem: IMO 2017 N1
The paper formalizes problem N1 from 2017, a number theory problem concerning a sequence of positive integers defined recursively. The goal is to determine all values of a0​>1 for which there exists a number a such that an​=a for infinitely many values of n. The formalization involves defining a square root function for natural numbers and expressing the problem statement in Isabelle/HOL. The proof involves establishing claims about the sequence's behavior based on the residue of an​ modulo 3.
Educational Impact
The formalization effort is integrated into an Interactive Theorem Proving course at the University of Belgrade. The course aims to provide students with practical experience in formalizing mathematics and verifying software using Isabelle/HOL. Formalizing IMO problems is presented as a valuable task for practicing interactive theorem proving, due to their elementary nature, moderate complexity, and potential for contributing to automated problem-solving.
The paper acknowledges the relationship between informal proofs and their formal counterparts and cites Dana Scott's observations on the differences in problem-solving approaches between humans and computers. It also mentions existing work on formalizing IMO problems and high-school mathematics, including Manuel Eberl's formalization of IMO 2019 problems and the GeoCoq project.
Conclusion
This paper demonstrates the feasibility of formalizing IMO problem solutions within Isabelle/HOL. The authors advocate for the use of such formalization tasks in interactive theorem proving courses and propose a refined formulation of the IMO Grand Challenge, distinguishing between informal and formal aspects of problem-solving. The open repository of formalized IMO problems is intended to foster further contributions from the wider community. The experience shows that the difference between formal and informal proof significantly varies, mainly depending on the category of the problem. Problems in algebra usually have very rigorous informal proofs, that are easy to formalize. Unlike those, problems in combinatorics usually give a very rough proof outline, that requires significant effort to formalize.