
theorem UisoV:
for F being Field
for U,V being finite-dimensional VectSp of F
holds U,V are_isomorphic iff dim U = dim V
proof
let F be Field, U,V be finite-dimensional VectSp of F;
now assume AS: dim U = dim V;
  per cases;
  suppose dim U = 0; then
   H0: (Omega).U = (0).U & (Omega).V = (0).V by AS,VECTSP_9:29;
   H1: the carrier of U = {0.U} by H0,VECTSP_4:def 3;
   H2: the carrier of V = {0.V} by H0,VECTSP_4:def 3;
   deffunc F(object) = 0.V;
   H3: for x be object st x in the carrier of U holds F(x) in the carrier of V;
   consider T being Function of the carrier of U, the carrier of V such that
   A: for u being object st u in the carrier of U holds T.u = F(u)
      from FUNCT_2:sch 2(H3);
   now let u1,u2 be Element of U;
     thus T.u1 + T.u2 = 0.V + T.u2 by A .= 0.V + 0.V by A .= T.(u1+u2) by A;
     end; then
   B: T is additive by VECTSP_1:def 20;
   now let a be Element of F, u be Element of U;
     thus a * T.u = a * 0.V by A .= 0.V by VECTSP_1:14 .= T.(a*u) by A;
     end; then
   C: T is homogeneous by MOD_2:def 2;
   now let x1,x2 be object;
     assume H4: x1 in the carrier of U & x2 in the carrier of U & T.x1 = T.x2;
     hence x1 = 0.U by H1,TARSKI:def 1 .= x2 by H1,H4,TARSKI:def 1;
     end; then
   D: T is one-to-one by FUNCT_2:19;
   H5: dom T = the carrier of U by FUNCT_2:def 1;
   now let o be object;
     assume o in the carrier of V; then
     o = 0.V by H2,TARSKI:def 1; then
     T.(0.U) = o & 0.U in dom T by H5,A;
     hence o in rng T by FUNCT_1:def 3;
     end; then
   rng T c= the carrier of V & the carrier of V c= rng T; then
   rng T = the carrier of V; then
   T is onto by FUNCT_2:def 3;
   hence U,V are_isomorphic by B,C,D;
   end;
  suppose K: dim U > 0;
   set Bv = the Basis of V;
   card Bv > 0 by AS,K,VECTSP_9:def 1; then
   reconsider Bv1 = Bv as non empty Subset of V;
   reconsider U1 = U as non trivial finite-dimensional VectSp of F
     by K,MATRLIN2:42;
   set Bu = the Basis of U1;
   card Bu = dim V by AS,VECTSP_9:def 1 .= card Bv1 by VECTSP_9:def 1; then
   consider f1 being Function of Bu,Bv1 such that
   H: f1 is bijective by lemiso;
   J: dom f1 = Bu & rng f1 c= Bv1 & Bv1 c= the carrier of V
      by FUNCT_2:def 1; then
      rng f1 c= the carrier of V; then
   reconsider f = f1 as Function of Bu,V by J,FUNCT_2:2;
   set T = canLinTrans f;
   rng f is linearly-independent by J,VECTSP_7:1; then
   A: T is one-to-one by H,canLininj;
   now let o be object;
     assume o in the carrier of V; then
     reconsider v = o as Element of V;
     rng f1 = Bv by H,FUNCT_2:def 3; then
     im(canLinTrans f) = Lin Bv1 by canlinsurj; then
     the ModuleStr of V = im T by VECTSP_7:def 3; then
     v in (im T); then
     D: ex x being Element of U st v = T.x by RANKNULL:13;
     dom T = the carrier of U by FUNCT_2:def 1;
     hence o in rng T by D,FUNCT_1:def 3;
     end;
   then rng(canLinTrans f) c= the carrier of V &
        the carrier of V c= rng(canLinTrans f);
   then canLinTrans f is onto by XBOOLE_0:def 10,FUNCT_2:def 3;
   hence U,V are_isomorphic by A;
   end;
   end;
hence thesis by VECTSP12:4;
end;
