intros until H'.
unfold cast_fin in |- *.
case i; case i'.
simpl in |- *.
auto.
Qed.
Hint Resolve cast_fin_comp: algebra.
Variable A : Setoid.
Definition cast_seq : forall n n' : Nat, seq n A -> n =' n' in _ -> seq n' A.
intros.
destruct X.
set (Ap' := fun i : fin n' => Ap (cast_fin i (sym_eq H))) in *.
assert (Mcp' : fun_compatible Ap').
red in |- *; red in Map_compatible_prf.
unfold Ap' in |- *.
intros.
apply Map_compatible_prf; auto with algebra.
exact (Build_Map Mcp').
Defined.

(* Specifications: *)
Lemma cast_seq_comp :
forall (n n' : Nat) (v v' : seq n A) (H H' : n =' n' in _),
v =' v' in _ -> cast_seq v H =' cast_seq v' H' in _.