Proof using llsli si llsi lltsi rri.
unfold refined_raft_net_invariant_client_request, leaderLogs_entries_match.
intros.
split.
- { unfold leaderLogs_entries_match_host.
simpl. intuition. subst. repeat find_higher_order_rewrite.
repeat update_destruct_simplify.
- find_rewrite_lem update_elections_data_client_request_leaderLogs.
destruct (log d) using (handleClientRequest_log_ind ltac:(eauto)).
+ eauto.
+ destruct ll.
* apply entries_match_nil.
* { apply entries_match_cons_gt_maxTerm; eauto.
- eauto using lifted_logs_sorted_host.
- eapply leaderLogs_sorted_invariant; eauto.
- omega.
- find_copy_apply_lem_hyp leaderLogs_currentTerm_invariant; auto.
find_copy_apply_lem_hyp leaderLogs_term_sanity_invariant.
unfold leaderLogs_term_sanity in *.
eapply_prop_hyp In In; simpl; eauto. repeat find_rewrite.
simpl in *. omega.
}
- destruct (log d) using (handleClientRequest_log_ind ltac:(eauto)).
+ eauto.
+ apply entries_match_cons_sublog; eauto.
* eauto using lifted_logs_sorted_host.
* eapply leaderLogs_sorted_invariant; eauto.
* omega.
* intros.
eapply leaderLogs_sublog_invariant; eauto.
simpl in *. congruence.
- find_rewrite_lem update_elections_data_client_request_leaderLogs.
eauto.
- eauto.
}
- eapply leaderLogs_entries_match_nw_packet_set with (net:=net); intuition.
+ find_apply_hyp_hyp. intuition eauto.
erewrite handleClientRequest_no_send with (ms := l) in * by eauto.
simpl in *. intuition.
+ simpl. subst. find_higher_order_rewrite.
rewrite update_fun_comm. simpl.
rewrite update_fun_comm. simpl.
rewrite update_elections_data_client_request_leaderLogs.
now rewrite update_nop_ext' by auto.
Qed.

Lemma leaderLogs_entries_match_timeout :
refined_raft_net_invariant_timeout leaderLogs_entries_match.