Section ChoiceKeys.
Variable (K : choiceType).
Implicit Types (k : K) (ks : seq K).
Definition fset_sub_pickle x := index x fset_sub_enum.
Definition fset_sub_unpickle n := nth None (map some fset_sub_enum) n.
Definition fset_sub_countMixin := CountMixin fset_sub_pickleK.
Canonical fset_sub_countType := Eval hnf in CountType fset_sub_type fset_sub_countMixin.
Definition fset_sub_finMixin :=
Eval hnf in UniqFinMixin (undup_uniq _) mem_fset_sub_enum.
Canonical fset_sub_finType := Eval hnf in FinType fset_sub_type fset_sub_finMixin.
Canonical fset_sub_subfinType := [subFinType of fset_sub_type].

Lemma enum_imfset (T : choiceType) (f : T -> K) (p : finmempred T) :
{in p &, injective f} ->
perm_eq (imfset key f p) [seq f x | x <- enum_finmem p].