Proof using.
unfold getLastId.
intros.
congruence.
Qed.

Lemma cacheAppliedEntry_clientCache_preserved :
forall st e l st' c i o,
cacheApplyEntry st e = (l, st') ->
getLastId st c = Some (i, o) ->
exists i' o',
getLastId st' c = Some (i', o') /\
i <= i'.