  In this paper we analyze the optimal value function $v$ associated to a
general parametric optimization problems via the theory of viscosity solutions.
The novelty is that we obtain regularity properties of $v$ by showing that it
is a viscosity solution to a set of first-order equations. As a consequence, in
Banach spaces, we provide sufficient conditions for local and global Lipschitz
properties of $v$. We also derive, in finite dimensions, conditions for
optimality through a comparison principle. Finally, we study the relationship
between viscosity and Clarke generalized solutions to get further
differentiability properties of $v$ in Euclidean spaces.
