 reserve h,h1 for 0-convergent non-zero Real_Sequence,
         c,c1 for constant Real_Sequence;

theorem Th10:
  for a,b,x be Real, f be PartFunc of REAL,REAL st
   [.a,b.] c= dom f & f|[.a,b.] is continuous & x in [.a,b.[ holds
   f is_right_convergent_in x & lim_right(f|(].a,b.[),x) = f.x
proof
    let a,b,x be Real, f be PartFunc of REAL,REAL;
    assume that
A1:  [.a,b.] c= dom f and
A2:  f|[.a,b.] is continuous and
A3:  x in [.a,b.[;

A4: a <= x & x < b by A3,XXREAL_1:3;

A5: for r be Real st x < r ex g be Real st g < r & x < g & g in dom f
    proof
     let r be Real;
     set r1 = min(r,b);
     assume x < r; then
     consider g be Real such that
A6:   x < g & g < r1 by A4,XXREAL_0:21,XREAL_1:5;
     r1 <= r by XXREAL_0:17; then
A7:  g < r by A6,XXREAL_0:2;
     r1 <= b by XXREAL_0:17; then
     a <= g & g < b by A4,A6,XXREAL_0:2; then
     g in [.a,b.] by XXREAL_1:1;
     hence thesis by A1,A6,A7;
    end;

A8: dom(f|[.a,b.]) = [.a,b.] by A1,RELAT_1:62;
A9: [.a,b.[ c= [.a,b.] by XXREAL_1:24;

    ].a,b.[ c= [.a,b.] by XXREAL_1:25; then
A10: ].a,b.[ c= dom f by A1;

A11: for r be Real st 0 < r
     ex s be Real st x < s & for x1 be Real st x1 < s & x < x1 & x1 in dom f
      holds |. f.x1-f.x .| < r
    proof
     let r be Real;
     assume 0 < r; then
     consider e be Real such that
A12:  0 < e & for x1 be Real st x1 in dom(f|[.a,b.]) & |.x1-x.|<e holds
       |.(f|[.a,b.]).x1 - (f|[.a,b.]).x .| < r by A9,A2,A3,A8,FCONT_1:def 2,3;
     set s1 = x+e;
     set s = min(s1,b);
A13:  s <= s1 & s <= b by XXREAL_0:17;
A14:  x < s1 by A12,XREAL_1:29;

     take s;
     thus x < s by A4,A14,XXREAL_0:21;
     hereby let x1 be Real;
      assume that
A15:    x1 < s and
A16:    x < x1 and
       x1 in dom f;

A17:   x1 - x < s - x by A15,XREAL_1:9;
      s - x <= s1 - x by XXREAL_0:17,XREAL_1:9; then
A18:   x1 - x < s1 - x by A17,XXREAL_0:2;

      x1-x > 0 by A16,XREAL_1:50; then
A19:   |.x1-x.| < e by A18,ABSVALUE:def 1;

      a <= x by A9,A3,XXREAL_1:1; then
A20:   a < x1 & x1 < b by A15,A13,A16,XXREAL_0:2; then
A21:   x1 in dom(f|[.a,b.]) by A8,XXREAL_1:1;
      (f|[.a,b.]).x1 = f.x1 & (f|[.a,b.]).x = f.x
        by A9,A3,A8,A20,XXREAL_1:1,FUNCT_1:47;
      hence |. f.x1-f.x .| < r by A12,A19,A21;
     end;
    end;
    hence
A22: f is_right_convergent_in x by A5,LIMFUNC2:10;

A23: for r be Real st 0 < r
     ex s be Real st x < s &
      for x1 be Real st x1 < s & x < x1 & x1 in dom(f|(].a,b.[))
       holds |. (f|(].a,b.[)).x1 - f.x .| < r
    proof
     let r be Real;
     assume 0 < r; then
     consider s0 be Real such that
A24:   x < s0 & for x1 be Real st x1 < s0 & x < x1 & x1 in dom f
       holds |. f.x1-f.x .| < r by A11;
     set s = min(s0,b);
     for x1 be Real st x1 < s & x < x1 & x1 in dom(f|(].a,b.[))
      holds |. (f|(].a,b.[)).x1 - f.x .| < r
     proof
      let x1 be Real;
      assume that
A25:    x1 < s and
A26:    x < x1 and
A27:    x1 in dom(f|(].a,b.[));

      s <= s0 by XXREAL_0:17; then
A28:   x1 < s0 by A25,XXREAL_0:2;
      x1 in dom f by A27,RELAT_1:57; then
      |. f.x1-f.x .| < r by A24,A28,A26;
      hence |. (f|(].a,b.[)).x1 - f.x .| < r by A27,FUNCT_1:47;
     end;
     hence thesis by A24,A4,XXREAL_0:21;
    end;
    f|(].a,b.[) is_right_convergent_in x &
    lim_right(f|(].a,b.[),x) = lim_right(f,x) by A4,A22,A10,Th8;
    hence lim_right(f|(].a,b.[),x) = f.x by A23,LIMFUNC2:42;
end;
