Definition lexprodx {B A : Type} (f: A -> B) (R1: B -> B -> Prop)
  (R2: B -> A -> A -> Prop)
  (x y : A) : Prop :=
     R1 (f x) (f y) \/ f x = f y /\ R2 (f x) x y.

(* Specifications: *)
Lemma lexprodx_eq: forall B A f R1 R2 x y, lexprodx f R1 R2 x y <-> lexprod B (fun _ => A) R1 R2 (existT (fun _:B => A) (f x) x) (existT (fun _:B => A) (f y) y).
Lemma well_founded_lexprodx: forall B A (f: A -> B) R1 R2, well_founded R1 -> (forall n, well_founded (R2 n)) -> well_founded (lexprodx f R1 R2).