
theorem Th27:
for x0 be Real, f be PartFunc of REAL,REAL holds
 f is_Lcontinuous_in x0 iff
 x0 in dom f &
 for e be Real st 0<e ex d be Real st 0 < d &
  for x be Real st x in dom f & x0-d < x & x < x0 holds
    |. f.x - f.x0 .| < e
proof
    let x0 be Real, f be PartFunc of REAL,REAL;
    hereby assume
A1:  f is_Lcontinuous_in x0;
     hence x0 in dom f by FDIFF_3:def 1;
     given e be Real such that
A2:   0<e and
A3:   for d be Real holds
       not 0<d or
       ex x1 be Real st x1 in dom f & x0-d < x1 & x1 < x0
        & not |.f.x1-f.x0.|<e;

     defpred P[Element of NAT,Real] means
      $2 in dom f & x0-1/($1+1) < $2 & $2 < x0 & not |.f.$2-f.x0.|<e;


A4:  for n be Element of NAT ex p being Element of REAL st P[n,p]
     proof
      let n be Element of NAT;
      ex p be Real st
       p in dom f & x0-1/(n+1) < p & p < x0 & not |.f.p-f.x0.|<e by A3;
      hence thesis;
     end;
     consider s1 be Real_Sequence such that
A5:   for n be Element of NAT holds P[n,s1.n] from FUNCT_2:sch 3(A4);

     now let x be Real;
      assume x in rng s1; then
      consider n be Element of NAT such that
A6:    x=s1.n by FUNCT_2:113;
A7:   x in dom f by A5,A6;
      x in ].-infty,x0.[ by A5,A6,XXREAL_1:233; then
      x in left_open_halfline x0 by PROB_1:def 10;
      hence x in left_open_halfline x0 /\ dom f by A7,XBOOLE_0:def 4;
     end; then
A8:  rng s1 c= left_open_halfline x0 /\ dom f;
A9:  now
      let n be Nat;
A10:   n in NAT by ORDINAL1:def 12; then
A11:   n in dom s1 by FUNCT_2:def 1;
A12:   f/*s1 = f*s1 by A8,XBOOLE_1:18,FUNCT_2:def 11;
      not |.f.(s1.n)-f.x0.|<e by A5,A10;
      hence not |.(f/*s1).n-f.x0.|<e by FUNCT_1:13,A11,A12;
     end;
A13: now let d be Real;
      assume
A14:   0<d;
      consider n being Nat such that
A15:   d"<n by SEQ_4:3;
      d"+(0 qua Nat) <n+1 by A15,XREAL_1:8; then
A16:  1/(n+1)<1/d" by A14,XREAL_1:76;
       take k=n;
      let m be Nat;
A17:  m in NAT by ORDINAL1:def 12;
      assume k<=m;
      then k+1<=m+1 by XREAL_1:6;
      then 1/(m+1)<=1/(k+1) by XREAL_1:118;
      then
A18:   1/(m+1)<d by A16,XXREAL_0:2;
      x0-1/(m+1) < s1.m & s1.m < x0 by A5,A17; then
A19:   x0-s1.m < 1/(m+1) & 0 < x0-s1.m by XREAL_1:11,50; then
      |. x0-s1.m .| = x0-s1.m by ABSVALUE:def 1; then
      |. -(s1.m - x0) .| < d by A18,A19,XXREAL_0:2;
      hence |.s1.m-x0.|<d by COMPLEX1:52;
     end; then
A20: s1 is convergent by SEQ_2:def 6;
     then lim s1=x0 by A13,SEQ_2:def 7;
     then f/*s1 is convergent & f.x0=lim(f/*s1) by A1,A8,A20,FDIFF_3:def 1;
     then consider n being Nat such that
A21:  for m being Nat st n<=m holds |.(f/*s1).m-f.x0.|<e by A2,SEQ_2:def 7;
     |.(f/*s1).n-f.x0.|<e by A21;
     hence contradiction by A9;
    end;

    assume
A22: x0 in dom f &
     for e be Real st 0<e ex d be Real st 0 < d &
      for x be Real st x in dom f & x0-d < x & x < x0 holds
       |. f.x - f.x0 .| < e;
    now let s1 be Real_Sequence such that
A23:  rng s1 c= left_open_halfline x0 /\ dom f and
A24:  s1 is convergent & lim s1 = x0;
A25: now let p be Real;
      assume 0<p;
      then consider d be Real such that
A26:   0<d and
A27:   for x1 be Real st x1 in dom f & x0-d < x1 & x1 < x0 holds
         |.f.x1-f.x0.|<p by A22;
      consider n being Nat such that
A28:   for m being Nat  st n<=m holds |.s1.m-x0.|<d by A24,A26,SEQ_2:def 7;
      take k=n;
      let m be Nat;
A29:  m in NAT by ORDINAL1:def 12;
      assume
       k<=m; then
A30:   s1.m in rng s1 & |.s1.m-x0.|<d by A28,VALUED_0:28;
A31:   m in dom s1 by A29,FUNCT_2:def 1;
A32:   rng s1 c= left_open_halfline x0 & rng s1 c= dom f
         by A23,XBOOLE_1:18; then
      s1.m in left_open_halfline x0 by VALUED_0:28; then
A33:   s1.m in ].-infty,x0.[ by PROB_1:def 10; then
A34:   s1.m < x0 by XXREAL_1:233;
A35:   0 < x0-s1.m by A33,XREAL_1:50,XXREAL_1:233;
      f/*s1 = f*s1 by A23,XBOOLE_1:18,FUNCT_2:def 11; then
A36:  (f/*s1).m = f.(s1.m) by A31,FUNCT_1:13;
      |. -(x0-s1.m) .| < d by A30; then
      |. x0-s1.m .| < d by COMPLEX1:52; then
      x0-s1.m < d by A35,ABSVALUE:def 1; then
      x0-d < s1.m by XREAL_1:11;
      hence |.(f/*s1).m - f.x0.|<p by A36,A27,A30,A32,A34;
     end;
     then f/*s1 is convergent by SEQ_2:def 6;
     hence f/*s1 is convergent & f.x0 = lim (f/*s1) by A25,SEQ_2:def 7;
    end;
    hence f is_Lcontinuous_in x0 by A22,FDIFF_3:def 1;
end;
