LeanMachineLearning
What would it take to believe this library?
LeanMachineLearning states 6 results as theorems and proves all 930 of its declarations with no sorry anywhere.
Believing them means also accepting 8 upstream packages, of which 0 are unaudited.
Every declaration here carries what it claims, what it rests on, and a single self-contained Lean file holding everything you would have to read to check it.
The results, largest first by how much machinery they rest on.
-
Bandits.TS.integral_regret_leIf Thompson sampling has the correct prior over environments and every environment has
Kactions, each of which has a corresponding reward betweenlanduthat is sub-Gaussian with variance proxyσ2after its mean is subtracted, then the Bayesian regret at timenis at most(2 * K + 1) * (u - l) + 8 * √(σ2 * K * n * Real.log n). -
Bandits.UCB.regret_leRegret bound for the UCB algorithm.
-
Bandits.ETC.regret_leRegret bound for the ETC algorithm.
-
Learning.randomSampling.action_tendsto_anyThe minimum distance from sampled actions to any point tends to zero.
-
Learning.IsAlgEnvSeq.identDistrib_trajectoryThe law of the sequence of actions and observations generated by an algorithm-environment pair is unique: it does not depend on the probability space used.
-
Finset.measurable_inf'Dual version of
Finset.measurable_sup'.
Project overview
Source: README.md
Lean Machine Learning
The Lean library for machine learning research.
Website: https://leanmachinelearning.org/
Goals
-
A library of high-quality formalization of machine learning definitions.
-
Essential theorems and proofs in machine learning theory.
-
A framework for working on machine learning algorithms in Lean.
-
An extensive documentation, with examples and tutorials.
-
A trusted basis for formalization of machine learning research.
Contributing
Please see our contribution guide and code of conduct.
For discussions, you can reach out to us on the Lean prover Zulip chat.
You can also see the roadmap for ideas on what to work on.
Current state of the library
As a first proof of concept, the repository contains a formalization of regret bounds for several stochastic bandit algorithms.
Main results:
-
Framework for working on (bandit) algorithms in Lean.
-
Regret bound for the Explore-Then-Commit algorithm.
-
Regret bound for the UCB algorithm.
Modules
How the project's 68 modules depend on one another. Colour marks the chapter, so the blocks of colour are the chapter structure and the edges between them are where it is crossed.
An edge means some declaration in the lower module uses something declared in the upper one. Edges implied by a longer path are not drawn.
Showing the 47 modules that depend on one another; the other 21 are independent of the rest of the project.
For Mathlib (6 definitions, 143 lemmas, 1 theorems)
-
ForMathlib.MeasureTheory.Measurable(0 definitions, 5 lemmas, 0 theorems) -
ForMathlib.MeasureTheory.Measure.AbsolutelyContinuous(0 definitions, 1 lemmas, 0 theorems) -
ForMathlib.MeasureTheory.OuterMeasure.Basic(0 definitions, 1 lemmas, 0 theorems) -
ForMathlib.MeasureTheory.Order.Lattice(0 definitions, 0 lemmas, 1 theorems) -
ForMathlib.MeasureTheory.Order.MeasurableArg(4 definitions, 13 lemmas, 0 theorems) -
ForMathlib.Order.Interval.Finset(0 definitions, 1 lemmas, 0 theorems) -
ForMathlib.Probability.HasCondDistrib(0 definitions, 12 lemmas, 0 theorems) -
ForMathlib.Probability.Independence.CondDistrib(1 definitions, 36 lemmas, 0 theorems) -
ForMathlib.Probability.Kernel.KernelSub(0 definitions, 15 lemmas, 0 theorems) -
ForMathlib.Probability.Independence.CondIndepFun(0 definitions, 10 lemmas, 0 theorems) -
ForMathlib.Probability.Independence.IndepFun(0 definitions, 8 lemmas, 0 theorems) -
ForMathlib.Probability.Independence.IndepInfinitePi(0 definitions, 2 lemmas, 0 theorems) -
ForMathlib.Probability.Integrable(0 definitions, 1 lemmas, 0 theorems) -
ForMathlib.Probability.Kernel.Basic(0 definitions, 1 lemmas, 0 theorems) -
ForMathlib.Probability.Kernel.Composition.IntegralCompProd(0 definitions, 2 lemmas, 0 theorems) -
ForMathlib.Probability.Kernel.Composition.MapComap(0 definitions, 4 lemmas, 0 theorems) -
ForMathlib.Probability.Kernel.Composition.MeasureCompProd(0 definitions, 1 lemmas, 0 theorems) -
ForMathlib.Probability.Kernel.IonescuTulcea.Traj(1 definitions, 11 lemmas, 0 theorems) -
ForMathlib.Probability.Moments.SubGaussian(0 definitions, 9 lemmas, 0 theorems) -
ForMathlib.Probability.WithDensity(0 definitions, 9 lemmas, 0 theorems) -
ForMathlib.Topology.Instances.ENNReal.Lemmas(0 definitions, 1 lemmas, 0 theorems)
Online (31 definitions, 195 lemmas, 3 theorems)
-
Online.Bandit.Algorithms.ETC(2 definitions, 15 lemmas, 1 theorems) -
Online.Bandit.SumRewards(0 definitions, 32 lemmas, 0 theorems) -
Online.Bandit.ArrayProbSpace(9 definitions, 68 lemmas, 0 theorems) -
Online.Bandit.BayesRegret(4 definitions, 13 lemmas, 0 theorems) -
Online.Bandit.Regret(3 definitions, 15 lemmas, 0 theorems) -
Online.Bandit.Algorithms.Regret.BayesRegretTS(2 definitions, 12 lemmas, 1 theorems) -
Online.Bandit.Algorithms.TS(3 definitions, 3 lemmas, 0 theorems) -
Online.Bandit.Algorithms.UCB(5 definitions, 26 lemmas, 1 theorems) -
Online.Bandit.RewardByCountMeasure(3 definitions, 11 lemmas, 0 theorems)
Sequential Learning (56 definitions, 336 lemmas, 2 theorems)
-
SequentialLearning.SumRewards(4 definitions, 24 lemmas, 0 theorems) -
SequentialLearning.FiniteActions(4 definitions, 71 lemmas, 0 theorems) -
SequentialLearning.Algorithm(11 definitions, 39 lemmas, 0 theorems) -
SequentialLearning.StationaryEnv(4 definitions, 24 lemmas, 0 theorems) -
SequentialLearning.BayesStationaryEnv(4 definitions, 13 lemmas, 0 theorems) -
SequentialLearning.IonescuTulceaSpace(7 definitions, 41 lemmas, 1 theorems) -
SequentialLearning.Algorithms.RoundRobin(2 definitions, 10 lemmas, 0 theorems) -
SequentialLearning.Deterministic(8 definitions, 31 lemmas, 0 theorems) -
SequentialLearning.AlgorithmDensityBayes(0 definitions, 3 lemmas, 0 theorems) -
SequentialLearning.AlgorithmDensity(3 definitions, 3 lemmas, 0 theorems) -
SequentialLearning.Algorithms.Uniform(1 definitions, 1 lemmas, 0 theorems) -
SequentialLearning.Algorithms.RandomSampling.Basic(1 definitions, 4 lemmas, 0 theorems) -
SequentialLearning.ActionIndicator(1 definitions, 11 lemmas, 0 theorems) -
SequentialLearning.Algorithms.RandomSampling.Tendsto(0 definitions, 8 lemmas, 1 theorems) -
SequentialLearning.EvaluationEnv(2 definitions, 17 lemmas, 0 theorems) -
SequentialLearning.FeedbackMartingale(2 definitions, 21 lemmas, 0 theorems) -
SequentialLearning.Means(2 definitions, 15 lemmas, 0 theorems)
Tactic (117 definitions, 40 lemmas, 0 theorems)
-
Tactic.EqLift.ForMathlib.Kernel(0 definitions, 3 lemmas, 0 theorems) -
Tactic.EqLift.ForMathlib.MeasurableEquiv(1 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Kernel.Lift(1 definitions, 15 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Kernel.KernelLift(10 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Lift(7 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Utils(6 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Universe(4 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Location(2 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Kernel.Utils(4 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Kernel.KernelUnlift(10 definitions, 0 lemmas, 0 theorems) -
Tactic.EqLift.Tactic.Unlift(5 definitions, 0 lemmas, 0 theorems) -
Tactic.KernelHom.ForMathlib.LIntegral(0 definitions, 1 lemmas, 0 theorems) -
Tactic.KernelHom.Kernel.Hom(2 definitions, 19 lemmas, 0 theorems) -
Tactic.KernelHom.Kernel.MonoidalComp(6 definitions, 2 lemmas, 0 theorems) -
Tactic.KernelHom.Tactic.Delaborators(4 definitions, 0 lemmas, 0 theorems) -
Tactic.KernelHom.Tactic.HomKernel(10 definitions, 0 lemmas, 0 theorems) -
Tactic.KernelHom.Tactic.KernelHom(23 definitions, 0 lemmas, 0 theorems) -
Tactic.KernelHom.Tactic.Utils(3 definitions, 0 lemmas, 0 theorems) -
Tactic.KernelHom.Tactic.KernelCat(3 definitions, 0 lemmas, 0 theorems) -
Tactic.KernelHom.Tactic.KernelDiagram(10 definitions, 0 lemmas, 0 theorems) -
Tactic.KernelHom.Tactic.Reassoc(6 definitions, 0 lemmas, 0 theorems)