(* leA a' a for some a' in second arg *)
Inductive greater : A -> list A -> Prop :=
| Gr0 : forall a a' w, leA a' a -> greater a (a'::w)
| Gr1 : forall a a' w, greater a w -> greater a (a'::w).(* leA a' a for some a' in second arg *)
Inductive greater : A -> list A -> Prop :=
| Gr0 : forall a a' w, leA a' a -> greater a (a'::w)
| Gr1 : forall a a' w, greater a w -> greater a (a'::w).(* leA a' a for some a' in second arg *)
Inductive greater : A -> list A -> Prop :=
| Gr0 : forall a a' w, leA a' a -> greater a (a'::w)
| Gr1 : forall a a' w, greater a w -> greater a (a'::w).(* good sequence - leA a' a, a occurs in arg earlier than a' *)
Inductive good : list A -> Prop :=
| Gd0 : forall a w, greater a w -> good (a::w)
| Gd1 : forall a w, good w -> good (a::w).(* good sequence - leA a' a, a occurs in arg earlier than a' *)
Inductive good : list A -> Prop :=
| Gd0 : forall a w, greater a w -> good (a::w)
| Gd1 : forall a w, good w -> good (a::w).(* good sequence - leA a' a, a occurs in arg earlier than a' *)
Inductive good : list A -> Prop :=
| Gd0 : forall a w, greater a w -> good (a::w)
| Gd1 : forall a w, good w -> good (a::w).Definition bad (l : list A) : Prop := ~ good l.

(* Specifications: *)
Lemma greater_dec : forall a l, {greater a l} + {~ greater a l}.
Lemma good_dec : forall l, {good l} + {bad l}.