Section LeaderLogsSorted.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {rri : raft_refinement_interface}.
Context {si : sorted_interface}.
Proof using.
unfold refined_raft_net_invariant_init, leaderLogs_sorted.
intros. subst. simpl in *. intuition.
Qed.
Proof using.
unfold update_elections_data_client_request.
intros.
repeat break_match; auto.
Qed.
Proof using.
unfold refined_raft_net_invariant_client_request, leaderLogs_sorted.
intros. subst. simpl in *. find_higher_order_rewrite.
update_destruct_simplify; simpl in *.
- rewrite leaderLogs_update_elections_data_client_request in *.
eauto.
- eauto.
Qed.
Proof using si rri.
intros.
pose proof (lift_prop _ logs_sorted_invariant).
find_insterU. conclude_using eauto.
unfold logs_sorted, logs_sorted_host in *. break_and.
unfold deghost in *. simpl in *. break_match. eauto.
Qed.
Proof using.
unfold update_elections_data_timeout.
intros.
repeat break_match; simpl in *; auto.
Qed.
Proof using.
unfold refined_raft_net_invariant_timeout, leaderLogs_sorted.
intros. subst. simpl in *. find_higher_order_rewrite.
update_destruct_simplify; simpl in *;
try rewrite leaderLogs_update_elections_data_timeout in *;
eauto.
Qed.
Proof using.
unfold update_elections_data_appendEntries.
intros.
repeat break_match; subst; auto.
Qed.
Proof using.
unfold refined_raft_net_invariant_append_entries, leaderLogs_sorted.
intros. subst. simpl in *. find_higher_order_rewrite.
update_destruct_simplify; simpl in *.
- rewrite leaderLogs_update_elections_data_AE in *.
eauto.
- eauto.
Qed.
Proof using.
unfold refined_raft_net_invariant_append_entries_reply, leaderLogs_sorted.
intros. subst. simpl in *. find_higher_order_rewrite.
update_destruct_simplify; simpl in *; eauto.
Qed.
Proof using.
unfold refined_raft_net_invariant_request_vote, leaderLogs_sorted.
intros.
subst. simpl in *. find_higher_order_rewrite.
update_destruct_simplify.
- unfold update_elections_data_requestVote in *.
repeat break_match; simpl in *; intuition; repeat find_inversion; eauto.
- eauto.
Qed.
Proof using.
unfold update_elections_data_requestVoteReply.
intros.
repeat break_match; simpl in *; eauto.
repeat find_rewrite.
match goal with
| H : handleRequestVoteReply _ _ _ _ _ = _ |- _ =>
symmetry in H
end.
find_apply_lem_hyp handleRequestVoteReply_spec.
intuition; repeat find_rewrite; auto.
Qed.

Lemma leaderLogs_sorted_request_vote_reply :
refined_raft_net_invariant_request_vote_reply leaderLogs_sorted.