
theorem Th59:
  for L being add-associative right_zeroed right_complementable
  distributive non empty doubleLoopStr, b being bag of the carrier of L, f
being FinSequence of (the carrier of Polynom-Ring L)*, s being FinSequence of L
st len f = card support b & s = canFS(support b) & (for i being Element of NAT
st i in dom f holds f.i = fpoly_mult_root(s/.i,b.(s/.i))) holds len FlattenSeq
  f = degree b
proof
  let L be add-associative right_zeroed right_complementable distributive non
empty doubleLoopStr, b being bag of the carrier of L, f being FinSequence of (
  the carrier of Polynom-Ring L)*, s being FinSequence of L such that
A1: len f = card support b and
A2: s = canFS(support b) and
A3: for i being Element of NAT st i in dom f holds f.i = fpoly_mult_root
  (s/.i,b.(s/.i));
  reconsider Cf = Card f as FinSequence of NAT;
  consider g being FinSequence of NAT such that
A4: degree b = Sum g and
A5: g = b*canFS(support b) by Def3;
  len s = card support b by A2,FINSEQ_1:93;
  then
A6: dom f = dom s by A1,FINSEQ_3:29;
A7: now
A8: rng s c= dom b
    proof
      let x be object;
      assume x in rng s;
      then
A9:   x in support b by A2,FUNCT_2:def 3;
      support b c= dom b by PRE_POLY:37;
      hence thesis by A9;
    end;
    thus dom Card f = dom f by CARD_3:def 2
      .= dom g by A2,A6,A5,A8,RELAT_1:27;
    let i be Nat;
    assume i in dom Card f;
    then
A10: i in dom f by CARD_3:def 2;
    then
A11: g.i = b.(s.i) by A2,A6,A5,FUNCT_1:13;
    f.i = fpoly_mult_root(s/.i,b.(s/.i)) by A3,A10;
    then
A12: len (f.i) = b.(s/.i) by Def9;
    thus Cf.i = card (f.i) by A10,CARD_3:def 2
      .= g.i by A6,A10,A12,A11,PARTFUN1:def 6;
  end;
  len FlattenSeq f = Sum Cf by PRE_POLY:27;
  hence thesis by A4,A7,FINSEQ_1:13;
end;
