Section Stability.
Variable leT' : rel T.
Hypothesis (leT_total : total leT) (leT'_tr : transitive leT').
Let leT_lex := [rel x y | leT x y && (leT y x ==> leT' x y)].

Lemma merge_stable_sorted s1 s2 :
allrel leT' s1 s2 -> sorted leT_lex s1 -> sorted leT_lex s2 ->
sorted leT_lex (merge s1 s2).