Definition SF_compat_le (s : @SF_seq R) (pr : SF_sorted Rle s) :
  StepFun (head 0 (SF_lx s)) (last 0 (SF_lx s)).

(* Specifications: *)
Lemma Riemann_sum_compat f (s : SF_seq) (pr : SF_sorted Rle s) : Riemann_sum f s = RiemannInt_SF (SF_compat_le (SF_map f s) (SF_map_sort f s _ pr)).
Lemma ad_SF_val_fun (f : R -> R) (a b : R) (n : nat) : ((a <= b) -> adapted_couple (SF_val_fun f a b n) a b (seq2Rlist (unif_part a b n)) (seq2Rlist (SF_val_ly f a b n))) /\ (~(a <= b) -> adapted_couple (SF_val_fun f b a n) a b (seq2Rlist (unif_part b a n)) (seq2Rlist (SF_val_ly f b a n))).