Optional minima of finite ordered sets #
The least-result contract includes absence: none means the eligible set is empty. It is
independent of any tree, storage representation or cost model.
Main definitions #
Cslib.OrderedSet.LeastResult: a complete optional-minimum contract.Cslib.OrderedSet.least: the mathematical minimum of a finite set.
Main results #
Cslib.OrderedSet.least_spec: the mathematical minimum satisfies the contract.Cslib.OrderedSet.LeastResult.eq_least: any satisfying result equals that minimum.Cslib.OrderedSet.least_eq_min:leastagrees withFinset.min.
References #
Uses Mathlib's finite-set minimum and linear-order API.
A complete optional-minimum contract: none means no eligible key exists.
Instances For
The mathematical minimum, independent of any representation.
Instances For
theorem Cslib.OrderedSet.least_spec {α : Type u_1} [LinearOrder α] (s : Finset α) :
LeastResult s (least s)
least s satisfies the optional-minimum contract for s.
theorem Cslib.OrderedSet.LeastResult.eq_least {α : Type u_1} [LinearOrder α] {s : Finset α} {a : Option α} (h : LeastResult s a) :
Every result satisfying the optional-minimum contract for s is least s.
@[simp]
least agrees with Finset.min (WithTop α is Option α).