theorem Th5:
  f is_differentiable_on Z iff Z c= dom f & for x st x in Z holds
  f is_differentiable_in x
proof
  reconsider g=f as PartFunc of REAL,REAL-NS n by REAL_NS1:def 4;
  thus f is_differentiable_on Z implies Z c= dom f & for x st x in Z holds
  f is_differentiable_in x
  proof
    assume A1: f is_differentiable_on Z;
A2: Z c= dom g by A1;
    now
      let x;
      assume x in Z;
      then f|Z is_differentiable_in x by A1;
      hence g|Z is_differentiable_in x;
    end;
    then
A3: g is_differentiable_on Z by A2,NDIFF_3:def 5;
     for x st x in Z holds f is_differentiable_in x by A3,NDIFF_3:10;
    hence thesis by A1;
  end;
  assume
A4: Z c= dom f & for x st x in Z holds f is_differentiable_in x;
    now
      let x;
      assume x in Z;
      then f is_differentiable_in x by A4;
      hence g is_differentiable_in x;
    end;
    then
A5: g is_differentiable_on Z by A4,NDIFF_3:10;
    now
      let x;
      assume x in Z;
      then g|Z is_differentiable_in x by A5,NDIFF_3:def 5;
      hence f|Z is_differentiable_in x;
    end;
    hence f is_differentiable_on Z by A4;
end;
