
theorem lembascard:
for F being Field,
    E being FieldExtension of F
for a being F-algebraic Element of E holds card(Base a) = deg MinPoly(a,F)
proof
let F be Field, E be FieldExtension of F;
let a be F-algebraic Element of E;
set ma = MinPoly(a,F), m = deg MinPoly(a,F);
defpred P[object,object] means
  ex x being Element of Seg m,
     y being Element of NAT st $1 = x & y = x-1 & $2 = a|^y;
B1: for x,y1,y2 being object st x in Seg m & P[x,y1] & P[x,y2] holds y1 = y2;
B2: now let x be object;
    assume B3: x in Seg m;
    then reconsider n = x as Element of Seg m;
    1 <= n by B3,FINSEQ_1:1; then
    reconsider z = n - 1 as Element of NAT by INT_1:3;
    thus ex y being object st P[x,y]
      proof
      take a|^z;
      thus thesis;
      end;
    end;
consider f being Function such that
C: dom f = Seg m &
   for x being object st x in Seg m holds P[x,f.x] from FUNCT_1:sch 2(B1,B2);
A1: now let o be object;
    assume o in Base a;
    then consider n being Element of NAT such that
    A2: o = a|^n & n < m;
    A3: 0 + 1 <= n + 1 & n + 1 <= m by A2,INT_1:7; then
    reconsider x = n + 1 as Element of Seg m by FINSEQ_1:1;
    A4: x in Seg m by FINSEQ_1:1,A3;
    P[x,f.x] by C,FINSEQ_1:1,A3;
    hence o in rng f by A4,C,A2,FUNCT_1:def 3;
    end;
now let o be object;
    assume o in rng f;
    then consider u being object such that
    A2: u in dom f & o = f.u by FUNCT_1:def 3;
    P[u,f.u] by C,A2; then
    consider x being Element of Seg m, y being Element of NAT such that
    A3: u = x & y = x-1 & f.x = a|^y;
    not(deg ma <= 0) by RING_4:def 4; then
    m in Seg m by FINSEQ_1:3; then
    1 <= x & x <= m by FINSEQ_1:1; then
    y < m - 1 + 1 by A3,XREAL_1:9,NAT_1:13;
    hence o in Base a by A2,A3;
    end;
then A: rng f = Base a by A1,TARSKI:2;
now assume not f is one-to-one;
  then consider x1,x2 being object such that
  A1: x1 in dom f & x2 in dom f & f.x1 = f.x2 & x1 <> x2;
  consider n1 being Element of Seg m,
           y1 being Element of NAT such that
  A2: x1 = n1 & y1 = n1-1 & f.x1 = a|^y1 by A1,C;
  consider n2 being Element of Seg m,
           y2 being Element of NAT such that
  A3: x2 = n2 & y2 = n2-1 & f.x2 = a|^y2 by A1,C;
  n1 <= m & n2 <= m by C,A1,FINSEQ_1:1; then
  y1 + 1 - 1 <= m - 1 & y2 + 1 - 1 <= m - 1 by A3,A2,XREAL_1:9; then
  A4: y1 < m - 1 + 1 & y2 < m - 1 + 1 by NAT_1:13;
  A5: y1 <> y2 by A1,A2,A3;
  per cases by A5,XXREAL_0:1;
  suppose y1 < y2;
    hence contradiction by A1,A2,A3,A4,mpol5;
    end;
  suppose y1 > y2;
    hence contradiction by A1,A2,A3,A4,mpol5;
    end;
  end;
then card Base a = card(Seg m) by A,C,CARD_1:70 .= m by FINSEQ_1:57;
hence thesis;
end;
