Pathwise upcrossing inequality with correction term: unlike
MeasureTheory.mul_upcrossingsBefore_le, this requires no assumption a ≤ f N ω, at the price
of the extra term max (a - f N ω) 0.
Non-strict variant of MeasureTheory.upcrossingsBefore_lt_of_exists_upcrossing: since the
lower crossing hits Set.Iic a and the upper crossing hits Set.Ici b, it suffices that the
levels are reached (f N₁ ω ≤ a and b ≤ f N₂ ω) rather than strictly crossed. The Mathlib
proof already only uses the non-strict forms internally.
Alternations force upcrossings: if there are m pairs of (strictly increasing) times below
N at which f is alternately at most a and at least b, then f has at least
m upcrossings of [a, b] before N.
Converse of le_upcrossingsBefore_of_alternating: if f has at least m upcrossings of
[a, b] before N, then there is a strictly increasing sequence of 2 * m times below N at
which f is alternately at most a (at even positions) and at least b (at odd positions). The
times are the lower/upper crossing times.