
theorem MMcon4:
for f,g be Function of REAL,REAL, a,b being Real st
g is continuous & for x be Real holds f.x= max(a,min(b, g.x))
holds f is continuous
proof
 let f,g be Function of REAL,REAL;
 let a,b being Real;
 assume A1: g is continuous;
 assume A2:  for x be Real holds f.x= max(a,min(b, g.x));
 deffunc H1(Element of REAL) = In(min(b,g.$1),REAL);
 consider h being Function of REAL,REAL such that
 A3: for x being  Element of REAL holds
 h.x = H1(x) from FUNCT_2:sch 4;
 A5: for x be Real holds h.x= min(b, g.x)
 proof
  let x being Real;
  reconsider x as Element of REAL by XREAL_0:def 1;
  h.x = In(min(b,g.x),REAL) by A3
   .= min(b, g.x);
  hence thesis;
 end;
 then
 A4: h is continuous by MMcon1,A1;
 for x be Real holds f.x= max(a,h.x)
 proof
  let x be Real;
  thus f.x= max(a,min(b, g.x)) by A2
  .= max(a,h.x) by A5;
 end;
 hence thesis by MMcon3,A4;
end;
