fintype instances for equiv
and perm
#
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Main declarations:
perms_of_finset s
: The finset of permutations of the finsets
.
Given a list, produce a list of all permutations of its elements.
Equations
- perms_of_list (a :: l) = perms_of_list l ++ l.bind (λ (b : α), list.map (λ (f : equiv.perm α), equiv.swap a b * f) (perms_of_list l))
- perms_of_list list.nil = [1]
theorem
length_perms_of_list
{α : Type u_1}
[decidable_eq α]
(l : list α) :
(perms_of_list l).length = l.length.factorial
theorem
mem_perms_of_list_of_mem
{α : Type u_1}
[decidable_eq α]
{l : list α}
{f : equiv.perm α}
(h : ∀ (x : α), ⇑f x ≠ x → x ∈ l) :
f ∈ perms_of_list l
theorem
nodup_perms_of_list
{α : Type u_1}
[decidable_eq α]
{l : list α}
(hl : l.nodup) :
(perms_of_list l).nodup
Given a finset, produce the finset of all permutations of its elements.
Equations
- perms_of_finset s = quotient.hrec_on s.val (λ (l : list α) (hl : multiset.nodup ⟦l⟧), {val := ↑(perms_of_list l), nodup := _}) perms_of_finset._proof_2 _
theorem
card_perms_of_finset
{α : Type u_1}
[decidable_eq α]
(s : finset α) :
(perms_of_finset s).card = s.card.factorial
The collection of permutations of a fintype is a fintype.
Equations
- fintype_perm = {elems := perms_of_finset finset.univ, complete := _}
@[protected, instance]
def
equiv.fintype
{α : Type u_1}
{β : Type u_2}
[decidable_eq α]
[decidable_eq β]
[fintype α]
[fintype β] :
Equations
- equiv.fintype = dite (fintype.card β = fintype.card α) (λ (h : fintype.card β = fintype.card α), (fintype.trunc_equiv_fin α).rec_on_subsingleton (λ (eα : α ≃ fin (fintype.card α)), (fintype.trunc_equiv_fin β).rec_on_subsingleton (λ (eβ : β ≃ fin (fintype.card β)), fintype.of_equiv (equiv.perm α) ((equiv.refl α).equiv_congr (eα.trans (h.rec_on eβ.symm)))))) (λ (h : ¬fintype.card β = fintype.card α), {elems := ∅, complete := _})
theorem
fintype.card_perm
{α : Type u_1}
[decidable_eq α]
[fintype α] :
fintype.card (equiv.perm α) = (fintype.card α).factorial
theorem
fintype.card_equiv
{α : Type u_1}
{β : Type u_2}
[decidable_eq α]
[decidable_eq β]
[fintype α]
[fintype β]
(e : α ≃ β) :
fintype.card (α ≃ β) = (fintype.card α).factorial