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
  for f be PartFunc of S,T for Z be Subset of S st Z is open & Z c= dom
f & ex r be Point of T st rng f = {r} holds f is_differentiable_on Z & for x be
Point of S st x in Z holds (f`|Z)/.x = 0.R_NormSpace_of_BoundedLinearOperators(
  S,T)
proof
  let f be PartFunc of S,T;
  let Z be Subset of S such that
A1: Z is open and
A2: Z c= dom f;
  reconsider R = (the carrier of S) --> 0.T as PartFunc of S,T;
  set L = 0.R_NormSpace_of_BoundedLinearOperators(S,T);
  given r be Point of T such that
A3: rng f = {r};
  R_NormSpace_of_BoundedLinearOperators(S,T) = NORMSTR (#
    BoundedLinearOperators(S,T), Zero_(BoundedLinearOperators(S,T),
    R_VectorSpace_of_LinearOperators(S,T)), Add_(BoundedLinearOperators(S,T),
    R_VectorSpace_of_LinearOperators(S,T)), Mult_(BoundedLinearOperators(S,T),
R_VectorSpace_of_LinearOperators(S,T)), BoundedLinearOperatorsNorm(S,T) #) by
LOPBAN_1:def 14;
  then reconsider L as Element of BoundedLinearOperators(S,T);
A4: dom R = the carrier of S;
A5: now
    let h;
    assume  h is non-zero;
A6: now
      let n be Nat;
A7:   R/.(h.n) =R.(h.n) by A4,PARTFUN1:def 6
        .=0.T;
A8:   rng h c= dom R;
A9:   n in NAT by ORDINAL1:def 12;
      thus ((||.h.||")(#)(R/*h)).n = (||.h.||".n)*((R/*h).n) by Def2
        .= (||.h.||".n)*(R/.(h.n)) by A9,A8,FUNCT_2:109
        .= 0.T by A7,RLVECT_1:10;
    end;
    then
A10: (||.h.||")(#)(R/*h) is constant by VALUED_0:def 18;
    hence (||.h.||")(#)(R/*h) is convergent by Th18;
    ((||.h.||")(#)(R/*h)).0 = 0.T by A6;
    hence lim ((||.h.||")(#)(R/*h)) = 0.T by A10,Th18;
  end;
A11: now
    let x0 be Point of S;
    assume
A12: x0 in dom f;
    then f.x0 in {r} by A3,FUNCT_1:def 3;
    then f/.x0 in {r} by A12,PARTFUN1:def 6;
    hence f/.x0 = r by TARSKI:def 1;
  end;
  reconsider R as RestFunc of S,T by A5,Def5;
A13: ((the carrier of S) --> 0.T) = L by LOPBAN_1:31;
A14: now
    let x0 be Point of S;
    assume
A15: x0 in Z;
    then consider N being Neighbourhood of x0 such that
A16: N c= Z by A1,Th2;
A17: N c= dom f by A2,A16;
    for x be Point of S st x in N holds f/.x - f/.x0 = L.(x-x0) + R/.(x- x0)
    proof
      let x be Point of S;
A18:  R/.(x-x0) =R.(x-x0) by A4,PARTFUN1:def 6
        .=0.T;
      assume x in N;
      hence f/.x - f/.x0 = r - f/.x0 by A11,A17
        .= r - r by A2,A11,A15
        .=0.T by RLVECT_1:15
        .= 0.T + 0.T by RLVECT_1:4
        .= L.(x-x0)+R/.(x-x0) by A13,A18;
    end;
    hence f is_differentiable_in x0 by A17;
  end;
  hence
A19: f is_differentiable_on Z by A1,A2,Th31;
  let x0 be Point of S;
  assume
A20: x0 in Z;
  then
A21: f is_differentiable_in x0 by A14;
  then
  ex N being Neighbourhood of x0 st N c= dom f & 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);
  then consider N being Neighbourhood of x0 such that
A22: N c= dom f;
A23: for x be Point of S st x in N holds f/.x - f/.x0 = L.(x-x0) + R/.(x-x0)
  proof
    let x be Point of S;
A24: R/.(x-x0) =R.(x-x0) by A4,PARTFUN1:def 6
      .=0.T;
    assume x in N;
    hence f/.x - f/.x0 = r - f/.x0 by A11,A22
      .=r - r by A2,A11,A20
      .=0.T by RLVECT_1:15
      .= 0.T + 0.T by RLVECT_1:4
      .=L.(x-x0) + R/.(x-x0) by A13,A24;
  end;
  thus (f`|Z)/.x0 = diff(f,x0) by A19,A20,Def9
    .= 0.R_NormSpace_of_BoundedLinearOperators(S,T) by A21,A22,A23,Def7;
end;
