Viscosity solutions and comparison
Use smooth touching functions at nonsmooth values and state a precise comparison regime.
On this page
The question for today
What you’ll understand
- Apply the correct upper-test and lower-test inequalities for a proper HJB operator.
- State data, growth, and boundary conditions needed for a comparison principle.
- Check a nonsmooth exit-time value and reject an incorrect solution with the same boundary data.
A control value can be continuous and useful even where its classical derivatives do not exist. Viscosity solutions test the equation through smooth functions touching the value from above or below. This preserves the direction of the dynamic-programming inequalities at corners. Comparison then provides uniqueness within a specified function class and boundary problem. Neither the word viscosity nor continuity alone gives uniqueness for arbitrary nonlinear equations, coefficients, or growth at infinity.
Choose an operator with a fixed sign convention
For the minimizing diffusion equation, use the proper backward operator F equal to minus the time derivative minus the infimum of generator-plus-running-cost terms. It is nonincreasing in the Hessian argument, the degenerate-ellipticity convention. A continuous function is a viscosity subsolution when every smooth test function touching it from above gives at contact. Touching from below gives for a supersolution. A solution satisfies both conditions.
The test function agrees in value at the touching point but need not equal the candidate nearby. At a classical differentiability point, first derivatives match and the Hessian ordering is compatible with degenerate ellipticity, recovering the classical equation. At a corner, an upper or lower test may not exist; that half of the definition can then be vacuous. This feature is intentional and must be examined rather than replacing missing derivatives by an arbitrary average slope.
Comparison needs a structural and boundary regime
A standard sufficient finite-horizon regime on the whole Euclidean space has compact metric actions, bounded uniformly continuous coefficients and running data, coefficients uniformly Lipschitz in the state, and bounded uniformly continuous terminal cost. In the bounded uniformly continuous solution class, the corresponding HJB comparison principle orders subsolutions and supersolutions with ordered terminal data. The diffusion may be degenerate. The argument uses the operator's structure and a doubling-of-variables estimate, not an unsupported assumption that diffusion automatically smooths everything.
Under a valid dynamic programming principle, the control value is the viscosity solution in this regime, and comparison identifies it uniquely. On a bounded spatial domain, an appropriate boundary condition must also be specified; exit, reflection, and state constraints give different problems. For unbounded costs or candidate functions, one needs compatible growth classes and barriers or localization estimates. A uniqueness statement from the bounded class cannot simply be transferred to all polynomial or exponential growth without additional analysis.
A corner can encode an optimal exit direction
Consider the separate deterministic exit problem on the interval from minus one to one: motion has speed at most one and incurs unit running cost until exit, with zero boundary payoff. Its minimum exit time is the distance to the nearer endpoint. The stationary Bellman equation is the eikonal equation with gradient magnitude one. At the center, either exit direction is optimal, creating a downward corner in the value rather than a classical derivative.
The same boundary values are shared by the negative distance function, but that function fails the supersolution test at its upward corner. A constant lower test there has zero slope and violates the required inequality. Thus boundary matching and solving the equation away from a singular point do not suffice. Checking the touching inequalities at the corner separates the actual control value from the spurious candidate without claiming the two functions have classical derivatives there.
Work it through
Verify one corner and reject the opposite corner
For on , verify the viscosity inequalities at zero for . Then test the competing function with the same boundary values.
Away from zero, V has slope one or minus one, so the equation holds classically. At zero, an upper touching smooth function can have slope p only between minus one and one, from the inequalities on its right and left difference quotients.
For every such upper slope, , so the subsolution condition holds. A lower touching differentiable function would need slope at most minus one from the right and at least one from the left, which is impossible. Hence the supersolution test at zero is vacuous.
For the competing upward corner, the constant function minus one touches from below at zero. Its slope is zero, giving , contrary to the supersolution requirement. This candidate is rejected even though its boundary values and its classical equation away from zero match.
The nonnegative distance function passes both viscosity tests. The negative distance function fails the lower-test inequality at its central corner.
The living notebook
Explore the model
Interactive lab · function
Check a local classical residual before using corner tests
Pause and Reset, then set coefficient a to 0.5 and position x to 1. The plotted quadratic has slope 1, so the local eikonal residual |slope|−1 is zero there. For a fresh comparison, Pause and Reset, then set a to 0.5 and x to 0.5; the slope is 0.5 and the residual is −0.5. A residual at one point does not prove a global solution. The instrument draws a smooth quadratic, not the kinked distance function or a viscosity solver. Editing controls retains time, so reset and set both for each comparison.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forClassical residual checks apply at smooth points; viscosity tests supply the additional logic at corners.
Pause & reason
Check your understanding
Your turn
Try it yourself
At state in the unit-speed exit problem, compute the value, an optimal action until exit, and the exit duration. Would solve the same eikonal boundary problem? Give a smooth-point residual that decides.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The value is the nearer boundary distance. For the proposed quadratic, evaluate its derivative at a point where it is smooth, such as zero.
Compare with the solution
The nearer endpoint is one, at distance . Choosing speed plus one until exit attains that cost and duration. The quadratic has the same zero boundary values but derivative zero at zero, so its eikonal residual is . As a smooth function it would need equality there to be a viscosity solution, and therefore it fails. Boundary agreement does not repair its interior equation.
Keep the idea
Take it with you
- A fixed operator sign determines which inequalities belong to upper and lower touching tests.
- Comparison requires structural assumptions, terminal or boundary data, and a declared growth class.
- A corner can satisfy the viscosity equation even when one type of smooth test does not exist.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.