Proof using.
intros.
unfold cacheApplyEntry, applyEntry in *.
repeat break_match; subst; repeat find_inversion; do_bool;
simpl in *; auto; try omega; congruence.
Qed.

(* Specifications: *)
Lemma cacheApplyEntry_cache_no_apply :
forall st e os st' id o,
cacheApplyEntry st e = (os, st') ->
getLastId st (eClient e) = Some (id, o) ->
eId e <= id ->
clientCache st = clientCache st'.
Lemma clientCache_to_ks_assoc_set :
forall c client id o,
assoc_set clientId_eq_dec (clientCache_to_ks c) client id =
clientCache_to_ks (assoc_set clientId_eq_dec c client (id, o)).