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 Th4:
  0<r implies ].x0-r,x0+r.[ \ {x0} = ].x0-r,x0.[ \/ ].x0,x0+r.[
proof
  assume
A1: 0<r;
  thus ].x0-r,x0+r.[\{x0}c=].x0-r,x0.[ \/ ].x0,x0+r.[
  proof
    let x be object;
    assume
A2: x in ].x0-r,x0+r.[\{x0};
    then consider r1 such that
A3: r1=x;
    x in ].x0-r,x0+r.[ by A2,XBOOLE_0:def 5;
    then x in {g2: x0-r<g2 & g2<x0+r} by RCOMP_1:def 2;
    then
A4: ex g2 st g2=x & x0-r<g2 & g2<x0+r;
    not x in {x0} by A2,XBOOLE_0:def 5;
    then
A5: r1<>x0 by A3,TARSKI:def 1;
    now
      per cases by A5,XXREAL_0:1;
      suppose
        r1<x0;
        then r1 in {g1: x0-r<g1 & g1<x0} by A3,A4;
        then x in ].x0-r,x0.[ by A3,RCOMP_1:def 2;
        hence thesis by XBOOLE_0:def 3;
      end;
      suppose
        x0<r1;
        then r1 in {g1: x0<g1 & g1<x0+r} by A3,A4;
        then x in ].x0,x0+r.[ by A3,RCOMP_1:def 2;
        hence thesis by XBOOLE_0:def 3;
      end;
    end;
    hence thesis;
  end;
  let x be object such that
A6: x in ].x0-r,x0.[\/].x0,x0+r.[;
  now
    per cases by A6,XBOOLE_0:def 3;
    suppose
      x in ].x0-r,x0.[;
      then x in {g1: x0-r<g1 & g1<x0} by RCOMP_1:def 2;
      then consider g1 such that
A7:   g1=x and
A8:   x0-r<g1 and
A9:   g1<x0;
      g1<x0+r by A1,A9,Lm1;
      then x in {g2: x0-r<g2 & g2<x0+r} by A7,A8;
      then
A10:  x in ].x0-r,x0+r.[ by RCOMP_1:def 2;
      not x in {x0} by A7,A9,TARSKI:def 1;
      hence thesis by A10,XBOOLE_0:def 5;
    end;
    suppose
      x in ].x0,x0+r.[;
      then x in {g1: x0<g1 & g1<x0+r} by RCOMP_1:def 2;
      then consider g1 such that
A11:  g1=x and
A12:  x0<g1 and
A13:  g1<x0+r;
      x0-r<g1 by A1,A12,Lm1;
      then x in {g2: x0-r<g2 & g2<x0+r} by A11,A13;
      then
A14:  x in ].x0-r,x0+r.[ by RCOMP_1:def 2;
      not x in {x0} by A11,A12,TARSKI:def 1;
      hence thesis by A14,XBOOLE_0:def 5;
    end;
  end;
  hence thesis;
end;
