Definition swapped {A} (m1 m2 : A -> map) i j a b c d :=
  m1 i = a /\
  m1 j = b /\
  m2 i = c /\
  m2 j = d /\
  forall k, k <> i -> k <> j -> m1 k = m2 k.

(* Specifications: *)
Lemma selfjoins_swapped {A} {m1 m2 : A -> map} (Adec:forall x y:A,{x=y}+{x<>y}) i j (J:selfjoins m1) e a b c d : swapped m1 m2 i j a b c d -> join a b e -> join c d e -> selfjoins m2.
Lemma selfjoins_swapped {A} {m1 m2 : A -> map} (Adec:forall x y:A,{x=y}+{x<>y}) i j (J:selfjoins m1) e a b c d : swapped m1 m2 i j a b c d -> join a b e -> join c d e -> selfjoins m2.
Lemma natnateqdec (x y : nat + nat) : {x=y}+{x<>y}.
Lemma selfjoins_swapped {A} {m1 m2 : A -> map} (Adec:forall x y:A,{x=y}+{x<>y}) i j (J:selfjoins m1) e a b c d : swapped m1 m2 i j a b c d -> join a b e -> join c d e -> selfjoins m2.