 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 Th25:
  for EN,An st k <= n & card Affn = n+1 & An = {pn:(pn|--EN)|k in Ak}
    holds Ak is open iff An is open
 proof
  set A=Affn;
  set AA=Affin A;
  set TRn=TOP-REAL n;
  let EN,An such that
   A1: k<=n and
   A2: card A=n+1 and
   A3: An={v where v is Element of TRn:(v|--EN)|k in Ak};
  set E=EN;
  A4: rng E=A by Def1;
  then A5: len E=card A by FINSEQ_4:62;
  then A6: len E>=1 by A2,NAT_1:14;
  then A7: len E in dom E by FINSEQ_3:25;
  then E.(len E) in A by A4,FUNCT_1:def 3;
  then reconsider EL=E.(len E) as Element of TRn;
  A8: card(-EL+A)=n+1 by A2,RLAFFIN1:7;
  set BB={u where u is Element of TRn:u in AA & (u|--E)|k in Ak};
  A9: BB c=An
  proof
   let x be object;
   assume x in BB;
   then ex u be Element of TRn st x=u & u in AA & (u|--E)|k in Ak;
   hence thesis by A3;
  end;
  reconsider Ev=E+(card A|->-EL) as Enumeration of-EL+A by Th13;
  set TB={w where w is Element of TRn:(w|--Ev)|k in Ak};
  set T=transl(-EL,TRn);
  A10: dim TRn=n by Th4;
  then A11: [#]TRn=AA by A2,Th6;
  An c=BB
  proof
   let x be object;
   assume x in An;
   then consider v be Element of TRn such that
    A12: x=v & (v|--E)|k in Ak by A3;
   thus thesis by A11,A12;
  end;
  then BB=An by A9;
  then A13: T.:An={w where w is Element of TRn:w in Affin(-EL+A) & (w|--Ev)|k
in Ak} by Lm6;
  A14: T.:An c=TB
  proof
   let x be object;
   assume x in T.:An;
   then ex w be Element of TRn st x=w & w in Affin(-EL+A) & (w|--Ev)|k in Ak
by A13;
   hence thesis;
  end;
  A15: card(-EL+A)=card A by RLAFFIN1:7;
  then A16: Affin(-EL+A)=[#]TRn by A2,A10,Th6;
  TB c=T.:An
  proof
   let x be object;
   assume x in TB;
   then consider w be Element of TRn such that
    A17: x=w & (w|--Ev)|k in Ak;
   thus thesis by A16,A13,A17;
  end;
  then A18: T.:An=TB by A14;
  len E in Seg card A by A5,A6;
  then A19: (card A|->-EL).len E=-EL by FINSEQ_2:57;
  A20: rng Ev=-EL+A by Def1;
  then len Ev=card A by A15,FINSEQ_4:62;
  then dom E=dom Ev by A5,FINSEQ_3:29;
  then Ev.len E=EL+(-EL) by A7,A19,FVSUM_1:17
   .=0.TRn by RLVECT_1:5
   .=0*n by EUCLID:70;
  then A21: Ev.len Ev=0*n by A5,A15,A20,FINSEQ_4:62;
  -EL+A is non empty by A2,A15;
  then T.:An is open iff Ak is open by A1,A21,A8,A18,Lm7;
  hence thesis by TOPGRP_1:25;
  set TAA=T.:AA;
  A22: rng(T|AA)=T.:AA by RELAT_1:115;
  dom T=[#]TRn by FUNCT_2:52;
  then A23: dom(T|AA)=AA by RELAT_1:62;
  [#](TRn|AA)=AA & [#](TRn|TAA)=TAA by PRE_TOPC:def 5;
  then reconsider TA=T|AA as Function of TRn|AA,TRn|TAA by A23,A22,FUNCT_2:1;
  reconsider TAB=TA.:An as Subset of TRn|TAA;
  reconsider TAB=TA.:An as Subset of TRn|TAA;
 end;
