reserve i,n,m for Nat;

theorem
for m,n be non zero Nat, g be PartFunc of REAL-NS m,REAL-NS n,
    x0 be Point of REAL-NS m holds
g is_differentiable_in x0 iff
(for i be Nat st 1<=i & i <=n holds
      Proj(i,n)*g is_differentiable_in x0)
proof
   let m,n be non zero Nat;
   let g be PartFunc of REAL-NS m,REAL-NS n;
   let x0 be Point of REAL-NS m;
   set RB= R_NormSpace_of_BoundedLinearOperators(REAL-NS m,REAL-NS n);
   (for i be Nat st 1<=i & i<=n holds
      Proj(i,n)*g is_differentiable_in x0) implies
   g is_differentiable_in x0
   proof
    assume A1: for i be Nat st 1 <= i & i <= n holds
                 Proj(i,n)*g is_differentiable_in x0;
    defpred Pd[Nat,Element of REAL] means
     $2 > 0 &
     {y where y is Point of REAL-NS m : ||. y - x0 .|| < $2}
       c= dom (Proj($1,n)*g) &
     ex Ri be RestFunc of REAL-NS m,REAL-NS 1 st
      for x be Point of REAL-NS m st
       x in {y where y is Point of REAL-NS m : ||. y - x0 .|| < $2} holds
        (Proj($1,n)*g)/.x - (Proj($1,n)*g)/.x0
           = (diff((Proj($1,n)*g),x0)).(x-x0) + Ri/.(x-x0);
A2: for k be Nat st k in Seg n ex dk be Element of REAL st Pd[k,dk]
    proof
     let k be Nat;
     assume k in Seg n; then
     1 <= k & k <= n by FINSEQ_1:1; then
     Proj(k,n)*g is_differentiable_in x0 by A1; then
     consider Nk be Neighbourhood of x0 such that
A3:   Nk c= dom (Proj(k,n)*g) & ex Rk be RestFunc of REAL-NS m,REAL-NS 1 st
       for x be Point of REAL-NS m st
        x in Nk holds (Proj(k,n)*g)/.x - (Proj(k,n)*g)/.x0
         = (diff((Proj(k,n)*g),x0)).(x-x0) + Rk/.(x-x0) by NDIFF_1:def 7;
     consider dk be Real such that
A4:   0 < dk & {y where y is Point of REAL-NS m: ||. y-x0 .|| < dk} c= Nk
        by NFCONT_1:def 1;
     reconsider dk as Element of REAL by XREAL_0:def 1;
     take dk;
     thus 0 < dk by A4;
     thus {y where y is Point of REAL-NS m: ||. y-x0 .|| < dk}
            c= dom(Proj(k,n)*g) by A4,A3,XBOOLE_1:1;
     thus ex Rk be RestFunc of REAL-NS m,REAL-NS 1 st
       for x be Point of REAL-NS m st
        x in {y where y is Point of REAL-NS m: ||. y-x0 .|| < dk} holds
         (Proj(k,n)*g)/.x - (Proj(k,n)*g)/.x0
          = (diff((Proj(k,n)*g),x0)).(x-x0)+Rk/.(x-x0)
     proof
      consider Rk be RestFunc of REAL-NS m,REAL-NS 1 such that
A5:    for x be Point of REAL-NS m st
        x in Nk holds (Proj(k,n)*g)/.x - (Proj(k,n)*g)/.x0
                  = (diff((Proj(k,n)*g),x0)).(x-x0) + Rk/.(x-x0) by A3;
      take Rk;
      thus for x be Point of REAL-NS m st
        x in {y where y is Point of REAL-NS m: ||. y-x0 .|| < dk} holds
         (Proj(k,n)*g)/.x - (Proj(k,n)*g)/.x0
           = (diff((Proj(k,n)*g),x0)).(x-x0)+Rk/.(x-x0) by A4,A5;
     end;
    end;
    consider d be FinSequence of REAL such that
A6:  dom d = Seg n & for k be Nat st k in Seg n holds
       Pd[k,d/.k] from RECDEF_1:sch 17(A2);
    set d0 = min d;
    reconsider nn=n as Element of NAT by ORDINAL1:def 12;
    len d = nn by A6,FINSEQ_1:def 3; then
A7:min_p d in dom d by RFINSEQ2:def 2; then
    d/.(min_p d) > 0 by A6; then
A8:d0 > 0 by A7,PARTFUN1:def 6;
    defpred LX[set,set] means
     ex y be Element of REAL n st $2 = y &
      for i be Nat st i in Seg n holds
       y.i = proj(1,1).((diff((Proj(i,n)*g),x0)).$1);
A9: for x be Point of REAL-NS m holds ex y be Point of REAL-NS n st LX[x,y]
    proof
     let x being Point of REAL-NS m;
     defpred YX[Nat,set] means
       $2 = proj(1,1).((diff((Proj($1,n)*g),x0)).x);
A10: for i be Nat st i in Seg n
       ex r being Element of REAL st YX[i,r]
      proof let i be Nat;
       assume i in Seg n;
        proj(1,1).((diff((Proj(i,n)*g),x0)).x) in REAL by XREAL_0:def 1;
       hence thesis;
      end;
     consider y be FinSequence of REAL such that
A11:  dom y = Seg n & for i be Nat st i in Seg n holds YX[i,y/.i]
        from RECDEF_1:sch 17(A10);
      reconsider nn=n as Element of NAT by ORDINAL1:def 12;
     len y = nn by A11,FINSEQ_1:def 3; then
     reconsider y as Element of REAL n by FINSEQ_2:92;
A12: now let i be Nat;
      assume i in Seg n; then
      YX[i,y/.i] & y/.i = y.i by A11,PARTFUN1:def 6;
      hence y.i =proj(1,1).((diff((Proj(i,n)*g),x0)).x);
     end;
     reconsider y0=y as Point of REAL-NS n by REAL_NS1:def 4;
     ex y be Element of REAL n st y0=y &
      for i be Nat st i in Seg n holds
       y.i = proj(1,1).((diff((Proj(i,n)*g),x0)).x) by A12;
     hence ex y0 be Point of REAL-NS n st LX[x,y0];
    end;
    consider L be Function of REAL-NS m,REAL-NS n such that
A13:  for x be Point of REAL-NS m holds LX[x,L.x] from FUNCT_2:sch 3(A9);
A14:for x,y be VECTOR of REAL-NS m holds L.(x+y) = L.x + L.y
    proof
     let x,y be VECTOR of REAL-NS m;
     consider Lx be Element of REAL n such that
A15:   L.x = Lx & for i be Nat st i in Seg n holds
       Lx.i = proj(1,1).((diff((Proj(i,n)*g),x0)).x) by A13;
     consider Ly be Element of REAL n such that
A16:   L.y = Ly & for i be Nat st i in Seg n holds
       Ly.i = proj(1,1).((diff((Proj(i,n)*g),x0)).y) by A13;
     consider Lxy be Element of REAL n such that
A17:   L.(x+y) = Lxy & for i be Nat st i in Seg n holds
       Lxy.i = proj(1,1).((diff((Proj(i,n)*g),x0)).(x+y)) by A13;
     dom Lxy = Seg n by FINSEQ_1:89; then
A18:  dom Lxy = dom (Lx + Ly) by FINSEQ_1:89;
     for i0 be Nat st i0 in dom Lxy holds Lxy.i0 = (Lx + Ly).i0
     proof
      let i0 be Nat;
      reconsider i = i0 as Nat;
      assume i0 in dom Lxy; then
      i in Seg n by FINSEQ_1:89; then
A19:   Lxy.i = proj(1,1).((diff((Proj(i,n)*g),x0)).(x+y)) &
      Lx.i = proj(1,1).((diff((Proj(i,n)*g),x0)).x) &
      Ly.i = proj(1,1).((diff((Proj(i,n)*g),x0)).y) by A15,A16,A17;
      diff((Proj(i,n)*g),x0) is LinearOperator of REAL-NS m,REAL-NS 1
        by LOPBAN_1:def 9; then
A20:   diff((Proj(i,n)*g),x0).(x+y)
        = diff((Proj(i,n)*g),x0).x + diff((Proj(i,n)*g),x0).y
          by VECTSP_1:def 20;
      reconsider Diffxy = diff((Proj(i,n)*g),x0).(x+y)
        as Element of REAL 1 by REAL_NS1:def 4;
      reconsider Diffx = diff((Proj(i,n)*g),x0).x
        as Element of REAL 1 by REAL_NS1:def 4;
      reconsider Diffy = diff((Proj(i,n)*g),x0).y
        as Element of REAL 1 by REAL_NS1:def 4;
      Diffxy = Diffx + Diffy by A20,REAL_NS1:2; then
      Lxy.i0 = (Diffx + Diffy).1 by A19,PDIFF_1:def 1; then
      Lxy.i0 = Diffx.1 + Diffy.1 by RVSUM_1:11; then
      Lxy.i0 = Lx.i0 + Diffy.1 by A19,PDIFF_1:def 1; then
      Lxy.i0 = Lx.i0 + Ly.i0 by A19,PDIFF_1:def 1;
      hence thesis by RVSUM_1:11;
     end; then
     Lxy = Lx + Ly by A18,FINSEQ_1:13;
     hence thesis by A15,A16,A17,REAL_NS1:2;
    end;
    for x be VECTOR of REAL-NS m, r be Real holds L.(r*x) = r*(L.x)
    proof
     let x be VECTOR of REAL-NS m, r be Real;
     consider Lx be Element of REAL n such that
A21:   L.x = Lx & for i be Nat st i in Seg n holds
       Lx.i = proj(1,1).((diff((Proj(i,n)*g),x0)).x) by A13;
     consider Lrx be Element of REAL n such that
A22:   L.(r*x) = Lrx & for i be Nat st i in Seg n holds
       Lrx.i = proj(1,1).((diff((Proj(i,n)*g),x0)).(r*x)) by A13;
     dom (r*Lx) = Seg n by FINSEQ_1:89; then
A23:  dom (r*Lx) = dom Lrx by FINSEQ_1:89;
     for i0 be Nat st i0 in dom (r*Lx) holds (r*Lx).i0 = Lrx.i0
     proof
      let i0 be Nat;
      reconsider i = i0 as Nat;
      assume i0 in dom(r*Lx); then
      i0 in Seg n by FINSEQ_1:89; then
A24:   Lx.i = proj(1,1).((diff((Proj(i,n)*g),x0)).x) &
      Lrx.i = proj(1,1).((diff((Proj(i,n)*g),x0)).(r*x)) by A21,A22;
      diff((Proj(i,n)*g),x0) is LinearOperator of REAL-NS m,REAL-NS 1
        by LOPBAN_1:def 9; then
A25:   diff((Proj(i,n)*g),x0).(r*x)
        = r * diff((Proj(i,n)*g),x0).x by LOPBAN_1:def 5;
      reconsider Diffrx = diff((Proj(i,n)*g),x0).(r*x)
        as Element of REAL 1 by REAL_NS1:def 4;
      reconsider Diffx = diff((Proj(i,n)*g),x0).x
        as Element of REAL 1 by REAL_NS1:def 4;
      Diffrx = r*Diffx by A25,REAL_NS1:3; then
      Lrx.i0 = (r*Diffx).1 by A24,PDIFF_1:def 1; then
      Lrx.i0 = r*(Diffx.1) by RVSUM_1:45; then
      Lrx.i0 = r*(Lx.i0) by A24,PDIFF_1:def 1;
      hence thesis by RVSUM_1:45;
     end; then
     r*Lx = Lrx by A23,FINSEQ_1:13;
     hence thesis by A21,A22,REAL_NS1:3;
    end; then
    reconsider L as LinearOperator of REAL-NS m,REAL-NS n
       by A14,LOPBAN_1:def 5,VECTSP_1:def 20;
    reconsider L0 = L as Point of RB by LOPBAN_1:def 9;
    deffunc RD(Element of REAL-NS m) = g/.($1+x0) - g/.x0 - L.$1;
    consider R be Function of REAL-NS m,REAL-NS n such that
A26:  for x be Element of REAL-NS m holds R.x = RD(x) from FUNCT_2:sch 4;
A27:for x be Element of REAL-NS m, i be Nat st
     i in Seg n & x+x0 in dom g holds
     (Proj(i,n)*R).x
      = (Proj(i,n)*g)/.(x+x0) - (Proj(i,n)*g)/.x0 - (Proj(i,n)*L).x
    proof
     let x be Element of REAL-NS m, i be Nat;
     assume that
A28:  i in Seg n and
A29:  x+x0 in dom g;
     x0 - x0 = 0.(REAL-NS m) by RLVECT_1:15; then
     x0 - x0 = 0*m by REAL_NS1:def 4; then
     ||. x0 - x0 .|| = |. 0*m .| by REAL_NS1:1; then
A30:  ||. x0 - x0 .|| = 0 by EUCLID:7;
A31:  0 < d/.i & {y where y is Point of REAL-NS m : ||. y - x0 .|| < d/.i}
        c= dom (Proj(i,n)*g) by A28,A6; then
     x0 in {y where y is Point of REAL-NS m : ||. y - x0 .|| < d/.i}
        by A30; then
A32:  x0 in dom (Proj(i,n)*g) by A31;
A33:  dom (Proj(i,n)*g) c= dom g by RELAT_1:25;
     reconsider gxx0 = g/.(x+x0), gx0 = g/.x0, Lx = L.x as Element of REAL n
       by REAL_NS1:def 4;
     reconsider Lx1 = L.x as Point of REAL-NS n;
A34:  -gx0 = (-1)*(g/.x0) & -Lx = (-1)*(L.x) by REAL_NS1:3; then
     gxx0 + -gx0 = g/.(x+x0) + (-1)*(g/.x0) by REAL_NS1:2; then
A35:  gxx0 + -gx0 + -Lx = g/.(x+x0) + (-1)*(g/.x0) + (-1)*(L.x)
       by A34,REAL_NS1:2;
     gxx0-gx0 = g/.(x+x0)-g/.x0 by REAL_NS1:5; then
A36:  g/.(x+x0) - g/.x0 - L.x = gxx0 - gx0 - Lx by REAL_NS1:5;
     (Proj(i,n)*R).x = Proj(i,n).(R.x) by FUNCT_2:15; then
     (Proj(i,n)*R).x = Proj(i,n).(g/.(x+x0) - g/.x0 - L.x) by A26; then
     (Proj(i,n)*R).x = Proj(i,n).(g/.(x+x0) + (-1)*(g/.x0))
                         + Proj(i,n).((-1)*(L.x)) by A36,A35,Th26; then
A37:  (Proj(i,n)*R).x = Proj(i,n).(g/.(x+x0)) + Proj(i,n).((-1)*(g/.x0))
                         + Proj(i,n).((-1)*(L.x)) by Th26;
     Proj(i,n).((-1)*(g/.x0)) = (-1)*(Proj(i,n).(g/.x0)) &
     Proj(i,n).((-1)*(Lx1)) = (-1)*(Proj(i,n).(Lx1)) by Th27; then
     (Proj(i,n)*R).x = Proj(i,n).(g/.(x+x0)) + -Proj(i,n).(g/.x0)
                         + (-1)*Proj(i,n).(L.x) by A37,RLVECT_1:16; then
     (Proj(i,n)*R).x = Proj(i,n).(g/.(x+x0)) + -Proj(i,n).(g/.x0)
                         + -Proj(i,n).(L.x) by RLVECT_1:16; then
     (Proj(i,n)*R).x = Proj(i,n).(g/.(x+x0)) - Proj(i,n).(g/.x0)
                         + -Proj(i,n).(L.x) by RLVECT_1:def 11; then
A38:  (Proj(i,n)*R).x = Proj(i,n).(g/.(x+x0)) - Proj(i,n).(g/.x0)
                         - Proj(i,n).(L.x) by RLVECT_1:def 11;
     g/.(x+x0) in the carrier of REAL-NS n &
     g/.x0 in the carrier of REAL-NS n; then
A39:  g/.(x+x0) in dom (Proj(i,n)) & g/.x0 in dom (Proj(i,n)) by FUNCT_2:def 1;
A40:  Proj(i,n).(g/.(x+x0)) = Proj(i,n)/.(g/.(x+x0))
      .= (Proj(i,n)*g)/.(x+x0) by A29,A39,PARTFUN2:4;
     Proj(i,n).(g/.x0) = Proj(i,n)/.(g/.x0)
      .= (Proj(i,n)*g)/.x0 by A32,A33,A39,PARTFUN2:4;
     hence thesis by A38,A40,FUNCT_2:15;
    end;
    for r be Real st r > 0 ex d be Real st d > 0 &
      for z be Point of REAL-NS m st
       z <> 0.(REAL-NS m) & ||. z .|| < d holds (||.z.||"* ||. R/.z .||) < r
    proof
     let r be Real;
     assume A41: r > 0;
     set r0 = (sqrt n)"*r;
A42: sqrt n > 0 by SQUARE_1:25; then
A43: r0 > 0 by A41,XREAL_1:129;
     defpred DD[Nat,Element of REAL] means
      $2 > 0 &
      for z be Point of REAL-NS m st
       z <> 0.(REAL-NS m) & ||. z .|| < $2 holds
        (||. z .||"* ||. (Proj($1,n)*R)/.z .||) < r0;
A44: for k be Nat st k in Seg n ex dd be Element of REAL st DD[k,dd]
     proof
      let k be Nat;
      assume A45: k in Seg n; then
      1 <= k & k <= n by FINSEQ_1:1; then
      Proj(k,n)*g is_differentiable_in x0 by A1; then
      consider Nk be Neighbourhood of x0 such that
A46:    Nk c= dom (Proj(k,n)*g) & ex PR be RestFunc of REAL-NS m,REAL-NS 1 st
        for x be Point of REAL-NS m st x in Nk holds
         (Proj(k,n)*g)/.x - (Proj(k,n)*g)/.x0
           = diff(Proj(k,n)*g,x0).(x-x0) + PR/.(x-x0) by NDIFF_1:def 7;
      consider d0 be Real such that
A47:    0 < d0 & {y where y is Point of REAL-NS m: ||. y-x0 .|| < d0} c= Nk
         by NFCONT_1:def 1;
      consider PR be RestFunc of REAL-NS m,REAL-NS 1 such that
A48:    for x be Point of REAL-NS m st x in Nk holds
        (Proj(k,n)*g)/.x - (Proj(k,n)*g)/.x0
         = diff(Proj(k,n)*g,x0).(x-x0) + PR/.(x-x0) by A46;
      PR is total by NDIFF_1:def 5; then
      consider d1 be Real such that
A49:    d1 > 0 & for z be Point of REAL-NS m st
        z <> 0.(REAL-NS m) & ||. z .|| < d1 holds
         ( ||. z .||"* ||. PR/.z .||) < r0 by A43,NDIFF_1:23;
      reconsider d0,d1 as Real;
      reconsider dd = min(d0,d1) as Element of REAL by XREAL_0:def 1;
      take dd;
      for z be Point of REAL-NS m st z <> 0.(REAL-NS m) & ||. z .|| < dd holds
        (||. z .||"* ||. (Proj(k,n)*R)/.z .||) < r0
      proof
       let z be Point of REAL-NS m;
       assume A50: z <> 0.(REAL-NS m) & ||. z .|| < dd;
       dd <= d1 by XXREAL_0:17; then
       ||. z .|| < d1 by A50,XXREAL_0:2; then
A51:    ( ||. z .||"* ||. PR/.z .||) < r0 by A50,A49;
       dd <= d0 by XXREAL_0:17; then
A52:    ||. z .|| < d0 by A50,XXREAL_0:2;
A53:    z+x0 - x0 = z by RLVECT_4:1; then
A54:    z+x0 in {y where y is Point of REAL-NS m: ||. y-x0 .|| < d0} by A52;
 then
       z+x0 in Nk by A47; then
A55:    z+x0 in dom (Proj(k,n)*g) by A46;
       (Proj(k,n)*g)/.(z+x0) - (Proj(k,n)*g)/.x0
         = diff(Proj(k,n)*g,x0).(z+x0-x0) + PR/.(z+x0-x0) by A54,A47,A48; then
A56:   PR/.z = (Proj(k,n)*g)/.(z+x0) - (Proj(k,n)*g)/.x0
                 - diff(Proj(k,n)*g,x0).z by A53,RLVECT_4:1;
       dom(Proj(k,n)*g) c= dom g by RELAT_1:25; then
A57:    (Proj(k,n)*R).z
        = (Proj(k,n)*g)/.(z+x0) - (Proj(k,n)*g)/.x0 - (Proj(k,n)*L).z
          by A55,A45,A27;
       consider y be Element of REAL n such that
A58:    L.z = y & for i be Nat st i in Seg n holds
         y.i = proj(1,1).((diff((Proj(i,n)*g),x0)).z) by A13;
A59:   y.k = proj(1,1).((diff((Proj(k,n)*g),x0)).z) by A58,A45;
       (diff((Proj(k,n)*g),x0)).z is Element of REAL 1 by REAL_NS1:def 4; then
       consider Dk be Element of REAL such that
A60:    (diff((Proj(k,n)*g),x0)).z = <* Dk *> by FINSEQ_2:97;
       reconsider y1 = y as Point of REAL-NS n by REAL_NS1:def 4;
       dom L = the carrier of REAL-NS m by FUNCT_2:def 1; then
       (Proj(k,n)*L).z = (Proj(k,n)).(L.z) by FUNCT_1:13; then
       (Proj(k,n)*L).z = <* proj(k,n).y1 *> by A58,PDIFF_1:def 4; then
       (Proj(k,n)*L).z = <* proj(1,1).((diff((Proj(k,n)*g),x0)).z) *>
            by A59,PDIFF_1:def 1;
       hence thesis by A51,A56,A57,A60,PDIFF_1:1;
      end;
      hence thesis by A47,A49,XXREAL_0:21;
     end;
     consider dd be FinSequence of REAL such that
A61:  dom dd = Seg n & for i be Nat st i in Seg n holds DD[i,dd/.i]
        from RECDEF_1:sch 17(A44);
     set d = min dd;
     take d;
    reconsider nn=n as Element of NAT by ORDINAL1:def 12;
     len dd = nn by A61,FINSEQ_1:def 3; then
A62: min_p dd in dom dd by RFINSEQ2:def 2; then
A63: dd/.(min_p dd) > 0 by A61;
     for z be Point of REAL-NS m st
      z <> 0.(REAL-NS m) & ||. z .|| < d holds (||.z.||"* ||. R/.z .||) < r
     proof
      let z be Point of REAL-NS m;
      assume A64: z <> 0.(REAL-NS m) & ||. z .|| < d;
      reconsider Rz = R/.z as Element of REAL n by REAL_NS1:def 4;
      reconsider zr = (||. z .|| * r0)^2 as Element of REAL by XREAL_0:def 1;
      reconsider R0 = n |-> zr as Element of n-tuples_on REAL;
      reconsider SRz = sqr Rz as Element of n-tuples_on REAL;
      ||. z .|| <> 0 by A64,NORMSP_0:def 5; then
A65:  ||. z .|| > 0 by NORMSP_1:4;
A66:  for i0 be Nat st i0 in Seg n holds SRz.i0 < R0.i0
      proof
       let i0 be Nat;
       reconsider i = i0 as Nat;
       assume A67: i0 in Seg n; then
       i in dom Rz by FINSEQ_2:124; then
       (sqr Rz).i = sqrreal.(Rz.i) by FUNCT_1:13; then
A68:    (sqr Rz).i = (Rz.i)^2 by RVSUM_1:def 2;
    reconsider nn=n as Element of NAT by ORDINAL1:def 12;
       1 <= i & i <= nn by A67,FINSEQ_1:1; then
       1 <= i & i <= len dd by A61,FINSEQ_1:def 3; then
       d <= dd.i by RFINSEQ2:2; then
       d <= dd/.i by A67,A61,PARTFUN1:def 6; then
       ||. z .|| < dd/.i by A64,XXREAL_0:2; then
       (||. z .||" * ||. (Proj(i,n)*R)/.z .||) < r0 by A64,A67,A61; then
A69:    ||. (Proj(i,n)*R)/.z .|| < r0 / (||. z .||") by A65,XREAL_1:81;
       Rz.i in REAL by XREAL_0:def 1;
       then reconsider Rzi = <* Rz.i *> as Element of REAL 1 by FINSEQ_2:98;
       (Proj(i,n)*R).z = Proj(i,n).(R.z) by FUNCT_2:15; then
       (Proj(i,n)*R).z = <* proj(i,n).Rz *> by PDIFF_1:def 4; then
       (Proj(i,n)*R).z = <* Rz.i *> by PDIFF_1:def 1; then
       ||. (Proj(i,n)*R).z .|| = |. Rzi .| by REAL_NS1:1; then
       |. Rz.i .| < ||. z .|| * r0 by A69,JORDAN2C:10; then
       |. Rz.i .| ^2 < (||. z .|| * r0)^2 by COMPLEX1:46,SQUARE_1:16; then
       (Rz.i0)^2 < (||. z .|| * r0)^2 by COMPLEX1:75;
       hence thesis by A67,A68,FINSEQ_2:57;
      end;
A70:  for i be Nat st i in dom (sqr Rz) holds 0 <= (sqr Rz).i
      proof
       let i be Nat;
       assume i in dom(sqr Rz); then
       i in dom (sqrreal*Rz) & dom(sqrreal*Rz) c= dom Rz by RELAT_1:25; then
       (sqr Rz).i = sqrreal.(Rz.i) by FUNCT_1:13; then
       (sqr Rz).i = (Rz.i)^2 by RVSUM_1:def 2;
       hence thesis by XREAL_1:63;
      end;
A71:  (||. z .|| * r0)^2 >= 0 by XREAL_1:63;
A72:  ex i be Nat st i in Seg n & SRz.i < R0.i
      proof
       take 1;
       1 <= n by NAT_1:14;
       hence 1 in Seg n;
       hence SRz.1 < R0.1 by A66;
      end;
A73:  sqrt n > 0 by SQUARE_1:25;
      for i0 be Nat st i0 in Seg n holds SRz.i0 <= R0.i0 by A66; then
      Sum SRz < Sum R0 by A72,RVSUM_1:83; then
      Sum (sqr Rz) < n * (||. z .|| * r0)^2 by RVSUM_1:80; then
      |. Rz .| < sqrt (n * (||. z .|| * r0)^2)
         by A70,RVSUM_1:84,SQUARE_1:27; then
      |. Rz .| < sqrt n * sqrt (||. z .|| * r0)^2 by A71,SQUARE_1:29; then
      |. Rz .| < sqrt n * |. ||. z .|| * r0 .| by COMPLEX1:72; then
      |. Rz .| < sqrt n * (||. z .|| * r0) by A42,A41,A65,ABSVALUE:def 1; then
      |. Rz .| < sqrt n * r0 * ||. z .||; then
      |. Rz .| / ||. z .|| < sqrt n * r0 by A65,XREAL_1:83; then
      ||. z .||" * ||. R/.z .|| < sqrt n * (sqrt n)"*r by REAL_NS1:1; then
      ||. z .||" * ||. R/.z .|| < 1*r by A73,XCMPLX_0:def 7;
      hence ||. z .||" * ||. R/.z .|| < r;
     end;
     hence thesis by A63,A62,PARTFUN1:def 6;
    end; then
    reconsider R as RestFunc of REAL-NS m,REAL-NS n by NDIFF_1:23;
    set N = {y where y is Point of REAL-NS m : ||. y - x0 .|| < d0};
    reconsider N as Neighbourhood of x0 by A8,NFCONT_1:3;
    now let x be object;
     assume x in N; then
     consider y be Point of REAL-NS m such that
A74:   x = y & ||. y - x0 .|| < d0;
     1 <= n by NAT_1:14; then
A75:  1 in Seg n & 1 in dom d by A6; then
A76:  {z where z is Point of REAL-NS m : ||. z - x0 .|| < d/.1}
        c= dom(Proj(1,n)*g) by A6;
     dom(Proj(1,n)*g) c= dom g by RELAT_1:25; then
A77:  {z where z is Point of REAL-NS m : ||. z - x0 .|| < d/.1} c= dom g
        by A76,XBOOLE_1:1;
    reconsider nn=n as Element of NAT by ORDINAL1:def 12;
     len d = nn by A6,FINSEQ_1:def 3; then
     1 <= len d by NAT_1:14; then
     d0 <= d.1 by RFINSEQ2:2; then
     d0 <= d/.1 by A75,PARTFUN1:def 6; then
     ||. y - x0 .|| < d/.1 by A74,XXREAL_0:2; then
     y in {z where z is Point of REAL-NS m : ||. z - x0 .|| < d/.1};
     hence x in dom g by A74,A77;
    end; then
A78: N c= dom g by TARSKI:def 3;
    ex L be Point of RB, R be RestFunc of REAL-NS m,REAL-NS n st
     for x be Point of REAL-NS m st x in N holds
       g/.x - g/.x0 = L.(x-x0) + R/.(x-x0)
    proof
     take L0;
     take R;
     hereby let x be Point of REAL-NS m;
      assume x in N;
A79:  dom R = the carrier of REAL-NS m by PARTFUN1:def 2;
      R.(x-x0) = g/.(x-x0+x0) - g/.x0 - L.(x-x0) by A26; then
      R.(x-x0) = g/.(x-(x0-x0)) - g/.x0 - L0.(x-x0) by RLVECT_1:29; then
      R.(x-x0) = g/.(x-(x0 + -x0)) - g/.x0 - L0.(x-x0) by RLVECT_1:def 11; then
      R.(x-x0) = g/.(x-0.(REAL-NS m)) - g/.x0 - L0.(x-x0) by RLVECT_1:5; then
      R.(x-x0) = g/.x - g/.x0 - L0.(x-x0) by RLVECT_1:13; then
      R.(x-x0) = g/.x - g/.x0 + -(L0.(x-x0)) by RLVECT_1:def 11; then
      R/.(x-x0) = g/.x - g/.x0 + -(L0.(x-x0)) by A79,PARTFUN1:def 6; then
      L0.(x-x0) + R/.(x-x0)
       = g/.x - g/.x0 + (-(L0.(x-x0)) + L0.(x-x0)) by RLVECT_1:def 3; then
      L0.(x-x0) + R/.(x-x0) = g/.x - g/.x0 + (0.(REAL-NS n)) by RLVECT_1:5;
      hence g/.x - g/.x0 = L0.(x-x0) + R/.(x-x0) by RLVECT_1:4;
     end;
    end;
    hence thesis by A78,NDIFF_1:def 6;
   end;
   hence thesis by Th28;
end;
