Fixpoint nsum (n:Nat) {struct n} : seq n Nat -> Nat :=
match n return (seq n Nat -> Nat) with
|O => fun x:seq 0 Nat => 0
|S m => fun x:seq (S m) Nat => (head x) + (nsum m (Seqtl x)) end.

Lemma samecardA:forall(E F:Setoid)(M:MAP E F) (S:surjective M)(I:injective M)(n:Nat)(C:has_n_elements n E), has_n_elements n F.