unfold cast_seq, distinct in |- *.
intros until H.
elim v.
simpl in |- *.
intros.
red in |- *; intro; red in H0;
(apply H0 with (cast_fin i (sym_eq H)) (cast_fin j (sym_eq H));
auto with algebra).
unfold cast_fin in |- *.
generalize H1; elim i; elim j.
simpl in |- *.
auto.
Qed.
Hint Resolve cast_seq_preserves_distinct: algebra.

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