44.07.04 · optimization-control / optimal-control-pontryagin

The Hamilton-Jacobi-Bellman Equation and the Verification Theorem

shipped3 tiersLean: none

Anchor (Master): Fleming & Soner 2006 Controlled Markov Processes and Viscosity Solutions (2nd ed., Springer Stochastic Modelling and Applied Probability 25) Ch. 1-2, 10 (the dynamic-programming principle, the HJB equation, classical verification, and the viscosity-solution theory that handles the nonsmooth value function and gives uniqueness); Liberzon 2012 Calculus of Variations and Optimal Control Theory (Princeton University Press) Ch. 5; Bardi & Capuzzo-Dolcetta 1997 Optimal Control and Viscosity Solutions of Hamilton-Jacobi-Bellman Equations (Birkhäuser) Ch. 1-3 (deterministic optimal control, the comparison principle, and viscosity characterisation of the value function)

Intuition Beginner

Suppose you are driving across a country and want to reach a city by sunset at the lowest fuel cost. One way to plan is to consider every possible whole route and compare totals. A smarter way is to build a map that labels each town with a single number: the cheapest cost still remaining to finish the trip from that town. If you had that map, planning would be effortless. Standing in any town, you just look one road ahead, add the cost of that road to the labelled number of the town it leads to, and take the road with the smallest total. The map carries all the foresight; your decisions become local.

The Hamilton-Jacobi-Bellman equation is the rule that map must obey. It says the label of a town equals the best you can do over one small step: the cost paid on that step plus the label of wherever the step lands you. Nothing about the distant future appears directly, because the neighbour's label already summarises everything beyond it. This is the same idea as the value tables of discrete dynamic programming, now stated for time that flows continuously rather than in separate stages.

The second half of the story is the most useful. Building the true cost-to-come map is hard. But checking a candidate is comparatively simple. If someone hands you a map and you verify that every town's label really does equal the best one-step-ahead total, then that map is guaranteed to be the true one, and the road it points to from each town is genuinely an optimal plan. This guarantee is the verification theorem: passing the local self-consistency test certifies global optimality.

That contrast matters. An earlier method gives conditions any best plan must satisfy, like a list of clues a culprit must match. Verification does the opposite: it confirms that a proposed plan actually is best.

Visual Beginner

Picture the cost-to-come map as a landscape where height at each point is the cheapest remaining cost from that point. The optimal motion always heads in the direction that descends this landscape fastest while paying the running cost. The map's defining property is purely local: at every point, the height equals the best one-small-step total.

The table below contrasts the two ways of certifying a plan, the necessary-condition method from the previous chapter and the verification method of this unit.

method what it provides direction of the guarantee
necessary conditions (maximum principle) clues every optimum must satisfy narrows the suspects; does not by itself convict
verification (this unit) a self-consistent cost map confirms a candidate is genuinely best

The takeaway: a single stored function of position and time turns global optimisation into a local check, and passing that check at every point is a certificate of optimality.

Worked example Beginner

Take a cart on a line whose position changes at the rate , with the throttle free to be any number. You start at some position at time and must arrive at time . The running cost is (steering effort), and the finishing cost is (you are penalised for ending far from ). We want the cheapest plan and its cost-to-come map.

Step 1. Guess the shape of the map. Because every cost here is a square, a sensible guess is that the cheapest remaining cost from position at time has the form for some number that depends only on the time left. At the finish, , so .

Step 2. Write the local rule. From position , choosing throttle for a small instant costs now and moves you to . The best throttle balances effort against future savings. Working this out for the squared map gives the cheapest throttle as : steer back toward , harder when the future penalty is larger.

Step 3. Find . The self-consistency of the map forces to satisfy , that is , together with . Solving gives .

Step 4. Read off the answer. At the start time , the cheapest remaining cost from position is , and the optimal steering at any moment is .

What this tells us: a single tidy function stored the entire plan, and the optimal control came straight out of it as a feedback rule that reacts to the current position. We never searched over whole trajectories; we found the map and let it steer.

Check your understanding Beginner

Formal definition Intermediate+

Consider the controlled system with state and control a measurable function, continuous and Lipschitz in uniformly on bounded sets so that trajectories exist and are unique. For an initial pair with , an admissible control on generates the trajectory started at . The cost is the Bolza functional of 44.07.01,

with running cost and terminal cost , both continuous and bounded below.

Definition (value function). The value function (optimal cost-to-go) is

It records the best achievable remaining cost from each state-time pair; the terminal identity is the boundary condition.

Definition (dynamic-programming principle). For every with ,

This is the continuous-time principle of optimality: an optimal plan splits into an optimal first leg followed by an optimal continuation, with the value function summarising the continuation. It is the continuous counterpart of the discrete identity of 44.08.02.

Definition (Hamilton-Jacobi-Bellman equation). The control Hamiltonian is

the partial minimisation over the admissible controls of the integrand (the same pointwise minimisation that defines the optimal control in 44.07.01, with the gradient slot). The Hamilton-Jacobi-Bellman equation is the first-order partial differential equation

with terminal condition . A control is an optimal feedback law: a function of the current state and time rather than of the initial data.

Definition (greedy / feedback minimiser and the costate). Along a trajectory generated by the feedback , the costate of 44.07.01 is recovered as . The symbols (value function), (state gradient), (time derivative), (the minimised Hamiltonian), (control-constraint set), and (terminal and running costs) are recorded in _meta/NOTATION.md.

Counterexamples to common slips Intermediate+

  • "The value function is always differentiable, so the HJB PDE holds in the classical sense everywhere." False. Even with smooth data, is generically only Lipschitz: it develops kinks along surfaces where the optimal trajectory is non-unique (the analogue of caustics in the classical Hamilton-Jacobi setting 09.05.02). At such points does not exist, and the equation must be interpreted in the viscosity sense 02.18.05. A classical solution may simply fail to exist.

  • "A smooth solution of the HJB equation is automatically the value function." It is, but only once the terminal condition is imposed and the minimising feedback is admissible. The verification theorem needs both the PDE and the boundary data; the PDE alone has many solutions. This is the continuous shadow of the discrete fact that Bellman's equation pins down only because the contraction gives a unique fixed point 44.08.02.

  • "The HJB equation gives necessary conditions, like the maximum principle." The opposite. HJB plus verification is a sufficiency statement: a solution certifies optimality. Pontryagin's principle 44.07.01 is necessity: it lists conditions any optimum must meet. Confusing the two directions is the central conceptual error; the link between them is along the optimal trajectory.

Key theorem with proof Intermediate+

The signature result is the verification theorem: a smooth solution of the HJB equation that meets the terminal condition is the value function, and its pointwise minimiser is an optimal feedback control. This is the sufficiency counterpart to the necessity of the maximum principle 44.07.01, and the continuous-time face of the discrete optimality equation 44.08.02.

Theorem (verification / sufficiency). Let satisfy the Hamilton-Jacobi-Bellman equation

for all . Suppose there is a measurable feedback attaining the minimum for every , and that the closed-loop equation , , has a solution on for each . Then is the value function, and is an optimal control: for every .

Proof. Fix and let be any admissible control on , with trajectory , . Because is , the map is absolutely continuous and, by the chain rule,

The HJB equation gives , since the minimum over is no larger than the value at . Substituting,

Integrate from to and use :

that is . As was arbitrary, .

For the reverse inequality, run the closed-loop control with trajectory . Now attains the minimum, so the inequality above is an equality at every :

Integrating from to gives , i.e. (the cost of a specific admissible control is at least the infimum). Combining, and the bound is achieved by , so is optimal.

Bridge. The verification theorem is the foundational reason a stored value function certifies optimality: the chain-rule identity telescopes the entire trajectory cost into the boundary values, and equality holds exactly along the feedback minimiser. This is exactly the continuous-time image of the discrete fixed-point equation of 44.08.02 — where the discrete operator iterates to a unique fixed point, the continuous problem replaces iteration with a PDE whose terminal-valued solution plays the role of , and the minimised Hamiltonian is the infinitesimal generator of that operator. It is dual to the necessity of Pontryagin's maximum principle 44.07.01: the central insight is that the costate is the value gradient, along the optimal trajectory, so the trajectory-side necessary conditions and the value-side sufficient conditions are two readings of one problem. The construction generalises the classical Hamilton-Jacobi equation of 09.05.02, to which it reduces when there is no control to minimise over, and it builds toward the viscosity-solution theory of 02.18.05 that rescues the argument when is merely Lipschitz. Putting these together, the bridge is that the HJB equation appears again in the linear-quadratic regulator 44.07.02 as the quadratic-value reduction to the Riccati equation, where this verification proof becomes a direct, dimension-free certificate of the LQR optimum.

Exercises Intermediate+

Advanced results Master

The continuous theory extends in four directions that parallel the discrete development of 44.08.02: the exact LQR reduction, the relation of HJB to the classical Hamilton-Jacobi equation, the viscosity-solution rescue of the nonsmooth case, and the discrete-to-continuous limit that ties HJB to the Bellman operator.

Theorem 1 (LQR as the quadratic-value HJB solution). For , with , , and with , the value function is the quadratic where solves the differential Riccati equation , . The feedback minimiser is the linear law , and verification is immediate because the candidate is exactly (indeed ) wherever exists. This is the HJB-side derivation of the regulator of 44.07.02, complementary to its Pontryagin-side derivation via the Hamiltonian matrix \mathcal H = \begin{psmallmatrix}A & -BR^{-1}B^{\mathsf T}\\ -Q & -A^{\mathsf T}\end{psmallmatrix}; the Riccati solution is the value-function Hessian, [Bertsekas Vol. 1 Ch. 3].

Theorem 2 (relation to the classical Hamilton-Jacobi equation). When the running cost depends on the control only through and over an open control set, the minimisation in is the Legendre transform of in its velocity argument, and the HJB equation becomes the classical Hamilton-Jacobi equation of analytical mechanics 09.05.02, with the Legendre-dual Hamiltonian. HJB is thus the controlled, minimisation-bearing generalisation of Hamilton-Jacobi: the action-as-value-function of mechanics is the no-constraint, single-Lagrangian special case of the optimal cost-to-go [Liberzon Ch. 5].

Theorem 3 (viscosity characterisation and uniqueness). Under mild hypotheses (continuity and appropriate growth of , with compact), the value function is the unique bounded uniformly continuous viscosity solution of the HJB equation with terminal data , in the sense of 02.18.05: is simultaneously a viscosity sub- and supersolution, tested against functions touching from above and below. The comparison principle for the Hamilton-Jacobi operator delivers uniqueness even where has corners, so the verification theorem extends: a continuous function is the value function if and only if it is the viscosity solution with the correct boundary condition. The classical verification theorem is the special case in which the viscosity solution happens to be differentiable [Fleming-Soner Ch. 10].

Theorem 4 (HJB as the continuous limit of discrete dynamic programming). Discretising time into steps of length and replacing by yields a finite-horizon discrete problem whose Bellman operator satisfies as on smooth . Thus the discrete dynamic-programming recursion of 44.08.02 converges, under consistency and stability, to the HJB equation, and value iteration in discrete time is the explicit time-marching scheme for the HJB PDE. The discount factor of the discrete contraction becomes a zeroth-order term in the infinite-horizon discounted HJB equation , the coercive term that restores well-posedness without a terminal condition [Bardi-Capuzzo-Dolcetta Ch. 3].

The curse of dimensionality. The verification theorem is a certificate, not an algorithm: it presupposes a solution of a PDE on . Grid-based solution of the HJB equation requires points for nodes per axis, so the cost grows exponentially in the state dimension — Bellman's curse of dimensionality. Exact HJB solution is therefore feasible only for small or for structured cases (LQR, where the value is quadratic and the PDE collapses to the matrix Riccati equation) and motivates approximate dynamic programming, the maximum-principle's trajectory-based methods that avoid the full state-space sweep, and reinforcement-learning value-function approximation [Bertsekas Vol. 1 Ch. 3].

Synthesis. The foundational reason continuous-time optimal control reduces to a single equation is that the dynamic-programming principle, applied over an infinitesimal step, collapses the optimisation over all control functions into the local HJB partial differential equation — the continuous-time image of the discrete fixed point of 44.08.02, with the minimised Hamiltonian the infinitesimal generator of the Bellman operator. This is dual to Pontryagin's maximum principle 44.07.01: the central insight is the identity along the optimal trajectory, which makes the trajectory-side necessary conditions and the value-side sufficient conditions two readings of one problem, and the verification theorem is exactly the sufficiency direction the maximum principle cannot supply. The HJB equation generalises the classical Hamilton-Jacobi equation of 09.05.02 — the no-control, single-Lagrangian special case in which becomes the Legendre transform and the action of mechanics is the cost-to-go stripped of its minimisation. Putting these together, the smooth verification theorem is the differentiable shadow of the viscosity-solution characterisation of 02.18.05, the precise sense in which the kinked value function is still the unique solution of HJB; the discount term that makes the infinite-horizon HJB coercive is dual to the contraction modulus of the discrete Bellman operator. This appears again in the LQR case 44.07.02, where all of it is exact: the value is quadratic, the PDE is the Riccati equation, and the curse of dimensionality is the one obstruction the certificate cannot remove.

Full proof set Master

Proposition 1 (dynamic-programming principle implies HJB for smooth ). If the value function is , then satisfies with .

Proof. Fix and a constant control value held over , with trajectory . The dynamic-programming principle gives . Subtract , divide by , and let ; by the chain rule and , yielding for every , hence . For the reverse, choose near-optimal controls achieving ; the same expansion and a continuity/selection argument as give . Equality follows, and is the definition.

Proposition 2 (verification / sufficiency). Let solve the HJB equation with , with a measurable feedback minimiser whose closed loop has solutions. Then and is optimal.

Proof. For any admissible with trajectory , , the chain rule gives . The HJB equation gives , so . Integrating over and using gives ; infimising over , . Running makes every inequality an equality (the feedback attains the min), so . Hence and is optimal.

Proposition 3 (costate-gradient identity). For with interior feedback minimiser , the function along the optimal trajectory satisfies the adjoint equation of 44.07.01.

Proof. Differentiating and using gives . Differentiating the HJB identity in , the envelope theorem kills the terms (because minimises), leaving . Substituting, the terms cancel and .

Proposition 4 (LQR value is quadratic and solves the Riccati equation). For the LQR data, with the solution of , , and the optimal feedback is .

Proof. Insert ( symmetric) into HJB. Then and . The inner problem has, since , the unique minimiser with minimum . The HJB equation equal to this for all , after symmetrising , forces with from . The candidate is where exists, so Proposition 2 certifies and optimal.

Proposition 5 (the value function is a viscosity solution). Under continuity and boundedness of the data with compact, is a viscosity solution of the HJB equation in the sense of 02.18.05: for every and every interior local maximum (resp. minimum) point of , (resp. ).

Proof (subsolution direction). Let touch from above at with having a local maximum there, normalised so and nearby. Fix constant and apply the dynamic-programming principle: for small . Subtract , divide by , let : by the expansion of , . Minimising over gives , the subsolution inequality. The supersolution direction uses near-optimal controls and a touch from below symmetrically. Uniqueness then follows from the comparison principle for this Hamilton-Jacobi operator 02.18.05.

Connections Master

  • The infinite-horizon discounted dynamic programming of 44.08.02 is this unit's discrete-time origin: the discrete Bellman operator becomes, under time-discretisation with step and discount , the differential operator of the HJB equation as , and the unique-fixed-point statement delivered there by the -contraction becomes the terminal-valued HJB solution here. Value iteration in discrete time is the explicit time-marching scheme for the HJB PDE, and the discount factor that supplied the contraction modulus reappears as the zeroth-order coercive term in the stationary infinite-horizon equation.

  • The classical Hamilton-Jacobi equation of 09.05.02 is the no-control special case of HJB: when there is no minimisation over an admissible set and the running cost is a single Lagrangian, the minimised Hamiltonian becomes the Legendre transform of and the HJB equation reduces to , with Hamilton's principal function (the action) playing the role of the value function. Optimal control's cost-to-go is thus the controlled generalisation of mechanics' action, and the method of characteristics for the classical equation is the maximum-principle trajectory sweep seen from the value side.

  • The viscosity-solution theory of 02.18.05 is what makes the verification theorem survive nonsmoothness: the value function is generically only Lipschitz, developing corners where optimal trajectories bifurcate, so the classical verification of this unit must be replaced by the statement that is the unique viscosity solution of HJB with the given boundary data. The comparison principle that delivers uniqueness for the Hamilton-Jacobi operator is the weak-solution substitute for the contraction uniqueness of the discrete theory, and the smooth verification theorem is exactly the case where the viscosity solution is differentiable.

  • Pontryagin's maximum principle 44.07.01 is the necessary-condition dual of this unit's sufficient verification theorem: the costate is the value-function gradient, , so the adjoint equation is the differentiated HJB equation along the optimal trajectory, and the pointwise Hamiltonian minimisation defining the optimal control is the same inner minimisation that defines the HJB Hamiltonian . Pontryagin reads the problem from the trajectory; HJB reads it from the value; the identity is the bridge.

  • The linear-quadratic regulator of 44.07.02 is the case where the entire HJB apparatus is exact and finite-dimensional: the value function is the quadratic , the HJB PDE collapses to the matrix differential Riccati equation, the value Hessian is the Riccati matrix, and the optimal feedback is the linear law. LQR is the standard demonstration that verification, when the value happens to be smooth, is a clean and complete optimality certificate immune to the curse of dimensionality.

Historical & philosophical context Master

The continuous-time dynamic-programming equation grew directly out of Richard Bellman's work of the 1950s on the principle of optimality, the same program from which the discrete Bellman equation of 44.08.02 descends [Bellman 1957]. Bellman recognised that the cost-to-go function of a continuous control problem should satisfy a first-order partial differential equation obtained by applying the principle of optimality over an infinitesimal time step, and that this equation specialises the Hamilton-Jacobi equation of nineteenth-century analytical mechanics — a connection that gives the equation its compound name. The verification theorem, the sufficiency statement that a smooth solution certifies optimality, was the natural complement to the necessity supplied by Pontryagin's contemporaneous maximum principle [Pontryagin 1962].

For two decades the equation was treated formally, because the value function is generically not differentiable and no classical solution exists in the regimes where optimal trajectories cross. The resolution came in 1983 with the introduction of viscosity solutions by Michael Crandall and Pierre-Louis Lions, which gave a weak-solution concept under which the value function is the unique solution and the comparison principle holds [Crandall-Lions 1983]. Wendell Fleming and Halil Mete Soner's monograph and the parallel treatment by Martino Bardi and Italo Capuzzo-Dolcetta established the viscosity characterisation as the standard rigorous foundation, deterministic and stochastic, and connected it to the controlled-diffusion second-order HJB equation. Lions received the Fields Medal in 1994 in part for this work.

Bibliography Master

@book{Bellman1957DP,
  author    = {Bellman, Richard E.},
  title     = {Dynamic Programming},
  publisher = {Princeton University Press},
  address   = {Princeton, NJ},
  year      = {1957}
}

@book{FlemingSoner2006,
  author    = {Fleming, Wendell H. and Soner, Halil Mete},
  title     = {Controlled Markov Processes and Viscosity Solutions},
  edition   = {2nd},
  series    = {Stochastic Modelling and Applied Probability},
  volume    = {25},
  publisher = {Springer},
  address   = {New York},
  year      = {2006}
}

@book{Liberzon2012,
  author    = {Liberzon, Daniel},
  title     = {Calculus of Variations and Optimal Control Theory: A Concise Introduction},
  publisher = {Princeton University Press},
  address   = {Princeton, NJ},
  year      = {2012}
}

@book{BardiCapuzzoDolcetta1997,
  author    = {Bardi, Martino and Capuzzo-Dolcetta, Italo},
  title     = {Optimal Control and Viscosity Solutions of Hamilton-Jacobi-Bellman Equations},
  series    = {Systems \& Control: Foundations \& Applications},
  publisher = {Birkh\"auser},
  address   = {Boston},
  year      = {1997}
}

@book{Bertsekas2017DPv1,
  author    = {Bertsekas, Dimitri P.},
  title     = {Dynamic Programming and Optimal Control, Volume I},
  edition   = {4th},
  publisher = {Athena Scientific},
  address   = {Belmont, MA},
  year      = {2017}
}

@article{CrandallLions1983,
  author  = {Crandall, Michael G. and Lions, Pierre-Louis},
  title   = {Viscosity Solutions of Hamilton-Jacobi Equations},
  journal = {Transactions of the American Mathematical Society},
  volume  = {277},
  number  = {1},
  year    = {1983},
  pages   = {1--42}
}

@book{Pontryagin1962,
  author    = {Pontryagin, Lev S. and Boltyanskii, Vladimir G. and Gamkrelidze, Revaz V. and Mishchenko, Evgenii F.},
  title     = {The Mathematical Theory of Optimal Processes},
  publisher = {Interscience Publishers (Wiley)},
  address   = {New York},
  year      = {1962}
}

@book{YongZhou1999,
  author    = {Yong, Jiongmin and Zhou, Xun Yu},
  title     = {Stochastic Controls: Hamiltonian Systems and HJB Equations},
  publisher = {Springer},
  address   = {New York},
  year      = {1999}
}