
theorem lemppoly:
for R being domRing,
    F being non empty FinSequence of Polynom-Ring R,
    p being Polynomial of R
st p = Product F &
   (for i being Nat st i in dom F ex a being Element of R st F.i = rpoly(1,a))
holds deg p = len F
proof
let R be domRing, F be non empty FinSequence of Polynom-Ring R,
    p be Polynomial of R;
assume AS: p = Product F &
   (for i being Nat st i in dom F ex a being Element of R st F.i = rpoly(1,a));
defpred P[Nat] means
  for F being non empty FinSequence of Polynom-Ring R
  for p being Polynomial of R st len F = $1 & p = Product F &
   (for i being Nat st i in dom F ex a being Element of R st F.i = rpoly(1,a))
  holds deg p = len F;
IA: P[0];
IS: now let k be Nat;
    assume IV: P[k];
    per cases;
    suppose S: k = 0;
      now let F be non empty FinSequence of Polynom-Ring R,
              p being Polynomial of R;
      assume A: len F = 1 & p = Product F &
                (for i being Nat st i in dom F
                            ex a being Element of R st F.i = rpoly(1,a));
      then 1 in Seg(len F);
      then 1 in dom F by FINSEQ_1:def 3;
      then consider a being Element of R such that A0: F.1 = rpoly(1,a) by A;
      reconsider q = rpoly(1,a) as Element of Polynom-Ring R
          by POLYNOM3:def 10;
      F = <*q*> by A0,A,FINSEQ_1:40;
      then q = p by A,GROUP_4:9;
      hence deg p = 1 by HURWITZ:27;
      end;
      hence P[k+1] by S;
      end;
    suppose S: k > 0;
      now let F be non empty FinSequence of Polynom-Ring R,
              p being Polynomial of R;
      assume A: len F = k + 1 & p = Product F &
                (for i being Nat st i in dom F
                            ex a being Element of R st F.i = rpoly(1,a));
      consider G being FinSequence, y being object such that
      B2: F = G^<*y*> by FINSEQ_1:46;
      B2a: rng G c= rng F by B2,FINSEQ_1:29;
      B2b: rng F c= the carrier of Polynom-Ring R by FINSEQ_1:def 4;
      then reconsider G as FinSequence of Polynom-Ring R
                                    by B2a,XBOOLE_1:1,FINSEQ_1:def 4;
      reconsider q = Product G as Polynomial of R by POLYNOM3:def 10;
      B3: len F = len G + len<*y*> by B2,FINSEQ_1:22
               .= len G + 1 by FINSEQ_1:39; then
      reconsider G as non empty FinSequence of Polynom-Ring R by S,A;
      C: dom G c= dom F by B2,FINSEQ_1:26;
      now let i be Nat;
        assume C0: i in dom G;
        then G.i = F.i by B2,FINSEQ_1:def 7;
        hence ex a being Element of R st G.i = rpoly(1,a) by C,C0,A;
        end;
      then F: deg q = k by IV,B3,A;
      rng<*y*> = {y} by FINSEQ_1:39;
      then G5: y in rng<*y*> by TARSKI:def 1;
      rng<*y*> c= rng F by B2,FINSEQ_1:30;
      then reconsider y as Element of Polynom-Ring R by G5,B2b;
      dom<*y*> = {1} by FINSEQ_1:2,FINSEQ_1:def 8;
      then 1 in dom<*y*> by TARSKI:def 1;
      then B6: F.(k+1) = <*y*>.1 by B2,B3,A,FINSEQ_1:def 7
                      .= y;
      dom F = Seg(k+1) by A,FINSEQ_1:def 3;
      then consider a being Element of R such that
      B9: y = rpoly(1,a) by A,B6,FINSEQ_1:4;
      B10: p = (Product G) * y by A,B2,GROUP_4:6
            .= q *' rpoly(1,a) by B9,POLYNOM3:def 10;
      q <> 0_.(R) & rpoly(1,a) <> 0_.(R) by F,HURWITZ:20;
      hence deg p = deg q + deg rpoly(1,a) by B10,HURWITZ:23
                 .= k + 1 by F,HURWITZ:27;
      end;
      hence P[k+1];
      end;
    end;
I: for k being Nat holds P[k] from NAT_1:sch 2(IA,IS);
thus thesis by I,AS;
end;
