
theorem MMD:
  for a,b be non negative Real holds
  max(a,b) - min(a,b) = |.a - b.|
  proof
    let a,b be non negative Real;
    per cases;
    suppose a >= b; then
      max (a,b) = a & min (a,b) = b by XXREAL_0:def 9,def 10;
      hence thesis;
    end;
    suppose a < b; then
      max (a,b) = b & min (a,b) = a by XXREAL_0:def 9,def 10; then
      |.max (a,b) - min (a,b).| = |.-(b - a).| by COMPLEX1:52;
      hence thesis;
    end;
  end;
