Deakstadieđáhus: The mathematical theory of optimal processes