
theorem Th57:
for X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
 E be Element of S, f be nonpositive PartFunc of X,ExtREAL
  st (ex A be Element of S st A = dom f & f is A-measurable) holds
 Integral(M,f) = - integral+(M,max- f) & Integral(M,f) = - integral+(M,-f)
& Integral(M,f) = - Integral(M,-f)
proof
    let X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
    E be Element of S, f be nonpositive PartFunc of X,ExtREAL;
    assume ex A be Element of S st A = dom f & f is A-measurable; then
    consider A be Element of S such that
A2:  A = dom f & f is A-measurable;
A3: dom(max+f) = A by A2,MESFUNC2:def 2;
A4: f = -(max-f) by Th32; then
A5: -f = max-f by Th36;
    for x be Element of X st x in dom(max+f) holds (max+f).x = 0
    proof
     let x be Element of X;
     assume x in dom(max+f); then
     f.x = -((max-f).x) by A2,A3,A4,MESFUNC1:def 7; then
     -(f.x) = (max-f).x;
     hence (max+f).x = 0 by MESFUNC2:21;
    end; then
A6: integral+(M,max+f) = 0 by A3,A2,MESFUNC2:25,MESFUNC5:87;
A7: Integral(M,f) = integral+(M,max+f) - integral+(M,max-f) by MESFUNC5:def 16
     .= integral+(M,max+f) + -integral+(M,max-f) by XXREAL_3:def 4;
    hence Integral(M,f) = - integral+(M,max- f) by A6,XXREAL_3:4;
    thus
A8: Integral(M,f) = - integral+(M,-f) by A5,A7,A6,XXREAL_3:4;
    A = dom(-f) by A2,MESFUNC1:def 7;
    hence Integral(M,f) = - Integral(M,-f) by A8,A2,MEASUR11:63,MESFUNC5:88;
end;
