reserve x1, x2, x3, x4, x5, x6, x7 for set;

theorem Th57:
  for a, b being Real holds REAL \ RAT (a, b) = ]. -infty,a
  .] \/ IRRAT (a, b) \/ [.b,+infty .[
proof
  let a, b be Real;
    thus REAL \ RAT (a, b) c= ]. -infty,a.] \/ IRRAT (a, b) \/ [.b,+infty .[
    proof
      let x be object;
      assume
A1:   x in REAL \ RAT (a, b);
      then
A2:   not x in RAT (a, b) by XBOOLE_0:def 5;
      reconsider x as Real by A1;
      per cases;
      suppose
        x <= a & x < b;
        then x in ]. -infty,a.] by XXREAL_1:234;
        then x in ]. -infty,a.] \/ IRRAT (a, b) by XBOOLE_0:def 3;
        hence thesis by XBOOLE_0:def 3;
      end;
      suppose
        x <= a & x >= b;
        then x in ]. -infty,a.] by XXREAL_1:234;
        then x in ]. -infty,a.] \/ IRRAT (a, b) by XBOOLE_0:def 3;
        hence thesis by XBOOLE_0:def 3;
      end;
      suppose
A3:     x > a & x < b;
        x in IRRAT (a, b)
        proof
          per cases;
          suppose
            x is rational;
            hence thesis by A2,A3,Th28;
          end;
          suppose
            x is irrational;
            hence thesis by A3,Th29;
          end;
        end;
        then x in ]. -infty,a.] \/ IRRAT (a, b) by XBOOLE_0:def 3;
        hence thesis by XBOOLE_0:def 3;
      end;
      suppose
        x > a & x >= b;
        then x in [.b,+infty .[ by XXREAL_1:236;
        hence thesis by XBOOLE_0:def 3;
      end;
    end;
    let x be object;
    assume
A4: x in ]. -infty,a.] \/ IRRAT (a, b) \/ [.b,+infty .[;
    then reconsider x as Real;
A5: x in ]. -infty,a.] \/ IRRAT (a, b) or x in [.b,+infty .[ by A4,
XBOOLE_0:def 3;
    per cases by A5,XBOOLE_0:def 3;
    suppose
      x in ]. -infty,a.];
      then x <= a by XXREAL_1:234;
      then
A6:   not x in RAT (a, b) by Th28;
      x in REAL by XREAL_0:def 1;
      hence thesis by A6,XBOOLE_0:def 5;
    end;
    suppose
A7:   x in IRRAT (a, b);
      IRRAT (a, b) misses RAT (a, b) by Th56;
      then
A8:   not x in RAT (a,b) by A7,XBOOLE_0:3;
      x in REAL by XREAL_0:def 1;
      hence thesis by A8,XBOOLE_0:def 5;
    end;
    suppose
      x in [.b,+infty .[;
      then x >= b by XXREAL_1:236;
      then
A9:   not x in RAT (a, b) by Th28;
      x in REAL by XREAL_0:def 1;
      hence thesis by A9,XBOOLE_0:def 5;
    end;
end;
