Documentation

Mathlib.Data.Finset.Sum

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 #

def Finset.disjSum {α : Type u_1} {β : Type u_2} (s : Finset α) (t : Finset β) :
Finset (Sum α β)

Disjoint sum of finsets.

Equations
Instances For
    theorem Finset.val_disjSum {α : Type u_1} {β : Type u_2} (s : Finset α) (t : Finset β) :
    Eq (s.disjSum t).val (s.val.disjSum t.val)
    theorem Finset.card_disjSum {α : Type u_1} {β : Type u_2} (s : Finset α) (t : Finset β) :
    theorem Finset.mem_disjSum {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} {x : Sum α β} :
    Iff (Membership.mem (s.disjSum t) x) (Or (Exists fun (a : α) => And (Membership.mem s a) (Eq (Sum.inl a) x)) (Exists fun (b : β) => And (Membership.mem t b) (Eq (Sum.inr b) x)))
    theorem Finset.inl_mem_disjSum {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} {a : α} :
    theorem Finset.inr_mem_disjSum {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} {b : β} :
    theorem Finset.disjSum_mono {α : Type u_1} {β : Type u_2} {s₁ s₂ : Finset α} {t₁ t₂ : Finset β} (hs : HasSubset.Subset s₁ s₂) (ht : HasSubset.Subset t₁ t₂) :
    HasSubset.Subset (s₁.disjSum t₁) (s₂.disjSum t₂)
    theorem Finset.disjSum_mono_left {α : Type u_1} {β : Type u_2} (t : Finset β) :
    Monotone fun (s : Finset α) => s.disjSum t
    theorem Finset.disjSum_mono_right {α : Type u_1} {β : Type u_2} (s : Finset α) :
    theorem Finset.disjSum_ssubset_disjSum_of_ssubset_of_subset {α : Type u_1} {β : Type u_2} {s₁ s₂ : Finset α} {t₁ t₂ : Finset β} (hs : HasSSubset.SSubset s₁ s₂) (ht : HasSubset.Subset t₁ t₂) :
    HasSSubset.SSubset (s₁.disjSum t₁) (s₂.disjSum t₂)
    theorem Finset.disjSum_ssubset_disjSum_of_subset_of_ssubset {α : Type u_1} {β : Type u_2} {s₁ s₂ : Finset α} {t₁ t₂ : Finset β} (hs : HasSubset.Subset s₁ s₂) (ht : HasSSubset.SSubset t₁ t₂) :
    HasSSubset.SSubset (s₁.disjSum 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 α) :
    theorem Finset.disjSum_inj {α : Type u_4} {β : Type u_5} {s₁ s₂ : Finset α} {t₁ t₂ : Finset β} :
    Iff (Eq (s₁.disjSum t₁) (s₂.disjSum t₂)) (And (Eq s₁ s₂) (Eq t₁ t₂))
    def Finset.toLeft {α : Type u_1} {β : Type u_2} (u : Finset (Sum α β)) :

    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.

    Equations
    Instances For
      def Finset.toRight {α : Type u_1} {β : Type u_2} (u : Finset (Sum α β)) :

      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.

      Equations
      Instances For
        theorem Finset.mem_toLeft {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {a : α} :
        theorem Finset.mem_toRight {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {b : β} :
        theorem Finset.toLeft_subset_toLeft {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} :
        theorem Finset.toRight_subset_toRight {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} :
        theorem Finset.toLeft_monotone {α : Type u_1} {β : Type u_2} :
        theorem Finset.toRight_monotone {α : Type u_1} {β : Type u_2} :
        theorem Finset.toLeft_disjSum_toRight {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} :
        theorem Finset.card_toLeft_add_card_toRight {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} :
        theorem Finset.card_toLeft_le {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} :
        theorem Finset.card_toRight_le {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} :
        theorem Finset.toLeft_disjSum {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} :
        Eq (s.disjSum t).toLeft s
        theorem Finset.toRight_disjSum {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} :
        theorem Finset.disjSum_eq_iff {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} {u : Finset (Sum α β)} :
        Iff (Eq (s.disjSum t) u) (And (Eq s u.toLeft) (Eq t u.toRight))
        theorem Finset.eq_disjSum_iff {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} {u : Finset (Sum α β)} :
        Iff (Eq u (s.disjSum t)) (And (Eq u.toLeft s) (Eq u.toRight t))
        theorem Finset.disjSum_subset {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} {u : Finset (Sum α β)} :
        theorem Finset.subset_disjSum {α : Type u_1} {β : Type u_2} {s : Finset α} {t : Finset β} {u : Finset (Sum α β)} :
        theorem Finset.toLeft_map_sumComm {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} :
        theorem Finset.toRight_map_sumComm {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} :
        theorem Finset.toLeft_cons_inl {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {a : α} (ha : Not (Membership.mem u (Sum.inl a))) :
        Eq (cons (Sum.inl a) u ha).toLeft (cons a u.toLeft )
        theorem Finset.toLeft_cons_inr {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {b : β} (hb : Not (Membership.mem u (Sum.inr b))) :
        Eq (cons (Sum.inr b) u hb).toLeft u.toLeft
        theorem Finset.toRight_cons_inl {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {a : α} (ha : Not (Membership.mem u (Sum.inl a))) :
        theorem Finset.toRight_cons_inr {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {b : β} (hb : Not (Membership.mem u (Sum.inr b))) :
        Eq (cons (Sum.inr b) u hb).toRight (cons b u.toRight )
        theorem Finset.toLeft_image_swap {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toRight_image_swap {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toLeft_insert_inl {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {a : α} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toLeft_insert_inr {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {b : β} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toRight_insert_inl {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {a : α} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toRight_insert_inr {α : Type u_1} {β : Type u_2} {u : Finset (Sum α β)} {b : β} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toLeft_inter {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toRight_inter {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toLeft_union {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toRight_union {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toLeft_sdiff {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        theorem Finset.toRight_sdiff {α : Type u_1} {β : Type u_2} {u v : Finset (Sum α β)} [DecidableEq α] [DecidableEq β] :
        def Finset.sumEquiv {α : Type u_4} {β : Type u_5} :
        OrderIso (Finset (Sum α β)) (Prod (Finset α) (Finset β))

        Finsets on sum types are equivalent to pairs of finsets on each summand.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Finset.sumEquiv_apply_snd {α : Type u_4} {β : Type u_5} (s : Finset (Sum α β)) :
          theorem Finset.sumEquiv_apply_fst {α : Type u_4} {β : Type u_5} (s : Finset (Sum α β)) :
          theorem Finset.sumEquiv_symm_apply {α : Type u_4} {β : Type u_5} (s : Prod (Finset α) (Finset β)) :
          theorem Finset.map_disjSum {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Finset α} {t : Finset β} (f : Function.Embedding (Sum α β) γ) :
          theorem Finset.fold_disjSum {α : Type u_1} {β : Type u_2} {γ : Type u_3} (s : Finset α) (t : Finset β) (f : Sum α βγ) (b₁ b₂ : γ) (op : γγγ) [Std.Commutative op] [Std.Associative op] :
          Eq (fold op (op b₁ b₂) f (s.disjSum t)) (op (fold op b₁ (fun (x : α) => f (Sum.inl x)) s) (fold op b₂ (fun (x : β) => f (Sum.inr x)) t))