
theorem Th6:
  for x,y,k being ExtReal st 0 <= k holds k*max(x,y) = max
  (k*x,k*y) & k*min(x,y) = min(k*x,k*y)
proof
  let x,y,k be ExtReal;
  assume
A1: 0 <= k;
  now
    per cases by XXREAL_0:16;
    suppose
A2:   max(x,y) = x;
      then y <= x by XXREAL_0:def 10;
      then k*y <= k*x by A1,XXREAL_3:71;
      hence k*max(x,y) = max(k*x,k*y) by A2,XXREAL_0:def 10;
    end;
    suppose
A3:   max(x,y) = y;
      then x <= y by XXREAL_0:def 10;
      then k*x <= k*y by A1,XXREAL_3:71;
      hence k*max(x,y) = max(k*x,k*y) by A3,XXREAL_0:def 10;
    end;
  end;
  hence k*max(x,y) = max(k*x,k*y);
  per cases by XXREAL_0:15;
  suppose
A4: min(x,y) = x;
    then x <= y by XXREAL_0:def 9;
    then k*x <= k*y by A1,XXREAL_3:71;
    hence thesis by A4,XXREAL_0:def 9;
  end;
  suppose
A5: min(x,y) = y;
    then y <= x by XXREAL_0:def 9;
    then k*y <= k*x by A1,XXREAL_3:71;
    hence thesis by A5,XXREAL_0:def 9;
  end;
end;
