Definition nextIndex_preserved st st' :=
    (type st' = Leader ->
     type st = Leader /\
     maxIndex (log st) <= maxIndex (log st') /\
     nextIndex st' = nextIndex st).

Lemma handleAppendEntriesReply_nextIndex : forall h st st' m t es res h', handleAppendEntriesReply h st h' t es res = (st', m) -> type st' = Leader -> type st = Leader /\ ((nextIndex st' = nextIndex st \/ (res = true /\ currentTerm st = t /\ nextIndex st' = (assoc_set name_eq_dec (nextIndex st) h' (Nat.max (getNextIndex st h') (S (maxIndex es)))))) \/ (res = false /\ currentTerm st = t /\ nextIndex st' = (assoc_set name_eq_dec (nextIndex st) h' (pred (getNextIndex st h'))))).