Section Decomposition.
Context `{d : Decomposition}.
(* Fixpoint remove_one {A : Type} (A_eq_dec : forall x y : A, {x = y} + {x <> y}) a l := match l with | x :: xs => if A_eq_dec a x then xs else x :: remove_one A_eq_dec a xs | [] => [] end. *)
Definition packet_eq_dec :
forall p1 p2 : packet,
{p1 = p2} + {p1 <> p2}.
Proof using.
intros.
in_crush; destruct x; simpl in *; eauto.
Qed.
Proof using.
induction xs; intros; subst; simpl in *; intuition eauto; subst; eauto.
apply network_network_invariant_sym. eauto.
Qed.

Lemma distinct_pairs_and_app_cons :
forall A R xs p ys l,
l = (xs ++ p :: ys) ->
distinct_pairs_and (A:=A) R l ->
distinct_pairs_and R (xs ++ ys).