reserve x for set;
reserve a,b,d,ra,rb,r0,s1,s2 for Real;
reserve r,s,r1,r2,r3,rc for Real;
reserve p,q,q1,q2 for Point of TOP-REAL 2;
reserve X,Y,Z for non empty TopSpace;

theorem Th3:
  for A being Subset of R^1,a st not a in A & ex b,d st b in A & d
  in A & b<a & a<d holds not A is connected
proof
  let A be Subset of R^1,a;
  assume that
A1: not a in A and
A2: ex b,d st b in A & d in A & b<a & a<d;
  consider b,d such that
A3: b in A and
A4: d in A and
A5: b<a and
A6: a<d by A2;
  set B2={s:s>a};
  set B1={r:r<a};
A7: A c= B1 \/ B2
  proof
    let x be object;
    assume
A8: x in A;
    then reconsider r=x as Real;
    r<a or a<r by A1,A8,XXREAL_0:1;
    then r in B1 or r in B2;
    hence thesis by XBOOLE_0:def 3;
  end;
  B2 c= REAL
  proof
    let x be object;
    assume x in B2;
    then consider r such that
A9:   r=x and r>a;
     r in REAL by XREAL_0:def 1;
    hence thesis by A9;
  end;
  then reconsider C2=B2 as Subset of R^1 by METRIC_1:def 13,TOPMETR:12,def 6;
  B1 c= REAL
  proof
    let x be object;
    assume x in B1;
    then consider r such that
A10:   r=x and r<a;
     r in REAL by XREAL_0:def 1;
    hence thesis by A10;
  end;
  then reconsider C1=B1 as Subset of R^1 by METRIC_1:def 13,TOPMETR:12,def 6;
A11: now
    assume B1 meets B2;
    then consider x being object such that
A12: x in B1 /\ B2 by XBOOLE_0:4;
    x in B2 by A12,XBOOLE_0:def 4;
    then
A13: ex r2 st r2=x & r2>a;
    x in B1 by A12,XBOOLE_0:def 4;
    then ex r1 st r1=x & r1<a;
    hence contradiction by A13;
  end;
  reconsider r1 = d as Element of REAL by XREAL_0:def 1;
  r1 in B2 by A6;
  then d in B2 /\ A by A4,XBOOLE_0:def 4;
  then
A14: B2 meets A by XBOOLE_0:4;
  reconsider r = b as Element of REAL by XREAL_0:def 1;
  r in B1 by A5;
  then b in B1 /\ A by A3,XBOOLE_0:def 4;
  then
A15: B1 meets A by XBOOLE_0:4;
  C1 is open & C2 is open by JORDAN2B:24,25;
  hence thesis by A11,A15,A14,A7,Th1;
end;
