(** * The sign function *)
Definition sign (x : R) :=
match total_order_T 0 x with
| inleft (left _) => 1
| inleft (right _) => 0
| inright _ => -1
end.

(* head, last, behead and belast *)
Lemma head_rcons {T : Type} (x0 : T) (s : seq T) (t : T) : head x0 (rcons s t) = head t s.