Section MatchIndexLeader.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {naertsi : no_append_entries_replies_to_self_interface}.
Proof using naertsi.
red. unfold match_index_leader in *. simpl in *. intros.
repeat find_higher_order_rewrite.
destruct_update; simpl in *; eauto.
find_eapply_lem_hyp handleAppendEntriesReply_matchIndex_leader_preserved; eauto.
erewrite handleAppendEntriesReply_log; eauto.
intuition.
find_apply_hyp_hyp.
find_higher_order_rewrite; auto.
find_apply_lem_hyp no_append_entries_replies_to_self_invariant.
unfold no_append_entries_replies_to_self in *.
intuition.
match goal with
| H : context [_ = _ -> False] |- _ => eapply H
end; eauto.
Qed.

Lemma match_index_leader_client_request :
raft_net_invariant_client_request match_index_leader.