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 app_contiguous_maxIndex_le_eq : forall l l1 l2 l2' i, l = l1 ++ l2 -> Prefix l2 l2' -> contiguous_range_exact_lo l i -> maxIndex l2' <= i -> l = l1.