See https://lean-lang.org/install/ for a detailed tutorial on setting up Lean.
Confirm that Lean is set up by lake --version.
git clone git@github.com:ShangtongZhang/rl-theory-in-lean.git
cd rl-theory-in-lean
lake exe cache get
lake build
It is recommended to use this project with the Lean 4 extension of VSCode.
Towards Formalizing Reinforcement Learning Theory
@article{zhang2026towards,
title={Towards Formalizing Reinforcement Learning Theory: A Robbins-Siegmund Approach},
author={Shangtong Zhang},
journal={Reinforcement Learning Journal},
year={2026}
}
This project is organized by mirroring the structure of Mathlib so the counterparts can be upstreamed to Mathlib easily. Below are some main results.
[LinearTDIterates] - linear TD algorithm.[DecreaseAlong] - $\ell_2$ norm qualifies a Lyapunov function for linear TD.ae_tendsto_of_linearTD_iid — almost sure convergence of linear TD with i.i.d. samples.ae_tendsto_of_linearTD_markov — almost sure convergence of linear TD with Markovian samples.[QLearningIterates] — Q-learning algorithm.[DecreaseAlong] - $\ell_p$ norm with a sufficiently large $p$ qualifies a Lyapunov function for Q-learning.ae_tendsto_of_QLearning_iid — almost sure convergence of Q-learning with i.i.d. samples.ae_tendsto_of_QLearning_markov — almost sure convergence of Q-learning with Markovian samples.[Iterates] — a general form of SA iterates with Martingale difference noise and additional noise.[IteratesOfResidual] — a specific form of SA iterates driven by residual of an operator.[AdaptedOnSamplePath] — SA iterates are completely determined by available information until current time step on every sample path.condExp_iterates_update — computes the conditional expectation of SA iterates in the Ionescu-Tulcea probability space.[LyapunovFunction] — desired properties for a function to be used as a Lyapunov function to analyze SA iterates.smooth_half_sq_Lp — squared $\ell_p$ norm is $p - 1$ smooth.fundamental_inequality — recursive bounds of errors based on a Lyapunov function on an individual sample path.ae_tendsto_of_iterates_mds_noise — convergence of SA iterates with Martingale difference noise.ae_tendsto_of_iterates_iid_samples — convergence of SA iterates with i.i.d. samples.anchors_of_inv_poly — inverse polynomial step size qualifies the skeleton iterates technique that can convert Markov noise to Martingale difference noise.ae_tendsto_of_iterates_markov_samples — convergence of SA iterates with Markovian samples.ae_tendsto_of_iterates_markov_samples_of_inv_poly — specializes to inverse polynomial step size schedules.all_but_finite_of_closed_under_add_and_gcd_one — if a set has gcd 1 and is close under addition, it then contains all large enough integers.posDefAsymm_iff' — a lower bound for the quadratic form of a p.d. matrix.smat_minorizable_with_large_pow — an irreducible and aperiodic stochastic matrix is Doeblin minorizable after sufficient powers.smat_contraction_in_simplex - Doeblin minorization implies contraction in simplexstationary_distribution_exists - produces one stationary distribution via Cesaro limit.stationary_distribution_uniquely_exists — stationary distribution uniquely exists under irreducibility and aperiodicity.[GeometricMixing] - geometric mixing under irreducibility and aperiodicity.traj_prob — constructs the sample path space probability measure for Markov chains by the Ionescu-Tulcea theorem.ae_tendsto_zero_of_almost_supermartingale — Robbins-Siegmund theorem for the convergence of almost supermartingales.[NegDefAsymm MRP.K] — negative definiteness of the matrix $D(\gamma P - I)$16 commits
2 commits
Lean
99.1%
See https://lean-lang.org/install/ for a detailed tutorial on setting up Lean.
Confirm that Lean is set up by lake --version.
git clone git@github.com:ShangtongZhang/rl-theory-in-lean.git
cd rl-theory-in-lean
lake exe cache get
lake build
It is recommended to use this project with the Lean 4 extension of VSCode.
Towards Formalizing Reinforcement Learning Theory
@article{zhang2026towards,
title={Towards Formalizing Reinforcement Learning Theory: A Robbins-Siegmund Approach},
author={Shangtong Zhang},
journal={Reinforcement Learning Journal},
year={2026}
}
This project is organized by mirroring the structure of Mathlib so the counterparts can be upstreamed to Mathlib easily. Below are some main results.
[LinearTDIterates] - linear TD algorithm.[DecreaseAlong] - $\ell_2$ norm qualifies a Lyapunov function for linear TD.ae_tendsto_of_linearTD_iid — almost sure convergence of linear TD with i.i.d. samples.ae_tendsto_of_linearTD_markov — almost sure convergence of linear TD with Markovian samples.[QLearningIterates] — Q-learning algorithm.[DecreaseAlong] - $\ell_p$ norm with a sufficiently large $p$ qualifies a Lyapunov function for Q-learning.ae_tendsto_of_QLearning_iid — almost sure convergence of Q-learning with i.i.d. samples.ae_tendsto_of_QLearning_markov — almost sure convergence of Q-learning with Markovian samples.[Iterates] — a general form of SA iterates with Martingale difference noise and additional noise.[IteratesOfResidual] — a specific form of SA iterates driven by residual of an operator.[AdaptedOnSamplePath] — SA iterates are completely determined by available information until current time step on every sample path.condExp_iterates_update — computes the conditional expectation of SA iterates in the Ionescu-Tulcea probability space.[LyapunovFunction] — desired properties for a function to be used as a Lyapunov function to analyze SA iterates.smooth_half_sq_Lp — squared $\ell_p$ norm is $p - 1$ smooth.fundamental_inequality — recursive bounds of errors based on a Lyapunov function on an individual sample path.ae_tendsto_of_iterates_mds_noise — convergence of SA iterates with Martingale difference noise.ae_tendsto_of_iterates_iid_samples — convergence of SA iterates with i.i.d. samples.anchors_of_inv_poly — inverse polynomial step size qualifies the skeleton iterates technique that can convert Markov noise to Martingale difference noise.ae_tendsto_of_iterates_markov_samples — convergence of SA iterates with Markovian samples.ae_tendsto_of_iterates_markov_samples_of_inv_poly — specializes to inverse polynomial step size schedules.all_but_finite_of_closed_under_add_and_gcd_one — if a set has gcd 1 and is close under addition, it then contains all large enough integers.posDefAsymm_iff' — a lower bound for the quadratic form of a p.d. matrix.smat_minorizable_with_large_pow — an irreducible and aperiodic stochastic matrix is Doeblin minorizable after sufficient powers.smat_contraction_in_simplex - Doeblin minorization implies contraction in simplexstationary_distribution_exists - produces one stationary distribution via Cesaro limit.stationary_distribution_uniquely_exists — stationary distribution uniquely exists under irreducibility and aperiodicity.[GeometricMixing] - geometric mixing under irreducibility and aperiodicity.traj_prob — constructs the sample path space probability measure for Markov chains by the Ionescu-Tulcea theorem.ae_tendsto_zero_of_almost_supermartingale — Robbins-Siegmund theorem for the convergence of almost supermartingales.[NegDefAsymm MRP.K] — negative definiteness of the matrix $D(\gamma P - I)$16 commits
2 commits
Lean
99.1%