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
  Z c= dom (ln^) & (for x st x in Z holds ln.x<>0) implies (ln^)
  is_differentiable_on Z & for x st x in Z holds ((ln^)`|Z).x =-1/(x*(ln.x)^2)
proof
  set f = ln;
  assume that
A1: Z c= dom (ln^) and
A2: for x st x in Z holds ln.x<>0;
  dom (f^) c= dom f by RFUNCT_1:1;
  then
A3: Z c= dom f by A1;
  then
A4: f is_differentiable_on Z by Th19;
  then
A5: f^ is_differentiable_on Z by A2,FDIFF_2:22;
  for x st x in Z holds ((f^)`|Z).x= - 1/(x*(ln.x)^2)
  proof
    let x;
    assume
A6: x in Z;
    then
A7: f.x<>0 & f is_differentiable_in x by A2,A4,FDIFF_1:9;
    ((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 A4,A6,FDIFF_1:def 7
      .= -(1/x)/(ln.x)^2 by A3,A6,Th19
      .= -1/(x*(ln.x)^2) by XCMPLX_1:78;
    hence thesis;
  end;
  hence thesis by A2,A4,FDIFF_2:22;
end;
