Let us go back to the formula (4.23), which says that the infinitesimal perturbation of the terminal point caused by a needle perturbation of the optimal control with parameters , , is described by the vector . This vector was subsequently labeled as , and by construction belongs to the terminal cone . Applying the inequality (4.29) which encodes the separating hyperplane property, and noting that and are both positive, we have
Next, since is the transition matrix for the variational equation (4.19), we know that is the value at time of the solution of the variational equation passing through at time . Invoking the adjoint property (4.32), we obtain
We can thus expand (4.34) as follows:
Recalling the expression (4.8) for the Hamiltonian, we see that this is equivalent to
In the above derivation, was an arbitrary element of the control set and was an arbitrary time in the interval at which the optimal control is continuous. Thus we have established that the Hamiltonian maximization condition holds everywhere except possibly a finite number of time instants (discontinuities of ). Additionally, recall that is piecewise continuous and we adopted the convention (see page ) that the value of a piecewise continuous function at each discontinuity is equal to the limit either from the left or from the right. Letting in (4.35) approach a discontinuity of or an endpoint of from an appropriate side, and using continuity of and in time and continuity of in all variables, we see that the Hamiltonian maximization condition must actually hold everywhere.
This conclusion can be understood intuitively as follows. The Hamiltonian is the inner product of the augmented adjoint vector with the right-hand side of the augmented control system (the velocity of ). When the optimal control is perturbed, the state trajectory deviates from the optimal one in a direction that makes a nonpositive inner product with the augmented adjoint vector (at the time when the perturbation stops acting). Therefore, such control perturbations can only decrease the Hamiltonian, regardless of the value of the perturbed control during the perturbation interval.