 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 Th24:
  for A be Subset of n-VectSp_over F_Real st
    Affn = A & 0*n in Affn & EN.len EN = 0*n
  for B be OrdBasis of Lin A st B = EN|(card Affn-' 1)
  for v be Element of Lin A holds v|--B = (v|--EN)|(card Affn-' 1)
 proof
  reconsider Z=0 as Element of REAL by Lm5;
  set TR=TOP-REAL n;
  set A=Affn;
  set V=n-VectSp_over F_Real;
  set E=EN;
  let A1 be Subset of V such that
   A1: A=A1 and
   A2: 0*n in A and
   A3: E.len E=0*n;
  deffunc F(set)=Z;
  A4: Affin A=[#]Lin A by A2,Th11;
  set cA=card A-' 1;
  let B be OrdBasis of Lin A1 such that
   A5: B=E|cA;
  A6: rng B=A\{0*n} by A2,A3,A5,Th23;
  then reconsider rB=rng B as Subset of TR;
  let v be Element of Lin A1;
  set vB=v|--B;
  consider KV be Linear_Combination of Lin A1 such that
   A7: v=Sum(KV) and
   A8: Carrier KV c=rng B and
   A9: for k be Nat st 1<=k & k<=len vB holds vB/.k=KV.(B/.k)
    by MATRLIN:def 7;
  A10: (v|--E)|cA  =(v|--A)*(E|cA) by RELAT_1:83;
  dom(v|--A)=[#]TR by FUNCT_2:def 1;
  then rB c=dom(v|--A);
  then A11: len((v|--E)|cA)=len B by A5,A10,FINSEQ_2:29;
  A12: [#]Lin A1=[#]Lin A by A1,MATRTOP2:6;
  then reconsider RB=rB as Subset of Lin A;
  reconsider KR=KV as Linear_Combination of Lin A by A12,MATRTOP2:11;
  A13: Carrier KR=Carrier KV by MATRTOP2:12;
  consider KR1 be Linear_Combination of TR such that
   A14: Carrier KR1=Carrier KR and
   A15: Sum KR1=Sum KR by RLVECT_5:11;
  rng B c=A by A6,XBOOLE_1:36;
  then A16: Carrier KR1 c=A by A8,A13,A14;
  reconsider KR2=KR1| [#]Lin A as Linear_Combination of Lin A by MATRTOP2:10;
  A17: Carrier KR2=Carrier KR1 & Sum KR2=Sum KR1 by A14,RLVECT_5:10;
  reconsider KR1 as Linear_Combination of A by A16,RLVECT_2:def 6;
  reconsider ms = 1-sum KR1 as Element of REAL by XREAL_0:def 1;
  consider KR0 being Function of the carrier of TR,REAL such that
   A18: KR0.0.TR= ms and
   A19: for u being Element of TR st u<>0.TR holds KR0.u=F(u)
        from FUNCT_2:sch
6;
  reconsider KR0 as Element of Funcs(the carrier of TR,REAL) by FUNCT_2:8;
  now let u be VECTOR of TR;
   assume not u in {0.TR};
   then u<>0.TR by TARSKI:def 1;
   hence KR0.u=0 by A19;
  end;
  then reconsider KR0 as Linear_Combination of TR by RLVECT_2:def 3;
  Carrier KR0 c={0.TR}
  proof
   let x be object;
   assume that
    A20: x in Carrier KR0 and
    A21: not x in {0.TR};
   KR0.x<>0 & x<>0.TR by A20,A21,RLVECT_2:19,TARSKI:def 1;
   hence thesis by A19,A20;
  end;
  then reconsider KR0 as Linear_Combination of{0.TR} by RLVECT_2:def 6;
  A22: Carrier KR0 c={0.TR} by RLVECT_2:def 6;
  rng B is Basis of Lin A1 by MATRLIN:def 2;
  then rng B is linearly-independent by VECTSP_7:def 3;
  then rng B is linearly-independent Subset of V by VECTSP_9:11;
  then rB is linearly-independent by MATRTOP2:7;
  then A23: RB is linearly-independent by RLVECT_5:15;
  A24: len vB=len B by MATRLIN:def 7;
  A25: Sum KR0=KR0.(0.TR)*0.TR by RLVECT_2:32
   .=0.TR by RLVECT_1:10;
  A26: 0.TR=0*n by EUCLID:66;
  then {0.TR}c=A by A2,ZFMISC_1:31;
  then reconsider KR0 as Linear_Combination of A by RLVECT_2:21;
  reconsider K=KR1+KR0 as Linear_Combination of A by RLVECT_2:38;
  A27: sum K=sum KR1+sum KR0 by RLAFFIN1:34
   .=sum KR1+(1-sum KR1) by A18,A22,RLAFFIN1:32
   .=1;
  Sum K=Sum KR1+Sum KR0 by RLVECT_3:1
   .=Sum KR1 by A25,RLVECT_1:def 4
   .=v by A7,A15,MATRTOP2:12;
  then A28: v|--A=K by A12,A4,A27,RLAFFIN1:def 7;
  now let k be Nat;
   reconsider Bk=B/.k as Element of TR by A12,RLSUB_1:10;
   assume A29: 1<=k & k<=len B;
   then A30: vB/.k=KV.Bk & k in dom((v|--E)|cA) by A24,A9,A11,FINSEQ_3:25;
   A31: k in dom B by A29,FINSEQ_3:25;
   then A32: Bk=B.k by PARTFUN1:def 6;
   then Bk in rng B by A31,FUNCT_1:def 3;
   then Bk<>0.TR by A6,A26,ZFMISC_1:56;
   then not Bk in Carrier KR0 by A22,TARSKI:def 1;
   then A33: KR0.Bk=0 by RLVECT_2:19;
   k in dom vB by A24,A29,FINSEQ_3:25;
   then A34: vB.k=vB/.k by PARTFUN1:def 6;
   K.Bk=KR1.Bk+KR0.Bk by RLVECT_2:def 10;
   then K.Bk =KR2.Bk by A12,A33,FUNCT_1:49
    .=KV.Bk by A23,A8,A13,A14,A15,A17,RLVECT_5:1;
   hence ((v|--E)|cA).k=vB.k by A5,A28,A10,A30,A34,A32,FUNCT_1:12;
  end;
  hence thesis by A24,A11;
 end;
