 reserve a,b,r for Real;
 reserve A for non empty set;
 reserve X,x for set;
 reserve f,g,F,G for PartFunc of REAL,REAL;
 reserve n for Element of NAT;

theorem Th14:
  for f be PartFunc of REAL,REAL,
      Z be Subset of REAL,
      x be Real
  st Z is open & x in Z & Z c= dom f
  holds
    f|Z is_differentiable_in x
      iff
    f is_differentiable_in x
proof
  let f be PartFunc of REAL,REAL,
      Z be Subset of REAL,
      x0 be Real;
  assume
  A1: Z is open & x0 in Z & Z c= dom f;

  hereby
    assume
    A2: f|Z is_differentiable_in x0;

    thus f is_differentiable_in x0
    proof
      consider N be Neighbourhood of x0 such that
      A3: N c= dom(f|Z) and
      A4: ex L be LinearFunc, R be RestFunc
          st for x be Real st x in N
             holds (f|Z).x - (f|Z).x0 = L.(x - x0) + R.(x - x0) by A2;

      consider L be LinearFunc, R be RestFunc such that
      A5: for x be Real st x in N
          holds (f|Z).x - (f|Z).x0 = L.(x - x0) + R.(x - x0) by A4;
      take N;
      dom(f|Z) c= dom f by RELAT_1:60;
      hence N c= dom f by A3;
      take L;
      take R;
      let x be Real;

      assume
      A6: x in N;
      then (f|Z).x - (f|Z).x0 = L.(x - x0) + R.(x - x0) by A5;
      then f.x - (f|Z).x0 = L.(x - x0) + R.(x - x0) by A3,A6,FUNCT_1:47;
      hence f.x - f.x0 = L.(x - x0) + R.(x - x0) by A1,FUNCT_1:49;
    end;
  end;

  assume
  A7: f is_differentiable_in x0;

  consider N1 be Neighbourhood of x0 such that
  A8: N1 c= Z by A1,RCOMP_1:18;

  consider N be Neighbourhood of x0 such that
  A9: N c= dom f and
  A10: ex L be LinearFunc, R be RestFunc
       st for x be Real st x in N
          holds f.x - f.x0 = L.(x - x0) + R.(x - x0) by A7;

  consider N2 be Neighbourhood of x0 such that
  A11: N2 c= N1 and
  A12: N2 c= N by RCOMP_1:17;
  A13: N2 c= Z by A8,A11;

  take N2;
  N2 c= dom f by A9,A12; then
  N2 c= dom f /\ Z by A13,XBOOLE_1:19;
  hence N2 c= dom(f|Z) by RELAT_1:61;

  consider L be LinearFunc, R be RestFunc such that
  A15: for x be Real st x in N
       holds f.x - f.x0 = L.(x - x0) + R.(x - x0) by A10;

  take L;
  take R;
  let x be Real;
  assume
  A16: x in N2; then
  f.x - f.x0 = L.(x - x0) + R.(x - x0) by A12,A15;
  then (f|Z).x - f.x0 = L.(x - x0) + R.(x - x0) by A8,A11,A16,FUNCT_1:49;
  hence (f|Z).x - (f|Z).x0 = L.(x - x0) + R.(x - x0) by A1,FUNCT_1:49;
end;
