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,S for Z be Subset of S st Z is open & Z c= dom
  f & f|Z = id Z holds f is_differentiable_on Z & for x be Point of S st x in Z
  holds (f`|Z)/.x = id (the carrier of S)
proof
  set L= id (the carrier of S);
  R_NormSpace_of_BoundedLinearOperators(S,S) = NORMSTR (#
    BoundedLinearOperators(S,S), Zero_(BoundedLinearOperators(S,S),
    R_VectorSpace_of_LinearOperators(S,S)), Add_(BoundedLinearOperators(S,S),
    R_VectorSpace_of_LinearOperators(S,S)), Mult_(BoundedLinearOperators(S,S),
R_VectorSpace_of_LinearOperators(S,S)), BoundedLinearOperatorsNorm(S,S) #) & L
  is Lipschitzian LinearOperator of S,S by LOPBAN_1:def 14,LOPBAN_2:3;
  then reconsider L as Point of R_NormSpace_of_BoundedLinearOperators(S,S) by
LOPBAN_1:def 9;
  let f be PartFunc of S,S;
  let Z be Subset of S such that
A1: Z is open;
  reconsider R = (the carrier of S) --> 0.S as PartFunc of S,S;
A2: dom R = (the carrier of S);
  now
    let h;
    assume h is non-zero;

A3: now
      let n be Nat;
A4:   R/.(h.n) =R.(h.n) by A2,PARTFUN1:def 6
        .=0.S;
A5:   rng h c= dom R;
A6:   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 A6,A5,FUNCT_2:109
        .= 0.S by A4,RLVECT_1:10;
    end;
    then
A7: (||.h.||")(#)(R/*h) is constant by VALUED_0:def 18;
    hence (||.h.||")(#)(R/*h) is convergent by Th18;
    ((||.h.||")(#)(R/*h)).0 = 0.S by A3;
    hence lim ((||.h.||")(#)(R/*h)) = 0.S by A7,Th18;
  end;
  then reconsider R as RestFunc of S,S by Def5;
  assume that
A8: Z c= dom f and
A9: f|Z = id Z;
A10: now
    let x be Point of S;
    assume
A11: x in Z;
    then f|Z.x = x by A9,FUNCT_1:18;
    then f.x = x by A11,FUNCT_1:49;
    hence f/.x =x by A8,A11,PARTFUN1:def 6;
  end;
A12: now
    let x0 be Point of S;
    assume
A13: x0 in Z;
    then consider N being Neighbourhood of x0 such that
A14: N c= Z by A1,Th2;
A15: 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;
A16:  R/.(x-x0) =R.(x-x0) by A2,PARTFUN1:def 6
        .=0.S;
      assume x in N;
      hence f/.x - f/.x0 = x - f/.x0 by A10,A14
        .= x - x0 by A10,A13
        .= L.(x-x0)
        .= L.(x-x0) + R/.(x-x0) by A16,RLVECT_1:4;
    end;
    N c= dom f by A8,A14;
    hence f is_differentiable_in x0 by A15;
  end;
  hence
A17: f is_differentiable_on Z by A1,A8,Th31;
  let x0 be Point of S;
  assume
A18: x0 in Z;
  then consider N1 being Neighbourhood of x0 such that
A19: N1 c= Z by A1,Th2;
A20: f is_differentiable_in x0 by A12,A18;
  then ex N being Neighbourhood of x0 st N c= dom f & ex L be Point of
R_NormSpace_of_BoundedLinearOperators(S,S),
 R be RestFunc of S,S 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
A21: N c= dom f;
  consider N2 being Neighbourhood of x0 such that
A22: N2 c= N1 and
A23: N2 c= N by Th1;
A24: N2 c= dom f by A21,A23;
A25: for x be Point of S st x in N2 holds f/.x - f/.x0 = L.(x-x0) + R/.(x-x0 )
  proof
    let x be Point of S;
A26: R/.(x-x0) =R.(x-x0) by A2,PARTFUN1:def 6
      .=0.S;
    assume x in N2;
    then x in N1 by A22;
    hence f/.x - f/.x0 = x - f/.x0 by A10,A19
      .= x - x0 by A10,A18
      .= L.(x-x0)
      .= L.(x-x0) + R/.(x-x0) by A26,RLVECT_1:4;
  end;
  thus (f`|Z)/.x0 = diff(f,x0) by A17,A18,Def9
    .= id the carrier of S by A20,A24,A25,Def7;
end;
