Proof using.
intros. unfold handleAppendEntriesReply, advanceCurrentTerm in *.
repeat break_match; find_inversion; simpl in *; auto; congruence.
Qed.

Theorem handleRequestVoteReply_term_votedFor :
forall h st t h' h'' r st',
handleRequestVoteReply h st h' t r = st' ->
votedFor st' = Some h'' ->
currentTerm st' = currentTerm st /\ votedFor st' = votedFor st.