
theorem Th33:
  for C being non empty set, f being PartFunc of C,ExtREAL, c be
  Real st c <= 0 holds max+(c(#)f) = (-c)(#)max-f & max-(c(#)f) = (-c)(#)max+f
proof
  let C be non empty set;
  let f be PartFunc of C,ExtREAL;
  let c be Real;
  assume
A1: c <= 0;
A2: dom max+(c(#)f) = dom(c(#)f) by MESFUNC2:def 2
    .= dom f by MESFUNC1:def 6
    .= dom max-f by MESFUNC2:def 3
    .= dom((-c)(#)max-f) by MESFUNC1:def 6;
  for x be Element of C st x in dom max+(c(#)f) holds
    (max+(c(#)f)).x = ((-c)(#)max-f).x
  proof
    let x be Element of C;
    assume
A3: x in dom max+(c(#)f); then
A4: x in dom(c(#)f) by MESFUNC2:def 2;
    then x in dom f by MESFUNC1:def 6; then
A5: x in dom max- f by MESFUNC2:def 3;
A6: (max+(c(#)f)).x = max((c(#)f).x,0) by A3,MESFUNC2:def 2
      .= max( c * f.x,0) by A4,MESFUNC1:def 6;
B1: ((-c)(#)max-f).x = (-c) * max-f.x by A2,A3,MESFUNC1:def 6
      .= (-c) * max(-(f.x),0) by A5,MESFUNC2:def 3;
    per cases;
    suppose f.x >= 0; then
     (max+(c(#)f)).x = 0 & max(-(f.x),0) = 0 by A1,A6,XXREAL_0:def 10;
     hence thesis by B1;
    end;
    suppose D1: f.x < 0; then
B2:  (max+(c(#)f)).x = c * f.x & max(-(f.x),0) = -(f.x)
       by A1,A6,XXREAL_0:def 10;
     per cases by D1,XXREAL_0:14;
     suppose E1: f.x = -infty;
      per cases by A1;
      suppose c = 0; then
       (max+(c(#)f)).x = 0 & ((-c)(#)max-f).x = 0
         by B1,A6,XXREAL_0:def 10;
       hence thesis;
      end;
      suppose F1: c < 0; then
       (-c) * (-(f.x)) = +infty by E1,XXREAL_3:5,def 5;
       hence thesis by B1,B2,E1,F1,XXREAL_3:def 5;
      end;
     end;
     suppose f.x in REAL; then
      reconsider a = f.x as Real;
      (-c) * (-a) = (-c) * (-(f.x)); then
      (-c) * (-(f.x)) = c * a  .= c * f.x;
      hence thesis by B1,B2;
     end;
    end;
  end;
  hence max+(c(#)f) = (-c)(#)max-f by A2,PARTFUN1:5;
A7: dom(max-(c(#)f)) = dom(c(#)f) by MESFUNC2:def 3
    .= dom f by MESFUNC1:def 6
    .= dom max+f by MESFUNC2:def 2
    .= dom((-c)(#)max+f) by MESFUNC1:def 6;
  for x be Element of C st x in dom max-(c(#)f) holds (max-(c(#)f)).x = (
  (-c)(#)max+f).x
  proof
    let x be Element of C;
    assume
A8: x in dom max-(c(#)f);
    then
A9: x in dom(c(#)f) by MESFUNC2:def 3;
    then x in dom f by MESFUNC1:def 6;
    then
A10: x in dom max+ f by MESFUNC2:def 2;
A11: (max-(c(#)f)).x = max(-(c(#)f).x,0) by A8,MESFUNC2:def 3
      .= max(-( c)*f.x,0) by A9,MESFUNC1:def 6;
A12:((-c)(#)max+f).x = (-c) * max+f.x by A7,A8,MESFUNC1:def 6
      .= (-c) * max(f.x,0) by A10,MESFUNC2:def 2
      .= max((-c) * (f.x),(-c) * (0 qua ExtReal)) by A1,MESFUNC5:6
      .= max((-c)*f.x, 0);
    -(c) * f.x = (-c) * f.x
    proof
     per cases by XXREAL_0:14;
     suppose E1: f.x = +infty;
      per cases by A1;
      suppose c = 0; then
       c * f.x = 0 & (-c) * f.x = 0;
       hence -(c) * f.x = (-c) * f.x;
      end;
      suppose E2: c < 0; then
       c * f.x = -infty by E1,XXREAL_3:def 5;
       hence -(c) * f.x = (-c) * f.x by E1,E2,XXREAL_3:5,def 5;
      end;
     end;
     suppose E1: f.x = -infty;
      per cases by A1;
      suppose c = 0; then
       c * f.x = 0 & (-c) * f.x = 0;
       hence -(c) * f.x = (-c) * f.x;
      end;
      suppose E2: c < 0; then
       c * f.x = +infty by E1,XXREAL_3:def 5;
       hence -(c) * f.x = (-c) * f.x by E1,E2,XXREAL_3:6,def 5;
      end;
     end;
     suppose f.x in REAL; then
      reconsider a = f.x as Real;
      (-c)*a = (-c)*f.x; then
      (-c)*f.x = -(c * a);
      hence -(c) * f.x = (-c) * f.x;
     end;
    end;
    hence thesis by A11,A12;
  end;
  hence thesis by A7,PARTFUN1:5;
end;
