reserve D for set;
reserve x,x0,x1,x2,y,y0,y1,y2,z,z0,z1,z2,r,s,t for Real;
reserve p,a,u,u0 for Element of REAL 3;
reserve n,m,k for Element of NAT;
reserve f,f1,f2,f3,g for PartFunc of REAL 3,REAL;
reserve R,R1,R2 for RestFunc;
reserve L,L1,L2 for LinearFunc;

theorem
  for u0 being Element of REAL 3 for N being Neighbourhood of proj(2,3).u0 st
  f is_partial_differentiable_in u0,2 & N c= dom SVF1(2,f,u0) holds
  for h be 0-convergent non-zero Real_Sequence,
  c be constant Real_Sequence st rng c = {proj(2,3).u0} & rng (h+c) c= N
  holds h"(#)(SVF1(2,f,u0)/*(h+c) - SVF1(2,f,u0)/*c) is convergent &
  partdiff(f,u0,2) = lim (h"(#)(SVF1(2,f,u0)/*(h+c) - SVF1(2,f,u0)/*c))
proof
     let u0 be Element of REAL 3;
     let N be Neighbourhood of proj(2,3).u0;
     assume
A1:  f is_partial_differentiable_in u0,2 & N c= dom SVF1(2,f,u0);
     let h be 0-convergent non-zero Real_Sequence,
     c be constant Real_Sequence such that
A2:  rng c = {proj(2,3).u0} & rng (h+c) c= N;
     consider x0,y0,z0 being Real such that
A3:  u0 = <*x0,y0,z0*> & ex N1 being Neighbourhood of y0
     st N1 c= dom SVF1(2,f,u0) & ex L,R st for y st y in N1 holds
     SVF1(2,f,u0).y - SVF1(2,f,u0).y0 = L.(y-y0) + R.(y-y0) by A1,Th14;
     consider N1 be Neighbourhood of y0 such that
A4:  N1 c= dom SVF1(2,f,u0) & ex L,R st for y st y in N1 holds
     SVF1(2,f,u0).y - SVF1(2,f,u0).y0 = L.(y-y0) + R.(y-y0) by A3;
     consider L,R such that
A5:  for y st y in N1 holds
     SVF1(2,f,u0).y - SVF1(2,f,u0).y0 = L.(y-y0) + R.(y-y0) by A4;
A6:  proj(2,3).u0 = y0 by A3,Th2;
     then consider N2 be Neighbourhood of y0 such that
A7:  N2 c= N & N2 c= N1 by RCOMP_1:17;
     consider g be Real such that
A8:  0 < g & N2 = ].y0-g,y0+g.[ by RCOMP_1:def 6;
A9: y0 in N2
     proof
  A10: y0 + 0 < y0 + g by A8,XREAL_1:8;
    y0 - g < y0 - 0 by A8,XREAL_1:44;
       hence thesis by A8,A10;
     end;
     ex n st rng (c^\n) c= N2 & rng ((h+c)^\n) c= N2
     proof
       y0 in rng c by A2,A6,TARSKI:def 1;then
  A11: lim c = y0 by SEQ_4:25;
   h is convergent & lim h = 0;then
  A12: lim (h+c) = 0+y0 by A11,SEQ_2:6
       .= y0;
       consider n being Nat such that
  A13: for m being Nat st n <= m holds |.(h+c).m-y0.| < g
       by A8,A12,SEQ_2:def 7;
  A14: rng (c^\n) = {y0} by A2,A6,VALUED_0:26;
        reconsider n as Element of NAT by ORDINAL1:def 12;
       take n;
       thus rng (c^\n) c= N2
       by A9,A14,TARSKI:def 1;
       let y be object;
       assume y in rng ((h+c)^\n);
       then consider m such that
  A15: y = ((h+c)^\n).m by FUNCT_2:113;
       n + 0 <= n+m by XREAL_1:7;
       then |.(h+c).(n+m)-y0.|<g by A13;
       then -g < (h+c).(m+n) - y0 & (h+c).(m+n) - y0 < g by SEQ_2:1;
       then -g < ((h+c)^\n).m - y0 & ((h+c)^\n).m - y0 < g by NAT_1:def 3;
       then
    y0 +-g < ((h+c)^\n).m & ((h+c)^\n).m < y0 + g by XREAL_1:19,20;
       hence thesis by A8,A15;
     end;
     then consider n such that
A16: rng (c^\n) c= N2 & rng ((h+c)^\n) c= N2;
A17: rng (c^\n) c= dom SVF1(2,f,u0)
     proof
       let y be object;
  A18: rng (c^\n) = rng c by VALUED_0:26;
       assume y in rng (c^\n);
       then y = y0 by A2,A6,A18,TARSKI:def 1;
       then y in N by A7,A9;
       hence thesis by A1;
     end;
A19: rng ((h+c)^\n) c= dom SVF1(2,f,u0)
     by A16,A7,A1;
A20: rng c c= dom SVF1(2,f,u0)
     proof
       let y be object;
       assume y in rng c;
       then y = y0 by A2,A6,TARSKI:def 1;
       then y in N by A7,A9;
       hence thesis by A1;
     end;
A21: rng (h+c) c= dom SVF1(2,f,u0)
     by A2,A1;
A22: for y st y in N2 holds
     SVF1(2,f,u0).y - SVF1(2,f,u0).y0 = L.(y-y0) + R.(y-y0) by A5,A7;
A23: for k holds SVF1(2,f,u0).(((h+c)^\n).k) - SVF1(2,f,u0).((c^\n).k)
     = L.((h^\n).k) + R.((h^\n).k)
     proof
       let k;
       ((h+c)^\n).k in rng ((h+c)^\n) by VALUED_0:28;then
  A24: ((h+c)^\n).k in N2 by A16;
  A25: ((h+c)^\n).k - (c^\n).k = (h^\n + c^\n).k - (c^\n).k by SEQM_3:15
      .= (h^\n).k + (c^\n).k - (c^\n).k by SEQ_1:7
      .= (h^\n).k;
  A26: (c^\n).k in rng (c^\n) by VALUED_0:28;
       rng (c^\n) = rng c by VALUED_0:26;
       then (c^\n).k = y0 by A2,A6,A26,TARSKI:def 1;
       hence thesis by A5,A7,A24,A25;
     end;
A27: L is total by FDIFF_1:def 3;
A28: R is total by FDIFF_1:def 2;
A29: SVF1(2,f,u0)/*((h+c)^\n) - SVF1(2,f,u0)/*(c^\n) = L/*(h^\n) + R/*(h^\n)
     proof
       now
         let k;
         thus (SVF1(2,f,u0)/*((h+c)^\n) - SVF1(2,f,u0)/*(c^\n)).k
         = (SVF1(2,f,u0)/*((h+c)^\n)).k - (SVF1(2,f,u0)/*(c^\n)).k
           by RFUNCT_2:1
        .= SVF1(2,f,u0).(((h+c)^\n).k) - (SVF1(2,f,u0)/*(c^\n)).k
           by A19,FUNCT_2:108
        .= SVF1(2,f,u0).(((h+c)^\n).k) - SVF1(2,f,u0).((c^\n).k)
           by A17,FUNCT_2:108
        .= L.((h^\n).k) + R.((h^\n).k) by A23
        .= (L/*(h^\n)).k + R.((h^\n).k) by A27,FUNCT_2:115
        .= (L/*(h^\n)).k + (R/*(h^\n)).k by A28,FUNCT_2:115
        .= (L/*(h^\n) + R/*(h^\n)).k by SEQ_1:7;
       end;
       hence thesis by FUNCT_2:63;
     end;
A30: (L/*(h^\n) + R/*(h^\n))(#)(h^\n)" is convergent &
     lim ((L/*(h^\n) + R/*(h^\n))(#)(h^\n)") = L.1
     proof
       deffunc F(Nat) = L.1 + ((R/*(h^\n))(#)(h^\n)").$1;
       consider s1 be Real_Sequence such that
  A31: for k being Nat holds s1.k = F(k) from SEQ_1:sch 1;
       consider s such that
  A32: for p1 be Real holds L.p1 = s*p1 by FDIFF_1:def 3;
  A33: L.1 = s*1 by A32
       .= s;
       now
         let m;
    A34: (h^\n).m <> 0 by SEQ_1:5;
         thus ((L/*(h^\n) + R/*(h^\n))(#)(h^\n)").m
         = ((L/*(h^\n) + R/*(h^\n)).m)*((h^\n)").m by SEQ_1:8
         .= ((L/*(h^\n)).m + (R/*(h^\n)).m) * ((h^\n)").m by SEQ_1:7
         .= ((L/*(h^\n)).m)*((h^\n)").m + ((R/*(h^\n)).m)*((h^\n)").m
         .= ((L/*(h^\n)).m)*((h^\n)").m + ((R/*(h^\n))(#)(h^\n)").m
         by SEQ_1:8
         .= ((L/*(h^\n)).m)*((h^\n).m)" + ((R/*(h^\n))(#)(h^\n)").m
         by VALUED_1:10
         .= (L.((h^\n).m))*((h^\n).m)" + ((R/*(h^\n))(#)(h^\n)").m
         by A27,FUNCT_2:115
         .= (s*((h^\n).m))*((h^\n).m)" + ((R/*(h^\n))(#)(h^\n)").m by A32
         .= s*(((h^\n).m)*((h^\n).m)") + ((R/*(h^\n))(#)(h^\n)").m
         .= s*1 + ((R/*(h^\n))(#)(h^\n)").m by A34,XCMPLX_0:def 7
         .= s1.m by A31,A33;
       end;
       then
  A35: (L/*(h^\n) + R/*(h^\n))(#)(h^\n)" = s1 by FUNCT_2:63;
  A36: now
         let r be Real such that
   A37:  0 < r;
         ((h^\n)")(#)(R/*(h^\n)) is convergent &
         lim (((h^\n)")(#)(R/*(h^\n))) = 0 by FDIFF_1:def 2;
         then consider m being Nat such that
   A38:  for k being Nat st m <= k holds
         |.(((h^\n)")(#)(R/*(h^\n))).k-0 .| < r by A37,SEQ_2:def 7;
         take n1 = m;
         let k be Nat such that
   A39:  n1 <= k;
         |.s1.k-L.1.| = |.L.1+((R/*(h^\n))(#)(h^\n)").k-L.1 .| by A31
         .= |.(((h^\n)")(#)(R/*(h^\n))).k-0 .|;
         hence |.s1.k-L.1.| < r by A38,A39;
       end;
       hence (L/*(h^\n)+R/*(h^\n))(#)(h^\n)" is convergent by A35,SEQ_2:def 6;
       hence thesis by A35,A36,SEQ_2:def 7;
     end;
A40: N2 c= dom SVF1(2,f,u0) by A1,A7;
A41: ((L/*(h^\n)+R/*(h^\n))(#)(h^\n)")
     = ((((SVF1(2,f,u0)/*(h+c))^\n)-SVF1(2,f,u0)/*(c^\n))(#)(h^\n)")
     by A21,A29,VALUED_0:27
     .= ((((SVF1(2,f,u0)/*(h+c))^\n)-((SVF1(2,f,u0)/*c)^\n))(#)(h^\n)")
     by A20,VALUED_0:27
     .= ((((SVF1(2,f,u0)/*(h+c))-(SVF1(2,f,u0)/*c))^\n)(#)(h^\n)") by SEQM_3:17
     .= ((((SVF1(2,f,u0)/*(h+c))-(SVF1(2,f,u0)/*c))^\n)(#)((h")^\n))
       by SEQM_3:18
     .= ((((SVF1(2,f,u0)/*(h+c))-(SVF1(2,f,u0)/*c))(#) h")^\n)
       by SEQM_3:19;then
A42: L.1 = lim ((h")(#)((SVF1(2,f,u0)/*(h+c))-(SVF1(2,f,u0)/*c)))
       by A30,SEQ_4:22;
     thus h"(#)(SVF1(2,f,u0)/*(h+c)-SVF1(2,f,u0)/*c) is convergent
     by A30,A41,SEQ_4:21;
     thus thesis by A1,A3,A22,A40,A42,Th17;
end;
