reserve a,b for object, I,J for set;
reserve b for bag of I;

theorem Th27:
  for p being Bags I-valued FinSequence, i being object st i in support Sum p
  ex b st b in rng p & i in support b
  proof
    defpred P[Nat] means
    for p being Bags I-valued FinSequence st len p = $1
    for i being object st i in support Sum p
    ex b st b in rng p & i in support b;
A1: P[0]
    proof
      let p be Bags I-valued FinSequence such that
A2:   len p = 0;
      let i be object;
      assume Z0: i in support Sum p;
      p = {} = <*>Bags I by A2;
      then i in support EmptyBag I by Z0,Th21;
      hence thesis;
    end;
A3: for j being Nat st P[j] holds P[j+1]
    proof
      let j be Nat; assume
A4:   P[j];
      let p be Bags I-valued FinSequence such that
A2:   len p = j+1;
      consider w being FinSequence, x being set such that
A5:   p = w^<*x*> & len w = j by A2,TREES_2:3;
      reconsider w, xx = <*x*> as Bags I-valued FinSequence by A5,Lem8;
      len xx = 1 by FINSEQ_1:40;
      then 1 in dom xx by FINSEQ_3:25;
      then x = xx.1 in Bags I by FUNCT_1:102;
      then reconsider x as Element of Bags I;
      Sum p = Sum w+x by A5,Th22;
      then
A6:   support Sum p = (support Sum w)\/support x by PRE_POLY:38;
      let i be object;
      assume i in support Sum p;
      then per cases by A6,XBOOLE_0:def 3;
      suppose i in support Sum w;
        then consider b such that
A7:     b in rng w & i in support b by A4,A5;
        take b;
        rng p = rng w \/ rng xx by A5,FINSEQ_1:31;
        hence thesis by A7,XBOOLE_0:def 3;
      end;
      suppose
A8:     i in support x;
        take b = x;
        rng p = rng w \/ rng xx & x in {x} = rng xx
        by A5,FINSEQ_1:31,39,TARSKI:def 1;
        hence thesis by A8,XBOOLE_0:def 3;
      end;
    end;
    let p be Bags I-valued FinSequence;
    for j being Nat holds P[j] from NAT_1:sch 2(A1,A3);
    then P[len p];
    hence thesis;
  end;
