induction ls; intuition.
inversion H0; subst; clear H0.
inversion H1. trivial.
inversion H0; clear H0; subst.
inversion H1; clear H1; subst.
exfalso.
eapply H; eauto. simpl. intuition.
eapply IHls; eauto.
intuition.
eapply H; eauto. simpl. intuition.
Qed.

Lemma rel_map_app_inv : forall (A B : Type)(rel : A -> B -> Prop)(lsa1 lsa2 : list A)(lsb : list B),
rel_map rel (lsa1 ++ lsa2) lsb ->
(rel_map rel lsa1 (firstn (length lsa1) lsb) /\ rel_map rel lsa2 (skipn (length lsa1) lsb)).