Proof using.
intros. unfold handleAppendEntries, advanceCurrentTerm in *.
repeat break_match; find_inversion; 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 /\ log st' = log st) \/
type st' = Follower.