File: Mathlib/Data/Multiset/Powerset.lean

full_name: Multiset.powersetAux
code: /-- A helper function for the powerset of a multiset. Given a list `l`, returns a list
of sublists of `l` as multisets. -/
def powersetAux (l : List α) : List (Multiset α) 
goal: List (Multiset α)

full_name: Multiset.powersetAux_eq_map_coe
code: theorem powersetAux_eq_map_coe {l : List α} : powersetAux l = (sublists l).map (↑) 
goal: Multiset.powersetAux l = List.map Multiset.ofList l.sublists

full_name: Multiset.mem_powersetAux
code: @[simp]
theorem mem_powersetAux {l : List α} {s} : s ∈ powersetAux l ↔ s ≤ ↑l 
goal: s ∈ Multiset.powersetAux l ↔ s ≤ ↑l

full_name: Multiset.powersetAux'
code: /-- Helper function for the powerset of a multiset. Given a list `l`, returns a list
of sublists of `l` (using `sublists'`), as multisets. -/
def powersetAux' (l : List α) : List (Multiset α) 
goal: List (Multiset α)

full_name: Multiset.powersetAux_perm_powersetAux'
code: theorem powersetAux_perm_powersetAux' {l : List α} : powersetAux l ~ powersetAux' l 
goal: (Multiset.powersetAux l).Perm (Multiset.powersetAux' l)

full_name: Multiset.powersetAux'_nil
code: @[simp]
theorem powersetAux'_nil : powersetAux' (@nil α) = [0] 
goal: Multiset.powersetAux' [] = [0]

full_name: Multiset.powersetAux'_cons
code: @[simp]
theorem powersetAux'_cons (a : α) (l : List α) :
    powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l) 
goal: Multiset.powersetAux' (a :: l) = Multiset.powersetAux' l ++ List.map (Multiset.cons a) (Multiset.powersetAux' l)

full_name: Multiset.powerset_aux'_perm
code: theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂ 
goal: (Multiset.powersetAux' l₁).Perm (Multiset.powersetAux' l₂)

full_name: Multiset.powersetAux_perm
code: theorem powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux l₁ ~ powersetAux l₂ 
goal: (Multiset.powersetAux l₁).Perm (Multiset.powersetAux l₂)

full_name: Multiset.powerset
code: /-- The power set of a multiset. -/
def powerset (s : Multiset α) : Multiset (Multiset α) 
goal: Multiset (Multiset α)

full_name: Multiset.powerset_coe
code: theorem powerset_coe (l : List α) : @powerset α l = ((sublists l).map (↑) : List (Multiset α)) 
goal: (↑l).powerset = ↑(List.map Multiset.ofList l.sublists)

full_name: Multiset.powerset_coe'
code: @[simp]
theorem powerset_coe' (l : List α) : @powerset α l = ((sublists' l).map (↑) : List (Multiset α)) 
goal: (↑l).powerset = ↑(List.map Multiset.ofList l.sublists')

full_name: Multiset.powerset_zero
code: @[simp]
theorem powerset_zero : @powerset α 0 = {0} 
goal: Multiset.powerset 0 = {0}

full_name: Multiset.powerset_cons
code: @[simp]
theorem powerset_cons (a : α) (s) : powerset (a ::ₘ s) = powerset s + map (cons a) (powerset s) 
goal: (a ::ₘ s).powerset = s.powerset + Multiset.map (Multiset.cons a) s.powerset

full_name: Multiset.mem_powerset
code: @[simp]
theorem mem_powerset {s t : Multiset α} : s ∈ powerset t ↔ s ≤ t 
goal: s ∈ t.powerset ↔ s ≤ t

full_name: Multiset.map_single_le_powerset
code: theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset s 
goal: Multiset.map singleton s ≤ s.powerset

full_name: Multiset.card_powerset
code: @[simp]
theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s 
goal: Multiset.card s.powerset = 2 ^ Multiset.card s

full_name: Multiset.revzip_powersetAux
code: theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l 
goal: x.1 + x.2 = ↑l

full_name: Multiset.revzip_powersetAux'
code: theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) :
    x.1 + x.2 = ↑l 
goal: x.1 + x.2 = ↑l

full_name: Multiset.revzip_powersetAux_lemma
code: theorem revzip_powersetAux_lemma {α : Type*} [DecidableEq α] (l : List α) {l' : List (Multiset α)}
    (H : ∀ ⦃x : _ × _⦄, x ∈ revzip l' → x.1 + x.2 = ↑l) :
    revzip l' = l'.map fun x => (x, (l : Multiset α) - x) 
goal: l'.revzip = List.map (fun x => (x, ↑l - x)) l'

full_name: Multiset.revzip_powersetAux_perm_aux'
code: theorem revzip_powersetAux_perm_aux' {l : List α} :
    revzip (powersetAux l) ~ revzip (powersetAux' l) 
goal: (Multiset.powersetAux l).revzip.Perm (Multiset.powersetAux' l).revzip

full_name: Multiset.revzip_powersetAux_perm
code: theorem revzip_powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) :
    revzip (powersetAux l₁) ~ revzip (powersetAux l₂) 
goal: (Multiset.powersetAux l₁).revzip.Perm (Multiset.powersetAux l₂).revzip

full_name: Multiset.powersetCardAux
code: /-- Helper function for `powersetCard`. Given a list `l`, `powersetCardAux n l` is the list
of sublists of length `n`, as multisets. -/
def powersetCardAux (n : ℕ) (l : List α) : List (Multiset α) 
goal: List (Multiset α)

full_name: Multiset.powersetCardAux_eq_map_coe
code: theorem powersetCardAux_eq_map_coe {n} {l : List α} :
    powersetCardAux n l = (sublistsLen n l).map (↑) 
goal: Multiset.powersetCardAux n l = List.map Multiset.ofList (List.sublistsLen n l)

full_name: Multiset.mem_powersetCardAux
code: @[simp]
theorem mem_powersetCardAux {n} {l : List α} {s} : s ∈ powersetCardAux n l ↔ s ≤ ↑l ∧ card s = n 
goal: s ∈ Multiset.powersetCardAux n l ↔ s ≤ ↑l ∧ Multiset.card s = n

full_name: Multiset.powersetCardAux_zero
code: @[simp]
theorem powersetCardAux_zero (l : List α) : powersetCardAux 0 l = [0] 
goal: Multiset.powersetCardAux 0 l = [0]

full_name: Multiset.powersetCardAux_nil
code: @[simp]
theorem powersetCardAux_nil (n : ℕ) : powersetCardAux (n + 1) (@nil α) = [] 
goal: Multiset.powersetCardAux (n + 1) [] = []

full_name: Multiset.powersetCardAux_cons
code: @[simp]
theorem powersetCardAux_cons (n : ℕ) (a : α) (l : List α) :
    powersetCardAux (n + 1) (a :: l) =
      powersetCardAux (n + 1) l ++ List.map (cons a) (powersetCardAux n l) 
goal: Multiset.powersetCardAux (n + 1) (a :: l) =
  Multiset.powersetCardAux (n + 1) l ++ List.map (Multiset.cons a) (Multiset.powersetCardAux n l)

full_name: Multiset.powersetCardAux_perm
code: theorem powersetCardAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
    powersetCardAux n l₁ ~ powersetCardAux n l₂ 
goal: (Multiset.powersetCardAux n l₁).Perm (Multiset.powersetCardAux n l₂)

full_name: Multiset.powersetCard
code: /-- `powersetCard n s` is the multiset of all submultisets of `s` of length `n`. -/
def powersetCard (n : ℕ) (s : Multiset α) : Multiset (Multiset α) 
goal: Multiset (Multiset α)

full_name: Multiset.powersetCard_coe'
code: theorem powersetCard_coe' (n) (l : List α) : @powersetCard α n l = powersetCardAux n l 
goal: Multiset.powersetCard n ↑l = ↑(Multiset.powersetCardAux n l)

full_name: Multiset.powersetCard_coe
code: theorem powersetCard_coe (n) (l : List α) :
    @powersetCard α n l = ((sublistsLen n l).map (↑) : List (Multiset α)) 
goal: Multiset.powersetCard n ↑l = ↑(List.map Multiset.ofList (List.sublistsLen n l))

full_name: Multiset.powersetCard_zero_left
code: @[simp]
theorem powersetCard_zero_left (s : Multiset α) : powersetCard 0 s = {0} 
goal: Multiset.powersetCard 0 s = {0}

full_name: Multiset.powersetCard_zero_right
code: theorem powersetCard_zero_right (n : ℕ) : @powersetCard α (n + 1) 0 = 0 
goal: Multiset.powersetCard (n + 1) 0 = 0

full_name: Multiset.powersetCard_cons
code: @[simp]
theorem powersetCard_cons (n : ℕ) (a : α) (s) :
    powersetCard (n + 1) (a ::ₘ s) = powersetCard (n + 1) s + map (cons a) (powersetCard n s) 
goal: Multiset.powersetCard (n + 1) (a ::ₘ s) =
  Multiset.powersetCard (n + 1) s + Multiset.map (Multiset.cons a) (Multiset.powersetCard n s)

full_name: Multiset.powersetCard_one
code: theorem powersetCard_one (s : Multiset α) : powersetCard 1 s = s.map singleton 
goal: Multiset.powersetCard 1 s = Multiset.map singleton s

full_name: Multiset.mem_powersetCard
code: @[simp]
theorem mem_powersetCard {n : ℕ} {s t : Multiset α} : s ∈ powersetCard n t ↔ s ≤ t ∧ card s = n 
goal: s ∈ Multiset.powersetCard n t ↔ s ≤ t ∧ Multiset.card s = n

full_name: Multiset.card_powersetCard
code: @[simp]
theorem card_powersetCard (n : ℕ) (s : Multiset α) :
    card (powersetCard n s) = Nat.choose (card s) n 
goal: Multiset.card (Multiset.powersetCard n s) = (Multiset.card s).choose n

full_name: Multiset.powersetCard_le_powerset
code: theorem powersetCard_le_powerset (n : ℕ) (s : Multiset α) : powersetCard n s ≤ powerset s 
goal: Multiset.powersetCard n s ≤ s.powerset

full_name: Multiset.powersetCard_mono
code: theorem powersetCard_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
    powersetCard n s ≤ powersetCard n t 
goal: Multiset.powersetCard n s ≤ Multiset.powersetCard n t

full_name: Multiset.powersetCard_eq_empty
code: @[simp]
theorem powersetCard_eq_empty {α : Type*} (n : ℕ) {s : Multiset α} (h : card s < n) :
    powersetCard n s = 0 
goal: Multiset.powersetCard n s = 0

full_name: Multiset.powersetCard_card_add
code: @[simp]
theorem powersetCard_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
    s.powersetCard (card s + i) = 0 
goal: Multiset.powersetCard (Multiset.card s + i) s = 0

full_name: Multiset.powersetCard_map
code: theorem powersetCard_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
    powersetCard n (s.map f) = (powersetCard n s).map (map f) 
goal: Multiset.powersetCard n (Multiset.map f s) = Multiset.map (Multiset.map f) (Multiset.powersetCard n s)

full_name: Multiset.pairwise_disjoint_powersetCard
code: theorem pairwise_disjoint_powersetCard (s : Multiset α) :
    _root_.Pairwise fun i j => Multiset.Disjoint (s.powersetCard i) (s.powersetCard j) 
goal: Pairwise fun i j => (Multiset.powersetCard i s).Disjoint (Multiset.powersetCard j s)

full_name: Multiset.bind_powerset_len
code: theorem bind_powerset_len {α : Type*} (S : Multiset α) :
    (bind (Multiset.range (card S + 1)) fun k => S.powersetCard k) = S.powerset 
goal: ((Multiset.range (Multiset.card S + 1)).bind fun k => Multiset.powersetCard k S) = S.powerset

full_name: Multiset.nodup_powerset
code: @[simp]
theorem nodup_powerset {s : Multiset α} : Nodup (powerset s) ↔ Nodup s 
goal: s.powerset.Nodup ↔ s.Nodup

full_name: Multiset.Nodup.powersetCard
code: protected theorem Nodup.powersetCard {n : ℕ} {s : Multiset α} (h : Nodup s) :
    Nodup (powersetCard n s) 
goal: (Multiset.powersetCard n s).Nodup