Section ext_C1.
Context {V : NormedModule R_AbsRing}.
Definition extension_C1 (f df : R -> V) (a b : Rbar) (x : R) : V :=
match Rbar_le_dec a x with
| left _ => match Rbar_le_dec x b with
| left _ => f x
| right _ => plus (f (real b)) (scal (x - real b) (df (real b)))
end
| right _ => plus (f (real a)) (scal (x - real a) (df (real a)))
end.
End ext_C1.

Lemma extension_C1_ex_derive (f df : R -> R) (a b : Rbar) :
Rbar_le a b
-> (forall x : R, Rbar_le a x -> Rbar_le x b -> ex_derive f x)
-> forall x : R, ex_derive (extension_C1 f (Derive f) a b) x.