reserve x,y for set;
reserve s,s1,s2,s4,r,r1,r2 for Real;
reserve n,m,i,j for Element of NAT;
reserve p for Element of NAT;

theorem Th12:
  for r1,r2,s1,s2 st r1 in [.s1,s2.] & r2 in [.s1,s2.] holds |. r1-r2.|<=s2-s1
proof
  let r1,r2,s1,s2;
  assume
A1: r1 in [.s1,s2.] & r2 in [.s1,s2.];
  then
A2: r1<=s2 & s1<=r2 by Lm6;
A3: s1<=r1 & r2<=s2 by A1,Lm6;
  per cases;
  suppose
A4: r1<=r2;
A5: r2-r1<=s2-s1 by A3,XREAL_1:13;
    r2-r1>=0 by A4,XREAL_1:48;
    then |.r2-r1.|<=s2-s1 by A5,ABSVALUE:def 1;
    hence thesis by Th11;
  end;
  suppose
    r1>r2;
    then
A6: r1-r2>=0 by XREAL_1:48;
    r1-r2<=s2-s1 by A2,XREAL_1:13;
    hence thesis by A6,ABSVALUE:def 1;
  end;
end;
