 reserve h,h1 for 0-convergent non-zero Real_Sequence,
         c,c1 for constant Real_Sequence;

theorem
  for X be open Subset of REAL, x0 be Real, f be PartFunc of REAL,REAL st
   x0 in X & f is_differentiable_on X holds diff(f,x0) = diff(f|X,x0)
proof
    let X be open Subset of REAL, x0 be Real, f be PartFunc of REAL,REAL;
    assume that
A1:  x0 in X and
A2:  f is_differentiable_on X;

A3: f|X is_differentiable_in x0 by A1,A2; then
A4: f is_differentiable_in x0 by A1,PDIFFEQ1:2;

    consider N be Neighbourhood of x0 such that
A5:  N c= dom(f|X) &
     ex L be LinearFunc, R be RestFunc st diff(f|X,x0) = L.1
      & for x be Real st x in N holds (f|X).x-(f|X).x0 = L.(x-x0)+R.(x-x0)
       by A3,FDIFF_1:def 5;
    consider L be LinearFunc, R be RestFunc such that
A6:  diff(f|X,x0) = L.1 &
     for x be Real st x in N holds (f|X).x-(f|X).x0 = L.(x-x0)+R.(x-x0)
       by A5;

    dom(f|X) c= dom f by RELAT_1:60; then
A7: N c= dom f by A5;
    for x be Real st x in N holds f.x - f.x0 = L.(x-x0)+R.(x-x0)
    proof
     let x be Real;
     assume A8: x in N; then
     x in dom(f|X) by A5; then
     (f|X).x = f.x & (f|X).x0 = f.x0 by A1,FUNCT_1:49;
     hence thesis by A6,A8;
    end;
    hence diff(f,x0) = diff(f|X,x0) by A6,A4,A7,FDIFF_1:def 5;
end;
