
theorem
  for L being non trivial comRing, s being non empty finite Subset of L,
x being Element of L, f being FinSequence of L st len f = card s & for i being
Element of NAT, c being Element of L st i in dom f & c = (canFS(s)).i holds f.i
  = eval(<% -c, 1.L %>,x) holds eval(poly_with_roots((s,1)-bag),x) = Product(f)
proof
  let L be non trivial comRing;
  set cL = the carrier of L;
  let s be non empty finite Subset of cL, x be Element of cL, f be FinSequence
  of L such that
A1: len f = card s and
A2: for i being Element of NAT, c being Element of cL st i in dom f & c
  = (canFS(s)).i holds f.i = eval(<% -c, 1.L %>,x);
  set cs = canFS(s);
A3: rng cs = s by FUNCT_2:def 3;
  defpred P[Nat] means ex t being finite Subset of cL, g being
  FinSequence of cL st t = rng (cs | Seg $1) & g = f | Seg $1 & eval(
  poly_with_roots((t,1)-bag),x) = Product(g);
A4: len cs = card s by FINSEQ_1:93;
  then
A5: dom f = dom cs by A1,FINSEQ_3:29;
A6: for j being Element of NAT st 1 <= j & j < len f holds P[j] implies P[j +1]
  proof
    let j be Element of NAT such that
A7: 1 <= j and
A8: j < len f;
    reconsider g1 = f | Seg (j+1) as FinSequence of cL by FINSEQ_1:18;
A9: j+1 <= len f by A8,NAT_1:13;
    then ex l being Nat st len f = j+1+l by NAT_1:10;
    then
A10: len g1 = j+1 by FINSEQ_3:53;
    1 <= j+1 by A7,NAT_1:13;
    then
A11: j+1 in dom cs by A1,A4,A9,FINSEQ_3:25;
    then cs.(j+1) in s by FINSEQ_2:11;
    then reconsider csj1 = cs.(j+1) as Element of cL;
A12: g1.(j+1) = f.(j+1) by FINSEQ_1:4,FUNCT_1:49
      .= eval(<% -csj1, 1.L %>,x) by A2,A5,A11;
    reconsider csja1 = cs | Seg (j+1) as FinSequence of s by FINSEQ_1:18;
    reconsider csja = cs | Seg j as FinSequence of s by FINSEQ_1:18;
    given t being finite Subset of cL, g being FinSequence of cL such that
A13: t = rng (cs | Seg j) and
A14: g = f | Seg j and
A15: eval(poly_with_roots((t,1)-bag),x) = Product(g);
    j <= j+1 by NAT_1:12;
    then Seg j c= Seg (j+1) by FINSEQ_1:5;
    then g = g1 | Seg j by A14,RELAT_1:74;
    then
A16: g1 = g ^ <* eval(<% -csj1, 1.L %>,x) *> by A10,A12,FINSEQ_3:55;
    reconsider pt = poly_with_roots((t,1)-bag) as Polynomial of L;
    set t1 = rng csja1;
    Seg (j+1) = Seg j \/ {j+1} by FINSEQ_1:9;
    then
A17: csja1 = csja \/ cs|{j+1} by RELAT_1:78;
    cs|{j+1} = (j+1) .--> csj1 by A11,FUNCT_7:6;
    then rng (cs|{j+1}) = {csj1} by FUNCOP_1:8;
    then
A18: t1 = t \/ {csj1} by A13,A17,RELAT_1:12;
    then reconsider t1 as finite Subset of cL;
    take t1, g1;
    thus t1 = rng (cs | Seg (j+1)) & g1 = f | Seg (j+1);
    reconsider pj1 = poly_with_roots(({csj1},1)-bag) as Polynomial of L;
A19: pj1 = <% -csj1, 1.L %> by Th58;
    t misses {csj1}
    proof
      assume not thesis;
      then t /\ {csj1} <> {} by XBOOLE_0:def 7;
      then consider x being object such that
A20:  x in t /\ {csj1} by XBOOLE_0:def 1;
      x in {csj1} by A20,XBOOLE_0:def 4;
      then
A21:  x = csj1 by TARSKI:def 1;
      x in t by A20,XBOOLE_0:def 4;
      then consider i being object such that
A22:  i in dom (cs | Seg j) and
A23:  x = (cs | Seg j).i by A13,FUNCT_1:def 3;
A24:  i in Seg j by A22,RELAT_1:57;
      reconsider i as Element of NAT by A22;
A25:  1 <= i by A24,FINSEQ_1:1;
      i <= j by A24,FINSEQ_1:1;
      then
A26:  i < j+1 by NAT_1:13;
      x = cs.i by A22,A23,FUNCT_1:47;
      hence contradiction by A1,A4,A3,A9,A21,A25,A26,GRAPH_5:7;
    end;
    then (t1,1)-bag = (t,1)-bag + ({csj1},1)-bag by A18,Th7;
    then poly_with_roots((t1,1)-bag) = pt *' pj1 by Th61;
    hence
    eval(poly_with_roots((t1,1)-bag),x) = Product(g) * eval(pj1,x) by A15,
POLYNOM4:24
      .= Product(g1) by A16,A19,GROUP_4:6;
  end;
  f | Seg len f is FinSequence by FINSEQ_1:18;
  then
A27: cs | Seg len f is FinSequence & f | Seg len f = f by FINSEQ_1:18
,FINSEQ_2:20;
A28: 0 qua Nat+1 <= len f by A1,NAT_1:13;
A29: P[1]
  proof
    1 in dom cs by A1,A4,A28,FINSEQ_3:25;
    then reconsider cs1 = cs.1 as Element of s by FINSEQ_2:11;
    reconsider g = f | Seg 1 as FinSequence of cL by FINSEQ_1:18;
    reconsider cs1a = cs | Seg 1 as FinSequence of s by FINSEQ_1:18;
A30: cs1 in cL;
A31: 1 in Seg 1 by FINSEQ_1:1;
    then
A32: cs1a.1 = cs1 by FUNCT_1:49;
    reconsider cs1 = cs.1 as Element of cL by A30;
    reconsider t = {cs1} as finite Subset of cL;
    take t, g;
    consider s1 being Element of s such that
A33: cs1a = <* s1 *> by A1,A4,A28,TREES_9:34;
    thus t = rng (cs | Seg 1) & g = f | Seg 1 by A33,A32,FINSEQ_1:39;
    consider p1 being Element of cL such that
A34: g = <* p1 *> by A28,TREES_9:34;
A35: g.1 = p1 & Product(g) = p1 by A34,FINSOP_1:11;
A36: 1 in dom f by A28,FINSEQ_3:25;
    then reconsider f1 = f.1 as Element of cL by FINSEQ_2:11;
A37: g.1 = f1 by A31,FUNCT_1:49;
    f1 = eval(<% -cs1, 1.L %>,x) by A2,A36;
    hence thesis by A37,A35,Th58;
  end;
  for i being Element of NAT st 1 <= i & i <= len f holds P[i] from
  INT_1:sch 7 (A29,A6);
  then
  ex t being finite Subset of cL, g being FinSequence of cL st t = rng (cs
  | Seg len f) & g = f | Seg len f & eval(poly_with_roots((t,1 )-bag),x) =
  Product(g) by A28;
  hence thesis by A1,A4,A27,A3,FINSEQ_2:20;
end;
