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

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

A4: dom(f|(].a,b.[)) = ].a,b.[ by A2,RELAT_1:62;

A5: for r be Real st x < r
     ex g be Real st g < r & x < g & g in dom(f|(].a,b.[))
    proof
     let r be Real;
     assume A6: x < r;

     set s = min(r,b);
     consider g be Real such that
A7:   x < g & g < s by A6,A1,XXREAL_0:21,XREAL_1:5;
A8:  s <= r & s <= b by XXREAL_0:17; then
A9:  g < r by A7,XXREAL_0:2;
     a < g & g < b by A1,A7,A8,XXREAL_0:2;
     hence thesis by A7,A9,A4,XXREAL_1:4;
    end;

A10: for r be Real st 0 < r
     ex d be Real st x < d & for x1 be Real st x1 < d & x < x1 &
      x1 in dom(f|(].a,b.[)) holds
       |. (f|(].a,b.[)).x1 - lim_right(f,x) .| < r
    proof
     let r be Real;
     assume 0 < r; then
     consider d0 be Real such that
A11:   x < d0 &
      for x1 be Real st x1 < d0 & x < x1 & x1 in dom f holds
       |. f.x1 - lim_right(f,x) .| < r by A3,LIMFUNC2:42;
     set d = min(d0,b);

     for x1 be Real st x1 < d & x < x1 & x1 in dom(f|(].a,b.[))
      holds |. (f|(].a,b.[)).x1 - lim_right(f,x) .| < r
     proof
      let x1 be Real;
      assume that
A12:    x1 < d and
A13:    x < x1 and
A14:    x1 in dom(f|(].a,b.[));

      d <= d0 by XXREAL_0:17; then
A15:   x1 < d0 by A12,XXREAL_0:2;
      x1 in dom f by A14,RELAT_1:57; then
      |. f.x1 - lim_right(f,x) .| < r by A15,A13,A11;
      hence |. (f|(].a,b.[)).x1 - lim_right(f,x) .| < r by A14,FUNCT_1:47;
     end;
     hence thesis by A11,A1,XXREAL_0:21;
    end;
    hence f|(].a,b.[) is_right_convergent_in x by A5,LIMFUNC2:10;
    hence lim_right(f|(].a,b.[),x) = lim_right(f,x) by A10,LIMFUNC2:42;
end;
