
theorem
  for a, b being Real holds a <> b iff Cl ].a,b.[ = [.a,b.]
proof
  let a, b be Real;
  thus a <> b implies Cl ].a,b.[ = [.a,b.]
  proof
    assume
A1: a <> b;
    per cases by A1,XXREAL_0:1;
    suppose
A2:   a > b;
      hence Cl ].a,b.[ = {} by MEASURE6:60,XXREAL_1:28
        .= [.a,b.] by A2,XXREAL_1:29;
    end;
    suppose
A3:   a < b;
      then
A4:   (a+b)/2 < b by XREAL_1:226;
      thus Cl ].a,b.[ c= [.a,b.] by MEASURE6:57,XXREAL_1:25;
      let p be object;
A5:   ].a,b.[ = {w where w is Real: a < w & w < b } by RCOMP_1:def 2;
      assume
A6:   p in [.a,b.];
      [.a,b.] = {w where w is Real: a <= w & w <= b } by RCOMP_1:def 1;
      then consider r being Real such that
A7:   p = r and
A8:   a <= r and
A9:   r <= b by A6;
      a < (a+b)/2 by A3,XREAL_1:226;
      then
A10:  (a+b)/2 in ].a,b.[ by A5,A4;
      now
        per cases by A8,A9,XXREAL_0:1;
        case
A11:      a < r & r < b;
A12:      ].a,b.[ c= Cl ].a,b.[ by MEASURE6:58;
          r in ].a,b.[ by A5,A11;
          hence thesis by A7,A12;
        end;
        case
A13:      a = r;
          for O being open Subset of REAL st a in O holds O /\ ].a,b.[ is
          non empty
          proof
            let O be open Subset of REAL;
            assume a in O;
            then consider g being Real such that
A14:        0 < g and
A15:        ].a-g,a+g.[ c= O by RCOMP_1:19;
A16:        a-g < a-0 by A14,XREAL_1:15;
A17:        ]. a-g,a+g.[ = {w where w is Real: a-g < w & w < a+g } by
RCOMP_1:def 2;
            per cases;
            suppose
A18:          a+g < b;
A19:          a+0 < a+g by A14,XREAL_1:6;
              then
A20:          a < (a+(a+g))/2 by XREAL_1:226;
A21:          (a+(a+g))/2 < a+g by A19,XREAL_1:226;
              then (a+(a+g))/2 < b by A18,XXREAL_0:2;
              then
A22:          (a+(a+g))/2 in ].a,b.[ by A5,A20;
              a-g < (a+(a+g))/2 by A16,A20,XXREAL_0:2;
              then (a+(a+g))/2 in ].a-g,a+g.[ by A17,A21;
              hence thesis by A15,A22,XBOOLE_0:def 4;
            end;
            suppose
A23:          a+g >= b;
              (a+b)/2 < b by A3,XREAL_1:226;
              then
A24:          (a+b)/2 < a+g by A23,XXREAL_0:2;
              a < (a+b)/2 by A3,XREAL_1:226;
              then a-g < (a+b)/2 by A16,XXREAL_0:2;
              then (a+b)/2 in ].a-g,a+g.[ by A17,A24;
              hence thesis by A10,A15,XBOOLE_0:def 4;
            end;
          end;
          hence thesis by A7,A13,MEASURE6:63;
        end;
        case
A25:      b = r;
          for O being open Subset of REAL st b in O holds O /\ ].a,b.[ is
          non empty
          proof
            let O be open Subset of REAL;
            assume b in O;
            then consider g being Real such that
A26:        0 < g and
A27:        ].b-g,b+g.[ c= O by RCOMP_1:19;
A28:        b-g < b-0 by A26,XREAL_1:15;
A29:        b+0 < b+g by A26,XREAL_1:6;
A30:        ]. b-g,b+g.[ = {w where w is Real: b-g < w & w < b+g } by
RCOMP_1:def 2;
            per cases;
            suppose
A31:          b-g > a;
A32:          (b+(b-g))/2 < b by A28,XREAL_1:226;
A33:          b-g < (b+(b-g))/2 by A28,XREAL_1:226;
              then a < (b+(b-g))/2 by A31,XXREAL_0:2;
              then
A34:          (b+(b-g))/2 in ].a,b.[ by A5,A32;
              (b+(b-g))/2 < b by A28,XREAL_1:226;
              then (b+(b-g))/2 < b+g by A29,XXREAL_0:2;
              then (b+(b-g))/2 in ].b-g,b+g.[ by A30,A33;
              hence thesis by A27,A34,XBOOLE_0:def 4;
            end;
            suppose
A35:          b-g <= a;
              (a+b)/2 < b by A3,XREAL_1:226;
              then
A36:          (a+b)/2 < b+g by A29,XXREAL_0:2;
              a < (a+b)/2 by A3,XREAL_1:226;
              then b-g < (a+b)/2 by A35,XXREAL_0:2;
              then (a+b)/2 in ].b-g,b+g.[ by A30,A36;
              hence thesis by A10,A27,XBOOLE_0:def 4;
            end;
          end;
          hence thesis by A7,A25,MEASURE6:63;
        end;
      end;
      hence thesis;
    end;
  end;
  assume that
A37: Cl ].a,b.[ = [.a,b.] and
A38: a = b;
  [.a,b.] = {a} by A38,XXREAL_1:17;
  hence contradiction by A37,A38,MEASURE6:60,XXREAL_1:28;
end;
