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

theorem Th42:
  for r,s,t,x being Real holds
  (r <= x - t & x + t <= s implies
    ].x - t, x + t .[ /\ [.r,s.] = ].x-t,x+t.[) &
  (r <= x - t & s < x + t implies ].x-t,x+t.[ /\ [.r,s.] = ].x-t,s.]) &
  (x-t < r & x+t <= s implies ].x-t,x+t.[ /\ [.r,s.] = [.r,x+t.[) &
  (x-t < r & s < x+t implies ].x-t,x+t.[ /\ [.r,s.] = [.r,s.])
  proof
    let r,s,t,x be Real;
    hereby
      assume that
A1:   r <= x - t and
A2:   x + t <= s;
      ].x-t,x+t.[ c= [.r,s.]
      proof
        let u be object;
        assume
A3:     u in ].x-t,x+t.[;
        then reconsider u1 = u as Real;
        x-t<u1<x+t by A3,XXREAL_1:4;
        then r<=u1<=s by A1,A2,XXREAL_0:2;
        hence thesis by XXREAL_1:1;
      end;
      hence ].x-t,x+t.[ /\ [.r,s.] = ].x-t,x+t.[ by XBOOLE_1:17,XBOOLE_1:19;
    end;
    hereby
      assume that
A4:   r <= x - t and
A5:   s < x + t;
A6:   ].x-t,x+t.[ /\ [.r,s.] c= ].x-t,s.]
      proof
        let u be object;
        assume
A7:     u in ].x-t,x+t.[ /\ [.r,s.]; then
A8:     u in ].x-t,x+t.[ & u in [.r,s.] by XBOOLE_0:def 4;
        reconsider u1 = u as Real by A7;
        x-t < u1 <= s by A8,XXREAL_1:1,XXREAL_1:4;
        hence thesis by XXREAL_1:2;
      end;
      ].x-t,s.] c= ].x-t,x+t.[ /\ [.r,s.]
      proof
        let u be object;
        assume
A9:     u in ].x-t,s.];
        then reconsider u1 = u as Real;
        x-t<u1<=s by A9,XXREAL_1:2;
        then x-t<u1<x+t & r<=u1<=s by A4,A5,XXREAL_0:2;
        then u in ].x-t,x+t.[ & u in [.r,s.] by XXREAL_1:1,XXREAL_1:4;
        hence thesis by XBOOLE_0:def 4;
      end;
      hence ].x-t,x+t.[ /\ [.r,s.] = ].x-t,s.] by A6;
    end;
    hereby
      assume that
A10:  x-t < r and
A11:  x+t<=s;
A12:  ].x-t,x+t.[ /\ [.r,s.] c= [.r,x+t.[
      proof
        let u be object;
        assume
A13:    u in ].x-t,x+t.[ /\ [.r,s.]; then
A14:    u in ].x-t,x+t.[ & u in [.r,s.] by XBOOLE_0:def 4;
        reconsider u1 = u as Real by A13;
        r <= u1 < x+t by A14,XXREAL_1:4,XXREAL_1:1;
        hence thesis by XXREAL_1:3;
      end;
      [.r,x+t.[ c= ].x-t,x+t.[ /\ [.r,s.]
      proof
        let u be object;
        assume
A15:    u in [.r,x+t.[;
        then reconsider u1 = u as Real;
        r<=u1<x+t by A15,XXREAL_1:3;
        then x-t<u1<x+t & r<=u1<=s by A10,A11,XXREAL_0:2;
        then u in ].x-t,x+t.[ & u in [.r,s.] by XXREAL_1:1,XXREAL_1:4;
        hence thesis by XBOOLE_0:def 4;
      end;
      hence ].x-t,x+t.[ /\ [.r,s.] = [.r,x+t.[ by A12;
    end;
    hereby
      assume that
A16:  x-t < r and
A17:  s <x+t;
      [.r,s.] c= ].x-t,x+t.[
      proof
        let u be object;
        assume
A18:    u in [.r,s.];
        then reconsider u1 = u as Real;
        r<= u1<=s by A18,XXREAL_1:1;
        then x-t<u1<x+t by A16,A17,XXREAL_0:2;
        hence thesis by XXREAL_1:4;
      end;
      hence ].x-t,x+t.[ /\ [.r,s.] = [.r,s.] by XBOOLE_1:17,XBOOLE_1:19;
    end;
  end;
