Proof using.
intros.
unfold handleAppendEntriesReply in *.
repeat (break_match; repeat (find_inversion; simpl in *)); auto using advanceCurrentTerm_same_log.
Qed.

Lemma handleAppendEntriesReply_same_lastApplied :
forall n st src t es b st' l,
handleAppendEntriesReply n st src t es b = (st', l) ->
lastApplied st' = lastApplied st.