The control variate does not change the expected value of the off-policy return (Exercise 7.6, for (7.13))
ProvedSuttonBartoRL.NStep.controlVariate_expectationLet a finite MDP be given, a target policy and a behavior policy with coverage: implies . Fix a value estimate , a discount , a number of steps and a state , and let actions be drawn from . Write and consider, with horizon ,
- the off-policy return with control variate (7.13): , ;
- the same return without the control variate: , .
Then
where is the on-policy -step return (7.1) and the last expectation is over trajectories generated by .
The first equality is the statement of the exercise: the control variate term leaves the expected return unchanged. The second is the property the book states on p. 150, that the control variate "does not change the expected update".
Formalization Note The book poses this as Exercise 7.6 (no solution given) right after the action-value return (7.14), referring to "the above equations"; this item states it for the state-value return (7.13) of p. 150. The second equality (unbiasedness for the on-policy return) is a stronger conclusion than the literal exercise and is stated deliberately. Expectations are finite sums over -step segments, and is fixed (the book's ).
import Mathlib import Definitions.Def_SuttonBartoRL_NStep_MDP import Definitions.Def_SuttonBartoRL_NStep_Trajectories
namespace SuttonBartoRL.NStep
/-- Sutton & Barto (2018), Exercise 7.6, p. 151, for the state-value return (7.13), p. 150: the
control variate `(1 − ρ_t) V(S_t)` does not change the expected value of the return. For a finite
MDP, a target policy `π`, a behavior policy `b` with coverage (`π(a|s) > 0 ⇒ b(a|s) > 0`), a fixed
value estimate `V`, any `γ` and any number of steps `n`, the expectation under `b` given `S_t = s` of
the control-variate return (7.13) equals that of the per-decision importance-sampled return without
the control variate, and both equal the on-policy expectation `E_π[G_{t:t+n} | S_t = s]` of the
`n`-step return (7.1). -/
theorem controlVariate_expectation {S A : Type} [Fintype S] [DecidableEq S]
[Fintype A] [DecidableEq A]
(M : MDP S A) (π b : Policy S A) (hcov : ∀ s a, 0 < π.prob s a → 0 < b.prob s a)
(γ : ℝ) (V : S → ℝ) (n : ℕ) (s : S) :
segmentExpectation M b n s (controlVariateReturnOn M π b γ V n s) =
segmentExpectation M b n s (perDecisionReturnOn M π b γ V n s) ∧
segmentExpectation M b n s (controlVariateReturnOn M π b γ V n s) =
expectedNStepReturn M π γ V n s := by sorry
end SuttonBartoRL.NStep
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.