reserve n for Nat,
        p,p1,p2 for Point of TOP-REAL n,
        x for Real;
reserve n,m for non zero Nat;
reserve i,j for Nat;
reserve f for PartFunc of REAL-NS m,REAL-NS n;
reserve g for PartFunc of REAL m,REAL n;
reserve h for PartFunc of REAL m,REAL;
reserve x for Point of REAL-NS m;
reserve y for Element of REAL m;
reserve X for set;

theorem Th21:
f is_differentiable_in x & 1 <= i & i <= m implies
  f is_partial_differentiable_in x,i &
  partdiff(f,x,i) = diff(f,x) * reproj(i,0.(REAL-NS m))
proof
   assume A1: f is_differentiable_in x;
   assume A2: 1 <= i & i <= m;
   consider N being Neighbourhood of x such that
A3: N c= dom f & ex R be RestFunc of REAL-NS m,REAL-NS n st
     for y be Point of REAL-NS m 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 REAL-NS m,REAL-NS n such that
A4: for y be Point of REAL-NS m st y in N holds
     f/.y-f/.x = diff(f,x).(y-x) + R/.(y-x) by A3;
   consider r0 be Real such that
A5:0 < r0 & {z where z is Point of REAL-NS m : ||. z-x .|| < r0} c= N
      by NFCONT_1:def 1;
   set u = f*reproj(i,x);
   reconsider x0 = Proj(i,m).x as Point of REAL-NS 1;
   set Z=0.(REAL-NS m);
   set Nx0 = {z where z is Point of REAL-NS 1: ||. z-x0 .|| < r0 };
    now let s be object;
    assume s in Nx0;
    then ex z be Point of REAL-NS 1 st s=z & ||. z-x0 .|| < r0;
    hence s in the carrier of REAL-NS 1;
   end;
   then Nx0 is Subset of REAL-NS 1 by TARSKI:def 3;
   then reconsider Nx0 as Neighbourhood of x0 by A5,NFCONT_1:def 1;
A6:
   for xi be Element of REAL-NS 1 st xi in Nx0 holds reproj(i,x).xi in N
   proof
    let xi be Element of REAL-NS 1;
    assume xi in Nx0;
then A7: ex z be Point of REAL-NS 1 st xi=z & ||. z-x0 .|| < r0;
     reproj(i,x).xi-x = reproj(i,Z).(xi-x0) by A2,Th20;
    then ||. reproj(i,x).xi-x .|| < r0 by A2,Th5,A7;
    then
reproj(i,x).xi in {z where z is Point of REAL-NS m: ||. z-x .|| < r0 };
    hence thesis by A5;
   end;
A8:R is total by NDIFF_1:def 5;
then A9:
   dom R = the carrier of REAL-NS m by PARTFUN1:def 2;
   reconsider R1 = R*reproj(i,0.(REAL-NS m))
     as PartFunc of REAL-NS 1 ,REAL-NS n;
A10:dom(reproj(i,0.(REAL-NS m))) = the carrier of REAL-NS 1 by FUNCT_2:def 1;
A11:dom R1 = the carrier of REAL-NS 1 by A8,PARTFUN1:def 2;
    for r be Real st r > 0 ex d be Real st d > 0 &
     for z be Point of REAL-NS 1 st z <> 0.(REAL-NS 1) & ||.z.|| < d
      holds (||.z.||"  * ||. R1/.z .||) < r
   proof
    let r be Real;
    assume r > 0;
    then consider d be Real such that
A12: d > 0 & for z be Point of REAL-NS m st z <> 0.(REAL-NS m) & ||.z.|| < d
      holds (||.z.||"  * ||. R/.z .||) < r by A8,NDIFF_1:23;
    take d;
     now let z be Point of REAL-NS 1;
     assume A13: z <> 0.(REAL-NS 1) & ||.z.|| < d;
A14: ||. reproj(i,Z).z .|| = ||.z.|| by A2,Th5;
      R/.(reproj(i,Z).z) = R.(reproj(i,Z).z) by A9,PARTFUN1:def 6;
     then R/.(reproj(i,Z).z) =R1.z by A10,FUNCT_1:13;
     then R/.(reproj(i,Z).z) =R1/.z by A11,PARTFUN1:def 6;
     hence ||.z.||" * ||. R1/.z .|| < r by A12,A14,A13,Th18,A2;
    end;
    hence thesis by A12;
   end;
   then reconsider R1 as RestFunc of REAL-NS 1,REAL-NS n by A8,NDIFF_1:23;
   reconsider dfx = diff(f,x)
      as Lipschitzian LinearOperator of REAL-NS m,REAL-NS n by LOPBAN_1:def 9;
   reconsider LD1 = dfx*reproj(i,0.(REAL-NS m))
      as Function of REAL-NS 1,REAL-NS n;
A15:now let x,y be Element of REAL-NS 1;
     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 Th14,A2;
    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 REAL-NS 1, 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 Th16,A2;
    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 REAL-NS 1,REAL-NS n
     by A15,LOPBAN_1:def 5,VECTSP_1:def 20;
   reconsider LD1 as Point of
     R_NormSpace_of_BoundedLinearOperators(REAL-NS 1,REAL-NS n)
        by LOPBAN_1:def 9;
    now let s be object;
    assume s in (reproj(i,x)).:Nx0;
    then ex t being Element of REAL-NS 1 st
      t in Nx0 & s = (reproj(i,x)).t by FUNCT_2:65;
    then s in N by A6;
    hence s in dom f by A3;
   end;
then A16:(reproj(i,x)).:Nx0 c= dom f;
    dom(reproj(i,x)) = the carrier of REAL-NS 1 by FUNCT_2:def 1;
then A17:
   Nx0 c= dom u by A16,FUNCT_3:3;
A18:for y be Point of REAL-NS 1 st y in Nx0 holds
     u/.y-u/.x0 = LD1.(y-x0) + R1/.(y-x0)
   proof
    let y be Point of REAL-NS 1;
    assume A19: y in Nx0;
then A20: reproj(i,x).y in N by A6;
    consider q be Element of REAL, z be Element of REAL m  such that
A21: x0 = <*q*> & z = x & reproj(i,x).x0 = reproj(i,z).q by PDIFF_1:def 6;
    reconsider zi=z.i as Element of REAL by XREAL_0:def 1;
     x0 = <* proj(i,m).x *> by PDIFF_1:def 4;
    then q = proj(i,m).z by A21,FINSEQ_1:76;
    then reproj(i,x).x0 = reproj(i,z).(z.i) by A21,PDIFF_1:def 1;
    then reproj(i,x).x0 = Replace(z,i,zi) by PDIFF_1:def 5;
then A22:reproj(i,x).x0 = x by A21,FUNCT_7:35;
A23:x0 in Nx0 by NFCONT_1:4;
A24:reproj(i,x).x0 in N by A6,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,A3,PARTFUN1:def 6;
     u/.x0 = u.x0 by A23,A17,PARTFUN1:def 6;
    then u/.x0 = f.(reproj(i,x).x0) by FUNCT_2:15;
then A26: u/.y-u/.x0 = f/.(reproj(i,x).y) -f/.x by A25,A22,A24,A3,
PARTFUN1:def 6;
     R/.(reproj(i,Z).(y-x0)) = R.(reproj(i,Z).(y-x0)) by A9,PARTFUN1:def 6;
    then R/.(reproj(i,Z).(y-x0)) =R1.(y-x0) by A10,FUNCT_1:13;
then A27: R/.(reproj(i,Z).(y-x0)) =R1/.(y-x0) by A11,PARTFUN1:def 6;
     u/.y-u/.x0 = diff(f,x).(reproj(i,x).y-x) + R/.(reproj(i,x).y-x)
      by A26,A4,A19,A6;
    then u/.y-u/.x0 = dfx.(reproj(i,Z).(y-x0)) + R/.(reproj(i,x).y-x)
      by A2,Th20;
    then u/.y-u/.x0 = dfx.(reproj(i,Z).(y-x0)) + R/.(reproj(i,Z).(y-x0))
      by A2,Th20;
    hence u/.y-u/.x0 = LD1.(y-x0) +  R1/.(y-x0) by A27,FUNCT_2:15;
   end;
then A28:
   u is_differentiable_in x0 by A17,NDIFF_1:def 6;
   hence f is_partial_differentiable_in x,i;
   thus partdiff(f,x,i) = diff(f,x)* reproj(i,0.(REAL-NS m))
     by A28,A17,A18,NDIFF_1:def 7;
end;
