proposition: Lemma trans_lex : transitive lex.
proof: Proof. move=>[x1 x2][y1 y2][z1 z2]; rewrite /lex /=. case: ifP=>H1; first by rewrite (eqP H1); case: eqP=>// _; apply: trans. case: ifP=>H2; first by rewrite (eqP H2) in H1 *; rewrite H1. case: ifP=>H3; last by apply: trans. by rewrite (eqP H3)=>R1; move/(nsym R1). Qed.
imports: Coq(ssreflect ssrbool ssrfun) mathcomp(ssrnat eqtype seq path fintype) pcm(options)