(** ** SF_sorted *)
Definition SF_sorted (Ord : R -> R -> Prop) (s : SF_seq) :=
sorted Ord (SF_lx s).
End SF_seq.
(** ** SF_map *)
Section SF_map.
Context {T T0 : Type}.
Definition SF_map  (f : T -> T0) (s : SF_seq) : SF_seq :=
mkSF_seq (SF_h s) (map (fun x => (fst x,f (snd x))) (SF_t s)).

Lemma SF_map_rcons (f : T -> T0) (s : SF_seq) (h : R*T) :
SF_map f (SF_rcons s h) = SF_rcons (SF_map f s) (fst h, f (snd h)).