[2602.22631] TorchLean: Formalizing Neural Networks in Lean

[2602.22631] TorchLean: Formalizing Neural Networks in Lean

arXiv - Machine Learning 4 min read Article

Summary

TorchLean is a framework that formalizes neural networks within the Lean 4 theorem prover, enabling precise semantics for execution and verification, addressing critical safety in AI applications.

Why It Matters

As neural networks are increasingly used in safety-critical applications, ensuring their reliability through formal verification is essential. TorchLean bridges the gap between model execution and verification, enhancing trust in AI systems by providing a unified framework for rigorous analysis and certification.

Key Takeaways

  • TorchLean treats neural networks as first-class mathematical objects for rigorous verification.
  • It integrates a verified API with both eager and compiled execution modes.
  • The framework supports explicit Float32 semantics and verification through advanced techniques.
  • End-to-end validation demonstrates its effectiveness in certified robustness and controller verification.
  • TorchLean aims to close the semantic gap in neural network analysis and execution.

Computer Science > Mathematical Software arXiv:2602.22631 (cs) [Submitted on 26 Feb 2026] Title:TorchLean: Formalizing Neural Networks in Lean Authors:Robert Joseph George, Jennifer Cruden, Xiangru Zhong, Huan Zhang, Anima Anandkumar View a PDF of the paper titled TorchLean: Formalizing Neural Networks in Lean, by Robert Joseph George and 4 other authors View PDF HTML (experimental) Abstract:Neural networks are increasingly deployed in safety- and mission-critical pipelines, yet many verification and analysis results are produced outside the programming environment that defines and runs the model. This separation creates a semantic gap between the executed network and the analyzed artifact, so guarantees can hinge on implicit conventions such as operator semantics, tensor layouts, preprocessing, and floating-point corner cases. We introduce TorchLean, a framework in the Lean 4 theorem prover that treats learned models as first-class mathematical objects with a single, precise semantics shared by execution and verification. TorchLean unifies (1) a PyTorch-style verified API with eager and compiled modes that lower to a shared op-tagged SSA/DAG computation-graph IR, (2) explicit Float32 semantics via an executable IEEE-754 binary32 kernel and proof-relevant rounding models, and (3) verification via IBP and CROWN/LiRPA-style bound propagation with certificate checking. We validate TorchLean end-to-end on certified robustness, physics-informed residual bounds for PINNs, and Ly...

Related Articles

UMKC Announces New Master of Science in Artificial Intelligence
Ai Infrastructure

UMKC Announces New Master of Science in Artificial Intelligence

UMKC announces a new Master of Science in Artificial Intelligence program aimed at addressing workforce demand for AI expertise, set to l...

AI News - General · 4 min ·
Machine Learning

[D] Looking for definition of open-world ish learning problem

Hello! Recently I did a project where I initially had around 30 target classes. But at inference, the model had to be able to handle a lo...

Reddit - Machine Learning · 1 min ·
Mystery Shopping Meets Machine Learning: Can Algorithms Become the Ultimate Customer Experience Auditor?
Machine Learning

Mystery Shopping Meets Machine Learning: Can Algorithms Become the Ultimate Customer Experience Auditor?

Customer expectations across Africa are shifting faster than most organisations can track. A single inconsistent interaction can ignite a...

AI News - General · 8 min ·
Machine Learning

GitHub to Use User Data for AI Training by Default

submitted by /u/i-drake [link] [comments]

Reddit - Artificial Intelligence · 1 min ·
More in Machine Learning: This Week Guide Trending

No comments

No comments yet. Be the first to comment!

Stay updated with AI News

Get the latest news, tools, and insights delivered to your inbox.

Daily or weekly digest • Unsubscribe anytime