reserve i,n,m for Nat;

theorem
for m,n be non zero Nat, f be PartFunc of REAL m,REAL n,
    Z be Subset of REAL m st
 ex Z0 be Subset of REAL-NS m st Z=Z0 & Z0 is open
holds
  ( f is_differentiable_on Z
 iff
    Z c=dom f &
    for x be Element of REAL m st x in Z holds f is_differentiable_in x )
proof
   let m,n be non zero Nat;
   let f be PartFunc of REAL m,REAL n;
   let Z be Subset of REAL m;
   assume ex Z0 be Subset of REAL-NS m st Z=Z0 & Z0 is open; then
   consider Z0 be Subset of REAL-NS m such that
A1:Z=Z0 & Z0 is open;
   the carrier of REAL-NS m = REAL m &
   the carrier of REAL-NS n = REAL n by REAL_NS1:def 4; then
   reconsider g=f as PartFunc of REAL-NS m,REAL-NS n;
A2:
   g is_differentiable_on Z0 iff Z0 c=dom g &
       for x be Point of REAL-NS m st x in Z0 holds g is_differentiable_in x
              by A1,NDIFF_1:31;
   thus f is_differentiable_on Z implies Z c=dom f & for x be Element of REAL m
                           st x in Z holds f is_differentiable_in x
   by A1,A2,Th30,PDIFF_1:def 7;
   assume
A3: Z c=dom f &
    for x be Element of REAL m st x in Z holds f is_differentiable_in x;
   now let y be Point of REAL-NS m;
    reconsider x=y as Element of REAL m by REAL_NS1:def 4;
    assume y in Z0; then
    f is_differentiable_in x by A1,A3; then
    ex g be PartFunc of REAL-NS m,REAL-NS n, y be Point of REAL-NS m st
     f=g & x=y & g is_differentiable_in y by PDIFF_1:def 7;
    hence g is_differentiable_in y;
   end;
   hence f is_differentiable_on Z by A1,A2,A3,Th30;
end;
