TorchLean API

NN.MLTheory

NN.MLTheory #

This is the recommended entrypoint for TorchLean's formal “ML theory” layer.

It collects specifications, executable checkers, and theorems into a single import. Import a focused submodule when you only need one topic.

Optimization theory #

The optimization layer has three levels:

The tensor/runtime and real-analysis layers are deliberately separate. To use a convergence theorem for a concrete model, a model-specific bridge still has to identify the runtime gradient with the mathematical operator and account for floating-point error.

Self-supervised objectives #

The SSL theory modules formalize a finite predictive-view objective algebra:

The concrete Euclidean layer also proves that positive-edge alignment energy is nonnegative, that fully collapsed embeddings can still obtain zero alignment energy, and that a positive variance-floor guard assigns positive objective value to collapsed representations in nonzero dimension.

API training helpers can use these objectives with masked/reconstruction or joint-embedding targets and an MLP, CNN, ViT, Mamba block, or custom model.

Verified-network integration #

This entrypoint includes CROWN soundness proofs and finite-precision approximation bounds. For graph-level forward and backward rounding-error bounds, import NN.Proofs.RuntimeApprox.

Notes: