Proof using.
intros. unfold handleAppendEntries, advanceCurrentTerm in *.
repeat break_match; find_inversion; do_bool; auto.
Qed.

Lemma handleAppendEntriesReply_type :
forall h st h' t es r st' ms,
handleAppendEntriesReply h st h' t es r = (st', ms) ->
(type st' = type st /\ currentTerm st' = currentTerm st) \/
type st' = Follower.