Lattice operations on finsets #
sup #
Supremum of a finite set: sup {a, b, c} f = f a ⊔ f b ⊔ f c
Equations
- Finset.sup s f = Finset.fold (fun (x x_1 : α) => x ⊔ x_1) ⊥ f s
Instances For
Alias of the reverse direction of Finset.sup_le_iff
.
See also Finset.product_biUnion
.
Computing sup
in a subtype (closed under sup
) is the same as computing it in α
.
inf #
Infimum of a finite set: inf {a, b, c} f = f a ⊓ f b ⊓ f c
Equations
- Finset.inf s f = Finset.fold (fun (x x_1 : α) => x ⊓ x_1) ⊤ f s
Instances For
Alias of the reverse direction of Finset.le_inf_iff
.
Computing inf
in a subtype (closed under inf
) is the same as computing it in α
.
Given nonempty finset s
then s.sup' H f
is the supremum of its image under f
in (possibly
unbounded) join-semilattice α
, where H
is a proof of nonemptiness. If α
has a bottom element
you may instead use Finset.sup
which does not require s
nonempty.
Equations
- Finset.sup' s H f = WithBot.unbot (Finset.sup s (WithBot.some ∘ f)) ⋯
Instances For
Alias of the reverse direction of Finset.sup'_le_iff
.
See also Finset.sup'_prodMap
.
See also Finset.prodMk_sup'_sup'
.
To rewrite from right to left, use Finset.sup'_comp_eq_image
.
A version of Finset.sup'_image
with LHS and RHS reversed.
Also, this lemma assumes that s
is nonempty instead of assuming that its image is nonempty.
To rewrite from right to left, use Finset.sup'_comp_eq_map
.
A version of Finset.sup'_map
with LHS and RHS reversed.
Also, this lemma assumes that s
is nonempty instead of assuming that its image is nonempty.
A version of Finset.sup'_mono
acceptable for @[gcongr]
.
Instead of deducing s₂.Nonempty
from s₁.Nonempty
and s₁ ⊆ s₂
,
this version takes it as an argument.
Given nonempty finset s
then s.inf' H f
is the infimum of its image under f
in (possibly
unbounded) meet-semilattice α
, where H
is a proof of nonemptiness. If α
has a top element you
may instead use Finset.inf
which does not require s
nonempty.
Equations
- Finset.inf' s H f = WithTop.untop (Finset.inf s (WithTop.some ∘ f)) ⋯
Instances For
See also Finset.inf'_prodMap
.
See also Finset.prodMk_inf'_inf'
.
To rewrite from right to left, use Finset.inf'_comp_eq_image
.
A version of Finset.inf'_image
with LHS and RHS reversed.
Also, this lemma assumes that s
is nonempty instead of assuming that its image is nonempty.
To rewrite from right to left, use Finset.inf'_comp_eq_map
.
A version of Finset.inf'_map
with LHS and RHS reversed.
Also, this lemma assumes that s
is nonempty instead of assuming that its image is nonempty.
A version of Finset.inf'_mono
acceptable for @[gcongr]
.
Instead of deducing s₂.Nonempty
from s₁.Nonempty
and s₁ ⊆ s₂
,
this version takes it as an argument.
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
- Finset.max s = Finset.sup s 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
- Finset.min s = Finset.inf s WithTop.some
Instances For
Given a nonempty finset s
in a linear order α
, then s.min' h
is its minimum, as an
element of α
, where h
is a proof of nonemptiness. Without this assumption, use instead s.min
,
taking values in WithTop α
.
Equations
- Finset.min' s H = Finset.inf' s H id
Instances For
Given a nonempty finset s
in a linear order α
, then s.max' h
is its maximum, as an
element of α
, where h
is a proof of nonemptiness. Without this assumption, use instead s.max
,
taking values in WithBot α
.
Equations
- Finset.max' s H = Finset.sup' s H id
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 Finset
s in a linearly ordered type: a predicate is true on all
s : Finset α
provided that:
Induction principle for Finset
s in a linearly ordered type: a predicate is true on all
s : Finset α
provided that:
Induction principle for Finset
s 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 Finset
s 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:
Supremum of s i
, i : ι
, is equal to the supremum over t : Finset ι
of suprema
⨆ i ∈ t, s i
. This version assumes ι
is a Type*
. See iSup_eq_iSup_finset'
for a version
that works for ι : Sort*
.
Supremum of s i
, i : ι
, is equal to the supremum over t : Finset ι
of suprema
⨆ i ∈ t, s i
. This version works for ι : Sort*
. See iSup_eq_iSup_finset
for a version
that assumes ι : Type*
but has no PLift
s.
Infimum of s i
, i : ι
, is equal to the infimum over t : Finset ι
of infima
⨅ i ∈ t, s i
. This version assumes ι
is a Type*
. See iInf_eq_iInf_finset'
for a version
that works for ι : Sort*
.
Infimum of s i
, i : ι
, is equal to the infimum over t : Finset ι
of infima
⨅ i ∈ t, s i
. This version works for ι : Sort*
. See iInf_eq_iInf_finset
for a version
that assumes ι : Type*
but has no PLift
s.
Union of an indexed family of sets s : ι → Set α
is equal to the union of the unions
of finite subfamilies. This version assumes ι : Type*
. See also iUnion_eq_iUnion_finset'
for
a version that works for ι : Sort*
.
Union of an indexed family of sets s : ι → Set α
is equal to the union of the unions
of finite subfamilies. This version works for ι : Sort*
. See also iUnion_eq_iUnion_finset
for
a version that assumes ι : Type*
but avoids PLift
s in the right hand side.
Intersection of an indexed family of sets s : ι → Set α
is equal to the intersection of the
intersections of finite subfamilies. This version assumes ι : Type*
. See also
iInter_eq_iInter_finset'
for a version that works for ι : Sort*
.
Intersection of an indexed family of sets s : ι → Set α
is equal to the intersection of the
intersections of finite subfamilies. This version works for ι : Sort*
. See also
iInter_eq_iInter_finset
for a version that assumes ι : Type*
but avoids PLift
s in the right
hand side.