
theorem Th24:
  for n being Ordinal, L being right_zeroed add-associative
  right_complementable well-unital distributive non trivial doubleLoopStr, c
being ConstPoly of n,L, x being Function of n,L holds eval(c,x) = coefficient(c
  )
proof
  let n be Ordinal, L be right_zeroed add-associative right_complementable
well-unital distributive non trivial doubleLoopStr, c be ConstPoly of n,L, x
  be Function of n,L;
  consider y being FinSequence of the carrier of L such that
A1: len y = len SgmX(BagOrder n, Support c) and
A2: eval(c,x) = Sum y and
A3: for i being Element of NAT st 1 <= i & i <= len y holds y/.i = (c *
  SgmX(BagOrder n, Support c))/.i * eval(((SgmX(BagOrder n, Support c))/.i),x)
  by POLYNOM2:def 4;
  now
    per cases;
    case
A4:   coefficient(c) = 0.L;
      Support c = {}
      proof
        set u = the Element of Support c;
        assume
A5:     Support c <> {};
        then u in Support c;
        then reconsider u as Element of Bags n;
        c.u <> 0.L by A5,POLYNOM1:def 4;
        then u <> EmptyBag n by A4,Lm2;
        then c.u = 0.L by Def7;
        hence thesis by A5,POLYNOM1:def 4;
      end;
      then reconsider Sc = Support c as empty Subset of Bags n;
      SgmX(BagOrder n, Sc) = {} by POLYNOM2:18,PRE_POLY:76;
      then y = <*>(the carrier of L) by A1;
      hence thesis by A2,A4,RLVECT_1:43;
    end;
    case
A6:   coefficient(c) <> 0.L;
      reconsider sc = Support c as finite Subset of Bags n;
      set sg = SgmX(BagOrder n, sc);
A7:   BagOrder n linearly_orders sc by POLYNOM2:18;
A8:   for u being object holds u in Support c implies u in {EmptyBag n}
      proof
        let u be object;
        assume
A9:     u in Support c;
        assume
A10:    not u in {EmptyBag n};
        reconsider u as Element of Bags n by A9;
        u <> EmptyBag n by A10,TARSKI:def 1;
        then c.u = 0.L by Def7;
        hence thesis by A9,POLYNOM1:def 4;
      end;
      for u being object holds u in {EmptyBag n} implies u in Support c
      proof
        let u be object;
        assume
A11:    u in {EmptyBag n};
        then
A12:    u = EmptyBag n by TARSKI:def 1;
        reconsider u as Element of Bags n by A11;
        c.u <> 0.L by A6,A12,Lm2;
        hence thesis by POLYNOM1:def 4;
      end;
      then Support c = {EmptyBag n} by A8,TARSKI:2;
      then
A13:  rng sg = {EmptyBag n} by A7,PRE_POLY:def 2;
      then
A14:  EmptyBag n in rng sg by TARSKI:def 1;
      then
A15:  1 in dom sg by FINSEQ_3:31;
      then
A16:  sg.1 in rng sg by FUNCT_1:3;
A17:  for u being object holds u in dom sg implies u in {1}
      proof
        let u be object;
        assume
A18:    u in dom sg;
        assume
A19:    not u in {1};
        reconsider u as Element of NAT by A18;
        sg/.u = sg.u by A18,PARTFUN1:def 6;
        then
A20:    sg/.u in rng sg by A18,FUNCT_1:3;
A21:    u <> 1 by A19,TARSKI:def 1;
A22:    1 < u
        proof
          consider k being Nat such that
A23:      dom sg = Seg k by FINSEQ_1:def 2;
          Seg k = {m where m is Nat : 1 <= m & m <= k} by FINSEQ_1:def 1;
          then
          ex m9 being Nat st m9 = u & 1 <= m9 & m9 <= k by A18,A23;
          hence thesis by A21,XXREAL_0:1;
        end;
        sg/.1 = sg.1 by A14,A18,FINSEQ_3:31,PARTFUN1:def 6;
        then sg/.1 in rng sg by A15,FUNCT_1:3;
        then sg/.1 = EmptyBag n by A13,TARSKI:def 1
          .= sg/.u by A13,A20,TARSKI:def 1;
        hence thesis by A7,A15,A18,A22,PRE_POLY:def 2;
      end;
      for u being object holds u in {1} implies u in dom sg
       by A15,TARSKI:def 1;
      then
A24:  dom sg = Seg 1 by A17,FINSEQ_1:2,TARSKI:2;
      then
A25:  1 in dom sg by FINSEQ_1:2,TARSKI:def 1;
      sg/.1 = sg.1 by A15,PARTFUN1:def 6;
      then sg/.1 in rng sg by A25,FUNCT_1:3;
      then
A26:  sg/.1 = EmptyBag n by A13,TARSKI:def 1;
A27:  len sg = 1 by A24,FINSEQ_1:def 3;
      dom c = Bags n by FUNCT_2:def 1;
      then 1 in dom (c * sg) by A13,A15,A16,FUNCT_1:11;
      then
A28:  (c * sg)/.1 = (c * sg).1 by PARTFUN1:def 6
        .= c.(sg.1) by A15,FUNCT_1:13
        .= c.(EmptyBag n) by A13,A16,TARSKI:def 1
        .= coefficient(c) by Lm2;
      dom y = Seg(len y) by FINSEQ_1:def 3
        .= dom sg by A1,FINSEQ_1:def 3;
      then y.1 = y/.1 by A25,PARTFUN1:def 6
        .= coefficient(c) * eval(EmptyBag n,x) by A1,A3,A27,A26,A28
        .= coefficient(c) * 1.L by POLYNOM2:14
        .= coefficient(c);
      then y = <* coefficient(c) *> by A1,A27,FINSEQ_1:40;
      hence thesis by A2,RLVECT_1:44;
    end;
  end;
  hence thesis;
end;
