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

theorem
  Z c= dom (id Z - (2*a)(#)f) & f = ln*f1 & (for x st x in Z holds f1.x=
x+a & f1.x>0) implies (id Z - (2*a)(#)f) is_differentiable_on Z & for x st x in
  Z holds ((id Z -(2*a)(#)f)`|Z).x = (x-a)/(x+a)
proof
  assume that
A1: Z c= dom (id Z - (2*a)(#)f) and
A2: f = ln*f1 and
A3: for x st x in Z holds f1.x=x+a & f1.x>0;
A4: for x st x in Z holds f1.x=a+x & f1.x>0 by A3;
A5: Z c= dom id Z /\ dom ((2*a)(#)f) by A1,VALUED_1:12;
  then
A6: Z c= dom ((2*a)(#)f) by XBOOLE_1:18;
  then
A7: Z c= dom (ln*f1) by A2,VALUED_1:def 5;
  then
A8: f is_differentiable_on Z by A2,A4,Th1;
  then
A9: (2*a)(#)f is_differentiable_on Z by A6,FDIFF_1:20;
A10: for x st x in Z holds (id Z).x = 1*x+0 by FUNCT_1:18;
A11: Z c= dom id Z by A5,XBOOLE_1:18;
  then
A12: id Z is_differentiable_on Z by A10,FDIFF_1:23;
A13: for x st x in Z holds (((2*a)(#)f)`|Z).x =(2*a)/(x+a)
  proof
    let x;
    assume
A14: x in Z;
    hence (((2*a)(#)f)`|Z).x =(2*a)*diff(f,x) by A6,A8,FDIFF_1:20
      .=(2*a)*(f`|Z).x by A8,A14,FDIFF_1:def 7
      .=(2*a)*(1/(x+a)) by A2,A7,A4,A14,Th1
      .=(2*a)/(x+a) by XCMPLX_1:99;
  end;
  for x st x in Z holds ((id Z - (2*a)(#)f)`|Z).x = (x-a)/(x+a)
  proof
    let x;
    assume
A15: x in Z;
    then
A16: f1.x=x+a & f1.x>0 by A3;
    ((id Z - (2*a)(#)f)`|Z).x = diff(id Z,x) - diff((2*a)(#)f,x) by A1,A12,A9
,A15,FDIFF_1:19
      .=((id Z)`|Z).x - diff((2*a)(#)f,x) by A12,A15,FDIFF_1:def 7
      .=((id Z)`|Z).x - (((2*a)(#)f)`|Z).x by A9,A15,FDIFF_1:def 7
      .=1 - (((2*a)(#)f)`|Z).x by A11,A10,A15,FDIFF_1:23
      .=1 - (2*a)/(x+a) by A13,A15
      .=(1*(x+a) - (2*a))/(x+a) by A16,XCMPLX_1:127
      .=(x-a)/(x+a);
    hence thesis;
  end;
  hence thesis by A1,A12,A9,FDIFF_1:19;
end;
