reserve x,x0,x1,x2,y,y0,y1,y2,r,r1,s,p,p1 for Real;
reserve z,z0 for Element of REAL 2;
reserve n,m,k for Element of NAT;
reserve Z for Subset of REAL 2;
reserve s1 for Real_Sequence;
reserve f,f1,f2 for PartFunc of REAL 2,REAL;
reserve R,R1,R2 for RestFunc;
reserve L,L1,L2 for LinearFunc;

theorem
  z = <*x0,y0*> & f is_partial_differentiable_in z,2 implies partdiff(f,
  z,2) = diff(SVF1(2,f,z),y0)
proof
  set r = partdiff(f,z,2);
  assume that
A1: z = <*x0,y0*> and
A2: f is_partial_differentiable_in z,2;
  consider x1,y1 being Real such that
A3: z = <*x1,y1*> and
A4: ex N being Neighbourhood of y1 st N c= dom SVF1(2,f,z) & ex L,R st r
= L.1 & for y st y in N holds SVF1(2,f,z).y - SVF1(2,f,z).y1 = L.(y-y1) + R.(y-
  y1) by A1,A2,Th12;
  y0 = y1 by A1,A3,FINSEQ_1:77;
  then consider N being Neighbourhood of y0 such that
  N c= dom SVF1(2,f,z) and
A5: ex L,R st r = L.1 & for y st y in N holds SVF1(2,f,z).y - SVF1(2,f,z
  ).y0 = L.(y-y0) + R.(y-y0) by A4;
  consider L,R such that
A6: r = L.1 and
A7: for y st y in N holds SVF1(2,f,z).y - SVF1(2,f,z).y0 = L.(y-y0) + R.
  (y-y0) by A5;
  consider r1 such that
A8: for p holds L.p = r1*p by FDIFF_1:def 3;
A9: r = r1*1 by A6,A8;
  consider x2,y2 such that
A10: z = <*x2,y2*> and
A11: SVF1(2,f,z) is_differentiable_in y2 by A2,Th6;
  consider N1 being Neighbourhood of y2 such that
  N1 c= dom SVF1(2,f,z) and
A12: ex L,R st diff(SVF1(2,f,z),y2) = L.1 & for y st y in N1 holds SVF1(
  2 ,f,z).y - SVF1(2,f,z).y2 = L.(y-y2) + R.(y-y2) by A11,FDIFF_1:def 5;
  consider L1,R1 such that
A13: diff(SVF1(2,f,z),y2) = L1.1 and
A14: for y st y in N1 holds SVF1(2,f,z).y - SVF1(2,f,z).y2 = L1.(y-y2) +
  R1.(y-y2) by A12;
  consider p1 such that
A15: for p holds L1.p = p1*p by FDIFF_1:def 3;
A16: y0 = y2 by A1,A10,FINSEQ_1:77;
  then consider N0 be Neighbourhood of y0 such that
A17: N0 c= N & N0 c= N1 by RCOMP_1:17;
  consider g be Real such that
A18: 0 < g and
A19: N0 = ].y0-g,y0+g.[ by RCOMP_1:def 6;
  deffunc F(Nat) = g/($1+2);
  consider s1 such that
A20: for n being Nat holds s1.n = F(n) from SEQ_1:sch 1;
  now
    let n be Nat;
    g/(n+2) <> 0 by A18,XREAL_1:139;
    hence s1.n <> 0 by A20;
  end;
  then
A21: s1 is non-zero by SEQ_1:5;
  s1 is convergent & lim s1 = 0 by A20,SEQ_4:31;
  then reconsider h = s1 as 0-convergent non-zero Real_Sequence
   by A21,FDIFF_1:def 1;
A22: for n ex y st y in N & y in N1 & h.n = y-y0
  proof
    let n;
    take y0+g/(n+2);
    0+1 < n+1+1 by XREAL_1:6;
    then g/(n+2) < g/1 by A18,XREAL_1:76;
    then
A23: y0+g/(n+2) < y0+g by XREAL_1:6;
    g/(n+2) > 0 by A18,XREAL_1:139;
    then y0+-g < y0+g/(n+2) by A18,XREAL_1:6;
    then y0+g/(n+2) in ].y0-g,y0+g.[ by A23;
    hence thesis by A17,A19,A20;
  end;
A24: diff(SVF1(2,f,z),y2) = p1*1 by A13,A15;
A25: now
    let y;
    assume that
A26: y in N and
A27: y in N1;
    SVF1(2,f,z).y - SVF1(2,f,z).y0 = L.(y-y0) + R.(y-y0) by A7,A26;
    then L.(y-y0) + R.(y-y0) = L1.(y-y0) + R1.(y-y0) by A14,A16,A27;
    then r1*(y-y0) + R.(y-y0) = L1.(y-y0) + R1.(y-y0) by A8;
    hence
    r*(y-y0) + R.(y-y0) = diff(SVF1(2,f,z),y2)*(y-y0) + R1.(y-y0) by A15,A9,A24
;
  end;
  reconsider rd = r - diff(SVF1(2,f,z),y2) as Element of REAL by XREAL_0:def 1;
  now
    R1 is total by FDIFF_1:def 2;
    then dom R1 = REAL by PARTFUN1:def 2;
    then
A28: rng h c= dom R1;
    let n be Nat;
    R is total by FDIFF_1:def 2;
    then dom R = REAL by PARTFUN1:def 2;
    then
A29: rng h c= dom R;
A30: n in NAT by ORDINAL1:def 12;
    then ex y st y in N & y in N1 & h.n = y-y0 by A22;
    then r*(h.n) + R.(h.n) = diff(SVF1(2,f,z),y2)*(h.n) + R1.(h.n) by A25;
    then
A31: (r*(h.n))/(h.n) + (R.(h.n))/(h.n) = (diff(SVF1(2,f,z),y2)*(h.n) + R1.
    (h.n))/(h.n) by XCMPLX_1:62;
A32: (R.(h.n))/(h.n) = (R.(h.n))*(h.n)" by XCMPLX_0:def 9
      .= (R.(h.n))*(h".n) by VALUED_1:10
      .= ((R/*h).n)*(h".n) by A30,A29,FUNCT_2:108
      .= ((h")(#)(R/*h)).n by SEQ_1:8;
A33: h.n <> 0 by SEQ_1:5;
A34: (R1.(h.n))/(h.n) = (R1.(h.n))*(h.n)" by XCMPLX_0:def 9
      .= (R1.(h.n))*(h".n) by VALUED_1:10
      .= ((R1/*h).n)*(h".n) by A30,A28,FUNCT_2:108
      .= ((h")(#)(R1/*h)).n by SEQ_1:8;
A35: (diff(SVF1(2,f,z),y2)*(h.n))/(h.n) = diff(SVF1(2,f,z),y2)*((h.n)/(h.n
    )) by XCMPLX_1:74
      .= diff(SVF1(2,f,z),y2)*1 by A33,XCMPLX_1:60
      .= diff(SVF1(2,f,z),y2);
    (r*(h.n))/(h.n) = r*((h.n)/(h.n)) by XCMPLX_1:74
      .= r*1 by A33,XCMPLX_1:60
      .= r;
    then
    r + (R.(h.n))/(h.n) = diff(SVF1(2,f,z),y2) + (R1.(h.n))/(h.n) by A31,A35,
XCMPLX_1:62;
    then r = diff(SVF1(2,f,z),y2) + (((h")(#)(R1/*h)).n - ((h")(#)(R/*h)).n)
    by A32,A34;
    hence rd = (((h")(#)(R1/*h))-((h")(#)(R/*h))).n by
RFUNCT_2:1;
  end;
  then ((h")(#)(R1/*h))-((h")(#)(R/*h)) is constant & (((h")(#)(R1/*h))-((h")
  (#)(R /*h))).1 = r-diff(SVF1(2,f,z),y2) by VALUED_0:def 18;
  then
A36: lim (((h")(#)(R1/*h))-((h")(#)(R/*h))) = r-diff(SVF1(2,f,z),y2) by
SEQ_4:25;
A37: (h")(#)(R1/*h) is convergent & lim ((h")(#)(R1/*h)) = 0 by FDIFF_1:def 2;
  (h")(#)(R/*h) is convergent & lim ((h")(#)(R/*h)) = 0 by FDIFF_1:def 2;
  then r-diff(SVF1(2,f,z),y2) = 0-0 by A36,A37,SEQ_2:12;
  hence thesis by A1,A10,FINSEQ_1:77;
end;
