 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 Th22:
  for EV st k <= card Affv & x in Affin Affv holds
    x in Affin(Affv\(EV.:Seg k))
  iff
    x|--EV = (k|->0)^((x|--EV)/^k)
 proof
  let E be Enumeration of Affv;
  set cA=card Affv;
  set B=E.:Seg k;
  set AB=Affv\B;
  set xE=x|--E;
  set xEk=xE|k;
  set xA=x|--Affv;
  set k0=k|->0;
  A1: AB c=Affv by XBOOLE_1:36;
  A2: xE=(xE|k)^(xE/^k) by RFINSEQ:8;
  assume A3: k<=card Affv;
  then A4: Seg k c=Seg cA by FINSEQ_1:5;
  A5: len xE=cA by Th16;
  then A6: Seg cA=dom xE by FINSEQ_1:def 3;
  A7: rng E=Affv by Def1;
  then len E=cA by FINSEQ_4:62;
  then A8: dom E=dom xE by A5,FINSEQ_3:29;
  assume A9: x in Affin Affv;
  A10: len k0=k & len xEk=k by A3,A5,CARD_1:def 7,FINSEQ_1:59;
  hereby assume A11: x in Affin AB;
   now let i be Nat;
    assume 1<=i & i<=k;
    then A12: i in Seg k;
    then E.i in B by A8,A4,A6,FUNCT_1:def 6;
    then not E.i in AB by XBOOLE_0:def 5;
    then xE.i=0 by A9,A1,A4,A6,A11,A12,Th20;
    hence xEk.i=k0.i by A12,FUNCT_1:49;
   end;
   hence xE=k0^(xE/^k) by A10,A2,FINSEQ_1:14;
  end;
  assume xE=k0^(xE/^k);
  then A13: xEk=k0 by A2,FINSEQ_1:33;
  now let y be set;
   assume that
    A14: y in dom xE and
    A15: not E.y in AB;
   E.y in Affv by A7,A8,A14,FUNCT_1:def 3;
   then E.y in E.:Seg k by A15,XBOOLE_0:def 5;
   then consider z be object such that
    A16: z in dom E and
    A17: z in Seg k and
    A18: E.z=E.y by FUNCT_1:def 6;
   z=y by A8,A14,A16,A18,FUNCT_1:def 4;
   then xEk.y=xE.y by A17,FUNCT_1:49;
   hence xE.y=0 by A13;
  end;
  hence thesis by A9,A1,Th20;
 end;
