reserve m, n for non zero Element of NAT;
reserve i, j, k for Element of NAT;
reserve Z for Subset of REAL 2;
reserve c for Real;
reserve I for non empty FinSequence of NAT;
reserve d1, d2 for Element of REAL;

theorem LM002:
  for f be PartFunc of REAL,REAL, Z be Subset of REAL, x0 be Real
  st Z is open & x0 in Z holds
  (f is_differentiable_in x0 iff (f|Z) is_differentiable_in x0)
  & (f is_differentiable_in x0 implies diff(f, x0) = diff(f|Z, x0))
  proof
    let f be PartFunc of REAL, REAL, Z be Subset of REAL, x0 be Real;
    assume that
    AS1: Z is open and
    AS3: x0 in Z;
    thus f is_differentiable_in x0 iff (f|Z) is_differentiable_in x0
    proof
      thus f is_differentiable_in x0 implies (f|Z) is_differentiable_in x0
      by LM001, AS1, AS3;
      thus (f|Z) is_differentiable_in x0 implies f is_differentiable_in x0
      proof assume (f|Z) is_differentiable_in x0; then
      consider N being Neighbourhood of x0 such that
      A11: N c= dom(f|Z) and
      A12: ex L being LinearFunc,R being RestFunc
      st for x being Real st x in N holds
      ((f|Z).x) - ((f|Z).x0) = (L.(x - x0)) + (R.(x - x0)) by FDIFF_1:def 4;
      consider L being LinearFunc, R being RestFunc such that
      A17: for x being Real st x in N holds
      ((f|Z).x) - ((f|Z).x0) = (L.(x - x0)) + (R.(x - x0)) by A12;
      Y0: dom(f|Z) c= dom f by RELAT_1:60;
      now let x be Real;
        assume A19: x in N; then
        A20: x in Z by RELAT_1:58, A11, TARSKI:def 3;
        ((f|Z).x) - ((f|Z).x0) = (L.(x - x0)) + (R.(x - x0)) by A17,A19;
        then ((f|Z).x) - (f.x0) = (L.(x - x0)) + (R.(x - x0))
        by AS3, FUNCT_1:49;
        hence (f.x) - (f.x0) = (L.(x - x0)) + (R.(x - x0)) by A20, FUNCT_1:49;
      end;
      hence f is_differentiable_in x0 by Y0, A11, XBOOLE_1:1, FDIFF_1:def 4;
    end;
  end;
  thus (f is_differentiable_in x0 implies diff(f, x0) = diff(f|Z, x0))
  by AS1, AS3, LM001;
  end;
