Definition msg_lifted_leader_sublog_host (net : ghost_log_network) : Prop :=
    forall leader e h,
      type (snd (nwState net leader)) = Leader ->
      In e (log (snd (nwState net h))) ->
      eTerm e = currentTerm (snd (nwState net leader)) ->
      In e (log (snd (nwState net leader))).

(* Specifications: *)
Lemma msg_lifted_leader_sublog_host_invariant : forall net, msg_refined_raft_intermediate_reachable net -> msg_lifted_leader_sublog_host net.
Lemma lifted_entries_match_invariant : forall net h h', msg_refined_raft_intermediate_reachable net -> entries_match (log (snd (nwState net h))) (log (snd (nwState net h'))).
Lemma lifted_terms_and_indices_from_one_log : forall net h, refined_raft_intermediate_reachable net -> terms_and_indices_from_one (log (snd (nwState net h))).
Lemma doLeader_preserves_committed : forall (net net' : ghost_log_network) d h os d' ms gd e t, doLeader d h = (os, d', ms) -> nwState net h = (gd, d) -> (forall h', nwState net' h' = update name_eq_dec (nwState net) h (gd, d') h') -> lifted_committed net e t -> lifted_committed net' e t.
Lemma doLeader_message_lci : forall st h os st' ms m t n pli plt es ci, doLeader st h = (os, st', ms) -> In m ms -> snd m = AppendEntries t n pli plt es ci -> ci = commitIndex st'.
Lemma doLeader_message_term : forall st h os st' ms m t n pli plt es ci, doLeader st h = (os, st', ms) -> In m ms -> snd m = AppendEntries t n pli plt es ci -> t = currentTerm st'.
Lemma commit_invariant_do_leader : forall net st' ps' gd d h os d' ms, doLeader d h = (os, d', ms) -> commit_invariant net -> msg_refined_raft_intermediate_reachable net -> lifted_maxIndex_sanity net -> nwState net h = (gd, d) -> (forall h', st' h' = update name_eq_dec (nwState net) h (gd, d') h') -> (forall p, In p ps' -> In p (nwPackets net) \/ In p (send_packets h (add_ghost_msg (msg_ghost_params := ghost_log_params) h (gd, d') ms))) -> commit_invariant {| nwPackets := ps'; nwState := st' |}.
Lemma doGenericServer_preserves_committed : forall (net net' : ghost_log_network) h out st' ms e t, doGenericServer h (snd (nwState net h)) = (out, st', ms) -> (forall h', nwState net' h' = update name_eq_dec (nwState net) h (fst (nwState net h), st') h') -> lifted_committed net e t -> lifted_committed net' e t.
Lemma commit_invariant_do_generic_server : msg_refined_raft_net_invariant_do_generic_server commit_invariant.
Lemma commit_invariant_state_same_packet_subset : msg_refined_raft_net_invariant_state_same_packet_subset commit_invariant.
Lemma reboot_preserves_committed : forall (net net' : ghost_log_network) h e t, (forall h', nwState net' h' = update name_eq_dec (nwState net) h (fst (nwState net h), reboot (snd (nwState net h))) h') -> lifted_committed net e t -> lifted_committed net' e t.
Lemma commit_invariant_reboot : msg_refined_raft_net_invariant_reboot commit_invariant.
Lemma maxIndex_sanity_lift : forall net, maxIndex_sanity (deghost (mgv_deghost net)) -> lifted_maxIndex_sanity net.
Lemma maxIndex_sanity_lower : forall net, lifted_maxIndex_sanity net -> maxIndex_sanity (deghost (mgv_deghost net)).