reserve x,a,b,c for Real,
  n for Nat,
  Z for open Subset of REAL,
  f, f1,f2 for PartFunc of REAL,REAL;

theorem
  not 0 in Z & Z c= dom (ln*((id Z)^)) implies (ln*((id Z)^))
  is_differentiable_on Z & for x st x in Z holds ((ln*((id Z)^))`|Z).x = -1/x
proof
  set f = id Z;
  assume that
A1: not 0 in Z and
A2: Z c= dom (ln*((id Z)^));
  dom (ln*(f^)) c= dom(f^) by RELAT_1:25;
  then
A3: Z c= dom (f^) by A2,XBOOLE_1:1;
A4: for x st x in Z holds f^.x>0
  proof
    let x;
    assume
A5: x in Z;
    then
A6: f^.x=(f.x)" by A3,RFUNCT_1:def 2
      .=1/x by A5,FUNCT_1:18;
    f^.x in right_open_halfline(0) by A2,A5,FUNCT_1:11,TAYLOR_1:18;
    then ex g being Real st (1/x)=g & 0<g by A6,Lm1;
    hence thesis by A6;
  end;
A7: for x st x in Z holds f.x>0
  proof
    let x;
    assume
A8: x in Z;
    then f^.x>0 by A4;
    then (f.x)">0 by A3,A8,RFUNCT_1:def 2;
    hence thesis;
  end;
A9: f^ is_differentiable_on Z by A1,FDIFF_5:4;
A10: for x st x in Z holds (ln *(f^)) is_differentiable_in x & diff((ln *(f^
  )),x) = diff(f^,x)/(f^.x)
  proof
    let x;
    assume x in Z;
    then f^ is_differentiable_in x & f^.x>0 by A4,A9,FDIFF_1:9;
    hence thesis by TAYLOR_1:20;
  end;
  then
A11: for x st x in Z holds (ln *(f^)) is_differentiable_in x;
  then
A12: (ln *(f^)) is_differentiable_on Z by A2,FDIFF_1:9;
  for x st x in Z holds ((ln*(f^))`|Z).x = -1/x
  proof
    let x;
    assume
A13: x in Z;
    then f.x<>0 by A7;
    then
A14: x<>0 by A13,FUNCT_1:18;
    diff((ln *(f^)),x) = diff(f^,x)/(f^.x) by A10,A13
      .= (((f^)`|Z).x)/(f^.x) by A9,A13,FDIFF_1:def 7
      .= (((f^)`|Z).x)/((f.x)") by A3,A13,RFUNCT_1:def 2
      .= (((f^)`|Z).x)/(1*x") by A13,FUNCT_1:18
      .= (-1/x^2)/(1*x") by A1,A13,FDIFF_5:4
      .= -(x/x^2)
      .= -(x/x/x) by XCMPLX_1:78
      .= -1/x by A14,XCMPLX_1:60;
    hence thesis by A12,A13,FDIFF_1:def 7;
  end;
  hence thesis by A2,A11,FDIFF_1:9;
end;
