Let's say I have a list of heights in order: (H1, H2...Hn). If I want to find the maximum height difference between two consecutive elements, how do I write that? If I want the sum of the differences, it's easy:

∑

_{i=1}

^{n-1}(H

_{i+1}- H

_{i})

(of course the "n-1" and "i=1") should be above and below each other.

I'm pretty sure I can't do this:

max

_{i=1}

^{n-1}(H

_{i+1}- H

_{i})

Relatedly, how would I write the set of height differences between consecutive heights?

Reason for asking: I've been asked to retrospectively write formal specifications for code that already exists. Fun times!