Robby955/FormalSLT
关于
Machine-checked statistical learning theory in Lean 4: empirical-Bernstein and time-uniform PAC-Bayes, Markov risk, Rademacher/VC, and Dudley chaining.
科学与工程实测星标增长
- 24小时
- 0
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文FormalSLT
FormalSLT is a Lean 4 library for statistical learning theory and modern finite-sample inference.
It develops reusable results in VC and Rademacher theory, metric entropy and chaining, PAC-Bayes bounds, confidence sequences and e-processes, and learning from adaptive or dependent trajectories. The goal is a coherent Lean foundation in which classical learning theory and newer sequential methods can be composed and extended.
For a worked example, start with two predictors scored on the same stream. At each reporting time, select the one with lower observed loss. The downstream Lean example bounds that predictor’s average conditional risk along the observed prefix. The occupancy replay uses the same theorem to check a Brier-risk upper bound of 0.073268 over 8,224 observations.
Documentation · Theorem map · Search declarations · Install
Overview video
Fixed-time guarantees can fail under repeated monitoring; one checked event can cover repeated looks. The repo-wide film starts there, then maps reusable proof infrastructure across VC and Rademacher theory, chaining, PAC-Bayes, e-processes, and dependent-data inference. It establishes the platform and its current interfaces; it does not claim end-to-end verification of an ML system.
Play the responsive film · Transcript · Manim source · Pinned v0.2.0 film receipt
Results
Classical learning theory
FormalSLT includes Sauer-Shelah bounds for finite set families, VC-based uniform-deviation and ERM excess-risk bounds for binary zero-one loss, finite-sample Rademacher symmetrization, Massart bounds, contraction, linear-predictor bounds, and metric-entropy estimates. Its chaining results reach total-bounded spaces and continuous entropy-integral bounds while keeping the required boundary, separability, and modulus assumptions explicit.
VC source · Rademacher source · chaining source · theorem map
Anytime PAC-Bayes and empirical Bernstein
For an infinite IID sequence, one event controls every sample size n ≥ 2 and
every admissible posterior. The bound uses Bessel sample variance and
measure-theoretic KL divergence. A separate forward construction handles
predictable residuals for sequential use. One countable
master e-process can also cover a fixed catalog of history-dependent,
predictable tilt strategies. A finite product-catalog theorem goes further:
both the model and strategy posterior may be chosen after observing the path,
with separate KL costs, and a shared-strategy corollary returns ordinary
posterior conditional risk. A second countable master mixes a fixed positive
catalog of scalar tilts over arbitrary measurable hypothesis spaces and
eligible continuous posterior measures. The all-sample IID result is uniform
over sample size, but it is not an optional-stopping theorem.
The sequential layer also has exact executable wealth-weighted masters. A finite master adapts among supplied predictable betting strategies, while a countable sleeping-expert construction evaluates only the active prefix and a closed-form tail. Both compete with every active declared expert; neither is a parameter-free continuum coin-betting result.
Lean source · checker · positive-KL example · model--strategy posterior · predictable-strategy master · measurable countable master · computable betting master
Adaptive trajectories
One event can allow the posterior and tilt to depend on the observed prefix and time. The growing-prefix oracle now supports arbitrary measurable state and hypothesis spaces: it minimizes the exact observable boundary over the declared geometric tilts available at the reporting time and bounds it by an explicit LIL-order envelope. Its width tends to zero under the displayed pathwise posterior-KL rate. The trajectory result starts from a deterministic initial state and bounds monitored conditional risk, not stationary or future deployment risk.
finite-state source · observable oracle · measurable-space oracle · trajectory oracle receipt · measurable oracle checker
Stationary and Markov risk
Prequential bounds combine with finite-depth Poisson corrections to control stationary risk. One route uses a known contracting kernel. The empirical route uses a finite catalog of contracting candidates and requires every source row to be visited. A selected empirical contraction bound below one additionally proves uniqueness of the true invariant law.
known-kernel source · candidate-family source · worked checker
Controlled queue
For a 24-state controlled queue, the generic transition bound allocates
confidence across 48 × 48 × 2 = 4,608 coordinates. Under a specified
one-parameter refresh model, a single destination-hit statistic has a
row-independent conditional mean, and Lean proves that its parameter
discrepancy equals physical-row total variation. This example is retrospective
and conditional on the refresh model; it does not test family membership.
application · design · Lean receipt
Install
FormalSLT currently uses Lean 4.32.2 and Mathlib 4.32.2. The stable topic imports are:
import FormalSLT.PACBayes
import FormalSLT.Sequential
import FormalSLT.StochasticDynamics
import FormalSLT.VC
To install v0.3.0, add the tagged dependency to your Lake project.
require «formal-slt» from git
"https://github.com/Robby955/FormalSLT.git" @ "v0.3.0"
For unreleased work, pin a full commit SHA that you have reviewed rather than the moving branch.
Then run:
lake update
lake exe cache get
lake build
v0.3.0 release notes · Published releases
Repository layout
FormalSLT/PACBayes: PAC-Bayes inequalities and change-of-measure toolsFormalSLT/Rademacher: symmetrization, contraction, and generalization boundsFormalSLT/Covering: metric entropy and chainingFormalSLT/Sequential: confidence sequences, e-processes, and Ville boundsFormalSLT/StochasticDynamics: adaptive paths, kernels, and stationary riskFormalSLT/VC: VC dimension, growth functions, and uniform convergenceexamples: small checker files for public resultsapplications: end-to-end worked examples
Verify
lake exe cache get
lake build FormalSLT
make examples
make tutorials
make api
make downstream
Papers and references
- A Machine-Checked Anytime-Valid Confidence Sequence by the Method of Mixtures, accepted poster at COPA 2026 (artifact and reproduction)
- From Agents to Axioms: Verifier-Gated Lean Formalization for Statistical Learning Theory, ICML 2026 AI for Math workshop
- Literature notes
- Source map
To cite the v0.3.0 software, use Robert Sneiderman (2026), FormalSLT: Formal Statistical Learning Theory in Lean 4, version 0.3.0. Tagged source · Citation metadata
Contributing
See CONTRIBUTING.md and the good first issues.
License
MIT. See LICENSE.
探索相关项目
加载中…