reserve n,m,k for Element of NAT;
reserve x, X,X1,Z,Z1 for set;
reserve s,g,r,p,x0,x1,x2 for Real;
reserve s1,s2,q1 for Real_Sequence;
reserve Y for Subset of REAL;
reserve f,f1,f2 for PartFunc of REAL,REAL;

theorem Th5:
  for f,x0 holds f is_continuous_in x0 iff for N1 being
  Neighbourhood of f.x0 ex N being Neighbourhood of x0 st f.:N c= N1
proof
  let f,x0;
  thus f is_continuous_in x0 implies for N1 being Neighbourhood of f.x0 ex N
  being Neighbourhood of x0 st f.:N c= N1
  proof
    assume
A1: f is_continuous_in x0;
    let N1 be Neighbourhood of f.x0;
    consider N being Neighbourhood of x0 such that
A2: for x1 st x1 in dom f & x1 in N holds f.x1 in N1 by A1,Th4;
    take N;
    now
      let r;
      assume r in f.:N;
      then ex x be Element of REAL st x in dom f & x in N & r=f.x by
PARTFUN2:59;
      hence r in N1 by A2;
    end;
    hence thesis;
  end;
  assume
A3: for N1 being Neighbourhood of f.x0 ex N being Neighbourhood of x0 st
  f.:N c= N1;
  now
    let N1 be Neighbourhood of f.x0;
    consider N being Neighbourhood of x0 such that
A4: f.:N c= N1 by A3;
    take N;
    let x1;
    assume x1 in dom f & x1 in N;
    then f.x1 in f.:N by FUNCT_1:def 6;
    hence f.x1 in N1 by A4;
  end;
  hence thesis by Th4;
end;
