Definition type_term_log_monotonic st st' :=
    type st' = Leader ->
    type st = Leader /\
    currentTerm st' = currentTerm st /\
    (forall e, In e (log st) -> In e (log st')).Notation appendEntries_leader_predicate ps st :=
    (forall p t lid pli plt es lci e,
      In p ps ->
      pBody p = AppendEntries t lid pli plt es lci ->
      In e es ->
      currentTerm st = t ->
      type st = Leader ->
      In e (log st)).

Lemma doLeader_message_entries : forall st h os st' ms m t n pli plt es ci e, doLeader st h = (os, st', ms) -> In m ms -> snd m = AppendEntries t n pli plt es ci -> In e es -> currentTerm st = t /\ type st = Leader /\ In e (log st).