Proof using cci vci aecei.
red. unfold allEntries_leader_sublog. intros. simpl in *.
subst. repeat find_higher_order_rewrite.
match goal with
| |- context [handleRequestVoteReply ?h ?st ?h' ?t ?v] =>
pose proof handleRequestVoteReply_spec h st h' t v
(handleRequestVoteReply h st h' t v)
end.
destruct_update; simpl in *; eauto;
do_in_map; subst;
destruct x; simpl in *;
try find_rewrite_lem update_elections_data_requestVoteReply_allEntries;
intuition; repeat find_rewrite; eauto; try congruence.
- match goal with
| _ : context [type ?st = Leader -> False] |- _ =>
destruct (serverType_eq_dec (type st) Leader)
end; eauto.
+ match goal with
| _ : context [handleRequestVoteReply ?h ?st ?h' ?t ?v] |- _ =>
pose proof handleRequestVoteReply_type h st h' t v
(handleRequestVoteReply h st h' t v)
end.
intuition; repeat find_rewrite; try congruence.
eauto.
+ intuition.
find_copy_apply_lem_hyp allEntries_candidateEntries_invariant; auto.
match goal with
| _ : context [handleRequestVoteReply ?h ?st ?h' ?t ?v] |- _ =>
pose proof handleRequestVoteReply_RVR_spec h st h' t v
(handleRequestVoteReply h st h' t v)
end. intuition; repeat find_rewrite; try congruence.
subst.
find_eapply_lem_hyp wonElection_candidateEntries_rvr;
eauto using votes_correct_invariant, cronies_correct_invariant.
unfold ghost_data in *. simpl in *.
unfold raft_refined_base_params, raft_refined_multi_params in *.
congruence.
- match goal with
| _ : context [type ?st = Leader -> False] |- _ =>
destruct (serverType_eq_dec (type st) Leader)
end; eauto.
+ match goal with
| _ : context [handleRequestVoteReply ?h ?st ?h' ?t ?v] |- _ =>
pose proof handleRequestVoteReply_type h st h' t v
(handleRequestVoteReply h st h' t v)
end.
intuition; repeat find_rewrite; try congruence.
eauto.
+ intuition.
find_copy_apply_lem_hyp allEntries_candidateEntries_invariant; auto.
match goal with
| _ : context [handleRequestVoteReply ?h ?st ?h' ?t ?v] |- _ =>
pose proof handleRequestVoteReply_RVR_spec h st h' t v
(handleRequestVoteReply h st h' t v)
end. intuition; repeat find_rewrite; try congruence.
subst.
find_eapply_lem_hyp wonElection_candidateEntries_rvr;
eauto using votes_correct_invariant, cronies_correct_invariant.
unfold ghost_data in *. simpl in *.
unfold raft_refined_base_params, raft_refined_multi_params in *.
congruence.
Qed.

Lemma allEntries_leader_sublog_timeout :
refined_raft_net_invariant_timeout allEntries_leader_sublog.