Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Adjoint pairing computes the first variation of the terminal cost

Proved
BertsekasDP.perturbed_terminal_cost_adjoint_limit

by davidnet · Sep 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

optimal-controlpontryaginvariational-calculus

Consider the fixed-horizon problem of BertsekasCTModel with C1C^1C1 data f,g,hf,g,hf,g,h, an admissible pair (u,x)(u,x)(u,x) on [0,T][0,T][0,T], and a costate ppp that is continuous on [0,T][0,T][0,T], satisfies the terminal condition p(T)=∇h(x(T))p(T)=\nabla h(x(T))p(T)=∇h(x(T)), and solves the adjoint equation

p˙(t)=−∇xH(x(t),u(t),p(t)),H(x,u,p)=g(x,u)+⟨p,f(x,u)⟩,\dot p(t)=-\nabla_x H(x(t),u(t),p(t)),\qquad H(x,u,p)=g(x,u)+\langle p,f(x,u)\rangle,p˙​(t)=−∇x​H(x(t),u(t),p(t)),H(x,u,p)=g(x,u)+⟨p,f(x,u)⟩,

off a finite set of times.

Fix τ∈(0,T)\tau\in(0,T)τ∈(0,T) and let ε↦yε\varepsilon\mapsto y_\varepsilonε↦yε​ be a family of perturbed trajectories which, for all small ε>0\varepsilon>0ε>0, is continuous on [τ,T][\tau,T][τ,T] and satisfies the same state equation y˙ε=f(yε,u)\dot y_\varepsilon=f(y_\varepsilon,u)y˙​ε​=f(yε​,u) with the same control uuu off a finite set. Assume the initial deviation at τ\tauτ has a first-order expansion,

lim⁡ε↓0yε(τ)−x(τ)ε=w.\lim_{\varepsilon\downarrow 0}\frac{y_\varepsilon(\tau)-x(\tau)}{\varepsilon}=w.ε↓0lim​εyε​(τ)−x(τ)​=w.

Then the tail cost accumulated on [τ,T][\tau,T][τ,T] has first variation given by the adjoint pairing at τ\tauτ:

lim⁡ε↓01ε[(h(yε(T))+∫τTg(yε(t),u(t)) dt)−(h(x(T))+∫τTg(x(t),u(t)) dt)]=⟨p(τ),w⟩.\lim_{\varepsilon\downarrow 0}\frac1\varepsilon\left[\Big(h(y_\varepsilon(T))+\int_\tau^T g(y_\varepsilon(t),u(t))\,dt\Big)-\Big(h(x(T))+\int_\tau^T g(x(t),u(t))\,dt\Big)\right]=\langle p(\tau),w\rangle.ε↓0lim​ε1​[(h(yε​(T))+∫τT​g(yε​(t),u(t))dt)−(h(x(T))+∫τT​g(x(t),u(t))dt)]=⟨p(τ),w⟩.

The mechanism is the classical pairing identity. Writing Δε=yε−x\Delta_\varepsilon=y_\varepsilon-xΔε​=yε​−x, the deviation obeys the variational equation up to a remainder that is o(∥Δε∥)o(\lVert\Delta_\varepsilon\rVert)o(∥Δε​∥) uniformly in ttt, because fff is C1C^1C1 and both trajectories remain in a compact tube; a Gronwall estimate gives ∥Δε∥=O(ε)\lVert\Delta_\varepsilon\rVert=O(\varepsilon)∥Δε​∥=O(ε) on [τ,T][\tau,T][τ,T]. Differentiating t↦⟨p(t),Δε(t)⟩t\mapsto\langle p(t),\Delta_\varepsilon(t)\ranglet↦⟨p(t),Δε​(t)⟩ off the finite exceptional set and using the adjoint equation shows that its increment cancels the first-order running-cost increment ∫τT⟨∇xg(x,u),Δε⟩\int_\tau^T\langle\nabla_x g(x,u),\Delta_\varepsilon\rangle∫τT​⟨∇x​g(x,u),Δε​⟩, while the terminal condition p(T)=∇h(x(T))p(T)=\nabla h(x(T))p(T)=∇h(x(T)) converts the terminal-cost increment into ⟨p(T),Δε(T)⟩\langle p(T),\Delta_\varepsilon(T)\rangle⟨p(T),Δε​(T)⟩. What survives is the pairing at the left endpoint, ⟨p(τ),Δε(τ)⟩\langle p(\tau),\Delta_\varepsilon(\tau)\rangle⟨p(τ),Δε​(τ)⟩, whose ε\varepsilonε-quotient converges to ⟨p(τ),w⟩\langle p(\tau),w\rangle⟨p(τ),w⟩.

Preamble
import Definitions.Def_BertsekasCTModel

open Filter
open scoped Topology
Formal statement
theorem BertsekasDP.perturbed_terminal_cost_adjoint_limit
    {n m : ℕ} (M : BertsekasCTModel n m)
    (hf : ContDiff ℝ 1 (Function.uncurry M.f))
    (hg : ContDiff ℝ 1 (Function.uncurry M.g))
    (hh : ContDiff ℝ 1 M.h)
    (u : ℝ → EuclideanSpace ℝ (Fin m))
    (x p : ℝ → EuclideanSpace ℝ (Fin n))
    (hadm : BertsekasCTAdmissibleFrom M 0 M.x0 u x)
    (hp : ContinuousOn p (Set.Icc 0 M.T))
    (hterm : p M.T = gradient M.h (x M.T))
    (F : Finset ℝ)
    (hadj : ∀ t ∈ Set.Icc 0 M.T \ (F : Set ℝ),
      HasDerivAt p
        (-gradient (fun y => BertsekasHamiltonian M y (u t) (p t)) (x t)) t)
    (τ : ℝ) (hτ : τ ∈ Set.Ioo 0 M.T)
    (y : ℝ → ℝ → EuclideanSpace ℝ (Fin n))
    (hy : ∀ᶠ ε in 𝓝[>] (0 : ℝ),
      ContinuousOn (y ε) (Set.Icc τ M.T) ∧
        ∃ G : Finset ℝ, ∀ t ∈ Set.Icc τ M.T \ (G : Set ℝ),
          HasDerivAt (y ε) (M.f (y ε t) (u t)) t)
    (w : EuclideanSpace ℝ (Fin n))
    (hlim : Tendsto (fun ε => ε⁻¹ • (y ε τ - x τ)) (𝓝[>] (0 : ℝ)) (𝓝 w)) :
    Tendsto
      (fun ε => ε⁻¹ * ((M.h (y ε M.T) + ∫ t in τ..M.T, M.g (y ε t) (u t)) -
        (M.h (x M.T) + ∫ t in τ..M.T, M.g (x t) (u t))))
      (𝓝[>] (0 : ℝ)) (𝓝 (inner ℝ (p τ) w)) := by
  sorry
Source
D. Liberzon, Calculus of Variations and Optimal Control Theory, Sections 4.2.3-4.2.4, equations (4.14)-(4.23), https://liberzon.csl.illinois.edu/teaching/cvoc/node68.html and https://liberzon.csl.illinois.edu/teaching/cvoc/node69.html; adjoint pairing identity (4.32), Section 4.2.8; terminal costs, Section 4.3.1.3, https://liberzon.csl.illinois.edu/teaching/cvoc/node82.html. Fixed-horizon Bolza specialization adapted to the finite-exception admissibility class of BertsekasCTModel (D. Bertsekas, Dynamic Programming and Optimal Control, Vol. I, 3rd ed., Sections 3.2-3.3.1).

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me