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 Th17:
  Z c= dom (f1+f2) & (for x st x in Z holds f1.x=a^2) & f2=#Z 2
implies f1+f2 is_differentiable_on Z & for x st x in Z holds ((f1+f2)`|Z).x = 2
  *x
proof
  assume that
A1: Z c= dom (f1+f2) & for x st x in Z holds f1.x=a^2 and
A2: f2=#Z 2;
A3: Z c= dom (f1+1(#)f2) & for x st x in Z holds f1.x=a^2 + 0*x by A1,
RFUNCT_1:21;
A4: for x st x in Z holds ((f1+f2)`|Z).x = 2*x
  proof
    let x;
    assume
A5: x in Z;
    ((f1+f2)`|Z).x=((f1+1(#)f2)`|Z).x by RFUNCT_1:21
      .= 0+2*1*x by A2,A3,A5,Th12
      .= 2*x;
    hence thesis;
  end;
  f1+1(#)f2 is_differentiable_on Z by A2,A3,Th12;
  hence thesis by A4,RFUNCT_1:21;
end;
