Proof using.
unfold refined_raft_net_invariant_request_vote, prevLog_candidateEntriesTerm.
simpl. intros.
find_apply_hyp_hyp. break_or_hyp.
- find_eapply_lem_hyp app_cons_in_rest; [|solve[eauto]].
eapply candidateEntriesTerm_ext; eauto.
eapply handleRequestVote_preserves_candidateEntriesTerm; eauto.
- exfalso. eapply handleRequestVote_no_append_entries; eauto.
simpl in *. subst. eauto 10.
Qed.

Lemma handleRequestVoteReply_preserves_candidateEntriesTerm :
forall net h h' t r st' t',
handleRequestVoteReply h (snd (nwState net h)) h' t r = st' ->
refined_raft_intermediate_reachable net ->
candidateEntriesTerm t' (nwState net) ->
candidateEntriesTerm t' (update name_eq_dec (nwState net) h
(update_elections_data_requestVoteReply h h' t r (nwState net h),
st')).