reserve i,j,k,n,m for Nat,
        X for set,
        b,s for bag of X,
        x for object;
reserve O for Ordinal,
        R for right_zeroed add-associative right_complementable
          right_unital distributive non trivial doubleLoopStr,
        p for Polynomial of O, R;
reserve O for Ordinal,
        R for right_zeroed add-associative right_complementable
             right_unital distributive non trivial doubleLoopStr,
        p for Polynomial of O, R;

theorem Th34:
  for t be bag of O
    for ordP be one-to-one FinSequence of Bags O st
      rng ordP = Support (p `^ (t.x))
      ex ordS be one-to-one FinSequence of Bags O st
        rng ordS = Support Subst(t,x,p) &
        len ordS = len ordP  &
        for j st 1 <= j <= len ordS holds ordS.j = Subst(t,x,ordP/.j)
proof
  let t be bag of O; set S = Subst(t,x,p), P=p `^ (t.x);
  let ordP be one-to-one FinSequence of Bags O such that
A1: rng ordP = Support P;
  deffunc O(object) = Subst(t,x,ordP/.$1);
  consider ordS be FinSequence such that
A2: len ordS = len ordP and
A3: for k st k in dom ordS holds ordS.k=O(k) from FINSEQ_1:sch 2;
A4: dom ordS = dom ordP by A2,FINSEQ_3:29;
A5: dom S = Bags O =dom P by FUNCT_2:def 1;
A6: rng ordS c= Support S
  proof
    let y be object;
    assume y in rng ordS;
    then consider z be object such that
A7: z in dom ordS & ordS.z = y by FUNCT_1:def 3;
    reconsider z as Nat by A7;
A8: ordS.z=O(z) by A7,A3;
    ordP/.z = ordP.z in rng ordP by A7,A4,FUNCT_1:def 3,PARTFUN1:def 6;
    then
A9:  P. (ordP/.z)<>0.R by POLYNOM1:def 3,A1;
A10: O(z) in Bags O by PRE_POLY:def 12;
    S. O(z) = P. (ordP/.z) by Th33;
    hence thesis by A8,A7,A9,A5,A10,POLYNOM1:def 3;
  end;
  then reconsider ordS as FinSequence of Bags O by FINSEQ_1:def 4,XBOOLE_1:1;
A11: Support S c= rng ordS
  proof
    let y be object such that
A12:y in Support S;
    reconsider y as bag of O by A12;
A13: S.y <>0.R by A12,POLYNOM1:def 3;
    then consider s be bag of O such that
A14: y = Subst(t,x,s) by Def3;
A15: s in dom P by A5,PRE_POLY:def 12;
    S.y = P.s by A14,Th33;
    then s in Support P by A13,A15,POLYNOM1:def 3;
    then consider i be object such that
A16:  i in dom ordP & ordP.i = s by A1,FUNCT_1:def 3;
    reconsider i as Nat by A16;
    ordP/.i= s by A16,PARTFUN1:def 6;
    then ordS.i = y by A14,A3,A16,A4;
    hence thesis by A16,A4,FUNCT_1:def 3;
  end;
  ordS is one-to-one
  proof
    let x1,x2 be object such that
A17:x1 in dom ordS & x2 in dom ordS & ordS.x1 = ordS.x2;
    ordS.x1 = O(x1) & ordS.x2 = O(x2) by A3,A17;
    then ordP.x1=ordP/.x1 = ordP/.x2 =ordP.x2 by A4,PARTFUN1:def 6, Th32,A17;
    hence thesis by A17,A4,FUNCT_1:def 4;
  end;
  then reconsider ordS as one-to-one FinSequence of Bags O;
  take ordS;
  thus rng ordS = Support Subst(t,x,p) & len ordS = len ordP
    by A2,A6,A11,XBOOLE_0:def 10;
  thus thesis by A3,FINSEQ_3:25;
end;
