reserve k, k1, n, n1, m for Nat;
reserve X, y for set;
reserve p for Real;
reserve r for Real;
reserve a, a1, a2, b, b1, b2, x, x0, z, z0 for Complex;
reserve s1, s3, seq, seq1 for Complex_Sequence;
reserve Y for Subset of COMPLEX;
reserve f, f1, f2 for PartFunc of COMPLEX,COMPLEX;
reserve Nseq for increasing sequence of NAT;
reserve h for 0-convergent non-zero Complex_Sequence;
reserve c for constant Complex_Sequence;
reserve R, R1, R2 for C_RestFunc;
reserve L, L1, L2 for C_LinearFunc;
reserve Z for open Subset of COMPLEX;

theorem Th34:
  for x0 be Complex holds f is_differentiable_in x0 implies f
  is_continuous_in x0
proof
  let x0 be Complex;
  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);
A3: x0 in N by Th7;
  now
    consider g be Real such that
A4: 0 < g and
A5: {y where y is Complex : |.y-x0.| < g} c= N by Def5;
    reconsider xx0=x0 as Element of COMPLEX by XCMPLX_0:def 2;
    reconsider s2 = NAT --> xx0 as Complex_Sequence;
    let s1 such that
A6: rng s1 c= dom f and
A7: s1 is convergent and
A8: lim s1 = x0 and
A9: for n holds s1.n <> x0;
    consider l be Nat such that
A10: for m be Nat st l <= m holds |.s1.m-x0.| < g by A7,A8,A4,
COMSEQ_2:def 6;
A11: lim s2 = s2.0 by CFCONT_1:28
      .= x0;
    deffunc G(Nat) = In(s1.$1-s2.$1,COMPLEX);
    consider s3 such that
A12: for n being Element of NAT holds s3.n = G(n) from FUNCT_2:sch 4;
A13: for n holds s3.n = s1.n-s2.n
    proof let n;
     n in NAT by ORDINAL1:def 12;
     then s3.n = G(n) by A12;
     hence thesis;
    end;
A14: s3 = s1-s2 by A13,CFCONT_1:1;
A15: s2 is convergent by CFCONT_1:26;
    then
A16: s3 is convergent by A7,A14;
    lim s3 = lim (s1-s2) by A13,CFCONT_1:1
      .= x0-x0 by A7,A8,A15,A11,COMSEQ_2:26
      .= 0c;
    then
A17: lim(s3^\l) = 0c by A16,CFCONT_1:21;
    reconsider c = s2^\l as constant Complex_Sequence;
A18: now
      given n being Element of NAT such that
A19:  s3.n = 0c;
      s1.n-s2.n = 0c by A13,A19;
      hence contradiction by A9;
    end;
A20: now
      given n being Element of NAT such that
A21:  (s3^\l).n = 0c;
A22:   n+l in NAT by ORDINAL1:def 12;
      s3.(n+l) = 0c by A21,NAT_1:def 3;
      hence contradiction by A18,A22;
    end;
    then
A23: s3^\l is non-zero by COMSEQ_1:4;
    s3^\l is convergent by A16,CFCONT_1:21;
    then reconsider h = s3^\l as 0-convergent non-zero Complex_Sequence
      by A17,A23,Def1;
    now
      let n be Element of NAT;
      thus (f/*(h+c)-f/*c+f/*c).n = (f/*(h+c)-f/*c).n+(f/*c).n by VALUED_1:1
        .= (f/*(h+c)).n-(f/*c).n+(f/*c).n by CFCONT_1:1
        .= (f/*(h+c)).n;
    end;
    then
A24: f/*(h+c)-f/*c+(f/*c) = f/*(h+c);
    now
      let n be Element of NAT;
A25:    n+l in NAT by ORDINAL1:def 12;
      thus (h+c).n = ((s1-s2+s2)^\l).n by A14,Th18
        .= (s1-s2+s2).(n+l) by NAT_1:def 3
        .= (s1-s2).(n+l)+s2.(n+l) by VALUED_1:1,A25
        .= s1.(n+l)-s2.(n+l)+s2.(n+l) by CFCONT_1:1
        .= (s1^\l).n by NAT_1:def 3;
    end;
    then
A26: f/*(h+c)-f/*c+(f/*c) = f/*(s1^\l) by A24,FUNCT_2:63
      .= (f/*s1)^\l by A6,VALUED_0:27;
A27: rng c = {x0}
    proof
      thus rng c c= {x0}
      proof
        let y be object;
        assume y in rng c;
        then consider n being Element of NAT such that
A28:    y = (s2^\l).n by FUNCT_2:113;
A29:    n+l in NAT by ORDINAL1:def 12;
        y = s2.(n+l) by A28,NAT_1:def 3;
        then y = x0 by FUNCOP_1:7,A29;
        hence thesis by TARSKI:def 1;
      end;
      let y be object;
      assume y in {x0};
      then
A30:  y = x0 by TARSKI:def 1;
A31:    0+l in NAT by ORDINAL1:def 12;
      c.0 = s2.(0+l) by NAT_1:def 3
        .= y by A30,FUNCOP_1:7,A31;
      hence thesis by FUNCT_2:4;
    end;
A32: now
      let p be Real such that
A33:  0 < p;
       reconsider n = 0 as Nat;
      take n;
      thus for m st n <= m holds |.(f/*c).m-f/.x0.| < p
      proof
        let m such that
        n <= m;
A34:   m+l in NAT by ORDINAL1:def 12;
A35:   m in NAT by ORDINAL1:def 12;
        {x0} c= dom f by A2,A3,ZFMISC_1:31;
        then |.(f/*c).m-f/.x0.| = |.(f/.(c.m))-f/.x0.|
by A27,FUNCT_2:109,A35
          .= |.f/.(s2.(m+l))-f/.x0.| by NAT_1:def 3
          .= |.f/.x0-f/.x0.| by FUNCOP_1:7,A34
          .= 0 by ABSVALUE:2;
        hence thesis by A33;
      end;
    end;
    then
A36: f/*c is convergent;
    now
      let n be Element of NAT;
A37:  h.n <> 0 by A20;
      thus (h(#)(h"(#)(f/*(h+c)-f/*c))).n = h.n*(h"(#)(f/*(h+c)-f/*c)).n by
VALUED_1:5
        .= h.n*((h").n*(f/*(h+c)-f/*c).n) by VALUED_1:5
        .= 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 A37,XCMPLX_0:def 7
        .= (f/*(h+c)-f/*c).n;
    end;
    then
A38: h(#)(h"(#)(f/*(h+c)-f/*c)) = f/*(h+c)-f/*c;
    rng (h+c) c= N
    proof
      let y be object;
      assume
A39:  y in rng(h+c);
      then consider n being Element of NAT such that
A40:  y = (h+c).n by FUNCT_2:113;
A41:   n+l in NAT by ORDINAL1:def 12;
      reconsider y1 = y as Complex by A39;
      (h+c).n = ((s1-s2+s2)^\l).n by A14,Th18
        .= (s1-s2+s2).(n+l) by NAT_1:def 3
        .= (s1-s2).(n+l)+s2.(n+l) by VALUED_1:1,A41
        .= s1.(n+l)-s2.(n+l)+s2.(n+l) by CFCONT_1:1
        .= s1.(l+n);
      then |.(h+c).n-x0.| < g by A10,NAT_1:12;
      then y1 in {z where z is Complex : |.z-x0.| < g} by A40;
      hence thesis by A5;
    end;
    then
A42: h"(#)(f/*(h+c)-f/*c) is convergent by A1,A2,A27,Th22;
    then
A43: f/*(h+c)-f/*c is convergent by A38;
    then
A44: f/*(h+c)-f/*c+f/*c is convergent by A36;
    hence f/*s1 is convergent by A26,CFCONT_1:22;
    lim (h(#)(h"(#)(f/*(h+c)-f/*c))) = 0c*lim(h"(#)(f/*(h+c)-f/*c)) by A17,A42,
COMSEQ_2:30
      .= 0;
    then lim(f/*(h+c)-f/*c+f/*c) = 0c+lim (f/*c) by A38,A43,A36,COMSEQ_2:14
      .= f/.x0 by A32,A36,COMSEQ_2:def 6;
    hence f/.x0 = lim(f/*s1) by A44,A26,CFCONT_1:23;
  end;
  hence thesis by A2,A3,CFCONT_1:31;
end;
