reserve y for set;
reserve g,r,s,p,t,x,x0,x1,x2 for Real;
reserve n,n1 for Nat;
reserve s1,s2,s3 for Real_Sequence;
reserve f,f1,f2 for PartFunc of REAL,REAL;

theorem
  for p,g for f st ].p,g.[ c= dom f & f is_differentiable_on ].p,g.[ & (
  for x st x in ].p,g.[ holds 0<diff(f,x)) holds f|].p,g.[ is increasing
proof
  let p,g;
  let f such that
A1: ].p,g.[ c= dom f and
A2: f is_differentiable_on ].p,g.[ and
A3: for x st x in ].p,g.[ holds 0<diff(f,x);
  now
    let x1,x2 such that
A4: x1 in ].p,g.[ /\ dom f & x2 in ].p,g.[ /\ dom f and
A5: x1<x2;
A6: 0<x2-x1 by A5,XREAL_1:50;
    reconsider Z=].x1,x2.[ as open Subset of REAL;
    x1 in ].p,g.[ & x2 in ].p,g.[ by A4,XBOOLE_0:def 4;
    then
A7: [.x1,x2.] c= ].p,g.[ by XXREAL_2:def 12;
    f|].p,g.[ is continuous by A2,FDIFF_1:25;
    then
A8: f|[.x1,x2.] is continuous by A7,FCONT_1:16;
A9: Z c= [.x1,x2.] by XXREAL_1:25;
    then f is_differentiable_on Z by A2,A7,FDIFF_1:26,XBOOLE_1:1;
    then
A10: ex x0 st x0 in ].x1,x2.[ & diff(f,x0) = (f.x2-f.x1)/(x2- x1) by A1,A5,A7
,A8,Th3,XBOOLE_1:1;
    Z c= ].p,g.[ by A7,A9;
    then 0<f.x2-f.x1 by A3,A6,A10;
    then f.x1+0<f.x2 by XREAL_1:20;
    hence f.x1<f.x2;
  end;
  hence thesis by RFUNCT_2:20;
end;
