Proof using.
unfold raft_net_invariant_do_leader. unfold logs_sorted.
intuition; simpl in *.
- unfold logs_sorted_host in *. simpl in *. intros.
find_apply_lem_hyp doLeader_log.
repeat find_higher_order_rewrite. break_match; subst; try find_rewrite; eauto.
- unfold logs_sorted_nw. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map. subst. simpl in *.
find_eapply_lem_hyp doLeader_messages; intuition; eauto using sorted_subseq.
- unfold packets_gt_prevIndex. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map. subst. simpl in *.
find_eapply_lem_hyp doLeader_messages; [idtac|idtac|idtac|eauto];
intuition eauto.
- unfold packets_ge_prevTerm. intros. simpl in *.
find_apply_hyp_hyp. intuition eauto.
do_in_map. subst. simpl in *.
find_eapply_lem_hyp doLeader_messages; [idtac|idtac|idtac|eauto];
intuition eauto.
Qed.

Lemma doGenericServer_packets :
forall h st os st' ps,
doGenericServer h st = (os, st', ps) ->
ps = [].