Proof using.
unfold handleRequestVote.
intros.
repeat break_match; repeat find_inversion; intuition.
- simpl in *. discriminate.
- unfold advanceCurrentTerm in *.
break_if; simpl in *; do_bool; intuition.
Qed.

Lemma handleRequestVoteReply_term_votedFor_cases :
forall me st src t v st',
handleRequestVoteReply me st src t v = st' ->
(currentTerm st' = currentTerm st /\
votedFor st' = votedFor st) \/
(currentTerm st < currentTerm st' /\
votedFor st' = None).