
theorem Th10:
  for G being sequence of ExtREAL st G is nonnegative holds
for S being non empty Subset of NAT holds for H being Function of S,NAT st H is
  one-to-one holds SUM(On(G*H)) <= SUM(G)
proof
  let G be sequence of ExtREAL;
  assume
A1: G is nonnegative;
  let S be non empty Subset of NAT;
  let H be Function of S,NAT;
  defpred P[Nat] means
ex m being Element of NAT st for F being
sequence of ExtREAL st F is nonnegative holds Ser(On(F*H)).$1 <= Ser(F).m;
  assume
A2: H is one-to-one;
A3: for k being Nat st P[k] holds P[k+1]
  proof
    let k be Nat;
    given m0 being Element of NAT such that
A4: for F being sequence of ExtREAL st F is nonnegative holds Ser
    (On(F*H)).k <= Ser(F).m0;
    per cases;
    suppose
A5:   k+1 in S;
      reconsider m1 = H.(k+1) as Element of NAT;
      set m = m0 + m1;
      take m;
      let F be sequence of ExtREAL;
      defpred QQ0[Element of NAT,Element of ExtREAL] means (($1 = H.(k+1)
      implies $2 = F.$1) & ($1 <> H.(k+1) implies $2 = 0.));
A6:   for n being Element of NAT holds ex y being Element of ExtREAL st
      QQ0[n,y]
      proof
        let n be Element of NAT;
        per cases;
        suppose
A7:       n = H.(k+1);
          take F.n;
          thus thesis by A7;
        end;
        suppose
A8:       n <> H.(k+1);
          take 0.;
          thus thesis by A8;
        end;
      end;
      consider G0 being sequence of ExtREAL such that
A9:   for n being Element of NAT holds QQ0[n,G0.n] from FUNCT_2:sch 3
      (A6);
      reconsider GG0 = On(G0*H) as sequence of ExtREAL;
A10:  for n being Element of NAT holds n <> k+1 implies GG0.n = 0.
      proof
        let n be Element of NAT;
        assume
A11:    n <> k+1;
        per cases;
        suppose
A12:      n in S;
          then
A13:      GG0.n = (G0*H).n by Def1
            .= G0.(H.n) by A12,FUNCT_2:15;
          reconsider n as Element of S by A12;
          not H.n = H.(k+1) by A2,A5,A11,FUNCT_2:19;
          hence thesis by A9,A13;
        end;
        suppose
          not n in S;
          hence thesis by Def1;
        end;
      end;
      assume
A14:  F is nonnegative;
      for n being Element of NAT holds 0. <= G0.n
      proof
        let n be Element of NAT;
        per cases;
        suppose
          n = H.(k+1);
          then G0.n = F.n by A9;
          hence thesis by A14,SUPINF_2:39;
        end;
        suppose
          not n = H.(k+1);
          hence thesis by A9;
        end;
      end;
      then
A15:  G0 is nonnegative by SUPINF_2:39;
      reconsider n = k+1 as Element of S by A5;
      defpred QQ1[Element of NAT,Element of ExtREAL] means (($1 <> H.(k+1)
      implies $2 = F.$1) & ($1 = H.(k+1) implies $2 = 0.));
A16:  for n being Element of NAT holds ex y being Element of ExtREAL st
      QQ1[n,y]
      proof
        let n be Element of NAT;
        per cases;
        suppose
A17:      n <> H.(k+1);
          take F.n;
          thus thesis by A17;
        end;
        suppose
A18:      n = H.(k+1);
          take 0.;
          thus thesis by A18;
        end;
      end;
      consider G1 being sequence of ExtREAL such that
A19:  for n being Element of NAT holds QQ1[n,G1.n] from FUNCT_2:sch 3
      (A16);
      set GG1 = On(G1*H);
A20:  GG1.(k+1) = (G1*H).n by Def1
        .= G1.(H.n) by FUNCT_2:15
        .= 0. by A19;
A21:  GG0.n = (G0*H).n by Def1
        .= G0.(H.n) by FUNCT_2:15
        .= F.(H.n) by A9;
      then
A22:  (Ser GG0).(k+1) = F.(H.(k+1)) by A10,Th9;
A23:  for n being Element of NAT holds n <> k+1 & n in S implies GG1.n =
      F.(H.n)
      proof
        let n be Element of NAT;
        assume that
A24:    n <> k+1 and
A25:    n in S;
A26:    GG1.n = (G1*H).n by A25,Def1
          .= G1.(H.n) by A25,FUNCT_2:15;
        reconsider n as Element of S by A25;
        not H.n = H.(k+1) by A2,A5,A24,FUNCT_2:19;
        hence thesis by A19,A26;
      end;
A27:  for n being Element of NAT holds On(F*H).n = GG0.n + GG1.n
      proof
        let n be Element of NAT;
        per cases;
        suppose
A28:      n = k+1;
          then On(F*H).n = (F*H).n by A5,Def1
            .= F.(H.n) by A5,A28,FUNCT_2:15
            .= GG0.n + GG1.n by A21,A20,A28,XXREAL_3:4;
          hence thesis;
        end;
        suppose
A29:      n <> k+1;
          now
            per cases;
            suppose
A30:          n in S;
              then
A31:          GG1.n = F.(H.n) by A23,A29;
A32:          GG0.n = 0. by A10,A29;
              On(F*H).n = (F*H).n by A30,Def1
                .= F.(H.n) by A30,FUNCT_2:15
                .= GG0.n + GG1.n by A32,A31,XXREAL_3:4;
              hence thesis;
            end;
            suppose
A33:          not n in S;
              then
A34:          GG1.n = 0. by Def1;
A35:          GG0.n = 0. by A10,A29;
              On(F*H).n = 0. by A33,Def1
                .= GG0.n + GG1.n by A35,A34;
              hence thesis;
            end;
          end;
          hence thesis;
        end;
      end;
      m1 <= m by NAT_1:11;
      then
A36:  (Ser G0).m = G0.(H.(k+1)) by A9,Th9;
      set v = H.n;
A37:  (Ser GG1).(k+1) = (Ser GG1).k + GG1.(k+1) by SUPINF_2:def 11
        .= (Ser On(G1*H)).k by A20,XXREAL_3:4;
A38:  G0.v = F.v by A9;
      for n being Element of NAT holds 0. <= G1.n
      proof
        let n be Element of NAT;
        per cases;
        suppose
          n <> H.(k+1);
          then G1.n = F.n by A19;
          hence thesis by A14,SUPINF_2:39;
        end;
        suppose
          n = H.(k+1);
          hence thesis by A19;
        end;
      end;
      then
A39:  G1 is nonnegative by SUPINF_2:39;
      then G1*H is nonnegative by MEASURE1:25;
      then
A40:  GG1 is nonnegative by Th7;
      G0*H is nonnegative by A15,MEASURE1:25;
      then GG0 is nonnegative by Th7;
      then
A41:  (Ser On(F*H)).(k+1) = (Ser GG0).(k+1) + (Ser GG1).(k+1) by A40,A27,Th3;
      (Ser On(G1*H)).k <= Ser(G1).m0 & Ser(G1).m0 <= Ser(G1).m by A4,A39,Th8,
NAT_1:11;
      then
A42:  (Ser GG1).(k+1) <= (Ser G1).m by A37,XXREAL_0:2;
      for m being Element of NAT holds F.m = G0.m + G1.m
      proof
        let m be Element of NAT;
        per cases;
        suppose
          m = H.(k+1);
          then G0.m = F.m & G1.m = 0. by A9,A19;
          hence thesis by XXREAL_3:4;
        end;
        suppose
          m <> H.(k+1);
          then G0.m = 0. & G1.m = F.m by A9,A19;
          hence thesis by XXREAL_3:4;
        end;
      end;
      then (Ser F).m = (Ser G0).m + (Ser G1).m by A15,A39,Th3;
      hence thesis by A22,A36,A38,A42,A41,XXREAL_3:36;
    end;
    suppose
A43:  not k+1 in S;
      take m0;
      let F be sequence of ExtREAL;
A44:  On(F*H).(k+1) = 0. by A43,Def1;
      assume
A45:  F is nonnegative;
      Ser(On(F*H)).(k+1) = Ser(On(F*H)).k + (On(F*H)).(k+1) by SUPINF_2:def 11
        .= Ser(On(F*H)).k by A44,XXREAL_3:4;
      hence thesis by A4,A45;
    end;
  end;
A46: P[0]
  proof
    per cases;
    suppose
A47:  0 in S;
      reconsider m = H.0 as Element of NAT;
      take m;
      let F be sequence of ExtREAL;
      Ser(On(F*H)).0 = (On(F*H)).0 by SUPINF_2:def 11;
      then
A48:  Ser(On(F*H)).0 = (F*H).0 by A47,Def1
        .= F.(H.0) by A47,FUNCT_2:15;
      assume F is nonnegative;
      hence thesis by A48,Th2;
    end;
    suppose
A49:  not 0 in S;
      take m = 0;
      let F be sequence of ExtREAL;
      assume F is nonnegative;
      then
A50:  0. <= F.0 & F.0 <= Ser(F).m by Th2,SUPINF_2:39;
      Ser(On(F*H)).0 = (On(F*H)).0 by SUPINF_2:def 11;
      then Ser(On(F*H)).0 = 0. by A49,Def1;
      hence thesis by A50,XXREAL_0:2;
    end;
  end;
A51: for k being Nat holds P[k] from NAT_1:sch 2(A46,A3);
  for x being ExtReal st x in rng Ser(On(G*H)) holds ex y being
  ExtReal st y in rng Ser(G) & x <= y
  proof
    let x be ExtReal;
    assume
A52: x in rng Ser(On(G*H));
    ex y being ExtReal st y in rng Ser(G) & x <= y
    proof
      consider n being object such that
A53:  n in dom Ser(On(G*H)) and
A54:  x = Ser(On(G*H)).n by A52,FUNCT_1:def 3;
      reconsider n as Element of NAT by A53;
      consider m being Element of NAT such that
A55:  for F being sequence of ExtREAL st F is nonnegative holds
      Ser(On(F*H)).n <= Ser(F).m by A51;
      take Ser(G).m;
      dom Ser(G) = NAT by FUNCT_2:def 1;
      hence thesis by A1,A54,A55,FUNCT_1:def 3;
    end;
    hence thesis;
  end;
  then
   sup(rng Ser(On(G*H))) <= sup(rng Ser(G)) by XXREAL_2:63;
  hence thesis;
end;
