1. Add the dependency
Add StatsMLlib to your project’s lakefile.toml.
[[require]]
name = "StatsMLlib"
git = "https://github.com/Lean-MoDS/StatsMLlib.git"A Lean 4 library
Formal foundations for probability, statistics, and machine learning, from concentration inequalities and random matrices to finite-sample learning guarantees.
Abstract. StatsMLlib develops concentration of measure, metric entropy and chaining, empirical processes, Rademacher complexity, random matrix theory, and finite-sample learning guarantees as formal mathematics in Lean 4. Together, these results provide a unified foundation for probability, statistics, and machine learning, with every proof checked by the Lean 4 kernel.
Add StatsMLlib to your project’s lakefile.toml.
[[require]]
name = "StatsMLlib"
git = "https://github.com/Lean-MoDS/StatsMLlib.git"Import only the part of the library you need.
import StatsMLlib.Probability.Process.Dudley
import StatsMLlib.LearningTheory.UniformDeviation.Bounds
import StatsMLlib.Statistics.Regression.LeastSquares.Linear.MinimaxRateFormalized literature map
Navigate StatsMLlib through five foundational books, with each chapter map highlighting related formal developments in Lean 4.
For a separable, first-countable parameter space indexing measurable functions bounded in absolute value by \(b>0\), with pointwise-continuous parametrization, empirical means track their expectations uniformly.
For a \(d\)-dimensional linear class and injective design, least squares achieves a nonasymptotic rate of order \(\sigma^2 d/n\).
For an anchored sub-Gaussian process indexed by a totally bounded set of diameter at most \(D\), the expected supremum is controlled by metric entropy.