Proof using.
induction l; intros; simpl in *; intuition.
- subst_max. intuition.
- subst. find_apply_hyp_hyp. intuition.
- subst. find_apply_hyp_hyp. intuition.
Qed.

Lemma handleAppendEntries_logs_sorted :
forall net p t n pli plt es ci st' m,
raft_intermediate_reachable net ->
logs_sorted net ->
handleAppendEntries (pDst p) (nwState net (pDst p)) t n pli plt es ci =
(st', m) ->
pBody p = AppendEntries t n pli plt es ci ->
In p (nwPackets net) ->
sorted (log st').