Proof using.
intros.
unfold prefix_within_term in *.
intros.
find_apply_hyp_hyp. intuition; eauto.
Qed.

(* Specifications: *)
Lemma removeAfterIndex_maxTerm_in :
forall e l,
sorted l ->
In e l ->
maxTerm (removeAfterIndex l (eIndex e)) = eTerm e.