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 Th8:
for m,n be non zero Nat, i be Nat,
    f be PartFunc of REAL-NS m,REAL-NS n,
    Z be Subset of REAL-NS m st Z is open & 1 <= i & i <= m holds
  f is_partial_differentiable_on Z,i
iff
  Z c=dom f &
  for x be Point of REAL-NS m st x in Z holds
    f is_partial_differentiable_in x,i
proof
   let m,n be non zero Nat,
       i be Nat,
       f be PartFunc of REAL-NS m,REAL-NS n,
       Z be Subset of REAL-NS m;
   assume that
A1: Z is open and
A2: 1 <= i & i <= m;
   set S=REAL-NS 1;
   set T=REAL-NS n;
   set RNS= R_NormSpace_of_BoundedLinearOperators(S,T);
   thus f is_partial_differentiable_on Z,i implies Z c=dom f &
         for x be Point of REAL-NS m st x in Z holds
           f is_partial_differentiable_in x,i
   proof
    assume A3: f is_partial_differentiable_on Z,i;
    hence A4: Z c=dom f;
    let nx0 be Point of REAL-NS m;
    reconsider x0=Proj(i,m).nx0 as Point of S;
    assume A5: nx0 in Z;
    then f|Z is_partial_differentiable_in nx0,i by A3;
    then (f|Z)*reproj(i,nx0) is_differentiable_in x0;
    then consider N0 being Neighbourhood of x0 such that
A6:  N0 c= dom((f|Z)*reproj(i,nx0)) and
A7:  ex L be Point of RNS,R be RestFunc of S,T st
      for x be Point of S st x in N0 holds
       ((f|Z)*reproj(i,nx0))/.x-((f|Z)*reproj(i,nx0))/.x0
         = L .( x-x0)+R/.(x-x0) by NDIFF_1:def 6;
    consider L be Point of RNS,R be RestFunc of S,T such that
A8:  for x be Point of S st x in N0 holds
      ((f|Z)*reproj(i,nx0))/.x - ((f|Z)*reproj(i,nx0))/.x0
        = L.(x-x0) + R/.(x-x0) by A7;
    consider N1 being Neighbourhood of x0 such that
A9: for x be Point of S st x in N1 holds
      (reproj(i,nx0)).x in Z by A1,A2,A5,Lm5;
A10: now let x be Point of S;
     assume x in N1;
     then (reproj(i,nx0)).x in Z by A9;
     then (reproj(i,nx0)).x in (dom f) /\ Z by A4,XBOOLE_0:def 4;
     hence (reproj(i,nx0)).x in dom(f|Z) by RELAT_1:61;
    end;
    reconsider N = N0 /\ N1 as  Neighbourhood of x0 by Lm1;
     (f|Z)*reproj(i,nx0) c= f*reproj(i,nx0) by RELAT_1:29,59;
then A11:dom((f|Z)*reproj(i,nx0)) c= dom(f*reproj(i,nx0)) by RELAT_1:11;
     N c= N0 by XBOOLE_1:17;
    then N c= dom((f|Z)*reproj(i,nx0)) by A6;
then A12:N c= dom(f*reproj(i,nx0)) by A11;
     now let x be Point of S;
     assume A13: x in N;
then A14: x in N0 by XBOOLE_0:def 4;
A15: dom(reproj(i,nx0)) = the carrier of REAL-NS 1 by FUNCT_2:def 1;
      x in N1 by A13,XBOOLE_0:def 4;
then A16:(reproj(i,nx0)).x in dom(f|Z) by A10;
then A17: (reproj(i,nx0)).x in dom f & (reproj(i,nx0)).x in Z by RELAT_1:57;
A18:(reproj(i,nx0)).x0 in dom(f|Z) by A10,NFCONT_1:4;
then A19: (reproj(i,nx0)).x0 in dom f & (reproj(i,nx0)).x0 in Z by RELAT_1:57;
A20: ((f|Z)*reproj(i,nx0))/.x
       =(f|Z)/. (reproj(i,nx0)/.x ) by A16,A15,PARTFUN2:4
      .= f/. (reproj(i,nx0)/.x) by A17,PARTFUN2:17
      .= (f*reproj(i,nx0))/.x by A15,A17,PARTFUN2:4;
      ((f|Z)*reproj(i,nx0))/.x0
       =(f|Z)/. (reproj(i,nx0)/.x0 ) by A15,A18,PARTFUN2:4
      .= f/. (reproj(i,nx0)/.x0) by A19,PARTFUN2:17
      .= (f*reproj(i,nx0))/.x0 by A15,A19,PARTFUN2:4;
     hence (f*reproj(i,nx0))/.x-(f*reproj(i,nx0))/.x0 =L.(x-x0)+R/.(x-x0)
       by A8,A14,A20;
    end;
    then f*reproj(i,nx0) is_differentiable_in x0 by A12,NDIFF_1:def 6;
    hence f is_partial_differentiable_in nx0,i;
   end;
   assume that
A21:Z c=dom f and
A22:for nx be Point of REAL-NS m st nx in Z holds
     f is_partial_differentiable_in nx,i;
   thus Z c=dom f by A21;
    now let nx0 be Point of REAL-NS m;
    assume A23: nx0 in Z;
then A24:f is_partial_differentiable_in nx0,i by A22;
    reconsider x0=Proj(i,m).nx0 as Point of S;
     f*reproj(i,nx0) is_differentiable_in x0 by A24;
    then consider N0 being Neighbourhood of x0 such that
      N0 c= dom (f*reproj(i,nx0)) and
A25: ex L be Point of RNS,R be RestFunc of S,T st
      for x be Point of S st x in N0 holds
       (f*reproj(i,nx0))/.x-(f*reproj(i,nx0))/.x0
         = L.(x-x0)+R  /.(x-x0) by NDIFF_1:def 6;
    consider N1 being Neighbourhood of x0 such that
A26: for x be Point of S st x in N1 holds
       (reproj(i,nx0)).x in Z by A1,A2,A23,Lm5;
A27: now let x be Point of S;
     assume x in N1;
     then (reproj(i,nx0)).x in Z by A26;
     then (reproj(i,nx0)).x in (dom f) /\ Z by A21,XBOOLE_0:def 4;
     hence (reproj(i,nx0)).x in dom(f|Z) by RELAT_1:61;
    end;
A28:N1 c= dom((f|Z)*reproj(i,nx0))
    proof
     let z be object;
     assume A29:z in N1;
then A30: z in the carrier of S;
     reconsider x=z as Point of S by A29;
A31: (reproj(i,nx0)).x in dom(f|Z) by A29,A27;
      z in dom (reproj(i,nx0)) by A30,FUNCT_2:def 1;
     hence z in dom((f|Z)*reproj(i,nx0)) by A31,FUNCT_1:11;
    end;
    reconsider N=N0 /\ N1 as  Neighbourhood of x0 by Lm1;
     N c= N1 by XBOOLE_1:17;
then A32:N c= dom((f|Z)*reproj(i,nx0)) by A28;
    consider L be Point of RNS,R be RestFunc of S,T such that
A33: for x be Point of S st x in N0 holds
      (f*reproj(i,nx0))/.x-(f*reproj(i,nx0))/.x0=L.(x-x0)+R/.(x-x0) by A25;
     now let x be Point of S;
     assume A34: x in N;
then A35: x in N0 by XBOOLE_0:def 4;
A36: dom (reproj(i,nx0)) = the carrier of REAL-NS 1 by FUNCT_2:def 1;
      x in N1 by A34,XBOOLE_0:def 4;
then A37:(reproj(i,nx0)).x in dom(f|Z) by A27;
then A38: (reproj(i,nx0)).x in dom f /\ Z by RELAT_1:61;
then A39: (reproj(i,nx0)).x in dom f by XBOOLE_0:def 4;
A40:(reproj(i,nx0)).x0 in dom(f|Z) by A27,NFCONT_1:4;
then A41: (reproj(i,nx0)).x0 in dom f /\ Z by RELAT_1:61;
then A42: (reproj(i,nx0)).x0 in dom f by XBOOLE_0:def 4;
A43: ((f|Z)*reproj(i,nx0))/.x
       = (f|Z)/. (reproj(i,nx0)/.x ) by A37,A36,PARTFUN2:4
      .= f/. (reproj(i,nx0)/.x) by A38,PARTFUN2:16
      .= (f*reproj(i,nx0))/.x by A36,A39,PARTFUN2:4;
      ((f|Z)*reproj(i,nx0))/.x0
       = (f|Z)/. (reproj(i,nx0)/.x0 ) by A36,A40,PARTFUN2:4
      .= f/. (reproj(i,nx0)/.x0) by A41,PARTFUN2:16
      .= (f*reproj(i,nx0))/.x0 by A36,A42,PARTFUN2:4;
     hence ((f|Z)*reproj(i,nx0))/.x -((f|Z)*reproj(i,nx0))/.x0
             = L.(x-x0)+R/.(x-x0) by A43,A35,A33;
    end;
    then (f|Z)*reproj(i,nx0) is_differentiable_in x0 by A32,NDIFF_1:def 6;
    hence (f|Z) is_partial_differentiable_in nx0,i;
   end;
   hence thesis;
end;
