(** - if $\forall b\in B, f(b)\in W\subset A$ for $f:B\to A$ then $f$ can be seen as
 $f:B\to W$. This is done by cast_map_to_subset. *)

Definition cast_to_subset_fun :
  forall (A B : Setoid) (v : MAP B A) (W : part_set A),
  (forall i : B, in_part (v i) W) -> (B -> W:Type).(** %\label{castmaptosubset}% *)
Definition cast_map_to_subset :
  forall (A B : Setoid) (v : MAP B A) (W : part_set A),
  (forall i : B, in_part (v i) W) -> MAP B W.

Lemma cast_seq_nice : forall (A B : Setoid) (v : MAP B A) (W : part_set A) (H : forall i : B, in_part (v i) W) (P : Predicate (MAP B A)), Pred_fun P v -> Pred_fun P (Map_embed (cast_map_to_subset H)).