reserve a,b,c for set;

theorem Th7:
  for X being set, c being Function of bool X, bool X st c.{} = {}
& (for A being Subset of X holds A c= c.A) & (for A,B being Subset of X holds c
.(A \/ B) = (c.A) \/ (c.B)) & (for A being Subset of X holds c.(c.A) = c.A) for
T being TopStruct st the carrier of T = X & the topology of T = COMPLEMENT rng
  c holds T is TopSpace & for A being Subset of T holds Cl A = c.A
proof
  let X be set;
  let c be Function of bool X, bool X;
  assume that
A1: c.{} = {} and
A2: for A being Subset of X holds A c= c.A and
A3: for A,B being Subset of X holds c.(A \/ B) = (c.A) \/ (c.B) and
A4: for A being Subset of X holds c.(c.A) = c.A;
  set F = rng c;
A5: dom c = bool X by FUNCT_2:def 1;
A6: now
    let A,B be set;
    assume that
A7: A in F and
A8: B in F;
    consider a being object such that
A9: a in dom c and
A10: A = c.a by A7,FUNCT_1:def 3;
    consider b being object such that
A11: b in dom c and
A12: B = c.b by A8,FUNCT_1:def 3;
    reconsider a,b as Subset of X by A9,A11;
    A\/B = (c.A)\/B by A4,A9,A10
      .= (c.A)\/(c.B) by A4,A11,A12
      .= c.((c.a)\/(c.b)) by A3,A10,A12;
    hence A \/ B in F by A5,FUNCT_1:def 3;
  end;
A13: now
    let A,B be Subset of X;
    assume A c= B;
    then A\/B = B by XBOOLE_1:12;
    then c.B = (c.A)\/(c.B) by A3;
    hence c.A c= c.B by XBOOLE_1:11;
  end;
A14: now
    let G be Subset-Family of X such that
A15: G c= F;
    now
      let a;
      assume
A16:  a in G;
      then reconsider A = a as Subset of X;
A17:  c.Intersect G c= c.A by A13,A16,MSSUBFAM:2;
      ex b being object st b in dom c & A = c.b by A15,A16,FUNCT_1:def 3;
      hence c.Intersect G c= a by A17,A4;
    end;
    then
A18: c.Intersect G c= Intersect G by MSSUBFAM:4;
    Intersect G c= c.Intersect G by A2;
    then c.Intersect G = Intersect G by A18;
    hence Intersect G in F by A5,FUNCT_1:def 3;
  end;
  let T be TopStruct such that
A19: the carrier of T = X and
A20: the topology of T = COMPLEMENT F;
  {} = {}X;
  then
A21: {} in F by A1,A5,FUNCT_1:def 3;
  hence
A22: T is TopSpace by A14,A19,A20,A6,Th4;
  let A be Subset of T;
  reconsider B = A, ClA = Cl A as Subset of X by A19;
  reconsider cB = c.B as Subset of T by A19;
  cB in F by A5,FUNCT_1:def 3;
  then cB is closed by A19,A20,A21,A6,A14,Th4;
  hence Cl A c= c.A by A2,TOPS_1:5;
  ClA in F by A22,A19,A20,A21,A6,A14,Th4;
  then ex a being object st a in dom c & ClA = c.a by FUNCT_1:def 3;
  then c.ClA = ClA by A4;
  hence thesis by A19,A13,PRE_TOPC:18;
end;
