LLM+Lean+SMT: A New Paradigm for Formal Verification of Dynamical System Safety

LLM2Cert integrates LLM, SMT, and Lean to rigorously verify stability and safety of high-dimensional nonlinear systems.
LLM2Cert is a study integrating large language models, SMT solvers, and the Lean theorem prover into an end-to-end framework to synthesize and verify Lyapunov functions and barrier certificates under strict conditions. The team built the Dynasat Bench covering four task types, increasing high-dimensional use cases from 7 to 25. SMT handles fast verification and counterexamples, escalating Delta-satisfiable and timed-out obligations to Lean for constructive proofs via a proof-repair agent. LLM2Cert verified 40 systems versus 11 for baselines, solved 8 of 10 unresolved BarrierBench systems, and structured feedback boosted Lean proof repair success by over 40%. The full framework runs the benchmark in 2.5 hours with 7.83M tokens, trading time for strict mathematical guarantees.
Safety-critical systems (autonomous driving, robotics, aerospace) have long faced unreliable stability and safety proofs due to numerical methods and the approximate compromises of SMT solvers. A study called LLM2Cert attempts to integrate large language models, SMT solvers, and the Lean theorem prover into an end-to-end framework, completing the synthesis and verification of Lyapunov functions and barrier certificates under strict conditions without relaxation.
Bottlenecks of Traditional Verification Methods
Stability and safety verification of dynamical systems relies on two types of mathematical certificates: Lyapunov functions (decreasing along trajectories proves stability) and barrier certificates (constructing an impassable boundary to isolate dangerous regions). Traditional solving approaches each have limitations—numerical methods like sum-of-squares programming are affected by floating-point errors, and although SMT solvers can give Delta-satisfiable results, they require compromises such as Taylor approximations and excluding neighborhoods of the origin, and are difficult to adapt to high-dimensional strongly nonlinear systems.
More critically, existing benchmark sets are mostly low-dimensional, parameter-free polynomial systems with limited domains, disconnected from real engineering scenarios, and cannot accurately evaluate algorithmic capabilities.

Lyapunov functions and barrier certificates are two core mathematical objects in formal verification of dynamical systems. A Lyapunov function $V(x)$ is a scalar function that is zero at the equilibrium point, positive definite in a neighborhood, and has a non-positive derivative along system trajectories, thereby guaranteeing asymptotic stability. A barrier certificate $B(x)$ partitions the state space into safe and dangerous regions and proves that trajectories starting from the safe region can never cross the boundary into the dangerous region. What they share is that as long as a function satisfying specific inequalities can be found, the stability or safety of the system can be proven without solving trajectories. However, finding such a function is itself an existential quantification problem that is extremely difficult for nonlinear systems—this is precisely the motivation for numerical methods and SMT solvers to intervene, and also the root of their compromises.
SMT (Satisfiability Modulo Theories) solvers are used to determine whether a first-order logic formula has a satisfying solution under a specific theory (such as real arithmetic or nonlinear arithmetic). The Z3, CVC5, and Yices mentioned in the article are general-purpose SMT solvers, while dReal is specifically oriented toward nonlinear real arithmetic. For the verification conditions of Lyapunov functions or barrier certificates, SMT solvers can attempt to prove their unsatisfiability (i.e., holding for all candidate functions), but the decidability of nonlinear real arithmetic is theoretically limited, so dReal introduces the concept of Delta-satisfiability: determining satisfiability within a user-specified numerical tolerance. This means that when "satisfiable" is returned, it may only be approximately true, and when "unsatisfiable" is returned, it may also be misjudged due to tolerance; hence the article treats Delta-satisfiable results as neither confirmable nor refutable, requiring escalation to Lean for handling.
Dynasat Bench: A Benchmark Set for Real-World Scenarios
The research team constructed Dynasat Bench, covering four types of verification tasks for continuous and discrete-time systems: stability, region of attraction, forward invariance, and safety. The construction process collected 233 candidate entries from 15 representative papers and BarrierBench, and after deduplication, merging, and redundancy removal, retained 80 core systems.
To address the scarcity of high-dimensional use cases, the benchmark set added two extension levels: elevating the dimensionality of retained systems and adding control constraints or disturbances, as well as directly constructing new high-dimensional systems. Use cases with dimension greater than or equal to 5 increased from 7 to 25. Unlike BarrierBench, which only covers safety verification, Dynasat Bench has broader task coverage.

Hybrid Verification Framework: Division of Labor Between SMT and Lean
The core design of LLM2Cert is to let SMT solvers and the Lean theorem prover complement each other. SMT (Z3, CVC5, Yices, dReal) is responsible for fast verification and counterexample generation, with a per-obligation timeout set to 30 seconds; returning unsatisfiable means passing, while returning satisfiable provides a counterexample. dReal's Delta-satisfiable results, due to their uncertainty, can neither confirm nor refute, and together with timed-out obligations are escalated to Lean.
The Lean side employs a proof-repair agent: the context and theorem statement are fixed, the agent only generates the proof body, and upon failure returns structured diagnostics (error type, location, remaining goals), based on which iterative modifications are made. Proofs must pass type checking and auditing, rejecting sorry placeholders and custom axioms beyond standard axioms.

The Lean theorem prover is an interactive proof assistant based on dependent type theory, whose core mechanism is: the user (or agent) writes proof terms, the kernel performs type checking, and only proofs that pass the check are accepted. Unlike the automatic determination of SMT solvers, Lean's proofs are constructive and independently auditable, without reliance on numerical tolerance or approximation. The article requires the proof body to reject sorry placeholders (a placeholder in Lean used to skip proofs) and custom axioms beyond standard axioms, precisely to ensure the strictness of the proof—any incomplete proof or additional assumption would break the end-to-end guarantee. Introducing Lean into the synthesis-verification pipeline essentially transforms obligations that SMT cannot determine into constructive proof problems, trading computation time for mathematical certainty.
Experimental Performance and Efficiency Trade-offs
On the 51 systems supported by baselines, baseline methods verified 19 under their own conditions, with only 11 valid after strict retesting; LLM2Cert verified 40 under the same strict conditions, of which 23 could not be completed by any baseline under native conditions. Ablation shows that one-shot proposals verified only 63 systems, while the complete framework reached 81; SMT-only and Lean-only configurations verified 57 and 60, respectively. LLM2Cert also solved 8 of the 10 unresolved systems in BarrierBench.
Backend analysis with fixed candidates shows that among 296 obligations, SMT solved 212, and the remaining 84 had to be handled by Lean, concentrated in scenarios with transcendental functions, unbounded domains, and complex nonlinear constraints. Routing by obligation type achieved higher success rates and less total time. Structured feedback increased the Lean proof repair success rate by over 40% compared to attempts without feedback.
The complete framework running the entire benchmark set takes 2.5 hours, all-SMT takes 0.25 hours, and all-Lean takes 1.4 hours, with total experiment time of about 6.2 hours, consuming 7.83M model tokens. For safety-critical systems, the strict mathematical guarantees obtained by trading time are of practical value.

The proof-repair agent is a mechanism that allows large language models to self-correct after type-checking failures. Its key design is to fix the context and theorem statement, only allowing the agent to generate the proof body, thereby preventing the model from tampering with the proposition to be proven. On failure, the returned structured diagnostics include the error type (e.g., type mismatch, unsolved goals), error location, and remaining goals, which are fed back to the model for the next round of modification. This "generate—check—diagnose—repair" loop is similar to compiler-error-driven code repair, but demands higher logical rigor. The article reports that structured feedback increases the repair success rate by over 40%, indicating that the quality of diagnostic information has a decisive impact on LLM performance in formal proof tasks.
Limitations and Outlook
Currently, the proposal agent iterates at most 5 times, and Lean proof repair is capped at 6 rounds; complex systems may exhaust the budget; the framework only supports symbolic certificates and cannot yet handle neural network black-box certificates. Future optimization directions include improving candidate generation quality, refining proof repair strategies, and extending to end-to-end verification of neural certificates.
The significance of LLM2Cert lies in bridging the three domains of large language models, SMT solving, and theorem proving, providing a previously nonexistent strict verification path for high-dimensional strongly nonlinear systems, with reference value for safety assurance in autonomous driving and robotics.
One-line Summary
LLM2Cert integrates LLM, SMT, and Lean to rigorously verify the stability and safety of high-dimensional nonlinear systems.
Paragraph Summary
LLM2Cert is a study that integrates large language models, SMT solvers, and the Lean theorem prover into an end-to-end framework, aiming to synthesize and verify Lyapunov functions and barrier certificates under strict conditions without relaxation. The research team constructed the Dynasat Bench benchmark set, covering four types of tasks: stability, region of attraction, forward invariance, and safety, and increased high-dimensional use cases from 7 to 25 through dimension elevation and construction. The framework assigns SMT to fast verification and counterexample generation, escalates Delta-satisfiable and timed-out obligations to Lean for constructive proofs, and employs a proof-repair agent to iteratively modify proof bodies. Under strict conditions, LLM2Cert verified 40 systems versus only 11 valid for baselines, and solved 8 of the 10 unresolved systems in BarrierBench; structured feedback increased the Lean proof repair success rate by over 40%. The complete framework runs the benchmark set in 2.5 hours, with total experiment consumption of 7.83M tokens, trading time for strict mathematical guarantees and providing a previously nonexistent verification path for high-dimensional strongly nonlinear systems.
Related articles

Nvidia CEO Removal Saga: Trump Intervenes Over the Weekend, Jensen Huang Reinstated Monday
Vergecast podcast reveals Nvidia CEO drama: earnings call said he wouldn't return and a new CEO was being sought; Trump intervened over the weekend, with J.D. Vance brokering a security guarantee to the board; Jensen Huang reinstated at 9 a.m. Monday.

Semantic Caching Explained: Reusing the Same Answer for Similar Questions
Semantic caching uses embeddings to judge whether queries are similar in meaning and reuses cached results for similar prompts. This article explains how it works, the difficulty of threshold tuning (such as the risk of misjudging negations), and its applicable boundaries.

How Did Trump Personally Turn Nvidia into the "Twelfth Board Member"?
A YouTube political commentary offers a sharp view: behind Nvidia's market cap milestone, Trump's deep involvement earns him the title of "twelfth board member." The article breaks down the commentator's logic on stock market achievements, the break from small-government tradition, and power display.