reserve k,m,n for Nat;
reserve R for commutative Ring,
        p,q for Polynomial of R,
        z0,z1 for Element of R;

theorem Th20:
  for L being non empty ZeroStr
    for p being Polynomial of L st len even_part p is odd holds
      2 * len sieve(p,2) = len even_part p+1
  proof
    let L be non empty ZeroStr, p be Polynomial of L;
    set E=even_part p,CE=sieve (E,2);
    assume len E is odd;
    then consider n such that
    A1: len E=2*n+1 by ABIAN:9;
    A2:len E is_at_least_length_of E by ALGSEQ_1:def 3;
    set n1=n+1;
    A3: n1 is_at_least_length_of CE
    proof
      let k such that A4: k >= n1;
      k+k >= n1+n1 & n1+n1 = len E+1 by A1,A4,XREAL_1:7;
      then k+k > len E by NAT_1:13;
      hence 0.L = E.(2*k) by A2,ALGSEQ_1:def 2
      .= CE.k by Def5;
    end;
    for m be Nat st m is_at_least_length_of CE holds n1 <= m
    proof
      let m be Nat such that
      A5:m is_at_least_length_of CE;
      m>0
      proof
        assume A6:m <=0;
        2*n is_at_least_length_of E
        proof
          let k such that A7: k >= 2*n;
          per cases by A7,XXREAL_0:1;
          suppose k > 2*n;
            then k >=2*n+1 by NAT_1:13;
            hence thesis by A1,A2,ALGSEQ_1:def 2;
          end;
          suppose k=2*n;
            hence  E.k=CE.n by Def5
            .= 0.L by A5,A6,ALGSEQ_1:def 2;
          end;
        end;
        then 2*n+1 <= 2*n by A1,ALGSEQ_1:def 3;
        hence thesis by NAT_1:13;
      end;
      then reconsider mm=m-1 as Nat;
      m+mm is_at_least_length_of E
      proof
        let k such that A8: k >=m+mm;
        assume A9: E.k <>0.L;
        then A10: k is even by HURWITZ2:def 1;
        then consider i be Nat such that
        A11:k=2*i by ABIAN:def 2;
        m+mm=2*m-1;then
        k > m+mm by A10,A8,XXREAL_0:1;
        then k >= m+mm+1 by NAT_1:13;
        then 2*i >= 2*m by A11;
        then i>=m by XREAL_1:68;
        then CE.i =0.L by A5,ALGSEQ_1:def 2;
        hence thesis by A9,Def5,A11;
      end;
      then len E <= m+mm by ALGSEQ_1:def 3;
      then 2*n+1+1 <= 2*m-1+1 by A1,XREAL_1:7;
      then 2*n1 <= 2*m;
      hence n1 <=m by XREAL_1:68;
    end;
    then A12:len CE = n1 by A3,ALGSEQ_1:def 3;
    CE = sieve (p,2*1) by Th19;
    hence thesis by A1,A12;
  end;
