 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
  for EV st x in Affin Affv holds
    x in Affin(EV.:Seg k)
  iff
    x|--EV = ((x|--EV)|k)^((card Affv-' k)|->0)
 proof
  let E be Enumeration of Affv;
  set B=E.:Seg k;
  set cA=card Affv;
  set cAk=cA-' k;
  set xE=x|--E;
  set xEk=xE|k;
  set cAk0=cAk|->0;
  A1: B c=rng E by RELAT_1:111;
  assume A2: x in Affin Affv;
  then reconsider v=x as Element of V;
  A3: len xE=cA by Th16;
  A4: rng E=Affv by Def1;
  then A5: len E=cA by FINSEQ_4:62;
  per cases;
  suppose A6: k>cA;
   then Seg cA c=Seg k by FINSEQ_1:5;
   then dom E c=Seg k by A5,FINSEQ_1:def 3;
   then dom E/\Seg k=dom E by XBOOLE_1:28;
   then A7: B=E.:dom E by RELAT_1:112;
   cA-k<0 by A6,XREAL_1:49;
   then cAk=0 by XREAL_0:def 2;
   then A8: cAk0 is empty;
   xEk=xE by A3,A6,FINSEQ_1:58;
   hence thesis by A2,A4,A8,A7,FINSEQ_1:34,RELAT_1:113;
  end;
  suppose A9: k<=cA;
   A10: len cAk0=cAk by CARD_1:def 7;
   A11: len xEk=k by A3,A9,FINSEQ_1:59;
   cAk=cA-k by A9,XREAL_1:233;
   then A12: len(xEk^cAk0)=k+(cA-k) by A11,A10,FINSEQ_1:22;
   hereby assume A13: x in Affin B;
    now let i be Nat;
     assume A14: 1<=i & i<=len xE;
     then A15: i in dom xE by FINSEQ_3:25;
     A16: i in dom E by A3,A5,A14,FINSEQ_3:25;
     A17: i in dom(xEk^cAk0) by A3,A12,A14,FINSEQ_3:25;
     per cases by A11,A17,FINSEQ_1:25;
     suppose A18: i in dom xEk;
      hence (xEk^cAk0).i=xEk.i by FINSEQ_1:def 7
       .=xE.i by A18,FUNCT_1:47;
     end;
     suppose ex n be Nat st n in dom cAk0 & i=k+n;
      then consider n be Nat such that
       A19: n in dom cAk0 and
       A20: i=k+n;
      A21: not E.i in B
      proof
       assume E.i in B;
       then consider t be object such that
        A22: t in dom E & t in Seg k & E.t=E.i by FUNCT_1:def 6;
       i in Seg k by A16,A22,FUNCT_1:def 4;
       then A23: i<=k by FINSEQ_1:1;
       i>=k by A20,NAT_1:11;
       then i=k by A23,XXREAL_0:1;
       hence contradiction by A19,A20,FINSEQ_3:25;
      end;
      cAk0.n=0;
      then (xEk^cAk0).i=0 by A11,A19,A20,FINSEQ_1:def 7;
      hence xE.i=(xEk^cAk0).i by A2,A1,A4,A13,A15,A21,Th20;
     end;
    end;
    hence xE=xEk^cAk0 by A12,Th16;
   end;
   assume A24: xE=xEk^cAk0;
   A25: dom(xEk^cAk0)=dom xE by A3,A12,FINSEQ_3:29;
   now let y be set;
    assume that
     A26: y in dom xE and
     A27: not E.y in B;
    reconsider i=y as Nat by A26;
    i in dom E by A3,A5,A26,FINSEQ_3:29;
    then not i in Seg k by A27,FUNCT_1:def 6;
    then not i in dom xEk by A11,FINSEQ_1:def 3;
    then consider n be Nat such that
     A28: n in dom cAk0 & i=k+n by A11,A25,A26,FINSEQ_1:25;
    cAk0.n=0;
    hence xE.y=0 by A11,A24,A28,FINSEQ_1:def 7;
   end;
   hence x in Affin B by A2,A1,A4,Th20;
  end;
 end;
