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

(* Specifications: *)
Theorem handleRequestVoteReply_votesReceived :
forall h st t h' r v,
In v (votesReceived (handleRequestVoteReply h st h' t r)) ->
In v (votesReceived st) \/
(r = true /\ v = h' /\ currentTerm (handleRequestVoteReply h st h' t r) = t).
Lemma handleRequestVote_reply_true:
forall h h' st t lli llt st' t',
handleRequestVote h st t h' lli llt =
(st', RequestVoteReply t' true) ->
votedFor st' = Some h' /\
currentTerm st' = t'.