reserve n,m,i,k for Element of NAT;
reserve x,X,X1 for set;
reserve r,p for Real;
reserve s,x0,x1,x2 for Real;
reserve f,f1,f2 for PartFunc of REAL,REAL n;
reserve h for PartFunc of REAL,REAL-NS n;
reserve W for non empty set;

theorem
  f is_continuous_in x0 iff x0 in dom f &
  for N1 be Subset of REAL n
  st ex r be Real st 0 < r &
  {y where y is Element of REAL n: |.y-f/.x0.| < r} = N1
  ex N being Neighbourhood of x0 st f.:N c= N1
proof
  reconsider g= f as PartFunc of REAL,REAL-NS n
    by REAL_NS1:def 4;
  hereby assume f is_continuous_in x0; then
A1: g is_continuous_in x0;
  hence x0 in dom f;
  thus for N1 be Subset of REAL n st ex r be Real st 0 < r &
    {y where y is Element of REAL n: |.y-f/.x0.| < r} = N1
    ex N being Neighbourhood of x0 st f.:N c= N1
  proof
    let N1 be Subset of REAL n;
    given r be Real such that
A2: 0 < r & {y where y is Element of REAL n: |.y-f/.x0.| < r} = N1;
    f/.x0 = g/.x0 by REAL_NS1:def 4; then
A3: { p where p is Element of REAL n : |. p - f/.x0 .| < r }
      = { p where p is Point of REAL-NS n : ||. p - g/.x0 .|| < r } by Th4;
    N1 is Neighbourhood of g/.x0 by A2,A3,NFCONT_1:3;
    then consider N being Neighbourhood of x0 such that
A4: g.:N c= N1 by A1,NFCONT_3:10;
    take N;
    thus f.:N c= N1 by A4;
  end;
end;
assume A5: x0 in dom f & for N1 be Subset of REAL n
 st ex r be Real st 0 < r &
  {y where y is Element of REAL n: |.y-f/.x0.| < r}
   = N1 ex N being Neighbourhood of x0 st f.:N c= N1;
   now let N1 being Neighbourhood of g/.x0;
consider r be Real such that
A6: 0<r and
A7: { p where p is Point of REAL-NS n : ||. p - g/.x0 .|| < r } c= N1
  by NFCONT_1:def 1;
  reconsider rr=r as Real;
A8: 0<rr by A6;
  set N01={ p where p is Element of REAL n : |. p - f/.x0 .| < r };
f/.x0 = g/.x0 by REAL_NS1:def 4; then
A9: { p where p is Element of REAL n: |. p - f/.x0 .| < r }
= { p where p is Point of REAL-NS n : ||. p - g/.x0 .|| < r } by Th4;
now let x be object;
  assume x in N01;
  then ex p be Element of REAL n st p=x & |. p - f/.x0 .| < r;
  hence x in REAL n;
end;
then N01 is Subset of REAL n by TARSKI:def 3;
then consider N being Neighbourhood of x0 such that
A10: f.:N c= N01 by A5,A8;
take N;
thus g.:N c= N1 by A7,A9,A10;
end;
then g is_continuous_in x0 by A5,NFCONT_3:10;
hence thesis;
end;
