Section CroniesCorrectProof.
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 {vci : votes_correct_interface}.
Context {cvfsi : candidates_vote_for_selves_interface}.
Proof using cvfsi rri.
intros.
eapply lift_prop; [exact candidates_vote_for_selves_invariant|eauto].
Qed.
Proof using.
intros.
unfold handleClientRequest in *; repeat break_match;
repeat find_inversion; subst; simpl in *; find_apply_hyp_hyp; intuition.
Qed.
Proof using.
intros.
unfold handleTimeout, tryToBecomeLeader in *; repeat break_match;
repeat find_inversion; subst; simpl in *; find_apply_hyp_hyp;
in_crush; congruence.
Qed.
Proof using.
intros.
unfold handleAppendEntries, advanceCurrentTerm in *; repeat break_match;
repeat find_inversion; subst; simpl in *; find_apply_hyp_hyp;
in_crush; congruence.
Qed.

Lemma handleAppendEntriesReply_rvr :
forall h s src ps ps' p d l tae es res t v,
handleAppendEntriesReply h s src tae es res = (d, l) ->
(forall p' : packet,
In p' ps ->
In p' ps' \/
In p' (send_packets h l)) ->
pBody p = RequestVoteReply t v ->
In p ps ->
In p ps'.