reserve r,r1,r2,g,g1,g2,x0,t for Real;
reserve n,k,m for Element of NAT;
reserve seq for Real_Sequence;
reserve f,f1,f2 for PartFunc of REAL,REAL;

theorem Th1:
  (rng seq c= dom f /\ left_open_halfline(x0) or rng seq c= dom f
  /\ right_open_halfline(x0)) implies rng seq c= dom f \ {x0}
proof
  assume
A1: rng seq c=dom f/\left_open_halfline(x0) or rng seq c=dom f/\
  right_open_halfline(x0);
  let x be object;
  assume
A2: x in rng seq;
  then consider n such that
A3: seq.n=x by FUNCT_2:113;
  now
    per cases by A1;
    suppose
A4:   rng seq c=dom f/\left_open_halfline(x0);
      then seq.n in left_open_halfline(x0) by A2,A3,XBOOLE_0:def 4;
      then seq.n in {g1: g1<x0} by XXREAL_1:229;
      then ex g1 st g1=seq.n & g1<x0;
      then
A5:   not x in {x0} by A3,TARSKI:def 1;
      seq.n in dom f by A2,A3,A4,XBOOLE_0:def 4;
      hence thesis by A3,A5,XBOOLE_0:def 5;
    end;
    suppose
A6:   rng seq c=dom f/\right_open_halfline(x0);
      then seq.n in right_open_halfline(x0) by A2,A3,XBOOLE_0:def 4;
      then seq.n in {g1: x0<g1} by XXREAL_1:230;
      then ex g1 st g1=seq.n & x0<g1;
      then
A7:   not x in {x0} by A3,TARSKI:def 1;
      seq.n in dom f by A2,A3,A6,XBOOLE_0:def 4;
      hence thesis by A3,A7,XBOOLE_0:def 5;
    end;
  end;
  hence thesis;
end;
