
theorem Th1:
for X be non empty set, f be PartFunc of X,ExtREAL holds
 rng max+f c= rng f \/ {0} & rng max-f c= rng (-f) \/ {0}
proof
    let X be non empty set, f be PartFunc of X,ExtREAL;
    now let y be object;
     assume y in rng max+f; then
     consider x be Element of X such that
A1:   x in dom max+f & y = (max+f).x by PARTFUN1:3;
A2:  x in dom f by A1,MESFUNC2:def 2;
A3:  y = max(f.x,0) by A1,MESFUNC2:def 2;
     per cases by A3,XXREAL_0:16;
     suppose y = f.x; then
      y in rng f by A2,FUNCT_1:3;
      hence y in rng f \/ {0} by XBOOLE_0:def 3;
     end;
     suppose y = 0; then
      y in {0} by TARSKI:def 1;
      hence y in rng f \/ {0} by XBOOLE_0:def 3;
     end;
    end;
    hence rng max+f c= rng f \/ {0};

    now let y be object;
     assume y in rng max-f; then
     consider x be Element of X such that
A4:   x in dom max-f & y = (max-f).x by PARTFUN1:3;
     x in dom f by A4,MESFUNC2:def 3; then
A5:  x in dom(-f) by MESFUNC1:def 7;
     y = max(-(f.x),0) by A4,MESFUNC2:def 3; then
     per cases by XXREAL_0:16;
     suppose y = -(f.x); then
      y = (-f).x by A5,MESFUNC1:def 7; then
      y in rng (-f) by A5,FUNCT_1:3;
      hence y in rng (-f) \/ {0} by XBOOLE_0:def 3;
     end;
     suppose y = 0; then
      y in {0} by TARSKI:def 1;
      hence y in rng (-f) \/ {0} by XBOOLE_0:def 3;
     end;
    end;
    hence rng max-f c= rng (-f) \/ {0};
end;
