reserve n,m for Element of NAT;
reserve x, X,X1,Z,Z1 for set;
reserve s,g,r,t,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 Th19:
  p<=g & [.p,g.] c= dom f & f|[.p,g.] is continuous implies f.:[.p
  ,g.]=[.lower_bound (f.:[.p,g.]),upper_bound (f.:[.p,g.]).]
proof
  assume that
A1: p<=g and
A2: [.p,g.] c= dom f and
A3: f|[.p,g.] is continuous;
  [.p,g.] is compact by RCOMP_1:6;
  then
A4: f.:[.p,g.] is real-bounded by A2,A3,FCONT_1:29,RCOMP_1:10;
  now
    let y be Element of REAL;
    thus y in f.:[.p,g.] implies y in [.lower_bound(f.:[.p,g.]),upper_bound(f
    .:[.p,g.]).]
    proof
      assume
A5:   y in f.:[.p,g.];
      then
A6:   y>=lower_bound(f.:[.p,g.]) by A4,SEQ_4:def 2;
      y<=upper_bound(f.:[.p,g.]) by A4,A5,SEQ_4:def 1;
      then y in {s: lower_bound(f.:[.p,g.])<=s & s<=upper_bound(f.:[.p,g.])}
      by A6;
      hence thesis by RCOMP_1:def 1;
    end;
    assume y in [.lower_bound(f.:[.p,g.]),upper_bound(f.:[.p,g.]).];
    then ex x0 st x0 in [.p,g.] & y=f.x0 by A1,A2,A3,Th16;
    hence y in f.:[.p,g.] by A2,FUNCT_1:def 6;
  end;
  hence thesis by SUBSET_1:3;
end;
