 reserve j for set;
 reserve p,r for Real;
 reserve S,T,F for RealNormSpace;
 reserve x0 for Point of S;
 reserve g for PartFunc of S,T;
 reserve c for constant sequence of S;
 reserve R for RestFunc of S,T;
 reserve G for RealNormSpace-Sequence;
 reserve i for Element of dom G;
 reserve f for PartFunc of product G,F;
 reserve x for Element of product G;
reserve G for RealNormSpace-Sequence;
reserve F for RealNormSpace;
reserve i for Element of dom G;
reserve f,f1,f2 for PartFunc of product G, F;
reserve x for Point of product G;
reserve X for set;

theorem Th41:
 for G be RealNormSpace-Sequence,
      S be RealNormSpace,
      f be PartFunc of product G, S,
      x be Point of product G,
      i be set
  st f is_differentiable_in x holds
    f is_partial_differentiable_in x,i
  & partdiff(f,x,i) = diff(f,x) * reproj(In(i,dom G),0.(product G))
proof
   let G be RealNormSpace-Sequence,
       S be RealNormSpace,
       f be PartFunc of product G, S,
       x be Point of product G,
       i0 be set;
   assume
A1: f is_differentiable_in x;
   set i=In(i0,dom G);
   consider N being Neighbourhood of x such that
A2: N c= dom f &
    ex R be RestFunc of product G,S st
     for y be Point of product G  st y in N holds
      f/.y-f/.x = diff(f,x).(y-x) + R/.(y-x) by A1,NDIFF_1:def 7;

   consider R be RestFunc of product G,S such that
A3: for y be Point of product G  st y in N holds
     f/.y-f/.x = diff(f,x).(y-x) + R/.(y-x) by A2;

   consider r0 be Real such that
A4: 0 < r0 &
    {z where z is Point of product G  : ||. z-x .|| < r0} c= N
      by NFCONT_1:def 1;

   set u = f*reproj(i,x);
   reconsider x0 = proj(i).x as Point of G.i;
   set Z=0.(product G);
   set Nx0 = {z where z is Point of G.i: ||. z-x0 .|| < r0 };
   now let s be object;
    assume s in Nx0; then
    ex z be Point of G.i st s=z & ||. z-x0 .|| < r0;
    hence s in the carrier of G.i;
   end; then
   Nx0 is Subset of G.i by TARSKI:def 3; then
   reconsider Nx0 as Neighbourhood of x0 by A4,NFCONT_1:def 1;

A5:for xi be Element of G.i st xi in Nx0 holds reproj(i,x).xi in N
   proof
    let xi be Element of G.i;
    assume xi in Nx0; then
A6: ex z be Point of G.i st xi=z & ||. z-x0 .|| < r0;
    reproj(i,x).xi-x = reproj(i,Z).(xi-x0) by Th22; then
    ||. reproj(i,x).xi-x .|| < r0 by Th21,A6; then
    reproj(i,x).xi in {z where z is Point of product G : ||. z-x .|| < r0 };
    hence thesis by A4;
   end;

A7:R is total by NDIFF_1:def 5; then
A8:dom R = the carrier of product G by PARTFUN1:def 2;
   reconsider R1 = R*reproj(i,0.(product G)) as PartFunc of G.i,S;
A9:
   dom(reproj(i,0.(product G))) = the carrier of G.i by FUNCT_2:def 1;

A10:
   dom R1 = the carrier of G.i by A7,PARTFUN1:def 2;

   for r be Real st r > 0
    ex d be Real st d > 0 &
     for z be Point of G.i st z <> 0.(G.i) & ||.z.|| < d
      holds (||.z.||"  * ||. R1/.z .||) < r
   proof
    let r be Real;
    assume r > 0; then
    consider d be Real such that
A11: d > 0 &
     for z be Point of product G  st z <> 0.(product G ) & ||.z.|| < d
      holds (||.z.||"  * ||. R/.z .||) < r by A7,NDIFF_1:23;
    take d;
    now let z be Point of G.i;
     assume A12: z <> 0.(G.i) & ||.z.|| < d;
A13: ||. reproj(i,Z).z .|| = ||.z.|| by Th21;

     R/.(reproj(i,Z).z) = R.(reproj(i,Z).z) by A8,PARTFUN1:def 6; then
     R/.(reproj(i,Z).z) =R1.z by A9,FUNCT_1:13; then
     R/.(reproj(i,Z).z) =R1/.z by A10,PARTFUN1:def 6;
     hence ||.z.||" * ||. R1/.z .|| < r by A11,A13,A12,Th38;
    end;
    hence thesis by A11;
   end; then
   reconsider R1 as RestFunc of G.i,S by A7,NDIFF_1:23;

   reconsider dfx = diff(f,x)
      as Lipschitzian LinearOperator of product G,S by LOPBAN_1:def 9;
   reconsider LD1 = dfx*reproj(i,0.(product G )) as Function of G.i,S;
A14:
   now let x,y be Element of G.i;
    LD1.(x+y) = dfx.(reproj(i,Z).(x+y)) by FUNCT_2:15; then
    LD1.(x+y) =dfx.(reproj(i,Z).x+reproj(i,Z).y) by Th34; then
    LD1.(x+y) =dfx.(reproj(i,Z).x)+dfx.(reproj(i,Z).y)
      by VECTSP_1:def 20; then
    LD1.(x+y) =LD1.x+dfx.(reproj(i,Z).y) by FUNCT_2:15;
    hence LD1.(x+y) =LD1.x+LD1.y by FUNCT_2:15;
   end;

   now let x be Element of G.i, a be Real;
    LD1.(a*x) = dfx.(reproj(i,Z).(a*x)) by FUNCT_2:15; then
    LD1.(a*x) = dfx.(a*(reproj(i,Z).x)) by Th39; then
    LD1.(a*x) =a*dfx.(reproj(i,Z).x) by LOPBAN_1:def 5;
    hence LD1.(a*x) =a*LD1.x by FUNCT_2:15;
   end; then
   reconsider LD1 as LinearOperator of G.i,S
     by A14,LOPBAN_1:def 5,VECTSP_1:def 20;

   consider K0 being Real such that
A15:  0 <= K0 & for x being
   VECTOR of product G holds ||. dfx.x .|| <= K0 * ||. x .||
      by LOPBAN_1:def 8;

   now let r being  VECTOR of G.i;
    ||. dfx.(reproj(i,Z).r) .|| <= K0 * ||. reproj(i,Z).r .|| by A15; then
    ||. dfx.(reproj(i,Z).r ) .|| <= K0 * ||.r.|| by Th21;
    hence ||. LD1.r .|| <= K0 * ||.r.|| by FUNCT_2:15;
   end; then
   LD1 is Lipschitzian by A15; then
   reconsider LD1 as Point of
     R_NormSpace_of_BoundedLinearOperators(G.i,S) by LOPBAN_1:def 9;
   now let s be object;
    assume s in (reproj(i,x)).:Nx0; then
    ex t being Element of G.i st
      t in Nx0 & s = (reproj(i,x)).t by FUNCT_2:65;
    hence s in dom f by A2,A5;
   end; then
A16:
   (reproj(i,x)).:Nx0 c= dom f;
   dom(reproj(i,x)) = the carrier of G.i by FUNCT_2:def 1; then
A17:
   Nx0 c= dom u by A16,FUNCT_3:3;
A18:
   for y be Point of G.i st y in Nx0 holds
     u/.y-u/.x0 = LD1.(y-x0) + R1/.(y-x0)
   proof
    let y be Point of G.i;
    assume A19: y in Nx0; then
A20:reproj(i,x).y in N by A5;
A21:  reproj(i,x).x0 = x +* (i,x0) by Def4;
A22:  the carrier of (product G) = product carr G by Th10;
    x.i=x0 by Def3,A22; then
A23:x= x +* (i,x0) by FUNCT_7:35;
A24:reproj(i,x).x0 in N by A5,NFCONT_1:4;
    u/.y = u.y by A19,A17,PARTFUN1:def 6; then
    u/.y = f.(reproj(i,x).y) by FUNCT_2:15; then
A25:u/.y = f/.(reproj(i,x).y) by A20,A2,PARTFUN1:def 6;
    R/.(reproj(i,Z).(y-x0)) = R.(reproj(i,Z).(y-x0))
       by A8,PARTFUN1:def 6; then
    R/.(reproj(i,Z).(y-x0)) = R1.(y-x0) by A9,FUNCT_1:13; then
A26:R/.(reproj(i,Z).(y-x0)) = R1/.(y-x0) by A10,PARTFUN1:def 6;
    x0 in Nx0 by NFCONT_1:4; then
    u/.x0 = u.x0 by A17,PARTFUN1:def 6; then
    u/.x0 = f.(reproj(i,x).x0) by FUNCT_2:15; then
    u/.y-u/.x0 = f/.(reproj(i,x).y) -f/.x
       by A25,A23,A24,A2,A21,PARTFUN1:def 6; then
    u/.y-u/.x0 = diff(f,x).(reproj(i,x).y-x) + R/.(reproj(i,x).y-x)
      by A3,A19,A5; then
    u/.y-u/.x0 = dfx.(reproj(i,Z).(y-x0)) + R/.(reproj(i,x).y-x) by Th22; then
    u/.y-u/.x0 = dfx.(reproj(i,Z).(y-x0)) + R/.(reproj(i,Z).(y-x0)) by Th22;
    hence u/.y-u/.x0 = LD1.(y-x0) +  R1/.(y-x0) by A26,FUNCT_2:15;
   end;
   hence f is_partial_differentiable_in x,i0 by A17,NDIFF_1:def 6;
   u is_differentiable_in x0 by A17,A18,NDIFF_1:def 6;
   hence thesis by A17,A18,NDIFF_1:def 7;
end;
