Definition currentTerm_votedFor_votesWithLog net :=
    forall h t n,
      (currentTerm (snd (nwState net h)) = t /\
       votedFor (snd (nwState net h)) = Some n) ->
      exists l,
        In (t, n, l) (votesWithLog (fst (nwState net h))).

(* Specifications: *)
Lemma currentTerm_votedFor_votesWithLog_invariant : forall net, refined_raft_intermediate_reachable net -> currentTerm_votedFor_votesWithLog net.
Lemma handleRequestVote_currentTerm_leaderId' : forall h st t c li lt st' m, handleRequestVote h st t c li lt = (st', m) -> votedFor st' <> votedFor st -> currentTerm st < currentTerm st' \/ leaderId st = None.
Lemma handleRequestVote_currentTerm : forall h st t src lli llt st' m, handleRequestVote h st t src lli llt = (st', m) -> currentTerm st <= currentTerm st'.
Lemma votesWithLog_update_elections_data_request_vote : forall net h t src lli llt st' m t' h' l', refined_raft_intermediate_reachable net -> handleRequestVote h (snd (nwState net h)) t src lli llt = (st', m) -> In (t', h', l') (votesWithLog (update_elections_data_requestVote h src t src lli llt (nwState net h))) -> In (t', h', l') (votesWithLog (fst (nwState net h))) \/ (t' = currentTerm st' /\ l' = log st' /\ (leaderId (snd (nwState net h)) = None \/ currentTerm (snd (nwState net h)) < currentTerm st')).
Lemma allEntries_votesWithLog_request_vote : refined_raft_net_invariant_request_vote allEntries_votesWithLog.
Lemma allEntries_votesWithLog_request_vote_reply : refined_raft_net_invariant_request_vote_reply allEntries_votesWithLog.
Lemma update_elections_data_client_request_allEntries_in_or_term : forall h st client id c out st' ms t e, handleClientRequest h (snd st) client id c = (out, st', ms) -> In (t, e) (allEntries (update_elections_data_client_request h st client id c)) -> In (t, e) (allEntries (fst st)) \/ t = currentTerm (snd st).
Lemma allEntries_votesWithLog_client_request : refined_raft_net_invariant_client_request allEntries_votesWithLog.
Lemma votesWithLog_update_elections_data_timeout' : forall net h out st' ps t' h' l', refined_raft_intermediate_reachable net -> handleTimeout h (snd (nwState net h)) = (out, st', ps) -> In (t', h', l') (votesWithLog (update_elections_data_timeout h (nwState net h))) -> In (t', h', l') (votesWithLog (fst (nwState net h))) \/ (t' = currentTerm st' /\ l' = log st' /\ currentTerm (snd (nwState net h)) < currentTerm st').
Lemma allEntries_votesWithLog_timeout : refined_raft_net_invariant_timeout allEntries_votesWithLog.
Lemma allEntries_votesWithLog_do_leader : refined_raft_net_invariant_do_leader allEntries_votesWithLog.
Lemma allEntries_votesWithLog_do_generic_server : refined_raft_net_invariant_do_generic_server allEntries_votesWithLog.
Lemma allEntries_votesWithLog_init : refined_raft_net_invariant_init allEntries_votesWithLog.
Lemma allEntries_votesWithLog_state_same_packet_subset : refined_raft_net_invariant_state_same_packet_subset allEntries_votesWithLog.
Lemma allEntries_votesWithLog_reboot : refined_raft_net_invariant_reboot allEntries_votesWithLog.
Theorem allEntries_votesWithLog_invariant : forall net, refined_raft_intermediate_reachable net -> allEntries_votesWithLog net.