The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Multiset.Sym

14 declarations and 1 deprecated aliases. Mathlib docs · Source

Unordered tuples of elements of a multiset

Defines Multiset.sym and the specialized Multiset.sym2 for computing multisets of all unordered n-tuples from a given multiset. These are multiset versions of Nat.multichoose.

Main declarations

  • Multiset.sym2: xs.sym2 is the multiset of all unordered pairs of elements from xs, with multiplicity. The multiset's values are in Sym2 α.

TODO

  • Once List.Perm.sym is defined, define

    protected def sym (n : Nat) (m : Multiset α) : Multiset (Sym α n) :=
      m.liftOn (fun xs => xs.sym n) (List.perm.sym n)
    

    and then use this to remove the DecidableEq assumption from Finset.sym.

  • theorem injective_sym2 : Function.Injective (Multiset.sym2 : Multiset α → _)

  • theorem strictMono_sym2 : StrictMono (Multiset.sym2 : Multiset α → _)

def Multiset.sym2 E3 #

{α : Type u_1} → Multiset α → Multiset (Sym2 α)

m.sym2 is the multiset of all unordered pairs of elements from m, with multiplicity. If m has no duplicates then neither does m.sym2.

theorem Multiset.sym2_coe E0 #

∀ {α : Type u_1} (xs : List α), (↑xs).sym2 = ↑xs.sym2

theorem Multiset.sym2_eq_zero_iff E0 #

∀ {α : Type u_1} {m : Multiset α}, m.sym2 = 0 ↔ m = 0

theorem Multiset.sym2_zero E0 #

∀ {α : Type u_1}, Multiset.sym2 0 = 0

theorem Multiset.sym2_cons E1 #

∀ {α : Type u_1} (a : α) (m : Multiset α), (a ::ₘ m).sym2 = Multiset.map (fun b ↦ s(a, b)) (a ::ₘ m) + m.sym2

theorem Multiset.sym2_map E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (m : Multiset α), (Multiset.map f m).sym2 = Multiset.map (Sym2.map f) m.sym2

theorem Multiset.mk_mem_sym2_iff E0 #

∀ {α : Type u_1} {m : Multiset α} {a b : α}, s(a, b) ∈ m.sym2 ↔ a ∈ m ∧ b ∈ m

theorem Multiset.mem_sym2_iff E0 #

∀ {α : Type u_1} {m : Multiset α} {z : Sym2 α}, z ∈ m.sym2 ↔ ∀ y ∈ z, y ∈ m

theorem Multiset.setOfPred_mem_sym2 E1 #

∀ {α : Type u_1} {m : Multiset α}, {z | z ∈ m.sym2} = {x | x ∈ m}.sym2

theorem Multiset.Nodup.sym2 E1 #

∀ {α : Type u_1} {m : Multiset α}, m.Nodup → m.sym2.Nodup

theorem Multiset.sym2_mono E0 #

∀ {α : Type u_1} {m m' : Multiset α}, m ≤ m' → m.sym2 ≤ m'.sym2

theorem Multiset.monotone_sym2 E1 #

∀ {α : Type u_1}, Monotone Multiset.sym2

theorem Multiset.card_sym2 E1 #

∀ {α : Type u_1} {m : Multiset α}, m.sym2.card = (m.card + 1).choose 2

theorem Multiset.dedup_sym2 E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (m : Multiset α), m.sym2.dedup = m.dedup.sym2

Deprecated aliases

NameNew nameSince
Multiset.setOf_mem_sym2Multiset.setOfPred_mem_sym22026-07-09