File: Mathlib/Data/Multiset/FinsetOps.lean

full_name: Multiset.ndinsert
code: /-- `ndinsert a s` is the lift of the list `insert` operation. This operation
  does not respect multiplicities, unlike `cons`, but it is suitable as
  an insert operation on `Finset`. -/
def ndinsert (a : α) (s : Multiset α) : Multiset α 
goal: Multiset α

full_name: Multiset.coe_ndinsert
code: @[simp]
theorem coe_ndinsert (a : α) (l : List α) : ndinsert a l = (insert a l : List α) 
goal: Multiset.ndinsert a ↑l = ↑(insert a l)

full_name: Multiset.ndinsert_zero
code: @[simp]
theorem ndinsert_zero (a : α) : ndinsert a 0 = {a} 
goal: Multiset.ndinsert a 0 = {a}

full_name: Multiset.ndinsert_of_mem
code: @[simp]
theorem ndinsert_of_mem {a : α} {s : Multiset α} : a ∈ s → ndinsert a s = s 
goal: a ∈ s → Multiset.ndinsert a s = s

full_name: Multiset.ndinsert_of_not_mem
code: @[simp]
theorem ndinsert_of_not_mem {a : α} {s : Multiset α} : a ∉ s → ndinsert a s = a ::ₘ s 
goal: a ∉ s → Multiset.ndinsert a s = a ::ₘ s

full_name: Multiset.mem_ndinsert
code: @[simp]
theorem mem_ndinsert {a b : α} {s : Multiset α} : a ∈ ndinsert b s ↔ a = b ∨ a ∈ s 
goal: a ∈ Multiset.ndinsert b s ↔ a = b ∨ a ∈ s

full_name: Multiset.le_ndinsert_self
code: @[simp]
theorem le_ndinsert_self (a : α) (s : Multiset α) : s ≤ ndinsert a s 
goal: s ≤ Multiset.ndinsert a s

full_name: Multiset.mem_ndinsert_self
code: theorem mem_ndinsert_self (a : α) (s : Multiset α) : a ∈ ndinsert a s 
goal: a ∈ Multiset.ndinsert a s

full_name: Multiset.mem_ndinsert_of_mem
code: theorem mem_ndinsert_of_mem {a b : α} {s : Multiset α} (h : a ∈ s) : a ∈ ndinsert b s 
goal: a ∈ Multiset.ndinsert b s

full_name: Multiset.length_ndinsert_of_mem
code: @[simp]
theorem length_ndinsert_of_mem {a : α} {s : Multiset α} (h : a ∈ s) :
    card (ndinsert a s) = card s 
goal: Multiset.card (Multiset.ndinsert a s) = Multiset.card s

full_name: Multiset.length_ndinsert_of_not_mem
code: @[simp]
theorem length_ndinsert_of_not_mem {a : α} {s : Multiset α} (h : a ∉ s) :
    card (ndinsert a s) = card s + 1 
goal: Multiset.card (Multiset.ndinsert a s) = Multiset.card s + 1

full_name: Multiset.dedup_cons
code: theorem dedup_cons {a : α} {s : Multiset α} : dedup (a ::ₘ s) = ndinsert a (dedup s) 
goal: (a ::ₘ s).dedup = Multiset.ndinsert a s.dedup

full_name: Multiset.Nodup.ndinsert
code: theorem Nodup.ndinsert (a : α) : Nodup s → Nodup (ndinsert a s) 
goal: s.Nodup → (Multiset.ndinsert a s).Nodup

full_name: Multiset.ndinsert_le
code: theorem ndinsert_le {a : α} {s t : Multiset α} : ndinsert a s ≤ t ↔ s ≤ t ∧ a ∈ t 
goal: Multiset.ndinsert a s ≤ t ↔ s ≤ t ∧ a ∈ t

full_name: Multiset.attach_ndinsert
code: theorem attach_ndinsert (a : α) (s : Multiset α) :
    (s.ndinsert a).attach =
      ndinsert ⟨a, mem_ndinsert_self a s⟩ (s.attach.map fun p => ⟨p.1, mem_ndinsert_of_mem p.2⟩) 
goal: (Multiset.ndinsert a s).attach = Multiset.ndinsert ⟨a, ⋯⟩ (Multiset.map (fun p => ⟨↑p, ⋯⟩) s.attach)

full_name: Multiset.disjoint_ndinsert_left
code: @[simp]
theorem disjoint_ndinsert_left {a : α} {s t : Multiset α} :
    Disjoint (ndinsert a s) t ↔ a ∉ t ∧ Disjoint s t 
goal: (Multiset.ndinsert a s).Disjoint t ↔ a ∉ t ∧ s.Disjoint t

full_name: Multiset.disjoint_ndinsert_right
code: @[simp]
theorem disjoint_ndinsert_right {a : α} {s t : Multiset α} :
    Disjoint s (ndinsert a t) ↔ a ∉ s ∧ Disjoint s t 
goal: s.Disjoint (Multiset.ndinsert a t) ↔ a ∉ s ∧ s.Disjoint t

full_name: Multiset.ndunion
code: /-- `ndunion s t` is the lift of the list `union` operation. This operation
  does not respect multiplicities, unlike `s ∪ t`, but it is suitable as
  a union operation on `Finset`. (`s ∪ t` would also work as a union operation
  on finset, but this is more efficient.) -/
def ndunion (s t : Multiset α) : Multiset α 
goal: Multiset α

full_name: Multiset.coe_ndunion
code: @[simp]
theorem coe_ndunion (l₁ l₂ : List α) : @ndunion α _ l₁ l₂ = (l₁ ∪ l₂ : List α) 
goal: (↑l₁).ndunion ↑l₂ = ↑(l₁ ∪ l₂)

full_name: Multiset.zero_ndunion
code: theorem zero_ndunion (s : Multiset α) : ndunion 0 s = s 
goal: Multiset.ndunion 0 s = s

full_name: Multiset.cons_ndunion
code: @[simp]
theorem cons_ndunion (s t : Multiset α) (a : α) : ndunion (a ::ₘ s) t = ndinsert a (ndunion s t) 
goal: (a ::ₘ s).ndunion t = Multiset.ndinsert a (s.ndunion t)

full_name: Multiset.mem_ndunion
code: @[simp]
theorem mem_ndunion {s t : Multiset α} {a : α} : a ∈ ndunion s t ↔ a ∈ s ∨ a ∈ t 
goal: a ∈ s.ndunion t ↔ a ∈ s ∨ a ∈ t

full_name: Multiset.le_ndunion_right
code: theorem le_ndunion_right (s t : Multiset α) : t ≤ ndunion s t 
goal: t ≤ s.ndunion t

full_name: Multiset.subset_ndunion_right
code: theorem subset_ndunion_right (s t : Multiset α) : t ⊆ ndunion s t 
goal: t ⊆ s.ndunion t

full_name: Multiset.ndunion_le_add
code: theorem ndunion_le_add (s t : Multiset α) : ndunion s t ≤ s + t 
goal: s.ndunion t ≤ s + t

full_name: Multiset.ndunion_le
code: theorem ndunion_le {s t u : Multiset α} : ndunion s t ≤ u ↔ s ⊆ u ∧ t ≤ u 
goal: s.ndunion t ≤ u ↔ s ⊆ u ∧ t ≤ u

full_name: Multiset.subset_ndunion_left
code: theorem subset_ndunion_left (s t : Multiset α) : s ⊆ ndunion s t 
goal: s ⊆ s.ndunion t

full_name: Multiset.le_ndunion_left
code: theorem le_ndunion_left {s} (t : Multiset α) (d : Nodup s) : s ≤ ndunion s t 
goal: s ≤ s.ndunion t

full_name: Multiset.ndunion_le_union
code: theorem ndunion_le_union (s t : Multiset α) : ndunion s t ≤ s ∪ t 
goal: s.ndunion t ≤ s ∪ t

full_name: Multiset.Nodup.ndunion
code: theorem Nodup.ndunion (s : Multiset α) {t : Multiset α} : Nodup t → Nodup (ndunion s t) 
goal: t.Nodup → (s.ndunion t).Nodup

full_name: Multiset.ndunion_eq_union
code: @[simp]
theorem ndunion_eq_union {s t : Multiset α} (d : Nodup s) : ndunion s t = s ∪ t 
goal: s.ndunion t = s ∪ t

full_name: Multiset.dedup_add
code: theorem dedup_add (s t : Multiset α) : dedup (s + t) = ndunion s (dedup t) 
goal: (s + t).dedup = s.ndunion t.dedup

full_name: Multiset.Disjoint.ndunion_eq
code: theorem Disjoint.ndunion_eq {s t : Multiset α} (h : Disjoint s t) :
    s.ndunion t = s.dedup + t 
goal: s.ndunion t = s.dedup + t

full_name: Multiset.Subset.ndunion_eq_right
code: theorem Subset.ndunion_eq_right {s t : Multiset α} (h : s ⊆ t) : s.ndunion t = t 
goal: s.ndunion t = t

full_name: Multiset.ndinter
code: /-- `ndinter s t` is the lift of the list `∩` operation. This operation
  does not respect multiplicities, unlike `s ∩ t`, but it is suitable as
  an intersection operation on `Finset`. (`s ∩ t` would also work as a union operation
  on finset, but this is more efficient.) -/
def ndinter (s t : Multiset α) : Multiset α 
goal: Multiset α

full_name: Multiset.coe_ndinter
code: @[simp]
theorem coe_ndinter (l₁ l₂ : List α) : @ndinter α _ l₁ l₂ = (l₁ ∩ l₂ : List α) 
goal: (↑l₁).ndinter ↑l₂ = ↑(l₁ ∩ l₂)

full_name: Multiset.zero_ndinter
code: @[simp]
theorem zero_ndinter (s : Multiset α) : ndinter 0 s = 0 
goal: Multiset.ndinter 0 s = 0

full_name: Multiset.cons_ndinter_of_mem
code: @[simp]
theorem cons_ndinter_of_mem {a : α} (s : Multiset α) {t : Multiset α} (h : a ∈ t) :
    ndinter (a ::ₘ s) t = a ::ₘ ndinter s t 
goal: (a ::ₘ s).ndinter t = a ::ₘ s.ndinter t

full_name: Multiset.ndinter_cons_of_not_mem
code: @[simp]
theorem ndinter_cons_of_not_mem {a : α} (s : Multiset α) {t : Multiset α} (h : a ∉ t) :
    ndinter (a ::ₘ s) t = ndinter s t 
goal: (a ::ₘ s).ndinter t = s.ndinter t

full_name: Multiset.mem_ndinter
code: @[simp]
theorem mem_ndinter {s t : Multiset α} {a : α} : a ∈ ndinter s t ↔ a ∈ s ∧ a ∈ t 
goal: a ∈ s.ndinter t ↔ a ∈ s ∧ a ∈ t

full_name: Multiset.Nodup.ndinter
code: @[simp]
theorem Nodup.ndinter {s : Multiset α} (t : Multiset α) : Nodup s → Nodup (ndinter s t) 
goal: s.Nodup → (s.ndinter t).Nodup

full_name: Multiset.le_ndinter
code: theorem le_ndinter {s t u : Multiset α} : s ≤ ndinter t u ↔ s ≤ t ∧ s ⊆ u 
goal: s ≤ t.ndinter u ↔ s ≤ t ∧ s ⊆ u

full_name: Multiset.ndinter_le_left
code: theorem ndinter_le_left (s t : Multiset α) : ndinter s t ≤ s 
goal: s.ndinter t ≤ s

full_name: Multiset.ndinter_subset_left
code: theorem ndinter_subset_left (s t : Multiset α) : ndinter s t ⊆ s 
goal: s.ndinter t ⊆ s

full_name: Multiset.ndinter_subset_right
code: theorem ndinter_subset_right (s t : Multiset α) : ndinter s t ⊆ t 
goal: s.ndinter t ⊆ t

full_name: Multiset.ndinter_le_right
code: theorem ndinter_le_right {s} (t : Multiset α) (d : Nodup s) : ndinter s t ≤ t 
goal: s.ndinter t ≤ t

full_name: Multiset.inter_le_ndinter
code: theorem inter_le_ndinter (s t : Multiset α) : s ∩ t ≤ ndinter s t 
goal: s ∩ t ≤ s.ndinter t

full_name: Multiset.ndinter_eq_inter
code: @[simp]
theorem ndinter_eq_inter {s t : Multiset α} (d : Nodup s) : ndinter s t = s ∩ t 
goal: s.ndinter t = s ∩ t

full_name: Multiset.ndinter_eq_zero_iff_disjoint
code: theorem ndinter_eq_zero_iff_disjoint {s t : Multiset α} : ndinter s t = 0 ↔ Disjoint s t 
goal: s.ndinter t = 0 ↔ s.Disjoint t

full_name: Multiset.Subset.ndinter_eq_left
code: theorem Subset.ndinter_eq_left {s t : Multiset α} (h : s ⊆ t) : s.ndinter t = s 
goal: s.ndinter t = s