Bounds for list maximum folds #
Main results #
List.le_foldl_max_self: foldingmaxnever decreases the initial accumulator.List.mem_le_foldl_max: every element oflis bounded above byl.foldl max a.List.foldl_max_le:l.foldl max a ≤ bwhenevera ≤ band every element oflis≤ b.List.foldr_map_max_le_iff: a zero-seeded maximum of mapped natural numbers is at most a bound exactly when every mapped value is at most that bound.
Folding max across l never decreases the initial accumulator a.
Every element of l is bounded above by l.foldl max a.
theorem List.foldl_max_le {α : Type u_1} [LinearOrder α] {l : List α} {a b : α} (ha : a ≤ b) (hl : ∀ x ∈ l, x ≤ b) :
l.foldl max a ≤ b whenever a ≤ b and every element of l is at most b.