Maximum and minimum of finite sets #
max and min of finite sets #
Let s be a finset in a linear order. Then s.max is the maximum of s if s is not empty,
and ⊥ otherwise. It belongs to WithBot α. If you want to get an element of α, see
s.max'.
Equations
- s.max = s.sup WithBot.some
Instances For
Let s be a finset in a linear order. Then s.min is the minimum of s if s is not empty,
and ⊤ otherwise. It belongs to WithTop α. If you want to get an element of α, see
s.min'.
Equations
- s.min = s.inf WithTop.some
Instances For
{a}.min' _ is a.
{a}.max' _ is a.
If there's more than 1 element, the min' is less than the max'. An alternate version of
min'_lt_max' which is sometimes more convenient.
To rewrite from right to left, use Monotone.map_finset_max'.
A version of Finset.max'_image with LHS and RHS reversed.
Also, this version assumes that s is nonempty, not its image.
To rewrite from right to left, use Monotone.map_finset_min'.
A version of Finset.min'_image with LHS and RHS reversed.
Also, this version assumes that s is nonempty, not its image.
If finsets s and t are interleaved, then Finset.card s ≤ Finset.card t + 1.
If finsets s and t are interleaved, then Finset.card s ≤ Finset.card (t \ s) + 1.
Induction principle for Finsets in a linearly ordered type: a predicate is true on all
s : Finset α provided that:
Induction principle for Finsets in a linearly ordered type: a predicate is true on all
s : Finset α provided that:
Induction principle for Finsets in any type from which a given function f maps to a linearly
ordered type : a predicate is true on all s : Finset α provided that:
Induction principle for Finsets in any type from which a given function f maps to a linearly
ordered type : a predicate is true on all s : Finset α provided that: