Proof using.
red. unfold CandidateEntries. intros. intuition.
- unfold candidateEntries_host_invariant in *.
intros. simpl in *. eapply candidateEntries_ext; eauto.
repeat find_higher_order_rewrite.
find_rewrite_lem update_fun_comm. simpl in *.
update_destruct.
+ subst. rewrite_update.
unfold candidateEntries in *.
find_apply_lem_hyp handleAppendEntriesReply_spec. break_and.
repeat find_rewrite.
find_apply_hyp_hyp.
break_exists; exists x; eauto.
update_destruct; intuition; subst; rewrite_update; simpl in *; auto;
repeat find_rewrite; intuition; congruence.
+ rewrite_update. find_apply_hyp_hyp.
eauto using handleAppendEntriesReply_preserves_candidate_entries.
- unfold candidateEntries_nw_invariant in *. intros. simpl in *.
find_apply_hyp_hyp. intuition.
+ (* packet already in nw *)
prove_in.
eapply candidateEntries_ext; eauto.
find_eapply_lem_hyp handleAppendEntriesReply_preserves_candidate_entries; eauto.
subst. auto.
+ exfalso.
do_in_map.
find_eapply_lem_hyp handleAppendEntriesReply_spec; eauto.
subst. simpl in *. find_rewrite.
match goal with
| H : ~ is_append_entries _ |- _ => apply H
end.
repeat eexists; eauto.
Qed.

Lemma update_elections_data_requestVote_cronies_same :
forall h h' t lli llt st,
cronies (update_elections_data_requestVote h h' t h' lli llt st) =
cronies (fst st).