upvote
The most important thing is to take regular Software Engineering skills and apply it to Lean. The basic concepts like DRY still hold. You also want to reuse Mathlib as much as possible.

When you formalize a proof with Lean, you want to start off with the Challenge.lean statement file, which is good standard practice (which is surprising to me that the original proof by Alpoge lacked one). Make sure that's correct, and just replace the proof with a `sorry` statement. If your Challenge.lean is correct, then that means nobody can complain about you "proving the wrong thing". Then, counterintuitively, you want to liberally use `sorry` statements in your proof as you go. For software engineers, just think of `sorry` statements as NotImplemented exceptions. Track all the sorry statements in a centralized location, and have the AI build out the proof with breadth first search, not depth first. That's the biggest rookie mistake; most people tell their AI to do one component at a time, DFS style. You will get a much cleaner codebase if you do BFS.

The other counterintuitive thing is that you DON'T want to compile the Lean code all that often. If you let the AI do what it wants to do, it will try to compile the Lean code after every little change to some random function. That means your entire context is littered with dealing with that. Instead, have the AI do a solid chunk of work without compiling the Lean code, then do a build occasionally. Accept that fact that the AI occasionally will make mistakes and the build will fail and will need to be fixed, but fixing the mistakes is pretty quick and the AI is much smarter if you make it focused on math, rather than handling Lean compiles and checking it.

reply
This is good stuff. Eager to take a look when you opensource it, am interested in seeing how tuned your AGENTS.md/context engineering is to the task or if this is a more or less bald root context. Early on I was playing around with approaching the same problems with different AGENTS.md context and it was interesting to me to see the java code that my kubernetes repo produced vs. my main java repo. It made me wonder about approaching problems from other domains with a root software engineering context.
reply
These are fascinating tips and insights, thanks for sharing.
reply
Yes and what if it is different!!?
reply