
theorem Th42:
for X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
 f,g be PartFunc of X,REAL holds f a.e.= g,M iff
  max+f a.e.= max+g,M & max-f a.e.= max-g,M
proof
    let X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
    f,g be PartFunc of X,REAL;
    hereby assume f a.e.= g,M; then
     consider E be Element of S such that
A1:   M.E = 0 & f|E` = g|E` by LPSPACE1:def 10;

     (max+f)|E` = max+(f|E`) by RFUNCT_3:44; then
     (max+f)|E` = (max+g)|E` by A1,RFUNCT_3:44;
     hence max+f a.e.= max+g,M by A1,LPSPACE1:def 10;

     (max-f)|E` = max-(f|E`) by RFUNCT_3:45; then
     (max-f)|E` = (max-g)|E` by A1,RFUNCT_3:45;
     hence max-f a.e.= max-g,M by A1,LPSPACE1:def 10;
    end;
    assume that
A2:  max+f a.e.= max+g,M and
A3:  max-f a.e.= max-g,M;
    consider E1 be Element of S such that
A4:  M.E1 = 0 & (max+f)|E1` = (max+g)|E1` by A2,LPSPACE1:def 10;
    consider E2 be Element of S such that
A5:  M.E2 = 0 & (max-f)|E2` = (max-g)|E2` by A3,LPSPACE1:def 10;

    set E = E1 \/ E2;
    M.E <= M.E1 + M.E2 by MEASURE1:10; then
    M.E <= 0 + 0 by A4,A5; then

A6: M.E = 0 by SUPINF_2:51;

    (max+f)|E` = ((max+g)|E1`)|E` by A4,SUBSET_1:21,RELAT_1:74; then
A7: (max+f)|E` = (max+g)|E` by SUBSET_1:21,RELAT_1:74;

    (max-f)|E` = ((max-g)|E2`)|E` by A5,SUBSET_1:21,RELAT_1:74; then
A8: (max-f)|E` = (max-g)|E` by SUBSET_1:21,RELAT_1:74;

A9:dom(max+f - max-f) = dom f & dom(max+g - max-g) = dom g by RFUNCT_3:34;

    dom(f|E`) = dom(max+(f|E`)) by RFUNCT_3:def 10; then
    dom(f|E`) = dom((max+f)|E`) by RFUNCT_3:44; then
    dom(f|E`) = dom(max+(g|E`)) by A7,RFUNCT_3:44; then
A10: dom(f|E`) = dom(g|E`) by RFUNCT_3:def 10;
    for x be Element of X st x in dom(f|E`) holds
     (f|E`).x = (g|E`).x
    proof
     let x be Element of X;
     assume A11: x in dom(f|E`); then
A12:  x in dom f & x in E` by RELAT_1:57;

A13:  x in dom g & x in E` by A10,A11,RELAT_1:57;

     (f|E`).x = f.x by A11,FUNCT_1:47; then
     (f|E`).x = (max+f - max-f).x by RFUNCT_3:34; then
     (f|E`).x = (max+f).x - (max-f).x by A12,A9,VALUED_1:13; then
     (f|E`).x = ((max+f)|E`).x - (max-f).x by A12,FUNCT_1:49; then
     (f|E`).x = ((max+f)|E`).x - ((max-f)|E`).x by A12,FUNCT_1:49; then
     (f|E`).x = (max+g).x - ((max-g)|E`).x by A12,A7,A8,FUNCT_1:49; then
     (f|E`).x = (max+g).x - (max-g).x by A12,FUNCT_1:49; then
     (f|E`).x = (max+g - max-g).x by A13,A9,VALUED_1:13; then
     (f|E`).x = g.x by RFUNCT_3:34;
     hence (f|E`).x = (g|E`).x by A13,FUNCT_1:49;
    end;
    hence f a.e.= g,M by A6,A10,PARTFUN1:5,LPSPACE1:def 10;
end;
