TorchLean is the first unified deep-learning framework built in Lean 4. It brings model construction, training, and formal reasoning into one library, so executable neural-network code and the mathematics used to study it do not become separate projects.
You use it much like an ordinary ML library: define a model, load tensors, and train on CPU or GPU. Tensor shapes are part of the types, so incompatible layers and malformed operations are caught while the program is being written rather than during a training run.
Once a model runs, its Lean definition can be lowered to the graph used by the runtime. Backends and accelerated kernels remain explicit, including the assumptions made at external library boundaries. The graph can then be studied with formally verified floating-point arithmetic, autograd theorems, robustness bounds, and certificate checkers.