Zulip Chat Archive

Stream: general

Topic: combinatorics in mathlib


Ilia Zgonnik (Jul 23 2025 at 12:05):

Newbie here.

Guys, can someone send me info why Lean is still bad at combinatorics? Which for people easy steps are not available to lean. Is problem more about lack of combinatorics theorems in mathlib or something else?

Notification Bot (Jul 23 2025 at 12:56):

A message was moved here from #general > new monadic program verification framework by Ruben Van de Velde.

Yaël Dillies (Jul 23 2025 at 13:06):

Hey :wave: Can you clarify what you mean by "bad at combinatorics"? It's bad at combinatorics in the sense that it doesn't have much of it, but it's good at combinatorics in the sense that it's relatively easy to do any simple combinatorics on top of it. It also heavily depends on what subfield of combinatorics you're thinking about.

Ilia Zgonnik (Jul 23 2025 at 13:21):

Yaël Dillies said:

Hey :wave: Can you clarify what you mean by "bad at combinatorics"? It's bad at combinatorics in the sense that it doesn't have much of it, but it's good at combinatorics in the sense that it's relatively easy to do any simple combinatorics on top of it. It also heavily depends on what subfield of combinatorics you're thinking about.

For some problems it is very hard to write even a problem (not speaking of solution) in Lean. It struggles a lot with hard problems with cells. I just think there are a lot of techniques in combinatorics which you can’t write in Lean

Ilia Zgonnik (Jul 23 2025 at 13:26):

Ilia Zgonnik said:

Yaël Dillies said:

Hey :wave: Can you clarify what you mean by "bad at combinatorics"? It's bad at combinatorics in the sense that it doesn't have much of it, but it's good at combinatorics in the sense that it's relatively easy to do any simple combinatorics on top of it. It also heavily depends on what subfield of combinatorics you're thinking about.

For some problems it is very hard to write even a problem (not speaking of solution) in Lean. It struggles a lot with hard problems with cells. I just think there are a lot of techniques in combinatorics which you can’t write in Lean

For example, can we write combinatorics with number greater than 3 in IMO shortlist in Lean? Can AI do it? I think there are so many good solutions in Lean for hard combinatorics, that AI can’t train normally. And creating such dataset is very hard task to do, because it requires really good mathematicians and Lean pros :)

Joseph Myers (Jul 23 2025 at 14:03):

Ilia Zgonnik said:

For example, can we write combinatorics with number greater than 3 in IMO shortlist in Lean?

I wrote formal solutions to both combinatorics problems from IMO 2024, which were C4 and C7, so yes.

Ilia Zgonnik (Jul 23 2025 at 14:11):

Joseph Myers said:

Ilia Zgonnik said:

For example, can we write combinatorics with number greater than 3 in IMO shortlist in Lean?

I wrote formal solutions to both combinatorics problems from IMO 2024, which were C4 and C7, so yes.

Can you send link to them, please

Joseph Myers (Jul 23 2025 at 19:08):

https://github.com/leanprover-community/mathlib4/blob/master/Archive/Imo/Imo2024Q3.lean
https://github.com/leanprover-community/mathlib4/blob/master/Archive/Imo/Imo2024Q5.lean

Jeremy Tan (Jul 23 2025 at 21:50):

I have also written some solutions to combinatorics problems that are in the Archive folder of mathlib

Kim Morrison (Jul 24 2025 at 23:13):

I suspect this question is based on a misunderstanding: the AIs trying to do IMO level combinatorics problems in Lean are not very good at that task. I suspect the OP may have conflated this idea with the idea that it is hard to do combinatorics in Lean. This does not follow. :-)

Joseph Myers (Jul 25 2025 at 00:13):

It does seem there is a greater distance between an informal solution and a corresponding formal solution for such problems, compared to algebra or number theory problems. This might mean that AIs that produce an informal solution then formalize it have an advantage on such problems compared to AIs that search directly for a Lean proof, or might mean that there are general lemmas and tactics we're missing that could improve the experience of writing such proofs in Lean. (It would be interesting if an AI could mine large amounts of Lean proofs to look for common patterns that should be converted into lemmas or tactics.)

Ilia Zgonnik (Jul 25 2025 at 05:21):

Kim Morrison said:

I suspect this question is based on a misunderstanding: the AIs trying to do IMO level combinatorics problems in Lean are not very good at that task. I suspect the OP may have conflated this idea with the idea that it is hard to do combinatorics in Lean. This does not follow. :-)

I thought that if people can write proof in lean for combinatorics, then AI can also. What’s the problem for AI to get good at formalizing combinatorics in lean? Because it already produces great natural language proofs, able to break problem in lemmas, but when it comes to checking itself, it crushes.

Kim Morrison (Jul 25 2025 at 06:20):

Ilia Zgonnik said:

I thought that if people can write proof in lean for combinatorics, then AI can also.

This is still far from the truth. :-)

Ilia Zgonnik (Jul 25 2025 at 06:27):

Kim Morrison said:

Ilia Zgonnik said:

I thought that if people can write proof in lean for combinatorics, then AI can also.

This is still far from the truth. :-)

Is problem with dataset? Because it seems like routine work in which AI is good at


Last updated: Dec 20 2025 at 21:32 UTC