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 Th4:
  for x be Real st x in X & f|X is_differentiable_in x holds
    f is_differentiable_in x
proof
  let x be Real;
  assume that
A1: x in X and
A2: f|X is_differentiable_in x;
  consider N be Neighbourhood of x such that
A3: N c= dom(f|X) and
A4: ex L be LinearFunc, R be RestFunc st
 for x1 be Real st x1 in N holds (f|X).
  x1 - (f|X).x = L.(x1-x) + R.(x1-x) by A2;
A5: (f|X).x = f.x by A1,FUNCT_1:49;
  take N;
  N c= dom f /\ X by A3,RELAT_1:61;
  hence N c= dom f by XBOOLE_1:18;
  consider L be LinearFunc, R be RestFunc such that
A6: for x1 be Real st x1 in N holds (f|X).x1 - (f|X).x = L.(x1-x) + R.(
  x1-x) by A4;
  take L,R;
  let x1 be Real;
  assume
A7: x1 in N;
  then (f|X).x1 = f.x1 by A3,FUNCT_1:47;
  hence thesis by A6,A7,A5;
end;
