Lean Formalization of Generalization Error Bound by Rademacher Complexity

Sho Sonoda, Kazumi Kasaura, Yuma Mizuno, Kei Tsukamoto, Naoto Onda
3/25/2025
cs.LGcs.CLmath.ST

No official code found. Best implementation: auto-res/lean-rademacher (23 stars, MIT, last commit 2026-02-26).

Abstract

We formalize the generalization error bound using the Rademacher complexity for the Lean 4 theorem prover based on the probability theory in the Mathlib 4 library. Generalization error quantifies the gap between a learning machine's performance on given training data versus unseen test data, and the Rademacher complexity is a powerful tool to upper-bound the generalization error of a variety of modern learning problems. Previous studies have only formalized extremely simple cases such as bounds by parameter counts and analyses for very simple models (decision stumps). Formalizing the Rademacher complexity bound, also known as the uniform law of large numbers, requires substantial development and is achieved for the first time in this study. In the course of development, we formalize the Rademacher complexity and its unique arguments such as symmetrization, and clarify the topological assumptions on hypothesis classes under which the bound holds. As an application, we also present the formalization of generalization error bound for $L^2$-regularization models.

View on arXivView PDF

Code Implementations(1)

MIT

Lean Formalization of Generalization Error Bound by Rademacher Complexity

235LeanMar 25, 20257 months agoMIT

Similar Papers

Cite this paper

@article{sonoda2025lean,
  title  = {Lean Formalization of Generalization Error Bound by Rademacher Complexity},
  author = {Sho Sonoda and Kazumi Kasaura and Yuma Mizuno and Kei Tsukamoto and Naoto Onda},
  year   = {2025},
  eprint = {2503.19605},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.19605v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.19605.svg)](https://codeofpaper.com/paper/2503.19605)

Discussion