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.
Lemma prevLog_candidateEntriesTerm_lowered' : forall net, prevLog_candidateEntriesTerm net -> votes_correct net -> cronies_correct net -> forall p p' t leaderId prevLogIndex prevLogTerm entries leaderCommit, In p (nwPackets (deghost net)) -> pBody p = AppendEntries t leaderId prevLogIndex prevLogTerm entries leaderCommit -> 0 < prevLogTerm -> candidateEntriesTerm_lowered (deghost net) prevLogTerm p'.
Lemma prevLog_candidateEntriesTerm_lowered : forall net, raft_intermediate_reachable net -> forall p p' t leaderId prevLogIndex prevLogTerm entries leaderCommit, In p (nwPackets net) -> pBody p = AppendEntries t leaderId prevLogIndex prevLogTerm entries leaderCommit -> 0 < prevLogTerm -> candidateEntriesTerm_lowered net prevLogTerm p'.
Lemma handleRequestVoteReply_type_term_won : forall h st src t v st', handleRequestVoteReply h st src t v = st' -> type st' = type st \/ type st' = Follower \/ (v = true /\ wonElection (dedup name_eq_dec (src :: votesReceived st)) = true /\ currentTerm st' = t).
Lemma prevLog_leader_sublog_request_vote_reply : raft_net_invariant_request_vote_reply prevLog_leader_sublog.
Lemma prevLog_leader_sublog_do_leader : raft_net_invariant_do_leader prevLog_leader_sublog.
Lemma prevLog_leader_sublog_do_generic_server : raft_net_invariant_do_generic_server prevLog_leader_sublog.
Lemma prevLog_leader_sublog_state_same_packet_subset : raft_net_invariant_state_same_packet_subset prevLog_leader_sublog.
Lemma prevLog_leader_sublog_reboot : raft_net_invariant_reboot prevLog_leader_sublog.
Lemma prevLog_leader_sublog_invariant : forall net, raft_intermediate_reachable net -> prevLog_leader_sublog net.