Definition Riemann_fine (a b : R) :=
  within (fun ptd => pointed_subdiv ptd /\ SF_h ptd = Rmin a b /\ last (SF_h ptd) (SF_lx ptd) = Rmax a b)
    (locally_dist (fun ptd => seq_step (SF_lx ptd))).Global Instance Riemann_fine_filter :
  forall a b, ProperFilter (Riemann_fine a b).Definition Riemann_sum (f : R -> V) (ptd : SF_seq) : V :=
  foldr plus zero (pairmap (fun x y => (scal (fst y - fst x) (f (snd y)))) (SF_h ptd,zero) (SF_t ptd)).

Lemma Riemann_sum_Chasles_0 (f : R -> V) (M : R) (x : R) ptd : forall (eps : posreal), (forall x, SF_h ptd <= x <= last (SF_h ptd) (SF_lx ptd) -> norm (f x) < M) -> SF_h ptd <= x <= last (SF_h ptd) (SF_lx ptd) -> pointed_subdiv ptd -> seq_step (SF_lx ptd) < eps -> norm (minus (plus (Riemann_sum f (SF_cut_down ptd x)) (Riemann_sum f (SF_cut_up ptd x))) (Riemann_sum f ptd)) < 2 * eps * M.