Proof using.
red. unfold requestVoteReply_term_sanity. intros. simpl in *.
assert (In p (nwPackets net)) by
(find_apply_hyp_hyp; intuition;
do_in_map; subst;
unfold doLeader, replicaMessage in *;
repeat break_match; find_inversion; subst; simpl in *; intuition;
do_in_map; subst; simpl in *; congruence).
match goal with
| H : nwState ?net ?h = (?gd, ?d) |- _ =>
replace gd with (fst (nwState net h)) in * by (rewrite H; reflexivity);
replace d with (snd (nwState net h)) in * by (rewrite H; reflexivity);
clear H
end.
subst. repeat find_higher_order_rewrite.
destruct_update; simpl in *; eauto;
find_apply_lem_hyp doLeader_term_votedFor; intuition; repeat find_rewrite; eauto.
Qed.

Lemma requestVoteReply_term_sanity_do_generic_server :
refined_raft_net_invariant_do_generic_server requestVoteReply_term_sanity.