Section MAIN.
intros.
rewrite <- H0.
auto.
Qed.
(** %\label{castfin}% *)
Definition cast_fin : forall n n' : Nat, fin n -> n =' n' in _ -> fin n'.
intros.
destruct X.
exact (Build_finiteT (lt_comp in_range_prf H)).
Defined.
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.

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 _.