
theorem cardB:
for R being non degenerated Ring, n being Nat holds card Base(R,n) = n
proof
let R be non degenerated Ring, n be Nat;
defpred P[object,object] means
  ex x being Nat st $1 = x & $2 = x_th_unit_vector(n,R);
B1: for x,y1,y2 being object st x in Seg n & P[x,y1] & P[x,y2] holds y1 = y2;
B2: now let x be object;
    assume x in Seg n;
    then reconsider k = x as Nat;
    thus ex y being object st P[x,y]
      proof
      take k_th_unit_vector(n,R);
      thus thesis;
      end;
    end;
consider f being Function such that
C: dom f = Seg n &
   for x being object st x in Seg n holds P[x,f.x] from FUNCT_1:sch 2(B1,B2);
A1: now let o be object;
    assume o in Base(R,n);
    then consider i being Nat such that
    A2: o = i_th_unit_vector(n,R) & 1 <= i & i <= n;
    A4: i in Seg n by A2;
    P[i,f.i] by C,FINSEQ_1:1,A2;
    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;
    reconsider j = u as Element of NAT by A2,C;
    P[u,f.u] by C,A2; then
    consider i being Element of Seg n such that
    A3: u = i & f.u = j_th_unit_vector(n,R) by C,A2;
    1 <= j & j <= n by A2,C,FINSEQ_1:1;
    hence o in Base(R,n) by A2,A3;
    end;
then A: rng f = Base(R,n) 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;
  reconsider j1 = x1, j2 = x2 as Element of NAT by A1,C;
  P[x1,f.x1] by C,A1; then
  consider i1 being Element of Seg n such that
  A2: i1 = x1 & f.x1 = j1_th_unit_vector(n,R) by C,A1;
  P[x2,f.x2] by C,A1; then
  consider i2 being Element of Seg n such that
  A3: i2 = x2 & f.x2 = j2_th_unit_vector(n,R) by C,A1;
  1 <= j1 & j1 <= n & 1 <= j2 & j2 <= n by A1,C,FINSEQ_1:1;
  hence contradiction by u2,A1,A2,A3;
  end;
then card Base(R,n) = card(Seg n) by A,C,CARD_1:70 .= n by FINSEQ_1:57;
hence thesis;
end;
