Symmetric powers #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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.sym.sym2
.
TODO: This was created as supporting material for sym2
; it
needs a fleshed-out interface.
Tags #
symmetric powers
Equations
- sym.has_coe α n = coe_subtype
Equations
- sym.decidable_mem a s = multiset.decidable_mem a s.val
Another definition of the nth symmetric power, using vectors modulo permutations. (See sym
.)
Equations
- sym.sym' α n = quotient (vector.perm.is_setoid α n)
Instances for sym.sym'
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 α), ⇑multiset.card s = n) sym.sym_equiv_sym'._proof_1 sym.sym_equiv_sym'._proof_2
Equations
- sym.has_zero = {zero := ⟨0, _⟩}
Equations
- sym.has_emptyc = {emptyc := 0}
Equations
- sym.unique_zero = {to_inhabited := {default := sym.nil α}, uniq := _}
replicate n a
is the sym containing only a
with multiplicity n
.
Equations
- sym.replicate n a = ⟨multiset.replicate n a, _⟩
Equations
Equations
Equations
- sym.unique n = unique.mk' (sym α n)
Note: sym.map_id
is not simp-normal, as simp ends up unfolding id
with sym.map_congr
Remove every a
from a given sym α n
.
Yields the number of copies i
and a term of sym α (n - i)
.
Equations
- sym.filter_ne a m = ⟨⟨multiset.count a m.val, _⟩, ⟨multiset.filter (ne a) m.val, _⟩⟩
Combinatorial equivalences #
Function from the symmetric product over option
splitting on whether or not
it contains a none
.
Equations
- sym_option_succ_equiv.encode s = dite (option.none ∈ s) (λ (h : option.none ∈ s), sum.inl (s.erase option.none h)) (λ (h : option.none ∉ s), sum.inr (sym.map (λ (o : {x // x ∈ s}), option.get _) s.attach))
Inverse of sym_option_succ_equiv.decode
.
Equations
The symmetric product over option
is a disjoint union over simpler symmetric products.
Equations
- sym_option_succ_equiv = {to_fun := sym_option_succ_equiv.encode (λ (a b : α), _inst_1 a b), inv_fun := sym_option_succ_equiv.decode n, left_inv := _, right_inv := _}