
theorem
for X be non empty set, A be set, er be ExtReal, f be Function of X,ExtREAL st
 (for x be Element of X holds f.x = er * chi(A,X).x)
holds (er = +infty implies f = Xchi(A,X)) &
      (er = -infty implies f = -Xchi(A,X)) &
      (er <> +infty & er <> -infty implies
           ex r be Real st r = er & f = r(#)chi(A,X))
proof
   let X be non empty set, A be set, er be ExtReal, f be Function of X,ExtREAL;
   assume A1: for x be Element of X holds f.x = er * chi(A,X).x;
   hereby assume A2: er = +infty;
    for x be Element of X holds f.x = Xchi(A,X).x
    proof
     let x be Element of X;
     per cases;
     suppose A3: x in A; then
A4:   Xchi(A,X).x = +infty by MEASUR10:def 7;
      chi(A,X).x = 1 by A3,FUNCT_3:def 3; then
      f.x = er * 1 by A1;
      hence f.x = Xchi(A,X).x by A2,A4,XXREAL_3:81;
     end;
     suppose A5: not x in A; then
      chi(A,X).x = 0 by FUNCT_3:def 3; then
      f.x = er * 0 by A1;
      hence f.x = Xchi(A,X).x by A5,MEASUR10:def 7;
     end;
    end;
    hence f = Xchi(A,X) by FUNCT_2:def 8;
   end;
   hereby assume A6: er = -infty;
    for x be Element of X holds f.x = (-Xchi(A,X)).x
    proof
     let x be Element of X;
     dom Xchi(A,X) = X by FUNCT_2:def 1; then
     x in dom Xchi(A,X); then
A7:  x in dom(-Xchi(A,X)) by MESFUNC1:def 7;
     per cases;
     suppose A8: x in A; then
      Xchi(A,X).x = +infty by MEASUR10:def 7; then
A9:   (-Xchi(A,X)).x = -+infty by A7,MESFUNC1:def 7;
      chi(A,X).x = 1 by A8,FUNCT_3:def 3; then
      f.x = er * 1 by A1;
      hence f.x = (-Xchi(A,X)).x by A6,A9,XXREAL_3:6,81;
     end;
     suppose A10: not x in A; then
A11:  -(Xchi(A,X).x) = -0 by MEASUR10:def 7;
      chi(A,X).x = 0 by A10,FUNCT_3:def 3; then
      f.x = er * 0 by A1;
      hence f.x = (-Xchi(A,X)).x by A7,A11,MESFUNC1:def 7;
     end;
    end;
    hence f = -Xchi(A,X) by FUNCT_2:def 8;
   end;
   assume er <> +infty & er <> -infty; then
   er in REAL by XXREAL_0:14; then
   reconsider r = er as Real;
   dom f = X & dom chi(A,X) = X by FUNCT_2:def 1; then
A12:dom f = dom(r(#)chi(A,X)) by MESFUNC1:def 6;
   for x be Element of X st x in dom f holds f.x = (r(#)chi(A,X)).x
   proof
    let x be Element of X;
    assume x in dom f; then
    (r(#)chi(A,X)).x = r * chi(A,X).x by A12,MESFUNC1:def 6;
    hence f.x = (r(#)chi(A,X)).x by A1;
   end;
   hence ex r be Real st r = er & f = r(#)chi(A,X) by A12,PARTFUN1:5;
end;
