Section Lexicographic_Product.
Variables A B : Type.
Variable ltA : A -> A -> Prop.
Variable ltB : B -> B -> Prop.
Hypothesis wf_ltA : well_founded ltA.
Hypothesis wf_ltB : well_founded ltB.
Inductive lexprod : A*B -> A*B -> Prop :=
| lex_l : forall a a' b b', ltA a a' -> lexprod (a, b) (a', b')
| lex_r : forall a    b b', ltB b b' -> lexprod (a, b) (a,  b').

Lemma cons_cons_last (A:Type) (a b:A) l x:
last (a::b::l) x = last (b::l) x.