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 fromxs
, with multiplicity. The multiset's values are inSym2 α
.
TODO #
-
Once
List.Perm.sym
is defined, defineprotected 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 fromFinset.sym
. -
theorem injective_sym2 : Function.Injective (Multiset.sym2 : Multiset α → _)
-
theorem strictMono_sym2 : StrictMono (Multiset.sym2 : Multiset α → _)
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
.
Equations
- Multiset.sym2 m = Quotient.liftOn m (fun (xs : List α) => ↑(List.sym2 xs)) ⋯
Instances For
@[simp]
@[simp]
theorem
Multiset.mem_sym2_iff
{α : Type u_1}
{m : Multiset α}
{z : Sym2 α}
:
z ∈ Multiset.sym2 m ↔ ∀ y ∈ z, y ∈ m
@[simp]
theorem
Multiset.sym2_mono
{α : Type u_1}
{m : Multiset α}
{m' : Multiset α}
(h : m ≤ m')
:
Multiset.sym2 m ≤ Multiset.sym2 m'
theorem
Multiset.card_sym2
{α : Type u_1}
{m : Multiset α}
:
Multiset.card (Multiset.sym2 m) = Nat.choose (Multiset.card m + 1) 2