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 Th4:
  for f,x0 holds f is_continuous_in x0 iff for N1 being
Neighbourhood of f.x0 ex N being Neighbourhood of x0 st for x1 st x1 in dom f &
  x1 in N holds f.x1 in 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 for x1 st x1 in dom f & x1 in N holds f.x1 in N1
  proof
    assume
A1: f is_continuous_in x0;
    let N1 be Neighbourhood of f.x0;
    consider r such that
A2: 0<r and
A3: N1 = ].f.x0-r,f.x0+r.[ by RCOMP_1:def 6;
    consider s such that
A4: 0<s and
A5: for x1 st x1 in dom f & |.x1-x0.|<s holds |.f.x1-f.x0.|<r by A1,A2,Th3;
    reconsider N=].x0-s,x0+s.[ as Neighbourhood of x0 by A4,RCOMP_1:def 6;
    take N;
    let x1;
    assume that
A6: x1 in dom f and
A7: x1 in N;
    |.x1-x0.|<s by A7,RCOMP_1:1;
    then |.f.x1-f.x0.|<r by A5,A6;
    hence thesis by A3,RCOMP_1:1;
  end;
  assume
A8: for N1 being Neighbourhood of f.x0 ex N being Neighbourhood of x0
  st for x1 st x1 in dom f & x1 in N holds f.x1 in N1;
  now
    let r;
    assume 0<r;
    then reconsider N1 = ].f.x0-r,f.x0+r.[ as Neighbourhood of f.x0 by
RCOMP_1:def 6;
    consider N2 being Neighbourhood of x0 such that
A9: for x1 st x1 in dom f & x1 in N2 holds f.x1 in N1 by A8;
    consider s such that
A10: 0<s and
A11: N2 = ].x0-s,x0+s.[ by RCOMP_1:def 6;
    take s;
    for x1 st x1 in dom f & |.x1-x0.|<s holds |.f.x1-f.x0.|<r
    proof
      let x1;
      assume that
A12:  x1 in dom f and
A13:  |.x1-x0.|<s;
      x1 in N2 by A11,A13,RCOMP_1:1;
      then f.x1 in N1 by A9,A12;
      hence thesis by RCOMP_1:1;
    end;
    hence 0<s & for x1 st x1 in dom f & |.x1-x0.|<s holds |.f.x1-f.x0.|<r by
A10;
  end;
  hence thesis by Th3;
end;
