Proof using.
intros. unfold no_entries_past_current_term in *. intuition.
- unfold no_entries_past_current_term_host in *.
intros. simpl in *. find_higher_order_rewrite.
break_if; eauto. subst.
repeat find_rewrite. eapply le_trans; [|eauto].
eauto.
- unfold no_entries_past_current_term_nw.
intros. simpl in *.
find_apply_hyp_hyp. intuition.
+ intros.
match goal with
| _ : In ?p _ |- _ =>
assert (In p (nwPackets net)) by (find_rewrite; in_crush)
end.
eapply_prop no_entries_past_current_term_nw; eauto.
+ exfalso.
do_in_map. subst.
simpl in *.
find_apply_hyp_hyp. find_rewrite. repeat eexists; eauto.
Qed.

(* Specifications: *)
Lemma no_entries_past_current_term_unaffected_1 :
forall net st' ps' xs p ys d m,
nwPackets net = xs ++ p :: ys ->
no_entries_past_current_term net ->
(forall h : Net.name, st' h = update name_eq_dec (nwState net) (pDst p) d h) ->
(forall p' : packet,
In p' ps' ->
In p' (xs ++ ys) \/ p' = m) ->
currentTerm (nwState net (pDst p)) <= currentTerm d ->
log d = log (nwState net (pDst p)) ->
~ is_append_entries (pBody m) ->
no_entries_past_current_term {| nwPackets := ps'; nwState := st' |}.