reserve n for Nat;

theorem
for R being domRing,
    p being non zero Polynomial of R holds card(BRoots p) <= deg p
proof
let R be domRing, p be non zero Polynomial of R;
defpred P[Nat] means
  for p being non zero Polynomial of R st deg p = $1
  holds card(BRoots p) <= deg p;
IA: P[0]
    proof
    let p be non zero Polynomial of R;
    assume A1: deg p = 0;
    reconsider q = p as Element of the carrier of Polynom-Ring R
      by POLYNOM3:def 10;
    consider a being Element of R such that
    A2: q = a|R by A1,RING_4:def 4,RING_4:20;
    a <> 0.R by A2;
    then reconsider a as non zero Element of R by STRUCT_0:def 12;
    q = a|R by A2;
    hence card(BRoots p) <= deg p by bag1;
    end;
IS: now let k be Nat;
    assume IV: P[k];
    now let p be non zero Polynomial of R;
    assume A1: deg p = k+1;
    per cases;
    suppose ex x being Element of R st x is_a_root_of p;
      then consider x being Element of R such that A2: x is_a_root_of p;
      consider q being Polynomial of R such that
      A3: p = rpoly(1,x) *' q by A2,HURWITZ:33;
      A4: q <> 0_.(R) by A3;
      reconsider q as non zero Polynomial of R by A3;
      BRoots(p) = BRoots(rpoly(1,x)) + BRoots(q) by A3,UPROOTS:56;
      then A6: card BRoots(p)
         = card(BRoots(rpoly(1,x))) + card BRoots(q) by UPROOTS:15
        .= 1 + card BRoots(q) by bag2;
      deg p = deg q + deg rpoly(1,x) by HURWITZ:23,A3,A4
           .= deg q + 1 by HURWITZ:27;
      hence card(BRoots p) <= deg p by IV,A1,A6,XREAL_1:6;
      end;
    suppose A2: not ex x being Element of R st x is_a_root_of p;
      now assume A3: Roots(p) <> {};
        let x be Element of Roots(p);
        x in Roots(p) by A3; then
        reconsider x as Element of R;
        x is_a_root_of p by A3,POLYNOM5:def 10;
        hence contradiction by A2;
        end;
      then support(BRoots p) = {} by UPROOTS:def 9;
      hence card(BRoots p) <= deg p by bag1a;
      end;
    end;
    hence P[k+1];
    end;
I: for k being Nat holds P[k] from NAT_1:sch 2(IA,IS);
p <> 0_.(R);
then deg p is Element of NAT by T8;
hence thesis by I;
end;
