Symmetric powers
This file defines symmetric powers of a type. The nth symmetric power consists of homogeneous n-tuples modulo permutations by the symmetric group.
The special case of 2-tuples is called the symmetric square, which is
addressed in more detail in data.sym2
.
TODO: This was created as supporting material for data.sym2
; it
needs a fleshed-out interface.
Tags
symmetric powers
The nth symmetric power is n-tuples up to permutation. We define it
as a subtype of multiset
since these are well developed in the
library. We also give a definition sym.sym'
in terms of vectors, and we
show these are equivalent in sym.sym_equiv_sym'
.
This is the quotient map that takes a list of n elements as an n-tuple and produces an nth symmetric power.
Equations
- sym.of_vector x = ⟨↑(x.val), _⟩
Equations
- sym.has_lift = {lift := sym.of_vector n}
Equations
- sym.has_mem = {mem := sym.mem n}
Equations
- sym.decidable_mem a s = subtype.cases_on s (λ (s_val : multiset α) (s_property : s_val.card = n), id (multiset.decidable_mem a s_val))
This is cons
but for the alternative sym'
definition.
Equations
- sym.cons' = λ (a : α), quotient.map (vector.cons a) _
Multisets of cardinality n are equivalent to length-n vectors up to permutations.
Equations
- sym.sym_equiv_sym' = equiv.subtype_quotient_equiv_quotient_subtype (λ (l : list α), l.length = n) (λ (s : multiset α), s.card = n) sym.sym_equiv_sym'._proof_1 sym.sym_equiv_sym'._proof_2
Equations
- sym.inhabited_sym n = {default := ⟨multiset.repeat (default α) n, _⟩}
Equations
- sym.inhabited_sym' n = {default := quotient.mk' (vector.repeat (default α) n)}