reserve x,y for set,
        r,s for Real,
        n for Nat,
        V for RealLinearSpace,
        v,u,w,p for VECTOR of V,
        A,B for Subset of V,
        Af for finite Subset of V,
        I for affinely-independent Subset of V,
        If for finite affinely-independent Subset of V,
        F for Subset-Family of V,
        L1,L2 for Linear_Combination of V;

theorem Th29:
  for F be c=-linear Subset-Family of V st
      union F is finite affinely-independent
    holds (center_of_mass V).:F is affinely-independent Subset of V
  proof
    set B=center_of_mass V;
    defpred P[Nat] means
    for k be Nat st k<=$1for S be c=-linear Subset-Family of V st
        card union S=k & union S is finite affinely-independent
      holds B.:S is affinely-independent Subset of V;
    let S be c=-linear Subset-Family of V;
    A1: dom B=BOOL the carrier of V by FUNCT_2:def 1;
    A2: for n be Nat st P[n] holds P[n+1]
    proof
      let n be Nat such that
      A3: P[n];
      let k be Nat such that
      A4: k<=n+1;
      per cases by A4,NAT_1:8;
      suppose k<=n;
        hence thesis by A3;
      end;
      suppose A5: k=n+1;
        let S be c=-linear Subset-Family of V such that
        A6: card union S=k and
        A7: union S is finite affinely-independent;
        set U=union S;
        A8: S c=bool U by ZFMISC_1:82;
        set SU=S\{U};
        A9: union SU c=U by XBOOLE_1:36,ZFMISC_1:77;
        then reconsider Usu=union SU as finite set by A7;
        A10: SU c=S by XBOOLE_1:36;
        A11: union SU<>U
        proof
          assume A12: union SU=U;
          then SU is non empty by A5,A6,ZFMISC_1:2;
          then union SU in SU by A7,A10,A8,SIMPLEX0:9;
          hence contradiction by A12,ZFMISC_1:56;
        end;
        then union SU c<U by A9;
        then consider v be object such that
        A13: v in U and
        A14: not v in union SU by XBOOLE_0:6;
        reconsider v as Element of V by A13;
        A15: (U\{v})\/{B.U} is affinely-independent Subset of V by A7,A13,Th28;
        U is non empty by A5,A6;
        then A16: U in dom B by A1,ZFMISC_1:56;
        B.U in {B.U} by TARSKI:def 1;
        then B.U in (U\{v})\/{B.U} by XBOOLE_0:def 3;
        then reconsider BU=B.U as Element of V by A15;
        S is non empty by A5,A6,ZFMISC_1:2;
        then SU\/{U}=S by A7,A8,SIMPLEX0:9,ZFMISC_1:116;
        then A17: B.:S=B.:SU\/B.:{U} by RELAT_1:120
        .=B.:SU\/Im(B,U) by RELAT_1:def 16
        .=B.:SU\/{BU} by A16,FUNCT_1:59;
        A18: {v}c=U by A13,ZFMISC_1:31;
        A19: card{v}=1 by CARD_1:30;
        per cases;
        suppose n=0;
          then A20: U={v} by A5,A6,A7,A18,A19,CARD_2:102;
          SU/\dom B={}
          proof
            assume SU/\dom B<>{};
            then consider x being object such that
            A21: x in SU/\dom B by XBOOLE_0:def 1;
            reconsider x as set by TARSKI:1;
            x in SU by A21,XBOOLE_0:def 4;
            then A22: x c=union SU by ZFMISC_1:74;
            then x c=U by A9;
            then A23: x=U or x={} by A20,ZFMISC_1:33;
            not v in x by A14,A22;
            hence thesis by A20,A21,A23,TARSKI:def 1,ZFMISC_1:56;
          end;
          then B.:SU=B.:{} by RELAT_1:112
          .={};
          hence thesis by A17;
        end;
        suppose A24: n>0;
          reconsider u=U as finite set by A7;
          A25: Usu c=u by XBOOLE_1:36,ZFMISC_1:77;
          then card Usu<=n+1 by A5,A6,NAT_1:43;
          then card Usu<n+1 by A5,A6,A11,A25,CARD_2:102,XXREAL_0:1;
          then A26: card Usu<=n by NAT_1:13;
          union SU c=U\{v} & U\{v}c=(U\{v})\/{B.U}
          by A9,A14,XBOOLE_1:7,ZFMISC_1:34;
          then union SU is affinely-independent by A15,RLAFFIN1:43,XBOOLE_1:1;
          then reconsider BSU=B.:SU as affinely-independent Subset of V
          by A3,A10,A26;
          BSU c=Affin(U\{v})
          proof
            let y be object;
            assume y in BSU;
            then consider x being object such that
            A27: x in dom B and
            A28: x in SU and
            A29: B.x=y by FUNCT_1:def 6;
            reconsider x as non empty Subset of V by A27,ZFMISC_1:56;
            x in S by A28,XBOOLE_0:def 5;
            then A30: x c=U by ZFMISC_1:74;
            x c=union SU by A28,ZFMISC_1:74;
            then not v in x by A14;
            then x c=U\{v} by A30,ZFMISC_1:34;
            then A31: conv x c=conv(U\{v}) by RLTOPSP1:20;
            y in conv x by A7,A29,A30,Th16;
            then A32: y in conv(U\{v}) by A31;
            conv(U\{v})c=Affin(U\{v}) by RLAFFIN1:65;
            hence thesis by A32;
          end;
          then A33: Affin BSU c=Affin(U\{v}) by RLAFFIN1:51;
          card U<>1 by A5,A6,A24;
          then not BU in U by A7,Th19;
          then not BU in U\{v} by XBOOLE_0:def 5;
          then not BU in Affin BSU by A15,A33,Th27;
          hence thesis by A17,Th27;
        end;
      end;
    end;
    A34: P[0 qua Nat]
    proof
      let k be Nat;
      assume A35: k<=0;
      let S be c=-linear Subset-Family of V such that
      A36: card union S=k and
      union S is finite affinely-independent;
      A37: union S={} by A35,A36;
      S/\dom B={}
      proof
        assume S/\dom B<>{};
        then consider x being object such that
        A38: x in S/\dom B by XBOOLE_0:def 1;
        reconsider x as set by TARSKI:1;
        x in S by A38,XBOOLE_0:def 4;
        then A39: x c={} by A37,ZFMISC_1:74;
        x<>{} by A38,ZFMISC_1:56;
        hence contradiction by A39;
      end;
      then B.:S=B.:{} by RELAT_1:112
      .={};
      hence thesis;
    end;
    A40: for n be Nat holds P[n] from NAT_1:sch 2(A34,A2);
    assume A41: union S is finite affinely-independent;
    then card union S is Nat;
    hence thesis by A40,A41;
  end;
