Unordered tuples of elements of a list #
Defines List.sym and the specialized List.sym2 for computing lists of all unordered n-tuples
from a given list. These are list versions of Nat.multichoose.
Main declarations #
List.sym:xs.sym nis a list of all unordered n-tuples of elements fromxs, with multiplicity. The list's values are inSym α n.List.sym2:xs.sym2is a list of all unordered pairs of elements fromxs, with multiplicity. The list's values are inSym2 α.
TODO #
@[simp]
theorem
List.sym2_eq_sym_two
{α : Type u_1}
{xs : List α}
:
map (⇑(Sym2.equivSym α)) xs.sym2 = List.sym 2 xs
@[irreducible]
@[irreducible]
@[irreducible]
theorem
List.mem_of_mem_of_mem_sym
{α : Type u_1}
{n : ℕ}
{xs : List α}
{a : α}
{z : Sym α n}
(ha : a ∈ z)
(hz : z ∈ List.sym n xs)
:
a ∈ xs
@[irreducible]
@[irreducible]
theorem
List.length_sym
{α : Type u_1}
{n : ℕ}
{xs : List α}
:
(List.sym n xs).length = xs.length.multichoose n