reserve F for RealNormSpace;
reserve G for RealNormSpace;
reserve X for set;
reserve x,x0,g,r,s,p for Real;
reserve n,m,k for Element of NAT;
reserve Y for Subset of REAL;
reserve Z for open Subset of REAL;
reserve s1,s3 for Real_Sequence;
reserve seq for sequence of G;
reserve f,f1,f2 for PartFunc of REAL,the carrier of F;
reserve h for 0-convergent non-zero Real_Sequence;
reserve c for constant Real_Sequence;
reserve R,R1,R2 for RestFunc of F;
reserve L,L1,L2 for LinearFunc of F;

theorem Th10:
  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;
      assume
      A3: x0 in Z;
      then f|Z is_differentiable_in x0 by A1;
      then consider N being Neighbourhood of x0 such that
A4:   N c= dom(f|Z) and
A5:   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 A4;
      consider L,R such that
A6:   for x st x in N holds (f|Z)/.x - (f|Z)/.x0
      = L/.(x-x0) + R/.(x-x0) by A5;
      now let x;
        assume
        A7: x in N;
        then A8: (f|Z)/.x-(f|Z)/.x0=L/.(x-x0)+R/.(x-x0) by A6;
        f/.x-(f|Z)/.x0=L/.(x-x0)+R/.(x-x0) by A8,A4,A7,PARTFUN2:15;
        hence f/.x-f/.x0=L/.(x-x0)+R/.(x-x0) by A2,A3,PARTFUN2:17;
      end;
      hence thesis;
    end;
    assume that
    A9: Z c=dom f and
    A10: for x st x in Z holds f is_differentiable_in x;
    thus Z c=dom f by A9;
    let x0;
    assume
    A11: x0 in Z;
    then consider N1 being Neighbourhood of x0 such that
    A12: N1 c= Z by RCOMP_1:18;
    f is_differentiable_in x0 by A10,A11;
    then consider N being Neighbourhood of x0 such that
    A13: N c= dom f and
    A14: 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
    A15: N2 c= N1 and
    A16: N2 c= N by RCOMP_1:17;
    A17: N2 c= Z by A12,A15;
    take N2;
    N2 c= dom f by A13,A16;
    then N2 c= dom f/\Z by A17,XBOOLE_1:19;
    hence
    A18: N2 c= dom(f|Z) by RELAT_1:61;
    consider L,R such that
    A19: for x st x in N holds f/.x-f/.x0=L/.(x-x0)+R/.(x-x0) by A14;
    A20: x0 in N2 by RCOMP_1:16;
    take L,R;
    now let x;
      assume
      A21: x in N2;
      then f/.x-f/.x0=L/.(x-x0)+R/.(x-x0) by A16,A19;
      then (f|Z)/.x-f/.x0=L/.(x-x0)+R/.(x-x0) by A21,A18,PARTFUN2:15;
      hence (f|Z)/.x-(f|Z)/.x0=L/.(x-x0)+R/.(x-x0) by A20,A18,PARTFUN2:15;
    end;
    hence thesis;
  end;
