reserve i,j,n,n1,n2,m,k,l,u for Nat,
        i1,i2,i3,i4,i5,i6 for Element of n,
        p,q for n-element XFinSequence of NAT,
        a,b,c,d,e,f for Integer;

theorem Th10:
  for n being Ordinal,p being Polynomial of n, F_Real,
      r being Real st r >= 1
    for x being Function of n, the carrier of F_Real st
           for i being object st i in dom x holds |. x.i .| <= r
    holds
      |. eval(p,x).| <= (sum_of_coefficients |.p.|) * (r|^ degree p)
proof
  let n be Ordinal,p be Polynomial of n, F_Real,r be Real such that
A1: r >= 1;
  let x be Function of n, the carrier of F_Real such that
A2: for i be object st i in dom x holds |. x.i .| <= r;
  reconsider FR=F_Real as Field;
  reconsider pF=p,ApF = |.p.| as Polynomial of n, FR;
  reconsider xF=x as Function of n, the carrier of FR;
  set sgm=SgmX(BagOrder n,Support p);
  set SgmF=SgmX(BagOrder n,Support pF);
  reconsider H = ApF*SgmF as FinSequence of the carrier of F_Real;
A3: sum_of_coefficients |.p.| = Sum (ApF * SgmF) by Th3;
  consider y be FinSequence of the carrier of FR such that
A4:  len y = len SgmF & eval(p,x) = Sum y and
A5:  for i be Element of NAT st 1 <= i & i <= len y holds
    y/.i = (pF*SgmF)/.i * eval((SgmF/.i),xF) by POLYNOM2:def 4;
  reconsider Y=y as FinSequence of REAL;
  defpred P[Nat] means
    $1 <= len y implies |. Sum (Y|$1) .| <= Sum (H|$1)  * (r|^ degree p);
A6: P[0];
A7: len (ApF*SgmF) = len SgmF by CARD_1:def 7;
A8: for i be Nat st P[i] holds P[i+1]
    proof
A9:   BagOrder n linearly_orders Support p by POLYNOM2:18;
A10:  rng sgm = Support p by A9,PRE_POLY:def 2;
A11:  len (p*sgm) = len sgm by CARD_1:def 7;
      let i be Nat;
      assume
A12:    P[i];set i1=i+1;
      assume
A13:    i1 <= len y;
      then i1 in dom y by NAT_1:11,FINSEQ_3:25;
      then
A14:    y|i1 = (y|i)^<*y.i1*> & y.i1 = y/.i1 & Y.i1 = Y/.i1
        by FINSEQ_5:10,PARTFUN1:def 6;
A15:  Sum (y|i) = Sum (Y|i) by MATRPROB:36;
A16:  Sum (Y|i1)= Sum (y|i1) by MATRPROB:36
        .= Sum (y|i) + Sum <*y/.i1*> by A14,RLVECT_1:41
        .= (addreal).(Sum (y|i),y/.i1)by RLVECT_1:44
        .= Sum (Y|i) + (Y/.i1) by A15,BINOP_2:def 9;
      i1 in dom (ApF*SgmF) by A4,A13,A7,NAT_1:11,FINSEQ_3:25;
      then
A17:    H|i1 = (H|i)^<*H.i1*> & H/.i1 = H.i1 & (ApF*SgmF)/.i1 = (ApF*SgmF).i1 &
        (ApF*SgmF).i1=ApF .(SgmF.i1) by FINSEQ_5:10,PARTFUN1:def 6,FUNCT_1:12;
A18:  Sum (H|i1) = Sum ((ApF*SgmF)|i1) by MATRPROB:36
        .= Sum ((ApF*SgmF)|i) + Sum <*(ApF*SgmF)/.i1*> by A17, RLVECT_1:41
        .= (the addF of FR).(Sum ((ApF*SgmF)|i),(ApF*SgmF)/.i1) by RLVECT_1:44
        .= (addreal).(Sum (H|i),H/.i1) by MATRPROB:36
        .= Sum (H|i) + H/.i1 by BINOP_2:def 9;
A19:  |. (p * sgm)/.i1 .|>=0 & |. eval((sgm/.i1),x).|>=0 by COMPLEX1:46;
A20:  (pF*SgmF)/.i1 * eval((SgmF/.i1),xF)
        = (p * sgm)/.i1 * eval((sgm/.i1),x) by BINOP_2:def 11;
      i1 in dom (p*sgm) by A4,A13,A11,NAT_1:11,FINSEQ_3:25;
      then
A21:   (p*sgm).i1 = (p*sgm)/.i1 & (p*sgm).i1 = p.(sgm.i1) & i1 in dom sgm
        by PARTFUN1:def 6,FUNCT_1:11,12;
      then
A22:    sgm.i1 in rng sgm & sgm.i1 = sgm/.i1 by FUNCT_1:def 3,PARTFUN1:def 6;
A23:  H/.i1 = (|.p.|).(sgm/.i1) by A17,A21,PARTFUN1:def 6
        .= |. p.(sgm/.i1) .| by Def1;
A24:  |. (p * sgm)/.i1 .| <= (H/.i1) by PARTFUN1:def 6,A21,A23;
A25:  r|^ degree (sgm/.i1) <= r|^ degree p by A1,PREPOWER:93,Th6,A22,A10;
      |. eval((sgm/.i1),x).| <= r|^ (degree (sgm/.i1)) by A1,A2,Th9;
      then |. eval((sgm/.i1),x).| <= r|^ degree p by A25,XXREAL_0:2;
      then |. (p * sgm)/.i1.| *|.eval((sgm/.i1),x).|<= (H/.i1)* (r|^ degree p)
        by A24,A19,XREAL_1:66;
      then
A26:    |. (p * sgm)/.i1 * eval((sgm/.i1),x).| <= (H/.i1)* (r|^ degree p)
        by COMPLEX1:65;
A27:  |. Y/.i1.| <= (H/.i1) * (r|^ degree p) by A20,A26,A5,A13,NAT_1:11;
A28:  |. Sum (Y|i).| + |.(Y/.i1).| >= |. Sum (Y|i) + (Y/.i1).| by COMPLEX1:56;
      |. Sum (Y|i).| + |.(Y/.i1).| <=
      Sum (H|i)* (r|^ degree p) + (H/.i1) * (r|^ degree p)
        by A27,XREAL_1:7,A13,A12,NAT_1:13;
      hence thesis by A16,A18,A28,XXREAL_0:2;
    end;
 A29:eval(p,x) = Sum (Y|len y) by A4,MATRPROB:36;
 A30:Sum (H|len H) = sum_of_coefficients |.p.| by A3,MATRPROB:36;
    for i be Nat holds P[i] from NAT_1:sch 2(A6,A8);
    hence thesis by A30,A7,A4,A29;
end;
