Proof using.
intros.
destruct l2.
- intuition. subst. rewrite app_nil_r in *. auto.
- match goal with H : _ \/ _ |- _ => clear H end.
simpl in *. break_match; intuition. subst. simpl.
eauto using contiguous_partition.
Qed.

Lemma sorted_term_index_lt :
forall l e e',
sorted l ->
In e l ->
In e' l ->
eIndex e < eIndex e' ->
eTerm e <= eTerm e'.