reserve a,b,c for set;

theorem
  for X being set, B being non-empty ManySortedSet of X st rng B c= bool
  bool X & (for x,U being set st x in X & U in B.x holds x in U) & (for x,y,U
being set st x in U & U in B.y & y in X ex V being set st V in B.x & V c= U) &
(for x,U1,U2 being set st x in X & U1 in B.x & U2 in B.x ex U being set st U in
B.x & U c= U1 /\ U2) ex P being Subset-Family of X st P = Union B & for T being
  TopStruct st the carrier of T = X & the topology of T = UniCl P holds T is
  TopSpace & for T9 being non empty TopSpace st T9 = T holds B is
  Neighborhood_System of T9
proof
  let X be set;
  let B be non-empty ManySortedSet of X such that
A1: rng B c= bool bool X;
  Union B c= union bool bool X by A1,ZFMISC_1:77;
  then reconsider P = Union B as Subset-Family of X by ZFMISC_1:81;
A2: dom B = X by PARTFUN1:def 2;
  assume
A3: for x,U being set st x in X & U in B.x holds x in U;
  assume
A4: for x,y,U being set st x in U & U in B.y & y in X ex V being set st
  V in B.x & V c= U;
  assume
A5: for x,U1,U2 being set st x in X & U1 in B.x & U2 in B.x ex U being
  set st U in B.x & U c= U1 /\ U2;
A6: P is point-filtered
  proof
    let x,U1,U2 be set;
    assume that
A7: U1 in P and
A8: U2 in P and
A9: x in U1 /\ U2;
A10: x in U2 by A9,XBOOLE_0:def 4;
    ex y2 being object st y2 in X & U2 in B.y2 by A2,A8,CARD_5:2;
    then consider V2 being set such that
A11: V2 in B.x and
A12: V2 c= U2 by A10,A4;
A13: x in U1 by A9,XBOOLE_0:def 4;
    ex y1 being object st y1 in X & U1 in B.y1 by A7,A2,CARD_5:2;
    then consider V1 being set such that
A14: V1 in B.x and
A15: V1 c= U1 by A13,A4;
A16: x in X by A2,A14,FUNCT_1:def 2;
    then consider U being set such that
A17: U in B.x and
A18: U c= V1 /\ V2 by A5,A14,A11;
    U in P by A2,A16,A17,CARD_5:2;
    then reconsider U as Subset of X;
    take U;
    thus U in P by A2,A16,A17,CARD_5:2;
    thus x in U by A3,A16,A17;
    V1/\V2 c= U1/\U2 by A15,A12,XBOOLE_1:27;
    hence thesis by A18;
  end;
  take P;
  thus P = Union B;
  let T be TopStruct such that
A19: the carrier of T = X and
A20: the topology of T = UniCl P;
  now
    let x be set;
    set U = the Element of B.x;
    assume
A21: x in X;
    then
A22: U in P by A2,CARD_5:2;
    x in U by A3,A21;
    hence ex U being Subset of X st U in P & x in U by A22;
  end;
  then P is covering by Th1;
  hence T is TopSpace by A19,A20,A6,Th2;
  let T9 be non empty TopSpace;
  assume
A23: T9 = T;
  then reconsider B9 = B as ManySortedSet of T9 by A19;
  B9 is Neighborhood_System of T9
  proof
    let x be Point of T9;
A24: B9.x in rng B by A2,A19,A23,FUNCT_1:def 3;
    then reconsider Bx = B9.x as Subset-Family of T9 by A1,A19,A23;
    Bx is Basis of x
    proof
A25:  P c= UniCl P by CANTOR_1:1;
      Bx c= P by A24,ZFMISC_1:74;
      then Bx c= the topology of T9 by A25,A20,A23;
      then
A26:  Bx is open by TOPS_2:64;
      Bx is x-quasi_basis
      proof
      for a st a in Bx holds x in a by A3,A19,A23;
      hence x in Intersect Bx by SETFAM_1:43;
      let A be Subset of T9;
      assume A in the topology of T9;
      then consider Y being Subset-Family of T9 such that
A27:  Y c= P and
A28:  A = union Y by A19,A20,A23,CANTOR_1:def 1;
      assume x in A;
      then consider a such that
A29:  x in a and
A30:  a in Y by A28,TARSKI:def 4;
      ex b being object st b in dom B & a in B.b by A27,A30,CARD_5:2;
      then
A31:  ex V being set st V in B.x & V c= a by A4,A29;
      a c= A by A28,A30,ZFMISC_1:74;
      hence thesis by A31,XBOOLE_1:1;
    end;
    hence thesis by A26;
    end;
    hence thesis;
  end;
  hence thesis;
end;
