
theorem Th16:
  for L be add-associative right_zeroed right_complementable non
empty addLoopStr for p be Polynomial of L st len p <> 0 ex q be Polynomial of
L st len q < len p & p = q+Leading-Monomial(p) & for n be Element of NAT st n <
  len p-1 holds q.n = p.n
proof
  let L be add-associative right_zeroed right_complementable non empty
  addLoopStr;
  let p be Polynomial of L;
  deffunc F(Element of NAT) = p.$1;
  consider q be Polynomial of L such that
A1: len q <= len p-'1 and
A2: for n be Element of NAT st n < len p-'1 holds q.n=F(n) from POLYNOM3
  :sch 2;
  assume len p <> 0;
  then
A3: len p >= 0+1 by NAT_1:13;
  take q;
  len q < len p-'1+1 by A1,NAT_1:13;
  hence
A4: len q < len p by A3,XREAL_1:235;
A5: now
    let k be Nat;
A6: k in NAT by ORDINAL1:def 12;
    assume k < len p;
    then k+1 <= len p by NAT_1:13;
    then
A7: k+1-1 <= len p-1 by XREAL_1:9;
    per cases by A7,XXREAL_0:1;
    suppose
      k < len p-1;
      then
A8:   k < len p-'1 by XREAL_0:def 2;
      thus (q+Leading-Monomial(p)).k = q.k + (Leading-Monomial(p)).k by
NORMSP_1:def 2
        .= p.k + (Leading-Monomial(p)).k by A2,A6,A8
        .= p.k + 0.L by A6,A8,Def1
        .= p.k by RLVECT_1:def 4;
    end;
    suppose
      k = len p-1;
      then
A9:   k = len p-'1 by XREAL_0:def 2;
      thus (q+Leading-Monomial(p)).k = q.k + (Leading-Monomial(p)).k by
NORMSP_1:def 2
        .= 0.L + (Leading-Monomial(p)).k by A1,A9,ALGSEQ_1:8
        .= (Leading-Monomial(p)).k by RLVECT_1:4
        .= p.k by A9,Def1;
    end;
  end;
A10: len Leading-Monomial(p) = len p by Th15;
  then
  len (q+Leading-Monomial(p)) = max(len q,len Leading-Monomial(p)) by A4,Th7
    .= len p by A4,A10,XXREAL_0:def 10;
  hence p = q+Leading-Monomial(p) by A5,ALGSEQ_1:12;
  let n be Element of NAT;
  assume n < len p-1;
  then n < len p-'1 by XREAL_0:def 2;
  hence thesis by A2;
end;
