Towards Formalizing Reinforcement Learning Theory

Shangtong Zhang
11/5/2025
cs.LGstat.ML

Official code: ShangtongZhang/rl-theory-in-lean (58 stars, MIT, last commit 2026-04-24).

Abstract

In this paper, we formalize the almost sure convergence of $Q$-learning and linear temporal difference (TD) learning with Markovian samples using the Lean 4 theorem prover based on the Mathlib library. $Q$-learning and linear TD are among the earliest and most influential reinforcement learning (RL) algorithms. The investigation of their convergence properties is not only a major research topic during the early development of the RL field but also receives increasing attention nowadays. This paper formally verifies their almost sure convergence in a unified framework based on the Robbins-Siegmund theorem. The framework developed in this work can be easily extended to convergence rates and other modes of convergence. This work thus makes an important step towards fully formalizing convergent RL results. The code is available at https://github.com/ShangtongZhang/rl-theory-in-lean.

View on arXivView PDF

Code Implementations(1)

MIT

Towards Formalizing RL Theory

582Lean, ShellNov 5, 20256 months agoMIT

Similar Papers

Cite this paper

@article{zhang2025towards,
  title  = {Towards Formalizing Reinforcement Learning Theory},
  author = {Shangtong Zhang},
  year   = {2025},
  eprint = {2511.03618},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2511.03618v1}
}

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/2511.03618.svg)](https://codeofpaper.com/paper/2511.03618)

Discussion