Proof using.
unfold candidateEntries.
intros. break_exists. break_and.
exists x.
split.
- rewrite update_fun_comm. simpl.
rewrite update_fun_comm. simpl.
update_destruct; subst; rewrite_update; auto.
- intros. update_destruct; subst; rewrite_update; auto.
simpl in *.
find_apply_lem_hyp handleAppendEntriesReply_spec.
intuition; repeat find_rewrite; intuition.
congruence.
Qed.
Ltac prove_in :=
match goal with
| [ _ : nwPackets ?net = _,
_ : In (?p : packet) _ |- _] =>
assert (In p (nwPackets net)) by (repeat find_rewrite; do_in_app; intuition)
| [ _ : nwPackets ?net = _,
_ : pBody ?p = _ |- _] =>
assert (In p (nwPackets net)) by (repeat find_rewrite; intuition)
end.

(* Specifications: *)
Lemma candidate_entries_append_entries_reply :
refined_raft_net_invariant_append_entries_reply CandidateEntries.