
theorem
  for n being Ordinal, L being left_zeroed right_zeroed
  left_add-cancelable add-associative right_complementable well-unital
  associative domRing-like distributive non trivial doubleLoopStr, p being
Polynomial of n,L, a being Element of L, x being Function of n,L holds eval(a*p
  ,x) = a * eval(p,x)
proof
  let n be Ordinal, L be left_zeroed right_zeroed left_add-cancelable
  add-associative right_complementable well-unital associative domRing-like
distributive non trivial doubleLoopStr, p be Polynomial of n,L, a be Element
  of 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(a*p)) and
A2: eval(a*p,x) = Sum y and
A3: for i being Element of NAT st 1 <= i & i <= len y holds y/.i = ((a*p
) * SgmX(BagOrder n, Support(a*p)))/.i * eval(((SgmX(BagOrder n, Support(a*p)))
  /.i),x) by POLYNOM2:def 4;
A4: BagOrder n linearly_orders Support(a*p) by POLYNOM2:18;
  consider z being FinSequence of the carrier of L such that
A5: len z = len SgmX(BagOrder n, Support p) and
A6: eval(p,x) = Sum z and
A7: for i being Element of NAT st 1 <= i & i <= len z holds z/.i = (p *
  SgmX(BagOrder n, Support p))/.i * eval(((SgmX(BagOrder n, Support p))/.i),x)
  by POLYNOM2:def 4;
  per cases;
  suppose
A8: a = 0.L;
A9: now
      let b be bag of n;
      thus (a*p).b = a * p.b by Def9
        .= 0.L by A8;
    end;
    now
      assume Support(a*p) <> {};
      then reconsider sp = Support(a*p) as non empty Subset of Bags n;
      set c = the Element of sp;
      (a*p).c <> 0.L by POLYNOM1:def 4;
      hence contradiction by A9;
    end;
    then rng(SgmX(BagOrder n, Support(a*p))) = {} by A4,PRE_POLY:def 2;
    then SgmX(BagOrder n, Support(a*p)) = {} by RELAT_1:41;
    then y = <*>(the carrier of L) by A1;
    then Sum y = 0.L by RLVECT_1:43
      .= a * Sum z by A8;
    hence thesis by A2,A6;
  end;
  suppose
A10: a <> 0.L;
A11: for u being object holds u in Support(a*p) implies u in Support p
    proof
      let u be object;
      assume
A12:  u in Support(a*p);
      then reconsider u9 = u as Element of Bags n;
      (a*p).u <> 0.L by A12,POLYNOM1:def 4;
      then a * p.u9 <> 0.L by Def9;
      then p.u9 <> 0.L;
      hence thesis by POLYNOM1:def 4;
    end;
A13: for u being object holds u in Support p implies u in Support(a*p)
    proof
      let u be object;
      assume
A14:  u in Support p;
      then reconsider u9 = u as Element of Bags n;
      p.u <> 0.L by A14,POLYNOM1:def 4;
      then a * p.u9 <> 0.L by A10,VECTSP_2:def 1;
      then (a * p).u9 <> 0.L by Def9;
      hence thesis by POLYNOM1:def 4;
    end;
    then
A15: len z = len y by A1,A5,A11,TARSKI:2;
    then
A16: dom z = Seg(len y) by FINSEQ_1:def 3
      .= dom y by FINSEQ_1:def 3;
A17: Support(a*p) = Support(p) by A13,A11,TARSKI:2;
    now
A18:  dom(a*p) = Bags n by FUNCT_2:def 1;
      now
        let u be object;
        assume u in rng(SgmX(BagOrder n, Support(a*p)));
        then u in Support(a*p) by A4,PRE_POLY:def 2;
        hence u in dom(a*p) by A18;
      end;
      then rng SgmX(BagOrder n, Support(a*p)) c= dom(a*p) by TARSKI:def 3;
      then reconsider
      r = (a*p) * SgmX(BagOrder n, Support(a*p)) as FinSequence by FINSEQ_1:16;
      for u being object holds u in rng r implies u in the carrier of L
      proof
        let u be object;
        assume u in rng r;
        then
A19:    u in rng(a*p) by FUNCT_1:14;
        rng(a*p) c= the carrier of L by RELAT_1:def 19;
        hence thesis by A19;
      end;
      then
A20:  rng r c= the carrier of L by TARSKI:def 3;
A21:  dom p = Bags n by FUNCT_2:def 1;
      now
        let u be object;
        assume u in rng(SgmX(BagOrder n, Support(a*p)));
        then u in Support(a*p) by A4,PRE_POLY:def 2;
        hence u in dom p by A21;
      end;
      then rng SgmX(BagOrder n, Support(a*p)) c= dom p by TARSKI:def 3;
      then reconsider
      q = p * SgmX(BagOrder n, Support(a*p)) as FinSequence by FINSEQ_1:16;
      for u being object holds u in rng q implies u in the carrier of L
      proof
        let u be object;
        assume u in rng q;
        then
A22:    u in rng p by FUNCT_1:14;
        rng p c= the carrier of L by RELAT_1:def 19;
        hence thesis by A22;
      end;
      then
A23:  rng q c= the carrier of L by TARSKI:def 3;
      reconsider r as FinSequence of the carrier of L by A20,FINSEQ_1:def 4;
      reconsider q as FinSequence of the carrier of L by A23,FINSEQ_1:def 4;
      let i be object;
      assume
A24:  i in dom z;
      then i in Seg(len z) by FINSEQ_1:def 3;
      then i in { k where k is Nat : 1 <= k & k <= len z } by FINSEQ_1:def 1;
      then consider k being Nat such that
A25:  i = k and
A26:  1 <= k & k <= len z;
      reconsider k as Element of NAT by ORDINAL1:def 12;
A27:  dom z = Seg(len SgmX(BagOrder n, Support(a*p))) by A1,A16,FINSEQ_1:def 3
        .= dom(SgmX(BagOrder n, Support(a*p))) by FINSEQ_1:def 3;
      then
      (SgmX(BagOrder n, Support(a*p))).k = (SgmX(BagOrder n, Support(a*p)
      ))/.k by A24,A25,PARTFUN1:def 6;
      then k in dom q by A24,A25,A27,A21,FUNCT_1:11;
      then
A28:  (p * SgmX(BagOrder n, Support(a*p)))/.k = q.k by PARTFUN1:def 6
        .= p.(SgmX(BagOrder n, Support(a*p)).k) by A24,A25,A27,FUNCT_1:13
        .= p.(SgmX(BagOrder n, Support(a*p))/.k) by A24,A25,A27,PARTFUN1:def 6;
      reconsider c = SgmX(BagOrder n, Support(a*p))/.k as Element of Bags n;
      reconsider c as bag of n;
A29:  a * z/.k = a * ((p * SgmX(BagOrder n, Support p))/.k * eval(((SgmX(
      BagOrder n, Support p))/.k),x)) by A7,A26
        .= (a * (p * SgmX(BagOrder n, Support(a*p)))/.k) * eval(((SgmX(
      BagOrder n, Support(a*p)))/.k),x) by A17,GROUP_1:def 3;
A30:  (a*p).(SgmX(BagOrder n, Support(a*p))/.k)
        = a * (p * SgmX(BagOrder n, Support(a*p)))/.k by A28,Def9;
      (SgmX(BagOrder n, Support(a*p))).k = (SgmX(BagOrder n, Support(a*p)
      ))/.k by A24,A25,A27,PARTFUN1:def 6;
      then k in dom r by A24,A25,A27,A18,FUNCT_1:11;
      then ((a*p) * SgmX(BagOrder n, Support(a*p)))/.k = r.k by PARTFUN1:def 6
        .= (a*p).(SgmX(BagOrder n, Support(a*p)).k) by A24,A25,A27,FUNCT_1:13
        .= a * (p * SgmX(BagOrder n, Support(a*p)))/.k by A24,A25,A27,A30,
PARTFUN1:def 6;
      hence y/.i = a * z/.i by A3,A15,A25,A26,A29;
    end;
    then y = a * z by A16,POLYNOM1:def 1;
    hence thesis by A2,A6,BINOM:4;
  end;
end;
