r/functionalprogramming • u/Popular_Birthday1995 • Jun 14 '25
Question How can I learn lean4 in a few weeks?
I recently just finished up school and was offered a job by a startup focusing on building a math LLM, where I would translate the solutions to difficult math olympiad problems into lean. Since they are focusing on combinatorics, I will need to pass a technical interview where I solve a combinatorics problem (most likely an old IMO/ISL/USAMO problem) before I can secure the job.
I already started studying lean on my own through a book called Mathematics in Lean 4, where I've been completing exercises from a repository that I cloned onto my computer. I recently finished chapter 4, which was on sets and functions, but I'm not sure if the later sections in the book (linear algebra, topology, and analysis) will help me solve complex olympiad problems (which are excluded to advanced high school techniques). I've also begun to mix in some elementary AMC problems into my practice, but I'm having trouble cracking some of the AIME problems.
What are your recommendations to learn lean 4 pretty quickly? I have lots of experience in programming: I'm a specialist on codeforces, made a few hundred dollars freelancing doing webdev, and have coded a few websites for my school. I also have a bit of experience with math olympiads too, having participated in some back when I was in high school.
9
u/SV-97 Jun 14 '25
I'd definitely recommend reading theorem proving in lean 4. The lean community mostly lives in the lean zulip, so you probably get better answers over there. Note though that the community is quite small, so if you ask on there the startup people are quite likely to see it.
Do you have any experience with functional programming?
Do you have a math degree? Some bits of even basic mathematics require a nontrivial amount of knowledge to do in lean, because the "normal" way isn't really well suited to formalization.
4
u/Popular_Birthday1995 Jun 30 '25
UPDATE: Thanks everyone, I got the job. Onwards to solve some problems :)!
2
u/Grivza Jun 14 '25
I think your current approach of trying to write as many problems as possible is the correct one.
If you get stuck about how to model a specific detail don't hesitate to ask in the forum, since for most people in there answering newbie questions is trivial and doesn't take much energy. Although take a bit of time beforehand to see if something similar has been answered before. Good luck.
2
u/turn_lang Oct 03 '26
A few weeks can get you fluent in basic tactics and tiny combinatorics lemmas; it will not get you Mathlib-native speed on contest-hard formalization. Treat it like learning a new proof culture: definitions, rewriting discipline, and “search the library” habits. Turn-Lang’s design thesis (I’m Turner Z, founder) is that executable formalization should feel closer to writing mathematics you can still read, which matters a lot when the object is olympiad-style combinatorial reasoning rather than systems verification. For Lean specifically: Natural Number Game → Theorem Proving in Lean snippets → one small combinatorics formalization you already know on paper. Speed comes from repeating that loop, not from bingeing syntax.