Fintype instance for nodup lists #
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 Multiset (List α) is provided.
This function is applied to the Finset.powerset of Finset.univ.
Given a m : Multiset α, we form the Multiset of l : List α with the property ⟦l⟧ = m.
Equations
- s.lists = Quotient.liftOn s (fun (l : List α) => ↑l.permutations) ⋯