
theorem Th18:
  for L be right_zeroed add-associative right_complementable
  well-unital distributive non empty doubleLoopStr, n be Element of NAT, a be
  Element of L holds (a <> 0.L implies len monomial(a,n) = n+1) & (a = 0.L
  implies len monomial(a,n) = 0) & len monomial (a,n) <= n+1
proof
  let L be right_zeroed add-associative right_complementable well-unital
distributive non empty doubleLoopStr, n be Element of NAT, a be Element of L;
A1: now
    assume
A2: a = 0.L;
    now
      let i be Nat;
      assume i >= 0;
      per cases;
      suppose
        i = n;
        thus monomial(a,n).i = 0.L by A2,Def5;
      end;
      suppose
        i<>n;
        hence monomial(a,n).i = 0.L by Def5;
      end;
    end;
    then 0 is_at_least_length_of monomial(a,n) by ALGSEQ_1:def 2;
    hence len monomial(a,n) = 0 by ALGSEQ_1:def 3;
  end;
  now
    now
      let i be Nat;
      assume i >= n+1;
      then i > n by NAT_1:13;
      hence monomial(a,n).i = 0.L by Def5;
    end;
    then n+1 is_at_least_length_of monomial(a,n) by ALGSEQ_1:def 2;
    then
A3: len monomial(a,n) <= n+1 by ALGSEQ_1:def 3;
    assume a <> 0.L;
    then monomial(a,n).n <> 0.L by Def5;
    then len monomial(a,n) > n by ALGSEQ_1:8;
    then len monomial(a,n) >= n+1 by NAT_1:13;
    hence len monomial(a,n) = n+1 by A3,XXREAL_0:1;
  end;
  hence thesis by A1;
end;
