reserve n,k for Element of NAT;
reserve x,y,X for set;
reserve g,r,p for Real;
reserve S for RealNormSpace;
reserve rseq for Real_Sequence;
reserve seq,seq1 for sequence of S;
reserve x0 for Point of S;
reserve Y for Subset of S;
reserve S,T for RealNormSpace;
reserve f,f1,f2 for PartFunc of S,T;
reserve s1 for sequence of S;
reserve x0 for Point of S;
reserve h for (0.S)-convergent sequence of S;
reserve c for constant sequence of S;
reserve R,R1,R2 for RestFunc of S,T;
reserve L,L1,L2 for Point of R_NormSpace_of_BoundedLinearOperators(S,T);

theorem Th31:
  for f be PartFunc of S,T for Z be Subset of S st Z is open holds
( f is_differentiable_on Z iff Z c=dom f & for x be Point of S st x in Z holds
  f is_differentiable_in x )
proof
  let f be PartFunc of S,T;
  let Z be Subset of S such that
A1: Z is open;
  thus f is_differentiable_on Z implies Z c=dom f & for x be Point of S st x
  in Z holds f is_differentiable_in x
  proof
    assume
A2: f is_differentiable_on Z;
    hence
A3: Z c=dom f;
    let x0 be Point of S;
    assume
A4: x0 in Z;
    then f|Z is_differentiable_in x0 by A2;
    then consider N being Neighbourhood of x0 such that
A5: N c= dom(f|Z) and
A6: ex L,R st for x be Point of S st x in N holds (f|Z)/.x-(f|Z)/.x0=L
    .( x-x0)+R/.(x-x0);
    consider L,R such that
A7: for x be Point of S st x in N holds (f|Z)/.x - (f|Z)/.x0 = L.(x-
    x0) + R/.(x-x0) by A6;
    take N;
A8: 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;
    take L,R;
    let x be Point of S;
    assume
A9: x in N;
    then (f|Z)/.x-(f|Z)/.x0=L.(x-x0)+R/.(x-x0) by A7;
    then f/.x-(f|Z)/.x0=L.(x-x0)+R/.(x-x0) by A5,A8,A9,PARTFUN2:16;
    hence thesis by A3,A4,PARTFUN2:17;
  end;
  assume that
A10: Z c=dom f and
A11: for x be Point of S st x in Z holds f is_differentiable_in x;
  thus Z c=dom f by A10;
  let x0 be Point of S;
  assume
A12: x0 in Z;
  then consider N1 being Neighbourhood of x0 such that
A13: N1 c= Z by A1,Th2;
  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 be Point of S 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 Th1;
A18: N2 c= Z by A13,A16;
  take N2;
  N2 c= dom f by A14,A17;
  then
A19: N2 c= dom f/\Z by A18,XBOOLE_1:19;
  hence N2 c= dom(f|Z) by RELAT_1:61;
A20: x0 in N2 by NFCONT_1:4;
  consider L,R such that
A21: for x be Point of S st x in N holds f/.x-f/.x0=L.(x-x0)+R/.(x-x0) by A15;
  take L,R;
  let x be Point of S;
  assume
A22: x in N2;
  then f/.x-f/.x0=L.(x-x0)+R/.(x-x0) by A17,A21;
  then (f|Z)/.x-f/.x0=L.(x-x0)+R/.(x-x0) by A19,A22,PARTFUN2:16;
  hence thesis by A19,A20,PARTFUN2:16;
end;
