(***)
intros. elim E';intros v H';elim H';intros v' v'';clear H'.
assert(SURJ_Mv:surjective(comp_map_map M v)). unfold
surjective. intro a. elim(sM a). intros e e_goes_to_a. elim
(has_index(Map_to_equal_subsets v'(set_to_full E)e)). intros i
iH. simpl in iH. exists i. simpl;unfold comp_map_fun. apply
Trans with(M e);auto;intuition. unfold not;intro INJ.
(***)
assert(INJ_Mv:distinct(comp_map_map M v)). unfold distinct.
intros i j ij. simpl;unfold comp_map_fun. assert(vivj:~v i='
v j). apply v'';auto. unfold not;intro. apply vivj. apply INJ.
auto.
(***)
assert(SURJ_Mv_2:full A='seq_set(comp_map_map M v)). simpl;
unfold eq_part. intro a;split. simpl. intro. unfold surjective
in SURJ_Mv. elim(SURJ_Mv a). intros i iH. exists i. auto.
simpl;auto.
(***)
assert(has_n_elements n A). exists(comp_map_map M v). split.
exact SURJ_Mv_2. exact INJ_Mv. assert(has_n_elements m(full A)).
apply full_preserves_has_n_elements;auto. assert(has_n_elements
n(full A)). apply full_preserves_has_n_elements;auto. assert(m
='n). apply has_n_elements_inj with(B:=full A)(C:=full A).
auto. auto. apply Refl. apply H;auto. Qed.

Lemma nsum_const:forall(k:Nat)(C:Nat)(v:seq k Nat)
(H:forall(i:fin k),v i='C), nsum k v='k*C.