Inductive elemsR A B (R: A -> B -> Prop): list A -> list B -> Prop :=
  | eR_nil: elemsR R nil nil
  | eR_cons (a: A) (b: B): R a b -> forall l l', elemsR R l l' -> elemsR R (a :: l) (b :: l').Inductive elemsR A B (R: A -> B -> Prop): list A -> list B -> Prop :=
  | eR_nil: elemsR R nil nil
  | eR_cons (a: A) (b: B): R a b -> forall l l', elemsR R l l' -> elemsR R (a :: l) (b :: l').Inductive elemsR A B (R: A -> B -> Prop): list A -> list B -> Prop :=
  | eR_nil: elemsR R nil nil
  | eR_cons (a: A) (b: B): R a b -> forall l l', elemsR R l l' -> elemsR R (a :: l) (b :: l').Instance elemsR_trans A `{R: relation A} {TR: Transitive R}: Transitive (elemsR R).

Lemma elemsR_map A (R: relation A) f l: (forall x, In x l -> R (f x) x) -> elemsR R (map f l) l.