Proof using.
induction l; intros.
- simpl in *. intuition.
- simpl in *. intuition.
+ subst. auto with *.
+ find_apply_hyp_hyp. omega.
Qed.

(* Specifications: *)
Theorem maxIndex_is_max :
forall l e,
sorted l ->
In e l ->
maxIndex l >= eIndex e.
Theorem S_maxIndex_not_in :
forall l e,
sorted l ->
eIndex e = S (maxIndex l) ->
~ In e l.