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

(* Specifications: *)
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.
Lemma handleAppendEntries_type_term :
forall h st t n pli plt es ci st' ps,
handleAppendEntries h st t n pli plt es ci = (st', ps) ->
(type st' = type st /\ currentTerm st' = currentTerm st) \/
(type st' = Follower /\ currentTerm st' >= currentTerm st).