Proof using.
induction l; intros; simpl in *; intuition;
break_match; intuition; repeat subst; simpl in *; auto.
intuition.
eapply_prop_hyp sorted sorted; eauto.
match goal with
| _ : eIndex _ <= maxIndex ?l |- _ =>
destruct l
end.
- simpl in *.
find_apply_lem_hyp Prefix_nil. subst. simpl in *. intuition.
- simpl in *.
match goal with
| [ H : forall _, _ = _ \/ In _ _ -> _, _ : eIndex _ <= eIndex ?e |- _ ] =>
specialize (H e)
end; intuition.
Qed.

Lemma app_maxIndex_In_l :
forall l l' e,
sorted (l ++ l') ->
In e (l ++ l') ->
maxIndex l' < eIndex e ->
In e l.