Inductive set_type : predArgType := FinSet of {ffun pred T}.Inductive set_type : predArgType := FinSet of {ffun pred T}.Definition set_of of phant T := set_type.Identity Coercion type_of_set_of : set_of >-> set_type.Canonical set_eqType := Eval hnf in EqType set_type set_eqMixin.Canonical set_choiceType := Eval hnf in ChoiceType set_type set_choiceMixin.Canonical set_countType := Eval hnf in CountType set_type set_countMixin.Canonical set_finType := Eval hnf in FinType set_type set_finMixin.Notation "{ 'set' T }" := (set_of (Phant T))
  (at level 0, format "{ 'set'  T }") : type_scope.Notation "[ 'se' 't' E | x : T 'in' A , y : U ]" :=
  (imset2 (fun x y => E) (mem A) (fun _ : T => mem (predOfType U)))
  (at level 0, E, x, y at level 99, format
   "[ '[hv' 'se' 't'  E '/ '  |  x  :  T  'in'  A , '/   '  y  :  U ] ']'")
   : set_scope.Local Notation finset_def := (fun T P => @FinSet T (finfun P)).Local Notation pred_of_set_def := (fun T (A : set_type T) => val A : _ -> _).Definition finset := finset_def.Definition pred_of_set := pred_of_set_def.

Lemma pred_of_setE : pred_of_set = pred_of_set_def.