Proof using.
induction es; simpl; intuition; repeat break_match; repeat find_inversion; do_bool.
- omega.
- auto.
- discriminate.
- f_equal. destruct (clientId_eq_dec (eClient a) (eClient e)).
+ repeat find_rewrite. find_injection.
eapply IHes with (n := eId a); auto with *.
now rewrite get_set_same.
+ eapply IHes; eauto.
rewrite get_set_diff by auto. auto.
- eauto.
- f_equal. destruct (clientId_eq_dec (eClient a) (eClient e)).
+ repeat find_rewrite. discriminate.
+ eapply IHes; eauto.
rewrite get_set_diff by auto. auto.
Qed.

Lemma deduplicate_log'_snoc_drop_es :
forall es ks e e',
In e' es ->
eClient e = eClient e' ->
eId e <= eId e' ->
deduplicate_log' (es ++ [e]) ks = deduplicate_log' es ks.