Definition lifted_prevLog_leader_sublog (net : network) : Prop :=
    forall leader p t leaderId prevLogIndex prevLogTerm entries leaderCommit,
      type (snd (nwState net leader)) = Leader ->
      In p (nwPackets net) ->
      snd (pBody p) = AppendEntries t leaderId prevLogIndex prevLogTerm entries leaderCommit ->
      currentTerm (snd (nwState net leader)) = prevLogTerm ->
      0 < prevLogIndex ->
      0 < prevLogTerm ->
      exists ple, eIndex ple = prevLogIndex /\
             eTerm ple = prevLogTerm /\
             In ple (log (snd (nwState net leader))).

(* Specifications: *)
Lemma prevLog_leader_sublog_lifted : forall net, msg_refined_raft_intermediate_reachable net -> lifted_prevLog_leader_sublog net.
Lemma commit_invariant_client_request : forall h (net : ghost_log_network) st' ps' gd out d l client id c, handleClientRequest h (snd (nwState net h)) client id c = (out, d, l) -> gd = update_elections_data_client_request h (nwState net h) client id c -> commit_invariant net -> maxIndex_sanity (deghost (mgv_deghost net)) -> msg_refined_raft_intermediate_reachable net -> (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) l))) -> commit_invariant (mkNetwork ps' st').
Lemma handleTimeout_preserves_committed : forall h (net net' : ghost_log_network) out d' l e t, handleTimeout h (snd (nwState net h)) = (out, d', l) -> (forall h', nwState net' h' = update name_eq_dec (nwState net) h (update_elections_data_timeout h (nwState net h), d') h') -> lifted_committed net e t -> lifted_committed net' e t.
Lemma lifted_committed_monotonic : forall net t t' e, lifted_committed net e t -> t <= t' -> lifted_committed net e t'.
Lemma commit_invariant_timeout : msg_refined_raft_net_invariant_timeout commit_invariant.
Lemma committed_ext : forall ps st st' t e, (forall h, st' h = st h) -> committed (mkNetwork ps st) e t -> committed (mkNetwork ps st') e t.
Lemma lifted_committed_ext : forall ps st st' t e, (forall h, st' h = st h) -> lifted_committed (mkNetwork ps st) e t -> lifted_committed (mkNetwork ps st') e t.