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 Th36:
  for O be Ordinal, L be right_zeroed add-associative
    right_complementable Abelian well-unital distributive non trivial
    doubleLoopStr,
    p be Polynomial of O,L,
    x be Function of  O,L
  for P be FinSequence of Polynom-Ring (O, L) st p = Sum P
    for E be FinSequence of L st len E = len P &
      for s be Polynomial of O,L,i st i in dom E & s = P.i holds E.i=eval(s,x)
    holds eval(p,x) = Sum E
proof
  let O be Ordinal, L be right_zeroed add-associative
  right_complementable Abelian well-unital distributive non trivial
  doubleLoopStr, p be Polynomial of O,L, x be Function of  O,L;
  set PR=Polynom-Ring (O, L);
  let P be FinSequence of PR such that
A1: p = Sum P;
  let E be FinSequence of the carrier of L such that
A2:len E = len P &
  for s be Polynomial of O,L,i st i in dom E & s = P.i
  holds E.i=eval(s,x);
  defpred P[Nat] means for i be Nat st $1=i & i <= len P holds
  for q be Polynomial of O,L st q = Sum (P|i) holds Sum (E|i) = eval(q,x);
A3: P[0]
  proof
    let i be Nat;
    assume
A4: 0=i & i<=len P;
    let q be Polynomial of O,L such that
A5: q = Sum (P | i);
    P | i = <*>(the carrier of PR) by A4;
    then q = 0.PR by A5,RLVECT_1:43
    .= 0_(O,L) by POLYNOM1:def 11;
    then
A6: eval(q,x) = 0.L by POLYNOM2:20;
    E|0 =<*>(the carrier of L);
    hence thesis by A4,A6,RLVECT_1:43;
  end;
  A7: P[n] implies P[n+1]
  proof
    assume
A8: P[n];
    let n1 be Nat such that
A9: n1=n+1 & n1 <= len P;
    let q be Polynomial of O,L such that
A10:q = Sum (P | n1);
    reconsider q1 = Sum(P|n), Pn1 = P/.n1 as Polynomial of O,L
    by POLYNOM1:def 11;
A11:n1 in dom P & n1 in dom E by A2,A9,FINSEQ_3:25,NAT_1:11;
    then
A12: P|n1 = (P|n)^<*P.n1*> & P.n1 =P/.n1 & E|n1 = (E|n)^<*E.n1*>
    by A9,FINSEQ_5:10,PARTFUN1:def 6;
    then
A13: q = Sum(P|n) + Sum(<*P/.n1*>) by A10,RLVECT_1:41
    .= Sum(P|n) + P/.n1 by RLVECT_1:44
    .= q1+ Pn1 by POLYNOM1:def 11;
A14: n < len P by NAT_1:13,A9;
    E.n1 = eval(Pn1,x) by A11,A12,A2;
    hence Sum (E|n1) = Sum(E|n) +Sum <*eval(Pn1,x)*> by A12,RLVECT_1:41
    .= Sum(E|n) + eval(Pn1,x) by RLVECT_1:44
    .= eval(q1,x) + eval(Pn1,x) by A14,A8
    .= eval(q,x) by A13,POLYNOM2:23;
  end;
A15: P | len P = P;
  P[n] from NAT_1:sch 2(A3,A7);
  then Sum (E|len E) = eval(p,x) by A1,A2,A15;
  hence thesis;
end;
