Towards Formalizing Reinforcement Learning Theory: A Robbins-Siegmund Approach
Convergence proofs for reinforcement learning algorithms such as Q-learning and linear TD are delicate and error-prone; several published results have had documented gaps or errors. No machine-checked proofs of their almost sure convergence with Markovian samples existed.
The authors formalize finite Markov chains in Lean 4 with Mathlib: row-stochastic matrices, irreducibility, aperiodicity, Doeblin minorization, stationary distributions and geometric mixing. They build sample-path probability spaces from Mathlib probability kernels. Mathlib has little ODE theory, so they avoid the usual ODE-based approach. Instead, both algorithms are cast as stochastic approximation iterates and analyzed in a unified framework based on the Robbins-Siegmund theorem with Lyapunov functions.
The work gives the first formal verification of almost sure convergence of linear TD and Q-learning with Markovian samples; the code is released publicly. The authors identify conditional expectation as the most technically challenging part. They outline extensions to convergence rates, concentration bounds and other TD methods.
