I wonder if there is a rigorous/formal method to identify 'monotonicity' in code? Seems like it should be straightforward...