One thing I'm surprised to see little mention of here is that if you want to use Lean proofs for your code and really want good correspondence between what is proved in Lean and what your code actually does, you need a mathematical model of your programming language embedded in Lean and a deterministic parser converting your code itself into Lean. Otherwise, yes, an AI actually has no checks against hallucination and while writing Lean proofs probably helps AI identify its mistakes it really isn't an end-to-end proof of your code's functionality.
I personally think the future probably involves a combination of unit tests and formal verification to support our confidence in AI-written software, as well as means to align high-level human intent with the low-level intent of individual code pieces, which as this article mentions is the other big piece that can slip with formal proofs: we might not be proving what we think we're proving. For those interested I've written an educational post about this topic here as well: https://kellerai.io/resources/ai-proved-your-code-correct
You don't need a model of your programming language in Lean, that's overkill.
It's already useful to isolate a DSL in your software and model that in Lean. Sure that only proves that the domain specific code is correct, but now you've factored your proof into proving high-level correctness and low-level correctness.
Do people really approach Lean proofs from the programming language level rather than assembly code level (x64, arm, etc)?
For Elixir its author, Jose Valim, created Lynx: https://github.com/josevalim/lynx
--- start quote ---
You write laws in Erlang/Elixir, which are automatically translated to Lean alongside your Erlang/Elixir code, and you write proofs in Lean. The laws and proofs are assembled together and verified by Lean's kernel.
This technique is also known as shallow embedding, since it translates Erlang/Elixir to Lean and then use the features and properties of Lean for proofs.
--- end quote ---
I guess it isn't mentioned here because it is completely off-topic. Lean can make formal proofs of code but TFA is about proofs in pure mathematics.