Proof using.
unfold raft_net_invariant_request_vote, prevLog_leader_sublog.
intros. simpl in *.
repeat find_higher_order_rewrite.
find_apply_hyp_hyp. break_or_hyp.
- find_eapply_lem_hyp app_cons_in_rest; [|solve[eauto]].
find_rewrite. break_if; eauto.
find_copy_apply_lem_hyp handleRequestVote_log.
find_copy_apply_lem_hyp handleRequestVote_type.
intuition; repeat find_rewrite; try discriminate.
eauto.
- find_apply_lem_hyp handleRequestVote_no_append_entries.
simpl in *. subst. exfalso. eauto 10.
Qed.
Definition candidateEntriesTerm_lowered (net : network) t p : Prop :=
In p (nwPackets net) ->
pBody p = RequestVoteReply t true ->
currentTerm (nwState net (pDst p)) = t ->
wonElection (dedup name_eq_dec (pSrc p :: votesReceived (nwState net (pDst p)))) = true ->
type (nwState net (pDst p)) <> Candidate.

(* Specifications: *)
Lemma deghost_packet_exists :
forall net p,
In p (nwPackets (deghost net)) ->
exists (q : packet (params := raft_refined_multi_params (raft_params := raft_params))),
In q (nwPackets net) /\ p = deghost_packet q.