Definition leaderLogs_entries_match_nw (net : network) : Prop :=
    forall h llt ll p t src pli plt es ci,
      In (llt, ll) (leaderLogs (fst (nwState net h))) ->
      In p (nwPackets net) ->
      pBody p = AppendEntries t src pli plt es ci ->
      (forall e1 e2,
         eIndex e1 = eIndex e2 ->
         eTerm e1 = eTerm e2 ->
         In e1 es ->
         In e2 ll ->
         (forall e3,
            eIndex e3 <= eIndex e1 ->
            In e3 es ->
            In e3 ll) /\
         (pli <> 0 ->
          exists e4,
            eIndex e4 = pli /\
            eTerm e4 = plt /\
            In e4 ll)).Definition leaderLogs_entries_match (net : network) : Prop :=
    leaderLogs_entries_match_host net /\
    leaderLogs_entries_match_nw net.

Lemma lifted_log_matching_host : forall net, refined_raft_intermediate_reachable net -> (forall h h', entries_match (log (snd (nwState net h))) (log (snd (nwState net h')))) /\ (forall h i, 1 <= i <= maxIndex (log (snd (nwState net h))) -> exists e, eIndex e = i /\ In e (log (snd (nwState net h)))) /\ (forall h e, In e (log (snd (nwState net h))) -> eIndex e > 0).