Cyril Cohen published an extension to the Mathematical Components library to handle finite subsets of types. In the course of experimenting with this extension, I need to generalize a lemma that already exists for finite subsets of finite types to finite sets.
The lemma is stated in the Mathematical Components library as follows:
Section CardFunImage.
Variables aT rT : finType.
Variables (f : aT -> rT) (D : pred aT).
Lemma imset_injP : reflect {in D &, injective f} (#|f @: D| == #|D|).
I wish to have the same lemma for finite sets.  I express it in the following manner.  Note that the notation of cardinals has to change, because 
  reflect{in D &, injective f} (#|` [fset f x | x in D] | == #|` D |).
I also need to change the type for 
Proving this lemma is hard.  I first try to just apply 
Check @image_injP [finType of D] [finType of (f @` D) _ predT.
image_injP
     : reflect {in predT &, injective ?s}
         (#|[seq ?s x | x in predT]| == #|predT|)
For this quick experiment, I had to leave a place holder 
A similar experiment with 
Check @imset_injP [finType of D] [finType of (f @` D)] _ pred
To lift a function from type 
Section experiment_draft. Variable d1 : D. Check f (val d1). Check [finType of (f @` D)]. Definition fd : D -> [finType of (f @` D)]. Proof. move => d; exists (f (val d)); apply: in_imfset; case: d; move => e e_in; exact e_in. Defined.
In these experiments, we see that 
 
			 
			