Proof using.
unfold entries_match.
intuition; simpl in *; intuition; subst; subst;
try match goal with
| [ H : In _ _ |- _ ] => apply maxTerm_is_max in H; [| solve[auto]]; omega
| [ H : In _ _ |- _ ] => apply maxIndex_is_max in H; [| solve[auto]]; omega
end.
- match goal with
| [ H : _ |- _ ] => solve [eapply H; eauto]
end.
- right. match goal with
| [ H : _ |- _ ] => solve [eapply H; eauto]
end.
Qed.

Lemma entries_match_cons_sublog :
forall x xs ys,
sorted xs ->
sorted ys ->
eIndex x > maxIndex xs ->
entries_match xs ys ->
(forall y, In y ys -> eTerm x = eTerm y -> In y xs) ->
entries_match (x :: xs) ys.