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