Section MAIN.
Variable A : Setoid.
Variable n m : Nat.
Variable v : seq n A.
Variable w : seq m A.
(** - More facts about concatenation *)
induction n.
intros.
inversion Hi.
intro.
case i.
unfold concat in |- *.
unfold nat_rect in |- *.
simpl in |- *.
intros.
apply Ap_comp; auto with algebra.
intros.
apply Trans with (hdtl v (Build_finiteT Hi)).
apply Trans with ((hdtl v ++ w) (Build_finiteT Hi')).
apply concat_comp; auto with algebra.
2: apply Ap_comp; auto with algebra.
unfold hdtl in |- *.
apply Trans with ((head v;; Seqtl v ++ w) (Build_finiteT Hi'));
auto with algebra.
apply Trans with (Seqtl v (Build_finiteT (lt_S_n _ _ Hi))); auto with algebra.
apply Trans with ((Seqtl v ++ w) (Build_finiteT (lt_S_n _ _ Hi')));
auto with algebra.
Qed.
Hint Resolve concat_first_part: algebra.
induction n.
intros.
unfold concat in |- *.
unfold nat_rect in |- *.
apply Ap_comp; auto with algebra.
intros.
apply Trans with ((hdtl v ++ w) (Build_finiteT Hi')); auto with algebra.
unfold hdtl in |- *.
apply Trans with ((head v;; Seqtl v ++ w) (Build_finiteT Hi'));
auto with algebra.
cut (S (c + i) < S (c + m)).
intro.
apply Trans with ((Seqtl v ++ w) (Build_finiteT (lt_S_n _ _ H)));
auto with algebra.
apply Trans with ((head v;; Seqtl v ++ w) (Build_finiteT H));
auto with algebra.
replace (S (c + i)) with (S c + i).
assumption.
auto.
Qed.
Hint Resolve concat_second_part: algebra.

Lemma concat_prop_per_part :
forall P : Predicate A,
(forall (i : Nat) (Hi : i < n), Pred_fun P (v (Build_finiteT Hi))) ->
(forall (j : nat) (Hj : j < m), Pred_fun P (w (Build_finiteT Hj))) ->
forall (k : nat) (Hk : k < n + m), Pred_fun P ((v ++ w) (Build_finiteT Hk)).