lean-dojo

lean-dojo / TorchLean

Public

TorchLean is the first unified Lean 4 framework for neural-network specification, execution, and verification.

48
4
100% credibility
Found May 14, 2026 at 48 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Lean
AI Summary

TorchLean is a Lean 4 framework for defining, executing, inspecting, and verifying neural network programs with typed tensors, autograd support, finite-precision semantics, and CUDA integration.

How It Works

1
🔍 Discover safe AI math

You hear about TorchLean, a tool that lets you build and check neural networks mathematically so they're reliable.

2
📥 Get it ready

Download and set up with simple instructions, no complicated steps.

3
🚀 Run your first network

Try a ready example and see a neural network think and learn right away.

4
🧠 Build your own model

Create a custom neural network for your data, like predicting numbers or images.

5
📈 Train it to learn

Feed it examples so it gets better at your task, watching progress live.

6
Check it's correct

Verify your network behaves exactly as math says, catching any mistakes.

🎉 Reliable AI ready

You now have a proven neural network you can trust for real work.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 48 to 48 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is TorchLean?

TorchLean is the first unified Lean 4 framework for formalizing neural networks in Lean, letting you specify models mathematically, execute them on CPU or CUDA, and verify properties like robustness. Write typed tensors and layers, train with autograd and optimizers, then prove bounds or generate certificates—all in one language. Quickstarts like `lake exe torchlean mlp --cpu --steps 10` get you running toy models instantly.

Why is it gaining traction?

It unifies specification, execution, and verification without switching tools: import PyTorch models, run on GPU via TorchLean github repo, check certs for attacks or bounds. Lean proofs catch shape errors and semantics early, while runtime handles real training loops and RL envs. Stands out for blending formal rigor with practical speed on modern ops like convs, attention, and FFTs.

Who should use this?

ML engineers verifying robustness in safety-critical nets, like autonomous driving or certified classifiers. Researchers in scientific ML (PINNs, ODEs) needing provable approximations. Lean users extending to NN proofs without Python interop hacks.

Verdict

Promising pioneer for verified NNs, but 48 stars and 1.0% credibility signal early days—docs and examples shine, tests cover CUDA parity, yet scale cautiously. Dive in via the guide if formal ML hooks you; skip for production training.

(187 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.