Definition no_append_entries_to_leader' (net : network) : Prop :=
    forall p t n pli plt es ci,
      In p (nwPackets net) ->
      pBody p = AppendEntries t n pli plt es ci ->
      type (snd (nwState net (pDst p))) = Leader ->
      currentTerm (snd (nwState net (pDst p))) = t ->
      False.Definition no_append_entries_to_self' (net : network) : Prop :=
    forall p t n pli plt es ci,
      In p (nwPackets net) ->
      pBody p = AppendEntries t n pli plt es ci ->
      pDst p = pSrc p ->
      False.

(* Specifications: *)
Theorem lift_no_append_entries_to_self : forall net, refined_raft_intermediate_reachable net -> no_append_entries_to_self (deghost net).
Lemma ghost_packet : forall (net : network (params := raft_refined_multi_params)) p, In p (nwPackets net) -> In (deghost_packet p) (nwPackets (deghost net)).
Theorem no_append_entries_to_self'_invariant : forall net, refined_raft_intermediate_reachable net -> no_append_entries_to_self' net.
Lemma no_append_entries_to_leader_invariant' : forall net, refined_raft_intermediate_reachable net -> no_append_entries_to_leader' net.
Lemma deghost_packet_exists : forall net p, In p (nwPackets (deghost net)) -> exists (q : packet (params := raft_refined_multi_params (raft_params := raft_params))), In q (nwPackets net) /\ p = deghost_packet q.