Inductive rel_map(A B : Type)(r : A -> B -> Prop) : list A -> list B -> Prop :=
| rm_nil : 
  rel_map r nil nil
| rm_step : 
  forall lsa lsb a b,
    rel_map r lsa lsb ->
    r a b ->
    rel_map r (a :: lsa) (b :: lsb).Inductive rel_map(A B : Type)(r : A -> B -> Prop) : list A -> list B -> Prop :=
| rm_nil : 
  rel_map r nil nil
| rm_step : 
  forall lsa lsb a b,
    rel_map r lsa lsb ->
    r a b ->
    rel_map r (a :: lsa) (b :: lsb).Inductive rel_map(A B : Type)(r : A -> B -> Prop) : list A -> list B -> Prop :=
| rm_nil : 
  rel_map r nil nil
| rm_step : 
  forall lsa lsb a b,
    rel_map r lsa lsb ->
    r a b ->
    rel_map r (a :: lsa) (b :: lsb).

Lemma rel_map_permutation : forall (A B : Type) lsa1 lsa2, Permutation lsa1 lsa2 -> forall (rel : A -> B -> Prop), (forall a b1 b2, rel a b1 -> rel a b2 -> b1 = b2) -> (forall a, exists b, rel a b) -> forall lsb1 lsb2, rel_map rel lsa1 lsb1 -> rel_map rel lsa2 lsb2 -> Permutation lsb1 lsb2.