Ltac use_entries_match :=
    match goal with
      | [ _ : eIndex ?e1 = eIndex ?e2,
              H : context [entries_match]
                              |- _ ] =>
        first [ solve [eapply H with (e:=e2)(e':=e1); eauto; congruence] |
                solve [eapply H with (e:=e1)(e':=e2); eauto; congruence]]
    end.

Lemma findGtIndex_removeAfterIndex_i'_le_i : forall l i i', sorted l -> i' <= i -> (filter (fun x : entry => (i <? eIndex x) && (eIndex x <=? i')) (findGtIndex l i)) ++ removeAfterIndex l i = removeAfterIndex l i.