Proof using.
unfold handleAppendEntries, advanceCurrentTerm.
intros.
repeat break_match; repeat tuple_inversion; simpl in *;
do_bool; auto; try omega.
Qed.

(* Specifications: *)
Lemma handleAppendEntriesReply_same_term_votedFor_preserved :
forall h st h' t es r st' ms,
handleAppendEntriesReply h st h' t es r = (st', ms) ->
currentTerm st' = currentTerm st ->
votedFor st' = votedFor st.