Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5 — the LS TD limit under visit frequencies

Proved
LeastSquaresTD.Absorbing.lemma5_lstd_limit

by mikedeng1 · Oct 5, 2026 · Mathlib 0df444a (Lean v4.33.1)

markov-chainp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1reinforcement-learningtemporal-difference-learning

Run the LS TD estimate θn\theta_nθn​ from Equation (11) on an arbitrary finite Markov chain. Let πx\pi_xπx​ be the limiting proportion of transitions departing state xxx. Assume almost surely that every state is visited infinitely often and those departure proportions converge to π\piπ. If M=Φ⊤Π(I−γP)ΦM=\Phi^\top\Pi(I-\gamma P)\PhiM=Φ⊤Π(I−γP)Φ is invertible, then

θn⟶M−1Φ⊤Πrˉalmost surely.\theta_n\longrightarrow M^{-1}\Phi^\top\Pi\bar r\quad\text{almost surely}.θn​⟶M−1Φ⊤Πrˉalmost surely.

This identifies the large-sample least-squares estimate with the matrix expression used in Theorem 1.

Formalization Note The paper writes θLSTD\theta_{\mathrm{LSTD}}θLSTD​ for the limit; convergence is asserted directly here. The ordinary Markov path is specified by its initial distribution and finite-dimensional transition law. All observed transitions enter this estimator, as Equation (11) requires. Small-sample singular matrices use Lean's total inverse; the asserted limit includes eventual invertibility.

Preamble
import Definitions.Def_LeastSquaresTD_Absorbing_Estimator
Formal statement
namespace LeastSquaresTD.Absorbing

open MeasureTheory Filter Topology

variable {m : ℕ}

/-- Lemma 5, p. 43, for any finite Markov chain. The paper's `θ_LSTD` is
the limit of the estimates; `Tendsto` asserts that this limit exists.
Equation (11) uses every transition of this ordinary chain. -/
theorem lemma5_lstd_limit
    {X Ω : Type*} [Fintype X] [DecidableEq X] [Nonempty X]
    [MeasurableSpace X] [MeasurableSingletonClass X] [MeasurableSpace Ω]
    (μ : Measure Ω) [IsProbabilityMeasure μ]
    (C : Chain X) (S : X → ℝ) (R : X → X → ℝ)
    (φ : X → Fin m → ℝ) (γ : ℝ) (π : X → ℝ) (Z : ℕ → Ω → X)
    (hS_nonneg : ∀ x, 0 ≤ S x) (hS_sum : ∑ x, S x = 1)
    (hlaw : HasChainLaw C S μ Z)
    (hvisits : ∀ᵐ ω ∂μ, ∀ (x : X) (N : ℕ), ∃ n ≥ N, Z n ω = x)
    (hfreq : ∀ᵐ ω ∂μ, ∀ x,
      Tendsto (fun n => chainOutFrequency (fun k => Z k ω) x n) atTop (𝓝 (π x)))
    (hunit : IsUnit (limitMatrix C φ γ π)) :
    ∀ᵐ ω ∂μ, Tendsto
      (fun n => chainLstdTheta R φ γ (fun k => Z k ω) n)
      atTop (𝓝 (Matrix.mulVec (limitMatrix C φ γ π)⁻¹
        (limitVector C R φ π))) := by sorry

end LeastSquaresTD.Absorbing
Source
Bradtke and Barto, Linear Least-Squares Algorithms for Temporal Difference Learning, Machine Learning 22 (1996), https://doi.org/10.1023/A:1018056104778, p. 43, Lemma 5; pp. 54–55, Proof of Lemma 5
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me