The first minimizer of a nonempty list #
Mathlib's List.argmin f l is none exactly on the empty list. Algorithms that select a
cheapest candidate usually need the positive form, and often read the choice off with a
default through Option.getD. This file provides those forms.
Main results #
List.exists_argmin_eq_some: a nonempty list has a first minimizer.List.getD_argmin_mem: on a nonempty list, the minimizer read with any default is a member.List.getD_argmin_le: the minimizer read with any default is at most every member.
theorem List.getD_argmin_le {α : Type u_1} {β : Type u_2} [LinearOrder β] {f : α → β} {l : List α} {x : α} (hx : x ∈ l) (d : α) :
The first minimizer read with any default is at most every member of the list.
theorem List.argmin_map_equiv {α : Type u_3} {γ : Type u_4} {δ : Type u_5} [LinearOrder δ] (e : α → γ) (l : List α) (f : γ → δ) :