Proof using.
intros.
unfold cacheApplyEntry in *.
repeat break_match; repeat find_inversion.
- find_apply_hyp_hyp. break_exists. break_and.
erewrite deduplicate_log_snoc_drop; eauto.
do_bool. omega.
- find_apply_hyp_hyp. break_exists. break_and.
erewrite deduplicate_log_snoc_drop; eauto.
do_bool. omega.
- find_copy_apply_hyp_hyp. break_exists. break_and.
pose proof (deduplicate_log_cases es e).
intuition; break_exists; intuition; repeat find_rewrite.
+ do_bool. assert (eId x0 <= n) by eauto. omega.
+ eapply applyEntry_stateMachine_correct; eauto.
- pose proof (deduplicate_log_cases es e).
intuition; break_exists; intuition; repeat find_rewrite.
+ eapply_prop_hyp In In. break_exists. break_and.
repeat find_rewrite. discriminate.
+ eapply applyEntry_stateMachine_correct; eauto.
Qed.

Lemma deduplicate_log_In_if :
forall e l,
In e (deduplicate_log l) ->
In e l.