Section NoAppendEntriesToSelf.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Proof using.
intros.
unfold doLeader in *.
repeat break_match; try solve [find_inversion; simpl in *; congruence].
find_inversion.
do_in_map.
subst. simpl in *.
find_apply_lem_hyp filter_In.
intuition. subst.
break_match; congruence.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map.
subst. simpl in *.
find_eapply_lem_hyp doLeader_no_messages_to_self; eauto.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map.
subst. simpl in *.
find_eapply_lem_hyp doGenericServer_packets. subst. simpl in *. intuition.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
subst. simpl in *. subst.
find_apply_lem_hyp handleAppendEntries_not_append_entries.
intuition. find_false. repeat eexists; eauto.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map. subst. simpl in *.
find_apply_lem_hyp handleAppendEntriesReply_packets.
subst. intuition.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
subst. simpl in *. subst.
find_apply_lem_hyp handleRequestVote_no_append_entries.
intuition. find_false. repeat eexists; eauto.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map. subst. simpl in *.
find_eapply_lem_hyp handleClientRequest_no_append_entries; eauto.
intuition. find_false. repeat eexists; eauto.
Qed.
Proof using.
red. red. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map. subst. simpl in *.
find_eapply_lem_hyp handleTimeout_not_is_append_entries; eauto.
intuition. find_false. repeat eexists; eauto.
Qed.

Lemma no_append_entries_to_self_state_same_packet_subset :
raft_net_invariant_state_same_packet_subset no_append_entries_to_self.