Definition SF_sup_fun (f : R -> R) (a b : R) (n : nat) (x : R) : Rbar :=
match (Rle_dec a b) with
| left _ => SF_fun (SF_sup_seq f a b n) (Finite 0) x
| right _ => SF_fun (SF_sup_seq f b a n) (Finite 0) x
end.
Definition SF_inf_fun (f : R -> R) (a b : R) (n : nat) (x : R) : Rbar :=
match (Rle_dec a b) with
| left _ => SF_fun (SF_inf_seq f a b n) (Finite 0) x
| right _ => SF_fun (SF_inf_seq f b a n) (Finite 0) x
end.

Lemma SF_inf_fun_rw (f : R -> R) (a b : R) (n : nat) (x : R) (Hx : a <= x <= b) :
SF_inf_fun f a b n x =
match (unif_part_nat a b n x Hx) with
| inleft H => Inf_fct f (nth 0 (unif_part a b n) (proj1_sig H))
(nth 0 (unif_part a b n) (S (proj1_sig H)))
| inright _ => Inf_fct f (nth 0 (unif_part a b n) (n))
(nth 0 (unif_part a b n) (S n))
end.