Olympiad mathematics, Lean, and AI

IMO 2026 in Lean: GPT-5.6 Sol and AxiomProver

The mathematical content of twelve Lean proof developments, problem by problem.

Axiom Math released formal Lean statements and AxiomProver solutions for all six IMO 2026 problems. I copied only the six statement files into a separate project and gave them to GPT-5.6 Sol in Ultracode mode. Ultracode spawned subagents that worked on the problems concurrently. The model was not told that AxiomProver had solved the problems.

The prompt prohibited web search, GitHub, published solutions, proof databases, the other IMO problem files, and network-enabled theorem search. GPT could use the designated problem file, the installed Lean/Mathlib environment, local declaration inspection, and compiler feedback. The full protocol is recorded in gpt/AGENTS.md.

The recorded Ultracode run times were 22 minutes for P1, 1 hour 10 minutes for P2, 1 hour 58 minutes for P3, 26 minutes for P4, 32 minutes for P5, and 45 minutes for P6. These runs overlapped because subagents worked on several problems simultaneously. The complete experiment took about three hours of wall-clock time, so the per-problem durations should not be added to obtain the elapsed session time. The timings are informative, but this was not a controlled speed benchmark against AxiomProver.

Independent GPT project

about 3 h wall-clock time

Six GPT-5.6 Sol Ultracode proof runs with concurrent subagents.

5,206 lines of Lean.

junaid-hasan/2026_problems

Proof files · Prompt · Provenance

AxiomProver project

24 h 56 min reported

Sum of Axiom Math's published per-problem run times.

7,722 lines of Lean.

AxiomMath/IMO2026

Statements and proofs · Reported timings · MIT License

Source size and recorded run time

Line counts are physical source lines. GPT used Ultracode with concurrent subagents, so its per-problem durations overlap. The GPT total is the wall-clock duration of the full session. Axiom times are those reported by Axiom Math.

ProblemGPT linesAxiom linesGPT Ultracode timeAxiom reported time
P139452122 min24 min
P26361,2241 h 10 min360 min
P32,9474,2291 h 58 min869 min
P443152026 min39 min
P526945732 min65 min
P652977145 min139 min
Total5,2067,722about 3 h wall-clock time1,496 min (24 h 56 min)
About the P3 line count. The current GPT P3 file has 2,947 lines. It contains overlapping helper lemmas and repeated infrastructure produced by different Ultracode subagents, so the raw file is not line-minimal. A separate compression pass should reduce it substantially.
Provenance. The six statement files are copied from Axiom Math's MIT-licensed repository; the GPT proof files were produced independently.

The reusable artifact: AGENTS.md

Problem 1. Blackboard gcd and lcm process

There are integers greater than on a blackboard. In one move, two entries are replaced by Prove that every play terminates with exactly one entry , and that is independent of the choices.

For a board and a prime , define If and , then a move replaces by Since , every is invariant. Here zeros among the valuations do not affect the gcd, so exactly when divides at least one board entry.

Thus, if a terminal board has unique entry , then It remains only to prove termination and to rule out a terminal board of all ones.

The GPT proofGPT Lean source

Set ordered lexicographically. Let . The product of the two new entries is , so the board product is divided by . If , the first coordinate of decreases. If , the move is , so the product is unchanged and the second coordinate decreases. Hence strictly decreases in the well-founded order , and every play terminates.

A move cannot replace two numbers by two ones. If , the other output is ; if , the first output is already greater than . Therefore every reachable board contains an entry . A terminal board contains at most one such entry, hence exactly one. Formula (1) proves that its value is determined by the initial board.

The Axiom proofAxiom Lean source

Let be the number of prime factors of , counted with multiplicity, and put For the chosen pair, the total decreases by , where . If , the -sum is unchanged and the number of entries decreases by one. If , the first term decreases by at least , while the second term does not increase. Thus strictly decreases in . Termination follows.

The same observation as above shows that a reachable board never consists entirely of ones. The invariant then gives formula (1), so the terminal value is unique.

Comparison

The number-theoretic invariant is identical. The only real difference is the descent: GPT uses the board product and a lexicographic tie-breaker; Axiom encodes the same two cases in one weighted integer potential.

Problem 2. A coordinate identity in a triangle

Let be a triangle, and let be the midpoints of . Choose inside and inside , with strictly inside and strictly inside . Suppose If is the circumcenter of , prove that .

All segments used in the hypotheses are drawn. In particular, and are visible, and the dashed segments are and .

Place at the origin. Write The interior conditions imply and The last two inequalities follow from the assumptions that lies inside and lies inside .

Using the three angle equalities become three homogeneous linear equations in . Set Then For example, the first angle equality gives and the mixed terms cancel, giving (3). The other two calculations are the same cotangent identity applied at and at .

Put , and let Since is the circumcenter of , and . If , solving gives A short calculation now shows that is equivalent to

The GPT proofGPT Lean source

Let be the coefficient matrix of (3)–(5) in the variables . Direct expansion gives Since belongs to , the determinant vanishes. Hence

We also have . Indeed, if , then the identity and (8) give . Together with , positivity yields and then . This makes , contradicting (2).

The minor of rows in columns is , which licenses the elimination below. Solve (3) for , substitute into (4) to solve for , and insert both into (6). After cancellation, by (8). Therefore .

The Axiom proofAxiom Lean source

First, follows directly from the sign conditions. If , then Thus and , so , a contradiction.

Axiom finishes with the following polynomial certificate. Let Expanding both sides gives the identity Equations (3)–(5) make the right side zero. Since and , the factor is nonzero, so . By (6), .

Comparison

Both are coordinate eliminations. GPT extracts the extra relation from the kernel of a matrix and then substitutes. Axiom writes the target directly as a linear combination of the three angle equations. The latter is shorter; the former exhibits an additional relation among the positions of and .

Problem 3. The stick-cutting game

Liu Bang marks at most interior points of a unit stick. Xiang Yu then marks at most further interior points. The stick is cut at all marks. They alternately claim an unclaimed piece, Liu Bang first, each maximizing his own total length. Determine the largest amount that Liu Bang can guarantee.

Overlay the two partitions. Everything before the dashed line is paired; the overhang has total length .

The answer is Put . If the final piece lengths in decreasing order are , optimal play takes them in that order. Therefore Liu Bang receives

We use one elementary fact. If the multiset of pieces is a union of equal pairs together with a residual multiset of total length , then Indeed, equal maximal pairs may be deleted without changing ; if a maximal residual piece is deleted, the remaining alternating sum changes sign, so the new value is at most that piece plus the remaining residual total. This proves (11) by induction.

The common upper bound

Suppose Liu Bang creates initial segments. If , Xiang Yu bisects every segment, using at most marks. All pieces occur in equal pairs, so .

Now let . The subset sums of the initial lengths lie in . Partition into intervals of length . Two subset sums differ by at most . After removing their intersection and swapping them if needed, we obtain disjoint sets such that Concatenate the segments of into one bar and those of into another, aligned at the left. Transfer the division points of each bar to the other. Their common initial parts then split into equal pieces, while the longer bar has an overhang of total length . Bisect every segment outside . The number of new marks is at most Thus all pieces except a residual of total occur in equal pairs. By (11), .

The common dyadic opening

Liu Bang cuts the stick into lengths After Xiang Yu’s cuts, label each final piece by the initial segment containing it. Pair the sorted pieces as . There are at most pairs because there are at most pieces.

Both proofs produce a nonzero vector such that the labels in each adjacent pair satisfy . Then On the other hand, if is the largest index with , then Using (13) and (14), . Together with the upper bound and (10), this gives .

The GPT proofGPT Lean source

Work over . For every adjacent pair with labels , impose the linear equation There are at most equations in unknowns, so the homogeneous system has a nonzero solution. Identify the elements of with . The resulting vector is exactly the required , and the common calculation above finishes the proof.

The Axiom proofAxiom Lean source

Make a multigraph on vertices , with one edge for every adjacent pair of labels. It has at most edges and vertices, so some connected component has fewer edges than vertices. That component is a tree. Give its bipartition the values and , and give every vertex outside it the value . Every edge has opposite endpoint values or two zeros. This supplies the required , and the common calculation finishes the proof.

Comparison

The extremal dyadic division and the subset-sum upper bound are the same. The lower-bound certificate is genuinely different: GPT uses dimension over ; Axiom uses a tree component and bipartite coloring.

Problem 4. The triangle-cutting game

Fix . Shan-Yu chooses a triangle. If it has an angle , Mulan wins. Otherwise Mulan cuts from a nonvertex boundary point to the opposite vertex, and Shan-Yu keeps one of the two triangles. Determine the values of for which Mulan can force a win in finitely many cuts.

A B C P β γ x
The angle parameter gives the two triples in (15).

The answer is We omit degree signs below. If a triangle has angles and Mulan cuts from a point on the side between the and vertices to the opposite vertex, the children have angle triples where .

We first record a lemma used by both solutions. If a triangle contains for a positive integer , Mulan wins. Induct on . For she has already won. For , use the angle as the apex and choose in (15). One child contains and the other contains .

The GPT proofGPT Lean source

Assume first that , . Then .

If a triangle has an angle , let its other angles be . Use as the apex and cut with . This is legal because . One child contains and the other contains , so both are winning.

Now take any triangle. If it has an angle below , we are done. Otherwise choose an angle and write If , the common lemma applies. Otherwise . Cut with as apex and . One child contains and the other contains . Both are winning by the preceding arguments.

For necessity, write for the integer multiples of . Induct on a winning strategy tree and prove: The base case is immediate. For a cut as in (15), assume and neither base angle is a multiple. By induction, the left child contributes or , while the right contributes or . The pair would make a multiple. The other three combinations make, respectively, , , or the apex angle a multiple. This proves (16).

Apply (16) to the equilateral triangle. Either is a multiple of , or is; in the latter case is also a multiple. Hence with .

The Axiom proofAxiom Lean source

Again assume . Divide all three angles by , obtaining positive reals . If one is an integer, the common lemma applies. Suppose none is. After relabeling, there is an integer with Indeed, if some normalized angle , take . If all three are below , then , so and one may take .

Cut with parameter . By (17) the cut is legal. The two children contain and , so both are winning by the common lemma.

For necessity, assume and call a triangle safe if none of its angles lies in . Every cut of a safe triangle has a safe child. To see this, use (15). If the left child is not safe, then either or . In the first case neither nor is a multiple, since that would make or a multiple. In the second case neither nor is a multiple. Thus the right child is safe.

Shan-Yu can therefore keep a safe child forever, so Mulan cannot have a finite winning strategy from a safe triangle. The equilateral triangle is safe unless is a multiple of , which would force to be a multiple. Hence Mulan can guarantee a win only when .

Comparison

The sufficiency proofs are different. GPT cuts an angle into an integral part and a remainder below . Axiom chooses one integer that places a positive multiple of in each child. The necessity arguments are positive and negative forms of the same invariant.

Problem 5. A functional inequality

Find all functions such that for all .

The solutions are These functions work by QM–AM–GM applied to and .

For the converse, square the inequalities: Put . Setting makes the two outer expressions in (18) equal, so Hence Since every iterate is positive, .

The GPT proofGPT Lean source

From (18) and the identities we obtain

Suppose and . By (20), both forward orbits are arithmetic progressions with steps and . Take a far point , and let be the first point of the other orbit with . Then . Applying (21) to gives Letting forces . Therefore takes values in for some .

If , (21) with and gives so . Thus points at distance at most have the same -value. The function is locally constant on the connected interval , hence constant. Therefore .

The Axiom proofAxiom Lean source

Let , , and . Expanding the two sides of (18) gives Take far points on the two arithmetic orbits and arrange . If , (22) gives If , (23) gives Letting shows . Again takes only the values and one positive constant .

If and , the left inequality in (18) gives The set is open by (24). The set is also open: if , then for sufficiently close to we have , so (24) rules out and forces . Since and the interval is connected, one set is empty. Thus is constant.

Comparison

The proof architecture is the same: rigidity, arithmetic orbits, equality of positive steps, then connectedness. GPT packages both inequalities into (21); Axiom keeps the two polynomial estimates (22) and (23) separate.

Problem 6. A greedy gcd sequence

Let . For each , let be the least integer greater than satisfying Prove that there are positive integers such that for every .

Call good if for every . Every term is good. Conversely, every good occurs in the sequence: choose the least with ; if , then would have been an admissible smaller choice for . Thus the sequence is the increasing enumeration of the good integers above .

The GPT proofGPT Lean source

First observe that translation-periodicity of the good set gives the theorem. Suppose Choose with . If , then is a good integer above , so . A strict inequality would make a good integer strictly between and , impossible. Hence .

It remains to prove (25). We need four short facts.

  1. Any two good integers share a prime. A large power is good and therefore is a term; since is good, it has a common prime with , hence with .

  2. If is not good, some earlier term is coprime to . Indeed, place between two consecutive terms and use the minimality of the upper one. For the finitely many non-good , choose such witnesses and let exceed all of them.

  3. Every good has a squarefree good divisor minimal under divisibility. Take a minimal good divisor of the radical of .

  4. Every prime divisor of such an is at most .

For the last claim, use strong induction on . Let and . Minimality makes non-good. If , choose a good term coprime to . Since and are good, they share a prime; it cannot divide , so it is . Thus .

If , choose a term coprime to , and let be a minimal good divisor of . Then and . Since are good, their common prime must be , so . The induction hypothesis gives .

Let Every good has a minimal good divisor with and . Hence , so is good. Conversely, if is good, a minimal good divisor of divides both and , hence divides . The case is therefore impossible because ; in all remaining cases, is a multiple of the good integer and is good. The case also follows directly by taking a minimal good divisor of , which divides . Thus (25) holds, and the first paragraph completes the proof for every .

The Axiom proofAxiom Lean source

For an integer , let be its set of prime divisors. Axiom first proves:

Lemma 1 (support reduction). For every , there is such that and every prime in is at most .

Proof. Use strong induction on . If has no prime above , take . Otherwise choose dividing , and let be the -free part of . A prime satisfies , so .

For each , apply induction to and obtain a small-support term whose prime support lies inside . It shares a prime with ; that prime is at most , so it is not and therefore divides . Hence every multiple of shares a prime with every earlier term.

Choose minimal with , and put . Then . Also , so . If , it would be an admissible choice smaller than , contradiction. Choose the least with . Since shares a prime with every earlier term, minimality forces ; hence is an earlier term. Its prime support is . Apply the induction hypothesis once more to this earlier term. ◻

Only finitely many subsets of the primes at most exist. Choose so that every small support that ever occurs already occurs among . By the support reduction lemma, Let . Since each divides , condition (26) depends only on . Thus goodness is periodic modulo .

Among , two terms have the same residue modulo . Write them as , , and put Then . The same greedy argument used in the GPT proof gives

Finally extend (27) downwards. Suppose it holds at . The good integer is a term and lies below , hence . Therefore is good and satisfies The minimality of forces . This proves (27) for every .

Comparison

GPT proves that all minimal good divisors use primes from one finite set, then obtains periodicity of the entire good set and therefore pure periodicity at once. Axiom proves a sharper support reduction to primes at most , stabilizes the finite constraints, and first obtains eventual periodicity before propagating it backwards.

Overall assessment

Problems 1, 2, and 5 have the same mathematical backbone in both repositories. Problem 3 has a genuinely different certificate. Problems 4 and 6 show the clearest independent proof design. The concise versions above preserve those distinctions without reproducing formal bookkeeping that is useful in Lean but not in an olympiad solution note.