Proof using.
intros.
unfold update_elections_data_timeout.
repeat find_rewrite.
unfold handleTimeout, tryToBecomeLeader in *.
repeat break_match; repeat find_inversion; simpl in *; auto; try congruence;
find_inversion; auto.
Qed.

(* Specifications: *)
Lemma update_elections_data_request_vote_votedFor :
forall h h' cid t lli llt st st' m,
handleRequestVote h (snd st) t h' lli llt = (st', m) ->
votedFor st' = Some cid ->
(votedFor (snd st) = Some cid /\
currentTerm st' = currentTerm (snd st)) \/
(cid = h' /\
currentTerm st' = t /\
votesWithLog (update_elections_data_requestVote
h h' t h' lli llt st) =
(currentTerm st', cid, (log st')) :: votesWithLog (fst st) /\
moreUpToDate llt lli (maxTerm (log st')) (maxIndex (log st')) = true).