intros; red in |- *.
red in H, H0.
inversion_clear H.
inversion_clear H1.
assert (forall i : fin n, in_part (Map_embed x i) C).
intro.
simpl in |- *.
apply H0; auto with algebra.
exists (cast_map_to_subset H1).
red in |- *; intros.
red in H2; (apply (H2 i j); auto with algebra).
Qed.

Lemma has_n_elements_doesn't_have_more :
forall (A : Setoid) (n : Nat),
has_n_elements n A -> forall m : Nat, n < m -> ~ has_at_least_n_elements m A.