reserve x,y,X for set,
        r for Real,
        n,k for Nat;
reserve RLS for non empty RLSStruct,
        Kr,K1r,K2r for SimplicialComplexStr of RLS,
        V for RealLinearSpace,
        Kv for non void SimplicialComplex of V;
reserve Ks for simplex-join-closed SimplicialComplex of V,
        As,Bs for Subset of Ks,
        Ka for non void affinely-independent SimplicialComplex of V,
        Kas for non void affinely-independent simplex-join-closed
                 SimplicialComplex of V,
        K for non void affinely-independent simplex-join-closed total
                 SimplicialComplex of V;

theorem Th29:
  |.Kas.| c= [#]Kas implies BCS Kas is simplex-join-closed
 proof
  set B=center_of_mass V;
  set BC=BCS Kas;
  defpred P[Nat] means
   for S1,S2 be c=-linear finite simplex-like Subset-Family of Kas for A1,A2 be
Simplex of BC st A1=B.:S1 & A2=B.:S2 & card union S1<=$1 & card union S2<=$1 &
Int@A1 meets Int@A2 holds A1=A2;
  assume A1: |.Kas.|c=[#]Kas;
  then A2: BC=subdivision(B,Kas) by Def5;
  A3: BC is affinely-independent by A1,Th28;
  A4: dom B=(bool the carrier of V)\{{}} by FUNCT_2:def 1;
  A5: for n be Nat st P[n] holds P[n+1]
  proof
   let n be Nat such that
    A6: P[n];
   let S1,S2 be c=-linear finite simplex-like Subset-Family of Kas;
   let A1,A2 be Simplex of BC such that
    A7: A1=B.:S1 and
    A8: A2=B.:S2 and
    A9: card union S1<=n+1 and
    card union S2<=n+1 and
    A10: Int@A1 meets Int@A2;
   A11: union S2 in S2 or S2 is empty by SIMPLEX0:9;
   then A12: union S2 is simplex-like by TOPS_2:def 1,ZFMISC_1:2;
   set U=union S1;
   S2 c=bool union S2 & bool@union S2 c=bool the carrier of V by ZFMISC_1:67,82
;
   then A13: S2 is Subset-Family of V by XBOOLE_1:1;
   A14: union S1 in S1 or S1 is empty by SIMPLEX0:9;
   then A15: union S1 is simplex-like by TOPS_2:def 1,ZFMISC_1:2;
   S1 c=bool union S1 & bool@union S1 c=bool the carrier of V by ZFMISC_1:67,82
;
   then A16: S1 is Subset-Family of V by XBOOLE_1:1;
   then A17: Int(B.:S1)c=Int@union S1 by A15,RLAFFIN2:30;
   Int@union S1 meets Int(B.:S2) by A7,A8,A10,A15,A16,RLAFFIN2:30,XBOOLE_1:63;
   then Int@union S1 meets Int@union S2 by A13,A12,RLAFFIN2:30,XBOOLE_1:63;
   then A18: union S1=union S2 by A12,A15,Th25;
   per cases by A9,NAT_1:8;
   suppose card union S1<=n;
    hence thesis by A6,A7,A8,A10,A18;
   end;
   suppose A19: card union S1=n+1;
    then A20: @union S1 is non empty;
    then A21: union S1 in dom B by A4,ZFMISC_1:56;
    then A22: B.union S1 in @A1 by A7,A14,A19,FUNCT_1:def 6,ZFMISC_1:2;
    then reconsider Bu=B.union S1 as Element of V;
    A23: {Bu}c=@A1 by A22,ZFMISC_1:31;
    A24: B.union S1 in @A2 by A8,A11,A18,A19,A21,FUNCT_1:def 6,ZFMISC_1:2;
    then A25: {Bu}c=@A2 by ZFMISC_1:31;
    A26: Bu in {Bu} by ZFMISC_1:31;
    A27: conv{Bu}={Bu} by RLAFFIN1:1;
    consider x being object such that
     A28: x in Int@A1 and
     A29: x in Int@A2 by A10,XBOOLE_0:3;
    reconsider x as Element of V by A28;
    per cases;
    suppose A1={Bu} & A2={Bu};
     hence thesis;
    end;
    suppose A30: A1={Bu} & A2<>{Bu};
     then {Bu}c<@A2 & Int@A1=@A1 by A25,RLAFFIN2:6;
     hence thesis by A27,A28,A29,A30,RLAFFIN2:def 1;
    end;
    suppose A31: A1<>{Bu} & A2={Bu};
     then {Bu}c<@A1 & Int@A2=@A2 by A23,RLAFFIN2:6;
     hence thesis by A27,A28,A29,A31,RLAFFIN2:def 1;
    end;
    suppose A1<>{Bu} & A2<>{Bu};
     then {Bu}c<@A1 by A23;
     then A32: Bu<>x by A26,A27,A28,RLAFFIN2:def 1;
     S1\{U}c=S1 & S2\{U}c=S2 by XBOOLE_1:36;
     then reconsider s1u=S1\{U},s2u=S2\{U} as c=-linear finite simplex-like
Subset-Family of Kas by TOPS_2:11;
     A33: S1 c=the topology of Kas
     proof
      let x be object;
      assume A34: x in S1;
      then reconsider A=x as Subset of Kas;
      A is simplex-like by A34,TOPS_2:def 1;
      hence thesis;
     end;
     [#]Kas c=the carrier of V by SIMPLEX0:def 9;
     then bool the carrier of Kas c=bool the carrier of V by ZFMISC_1:67;
     then reconsider S1U=s1u,S2U=s2u as Subset-Family of V by XBOOLE_1:1;
     set Bu1=x|--@A1;
     set Bu2=x|--@A2;
     set BT=B|(the topology of Kas);
     A35: S1\{U}c=S1 by XBOOLE_1:36;
     A36: {U}c=S1 by A14,A19,ZFMISC_1:2,31;
     A37: union s2u c=U by A18,XBOOLE_1:36,ZFMISC_1:77;
     union s2u<>U
     proof
      assume A38: union s2u=U;
      then union s2u in s2u by A20,SIMPLEX0:9,ZFMISC_1:2;
      hence contradiction by A38,ZFMISC_1:56;
     end;
     then A39: union s2u c<U by A37;
     then consider xS2U be object such that
      A40: xS2U in @U and
      A41: not xS2U in union S2U by XBOOLE_0:6;
     reconsider xS2U as Element of V by A40;
     union S2U c=U\{xS2U} by A37,A41,ZFMISC_1:34;
     then A42: conv union S2U c=conv@(U\{xS2U}) by RLAFFIN1:3;
     A43: x in conv@A1 by A28,RLAFFIN2:def 1;
     then A44: Bu1.Bu<=1 by A3,RLAFFIN1:71;
     A45: Bu1.Bu<1
     proof
      assume Bu1.Bu>=1;
      then Bu1.Bu=1 by A44,XXREAL_0:1;
      hence contradiction by A3,A32,A43,RLAFFIN1:72;
     end;
     conv@A1 c=Affin@A1 by RLAFFIN1:65;
     then A46: x=Sum Bu1 by A3,A43,RLAFFIN1:def 7;
     then Bu in Carrier Bu1 by A3,A22,A28,A43,RLAFFIN1:71,RLAFFIN2:11;
     then A47: Bu1.Bu<>0 by RLVECT_2:19;
     Bu1 is convex by A3,A43,RLAFFIN1:71;
     then consider p1 be Element of V such that
      A48: p1 in conv(@A1\{Bu}) and
      A49: x=Bu1.Bu*Bu+(1-Bu1.Bu)*p1 and
      1/Bu1.Bu*x+(1-1/Bu1.Bu)*p1=Bu by A32,A46,A47,RLAFFIN2:1;
     A50: p1 in Int(@A1\{Bu}) by A3,A22,A28,A48,A49,RLAFFIN2:14;
     A51: {Bu}=Im(B,union S1) by A21,FUNCT_1:59
      .=B.:{union S1} by RELAT_1:def 16;
     then A52: A1\{Bu}=BT.:S1\(B.:{U}) by A33,A7,RELAT_1:129
      .=BT.:S1\(BT.:{U}) by A33,A36,RELAT_1:129,XBOOLE_1:1
      .=BT.:(S1\{U}) by FUNCT_1:64
      .=B.:(S1\{U}) by A35,A33,RELAT_1:129,XBOOLE_1:1;
     then conv(@A1\{Bu})c=conv union S1U by CONVEX1:30,RLAFFIN2:17;
     then A53: p1 in conv union S1U by A48;
     card union s2u<n+1 by A19,A39,CARD_2:48;
     then A54: card union s2u<=n by NAT_1:13;
     A55: union s1u c=U by XBOOLE_1:36,ZFMISC_1:77;
     A56: x in conv@A2 by A29,RLAFFIN2:def 1;
     then A57: Bu2.Bu<=1 by A3,RLAFFIN1:71;
     A58: Bu2.Bu<1
     proof
      assume Bu2.Bu>=1;
      then Bu2.Bu=1 by A57,XXREAL_0:1;
      hence contradiction by A3,A32,A56,RLAFFIN1:72;
     end;
     conv@A2 c=Affin@A2 by RLAFFIN1:65;
     then A59: x=Sum Bu2 by A3,A56,RLAFFIN1:def 7;
     then Bu in Carrier Bu2 by A3,A24,A29,A56,RLAFFIN1:71,RLAFFIN2:11;
     then A60: Bu2.Bu<>0 by RLVECT_2:19;
     Bu2 is convex by A3,A56,RLAFFIN1:71;
     then consider p2 be Element of V such that
      A61: p2 in conv(@A2\{Bu}) and
      A62: x=Bu2.Bu*Bu+(1-Bu2.Bu)*p2 and
      1/Bu2.Bu*x+(1-1/Bu2.Bu)*p2=Bu by A32,A59,A60,RLAFFIN2:1;
     A63: p2 in Int(@A2\{Bu}) by A3,A24,A29,A61,A62,RLAFFIN2:14;
     @U is non empty finite Subset of V by A19;
     then A64: Bu in Int@U by A15,RLAFFIN2:20;
     then A65: Bu in conv@U by RLAFFIN2:def 1;
     A66: S2 c=the topology of Kas
     proof
      let x be object;
      assume A67: x in S2;
      then reconsider A=x as Subset of Kas;
      A is simplex-like by A67,TOPS_2:def 1;
      hence thesis;
     end;
     union s1u<>U
     proof
      assume A68: union s1u=U;
      then union s1u in s1u by A20,SIMPLEX0:9,ZFMISC_1:2;
      hence contradiction by A68,ZFMISC_1:56;
     end;
     then A69: union s1u c<U by A55;
     then consider xS1U be object such that
      A70: xS1U in @U and
      A71: not xS1U in union S1U by XBOOLE_0:6;
     reconsider xS1U as Element of V by A70;
     union S1U c=U\{xS1U} by A55,A71,ZFMISC_1:34;
     then A72: conv union S1U c=conv@(U\{xS1U}) by RLAFFIN1:3;
     U\{xS1U}c=U & U\{xS1U}<>U by A70,ZFMISC_1:56;
     then U\{xS1U}c<U;
     then A73: not Bu in conv@(U\{xS1U}) by A64,RLAFFIN2:def 1;
     card union s1u<n+1 by A19,A69,CARD_2:48;
     then A74: card union s1u<=n by NAT_1:13;
     U\{xS2U}c=U & U\{xS2U}<>U by A40,ZFMISC_1:56;
     then U\{xS2U}c<U;
     then A75: not Bu in conv@(U\{xS2U}) by A64,RLAFFIN2:def 1;
     A76: {U}c=S2 by A11,A18,A19,ZFMISC_1:2,31;
     A77: S2\{U}c=S2 by XBOOLE_1:36;
     A78: A2\{Bu}=BT.:S2\(B.:{U}) by A66,A8,A51,RELAT_1:129
      .=BT.:S2\(BT.:{U}) by A76,A66,RELAT_1:129,XBOOLE_1:1
      .=BT.:(S2\{U}) by FUNCT_1:64
      .=B.:(S2\{U}) by A66,A77,RELAT_1:129,XBOOLE_1:1;
     then conv(@A2\{Bu})c=conv union S2U by CONVEX1:30,RLAFFIN2:17;
     then A79: p2 in conv union S2U by A61;
     x in conv@U by A7,A17,A28,RLAFFIN2:def 1;
     then p2=p1 by A15,A45,A49,A58,A62,A65,A42,A53,A75,A72,A73,A79,RLAFFIN2:2;
     then A80: Int(@A1\{Bu})meets Int(@A2\{Bu}) by A50,A63,XBOOLE_0:3;
     @A1\{Bu}=@(A1\{Bu}) & @A2\{Bu}=@(A2\{Bu});
     then A1\{Bu}=A2\{Bu} by A6,A54,A52,A74,A78,A80;
     hence A1=(A2\{Bu})\/{Bu} by A22,ZFMISC_1:116
      .=A2 by A24,ZFMISC_1:116;
    end;
   end;
  end;
  A81: P[0 qua Nat]
  proof
   let S1,S2 be c=-linear finite simplex-like Subset-Family of Kas;
   let A1,A2 be Simplex of BC such that
    A82: A1=B.:S1 and
    A2=B.:S2 and
    A83: card union S1<=0 and
    card union S2<=0 and
    A84: Int@A1 meets Int@A2;
   Int@A1 is non empty by A84;
   then A1 is non empty;
   then consider y being object such that
    A85: y in A1;
   consider x being object such that
    A86: x in dom B and
    A87: x in S1 and
    B.x=y by A82,A85,FUNCT_1:def 6;
   reconsider xx=x as set by TARSKI:1;
   A88: x<>{} by A86,ZFMISC_1:56;
   union S1 is empty by A83;
   then xx c={} by A87,ZFMISC_1:74;
   hence thesis by A88;
  end;
  A89: for n holds P[n] from NAT_1:sch 2(A81,A5);
  now let A1,A2 be Subset of BC;
   assume that
    A90: A1 is simplex-like and
    A91: A2 is simplex-like and
    A92: Int@A1 meets Int@A2;
   consider S1 be c=-linear finite simplex-like Subset-Family of Kas such that
    A93: A1=B.:S1 by A2,A90,SIMPLEX0:def 20;
   consider S2 be c=-linear finite simplex-like Subset-Family of Kas such that
    A94: A2=B.:S2 by A2,A91,SIMPLEX0:def 20;
   card union S1<=card union S2 or card union S2<=card union S1;
   hence A1=A2 by A89,A90,A91,A92,A93,A94;
  end;
  hence thesis by Th25;
 end;
