Fintype instance for nodup lists #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
The subtype of {l : list α // l.nodup} over a [fintype α]
admits a fintype instance.
Implementation details #
To construct the fintype instance, a function lifting a multiset α
to the finset (list α) that can construct it is provided.
This function is applied to the finset.powerset of finset.univ.
In general, a decidable_eq instance is not necessary to define this function,
but a proof of (list.permutations l).nodup is required to avoid it,
which is a TODO.
The finset of l : list α that, given m : multiset α, have the property ⟦l⟧ = m.
Equations
- multiset.lists = λ (s : multiset α), quotient.lift_on s (λ (l : list α), l.permutations.to_finset) multiset.lists._proof_1
@[simp]
theorem
multiset.lists_coe
{α : Type u_1}
[decidable_eq α]
(l : list α) :
↑l.lists = l.permutations.to_finset
@[protected, instance]
Equations
- fintype_nodup_list = fintype.subtype (finset.univ.powerset.bUnion (λ (s : finset α), s.val.lists)) fintype_nodup_list._proof_1