top of page

Lean Proof Automation Just Passed a Real Software Test, but the Proof Is Not Production Ready

Lean proof automation crossed an important line on July 26, despite falling far short of a production software release. Security engineer Adam Langley built a working Zstandard decompressor in Lean, then used several large language models to generate machine-checked proofs around its hardest logic.

The experiment did not produce a faster decompressor, a published library, or evidence that AI can verify any large application. Langley says his version runs about ten times slower than the standard zstd command. He also describes the implementation as a learning project and declined to publish its code.

What changed is narrower, but more consequential. An AI system produced proofs for nontrivial software while Lean independently checked whether those proofs were valid. That moves AI-assisted verification beyond fluent explanations and plausible code into a workflow with an unusually strict acceptance test.

The primary contest is no longer AI-generated code against human-written code. It is probabilistic generation against deterministic verification. The model can guess, revise, and fail repeatedly, while a small trusted checker decides what enters the finished program.

For developers, that pattern offers a possible answer to unreliable coding agents. For knowledge workers, it suggests a broader model for automation: let AI create the messy first attempt, but make acceptance depend on explicit, machine-checkable conditions.

The Zstandard Experiment Made Proof Automation Concrete

Langley’s test matters because it applied AI-generated proofs to ordinary systems software, not another isolated mathematics benchmark.

Lean is both a programming language and an interactive theorem prover. Its dependent types allow a program’s types to include facts about values, such as an array’s exact length or a relationship between several outputs.

That capability changes what a function signature can promise. A normal file-reading function might return a byte array. A Lean function can return an array paired with a proof that its length matches the requested number of bytes.

The official Lean reference explains why this architecture has unusual value for AI-generated work. Lean tactics can be complex and automated, but every proof term they produce passes through a comparatively small kernel.

A faulty tactic can waste time or generate an invalid candidate. It cannot make an invalid proof valid unless the trusted foundation also contains a defect. The checker, rather than the generator, remains the final authority.

Langley chose Zstandard because it provided a meaningful implementation challenge. Zstandard, usually called zstd, is a lossless compression format built around LZ77-style matching and two entropy-coding systems.

Its format specification assigns Huffman coding to literal data and Finite State Entropy, or FSE, to other symbols and Huffman headers. FSE uses a state carried between symbols, which requires decoding its bitstreams in reverse writing order.

That machinery is far more demanding than proving that two short arithmetic expressions are equal. A decompressor must parse compact binary structures, maintain state, reject invalid inputs, and reconstruct the original bytes correctly.

Langley’s Lean experiment focused particular attention on FSE table construction. The table determines how compressed states map back to symbols and how many bits the decoder consumes.

Several LLMs reportedly generated a proof for an important property of that table-building code in about 20 minutes. Langley checked that the resulting proofs passed Lean’s type checker and contained no sorry declarations, Lean’s mechanism for temporarily admitting an unproven statement.

The models did need to alter some implementation choices. Langley had used Id.run to express portions of the algorithm in a more imperative style, which made the proof machinery harder to use.

That detail prevents a simplistic reading of the result. The AI did not merely inspect fixed code and attach a certificate. It helped reshape the implementation into a form that supported proof construction.

Still, the result created a complete loop: write meaningful software, state a strong invariant, generate a proof, and ask an independent kernel to accept or reject it. That loop is the real event.

Lean Proof Automation Attacks Verification’s Cost Problem

Formal verification has delivered exceptional assurance before, but proof labor has kept it outside most everyday software projects.

The clearest historical example is seL4, a small operating-system kernel backed by machine-checked proofs. Its verified properties cover much more than passing tests on a selected collection of inputs.

The original verification required roughly 20 person-years over four years and produced more than 200,000 lines of Isabelle proof script. A retrospective described in seL4 research shows why those numbers cannot be dismissed as academic excess.

Verification teams must define the right properties, connect different abstraction layers, construct proofs, and keep those proofs aligned with changing code. Each task requires specialized knowledge and careful engineering.

The payoff can be substantial. The seL4 project reports no functional-correctness defects in verified code since its main proof was completed in 2009. However, most software teams cannot invest years of specialist labor before shipping one component.

Traditional proof automation reduces some of this burden. Tactics can solve familiar patterns, while satisfiability modulo theories solvers, known as SMT solvers, discharge logical conditions in supported domains.

Those systems also influence how programmers write verified code. Experienced users learn which formulations a solver can handle and which apparently harmless structures cause search to expand uncontrollably.

Langley argues that LLMs change this economic equation because they are flexible proof generators. They can read surrounding definitions, inspect error messages, rewrite local code, propose intermediate lemmas, and try another route after rejection.

Proof irrelevance strengthens the case. In Lean, propositions live in a proof-irrelevant universe, meaning the system generally cares that a valid proof exists, not which valid proof was supplied.

A human proof engineer often values elegance because a clear proof can survive later changes more easily. If an LLM can regenerate a checked proof quickly, some of that maintenance calculus changes.

That does not eliminate proof engineering. Someone must still state the correct theorem, define the trusted boundary, and decide whether regeneration after each change remains affordable.

It does, however, weaken one major objection. Ugly generated code is dangerous when developers cannot confidently evaluate its behavior. An ugly generated proof is less concerning when a trusted kernel rejects every invalid version.

The emerging workflow resembles compilation more than collaborative reasoning. Developers specify the property, an agent searches for an acceptable artifact, and the checker determines whether the build succeeds.

That difference matters for managers deciding where AI belongs. A coding assistant that says a function is safe provides an opinion. A proof-producing assistant that returns a kernel-checked artifact provides evidence under declared assumptions.

The distinction also exposes the new bottleneck. If proof generation becomes cheap, writing the right specification becomes the scarce skill.

Teams will need people who can translate requirements into precise invariants. “This parser should be secure” is not checkable. “Every successful parse stays within the supplied input buffer” is closer to a property a formal system can evaluate.

For knowledge workers, the equivalent task is defining acceptance conditions before automation begins. AI can draft a forecast, reconcile a policy, or merge meeting notes, but trustworthy automation requires a clear account of what must remain true.

The New Opponent Is Generation Without Verification

The strongest lesson is not that LLMs became reliable, but that unreliable generation can become useful inside a reliable checking loop.

Most generative AI products ask users to judge outputs directly. A model writes an email, summarizes a meeting, edits a spreadsheet, or proposes code. The human then searches for subtle errors using limited time and attention.

That pattern makes automation attractive for low-risk work but difficult to trust for security, finance, compliance, infrastructure, and irreversible operational changes. The model’s confidence offers little protection because fluent language does not establish correctness.

Lean proof automation separates two jobs. The LLM explores a large space of possible proofs, while the proof assistant performs a narrow verification task with exact rules.

The generator can hallucinate a theorem name, apply an invalid transformation, or misunderstand a definition. Those failures become rejected candidates rather than accepted conclusions, provided the claimed property and trusted boundary are sound.

Recent research points toward systems built around this separation. OpenProver, published in July 2026, combines planning, worker agents, and Lean verification in an open-source theorem-proving system.

Its architecture gives specialized agents different responsibilities while retaining automatic formal checking. It also supports human steering, acknowledging that proof search still benefits from expert direction.

This is a different product model from a chatbot with a code window. The valuable output is not the model’s explanation of why a proof should work. It is the proof object that survives independent checking.

A similar pattern can improve ordinary knowledge work even when full theorem proving is unnecessary. Consider a product manager assembling a weekly update from interviews, tickets, metrics, and decisions.

An LLM can draft the update quickly. However, every factual claim should remain traceable to a source, every metric should retain its date and definition, and unresolved contradictions should stay visible.

A personal knowledge system can help preserve those connections. For example, knowledge blending can bring related local material into one working context rather than forcing a user to reconstruct it from scattered files.

That is not the same as a mathematical proof. The checker may consist of source citations, schema validation, access controls, arithmetic tests, or a human approval step.

The architectural principle remains similar. Generative freedom belongs before the gate. Deterministic rules, documented evidence, or accountable review decide what passes through it.

This also changes how teams should evaluate AI productivity. Time saved during drafting is only one metric. Review time, correction frequency, defect escape rate, and the quality of supporting evidence matter just as much.

An agent that drafts ten times faster but doubles review effort has not automated the task. It has transferred work into a less visible stage.

By contrast, an agent that produces a slower first result with complete provenance and automatic validation may deliver more useful productivity. The evidence reduces uncertainty for every downstream reader.

Lean makes this principle unusually visible because the acceptance condition is binary. The proof checks or it does not. Most office automation lacks such a clean boundary, but teams can create smaller, task-specific gates.

A financial summary can require every total to reconcile with source cells. A contract comparison can require every flagged difference to link to exact clauses. A research brief can prevent unsupported quotations from entering the final document.

Those gates do not make the underlying model honest or deterministic. They make its weaknesses easier to contain.

What the Zstandard Test Does Not Prove

The experiment validates a promising mechanism, but it does not establish that AI can verify large production systems cheaply or completely.

The most obvious limitation is scope. Langley calls the decompressor a toy, says the code is unpublished, and does not present it as an exemplar for other Lean programmers.

That prevents independent reviewers from reproducing the result, examining the precise theorem statements, or identifying unverified components. We know that selected proofs type-checked, based on the author’s report.

We do not know whether those statements cover every property that a production decompressor requires. A perfectly valid proof of an incomplete specification can coexist with serious defects outside that specification.

This is often called the specification problem. The checker can establish that code satisfies a formal statement, but it cannot decide whether humans selected the right statement.

A decompressor could prove that valid inputs round-trip correctly while leaving memory exhaustion, denial-of-service behavior, resource limits, or archive parsing outside the theorem. Each omitted boundary creates room for failure.

The trusted computing base also matters. Lean’s small kernel sharply reduces the component that must be trusted, but real programs interact with compilers, operating systems, foreign functions, hardware, and external libraries.

Langley explored calling optimized assembly through Lean’s extern mechanism. Tiny equivalence examples worked, but attempts to scale the approach reportedly ran into severe memory requirements or failed to progress.

That result highlights a central tradeoff. High-level verified code can provide strong logical guarantees, while production performance often depends on low-level implementations and tooling beyond the immediate proof.

The Zstandard implementation itself illustrates the gap. Langley reports that his Lean decoder runs about ten times slower than the standard command-line implementation.

Performance is not a minor concern for compression software. Decompression often sits on a latency-sensitive path involving storage, package distribution, databases, or network transfer.

Proof maintenance also remains uncertain. Langley suggests that fast regeneration may reduce the need to carefully engineer proofs for future changes.

That is plausible for a contained project. A large codebase may create thousands of interdependent obligations, where a small type change expands across modules and overwhelms an agent’s context or search budget.

Research benchmarks should not settle this question by themselves. Mathematical theorem collections usually provide explicit goals and controlled environments. Production code includes partial specifications, legacy interfaces, changing dependencies, and undocumented assumptions.

There is also a human-factor risk. Easy proof generation can create pressure to treat any green check as comprehensive assurance.

A checked theorem says exactly what its formal statement says. It offers no guarantee about security, privacy, reliability, or business correctness unless those properties appear in the model.

Teams must therefore review specifications with the seriousness currently reserved for code review. Otherwise, AI will accelerate the production of convincing answers to incomplete questions.

AI Proof Automation Moves the Bottleneck to Specifications

If models become competent proof generators, valuable knowledge work shifts from constructing artifacts toward defining claims and boundaries.

Software teams have already experienced a version of this transition. Coding agents reduce the cost of producing functions, tests, migrations, and documentation.

As output becomes cheaper, deciding what should be built becomes more important. Requirements, interfaces, constraints, threat models, and acceptance tests determine whether fast generation creates value or merely creates more material to inspect.

Lean extends that shift into correctness claims. A programmer can encode an invariant in a type, ask an LLM to construct the proof, and let the kernel verify the result.

The highest-leverage human contribution is often upstream. Someone must recognize which invariant matters, express it without loopholes, and map it to the real operating environment.

Knowledge workers face the same structure with less formal tooling. An analyst needs to decide which evidence qualifies for a market claim. A recruiter needs to define which candidate criteria are legal and relevant.

A support manager must specify when an automated reply can be sent and when a case requires escalation. A researcher must distinguish a direct source, a secondary summary, and an unsupported inference.

These are specification tasks, even when nobody writes them in Lean. They turn vague expectations into observable conditions.

Organizations can prepare by recording decision rules alongside the documents they govern. A note saying “use the latest customer count” is ambiguous. A rule naming the authoritative dashboard, refresh time, region, and reporting period is testable.

Provenance becomes equally important. A model cannot reliably reconcile a team’s knowledge if the source material has lost its date, owner, version, or relationship to previous decisions.

This is why the movement from chat interfaces toward agent systems requires better information architecture. Agents need structured context, permissions, validation rules, and durable records of what they changed.

Human review should also move toward exceptions. If every AI-generated statement requires line-by-line inspection, the system remains an assistant rather than an automation layer.

Useful gates can automatically approve routine cases that meet explicit conditions. Humans then focus on missing evidence, contradictory sources, unusual values, security-sensitive actions, and changes outside known patterns.

Formal proof assistants provide the strongest version of that workflow, but they are not appropriate for every task. Many decisions depend on judgment, contested definitions, or incomplete information.

The goal is not to formalize every email. It is to identify the claims whose failure carries real cost and build proportionate checks around them.

For software, that might mean proving bounds safety in a parser while testing the user interface conventionally. For an operations team, it might mean automatically reconciling payment totals while requiring human approval for transfers.

For researchers, it might mean validating every citation and quoted passage while leaving interpretation open to debate. Verification should protect the boundary that matters most.

Langley’s experiment makes this design strategy easier to imagine. The LLM did not need to become a flawless mathematician. It needed to generate an artifact that a stricter system could evaluate.

That is a more realistic path for enterprise AI than waiting for models to stop making mistakes.

Three Signals Will Show Whether the Shift Is Real

The next stage depends on reproducibility, scale, and measurable maintenance cost rather than another impressive one-off proof.

The first signal is a published, reproducible corpus of ordinary verified software. Langley’s decompressor cannot serve that role because the source and proofs are unavailable.

Projects such as lean-zip provide a more inspectable reference. Lean co-creator Leonardo de Moura recently highlighted it as a verified compression project that implements both compression and decompression.

Future projects need precise theorem statements, documented assumptions, performance measurements, and tests against established implementations. Independent teams should be able to rebuild each proof and identify which modules remain outside the verified boundary.

If several projects repeat the pattern across parsers, networking code, storage formats, and cryptographic support, the case for Lean proof automation grows stronger. If results remain concentrated in small demonstrations, the broader claim weakens.

The second signal is how proof generation behaves after real code changes. Initial proof construction attracts attention, but maintenance determines whether the economics work.

Teams should measure regeneration time after refactoring, dependency upgrades, specification changes, and performance optimization. They should also record how often a human expert must restructure code or invent intermediate lemmas.

Fast success on a stable theorem offers limited evidence about a living application. A useful system must survive months of ordinary development without turning every pull request into an unpredictable proof-search project.

If proof costs remain bounded and failures produce actionable diagnostics, AI-generated verification can enter continuous integration. If small changes trigger hours of opaque search, adoption will remain limited.

The third signal is integration into mainstream coding agents. Proof generation currently sits near research workflows and specialized Lean environments.

The practical inflection point arrives when an agent can propose an invariant, explain its scope, generate the proof, run the checker, and show exactly which assumptions remain unverified.

That interface must resist false confidence. It should distinguish tested behavior from proved behavior and verified modules from unverified wrappers.

It should also make theorem changes highly visible. An agent must never “fix” a failed proof by silently weakening the property that users expected it to preserve.

For knowledge workers, these signals translate into a simple procurement test. Ask whether an AI product generates answers or produces answers with enforceable acceptance conditions.

Look for source-level provenance, permission checks, structured validation, reproducible transformations, and clear escalation paths. A polished response without those controls remains a draft, regardless of how confident it sounds.

Lean proof automation is not proof that AI can now be trusted on its own. It is evidence that trust can be engineered around AI when claims are explicit and verification stays independent.

The question for the next project is practical: which recurring decision creates enough risk to justify a real acceptance gate? Start there, define what must remain true, and make the automation earn every green check.

Get started for free

A local first AI Assistant w/ Personal Knowledge Management

For better AI experience,

remio only supports Windows 10+ (x64) and M-Chip Macs currently.

​Add Search Bar in Your Brain

Just Ask remio

Remember Everything

Organize Nothing

bottom of page