reserve h for non-zero 0-convergent Real_Sequence;
reserve c for constant Real_Sequence;
reserve R,R1,R2 for RestFunc;
reserve L,L1,L2 for LinearFunc;

theorem
for x0 be Real, f1,f2 be PartFunc of REAL,REAL st
 f1 is_right_differentiable_in x0 & f2 is_right_differentiable_in f1.x0 &
 (ex r be Real st r > 0 & f1|([.x0,x0+r.]) is non-decreasing) holds
  f2*f1 is_right_differentiable_in x0 &
  Rdiff(f2*f1,x0) = Rdiff(f2,f1.x0)*Rdiff(f1,x0)
proof
    let x0 be Real, f1,f2 be PartFunc of REAL,REAL;
    assume that
A1:  f1 is_right_differentiable_in x0 and
A2:  f2 is_right_differentiable_in f1.x0 and
A3:  ex r be Real st r > 0 & f1|([.x0,x0+r.]) is non-decreasing;

    consider R be Real such that
A4:  R > 0 & f1|([.x0,x0+R.]) is non-decreasing by A3;

A5: f1 is_Rcontinuous_in x0 by A1,FDIFF_3:7; then
A6: x0 in dom f1 by Th28;

    for r1 be Real st r1 > 0 ex r0 be Real st r0>0 &
     [.x0,x0+r0.] c= dom([.f1.x0,f1.x0+r1.]|`f1)
    proof
     let r1 be Real;
     assume
A7:   r1 > 0; then
     consider d be Real such that
A8:   0 < d &
      for x be Real st x in dom f1 & x0 < x & x < x0+d holds
       |. f1.x - f1.x0 .| < r1 by A5,Th28;
A9:  0 < d/2 & d/2 < d by A8,XREAL_1:215,216;
     consider s0 be Real such that
A10:   s0 > 0 & [.x0,x0+s0.] c= dom f1 by A1,FDIFF_3:def 3;
     set e = min(d/2,s0);
     take r0 = min(e,R);

A11: e > 0 by A9,A10,XXREAL_0:21;
     e <= d/2 & e <= s0 & r0 <= e & r0 <= R by XXREAL_0:17; then
A12: r0 <= d/2 & r0 <= s0 & r0 <= R by XXREAL_0:2; then
A13:  r0 < d by A9,XXREAL_0:2;

     now let x be Real;
      assume x in [.x0,x0+r0.]; then
A14:  x0 <= x & x <= x0+r0 by XXREAL_1:1;

      x0+r0 <= x0+s0 by A12,XREAL_1:6; then
      x <= x0+s0 by A14,XXREAL_0:2; then
A15:  x in dom f1 by A10,A14,XXREAL_1:1;

A16:  x0+r0 < x0+d by A13,XREAL_1:8;
      per cases;
      suppose x <> x0; then
A17:   x0 < x & x < x0+d by A14,A16,XXREAL_0:1,2; then
A18:   |. f1.x - f1.x0 .| < r1 by A8,A15;

       x0+r0 <= x0+R by XXREAL_0:17,XREAL_1:6; then
A19:    x0 < x0+R & x <= x0+R by A4,A14,XREAL_1:29,XXREAL_0:2; then
       x0 in dom(f1|([.x0,x0+R.])) & x in dom(f1|([.x0,x0+R.]))
         by A6,A15,A14,XXREAL_1:1,RELAT_1:57; then

       (f1|([.x0,x0+R.])).x0 <= (f1|([.x0,x0+R.])).x
         by A4,A17,RFUNCT_2:def 3; then
       f1.x0 <= (f1|([.x0,x0+R.])).x by A19,XXREAL_1:1,FUNCT_1:49; then
A20:   f1.x0 <= f1.x by A19,A14,XXREAL_1:1,FUNCT_1:49; then
       f1.x - f1.x0 < r1 by A18,ABSVALUE:def 1,XREAL_1:48; then
       f1.x < f1.x0+r1 by XREAL_1:19;
       hence x in dom([.f1.x0,f1.x0+r1.]|`f1) by A15,A20,FUNCT_1:54,XXREAL_1:1;
      end;
      suppose x = x0; then
       f1.x0 <= f1.x & f1.x < f1.x0+r1 by A7,XREAL_1:29;
       hence x in dom([.f1.x0,f1.x0+r1.]|`f1) by A15,FUNCT_1:54,XXREAL_1:1;
      end;
     end;
     hence thesis by A11,A4,XXREAL_0:21;
    end;
    hence thesis by A1,A2,Th42;
end;
