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.
Proof using.
induction xs; intros; subst; simpl in *; intuition eauto.
Qed.

Lemma distinct_pairs_and_app :
forall A R l1 l2,
distinct_pairs_and (A := A) R l1 ->
distinct_pairs_and R l2 ->
(forall x y,
In x l1 ->
In y l2 ->
R x y) ->
distinct_pairs_and R (l1 ++ l2).