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

Lemma cacheApplyEntry_cache_apply :
forall st e os st' id o o' d,
cacheApplyEntry st e = (os, st') ->
getLastId st (eClient e) = Some (id, o) ->
id < eId e ->
handler (eInput e) (stateMachine st) = (o', d) ->
assoc_set clientId_eq_dec (clientCache st) (eClient e) (eId e, o') = clientCache st'.