Ltac prove_in :=
    match goal with
      | [ _ : nwPackets ?net = _,
              _ : In (?p : packet) _ |- _] =>
        assert (In p (nwPackets net)) by (repeat find_rewrite; do_in_app; intuition)
      | [ _ : nwPackets ?net = _,
              _ : pBody ?p = _ |- _] =>
        assert (In p (nwPackets net)) by (repeat find_rewrite; intuition)
    end.Notation is_append_entries m :=
    (exists t n prevT prevI entries c,
       m = AppendEntries t n prevT prevI entries c).

Lemma leader_sublog_invariant_subset : forall net net', leader_sublog_invariant net -> (forall p, is_append_entries (pBody p) -> In p (nwPackets net') -> In p (nwPackets net)) -> (forall h, log (nwState net h) = log (nwState net' h)) -> (forall h, type (nwState net' h) = Leader -> type (nwState net h) = Leader /\ currentTerm (nwState net h) = currentTerm (nwState net' h)) -> leader_sublog_invariant net'.