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

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