reserve X for non empty set;
reserve e for set;
reserve x for Element of X;
reserve f,g for PartFunc of X,ExtREAL;
reserve S for SigmaField of X;
reserve F for Function of RAT,S;
reserve p,q for Rational;
reserve r for Real;
reserve n,m for Nat;
reserve A,B for Element of S;

theorem
  for C being non empty set, f being PartFunc of C,ExtREAL holds
  f = max+(f) - max-(f)
proof
  let C be non empty set;
  let f be PartFunc of C,ExtREAL;
A1: dom f = dom(max+(f)-max-(f)) by Th17;
   for x being Element of C st x in dom f holds f.x = (max+(f) - max-(f)).x
  proof
    let x be Element of C;
    assume
A2: x in dom f;
then A3: (max+(f) - max-(f)).x = max+(f).x - max-(f).x by A1,MESFUNC1:def 4;
    per cases by Th18;
    suppose
A4:   max+(f).x = f.x;
then    max-(f).x = 0. by Th19;
then    -max-(f).x = 0;
      hence thesis by A3,A4,XXREAL_3:4;
    end;
    suppose
A5:   max+(f).x = 0.;
then    max-(f).x = -(f.x) by A2,Th20;
      hence thesis by A3,A5,XXREAL_3:4;
    end;
  end;
  hence thesis by A1,PARTFUN1:5;
end;
