reserve T, T1 for non empty TopSpace;
reserve F,G,H for Subset-Family of T,
  A,B,C,D for Subset of T,
  O,U for open Subset of T,
  p,q for Point of T,
  x,y,X for set;
reserve Un for FamilySequence of T,
  r,r1,r2 for Real,
  n for Element of NAT;
reserve m for Function of [:the carrier of T,the carrier of T:],REAL;

theorem
  for r be Real,f be RealMap of T st f is continuous holds min(r,f) is
  continuous
proof
  let r be Real,f be RealMap of T such that
A1: f is continuous;
  reconsider f9=f,mf9=min(r,f) as Function of T,R^1 by TOPMETR:17;
A2: f9 is continuous by A1,JORDAN5A:27;
  now
    let t be Point of T;
    for R being Subset of R^1 st R is open & mf9.t in R ex U being Subset
    of T st U is open & t in U & mf9.:U c= R
    proof
      reconsider ft=f.t as Point of RealSpace by METRIC_1:def 13;
      let R be Subset of R^1 such that
A3:   R is open and
A4:   mf9.t in R;
      now
        per cases;
        suppose
A5:       f.t <=r;
          then f.t=min(r,f.t) by XXREAL_0:def 9;
          then ft in R by A4,Def9;
          then consider s being Real such that
A6:       s>0 and
A7:       Ball(ft,s) c= R by A3,TOPMETR:15,def 6;
          reconsider s9=s as Real;
          reconsider B=Ball(ft,s9) as Subset of R^1 by METRIC_1:def 13
,TOPMETR:17;
          dist(ft,ft)<s9 by A6,METRIC_1:1;
          then
A8:       ft in B by METRIC_1:11;
          B is open & f9 is_continuous_at t by A2,TMAP_1:50,TOPMETR:14,def 6;
          then consider U being Subset of T such that
A9:       U is open & t in U and
A10:      f9.:U c= B by A8,TMAP_1:43;
          min(r,f).:U c= R
          proof
            let mfx be object;
            assume mfx in min(r,f).:U;
            then consider x being object such that
A11:        x in dom min(r,f) and
A12:        x in U and
A13:        mfx=min(r,f).x by FUNCT_1:def 6;
            reconsider x as Point of T by A11;
            f.x in REAL & r in REAL by XREAL_0:def 1;
            then reconsider fx=f.x,r9=r as Point of RealSpace
by METRIC_1:def 13;
            dom min(r,f)=the carrier of T by FUNCT_2:def 1;
            then x in dom f by A11,FUNCT_2:def 1;
            then
A14:        f.x in f.:U by A12,FUNCT_1:def 6;
            then
A15:        f.x in B by A10;
            now
              per cases;
              suppose
                f.x<=r;
                then min(r,f.x)=f.x by XXREAL_0:def 9;
                then mfx=f.x by A13,Def9;
                hence thesis by A7,A15;
              end;
              suppose
A16:            f.x>r;
                dist(fx,ft)<s by A10,A14,METRIC_1:11;
                then
A17:            |.f.x-f.t.|<s by TOPMETR:11;
A18:            r-f.t<=f.x-f.t by A16,XREAL_1:9;
                f.x>=f.t by A5,A16,XXREAL_0:2;
                then f.x-f.t>=0 by XREAL_1:48;
                then f.x-f.t<s by A17,ABSVALUE:def 1;
                then
A19:            r-f.t<s by A18,XXREAL_0:2;
                r-f.t>=0 by A5,XREAL_1:48;
                then |.r-f.t.|<s by A19,ABSVALUE:def 1;
                then dist(ft,r9)<s by TOPMETR:11;
                then
A20:            r in B by METRIC_1:11;
                min(r,f.x)=r by A16,XXREAL_0:def 9;
                then mfx=r by A13,Def9;
                hence thesis by A7,A20;
              end;
            end;
            hence thesis;
          end;
          hence
          ex U being Subset of T st U is open & t in U & min(r,f).:U c= R
          by A9;
        end;
        suppose
A21:      f.t>r;
          set s=f.t-r;
          reconsider B=Ball(ft,s) as Subset of R^1 by METRIC_1:def 13
,TOPMETR:17;
          s>0 by A21,XREAL_1:50;
          then dist(ft,ft)<s by METRIC_1:1;
          then
A22:      ft in B by METRIC_1:11;
          B is open & f9 is_continuous_at t by A2,TMAP_1:50,TOPMETR:14,def 6;
          then consider U being Subset of T such that
A23:      U is open & t in U and
A24:      f9.:U c= B by A22,TMAP_1:43;
          min(r,f).:U c= R
          proof
            let mfx be object;
            assume mfx in min(r,f).:U;
            then consider x being object such that
A25:        x in dom min(r,f) and
A26:        x in U and
A27:        mfx=min(r,f).x by FUNCT_1:def 6;
            reconsider x as Point of T by A25;
            reconsider fx=f.x as Point of RealSpace by METRIC_1:def 13;
            dom min(r,f)=the carrier of T by FUNCT_2:def 1;
            then x in dom f by A25,FUNCT_2:def 1;
            then f.x in f.:U by A26,FUNCT_1:def 6;
            then dist(ft,fx)<s by A24,METRIC_1:11;
            then |.f.t-f.x.|<s by TOPMETR:11;
            then f.t+(-f.x) <=f.t+(-r) by ABSVALUE:5;
            then -f.x<=-r by XREAL_1:6;
            then r<=f.x by XREAL_1:24;
            then
A28:        min(r,f.x)=r by XXREAL_0:def 9;
            min(r,f.t)=r by A21,XXREAL_0:def 9;
            then min(r,f).t=r by Def9;
            hence thesis by A4,A27,A28,Def9;
          end;
          hence
          ex U being Subset of T st U is open & t in U & min(r,f).:U c= R
          by A23;
        end;
      end;
      hence thesis;
    end;
    hence mf9 is_continuous_at t by TMAP_1:43;
  end;
  then mf9 is continuous by TMAP_1:50;
  hence thesis by JORDAN5A:27;
end;
