reserve m,n for non zero Element of NAT;
reserve i,j,k for Element of NAT;
reserve Z for set;

theorem Th60:
for X be Subset of REAL m, f be PartFunc of REAL m,REAL, i being Nat st
 X is open & 1 <= i & i <= m holds
  ( f is_partial_differentiable_on X,i
     iff
    X c=dom f &
    for x be Element of REAL m st x in X holds
     f is_partial_differentiable_in x,i )
proof
   let X be Subset of REAL m, f be PartFunc of REAL m,REAL, i be Nat;
   assume that
A1: X is open and
A2: 1 <= i & i <= m;
   thus f is_partial_differentiable_on X,i implies X c=dom f &
         for x be Element of REAL m st x in X holds
           f is_partial_differentiable_in x,i
   proof
    assume A3: f is_partial_differentiable_on X,i;
    hence A4: X c=dom f;
    let nx0 be Element of REAL m;
    reconsider x0=proj(i,m).nx0 as Element of REAL;
    assume A5: nx0 in X; then
    f|X is_partial_differentiable_in nx0,i by A3; then
    consider N0 being Neighbourhood of x0 such that
A6:  N0 c= dom((f|X)*reproj(i,nx0)) and
A7:  ex L be LinearFunc,R be RestFunc st
      for x be Real st x in N0 holds
       ((f|X)*reproj(i,nx0)).x-((f|X)*reproj(i,nx0)).x0
         = L.( x-x0)+R.(x-x0) by FDIFF_1:def 4;
    consider L be LinearFunc,R be RestFunc such that
A8:  for x be Real st x in N0 holds
      ((f|X)*reproj(i,nx0)).x - ((f|X)*reproj(i,nx0)).x0
        = L.(x-x0) + R.(x-x0) by A7;
    consider N1 being Neighbourhood of x0 such that
A9: for x be Element of REAL st x in N1 holds
      (reproj(i,nx0)).x in X by A1,A2,A5,Lm2;
A10:now let x be Element of REAL;
     assume x in N1; then
     (reproj(i,nx0)).x in X by A9; then
     (reproj(i,nx0)).x in dom f /\ X by A4,XBOOLE_0:def 4;
     hence (reproj(i,nx0)).x in dom(f|X) by RELAT_1:61;
    end;
    consider N being Neighbourhood of x0 such that
A11: N c= N0 & N c= N1 by RCOMP_1:17;
    (f|X)*reproj(i,nx0) c= f*reproj(i,nx0) by RELAT_1:29,59; then
    dom((f|X)*reproj(i,nx0)) c= dom(f*reproj(i,nx0)) by RELAT_1:11; then
A13:N c= dom(f*reproj(i,nx0)) by A6,A11;
    now let xx be Real;
      reconsider x=xx as Element of REAL by XREAL_0:def 1;
     assume A14: xx in N; then
     (reproj(i,nx0)).x in dom(f|X) by A10,A11; then
A15: (reproj(i,nx0)).x in dom f & (reproj(i,nx0)).x in X by RELAT_1:57;
     (reproj(i,nx0)).x0 in dom(f|X) by A10,RCOMP_1:16; then
A16: (reproj(i,nx0)).x0 in dom f & (reproj(i,nx0)).x0 in X by RELAT_1:57;
A17: dom(reproj(i,nx0)) = REAL by FUNCT_2:def 1; then
A18: ((f|X)*reproj(i,nx0)).x =(f|X).(reproj(i,nx0).x) by FUNCT_1:13
       .= f.(reproj(i,nx0).x) by A15,FUNCT_1:49
       .= (f*reproj(i,nx0)).x by A17,FUNCT_1:13;
     ((f|X)*reproj(i,nx0)).x0 =(f|X).(reproj(i,nx0).x0) by A17,FUNCT_1:13
       .= f.(reproj(i,nx0).x0) by A16,FUNCT_1:49
       .= (f*reproj(i,nx0)).x0 by A17,FUNCT_1:13;
     hence (f*reproj(i,nx0)).xx-(f*reproj(i,nx0)).x0 =L.(xx-x0)+R.(xx-x0)
       by A8,A14,A11,A18;
    end;
    hence f is_partial_differentiable_in nx0,i by A13,FDIFF_1:def 4;
   end;
   assume that
A19:X c=dom f and
A20:for nx be Element of REAL m st nx in X holds
     f is_partial_differentiable_in nx,i;
   thus X c=dom f by A19;
   now let nx0 be Element of REAL m;
    assume A21: nx0 in X; then
A22:f is_partial_differentiable_in nx0,i by A20;
    reconsider x0=proj(i,m).nx0 as Element of REAL;
    consider N0 being Neighbourhood of x0 such that
     N0 c= dom (f*reproj(i,nx0)) and
A23: ex L be LinearFunc,R be RestFunc st
      for x be Real st x in N0 holds
       (f*reproj(i,nx0)).x-(f*reproj(i,nx0)).x0
         = L.(x-x0)+R.(x-x0) by FDIFF_1:def 4,A22;
    consider N1 being Neighbourhood of x0 such that
A24: for x be Element of REAL st x in N1 holds
       (reproj(i,nx0)).x in X by A1,A2,A21,Lm2;
A25:now let x be Element of REAL;
     assume x in N1; then
     (reproj(i,nx0)).x in X by A24; then
     (reproj(i,nx0)).x in dom f /\ X by A19,XBOOLE_0:def 4;
     hence (reproj(i,nx0)).x in dom(f|X) by RELAT_1:61;
    end;

A26:N1 c= dom((f|X)*reproj(i,nx0))
    proof
     let z be object;
     assume A27:z in N1; then
A28: z in REAL;
     reconsider x=z as Element of REAL by A27;
A29: (reproj(i,nx0)).x in dom(f|X) by A27,A25;
     z in dom reproj(i,nx0) by A28,FUNCT_2:def 1;
     hence z in dom((f|X)*reproj(i,nx0)) by A29,FUNCT_1:11;
    end;
    consider N being Neighbourhood of x0 such that
A30: N c= N0 & N c= N1 by RCOMP_1:17;
A31:N c= dom((f|X)*reproj(i,nx0)) by A30,A26;
    consider L be LinearFunc,R be RestFunc such that
A32: for x be Real st x in N0 holds
      (f*reproj(i,nx0)).x-(f*reproj(i,nx0)).x0=L.(x-x0)+R.(x-x0) by A23;
    now let xx be Real;
     assume A33: xx in N;
     reconsider x=xx as Element of REAL by XREAL_0:def 1;
A34: dom reproj(i,nx0) = REAL by FUNCT_2:def 1;
     (reproj(i,nx0)).x in dom(f|X) by A25,A33,A30; then
A35: (reproj(i,nx0)).x in dom f /\ X by RELAT_1:61;
     (reproj(i,nx0)).x0 in dom(f|X) by A25,RCOMP_1:16; then
A36: (reproj(i,nx0)).x0 in dom f /\ X by RELAT_1:61;
A37: ((f|X)*reproj(i,nx0)).x = (f|X).(reproj(i,nx0)/.x) by A34,FUNCT_1:13
       .= f.(reproj(i,nx0).x) by A35,FUNCT_1:48
       .= (f*reproj(i,nx0)).x by A34,FUNCT_1:13;
     ((f|X)*reproj(i,nx0)).x0 = (f|X).(reproj(i,nx0).x0) by A34,FUNCT_1:13
       .= f.(reproj(i,nx0).x0) by A36,FUNCT_1:48
       .= (f*reproj(i,nx0)).x0 by A34,FUNCT_1:13;
     hence ((f|X)*reproj(i,nx0)).xx -((f|X)*reproj(i,nx0)).x0
             = L.(xx-x0)+R.(xx-x0) by A37,A33,A32,A30;
    end;
    hence (f|X) is_partial_differentiable_in nx0,i by A31,FDIFF_1:def 4;
   end;
   hence thesis;
end;
