Definition lift_leader_sublog_nw :
    forall net leader p t leaderId prevLogIndex prevLogTerm entries leaderCommit e,    
      refined_raft_intermediate_reachable net ->
      type (snd (nwState net leader)) = Leader ->
      In p (nwPackets net) ->
      pBody p = AppendEntries t leaderId prevLogIndex prevLogTerm
                              entries leaderCommit ->
      In e entries ->
      eTerm e = currentTerm (snd (nwState net leader)) ->
      In e (log (snd (nwState net leader))).Definition append_entries_append_entries_prefix_within_term_nw net :=
    forall p t n pli plt es ci p' t' n' pli' plt' es' ci' e e',
      In p (nwPackets net) ->
      pBody p = AppendEntries t n pli plt es ci ->
      In p' (nwPackets net) ->
      pBody p' = AppendEntries t' n' pli' plt' es' ci' ->
      eTerm e = eTerm e' ->
      eIndex e <= eIndex e' ->
      In e es ->
      In e' es' ->
      (In e es' \/ (eIndex e = pli' /\ eTerm e = plt') \/ (eIndex e < pli' /\ eTerm e <= plt')).

Theorem log_log_prefix_within_term_invariant : forall net, refined_raft_intermediate_reachable net -> log_log_prefix_within_term net.