(*  The order on the lists is not lexicographic! It's Every element is smaller or equal. ALSO : surprisingly, we don't need transitivity.  *)
Inductive list_ord {A} (ord: A -> A -> Prop): list A -> list A -> Prop:=
| lt_head: forall x y ls, ord x y -> list_ord ord (x::ls) (y::ls)
| lt_tail: forall x ls ls', list_ord ord ls ls' ->
list_ord ord (x::ls) (x::ls').
Inductive list_ord_part {A}
(list_ord: list A -> list A -> Prop)
(ord: A -> A -> Prop): list A -> list A -> Prop:=
| lt_head_part: forall x y ls, ord x y ->
list_ord_part list_ord ord (x::ls) (y::ls)
| lt_tail_part: forall x ls ls', list_ord ls ls' ->
list_ord_part list_ord ord (x::ls) (x::ls').
Inductive list_ord_trans {A} (ord: A -> A -> Prop): list A -> list A -> Prop:=
| lt_head_trans: forall x y ls, ord x y -> list_ord_trans ord (x::ls) (y::ls)
| lt_tail_trans: forall x ls ls', list_ord_trans ord ls ls' ->
list_ord_trans ord (x::ls) (x::ls')
| lt_all: forall x y ls ls', ord x y ->
list_ord_trans ord ls ls' ->
list_ord_trans ord (x::ls) (y::ls').
Instance list_ord_is_trans {A} (ord: relation A):
Transitive ord -> Transitive (list_ord_trans ord).
Definition trans_symprod {A B} ltA ltB : relation (A * B):=
Relation_Operators.clos_trans _ (@Relation_Operators.symprod A B ltA ltB).

Lemma list_order_trans_as_pair:
forall {A} ord (a b:A) lsa lsb,
Transitive ord ->
list_ord_trans ord (a::lsa) (b::lsb) <->
trans_symprod ord (list_ord_trans ord) (a,lsa) (b,lsb).