let f be PartFunc of REAL,REAL; :: thesis: for I being Interval
for x being Real st f | I is_right_differentiable_in x holds
( f is_right_differentiable_in x & Rdiff ((f | I),x) = Rdiff (f,x) )

let I be Interval; :: thesis: for x being Real st f | I is_right_differentiable_in x holds
( f is_right_differentiable_in x & Rdiff ((f | I),x) = Rdiff (f,x) )

let x be Real; :: thesis: ( f | I is_right_differentiable_in x implies ( f is_right_differentiable_in x & Rdiff ((f | I),x) = Rdiff (f,x) ) )
assume A1: f | I is_right_differentiable_in x ; :: thesis: ( f is_right_differentiable_in x & Rdiff ((f | I),x) = Rdiff (f,x) )
then consider r being Real such that
A2: ( r > 0 & [.x,(x + r).] c= dom (f | I) ) by FDIFF_3:def 3;
A3: dom (f | I) c= dom f by RELAT_1:60;
then A4: [.x,(x + r).] c= dom f by A2;
for h being non-zero 0 -convergent Real_Sequence
for c being constant Real_Sequence st rng c = {x} & rng (h + c) c= dom f & ( for n being Nat holds h . n > 0 ) holds
( (h ") (#) ((f /* (h + c)) - (f /* c)) is convergent & lim ((h ") (#) ((f /* (h + c)) - (f /* c))) = Rdiff ((f | I),x) )
proof
let h be non-zero 0 -convergent Real_Sequence; :: thesis: for c being constant Real_Sequence st rng c = {x} & rng (h + c) c= dom f & ( for n being Nat holds h . n > 0 ) holds
( (h ") (#) ((f /* (h + c)) - (f /* c)) is convergent & lim ((h ") (#) ((f /* (h + c)) - (f /* c))) = Rdiff ((f | I),x) )

let c be constant Real_Sequence; :: thesis: ( rng c = {x} & rng (h + c) c= dom f & ( for n being Nat holds h . n > 0 ) implies ( (h ") (#) ((f /* (h + c)) - (f /* c)) is convergent & lim ((h ") (#) ((f /* (h + c)) - (f /* c))) = Rdiff ((f | I),x) ) )
assume that
A5: rng c = {x} and
A6: rng (h + c) c= dom f and
A7: for n being Nat holds h . n > 0 ; :: thesis: ( (h ") (#) ((f /* (h + c)) - (f /* c)) is convergent & lim ((h ") (#) ((f /* (h + c)) - (f /* c))) = Rdiff ((f | I),x) )
consider N being Nat such that
A8: ( rng ((h ^\ N) + c) c= ].x,(x + r).[ & ( for m being Nat holds ((h ^\ N) + c) . m = (h + c) . (N + m) ) & ( for m being Nat st N <= m holds
( |.(h . m).| < r & x < (h + c) . m & (h + c) . m < x + r ) ) ) by A2, A5, A7, Lm7;
set h1 = h ^\ N;
].x,(x + r).[ c= [.x,(x + r).] by XXREAL_1:37;
then A9: rng ((h ^\ N) + c) c= dom (f | I) by A2, A8;
then A10: (f | I) /* ((h ^\ N) + c) = (f | I) * ((h ^\ N) + c) by FUNCT_2:def 11;
A11: f /* (h + c) = f * (h + c) by A6, FUNCT_2:def 11;
A12: for n being Nat holds (h ^\ N) . n > 0
proof
let n be Nat; :: thesis: (h ^\ N) . n > 0
(h ^\ N) . n = h . (N + n) by NAT_1:def 3;
hence (h ^\ N) . n > 0 by A7; :: thesis: verum
end;
then A13: ((h ^\ N) ") (#) (((f | I) /* ((h ^\ N) + c)) - ((f | I) /* c)) is convergent by A1, A5, A9, FDIFF_3:def 3;
x < x + r by A2, XREAL_1:29;
then [.x,(x + r).] = (rng c) \/ ].x,(x + r).] by A5, XXREAL_1:130;
then A14: rng c c= [.x,(x + r).] by XBOOLE_1:7;
then A15: rng c c= dom (f | I) by A2;
A16: rng c c= dom f by A2, A3, A14;
then A17: f /* c = f * c by FUNCT_2:def 11;
consider g being Real such that
A18: for p being Real st 0 < p holds
ex M being Nat st
for l being Nat st M <= l holds
|.(((((h ^\ N) ") (#) (((f | I) /* ((h ^\ N) + c)) - ((f | I) /* c))) . l) - g).| < p by A13, SEQ_2:def 6;
lim (((h ^\ N) ") (#) (((f | I) /* ((h ^\ N) + c)) - ((f | I) /* c))) = g by A13, A18, SEQ_2:def 7;
then A19: Rdiff ((f | I),x) = g by A1, A5, A9, A12, FDIFF_3:def 6;
A20: now :: thesis: for p being Real st 0 < p holds
ex K being set st
for l being Nat st K <= l holds
|.((((h ") (#) ((f /* (h + c)) - (f /* c))) . l) - g).| < p
let p be Real; :: thesis: ( 0 < p implies ex K being set st
for l being Nat st K <= l holds
|.((((h ") (#) ((f /* (h + c)) - (f /* c))) . l) - g).| < p )

assume 0 < p ; :: thesis: ex K being set st
for l being Nat st K <= l holds
|.((((h ") (#) ((f /* (h + c)) - (f /* c))) . l) - g).| < p

then consider M being Nat such that
A21: for l being Nat st M <= l holds
|.(((((h ^\ N) ") (#) (((f | I) /* ((h ^\ N) + c)) - ((f | I) /* c))) . l) - g).| < p by A18;
take K = N + M; :: thesis: for l being Nat st K <= l holds
|.((((h ") (#) ((f /* (h + c)) - (f /* c))) . l) - g).| < p

hereby :: thesis: verum
let l be Nat; :: thesis: ( K <= l implies |.((((h ") (#) ((f /* (h + c)) - (f /* c))) . l) - g).| < p )
assume K <= l ; :: thesis: |.((((h ") (#) ((f /* (h + c)) - (f /* c))) . l) - g).| < p
then reconsider i = l - (N + M) as Element of NAT by NAT_1:21;
reconsider i1 = i + M as Element of NAT by ORDINAL1:def 12;
A22: ( dom ((h ^\ N) + c) = NAT & dom c = NAT & dom (h + c) = NAT ) by FUNCT_2:def 1;
then ( i1 in dom ((h ^\ N) + c) & i1 in dom c ) ;
then ( i1 in dom ((f | I) * ((h ^\ N) + c)) & i1 in dom ((f | I) * c) ) by A9, A15, RELAT_1:27;
then i1 in (dom ((f | I) * ((h ^\ N) + c))) /\ (dom ((f | I) * c)) by XBOOLE_0:def 4;
then A23: i1 in dom (((f | I) * ((h ^\ N) + c)) - ((f | I) * c)) by VALUED_1:12;
A24: ( ((h ^\ N) + c) . i1 in rng ((h ^\ N) + c) & c . i1 in rng c ) by A22, FUNCT_1:3;
A25: ( l in dom (h + c) & l in dom c ) by A22, ORDINAL1:def 12;
then A26: c . i1 = c . l by A22, FUNCT_1:def 10;
A27: ((h ^\ N) ") . i1 = ((h ") ^\ N) . i1 by SEQM_3:18
.= (h ") . (N + i1) by NAT_1:def 3 ;
A28: ( f . ((h + c) . l) = (f * (h + c)) . l & f . (c . l) = (f * c) . l ) by A22, ORDINAL1:def 12, FUNCT_1:13;
( l in dom (f * (h + c)) & l in dom (f * c) ) by A25, A6, A16, RELAT_1:27;
then l in (dom (f /* (h + c))) /\ (dom (f /* c)) by A11, A17, XBOOLE_0:def 4;
then A29: l in dom ((f /* (h + c)) - (f /* c)) by VALUED_1:12;
(((h ^\ N) ") (#) (((f | I) /* ((h ^\ N) + c)) - ((f | I) /* c))) . i1 = (((h ^\ N) ") (#) (((f | I) * ((h ^\ N) + c)) - ((f | I) * c))) . i1 by A10, A15, FUNCT_2:def 11
.= (((h ^\ N) ") . i1) * ((((f | I) * ((h ^\ N) + c)) - ((f | I) * c)) . i1) by VALUED_1:5
.= (((h ^\ N) ") . i1) * ((((f | I) * ((h ^\ N) + c)) . i1) - (((f | I) * c) . i1)) by A23, VALUED_1:13
.= (((h ^\ N) ") . i1) * (((f | I) . (((h ^\ N) + c) . i1)) - (((f | I) * c) . i1)) by A22, FUNCT_1:13
.= (((h ^\ N) ") . i1) * (((f | I) . (((h ^\ N) + c) . i1)) - ((f | I) . (c . i1))) by A22, FUNCT_1:13
.= (((h ^\ N) ") . i1) * ((f . (((h ^\ N) + c) . i1)) - ((f | I) . (c . i1))) by A24, A9, FUNCT_1:47
.= (((h ^\ N) ") . i1) * ((f . (((h ^\ N) + c) . i1)) - (f . (c . i1))) by A2, A24, A14, FUNCT_1:47
.= ((h ") . l) * (((f * (h + c)) . l) - ((f * c) . l)) by A8, A26, A27, A28
.= ((h ") . l) * (((f /* (h + c)) - (f /* c)) . l) by A11, A17, A29, VALUED_1:13
.= ((h ") (#) ((f /* (h + c)) - (f /* c))) . l by VALUED_1:5 ;
hence |.((((h ") (#) ((f /* (h + c)) - (f /* c))) . l) - g).| < p by A21, NAT_1:11; :: thesis: verum
end;
end;
hence (h ") (#) ((f /* (h + c)) - (f /* c)) is convergent by SEQ_2:def 6; :: thesis: lim ((h ") (#) ((f /* (h + c)) - (f /* c))) = Rdiff ((f | I),x)
hence lim ((h ") (#) ((f /* (h + c)) - (f /* c))) = Rdiff ((f | I),x) by A19, A20, SEQ_2:def 7; :: thesis: verum
end;
hence ( f is_right_differentiable_in x & Rdiff (f,x) = Rdiff ((f | I),x) ) by A2, A4, FDIFF_3:15; :: thesis: verum