mathematical theory of optimal processes