Definition NegRel (A : Set) (R : Rel A) (x y : A) := ~ R x y.Definition ProdRel (A B : Set) (R : Rel A) (S : Rel B) 
  (x y : A * B) := R (fst x) (fst y) /\ S (snd x) (snd y).Definition leq (a b : A) := ~ lt b a.Definition GBarlR := GRBar (A * B) (ProdRel A B leq R).Definition sndL := map (fun p : A * B => snd p).Definition MinD :=
  Min (A * B) (fun p q : A * B => lt (fst p) (fst q)) (ProdRel A B leq R).Definition prod_lt (a b : A * B) := lt (fst a) (fst b).

(* Specifications: *)
Lemma WFlem1 : well_founded prod_lt.
Lemma lem0 : forall (l : list (A * B)) (a : A * B), ExistsL B (fun x : B => R x (snd a)) (sndL l) -> MinD l -> GBarlR (a :: l).
Lemma lem1aux : forall l : list B, GoodR B R l -> forall us : list (A * B), l = sndL us -> MinD us -> GBarlR us.
Lemma lem1 : forall us : list (A * B), GoodR B R (sndL us) -> MinD us -> GBarlR us.
Lemma keylem : forall bs : list B, GRBar B R bs -> forall us : list (A * B), bs = sndL us -> MinD us -> GBarlR us.
Lemma keylem_cor : WR (A * B) (ProdRel A B leq R).
Lemma leq2le : forall a b : nat, leq nat lt a b -> a <= b.