reserve y for object, X for set;
reserve x,x0,x1,x2,g,g1,g2,r,r1,s,p,p1 for Real;
reserve n,m,k for Element of NAT;
reserve Y for Subset of REAL;
reserve Z for open Subset of REAL;
reserve s1,s3 for Real_Sequence;
reserve f,f1,f2 for PartFunc of REAL,REAL;
reserve h for non-zero 0-convergent Real_Sequence;
reserve c for constant Real_Sequence;
reserve R,R1,R2 for RestFunc;
reserve L,L1,L2 for LinearFunc;

theorem Th24:
  for x0 being Real holds f is_differentiable_in x0 implies
  f is_continuous_in x0
proof
  let x0 be Real;
  assume
A1: f is_differentiable_in x0;
  then consider N being Neighbourhood of x0 such that
A2: N c= dom f and
  ex L,R st for x st x in N holds f.x - f.x0 = L.(x-x0) + R.(x-x0);
  now
    consider g be Real such that
A3: 0<g and
A4: N=].x0-g,x0+g.[ by RCOMP_1:def 6;
    set s2 = seq_const x0;
    let s1 such that
A5: rng s1 c= dom f and
A6: s1 is convergent and
A7: lim s1 = x0 and
A8: for n being Nat holds s1.n<>x0;
    consider l be Nat such that
A9: for m being Nat  st l<=m holds |.s1.m-x0.|<g by A6,A7,A3,SEQ_2:def 7;
    reconsider c =s2^\l as constant Real_Sequence;
    deffunc G(Nat) = s1.$1-s2.$1;
    consider s3 such that
A10: for n being Nat holds s3.n=G(n) from SEQ_1:sch 1;
A11: s3=s1-s2 by A10,RFUNCT_2:1;
    then
A12: s3 is convergent by A6;
A13: rng c = {x0}
    proof
      thus rng c c= {x0}
      proof
        let y be object;
        assume y in rng c;
        then consider n such that
A14:    y=(s2^\l).n by FUNCT_2:113;

A15:     s2.(n+l) = x0 by SEQ_1:57;

        y=s2.(n+l) by A14,NAT_1:def 3;
        then y=x0 by A15;
        hence thesis by TARSKI:def 1;
      end;
      let y be object;
      assume y in {x0};
      then
A16:  y=x0 by TARSKI:def 1;
      c.0=s2.(0+l) by NAT_1:def 3
        .= y by A16,SEQ_1:57;
      hence thesis by VALUED_0:28;
    end;
A17: now
      let p be Real such that
A18:  0<p;
       reconsider n=0 as Nat;
      take n;
      let m being Nat such that
      n<=m;
A19: m in NAT by ORDINAL1:def 12;
      x0 in N by RCOMP_1:16;
      then rng c c= dom f by A2,A13,ZFMISC_1:31;
      then |.(f/*c).m-f.x0.|=|.f.(c.m)-f.x0.| by FUNCT_2:108,A19
        .=|.f.(s2.(m+l))-f.x0.| by NAT_1:def 3
        .=|.f.x0-f.x0.| by SEQ_1:57
        .=0 by ABSVALUE:2;
      hence |.(f/*c).m-f.x0.|<p by A18;
    end;
    then
A20: f/*c is convergent by SEQ_2:def 6;
    lim s2 = s2.0 by SEQ_4:26
      .=x0 by SEQ_1:57;
    then lim s3 =x0-x0 by A6,A7,A11,SEQ_2:12
      .=0;
    then
A21: lim(s3^\l)=0 by A12,SEQ_4:20;
A22: now
      given n being Nat such that
A23:  s3.n=0;
      s1.n-s2.n=0 by A10,A23;
      hence contradiction by A8,SEQ_1:57;
    end;
A24: now
      given n being Nat such that
A25:  (s3^\l).n=0;
      s3.(n+l)=0 by A25,NAT_1:def 3;
      hence contradiction by A22;
    end;
    s3^\l is 0-convergent by A12,A21;
    then reconsider h=s3^\l as 0-convergent non-zero Real_Sequence
      by A24,SEQ_1:5;
    now
      let n;
      thus (f/*(h+c)-f/*c+f/*c).n=(f/*(h+c)-f/*c).n+(f/*c).n by SEQ_1:7
        .=(f/*(h+c)).n-(f/*c).n+(f/*c).n by RFUNCT_2:1
        .=(f/*(h+c)).n;
    end;
    then
A26: f/*(h+c)-f/*c+(f/*c)=f/*(h+c) by FUNCT_2:63;
    now
      let n;
      thus (h+c).n=((s1-s2+s2)^\l).n by A11,SEQM_3:15
        .=(s1-s2+s2).(n+l) by NAT_1:def 3
        .=(s1-s2).(n+l)+s2.(n+l) by SEQ_1:7
        .=s1.(n+l)-s2.(n+l)+s2.(n+l) by RFUNCT_2:1
        .=(s1^\l).n by NAT_1:def 3;
    end;
    then
A27: f/*(h+c)-f/*c+(f/*c)=f/*(s1^\l) by A26,FUNCT_2:63
      .=(f/*s1)^\l by A5,VALUED_0:27;
    rng (h+c) c= N
    proof
      let y be object;
      assume y in rng(h+c);
      then consider n such that
A28:  y=(h+c).n by FUNCT_2:113;
      (h+c).n=((s1-s2+s2)^\l).n by A11,SEQM_3:15
        .=(s1-s2+s2).(n+l) by NAT_1:def 3
        .=(s1-s2).(n+l)+s2.(n+l) by SEQ_1:7
        .=s1.(n+l)-s2.(n+l)+s2.(n+l) by RFUNCT_2:1
        .=s1.(l+n);
      then |.(h+c).n-x0.|<g by A9,NAT_1:12;
      hence thesis by A4,A28,RCOMP_1:1;
    end; then
A29: h"(#)(f/*(h+c) - f/*c) is convergent by A1,A2,A13,Th12;
    then
A30: lim (h(#)(h"(#)(f/*(h+c) - f/*c))) =0*lim(h"(#) (f/*(h+c) - f/*c)) by A21,
SEQ_2:15
      .=0;
    now
      let n be Element of NAT;
A31:  h.n<>0 by A24;
      thus (h(#)(h"(#)(f/*(h+c) - f/*c))).n =h.n *(h"(#)(f/*(h+c) - f/*c)).n
      by SEQ_1:8
        .=h.n*((h").n*(f/*(h+c) - f/*c).n) by SEQ_1:8
        .=h.n*(((h.n)")*(f/*(h+c) - f/*c).n) by VALUED_1:10
        .=h.n*((h.n)")*(f/*(h+c) - f/*c).n
        .=1*(f/*(h+c) - f/*c).n by A31,XCMPLX_0:def 7
        .=(f/*(h+c) - f/*c).n;
    end;
    then
A32: h(#)(h"(#)(f/*(h+c) - f/*c))=f/*(h+c)-f/*c by FUNCT_2:63;
    then
A33: f/*(h+c)-f/*c is convergent by A29;
    then
A34: f/*(h+c)-f/*c+f/*c is convergent by A20;
    hence f/*s1 is convergent by A27,SEQ_4:21;
    lim(f/*c)=f.x0 by A17,A20,SEQ_2:def 7;
    then lim(f/*(h+c)-f/*c+f/*c)=0+f.x0 by A30,A32,A33,A20,SEQ_2:6
      .=f.x0;
    hence f.x0=lim(f/*s1) by A34,A27,SEQ_4:22;
  end;
  hence thesis by FCONT_1:2;
end;
