Proof using cci.
unfold refined_raft_net_invariant_request_vote_reply, prevLog_candidateEntriesTerm.
simpl. intros.
find_apply_hyp_hyp.
find_eapply_lem_hyp app_cons_in_rest; [|solve[eauto]].
eapply candidateEntriesTerm_ext; eauto.
subst.
eapply handleRequestVoteReply_preserves_candidateEntriesTerm; eauto.
Qed.

Lemma doLeader_preserves_candidateEntriesTerm :
forall net gd d h os d' ms t',
nwState net h = (gd, d) ->
doLeader d h = (os, d', ms) ->
candidateEntriesTerm t' (nwState net) ->
candidateEntriesTerm t' (update name_eq_dec (nwState net) h (gd, d')).