
theorem lem:   :: Ext_eval(Sum p_i,a) = Sum Ext_eval(p_i,a)
for F being Field,
    E being FieldExtension of F
for f being FinSequence of the carrier of Polynom-Ring F
for p being Polynomial of F st p = Sum f
for a being Element of E,
    g being FinSequence of E
st len g = len f &
   for i being Element of dom f, q being Polynomial of F
   st q = f.i holds g.i = Ext_eval(q,a)
holds Ext_eval(p,a) = Sum g
proof
let F be Field, E be FieldExtension of F;
let f be FinSequence of the carrier of Polynom-Ring F;
let p be Polynomial of F;
assume AS1: p = Sum f;
let a be Element of E, g be FinSequence of E;
assume AS2: len g = len f &
   for i being Element of dom f, q being Polynomial of F
   st q = f.i holds g.i = Ext_eval(q,a);
defpred P[Nat] means
  for f being FinSequence of the carrier of Polynom-Ring F
  for p being Polynomial of F st p = Sum f & len f = $1
  for a being Element of E, g being FinSequence of E
  st len g = len f &
     for i being Element of dom f, q being Polynomial of F
     st q = f.i holds g.i = Ext_eval(q,a)
     holds Ext_eval(p,a) = Sum g;
I0: P[0]
    proof
    now let f be FinSequence of the carrier of Polynom-Ring F;
      let p being Polynomial of F;
      assume A1: p = Sum f & len f = 0;
      let a be Element of E, g be FinSequence of E;
      assume A2: len g = len f &
        for i being Element of dom f, q being Polynomial of F
        st q = f.i holds g.i = Ext_eval(q,a);
      A3: f = <*>(the carrier of Polynom-Ring F) &
          g = <*>(the carrier of E) by A1,A2; then
      Sum f = 0.(Polynom-Ring F) by RLVECT_1:43;
      hence Ext_eval(p,a) = Ext_eval(0_.(F),a) by A1,POLYNOM3:def 10
                         .= 0.E by ALGNUM_1:13
                         .= Sum g by A3,RLVECT_1:43;
      end;
    hence thesis;
    end;
I1: P[1]
    proof
    now let f be FinSequence of the carrier of Polynom-Ring F;
      let p being Polynomial of F;
      assume A1: p = Sum f & len f = 1;
      let a be Element of E, g be FinSequence of E;
      assume A2: len g = len f &
        for i being Element of dom f, q being Polynomial of F
        st q = f.i holds g.i = Ext_eval(q,a); then
      A3: f = <*f.1*> & g = <*g.1*> by A1,FINSEQ_1:40; then
          dom f = { 1 } & dom g = { 1 } by FINSEQ_1:38,FINSEQ_1:2; then
      A4: 1 in dom f & 1 in dom g by TARSKI:def 1; then
          f.1 in rng f & rng f c= the carrier of Polynom-Ring F
          by FUNCT_1:3; then
      g.1 = Ext_eval(p,a) by A4,A2,A1,A3,RLVECT_1:44;
      hence Sum g = Ext_eval(p,a) by A3,RLVECT_1:44;
      end;
    hence thesis;
    end;
I2: now let k be Nat;
    assume IV: P[k];
    now let f be FinSequence of the carrier of Polynom-Ring F;
      let p being Polynomial of F;
      assume AS1: p = Sum f & len f = k + 1;
      let a be Element of E, g be FinSequence of E;
      assume AS2: len g = len f &
        for i being Element of dom f, q being Polynomial of F
        st q = f.i holds g.i = Ext_eval(q,a);
      f <> {} by AS1; then
      consider G1 being FinSequence, y being object such that
      A1: f = G1^<*y*> by FINSEQ_1:46;
      rng G1 c= rng f by A1,FINSEQ_1:29; then
      reconsider G1 as FinSequence of the carrier of Polynom-Ring F
           by XBOOLE_1:1,FINSEQ_1:def 4;
      A2: rng f c= the carrier of Polynom-Ring F;
      A3: rng<*y*> c= rng f by A1,FINSEQ_1:30;
      rng<*y*> = {y} & y in {y} by FINSEQ_1:38,TARSKI:def 1; then
      reconsider y as Element of the carrier of Polynom-Ring F by A2,A3;
      A4: len f = len G1 + len<*y*> by A1,FINSEQ_1:22
               .= len G1 + 1 by FINSEQ_1:39;
      g <> {} by AS1,AS2; then
      consider G2 being FinSequence, z being object such that
      A5: g = G2^<*z*> by FINSEQ_1:46;
      rng G2 c= rng g by A5,FINSEQ_1:29; then
      reconsider G2 as FinSequence of the carrier of E
           by XBOOLE_1:1,FINSEQ_1:def 4;
      A6: rng g c= the carrier of E;
      A7: rng<*z*> c= rng g by A5,FINSEQ_1:30;
      rng<*z*> = {z} & z in {z} by FINSEQ_1:38,TARSKI:def 1; then
      reconsider z as Element of the carrier of E by A6,A7;
      A8: len f = len G2 + len<*z*> by AS2,A5,FINSEQ_1:22
               .= len G2 + 1 by FINSEQ_1:39;
      per cases;
      suppose G1 is non empty; then
        reconsider G1 as non empty
                         FinSequence of the carrier of Polynom-Ring F;
        reconsider p1 = Sum G1, p2 = y as Polynomial of F
                                                   by POLYNOM3:def 10;
        B0: p1 + p2 = (Sum G1) + y by POLYNOM3:def 10
                   .= Sum G1 + Sum <*y*> by RLVECT_1:44
                   .= p by AS1,A1,RLVECT_1:41;
        now let i be Element of dom G1, q being Polynomial of F;
            assume C0: q = G1.i;
            dom G1 c= dom f by A1,FINSEQ_1:26; then
            q = f.i & i in dom f by C0,A1,FINSEQ_1:def 7; then
            C1: g.i = Ext_eval(q,a) by AS2;
            dom G1 = Seg(len G2) by A8,A4,FINSEQ_1:def 3
                  .= dom G2 by FINSEQ_1:def 3;
            hence G2.i = Ext_eval(q,a) by A5,C1,FINSEQ_1:def 7;
            end; then
        B1: Ext_eval(p1,a) = Sum G2 by A8,AS1,A4,IV;
        B2: Ext_eval(p2,a) = Sum <*z*>
            proof
            dom <*y*> = Seg 1 & dom <*z*> = Seg 1 by FINSEQ_1:38; then
            B3: 1 in dom <*y*> & 1 in dom <*z*> by FINSEQ_1:3; then
            B4: f.(len G1 + 1) = <*y*>.1 by A1,FINSEQ_1:def 7
                              .= p2;
            dom f = Seg(len G1 + 1) by A4,FINSEQ_1:def 3; then
            len G1 + 1 in dom f by FINSEQ_1:3;
            hence Ext_eval(p2,a) = g.(len G1 + 1) by B4,AS2
                          .= <*z*>.1 by A5,A8,A4,B3,FINSEQ_1:def 7
                          .= z
                          .= Sum <*z*> by RLVECT_1:44;
            end;
        H: F is Subring of E by FIELD_4:def 1;
        thus Sum g = Sum G2 + Sum <*z*> by A5,RLVECT_1:41
                  .= Ext_eval(p,a) by H,B0,B1,B2,ALGNUM_1:15;
        end;
      suppose G1 is empty;
        then len f = 0 + 1 by A4;
        hence Ext_eval(p,a) = Sum g by AS1,AS2,I1;
        end;
      end;
    hence P[k+1];
    end;
for k being Nat holds P[k] from NAT_1:sch 2(I0,I2);
hence thesis by AS1,AS2;
end;
