reserve a,b,c,d for Real;
reserve r,s for Real;
reserve p,q,r,s,t for ExtReal;

theorem
  r < s & (for q st r < q & q < s holds q <= t) implies s <= t
proof
  assume that
A1: r < s and
A2: for q st r < q & q < s holds q <= t;
  for q st t < q holds s <= q
  proof
    let q such that
A3: t < q and
A4: q < s;
    per cases;
    suppose r < q;
      hence thesis by A2,A3,A4;
    end;
    suppose
A5:   q <= r;
      consider p such that
A6:   r < p and
A7:   p < s by A1,Th227;
      p <= t by A2,A6,A7;
      then r <= t by A6,XXREAL_0:2;
      hence thesis by A3,A5,XXREAL_0:2;
    end;
  end;
  hence thesis by Th227;
end;
