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
  (Z c= dom f & ex r be Point of F st rng f = {r})
  implies f is_differentiable_on Z &
  for x st x in Z holds (f`|Z)/.x = 0.F
  proof
    set R = REAL --> 0.F;
    A1: dom R = REAL;
    now let h;
      now let n be Nat;
        A2: rng h c= dom R;
        A3: n in NAT by ORDINAL1:def 12;
        thus ((h")(#)(R/*h)).n = (h".n)*((R/*h).n) by NDIFF_1:def 2
        .= (h".n)*(R/.(h.n)) by A3,A2,FUNCT_2:108
        .= 0.F by RLVECT_1:10;
      end; then
      (h")(#)(R/*h) is constant
      & ((h")(#)(R/*h)).0 = 0.F by VALUED_0:def 18;
      hence (h")(#)(R/*h) is convergent &
      lim ((h")(#)(R/*h)) = 0.F by NDIFF_1:18;
    end;
    then reconsider R as RestFunc of F by Def1;
    reconsider L = (REAL --> 0.F) as Function of REAL,F;
    now let p be Real;
       reconsider pp=p as Element of REAL by XREAL_0:def 1;
      thus L/.p = L/.pp
      .= (0.F)
      .= p*(0.F) by RLVECT_1:10;
    end;
    then reconsider L as LinearFunc of F by Def2;
    assume
    A4: Z c= dom f;
    given r be Point of F such that
    A5: rng f = {r};
    A6: now let x0;
    assume A7: x0 in dom f;
    then f/.x0 = f.x0 by PARTFUN1:def 6;
    then f/.x0 in {r} by A5,A7,FUNCT_1:def 3;
    hence f/.x0 = r by TARSKI:def 1;
  end;
  A8: now
  let x0;
  assume
  A9: x0 in Z;
  then consider N being Neighbourhood of x0 such that
  A10: N c= Z by RCOMP_1:18;
  A11: N c= dom f by A4,A10;
  for x st x in N holds f/.x - f/.x0 = L/.(x-x0) + R/.(x-x0)
  proof
    let x;
A12:     x-x0 in REAL by XREAL_0:def 1;
    then
    A13: R/.(x-x0)=R.(x-x0) by A1,PARTFUN1:def 6
    .= 0.F by FUNCOP_1:7,A12;
    assume x in N;
    hence f/.x - f/.x0 = r - f/.x0 by A6,A11
    .= r - r by A4,A6,A9
    .=0.F by RLVECT_1:15
    .=L.(x-x0) by FUNCOP_1:7,A12
    .=L/.(x-x0) by A1,PARTFUN1:def 6,A12
    .=L/.(x-x0) + R/.(x-x0) by A13,RLVECT_1:4;
  end;
  hence f is_differentiable_in x0 by A11;
end;
hence
A14: f is_differentiable_on Z by A4,Th10;
let x0;
assume
A15: x0 in Z; then
A16: f is_differentiable_in x0 by A8;
then ex N being Neighbourhood of x0 st N c= dom f & ex L,R st for x st x in
N holds f/.x-f/.x0=L/.(x-x0)+R/.(x-x0);
then consider N being Neighbourhood of x0 such that
A17: N c= dom f;
A18: for x st x in N holds f/.x - f/.x0 = L/.(x-x0) + R/.(x-x0)
proof
  let x;
A19: x-x0 in REAL by XREAL_0:def 1;
  then
  A20: R/.(x-x0)=R.(x-x0) by A1,PARTFUN1:def 6
  .= 0.F by FUNCOP_1:7,A19;
  assume x in N;
  hence f/.x - f/.x0 = r - f/.x0 by A6,A17
  .=r - r by A4,A6,A15
  .=0.F by RLVECT_1:15
  .=L.(x-x0) by FUNCOP_1:7,A19
  .=L/.(x-x0) by A1,PARTFUN1:def 6,A19
  .=L/.(x-x0) + R/.(x-x0) by A20,RLVECT_1:4;
end;
dom ((f`|Z)) = Z by A14,Def6;
hence (f`|Z)/.x0 =(f`|Z).x0 by A15,PARTFUN1:def 6
.= diff(f,x0) by A14,A15,Def6
.= L/.jj by A16,A17,A18,Def4
.=0.F;
end;
