Proof using vci cci llcei lltsi lsi rri.
unfold refined_raft_net_invariant_request_vote_reply, leaderLogs_sublog.
simpl. intuition.
repeat find_higher_order_rewrite.
find_copy_apply_lem_hyp handleRequestVoteReply_RVR_spec.
intuition.
- subst. repeat find_rewrite.
repeat update_destruct_max_simplify; eauto;
find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto; intuition eauto;
unfold raft_data in *; congruence.
- repeat update_destruct_max_simplify; try congruence.
+ find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto; intuition eauto.
subst_max. repeat find_rewrite. discriminate.
+ eauto.
- repeat update_destruct_max_simplify.
+ repeat find_rewrite.
find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto; intuition.
* exfalso. eauto using contradict_leaderLogs_term_sanity.
* subst. unfold raft_data in *. repeat find_rewrite. auto.
+ repeat find_rewrite.
exfalso.
eapply leaderLogs_candidate_entries_rvr; eauto;
eauto using leaderLogs_candidate_entries_invariant,
votes_correct_invariant,
cronies_correct_invariant.
congruence.
+ find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto; intuition.
* eauto.
* subst. unfold raft_data in *. repeat find_rewrite.
eapply lifted_leader_sublog_host; eauto.
+ eauto.
- repeat update_destruct_max_simplify.
+ find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto; intuition.
* repeat find_rewrite. eauto.
* subst. unfold raft_data in *. repeat find_rewrite. auto.
+ repeat find_rewrite. eauto.
+ find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto; intuition.
* repeat find_rewrite. eauto.
* subst. unfold raft_data in *. repeat find_rewrite. discriminate.
+ eauto.
Qed.

Theorem leaderLogs_sublog_do_leader :
refined_raft_net_invariant_do_leader leaderLogs_sublog.