Definition triple0 A B C (t: A * B * C): A := fst (fst t).Definition triple1 A B C (t: A * B * C): B := snd (fst t).Definition triple2 A B C (t: A * B * C): C := snd t.Fixpoint rsplits T (l: list T): list (list T * T * list T) :=
  match l with
  | nil => nil
  | h :: t => (nil, h, t) :: map (fun p => (h :: triple0 p, triple1 p, triple2 p)) (rsplits t)
  end.

Lemma elemsR_map': forall (A B: Type) (Ra: relation A) (Rb: relation B) (f : A -> B) (fR: forall x y, Ra x y -> Rb (f x) (f y)) (l l': list A), elemsR Ra l l' -> elemsR Rb (map f l) (map f l').