reserve x,X for set;
reserve x0,r1,r2,g,g1,g2,p,s for Real;
reserve r for Real;
reserve n,m for Nat;
reserve a,b,d for Real_Sequence;
reserve f for PartFunc of REAL,REAL;

theorem
  f is_continuous_in x0 & f.x0 <> r & (ex N be Neighbourhood of x0 st N
  c= dom f) implies ex N be Neighbourhood of x0 st N c= dom f & for g st g in N
  holds f.g <> r
proof
  assume that
A1: f is_continuous_in x0 and
A2: f.x0 <> r;
  given N be Neighbourhood of x0 such that
A3: N c= dom f;
  consider p be Real such that
A4: 0 < p and
A5: N = ].x0 - p,x0 + p.[ by RCOMP_1:def 6;
  defpred P[Nat,Real] means x0 - p/($1+1) < $2 & $2 < x0 + p
  /($1+1) & f.$2 = r & $2 in dom f;
  assume
A6: for N be Neighbourhood of x0 holds not N c= dom f or ex g st g in N
  & f.g = r;
A7: for n being Element of NAT  ex g be Element of REAL st P[n,g]
  proof
    let n be Element of NAT;
A8: 0 <= n by NAT_1:2;
    then reconsider
    Nn = ].x0 - p/(n+1),x0 + p/(n+1).[ as Neighbourhood of x0 by A4,
RCOMP_1:def 6,XREAL_1:139;
A9: Nn c= dom f
    proof
      let x be object;
      assume x in Nn;
      then consider g2 such that
A10:  g2 = x and
A11:  x0 - p/(n+1) < g2 and
A12:  g2 < x0 + p/(n+1);
      0 + 1 <= n + 1 by A8,XREAL_1:7;
      then
A13:  p/(n+1) <= p/1 by A4,XREAL_1:118;
      then x0 + p/(n+1) <= x0 + p by XREAL_1:7;
      then
A14:  g2 < x0 + p by A12,XXREAL_0:2;
      x0 - p <= x0 - p/(n+1) by A13,XREAL_1:13;
      then x0 - p < g2 by A11,XXREAL_0:2;
      then x in N by A5,A10,A14;
      hence thesis by A3;
    end;
    then consider g such that
A15: g in Nn and
A16: f.g = r by A6;
     reconsider g as Element of REAL by XREAL_0:def 1;
    take g;
    ex g1 st g1 = g & x0 - p/(n+1) < g1 & g1 <x0 + p/(n+1) by A15;
    hence x0 - p/(n+1) < g & g <x0 + p/(n+1);
    thus f.g = r by A16;
    thus thesis by A9,A15;
  end;
  consider d such that
A17: for n being Element of NAT holds P[n,d.n] from FUNCT_2:sch 3(A7);
A18: rng d c= dom f
  proof
    let x be object;
    assume x in rng d;
    then ex n being Element of NAT st x = d.n by FUNCT_2:113;
    hence thesis by A17;
  end;
A19: now
    let r2 be Real such that
A20: 0 < r2;
     reconsider n = 0 as Nat;
    take n;
    let m be Nat such that
    n <= m;
A21:  m in NAT by ORDINAL1:def 12;
    |.(f/*d).m - r.| = |.f.(d.m) - r.| by A18,FUNCT_2:108,A21
      .= |.r - r.| by A17,A21
      .= 0 by ABSVALUE:2;
    hence |.(f/*d).m - r.| < r2 by A20;
  end;
  deffunc F(Nat) = x0 - p/($1+1);
  consider a such that
A22: for n holds a.n = F(n) from SEQ_1:sch 1;
  deffunc F(Nat) = x0 + p/($1+1);
  consider b such that
A23: for n holds b.n = F(n) from SEQ_1:sch 1;
A24: now
    let n;
  n in NAT by ORDINAL1:def 12;
    then x0 - p/(n+1) < d.n & d.n < x0 + p/(n+1) by A17;
    hence a.n <= d.n & d.n <= b.n by A22,A23;
  end;
A25: b is convergent & lim b = x0 by A23,Th6;
  a is convergent & lim a = x0 by A22,Th5;
  then d is convergent & lim d = x0 by A25,A24,SEQ_2:19,20;
  then f/*d is convergent & f.x0 = lim (f/*d) by A1,A18,FCONT_1:def 1;
  hence contradiction by A2,A19,SEQ_2:def 7;
end;
