
theorem MMLip3:
for f be Function of REAL,REAL, a,b,r,s be Real st
for x be Real holds f.x= max(r,min(s, AffineMap (a,b).x))
holds f is Lipschitzian
proof
 let f be Function of REAL,REAL;
 let a,b,r,s be Real;
 assume A1: for x be Real holds f.x= max(r,min(s, AffineMap (a,b).x));
 ex r being Real st
 ( 0 < r &
 ( for x1, x2 being Real st x1 in dom f & x2 in dom f holds
  |.((f . x1) - (f . x2)).| <= r * |.(x1 - x2).| ) )
 proof
 per cases;
 suppose C0: a = 0;
  take 1;
  for x1, x2 being Real st x1 in dom f & x2 in dom f holds
  |.((f . x1) - (f . x2)).| <= 1 * |.(x1 - x2).|
  proof
   let x1, x2 being Real;
   assume x1 in dom f & x2 in dom f;
   |.((f . x1) - (f . x2)).|
    = |.max(r,min(s, AffineMap (a,b).x1))-f.x2.| by A1
    .= |.max(r,min(s, AffineMap (a,b).x1))-max(r,min(s, AffineMap (a,b).x2)).|
     by A1
    .= |.max(r,min(s, a*x1+b))-max(r,min(s, AffineMap (a,b).x2)).|
          by FCONT_1:def 4
    .= |.max(r,min(s, a*x1+b))-max(r,min(s, a*x2+b)).| by FCONT_1:def 4
     .=0 by COMPLEX1:44,C0;
     hence thesis by COMPLEX1:46;
  end;
  hence thesis;
 end;
 suppose A2: a <> 0;
  take |.a.|;
  for x1, x2 being Real st x1 in dom f & x2 in dom f holds
  |.((f . x1) - (f . x2)).| <= |.a.| * |.(x1 - x2).|
  proof
   let x1, x2 being Real;
   assume x1 in dom f & x2 in dom f;
   |.((f . x1) - (f . x2)).|
    = |.max(r,min(s, AffineMap (a,b).x1))-f.x2.| by A1
    .= |.max(r,min(s, AffineMap (a,b).x1))-max(r,min(s, AffineMap (a,b).x2)).|
     by A1
    .= |.max(r,min(s, a*x1+b))-max(r,min(s, AffineMap (a,b).x2)).|
          by FCONT_1:def 4
    .= |.max(r,min(s, a*x1+b))-max(r,min(s, a*x2+b)).| by FCONT_1:def 4; then
   |.((f . x1) - (f . x2)).| <= |.a*x1+b- (a*x2+b).| by LeMM01; then
   |.((f . x1) - (f . x2)).| <= |.a*(x1- x2).|;
   hence |.((f . x1) - (f . x2)).| <= |.a.|*|.x1-x2.| by COMPLEX1:65;
  end;
  hence thesis by A2,COMPLEX1:47;
 end;
 end;
 hence thesis;
end;
