reserve x for object;
reserve x0,r,r1,r2,g,g1,g2,p,y0 for Real;
reserve n,m,k,l for Element of NAT;
reserve a,b,d for Real_Sequence;
reserve h,h1,h2 for non-zero 0-convergent Real_Sequence;
reserve c,c1 for constant Real_Sequence;
reserve A for open Subset of REAL;
reserve f,f1,f2 for PartFunc of REAL,REAL;
reserve L for LinearFunc;
reserve R for RestFunc;

theorem Th42:
  left_open_halfline(p) c= dom f & f is_differentiable_on
left_open_halfline(p) & ((for x0 st x0 in left_open_halfline(p) holds 0 < diff(
  f,x0)) or for x0 st x0 in left_open_halfline(p) holds diff(f,x0) < 0) implies
  rng (f|left_open_halfline(p)) is open
proof
  set L = left_open_halfline(p);
  assume
A1: L c= dom f;
  assume that
A2: f is_differentiable_on L and
A3: (for x0 st x0 in L holds 0 < diff(f,x0)) or for x0 st x0 in L holds
  diff(f,x0) < 0;
A4: f|L is continuous by A2,FDIFF_1:25;
  now
    per cases by A3;
    suppose
      for x0 st x0 in left_open_halfline(p) holds 0 < diff(f,x0);
      then f|left_open_halfline p is increasing by A2,Th29;
      hence thesis by A1,A4,FCONT_3:24;
    end;
    suppose
      for x0 st x0 in left_open_halfline(p) holds diff(f,x0) < 0;
      then f|left_open_halfline p is decreasing by A2,Th30;
      hence thesis by A1,A4,FCONT_3:24;
    end;
  end;
  hence thesis;
end;
