Proof using cci vci ollpti llcei lltsi llli.
red. unfold leaderLogs_preserved. intros. simpl in *.
repeat find_higher_order_rewrite.
destruct_update; simpl in *; eauto;
repeat find_apply_lem_hyp update_elections_data_requestVoteReply_leaderLogs';
intuition; subst; eauto.
- exfalso.
match goal with
| H : In _ ?ll, _ : In (_, ?ll) _ |- _ =>
eapply leaderLogs_term_sanity_invariant in H
end; eauto.
find_eapply_lem_hyp leaderLogs_currentTerm_invariant; eauto.
repeat find_rewrite.
repeat (unfold raft_data in *; simpl in *).
omega.
- find_apply_lem_hyp logs_leaderLogs_invariant; auto.
break_exists. intuition.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
find_eapply_lem_hyp app_in_2; eauto using removeAfterIndex_in.
- find_apply_lem_hyp logs_leaderLogs_invariant; auto.
break_exists. intuition.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
find_eapply_lem_hyp app_in_2; eauto using removeAfterIndex_in.
- match goal with
| H : In _ ?ll, _ : In (_, ?ll) _ |- _ =>
eapply leaderLogs_candidate_entries_invariant in H
end; eauto.
find_eapply_lem_hyp wonElection_candidateEntries_rvr;
repeat find_rewrite; eauto using votes_correct_invariant, cronies_correct_invariant.
intuition.
Qed.

Lemma leaderLogs_preserved_append_entries :
refined_raft_net_invariant_append_entries leaderLogs_preserved.