
theorem MMLip1:
for f be Function of REAL,REAL, a,b,c,d,r,s be Real st
for x be Real holds f.x= max(r,min(s, c*sin(a*x+b)+d))
holds f is Lipschitzian
proof
 let f be Function of REAL,REAL;
 let a,b,c,d,r,s be Real;
 assume A1: for x be Real holds f.x= max(r,min(s, c*sin(a*x+b)+d));
 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 C1: c = 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 be Real;
     assume x1 in dom f & x2 in dom f;
     |.((f . x1) - (f . x2)).|
      = |.max(r,min(s, c*sin(a*x1+b)+d))- f.x2.| by A1
     .= |.max(r,min(s, 0*sin(a*x1+b)+d))- max(r,min(s, 0*sin(a*x2+b)+d)).|
           by C1,A1
     .=0 by COMPLEX1:44;
     hence thesis by COMPLEX1:46;
    end;
    hence thesis;
   end;
   suppose A3: c <> 0;
    per cases;
    suppose A0: 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 be Real;
     |.((f . x1) - (f . x2)).|
      = |.max(r,min(s, c*sin(a*x1+b)+d))- f.x2.| by A1
     .= |.max(r,min(s, c*sin(0*x1+b)+d))- max(r,min(s, c*sin(0*x2+b)+d)).|
             by A0,A1
     .=0 by COMPLEX1:44;
     hence thesis by COMPLEX1:46;
     end;
     hence thesis;
    end;
    suppose A2: a <> 0;
  take |.a.|*|.c.|;
  A5: |.c.|>0 & |.a.|>0 by A2,A3,COMPLEX1:47;
  for x1, x2 being Real st x1 in dom f & x2 in dom f holds
  |.((f . x1) - (f . x2)).| <= |.a.|*|.c.| * |.(x1 - x2).|
  proof
   let x1, x2 be Real;
   assume x1 in dom f & x2 in dom f;
   A9:  |.((f . x1) - (f . x2)).|
    = |.max(r,min(s, c*sin(a*x1+b)+d))- f.x2.| by A1
   .= |.max(r,min(s, c*sin(a*x1+b)+d))- max(r,min(s, c*sin(a*x2+b)+d)).| by A1;
   A7: |.max(r,min(s, c*sin(a*x1+b)+d))- max(r,min(s, c*sin(a*x2+b)+d)).|
    <= |.c*sin(a*x1+b)+d-(c*sin(a*x2+b)+d).| by LeMM01;
   A8:  |.c.|*|.(a*x1+b)-(a*x2+b).| = |.c.|*|.a*(x1-x2).|
   .= |.c.|*(|.a.|*|.(x1-x2).|) by COMPLEX1:65;
   A6: |.c*(sin(a*x1+b)-sin(a*x2+b)).|=|.c.|*|.sin(a*x1+b)-sin(a*x2+b).| &
   |.c*sin(a*x1+b)+d-(c*sin(a*x2+b)+d).|=|.c*(sin(a*x1+b)-sin(a*x2+b)).|
        by COMPLEX1:65;
   |.c*sin(a*x1+b)+d-(c*sin(a*x2+b)+d).| <= |.c.|*|.(a*x1+b)-(a*x2+b).|
           by XREAL_1:64,A5,A6,LmSin2;
   hence thesis by A9,A8,A7,XXREAL_0:2;
  end;
  hence thesis by A5;
    end;
   end;
 end;
 hence thesis;
end;
