This is exactly what I do in $dayjob. I call it Property Driven Development.
I start with prose requirements, then use Elenxis (https://github.com/kbr-/elenxis) to translate into formal Lean model.
Then I state signatures and conjectures that the spec must have. Properties that the future implementation must hold. No implementation yet.
Only once all conjectures are there, we are ready to roll.
If I write in Lean, I can now fill in the signatures' implementations. Then prove theorems. Proof doesn't go through => bug. Fix, retry, repeat.
If I write in an inferior language, there is extra Intermediate step: translating the conjectures into property test in the language. Only once these are ready, I can write implementation.
You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.
All of the above applies equally to AI agents.
But then, is the application itself written in Lean?
One could maybe combine this with Rust code verified by Aenas (which runs Lean proofs)
Thank you for an interesting comment! Do you have any recommendations on web articles or other examples similar to what you do?
Interesting. I work in bog standard LOB SaaS type businesses my whole career, so zero practical experience with formal methods, but a growing interest in them due to how I see the industry trending towards them. Can I ask... in your case, what is $dayjob related to that you find yourself operating this way already? Finance? Aerospace? Just curious...
> You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.
Most software engineers don't really have a background in it, and tbh I kinda don't know where to start, and have heard that right now if you're already experienced with formal methods then you can get great results out of approaches like this with LLMs, but if you just vibecode up the Lean or TLA+ etc then you're not going to get out of it what you were expecting. I suspect your statement here is exactly the kind of thing that makes all the difference, but I don't know how to know what the other things that make the difference are. Any other pointers?