Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The return as a sum of flat partial returns

Proved
SuttonBartoRL.ImportanceSampling.return_eq_flat_partial_returns

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

importance-samplingp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1reinforcement-learning

For any rewards R1,R2,…R_1, R_2, \dotsR1​,R2​,…, any discount rate γ\gammaγ and times 0≤t<T0 \le t < T0≤t<T,

Gt=Rt+1+γRt+2+⋯+γT−t−1RT=(1−γ)∑h=t+1T−1γh−t−1Gˉt:h+γT−t−1Gˉt:T,G_t = R_{t+1} + \gamma R_{t+2} + \dots + \gamma^{T-t-1} R_T = (1 - \gamma) \sum_{h=t+1}^{T-1} \gamma^{h-t-1} \bar G_{t:h} + \gamma^{T-t-1} \bar G_{t:T},Gt​=Rt+1​+γRt+2​+⋯+γT−t−1RT​=(1−γ)h=t+1∑T−1​γh−t−1Gˉt:h​+γT−t−1Gˉt:T​,

where Gˉt:h=Rt+1+⋯+Rh\bar G_{t:h} = R_{t+1} + \dots + R_hGˉt:h​=Rt+1​+⋯+Rh​ is the flat partial return. Read with γ∈[0,1)\gamma \in [0,1)γ∈[0,1), the return is an average of flat partial returns in which horizon hhh receives the weight (1−γ)γh−t−1(1-\gamma)\gamma^{h-t-1}(1−γ)γh−t−1 of "terminating" at hhh. This decomposition underlies the discounting-aware importance-sampling estimators (5.9)–(5.10).

Formalization Note The book introduces the decomposition "for any γ∈[0,1)\gamma \in [0,1)γ∈[0,1)"; the identity is algebraic and is stated here for every real γ\gammaγ, which is more general than the book's reading.

Preamble
import Mathlib
import Definitions.Def_SuttonBartoRL_ImportanceSampling_Returns
Formal statement
namespace SuttonBartoRL.ImportanceSampling

/-- Sutton & Barto (2018), §5.8, p. 113: the return is a sum of flat partial returns,
`G_t = (1 - γ) Σ_{h=t+1}^{T-1} γ^{h-t-1} Ḡ_{t:h} + γ^{T-t-1} Ḡ_{t:T}` for `0 ≤ t < T`. -/
theorem return_eq_flat_partial_returns (R : ℕ → ℝ) (γ : ℝ) (t T : ℕ) (htT : t < T) :
    discountedReturn R γ t T =
      (1 - γ) * ∑ h ∈ Finset.Ioo t T, γ ^ (h - t - 1) * flatPartialReturn R t h +
        γ ^ (T - t - 1) * flatPartialReturn R t T := by sorry

end SuttonBartoRL.ImportanceSampling
Source
Sutton & Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press (2018), ISBN 9780262039246, §5.8, display decomposing G_t into flat partial returns, p. 113
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