
theorem Th21:
for L being Abelian add-associative right_zeroed right_complementable
            well-unital associative distributive commutative
            domRing-like non trivial doubleLoopStr
for z being rational_function of L
ex z1 being rational_function of L,
   z2 being non zero Polynomial of L
st z = [z2 *' z1`1, z2 *' z1`2] & z1 is irreducible &
   ex f being FinSequence of Polynom-Ring(L)
   st z2 = Product f &
      for i being Element of NAT st i in dom f
      ex x being Element of L st x is_a_common_root_of z`1,z`2 &
                                 f.i = rpoly(1,x)
proof
let L be Abelian add-associative right_zeroed right_complementable
         well-unital associative distributive commutative
         domRing-like non trivial doubleLoopStr;
let z be rational_function of L;
defpred P[Nat] means
  for z being rational_function of L st max(deg(z`1),deg(z`2)) = $1
  ex z1 being rational_function of L,
     z2 being non zero Polynomial of L
  st z = [z2*'z1`1,z2*'z1`2] & z1 is irreducible &
     ex f being FinSequence of Polynom-Ring(L)
     st z2 = Product f &
        for i being Element of NAT st i in dom f
        ex x being Element of L st x is_a_common_root_of z`1,z`2 &
                                   f.i = rpoly(1,x);

now let z be rational_function of L;
  assume max(deg(z`1),deg(z`2)) = 0;
  then deg(z`2) <= 0 by XXREAL_0:25;
  then A1: deg(z`2) = 0;
  A2:now assume ex x be Element of L st x is_a_root_of z`2;
    then consider y being Element of L such that
    A3: y is_a_root_of z`2;
    eval(z`2,y) = 0.L by A3,POLYNOM5:def 7;
    hence contradiction by A1,Th8;
    end;
  now assume z is reducible;
    then z`1,z`2 have_common_roots;
    then consider x being Element of L such that
    A4: x is_a_common_root_of z`1,z`2;
    x is_a_root_of z`2 by A4;
    hence contradiction by A2;
    end;
  hence
  ex z1 being rational_function of L,
     z2 being non zero Polynomial of L
  st z = [z2*'z1`1,z2*'z1`2] & z1 is irreducible &
     ex f being FinSequence of Polynom-Ring(L)
     st z2 = Product f &
        for i being Element of NAT st i in dom f
        ex x being Element of L st x is_a_common_root_of z`1,z`2 &
                                   f.i = rpoly(1,x) by Lm1;
  end;
then A5: P[0];

A6: now let n be Nat;
  assume A7: P[n];
  for z being rational_function of L st max(deg(z`1),deg(z`2)) = n+1
  ex z1 being rational_function of L,
     z2 being non zero Polynomial of L
  st z = [z2*'z1`1,z2*'z1`2] & z1 is irreducible &
     ex f being FinSequence of Polynom-Ring(L)
     st z2 = Product f &
        for i being Element of NAT st i in dom f
        ex x being Element of L st x is_a_common_root_of z`1,z`2 &
                                   f.i = rpoly(1,x)
  proof
  let z being rational_function of L;
  assume A8: max(deg(z`1),deg(z`2)) = n+1;
  per cases;
  suppose z is irreducible;
    hence thesis by Lm1;
    end;
  suppose z is reducible;
    then z`1,z`2 have_common_roots;
    then consider x being Element of L such that
    A9: x is_a_common_root_of z`1,z`2;
    A10: x is_a_root_of z`1 & x is_a_root_of z`2 by A9;
    consider q2 being Polynomial of L such that
    A11: z`2 = rpoly(1,x) *' q2 by A10,HURWITZ:33;
    consider q1 being Polynomial of L such that
    A12: z`1 = rpoly(1,x) *' q1 by A10,HURWITZ:33;
    q2 <> 0_.(L) by A11,POLYNOM3:34;
    then reconsider q2 as non zero Polynomial of L by UPROOTS:def 5;
    set q = [q1,q2];
    max(deg(q`1),deg(q`2)) = n
      proof
      A13: deg(z`2) = deg(rpoly(1,x)) + deg(q2) by A11,HURWITZ:23
                   .= 1 + deg(q2) by HURWITZ:27;
      per cases by XXREAL_0:16;
      suppose A14: max(deg(z`1),deg(z`2)) = deg(z`1);
        then z`1 <> 0_.(L) by A8,HURWITZ:20;
        then q1 <> 0_.(L) by A12,POLYNOM3:34; then
        A15: deg(z`1) = deg(rpoly(1,x)) + deg(q1) by A12,HURWITZ:23
                    .= 1 + deg(q1) by HURWITZ:27;
        A16: deg(z`2) <= n + 1 by A8,XXREAL_0:25;
        deg q2 + 1 - 1 <= n + 1 - 1 by A13,A16,XREAL_1:9;
        hence thesis by A15,A14,A8,XXREAL_0:def 10;
        end;
      suppose A17: max(deg(z`1),deg(z`2)) = deg(z`2);
        A18: deg(z`1) <= n + 1 by A8,XXREAL_0:25;
        now per cases;
        suppose q1 = 0_.(L);
          hence deg q1 <= deg q2 by HURWITZ:20;
          end;
        suppose q1 <> 0_.(L); then
          deg(z`1) = deg(rpoly(1,x)) + deg(q1) by A12,HURWITZ:23
                  .= 1 + deg(q1) by HURWITZ:27;
          hence deg q1 <= deg q2 by A18,A13,A17,A8,XREAL_1:9;
          end;
        end;
        hence thesis by A17,A13,A8,XXREAL_0:def 10;
        end;
      end;
    then consider z1q being rational_function of L,
                  z2q being non zero Polynomial of L such that
    A19: q = [z2q*'z1q`1,z2q*'z1q`2] & z1q is irreducible &
        ex f being FinSequence of Polynom-Ring(L)
        st z2q = Product f &
        for i being Element of NAT st i in dom f
        ex x being Element of L st x is_a_common_root_of q`1,q`2 &
                                   f.i = rpoly(1,x) by A7;
    take z1 = z1q;
    set z2 = rpoly(1,x) *' z2q;
    reconsider z2 as non zero Polynomial of L;
    take z2;
    consider fq being FinSequence of Polynom-Ring(L) such that
    A20: z2q = Product fq &
         for i being Element of NAT st i in dom fq
         ex x being Element of L st x is_a_common_root_of q`1,q`2 &
                                    fq.i = rpoly(1,x) by A19;
    reconsider rp = rpoly(1,x) as Element of Polynom-Ring(L)
       by POLYNOM3:def 10;
    set f = <*rp*> ^ fq;
    A21: Product f = rp * Product(fq) by GROUP_4:7
                  .= z2 by A20,POLYNOM3:def 10;
    A22: z = [z2*'z1`1,z2*'z1`2]
         proof
         A23: q1 = z2q*' z1q`1 by A19,XTUPLE_0:def 2;
         A24: q2 = z2q*' z1q`2 by A19,XTUPLE_0:def 3;
         A25: (z2 *' z1`1) = z`1 by A23,A12,POLYNOM3:33;
         A26: (z2 *' z1`2) = z`2 by A24,A11,POLYNOM3:33;
         thus z = [z2*'z1`1,z2*'z1`2] by A25,A26,Th19;
         end;
    A27: now let i be Element of NAT;
         assume A28: i in dom f;
         now per cases by A28,FINSEQ_1:25;
         suppose A29: i in dom<*rp*>;
           then A30: i in {1} by FINSEQ_1:2,38;
           f.i = <*rp*>.i by A29,FINSEQ_1:def 7
              .= <*rp*>.1 by A30,TARSKI:def 1
              .= rpoly(1,x);
           hence ex x being Element of L st x is_a_common_root_of z`1,z`2 &
                                            f.i = rpoly(1,x) by A9;
           end;
         suppose ex n being Nat st n in dom fq & i = len<*rp*> + n;
           then consider n being Nat such that
           A31: n in dom fq & i = len<*rp*> + n;
           f.i = fq.n by A31,FINSEQ_1:def 7;
           then consider y being Element of L such that
           A32: y is_a_common_root_of q`1,q`2 & f.i = rpoly(1,y) by A31,A20;
           A33: y is_a_root_of q`1 & y is_a_root_of q`2 by A32;
           then A34: 0.L = eval(q1,y) by POLYNOM5:def 7;
           A35: eval(z`1,y) = eval(rpoly(1,x),y) * eval(q1,y) by A12
,POLYNOM4:24
                          .= 0.L by A34;
           A36: 0.L = eval(q2,y) by A33,POLYNOM5:def 7;
           eval(z`2,y) = eval(rpoly(1,x),y) * eval(q2,y) by A11,POLYNOM4:24
                      .= 0.L by A36;
           then y is_a_root_of z`1 & y is_a_root_of z`2 by A35,POLYNOM5:def 7;
           then y is_a_common_root_of z`1,z`2;
           hence ex x being Element of L st x is_a_common_root_of z`1,z`2 &
                                            f.i = rpoly(1,x) by A32;
           end;
         end;
         hence ex x being Element of L st x is_a_common_root_of z`1,z`2 &
                                          f.i = rpoly(1,x);
         end;
    thus thesis by A19,A21,A22,A27;
    end;
  end;
  hence P[n+1];
  end;
A37: for n being Nat holds P[n] from NAT_1:sch 2(A5,A6);
max(deg(z`1),deg(z`2)) >= deg(z`2) by XXREAL_0:25;
then max(deg(z`1),deg(z`2)) >= 0;
then max(deg(z`1),deg(z`2)) in NAT by INT_1:3;
hence thesis by A37;
end;
