
theorem Th51:
for f,g be sequence of ExtREAL, i,j be Nat st
 f is nonnegative &
 i >= j & (for n be Nat st n <> i & n <> j holds f.n = g.n)
 & f.i = g.j & f.j = g.i
 holds SUM f = SUM g
proof
    let f,g be sequence of ExtREAL, i,j be Nat;
    assume that
A1:  f is nonnegative and
A2:  i >= j and
A3:  for n be Nat st n <> i & n <> j holds f.n = g.n and
A4:  f.i = g.j and
A5:  f.j = g.i;

A6: SUM f <= SUM g by A1,A2,A3,A4,A5,Lm13;

    for k be Element of NAT holds 0 <= g.k
    proof
     let k be Element of NAT;
     per cases;
     suppose k = i or k = j;
      hence 0 <= g.k by A1,A4,A5,SUPINF_2:51;
     end;
     suppose k <> i & k <> j; then
      g.k = f.k by A3;
      hence 0 <= g.k by A1,SUPINF_2:51;
     end;
    end; then
    g is nonnegative by SUPINF_2:39; then
    SUM g <= SUM f by A2,A3,A4,A5,Lm13;
    hence SUM f = SUM g by A6,XXREAL_0:1;
end;
