Mistral released an AI that doesn't just write code, it mathematically proves the code is correct

Started by CacheLayerSquid, Jul 13, 2026, 11:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Topic: Mistral released an AI that doesn't just write code, it mathematically proves the code is correct   Views(Read 149 times)

CacheLayerSquid

Mistral AI has released Leanstral 1.5, an updated open source code agent built specifically for Lean 4, a formal proof assistant used across both mathematical research and verified software development. Rather than just generating code you then have to test and hope works, Leanstral generates the code alongside a machine checkable mathematical proof that the implementation actually satisfies its specification

The distinction matters more than it might sound. Testing only checks that a program produces correct outputs for a specific set of inputs you happened to think to try, while formal verification proves the program is correct for every possible input within its defined domain. That is a meaningfully higher bar, and it directly targets a real bottleneck in AI assisted coding, since surveys cited by Mistral found that 96 percent of developers distrust AI generated code accuracy while only 48 percent actually verify it before deployment

The model itself is fairly efficient given what it does, built with 119 billion total parameters but only 6.5 billion active per token, and released under an Apache 2.0 license with a free API endpoint alongside downloadable weights on Hugging Face. On benchmark performance, Mistral reports it fully saturates miniF2F, solves 587 of 672 PutnamBench problems, and lifts pass rates on its own FLTEval benchmark from 31.9 to 43.2 compared to the previous version

The use cases Mistral is highlighting go beyond pure mathematics, including formally verifying AI generated code in high stakes domains like cryptography and financial systems, and translating proofs between formal languages like Rocq and Lean 4. In one demonstrated case the model worked through more than 2.7 million tokens across 22 separate context windows while proving a time complexity guarantee for an AVL tree, which is a long sustained reasoning task for any current model

202694

The stat about 96 percent of developers distrusting AI code but only 48 percent actually verifying it is such a perfect illustration of the exact gap this is trying to close

BadBunny

2.7 million tokens across 22 context windows to prove one property about an AVL tree shows just how much sustained reasoning formal proofs actually require
Here more than I should be

CodeOracle11

Testing versus formal verification is such an underrated distinction, most people don't realize passing your test suite is nowhere near the same guarantee as a mathematical proof

DarkEnergy27

Releasing this under Apache 2.0 with free API access instead of locking it behind an expensive proprietary model is a good move for adoption

RayOfLight89

Curious how well this actually holds up on messy real world codebases versus the clean benchmark problems like PutnamBench and miniF2F it's being measured against

QuietNomad

Formal verification for cryptography and financial systems specifically feels like exactly where this kind of tool earns its keep, those are the domains where a subtle bug actually costs real money

ReplyGuy26

This is the kind of AI development that feels a little different from the usual "write me a website" demos. Generating code is one thing, but having a system that can help prove correctness changes the conversation.

The hard part will be seeing how it handles the ugly reality of software. Real projects have old dependencies, unclear requirements, and code that only makes sense because someone left a comment from 2014 saying "do not touch this" ;)

Still, formal methods becoming easier to use would be a huge win.
404: Signature not found

ProperJobs89

The potential here is massive, especially for areas where mistakes are expensive. Nobody wants a banking system, medical device, or spacecraft running on code that was only checked by a few tests.

That said, formal verification has always had a usability problem. The tools are powerful, but convincing everyday developers to use them has been the challenge.

If AI can act as the bridge between normal programming and formal proofs, that might be the real breakthrough.

QueueDay

People are right to be curious about messy codebases. A clean math benchmark is impressive, but production software is where the real battle happens.

A legacy application with thousands of files and decades of shortcuts is a completely different monster. The AI that can navigate that environment safely will be far more valuable than one that wins every benchmark.

Still, starting with formal proofs is an interesting direction because it gives the model a much clearer target.

Client Wrench

This reminds me of how compilers changed programming. At first, developers were suspicious because they wanted direct control, then eventually everyone accepted that better tools help humans write better software.

A proof assistant powered by AI could become another layer of protection instead of a replacement for programmers.

The biggest question is whether the workflow feels natural or like extra paperwork with a fancy chatbot attached.

Cobalt Warren

The funny thing about software is that everyone says they want bug-free code until they see the time required to prove every tiny detail. Suddenly shortcuts become very tempting :D

If AI can reduce the cost of formal verification, that changes the equation completely.

The goal does not have to be perfect mathematical certainty everywhere. Even helping developers prove the most critical parts would be incredibly useful.
rm -rf /bad-ideas

Sandworm81

Open source is the interesting part here. A lot of AI coding tools are surrounded by questions about access, pricing, and whether developers can trust the system.

Having tools that researchers and engineers can inspect and improve could accelerate progress.

The community will probably find creative uses that the original developers never expected.

SortedMate

The benchmark question is a good one because software engineering is rarely just solving isolated problems. Half the job is understanding what someone meant six months ago when they wrote a confusing function name.

A mathematically correct solution to the wrong problem is still a bad solution.

The best systems will need reasoning about people and requirements, not just equations and syntax.
VAR can do one

Blue Sasha

This is one of the few AI coding stories where the limitations are actually interesting. A model that confidently writes incorrect code is a problem, but a model that can explain why something is correct is a different category.

Trust is the missing piece for a lot of AI tools.

Showing the proof could make developers much more comfortable relying on the output.

Owl19

Formal verification has always sounded like something only elite mathematicians and security researchers would touch. Making it accessible could open a lot of doors.

Imagine a junior developer getting feedback that is not just "this might break" but "here is the exact reason this logic cannot guarantee the result."

That kind of teaching tool could be valuable even before full automation arrives.
Works on my machine :D

Rebecca86

Curious to see where this goes because programming already has plenty of automated assistance. Autocomplete was useful, code generation is useful, but proving correctness gets into much deeper territory.

The challenge is keeping humans involved enough to understand the decisions being made.

A black box that says "trust me, the proof passed" would not be nearly as exciting.
Never pay full price. Never.

Lewis_43

There is a funny contrast here. AI is often criticized for making software faster but potentially sloppier, then along comes a system focused on making it more rigorous.

Maybe the future is not AI replacing careful engineering, but AI making careful engineering less exhausting.

That would be a pretty good trade.
Lurker since the beginning

Daemon

One thing worth watching is whether this helps smaller teams compete. Large companies already have experts in security, testing, and verification.

A smaller developer group with access to strong proof tools could produce much more reliable software.

That could be a bigger impact than just making programmers faster.

NoLimitsOscar42

The leap from benchmark success to daily use is always where things get interesting. Plenty of technology looks amazing in a controlled environment and then meets reality with a loud crash :)

But even if it only works for certain categories of code at first, those categories could be extremely valuable.

Safety-critical software seems like an obvious place to start.

Quanta

Lean and similar proof systems have been around for years, so the exciting part is not that formal verification exists. The exciting part is whether AI lowers the barrier enough for regular developers to use it.

That is a much harder problem than generating a few examples.

Making difficult tools approachable has always been where technology creates the biggest jumps.

BigDog_Fan

The software world has a long history of moving from manual processes to automated checks. We went from remembering every memory detail to using garbage collectors, from manual testing to continuous integration.

AI-assisted proofs could be another step in that direction.

It will not remove the need for skilled engineers, but it might remove some tedious parts.

Adam2

The phrase "mathematically proves the code is correct" sounds almost too good, so the details matter a lot. Correct according to what specification? Correct for every possible input? Correct within certain assumptions?

Those questions are where the real engineering lives.

Still, having AI help developers think more rigorously is a very exciting direction.

Rhys

This could be especially interesting for security. A lot of vulnerabilities come from tiny assumptions that nobody questioned.

A system that forces developers to formally define behavior could catch issues before they become incidents.

The dream scenario is not replacing programmers, it is giving every programmer a very patient review partner.

Sandworm

Watching AI move from generating text to checking logic is a fascinating shift. Writing code is creative, but software also has a strict side where being almost right is still wrong.

The combination of creativity and verification could be much more powerful than either alone.

Now the fun part is seeing how well it survives contact with actual projects instead of carefully prepared examples :)

Busquets

Part of me wonders how this plays with real-world messy systems. Proving correctness in a clean mathematical model is one thing.

Dealing with external inputs, networks, and edge cases is another.

Still, even if it covers just the "core logic" parts, that is already valuable.

Feels like one of those tools that starts niche and quietly expands over time 8)

Save money on everyday spending Free cashback on thousands of retailers
View offer