Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5.1, p. 22 — NPG with softmax policies is soft policy iteration: π⁽ᵗ⁺¹⁾(a|s) = π⁽ᵗ⁾(a|s) exp(ηA⁽ᵗ⁾(s,a)/(1−γ))/Z_t(s)

Proved
PolicyGradTheory.NPG.npg_soft_policy_iteration

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

multiplicative-weightsnatural-policy-gradientp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1soft-policy-iterationsoftmax-policy

This is the policy form of Lemma 5.1 (NPG as soft policy iteration).

Let (P,r,γ)(P,r,\gamma)(P,r,γ) be a finite MDP with a nonempty action set, ρ∈Δ(S)\rho\in\Delta(\mathcal S)ρ∈Δ(S) a start distribution from which every state is reachable, and η∈R\eta\in\mathbb Rη∈R a step size. Let (θ(t))t≥0(\theta^{(t)})_{t\ge0}(θ(t))t≥0​ be any run of the natural policy gradient updates (15) with softmax policies, from an arbitrary initial parameter θ(0)\theta^{(0)}θ(0), and write π(t)=πθ(t)\pi^{(t)}=\pi_{\theta^{(t)}}π(t)=πθ(t)​ and A(t)=Aπ(t)A^{(t)}=A^{\pi^{(t)}}A(t)=Aπ(t). Then for every ttt, every state sss and every action aaa,

π(t+1)(a∣s)=π(t)(a∣s) exp⁡(ηA(t)(s,a)/(1−γ))Zt(s),Zt(s)=∑a∈Aπ(t)(a∣s)exp⁡(ηA(t)(s,a)/(1−γ)).\pi^{(t+1)}(a\mid s)=\pi^{(t)}(a\mid s)\,\frac{\exp\big(\eta A^{(t)}(s,a)/(1-\gamma)\big)}{Z_t(s)},\qquad Z_t(s)=\sum_{a\in\mathcal A}\pi^{(t)}(a\mid s)\exp\big(\eta A^{(t)}(s,a)/(1-\gamma)\big).π(t+1)(a∣s)=π(t)(a∣s)Zt​(s)exp(ηA(t)(s,a)/(1−γ))​,Zt​(s)=a∈A∑​π(t)(a∣s)exp(ηA(t)(s,a)/(1−γ)).

The NPG step is thus a multiplicative-weights (exponentiated advantage) update at every state, independent of the state visitation distribution. This closed form is what drives the dimension-free rate of Theorem 5.3.

Formalization Note The page also states the parameter form θ(t+1)=θ(t)+η1−γA(t)\theta^{(t+1)}=\theta^{(t)}+\frac{\eta}{1-\gamma}A^{(t)}θ(t+1)=θ(t)+1−γη​A(t). That clause is not stated: the pseudoinverse step is the minimum-norm solution, which differs from A(t)/(1−γ)A^{(t)}/(1-\gamma)A(t)/(1−γ) by a state-dependent offset, and the lemma's own proof (App. C.3, p. 70) ends with θ(t+1)=θ(t)+η1−γA(t)+ηv\theta^{(t+1)}=\theta^{(t)}+\frac{\eta}{1-\gamma}A^{(t)}+\eta vθ(t+1)=θ(t)+1−γη​A(t)+ηv, vs,a=csv_{s,a}=c_svs,a​=cs​. The policy form, which is invariant to the offset, is the statement used downstream. Reachability of every state is the standing restriction of §5.3 (footnote 6); the step size is unrestricted since the identity holds for every real η\etaη.

Preamble
import Mathlib
import Definitions.Def_PolicyGradTheory_ProjGA_MDP
import Definitions.Def_PolicyGradTheory_NPG_Algorithm
import Definitions.Def_FoundationsML_ReinforcementLearning_IsOptimalPolicy

open FoundationsML.ReinforcementLearning
Formal statement
namespace PolicyGradTheory.NPG

/-- Lemma 5.1 (NPG as soft policy iteration; arXiv:1908.00261v5, p. 22), policy form: along any
run of the NPG updates (15) with softmax policies, from any start `θ^{(0)}`,
`π^{(t+1)}(a|s) = π^{(t)}(a|s) exp(η A^{(t)}(s,a)/(1−γ)) / Z_t(s)`. -/
theorem npg_soft_policy_iteration {S A : Type*} [Fintype S] [DecidableEq S] [Fintype A] [DecidableEq A]
    (P : S → A → S → ℝ) (r : S → A → ℝ) (γ : ℝ) (hM : PolicyGradTheory.ProjGA.IsFiniteMDP P r γ)
    [Nonempty A] (ρ : S → ℝ) (hρ : PolicyGradTheory.ProjGA.IsDist ρ) (hreach : AllReachable P γ ρ)
    (η : ℝ) (θ : ℕ → EuclideanSpace ℝ (S × A)) (hrun : IsNPGRun P r γ ρ η θ) :
    ∀ (t : ℕ) (s : S) (a : A),
      softmaxPolicy (θ (t + 1)) s a =
        softmaxPolicy (θ t) s a *
          Real.exp (η * PolicyGradTheory.ProjGA.advantage (softmaxPolicy (θ t)) P r γ s a / (1 - γ)) /
          npgNormalizer P r γ η (θ t) s := by sorry

end PolicyGradTheory.NPG
Source
arXiv:1908.00261v5, Lemma 5.1, p. 22; proof in App. C.3, pp. 69–70
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 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