Disjoint sum of finsets #
This file defines the disjoint sum of two finsets as Finset (α ⊕ β)
. Beware not to confuse with
the Finset.sum
operation which computes the additive sum.
Main declarations #
Finset.disjSum
:s.disjSum t
is the disjoint sum ofs
andt
.Finset.toLeft
: Given a finset of elementsα ⊕ β
, extracts all the elements of the formα
.Finset.toRight
: Given a finset of elementsα ⊕ β
, extracts all the elements of the formβ
.
@[simp]
theorem
Finset.empty_disjSum
{α : Type u_1}
{β : Type u_2}
(t : Finset β)
:
∅.disjSum t = Finset.map Function.Embedding.inr t
@[simp]
theorem
Finset.disjSum_empty
{α : Type u_1}
{β : Type u_2}
(s : Finset α)
:
s.disjSum ∅ = Finset.map Function.Embedding.inl s
theorem
Finset.disjoint_map_inl_map_inr
{α : Type u_1}
{β : Type u_2}
(s : Finset α)
(t : Finset β)
:
Disjoint (Finset.map Function.Embedding.inl s) (Finset.map Function.Embedding.inr t)
@[simp]
theorem
Finset.map_inl_disjUnion_map_inr
{α : Type u_1}
{β : Type u_2}
(s : Finset α)
(t : Finset β)
:
(Finset.map Function.Embedding.inl s).disjUnion (Finset.map Function.Embedding.inr t) ⋯ = s.disjSum t
theorem
Finset.disjSum_strictMono_left
{α : Type u_1}
{β : Type u_2}
(t : Finset β)
:
StrictMono fun (s : Finset α) => s.disjSum t
theorem
Finset.disj_sum_strictMono_right
{α : Type u_1}
{β : Type u_2}
(s : Finset α)
:
StrictMono s.disjSum
Given a finset of elements α ⊕ β
, extract all the elements of the form α
. This
forms a quasi-inverse to disjSum
, in that it recovers its left input.
See also List.partitionMap
.
Instances For
Given a finset of elements α ⊕ β
, extract all the elements of the form β
. This
forms a quasi-inverse to disjSum
, in that it recovers its right input.
See also List.partitionMap
.
Instances For
@[simp]
theorem
Finset.toLeft_map_sumComm
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
:
(Finset.map (Equiv.sumComm α β).toEmbedding u).toLeft = u.toRight
@[simp]
theorem
Finset.toRight_map_sumComm
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
:
(Finset.map (Equiv.sumComm α β).toEmbedding u).toRight = u.toLeft
@[simp]
theorem
Finset.toLeft_cons_inl
{α : Type u_1}
{β : Type u_2}
{a : α}
{u : Finset (α ⊕ β)}
(ha : Sum.inl a ∉ u)
:
(Finset.cons (Sum.inl a) u ha).toLeft = Finset.cons a u.toLeft ⋯
@[simp]
theorem
Finset.toLeft_cons_inr
{α : Type u_1}
{β : Type u_2}
{b : β}
{u : Finset (α ⊕ β)}
(hb : Sum.inr b ∉ u)
:
(Finset.cons (Sum.inr b) u hb).toLeft = u.toLeft
@[simp]
theorem
Finset.toRight_cons_inl
{α : Type u_1}
{β : Type u_2}
{a : α}
{u : Finset (α ⊕ β)}
(ha : Sum.inl a ∉ u)
:
(Finset.cons (Sum.inl a) u ha).toRight = u.toRight
@[simp]
theorem
Finset.toRight_cons_inr
{α : Type u_1}
{β : Type u_2}
{b : β}
{u : Finset (α ⊕ β)}
(hb : Sum.inr b ∉ u)
:
(Finset.cons (Sum.inr b) u hb).toRight = Finset.cons b u.toRight ⋯
theorem
Finset.toLeft_image_swap
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
(Finset.image Sum.swap u).toLeft = u.toRight
theorem
Finset.toRight_image_swap
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
(Finset.image Sum.swap u).toRight = u.toLeft
@[simp]
theorem
Finset.toLeft_insert_inl
{α : Type u_1}
{β : Type u_2}
{a : α}
{u : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
@[simp]
theorem
Finset.toLeft_insert_inr
{α : Type u_1}
{β : Type u_2}
{b : β}
{u : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
@[simp]
theorem
Finset.toRight_insert_inl
{α : Type u_1}
{β : Type u_2}
{a : α}
{u : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
@[simp]
theorem
Finset.toRight_insert_inr
{α : Type u_1}
{β : Type u_2}
{b : β}
{u : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
theorem
Finset.toLeft_inter
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
{v : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
theorem
Finset.toRight_inter
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
{v : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
theorem
Finset.toLeft_union
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
{v : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
theorem
Finset.toRight_union
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
{v : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
theorem
Finset.toLeft_sdiff
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
{v : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
:
theorem
Finset.toRight_sdiff
{α : Type u_1}
{β : Type u_2}
{u : Finset (α ⊕ β)}
{v : Finset (α ⊕ β)}
[DecidableEq α]
[DecidableEq β]
: