 reserve x for set,
         n,m,k for Nat,
         r for Real,
         V for RealLinearSpace,
         v,u,w,t for VECTOR of V,
         Av for finite Subset of V,
         Affv for finite affinely-independent Subset of V;
reserve pn for Point of TOP-REAL n,
        An for Subset of TOP-REAL n,
        Affn for affinely-independent Subset of TOP-REAL n,
        Ak for Subset of TOP-REAL k;
reserve EV for Enumeration of Affv,
        EN for Enumeration of Affn;

theorem Th23:
  0*n in Affn & EN.len EN=0*n implies
    rng(EN|(card Affn-' 1)) = Affn\{0*n} &
    for A be Subset of n-VectSp_over F_Real st Affn = A holds
      EN|(card Affn-' 1) is OrdBasis of Lin A
 proof
  set A=Affn;
  set E=EN;
  assume that
   A1: 0*n in A and
   A2: E.len E=0*n;
  A3: card A>=1 by A1,NAT_1:14;
  set cA=card A-' 1;
  A4: rng E=A by Def1;
  cA=card A-1 by A1,NAT_1:14,XREAL_1:233;
  then A5: len E=cA+1 by A4,FINSEQ_4:62;
  A6: len E=card A by A4,FINSEQ_4:62;
  A7: not 0*n in rng(E|cA)
  proof
   A8: len E in dom E by A6,A3,FINSEQ_3:25;
   assume 0*n in rng(E|cA);
   then consider x be object such that
    A9: x in dom(E|cA) and
    A10: (E|cA).x=0*n by FUNCT_1:def 3;
   A11: x in Seg cA by A9,RELAT_1:57;
   x in dom E & (E|cA).x=E.x by A9,FUNCT_1:47,RELAT_1:57;
   then x=cA+1 by A2,A5,A10,A8,FUNCT_1:def 4;
   then cA+1<=cA by A11,FINSEQ_1:1;
   hence thesis by NAT_1:13;
  end;
  E=(E|cA)^<*E.len E*> by A5,FINSEQ_3:55;
  then A12:A=rng(E|cA)\/rng<*E.len E*> by A4,FINSEQ_1:31
   .=rng(E|cA)\/{0*n} by A2,FINSEQ_1:38;
  hence A13:A\{0*n} =rng(E|cA) by A7,ZFMISC_1:117;
  let A1 be Subset of n-VectSp_over F_Real such that
   A14: A=A1;
  A1 c=[#]Lin A1
  proof
   let x be object;
   assume x in A1;
   then x in Lin A1 by VECTSP_7:8;
   hence thesis;
  end;
  then reconsider e=E as FinSequence of Lin A1 by A4,A14,FINSEQ_1:def 4;
  0*n=0.TOP-REAL n by EUCLID:66;
  then A\{0*n} is linearly-independent by A1,RLAFFIN1:46;
  then A1\{0*n} is linearly-independent by A14,MATRTOP2:7;
  then A15: rng(e|cA) is linearly-independent
    by A14,A13,VECTSP_9:12;
  [#]Lin A1=[#]Lin A by A14,MATRTOP2:6
   .=[#]Lin(A\{0.TOP-REAL n}) by Lm2
   .=[#]Lin(A\{0*n}) by EUCLID:66
   .=[#]Lin(A1\{0*n}) by A14,MATRTOP2:6;
  then Lin A1=Lin(A1\{0*n}) by VECTSP_4:29
   .=Lin rng(e|cA) by A12,A7,A14,VECTSP_9:17,ZFMISC_1:117;
  then (e|cA is one-to-one) & rng(e|cA) is Basis of Lin A1 by A15,FUNCT_1:52
,VECTSP_7:def 3;
  hence thesis by MATRLIN:def 2;
 end;
