For the trivial example of:
>Set _x_ to the largest element in a multiset _A_ of numbers.
if this is re-formulated as:
>Set _x_ to the smallest number >= all elements of _A_.
the code becomes much simpler.
Time index 15:20 or so of:
(the entire video is worth watching though, but as an old (La)TeX guy, I have to say that).
William