Section NextIndexSafety.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {aersi : append_entries_reply_sublog_interface}.
Context {si : sorted_interface}.
Proof using.
unfold raft_net_invariant_init, nextIndex_safety.
intros.
discriminate.
Qed.
Definition nextIndex_preserved st st' :=
(type st' = Leader ->
type st = Leader /\
maxIndex (log st) <= maxIndex (log st') /\
nextIndex st' = nextIndex st).

Lemma nextIndex_safety_preserved :
forall st st',
(forall h',
type st = Leader ->
Nat.pred (getNextIndex st h') <= maxIndex (log st)) ->
nextIndex_preserved st st' ->
(forall h',
type st' = Leader ->
Nat.pred (getNextIndex st' h') <= maxIndex (log st')).