reserve h,h1,h2 for 0-convergent non-zero Real_Sequence,
  c,c1 for constant Real_Sequence,
  f,f1,f2 for PartFunc of REAL,REAL,
  x0,r,r0,r1,r2,g,g1,g2 for Real,
  n0,k,n,m for Element of NAT,
  a,b,d for Real_Sequence,
  x for set;

theorem Th7:
  f is_right_differentiable_in x0 implies f is_Rcontinuous_in x0
proof
  assume
A1: f is_right_differentiable_in x0;
  then consider r such that
A2: r>0 and
A3: [.x0,x0 + r.] c= dom f;
A4: for a st rng a c= right_open_halfline(x0) /\ dom f & a is convergent &
  lim a = x0 holds f/*a is convergent & f.x0 = lim(f/*a)
  proof
  reconsider xx0 = x0 as Element of REAL by XREAL_0:def 1;
    set b = seq_const x0;
    let a such that
A5: rng a c= right_open_halfline(x0) /\ dom f and
A6: a is convergent and
A7: lim a = x0;
    consider r such that
A8: r > 0 and
A9: [.x0, x0 + r.] c= dom f by A1;
    x0 + 0 < x0 + r by A8,XREAL_1:6;
    then consider n0 be Nat such that
A10: for k being Nat st k>=n0 holds a.k < x0 +r by A6,A7,LIMFUNC2:2;
    deffunc F(Nat) = a.$1-b.$1;
    consider d such that
A11: for n being Nat holds d.n = F(n) from SEQ_1:sch 1;
A12: d = a - b by A11,RFUNCT_2:1;
    then
A13: d is convergent by A6;
    reconsider c = b^\n0 as constant Real_Sequence;
A14: rng c = {x0}
    proof
      thus rng c c= {x0}
      proof
        let x be object;
        assume x in rng c;
        then consider n such that
A15:    x = (b^\n0).n by FUNCT_2:113;
        x = b.(n + n0) by A15,NAT_1:def 3;
        then x = x0 by SEQ_1:57;
        hence thesis by TARSKI:def 1;
      end;
      let x be object;
      assume x in {x0};
      then
A16:  x = x0 by TARSKI:def 1;
      c.0 = b.(0 + n0) by NAT_1:def 3
        .= x by A16,SEQ_1:57;
      hence thesis by VALUED_0:28;
    end;
A17: now
      let g be Real such that
A18:  0<g;
       reconsider n=0 as Nat;
      take n;
      let m be Nat such that
      n<=m;
A19:   m in NAT by ORDINAL1:def 12;
      x0 + 0 <= x0 +r by A8,XREAL_1:7;
      then x0 in [.x0, x0 + r.] by XXREAL_1:1;
      then rng c c= dom f by A9,A14,ZFMISC_1:31;
      then |.(f/*c).m-f.x0.| = |.f.(c.m)-f.x0.| by FUNCT_2:108,A19
        .= |.f.(b.(m+n0))-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.|<g by A18;
    end;
    then
A20: f/*c is convergent by SEQ_2:def 6;
    lim b = b.0 by SEQ_4:26
      .= x0 by SEQ_1:57;
    then lim d = x0 - x0 by A6,A7,A12,SEQ_2:12
      .= 0;
    then
A21: lim (d^\n0) = 0 by A13,SEQ_4:20;
A22: for n holds d.n > 0 & d.n <> 0
    proof
      let n;
A23:  d.n = a.n - b.n by A11;
      a.n in rng a by VALUED_0:28;
      then a.n in right_open_halfline(x0) by A5,XBOOLE_0:def 4;
      then a.n in { r1: x0 < r1 } by XXREAL_1:230;
      then
A24:  ex r1 st r1 = a.n & x0 < r1;
      then a.n - x0 > x0 - x0 by XREAL_1:9;
      hence d.n > 0 by A23,SEQ_1:57;
      thus thesis by A23,A24,SEQ_1:57;
    end;
A25: for n being Nat holds (d^\n0).n > 0
    proof
      let n be Nat;
A26:    n+n0 in NAT by ORDINAL1:def 12;
      (d^\n0).n = d.(n + n0) by NAT_1:def 3;
      hence thesis by A22,A26;
    end;
    for n being Nat holds (d^\n0).n <>0
     by A25;
    then d ^\n0 is non-zero by SEQ_1:5;
    then reconsider h = d^\n0 as 0-convergent non-zero Real_Sequence
       by A13,A21,FDIFF_1:def 1;
A27: rng a c= dom f
    by A5,XBOOLE_0:def 4;
    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
A28: f/*(h+c)-f/*c+(f/*c)=f/*(h+c) by FUNCT_2:63;
    now
      let n;
      thus (h+c).n=((a-b+b)^\n0).n by A12,SEQM_3:15
        .= (a-b+b).(n+n0) by NAT_1:def 3
        .= (a-b).(n+n0)+b.(n+n0) by SEQ_1:7
        .= a.(n+n0)-b.(n+n0)+b.(n+n0) by RFUNCT_2:1
        .= (a^\n0).n by NAT_1:def 3;
    end;
    then
A29: f/*(h+c)-f/*c+(f/*c)=f/*(a^\n0) by A28,FUNCT_2:63
      .= (f/*a)^\n0 by A27,VALUED_0:27;
A30: for n holds (a^\n0).n in [.x0, x0 + r.]
    proof
      let n;
      a.(n + n0) in rng a by VALUED_0:28;
      then (a^\n0).n in rng a by NAT_1:def 3;
      then (a^\n0).n in right_open_halfline(x0) by A5,XBOOLE_0:def 4;
      then (a^\n0).n in {g:x0 < g} by XXREAL_1:230;
      then
A31:  ex g st g = (a^\n0).n & x0 < g;
      0 <= n & 0 + n0 = n0;
      then n0 <= n0 + n by XREAL_1:6;
      then a.(n + n0) <= x0 +r by A10;
      then (a^\n0).n <= x0 + r by NAT_1:def 3;
      then (a^\n0).n in {g: x0 <= g & g <= x0 + r} by A31;
      hence thesis by RCOMP_1:def 1;
    end;
    rng (h + c) c= [.x0,x0 + r.]
    proof
      let x be object;
      assume x in rng(h + c);
      then consider n such that
A32:  x = (h+c).n by FUNCT_2:113;
      (h+c).n=((a - b +b)^\n0).n by A12,SEQM_3:15
        .= (a - b + b) .(n + n0) by NAT_1:def 3
        .= (a - b).(n + n0) + b.(n + n0) by SEQ_1:7
        .= a.(n + n0) - b.(n + n0) + b.(n + n0) by RFUNCT_2:1
        .= (a^\n0).n by NAT_1:def 3;
      hence thesis by A30,A32;
    end;
    then rng (h + c) c= dom f by A9;
    then
A33: h"(#)(f/*(h+c) - f/*c) is convergent by A1,A25,A14;
    then
A34: 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;
A35:  h.n<>0 by A25;
      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 A35,XCMPLX_0:def 7
        .= (f/*(h+c) - f/*c).n;
    end;
    then
A36: h(#)(h"(#)(f/*(h+c) - f/*c))=f/*(h+c)-f/*c by FUNCT_2:63;
    then
A37: f/*(h+c)-f/*c is convergent by A33;
    then
A38: f/*(h+c)-f/*c+f/*c is convergent by A20;
    hence f/*a is convergent by A29,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 A34,A36,A37,A20,SEQ_2:6
      .= f.x0;
    hence thesis by A38,A29,SEQ_4:22;
  end;
  x0 + 0 <= x0 +r by A2,XREAL_1:7;
  then x0 in [.x0, x0 + r.] by XXREAL_1:1;
  hence thesis by A3,A4;
end;
