Proof using.
unfold raft_net_invariant_request_vote. intros.
unfold leader_sublog_invariant, leader_sublog_nw_invariant,
leader_sublog_host_invariant, handleRequestVote, advanceCurrentTerm in *.
intuition idtac; simpl in *.
- repeat find_higher_order_rewrite; repeat break_match; repeat find_inversion;
subst; simpl in *;
intuition eauto; try solve_by_inversion.
- repeat find_higher_order_rewrite; repeat break_match; repeat find_inversion;
subst; simpl in *;
intuition eauto;
find_apply_hyp_hyp; intuition eauto; subst; try discriminate.
Qed.
Definition CandidateEntriesLowered net e h :=
currentTerm (nwState net h) = eTerm e ->
wonElection (dedup name_eq_dec (votesReceived (nwState net h))) = true ->
type (nwState net h) <> Candidate.

Lemma candidate_entries_lowered' :
forall net,
CandidateEntries net ->
votes_correct net ->
cronies_correct net ->
forall h h' e,
In e (log (snd (nwState net h'))) ->
CandidateEntriesLowered (deghost net) e h.