Minima and maxima #
min #
min? #
Returns the smallest element of the array if it is not empty, or none if it is empty.
Examples:
Instances For
max #
max? #
Returns the largest element of the array if it is not empty, or none if it is empty.
Examples:
Instances For
theorem Array.min?_mem {α : Type u_1} {a : α} [Min α] [Std.MinEqOr α] (xs : Array α) (h : xs.min? = some a) :
theorem Array.foldl_min {α : Type u_1} [Min α] [Std.IdempotentOp min] [Std.Associative min] {xs : Array α} {a : α} :
theorem Array.max?_mem {α : Type u_1} {a : α} [Max α] [Std.MaxEqOr α] (xs : Array α) (h : xs.max? = some a) :
theorem Array.foldl_max {α : Type u_1} [Max α] [Std.IdempotentOp max] [Std.Associative max] {xs : Array α} {a : α} :
theorem Array.min_le_of_mem {α : Type u_1} [Min α] [LE α] [Std.IsLinearOrder α] [Std.LawfulOrderMin α] {xs : Array α} {a : α} (ha : a ∈ xs) :
theorem Array.le_max_of_mem {α : Type u_1} [Max α] [LE α] [Std.IsLinearOrder α] [Std.LawfulOrderMax α] {xs : Array α} {a : α} (ha : a ∈ xs) :