reserve n,m,k for Element of NAT;
reserve x, X,X1,Z,Z1 for set;
reserve s,g,r,p,x0,x1,x2 for Real;
reserve s1,s2,q1 for Real_Sequence;
reserve Y for Subset of REAL;
reserve f,f1,f2 for PartFunc of REAL,REAL;

theorem Th30:
  for f st dom f<>{} & (dom f) is compact & f|dom f is continuous
  ex x1,x2 st x1 in dom f & x2 in dom f & f.x1 = upper_bound (rng f) & f.x2 =
  lower_bound (rng f)
proof
  let f;
  assume dom f <> {} & dom f is compact & f|dom f is continuous;
  then
A1: rng f <> {} & rng f is compact by Th28,RELAT_1:42;
  then consider x being Element of REAL such that
A2: x in dom f & upper_bound (rng f) = f.x by PARTFUN1:3,RCOMP_1:14;
  take x;
  consider y being Element of REAL such that
A3: y in dom f & lower_bound (rng f) = f.y by A1,PARTFUN1:3,RCOMP_1:14;
  take y;
  thus thesis by A2,A3;
end;
