reserve y for set,
  x,a,b for Real,
  n for Element of NAT,
  Z for open Subset of REAL,
  f,f1,f2,g for PartFunc of REAL,REAL;

theorem Th4:
  not 0 in Z implies (id Z)^ is_differentiable_on Z & for x st x in
  Z holds (((id Z)^)`|Z).x= -1/x^2
proof
  set f = id Z;
A1: Z c= dom f & for x st x in Z holds f.x = 1*x+0 by FUNCT_1:17;
  then
A2: f is_differentiable_on Z by FDIFF_1:23;
  assume
A3: not 0 in Z;
  then
A4: for x st x in Z holds f.x<>0 by FUNCT_1:18;
  then
A5: f^ is_differentiable_on Z by A2,FDIFF_2:22;
  now
    let x;
    assume
A6: x in Z;
    then
A7: f.x<>0 & f is_differentiable_in x by A3,A2,FDIFF_1:9,FUNCT_1:18;
    ((f^)`|Z).x= diff(f^,x) by A5,A6,FDIFF_1:def 7
      .= - diff(f,x)/(f.x)^2 by A7,FDIFF_2:15
      .=- (f`|Z).x/(f.x)^2 by A2,A6,FDIFF_1:def 7
      .=-1/(f.x)^2 by A1,A6,FDIFF_1:23
      .=-1/x^2 by A6,FUNCT_1:18;
    hence ((f^)`|Z).x=-1/x^2;
  end;
  hence thesis by A2,A4,FDIFF_2:22;
end;
