 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;
reserve pnA for Element of(TOP-REAL n)|Affin Affn;

theorem
  card Affn = n+1 implies Int Affn is open
 proof
  set L=].0,1 .[;
  set TRn=TOP-REAL n;
  set A=Affn;
  assume that
   A1: card A=n+1;
  per cases;
  suppose A2:n<>0;
  reconsider L as Subset of R^1 by TOPMETR:17;
  set E=the Enumeration of A;
  deffunc F(object)=|--(A,E.$1)"L;
  consider f be FinSequence such that
   A3: len f=n+1 and
   A4: for k be Nat st k in dom f holds f.k=F(k) from FINSEQ_1:sch 2;
  A5: dom f=Seg len f by FINSEQ_1:def 3;
  then A6: rng f is non empty by A3,RELAT_1:42;
  rng f c=bool the carrier of TRn
  proof
   let y be object;
   assume y in rng f;
   then consider x be object such that
    A7: x in dom f and
    A8: f.x=y by FUNCT_1:def 3;
   f.x=F(x) by A4,A7;
   hence thesis by A8;
  end;
  then reconsider f as FinSequence of bool the carrier of TRn by FINSEQ_1:def 4
;
  A9: rng E=A by Def1;
  then A10: len E=card A by FINSEQ_4:62;
  A11: meet rng f c=Int A
  proof
   let x be object;
   dim TRn=n by Th4;
   then A12: [#]TRn=Affin A by A1,Th6;
   assume A13: x in meet rng f;
   A14: now let v be Element of TRn;
    assume v in A;
    then consider k be object such that
     A15: k in dom E and
     A16: E.k=v by A9,FUNCT_1:def 3;
    A17: k in dom f by A1,A3,A10,A5,A15,FINSEQ_1:def 3;
    then f.k in rng f by FUNCT_1:def 3;
    then A18: meet rng f c=f.k by SETFAM_1:3;
    A19: (x|--A).v=|--(A,v).x by A13,Def3;
    f.k=|--(A,v)"L by A4,A16,A17;
    then (x|--A).v in L by A13,A19,A18,FUNCT_1:def 7;
    hence (x|--A).v>0 by XXREAL_1:4;
   end;
   A20: A c=Carrier(x|--A)
   proof
    let y be object;
    assume A21: y in A;
    then (x|--A).y>0 by A14;
    hence thesis by A21,RLVECT_2:19;
   end;
   Carrier(x|--A)c=A by RLVECT_2:def 6;
   then A22: Carrier(x|--A)=A by A20;
   for v be Element of TRn st v in A holds(x|--A).v>=0 by A14;
   then A23: x in conv A by A13,A12,RLAFFIN1:73;
   Sum(x|--A)=x by A13,A12,RLAFFIN1:def 7;
   hence thesis by A23,A22,RLAFFIN1:71,RLAFFIN2:12;
  end;
  A24: conv A c=Affin A by RLAFFIN1:65;
  A25: Int A c=conv A by RLAFFIN2:5;
  A26: dom E=Seg len E by FINSEQ_1:def 3;
  A27: Int A c=meet rng f
  proof
   let x be object;
   assume A28: x in Int A;
   then consider K be Linear_Combination of A such that
    A29: K is convex and
    A30: x=Sum K by RLAFFIN2:10;
   A31: x in conv A by A25,A28;
   sum K=1 by A29,RLAFFIN1:62;
   then A32: K=x|--A by A24,A30,A31,RLAFFIN1:def 7;
   A33: Carrier K=A by A28,A29,A30,RLAFFIN2:11;
   now let Y be set;
    assume Y in rng f;
    then consider k be object such that
     A34: k in dom f and
     A35: f.k=Y by FUNCT_1:def 3;
    A36: E.k in A by A1,A3,A9,A10,A5,A26,A34,FUNCT_1:def 3;
    then reconsider Ek=E.k as Element of TRn;
    (x|--A).Ek<>0 by A32,A33,A36,RLVECT_2:19;
    then A37: 0<(x|--A).Ek by A29,A32,RLAFFIN1:62;
    A38: (x|--A).Ek<1
    proof
     assume A39: (x|--A).Ek>=1;
     (x|--A).Ek<=1 by A29,A32,RLAFFIN1:63;
     then A={Ek} by A29,A32,A33,A39,RLAFFIN1:64,XXREAL_0:1;
     then card A=1 by CARD_2:42;
     hence contradiction by A1,A2;
    end;
    (x|--A).Ek=|--(A,Ek).x by A30,Def3;
    then A40: |--(A,Ek).x in L by A38,A37,XXREAL_1:4;
    A41: dom|--(A,Ek)=[#]TRn by FUNCT_2:def 1;
    Y=|--(A,E.k)"L by A4,A34,A35;
    hence x in Y by A28,A40,A41,FUNCT_1:def 7;
   end;
   hence thesis by A6,SETFAM_1:def 1;
  end;
  now let B be Subset of TRn;
   A42: [#]R^1 is non empty;
   assume B in rng f;
   then consider k be object such that
    A43: k in dom f & f.k=B by FUNCT_1:def 3;
   (|--(A,E.k) is continuous) & L is open by A1,Th32,JORDAN6:35;
   then |--(A,E.k)"L is open by A42,TOPS_2:43;
   hence B is open by A4,A43;
  end;
  then rng f is open by TOPS_2:def 1;
  then meet rng f is open by TOPS_2:20;
  hence thesis by A27,A11,XBOOLE_0:def 10;
end;
  suppose A44:n =0;
    Affn is non empty by A1;
    then A45:Int Affn is non empty by RLAFFIN2:20;
    the carrier of TRn = {0.TRn} by A44,EUCLID:22,77;
    then Int Affn = [#]TRn by A45,ZFMISC_1:33;
    hence thesis;
  end;
 end;
