Section SortedProof.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {tsi : term_sanity_interface}.
Proof using.
unfold raft_net_invariant_init, logs_sorted,
logs_sorted_host, logs_sorted_nw, packets_gt_prevIndex, packets_ge_prevTerm in *.
intuition; simpl in *; intuition.
Qed.
Proof using.
intros. find_apply_lem_hyp handleClientRequest_log. intuition.
Qed.

Theorem logs_sorted_nw_packets_unchanged :
forall net ps' st',
logs_sorted_nw net ->
(forall p, In p ps' -> In p (nwPackets net) \/ False) ->
logs_sorted_nw (mkNetwork ps' st').