Section VotesWithLogSorted.
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, votesWithLog_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, votesWithLog_sorted.
intros. subst. simpl in *. find_higher_order_rewrite.
update_destruct_simplify; simpl in *.
- rewrite votesWithLog_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.

Lemma votesWithLog_update_elections_data_timeout :
forall {h st out st' l},
handleTimeout h (snd st) = (out, st', l) ->
forall (P : list (term * name * list entry) -> Prop),
(forall t cid, P ((t, cid, log st') :: votesWithLog (fst st))) ->
(P (votesWithLog (fst st))) ->
(P (votesWithLog (update_elections_data_timeout h st))).