Section SF_fun.
Context {T : Type}.
Fixpoint SF_fun_aux (h : R*T) (s : seq (R*T)) (y0 : T) (x : R) :=
match s with
| [::] => match Rle_dec x (fst h) with
| left _ => snd h
| right _ => y0
end
| h0 :: s0 => match Rlt_dec x (fst h) with
| left _ => snd h
| right _ => SF_fun_aux h0 s0 y0 x
end
end.
Definition SF_fun (s : SF_seq) (y0 : T) (x : R) :=
SF_fun_aux (SF_h s,y0) (SF_t s) y0 x.
End SF_fun.

Lemma SF_fun_map {T T0 : Type} (f : T -> T0) (s : SF_seq) y0 :
forall x, SF_fun (SF_map f s) (f y0) x = f (SF_fun s y0 x).