Section AllEntriesLogMatching.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {rri : raft_refinement_interface}.
Context {aelsi : allEntries_leader_sublog_interface}.
Context {lsi : leader_sublog_interface}.
Context {rlmli : refined_log_matching_lemmas_interface}.
Definition allEntries_log_matching_nw net :=
forall (e e' : entry) (h : name) (p : packet)
t leaderId prevLogIndex prevLogTerm entries leaderCommit,
In p (nwPackets net) ->
pBody p = AppendEntries t leaderId prevLogIndex prevLogTerm entries leaderCommit ->
In e entries ->
In e' (map snd (allEntries (fst (nwState net h)))) ->
eTerm e = eTerm e' -> eIndex e = eIndex e' -> e = e'.
Definition allEntries_log_matching_inductive net :=
allEntries_log_matching net /\ allEntries_log_matching_nw net.
Ltac start :=
red; unfold allEntries_log_matching_inductive; simpl; intros.
Ltac start_update :=
start; intuition; [unfold allEntries_log_matching in *|unfold allEntries_log_matching_nw in *];
intros; repeat find_higher_order_rewrite; repeat (update_destruct; rewrite_update); subst; simpl; eauto.

Lemma allEntries_log_matching_init :
refined_raft_net_invariant_init allEntries_log_matching_inductive.