reserve k, k1, n, n1, m for Nat;
reserve X, y for set;
reserve p for Real;
reserve r for Real;
reserve a, a1, a2, b, b1, b2, x, x0, z, z0 for Complex;
reserve s1, s3, seq, seq1 for Complex_Sequence;
reserve Y for Subset of COMPLEX;
reserve f, f1, f2 for PartFunc of COMPLEX,COMPLEX;
reserve Nseq for increasing sequence of NAT;
reserve h for 0-convergent non-zero Complex_Sequence;
reserve c for constant Complex_Sequence;
reserve R, R1, R2 for C_RestFunc;
reserve L, L1, L2 for C_LinearFunc;
reserve Z for open Subset of COMPLEX;

theorem Th15:
  f is_differentiable_on Z iff Z c= dom f & for x st x in Z holds
  f is_differentiable_in x
proof
  thus f is_differentiable_on Z implies Z c= dom f & for x st x in Z holds f
  is_differentiable_in x
  proof
    assume
A1: f is_differentiable_on Z;
    hence
A2: Z c= dom f;
    let x0;
A3: f|Z is differentiable by A1;
    assume
A4: x0 in Z;
    then x0 in dom (f|Z) by A2,RELAT_1:57;
    then f|Z is_differentiable_in x0 by A3;
    then consider N being Neighbourhood of x0 such that
A5: N c= dom(f|Z) and
A6: ex L,R st for x st x in N holds (f|Z)/.x-(f|Z)/.x0 = L/.(x-x0)+R/.
    (x -x0);
    take N;
    dom(f|Z) = dom f/\Z by RELAT_1:61;
    then dom(f|Z) c= dom f by XBOOLE_1:17;
    hence N c= dom f by A5;
    consider L,R such that
A7: for x st x in N holds (f|Z)/.x-(f|Z)/.x0 = L/.(x-x0)+R/.(x-x0) by A6;
    take L, R;
    let x;
    assume
A8: x in N;
    then (f|Z)/.x-(f|Z)/.x0 = L/.(x-x0)+R/.(x-x0) by A7;
    then
A9: f/.x-(f|Z)/.x0 = L/.(x-x0)+R/.(x-x0) by A5,A8,PARTFUN2:15;
    x0 in dom f/\ Z by A2,A4,XBOOLE_0:def 4;
    hence thesis by A9,PARTFUN2:16;
  end;
  assume that
A10: Z c= dom f and
A11: for x st x in Z holds f is_differentiable_in x;
  thus Z c= dom f by A10;
  let x0;
  assume x0 in dom (f|Z);
  then
A12: x0 in Z by RELAT_1:57;
  then consider N1 being Neighbourhood of x0 such that
A13: N1 c= Z by Th9;
  f is_differentiable_in x0 by A11,A12;
  then consider N being Neighbourhood of x0 such that
A14: N c= dom f and
A15: ex L,R st for x st x in N holds f/.x-f/.x0 = L/.(x-x0)+R/.(x-x0);
  consider N2 being Neighbourhood of x0 such that
A16: N2 c= N1 and
A17: N2 c= N by Lm1;
A18: N2 c= Z by A13,A16;
  take N2;
  N2 c= dom f by A14,A17;
  then N2 c= dom f/\Z by A18,XBOOLE_1:19;
  hence
A19: N2 c= dom(f|Z) by RELAT_1:61;
  consider L,R such that
A20: for x st x in N holds f/.x-f/.x0 = L/.(x-x0)+R/.(x-x0) by A15;
A21: x0 in N2 by Th7;
  take L, R;
  let x;
  assume
A22: x in N2;
  then f/.x-f/.x0 = L/.(x-x0)+R/.(x-x0) by A17,A20;
  then (f|Z)/.x-f/.x0 = L/.(x-x0)+R/.(x-x0) by A19,A22,PARTFUN2:15;
  hence thesis by A19,A21,PARTFUN2:15;
end;
