Theorem 3.1.2 — the finite horizon optimality equation and the characterization of optimal policies
ProvedSennottDP.FiniteHorizon.optimality_equationLet be an MDC with countable state space, a finite terminal cost, and . The finite horizon value function satisfies the finite horizon optimality equation
Moreover, with the set of actions attaining this minimum:
- A policy is optimal for the horizon if and only if, for every initial state , the distribution is concentrated on .
- For , a policy is optimal for the horizon if and only if, for every initial state : (1) is concentrated on ; and (2) if , then for every action with and every state with , the continuation policy that follows from is optimal for the horizon at the initial state : .
Policies here are general: history dependent and randomized. The theorem gives both the recursion that computes and Bellman's principle of optimality in necessary-and-sufficient form.
Formalization Note The book states (2) without the clause "if ". That clause is needed for the "only if" direction: when , every policy attains , including one that acts suboptimally after reaching a state with . The book's proof of necessity uses a strict inequality that holds only when is finite. "Given the process moves to state at " is read as: the pair is reachable, and . The continuation policy is θ.shift i a, and θ.σ [] i a is .
import Mathlib import Definitions.Def_SennottDP_FiniteHorizon_MDC import Definitions.Def_SennottDP_FiniteHorizon_Criterion open scoped ENNReal NNReal Topology open Filter
namespace SennottDP.FiniteHorizon
/-- Theorem 3.1.2 (Sennott, pp. 36–37), with a correction to the necessity of (ii)(2).
Let `0 < α ≤ 1` and a nonnegative terminal cost `F`. The finite horizon value function satisfies
the finite horizon optimality equation (3.2)
`v_{α,n}(i) = min_{a ∈ A_i} {C(i,a) + α ∑_j P_ij(a) v_{α,n−1}(j)}`, `i ∈ S`, `n ≥ 1`, and:
(i) a (general) policy `θ` is optimal for the 1 horizon iff for every initial state `i` the
distribution `θ(· | i)` is concentrated on `B_i(α, 1)`;
(ii) for `n ≥ 2`, `θ` is optimal for the `n` horizon iff for every initial state `i`:
(1) `θ(· | i)` is concentrated on `B_i(α, n)`, and (2) whenever `v_{α,n}(i) < ∞`, for every
action `a` with `θ(a | i) > 0` and every state `j` with `P_ij(a) > 0`, the continuation policy
`ψ(i, a, j)` of `θ` is optimal for the `n − 1` horizon at `j`.
The guard `v_{α,n}(i) < ∞` in (2) is not in the book; without it the "only if" fails when
`v_{α,n}(i) = ∞` (then every policy is optimal at `i`). -/
theorem optimality_equation {S Act : Type} [Countable S] (M : MDC S Act) (F : S → ℝ≥0)
(α : ℝ≥0) (hα0 : 0 < α) (hα1 : α ≤ 1) :
(∀ n, 1 ≤ n → ∀ i, M.value F α n i = (M.A i).inf' (M.A_nonempty i) (M.aux F α n i)) ∧
(∀ θ : M.Policy, M.IsOptimal F α 1 θ ↔
∀ i a, θ.σ [] i a ≠ 0 → a ∈ M.minSet F α 1 i) ∧
(∀ n, 2 ≤ n → ∀ θ : M.Policy, M.IsOptimal F α n θ ↔
∀ i, (∀ a, θ.σ [] i a ≠ 0 → a ∈ M.minSet F α n i) ∧
(M.value F α n i < ⊤ → ∀ a j, θ.σ [] i a ≠ 0 → M.P i a j ≠ 0 →
MDC.horizonCost F α (θ.shift i a) (n - 1) j = M.value F α (n - 1) j)) := by sorry
end SennottDP.FiniteHorizon
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.