
theorem Th5:
for f be PartFunc of REAL,REAL, I be Interval, x be Real st
 f is_left_differentiable_in x & x in I & x <> inf I holds
  f|I is_left_differentiable_in x
proof
    let f be PartFunc of REAL,REAL, I be Interval, x be Real;
    assume that
A1:  f is_left_differentiable_in x and
A2:  x in I and
A3:  x <> inf I;

    consider r be Real such that
A4:  r > 0 & [.x-r,x.] c= dom f by A1,FDIFF_3:def 4;
A5: inf I <= x by A2,XXREAL_2:3; then
A6: inf I < x by A3,XXREAL_0:1;
A7: x in REAL by XREAL_0:def 1;
A8: -infty < x by XREAL_0:def 1,XXREAL_0:12;
    inf I < +infty by A5,A7,XXREAL_0:2,9; then
A9: x - inf I > 0 by A6,A8,XXREAL_3:51;
    set R0 = min(r,x - inf I);

A10: R0 > 0 by A4,A9,XXREAL_0:21;
A11:R0 <> -infty by A4,A9,XXREAL_0:21;
A12:R0 <= r & r < +infty by XREAL_0:def 1,XXREAL_0:17,9; then
    R0 in REAL by A11,XXREAL_0:14; then
    reconsider r0=R0 as Real;
    set R = r0/2;

A13:R < r0 by A10,XREAL_1:216; then
    R < r by A12,XXREAL_0:2; then
    x-r < x-R by XREAL_1:10; then
    [.x-R,x.] c= [.x-r,x.] by XXREAL_1:34; then
A14:[.x-R,x.] c= dom f by A4;

    reconsider x0=x as R_eal by XXREAL_0:def 1;
    reconsider S=R as R_eal by XXREAL_0:def 1;

A15: -S = -R by XXREAL_3:def 3;

    r0 <= x - inf I by XXREAL_0:17; then
    R < x - inf I by A13,XXREAL_0:2; then
    S - x0 < x0 -inf I - x0 by A7,XXREAL_3:43; then
    S - x0 < -inf I + x0 - x0 by XXREAL_3:def 4; then
    S - x0 < -inf I by XXREAL_3:24; then
    -(S - x0) > --inf I by XXREAL_3:38; then
    x0 + -S > inf I by XXREAL_3:26; then
A16:x-R > inf I by A15,XXREAL_3:def 2;

A17: x-R < x by A10,XREAL_1:44,215; then
    x-R in I by A2,A16,XXREAL_2:82; then
    [.x-R,x.] c= I by A2,XXREAL_2:def 12; then
    [.x-R,x.] c= dom f /\ I by A14,XBOOLE_0:def 4; then
A18:[.x-R,x.] c= dom (f|I) by RELAT_1:61;

    for h be 0-convergent non-zero Real_Sequence,
     c be constant Real_Sequence st rng c = {x} & rng(h+c) c= dom(f|I) &
     (for n be Nat holds h.n < 0) holds
      h"(#)((f|I)/*(h+c) - (f|I)/*c) is convergent
    proof
     let h be 0-convergent non-zero Real_Sequence,
      c be constant Real_Sequence;
     assume that
A19:   rng c = {x} and
A20:   rng(h+c) c= dom(f|I) and
A21:   for n be Nat holds h.n < 0;
     dom(f|I) c= dom f by RELAT_1:60; then
     rng(h+c) c= dom f by A20; then
A22:  h"(#)(f/*(h+c) - f/*c) is convergent by A1,A19,A21,FDIFF_3:def 4;

A23:  (f|I)/*(h+c) = f/*(h+c) by A20,FUNCT_2:117;

     [.x-R,x.] = rng c \/ [.x-R,x.[ by A17,A19,XXREAL_1:129; then
     rng c c= [.x-R,x.] by XBOOLE_1:7; then
     rng c c= dom(f|I) by A18;
     hence h"(#)((f|I)/*(h+c) - (f|I)/*c) is convergent by A23,A22,FUNCT_2:117;
    end;
    hence f|I is_left_differentiable_in x by A18,A10,XREAL_1:215,FDIFF_3:def 4;
end;
