 reserve n for Nat;
 reserve s1 for sequence of Euclid n,
         s2 for sequence of REAL-NS n;

theorem Th37:
  for I1,I2,I being non empty closed_interval Subset of REAL
   st upper_bound I1 <= lower_bound I2 &
  lower_bound I <= lower_bound I1 & upper_bound I2 <= upper_bound I holds
  I1 \/ I2 c= I
  proof
    let I1,I2,I be non empty closed_interval Subset of REAL such that
A1: upper_bound(I1) <= lower_bound(I2) and
A2: lower_bound(I) <= lower_bound(I1) and
A3: upper_bound(I2) <= upper_bound(I);
    consider a1,b1 be Real such that
A4: I1 = [.a1,b1.] by MEASURE5:def 3;
A5: a1 <= b1 by A4,XXREAL_1:29; then
A6: lower_bound I1 = a1 & upper_bound I1 = b1 by A4,JORDAN5A:19;
    consider a2,b2 be Real such that
A7: I2 = [.a2,b2.] by MEASURE5:def 3;
A8: a2 <= b2 by A7,XXREAL_1:29;
A9: lower_bound(I) <= a1 & b2 <= upper_bound(I)
      by A2,A3,A5,A4,JORDAN5A:19,A8,A7;
A10: b1 <= a2 by A6,A1,A8,A7,JORDAN5A:19;
    consider a3,b3 be Real such that
A11: I = [.a3,b3.] by MEASURE5:def 3;
    a3 <= b3 by A11,XXREAL_1:29; then
A12: lower_bound I = a3 & upper_bound I = b3 by A11,JORDAN5A:19;
      let x be object;
      assume
A13:   x in I1 \/ I2;
      then reconsider x1 = x as Real;
      per cases by A13,XBOOLE_0:def 3;
      suppose x in I1;
        then a1 <= x1 <= b1 by A4,XXREAL_1:1;
        then a1 <= x1 <= a2 by A10,XXREAL_0:2;
        then a1 <= x1 <= b2 by A8,XXREAL_0:2;
        then lower_bound I <= x1 <= upper_bound I by A9,XXREAL_0:2;
        hence x in I by A12,A11,XXREAL_1:1;
      end;
      suppose x in I2;
        then a2 <= x1 <= b2 by A7,XXREAL_1:1;
        then b1 <= x1 <= b2 by A10,XXREAL_0:2;
        then a1 <= x1 <= b2 by A5,XXREAL_0:2;
        then lower_bound I <= x1 <= upper_bound I by A9,XXREAL_0:2;
        hence x in I by A12,A11,XXREAL_1:1;
      end;
  end;
