Inductive Bar (A : Set) (P : list A -> Set) : list A -> Set :=
  | Base : forall l : list A, P l -> Bar A P l
  | Ind : forall l : list A, (forall a : A, Bar A P (a :: l)) -> Bar A P l.Inductive Bar (A : Set) (P : list A -> Set) : list A -> Set :=
  | Base : forall l : list A, P l -> Bar A P l
  | Ind : forall l : list A, (forall a : A, Bar A P (a :: l)) -> Bar A P l.Inductive Bar (A : Set) (P : list A -> Set) : list A -> Set :=
  | Base : forall l : list A, P l -> Bar A P l
  | Ind : forall l : list A, (forall a : A, Bar A P (a :: l)) -> Bar A P l.Definition GRBar (A : Set) (R : Rel A) := Bar A (GoodR A R).Definition WR (A : Set) (R : Rel A) := GRBar A R nil.

(* Specifications: *)
Lemma subRelGRBar : forall (A B : Set) (R : Rel A) (S : Rel B) (f : A -> B), (forall a b : A, R a b -> S (f a) (f b)) -> (forall b : B, {a : A | b = f a}) -> forall l : list A, GRBar A R l -> GRBar B S (map f l).
Lemma consGRBar : forall (A : Set) (R : Rel A) (l : list A), GRBar A R l -> forall a : A, GRBar A R (a :: l).
Lemma nilGRBar : forall (A : Set) (R : Rel A), GRBar A R nil -> forall l : list A, GRBar A R l.
Lemma monGRBarAux : forall (A : Set) (R : Rel A) (l : list A), GRBar A R l -> forall xs bs cs : list A, l = xs ++ cs -> GRBar A R (xs ++ bs ++ cs).
Lemma monGRBar : forall (A : Set) (R : Rel A) (xs bs cs : list A), GRBar A R (xs ++ cs) -> GRBar A R (xs ++ bs ++ cs).