Proof using.
red. unfold lastApplied_le_commitIndex. intros.
subst.
simpl in *. repeat find_higher_order_rewrite.
destruct_update; simpl in *; eauto.
find_copy_apply_lem_hyp doLeader_same_lastApplied.
find_copy_apply_lem_hyp doLeader_same_commitIndex.
repeat find_rewrite. eapply le_trans; [|eauto]; eauto.
Qed.

Lemma doGenericServer_lastApplied:
forall (h : name)
(st : raft_data) (out : list raft_output) (st' : raft_data)
(ms : list (name * msg)),
doGenericServer h st = (out, st', ms) ->
lastApplied st' <= max (lastApplied st) (commitIndex st).