
theorem Th11:
  for n being Ordinal, b being bag of n, s being finite Subset of n,
  f, g being FinSequence of NAT
  st f = b*SgmX(RelIncl n, support b) & g = b*SgmX(RelIncl n, support b \/ s)
  holds Sum f = Sum g
proof
  let n be Ordinal, b be bag of n, s be finite Subset of n,
  f, g be FinSequence of NAT such that
A1: f = b*SgmX(RelIncl n, support b) and
A2: g = b*SgmX(RelIncl n, support b \/ s);
  set sb = support b;
  set sbs = sb \/ s;
  set sbs9b = sbs\sb;
  set xsb = SgmX(RelIncl n, sb), xsbs = SgmX(RelIncl n, sbs);
  set xsbs9b = SgmX(RelIncl n, sbs9b);
  set xs = xsb^xsbs9b;
  set h = b*xs;
A3: dom b = n by PARTFUN1:def 2;
A4: field(RelIncl n) = n by WELLORD2:def 1;
A5: RelIncl n is being_linear-order by ORDERS_1:19;
A6: RelIncl n linearly_orders n by A4,ORDERS_1:19,37;
A7: RelIncl n linearly_orders sbs by A4,A5,ORDERS_1:37,38;
A8: RelIncl n linearly_orders sb by A4,A5,ORDERS_1:37,38;
A9: RelIncl n linearly_orders sbs9b by A4,A5,ORDERS_1:37,38;
A10: rng xsbs = sbs by A7,PRE_POLY:def 2;
A11: rng xsb = sb by A8,PRE_POLY:def 2;
A12: rng xsbs9b = sbs9b by A9,PRE_POLY:def 2;
  then
A13: rng xs = sb \/ sbs9b by A11,FINSEQ_1:31;
  then reconsider h as FinSequence by A3,FINSEQ_1:16;
  per cases;
  suppose n = {};
    hence thesis by A1,A2;
  end;
  suppose n <> {};
    then reconsider n as non empty Ordinal;
    reconsider xsb, xsbs9b as FinSequence of n;
    rng b c= REAL;
    then reconsider b as Function of n,REAL by A3,FUNCT_2:2;
    rng h c= rng b by RELAT_1:26;
    then rng h c= REAL by XBOOLE_1:1;
    then reconsider h as FinSequence of REAL by FINSEQ_1:def 4;
    reconsider gr = g as FinSequence of REAL by FINSEQ_2:24,NUMBERS:19;
A14: sb misses sbs9b by XBOOLE_1:79;
A15: sbs = sb \/ sb \/ s .= sb \/ sbs by XBOOLE_1:4
      .= sb \/ sbs9b by XBOOLE_1:39;
    len xs = len xsb + len xsbs9b by FINSEQ_1:22
      .= card sb + len xsbs9b by A6,ORDERS_1:38,PRE_POLY:11
      .= card sb + card sbs9b by A6,ORDERS_1:38,PRE_POLY:11
      .= card sbs by A15,CARD_2:40,XBOOLE_1:79
      .= len xsbs by A6,ORDERS_1:38,PRE_POLY:11;
    then
A16: dom xsbs = dom xs by FINSEQ_3:29;
A17: xsbs is one-to-one by A6,ORDERS_1:38,PRE_POLY:10;
A18: rng xsb = sb by A8,PRE_POLY:def 2;
A19: rng xsbs9b = sbs9b by A9,PRE_POLY:def 2;
A20: xsb is one-to-one by A6,ORDERS_1:38,PRE_POLY:10;
    xsbs9b is one-to-one by A6,ORDERS_1:38,PRE_POLY:10;
    then xs is one-to-one by A14,A18,A19,A20,FINSEQ_3:91;
    then
A21: gr,h are_fiberwise_equipotent
       by A2,A3,A10,A13,A15,A16,A17,CLASSES1:83,RFINSEQ:26;
    now
      thus dom xsbs9b = dom (b*xsbs9b) by A3,A12,RELAT_1:27;
A22:  dom xsbs9b = Seg len xsbs9b by FINSEQ_1:def 3;
      hence dom xsbs9b = dom ((len xsbs9b) |-> 0) by FUNCOP_1:13;
      let x be object;
      assume
A23:  x in dom xsbs9b;
      then xsbs9b.x in rng xsbs9b by FUNCT_1:3;
      then not xsbs9b.x in sb by A12,XBOOLE_0:def 5;
      then b.(xsbs9b.x) = 0 by PRE_POLY:def 7;
      hence (b*xsbs9b).x = 0 by A23,FUNCT_1:13
        .= ((len xsbs9b) |-> 0).x by A22,A23,FUNCOP_1:7;
    end;
    then
A24: b*xsbs9b = (len xsbs9b) |-> (0 qua Real) by FUNCT_1:2;
    h = (b*xsb)^(b*xsbs9b) by FINSEQOP:9;
    then Sum h = Sum (b*xsb) + Sum (b*xsbs9b) by RVSUM_1:75
      .= Sum f + (0 qua Nat) by A1,A24,RVSUM_1:81;
    hence thesis by A21,RFINSEQ:9;
  end;
end;
