reserve X for non empty set;

theorem Th12:
  for T being non empty TopSpace holds ex ET being FMT_TopSpace st
  the carrier of T = the carrier of ET &
  Family_open_set(ET) = the topology of T
  proof
    let T be non empty TopSpace;
    ex ET be non empty strict FMT_Space_Str st
    ET is U_FMT_filter & ET is U_FMT_with_point & ET is U_FMT_local &
    the carrier of T = the carrier of ET &
    ex TT be FMT_TopSpace st
    TT=ET & Family_open_set(TT)=the topology of T
    proof
      deffunc F(object)={O where O is Element of the topology of T: $1 in O};
A1:   for x being object st x in the carrier of T holds
      F(x) in bool bool the carrier of T
      proof
        let x being object such that
A2:     x in the carrier of T;
        reconsider x as Element of T by A2;
        F(x) c= bool the carrier of T
        proof
          let t be object such that
A3:       t in F(x);
          consider O1 be Element of the topology of T such that
A4:       t=O1 and
          x in O1 by A3;
          thus thesis by A4;
        end;
        hence thesis;
      end;
      ex f being Function of the carrier of T,bool bool the carrier of T st
      for x being object st x in the carrier of T holds
      f.x=F(x) from FUNCT_2:sch 2(A1);
      then consider f be Function of
      the carrier of T,bool bool the carrier of T
      such that
A5:   for x being object st x in the carrier of T holds f.x=F(x);
      reconsider TMP=FMT_Space_Str(#the carrier of T,f#) as
      non empty strict FMT_Space_Str;
A6:   for t be Element of TMP holds U_FMT t is non empty
      proof
        let t be Element of TMP;
        take TT=the carrier of T;
        TT in the topology of T by PRE_TOPC:def 1;
        then TT in F(t);
        hence thesis by A5;
      end;
A7:   TMP is U_FMT_filter_base
      proof
        for x be Element of the carrier of TMP holds
        U_FMT x is non empty &
        U_FMT x is with_non-empty_elements &
        for B1,B2 be Element of U_FMT x
        ex B be Element of U_FMT x st B c= B1/\B2
        proof
          let x be Element of the carrier of TMP;
          thus
A8:       U_FMT x is non empty by A6;
          thus U_FMT x is with_non-empty_elements
          proof
            assume that
A9:         not (U_FMT x is with_non-empty_elements);
            {} in F(x) by A9,A5;
            then consider O be Element of the topology of T such that
A10:        O={} and
A11:        x in O;
            thus thesis by A10,A11;
          end;
          thus for B1,B2 be Element of U_FMT x
          ex B be Element of U_FMT x st B c= B1/\B2
          proof
            let B1,B2 be Element of U_FMT x;
            B1 in U_FMT x & B2 in U_FMT x by A8; then
A12:        B1 in F(x) & B2 in F(x) by A5;
            then consider O1 be Element of the topology of T such that
A13:        B1=O1 and
A14:        x in O1;
            consider O2 be Element of the topology of T such that
A15:        B2=O2 and
A16:        x in O2 by A12;
A17:        x in O1/\O2 by A14,A16,XBOOLE_0:def 4;
            reconsider OO=O1/\O2 as Element of the topology of T
            by PRE_TOPC:def 1;
            OO in F(x) by A17;
            then reconsider OO as Element of U_FMT x by A5;
            take OO;
            thus thesis by A13,A15;
          end;
        end;
        then for x be Element of the carrier of TMP holds
        U_FMT x is non empty & U_FMT x is with_non-empty_elements &
        U_FMT x is quasi_basis;
        hence thesis;
      end;
      reconsider ET=gen_filter(TMP) as non empty strict FMT_Space_Str;
      take ET;
      thus ET is U_FMT_filter by A7,Th8;
      thus
A18:  ET is U_FMT_with_point
      proof
        for x be Element of ET, V be Element of U_FMT x  holds x in V
        proof
          let x be Element of ET,V be Element of U_FMT x;
          set Z=(the BNbd of gen_filter(TMP)).x;
          reconsider x0=x as Element of TMP;
A20:      U_FMT x=<.(U_FMT x0).] by Def7;
A21:      U_FMT x0 = F(x0) by A5;
          then reconsider FX0=F(x0) as Subset-Family of the carrier of TMP;
A22:      V is Element of <.(FX0).] by A5,A20;
          <.FX0.] is non empty
          proof
            the carrier of T in the topology of T by PRE_TOPC:def 1;
            then the carrier of T in FX0;
            then reconsider XX=the carrier of T as Element of FX0;
            FX0 c= <.FX0.] by CARDFIL2:def 8;
            hence thesis by A21,A6;
          end;
          then V in <.FX0.] by A22;
          then consider b be Element of FX0 such that
A23:      b c= V by CARDFIL2:def 8;
          F(x0) is non empty
          proof
            the carrier of T in the topology of T by PRE_TOPC:def 1;
            then the carrier of T in F(x0);
            hence thesis;
          end;
          then b in F(x0);
          then consider OO be Element of the topology of T such that
A24:      b=OO and
A25:      x0 in OO;
          thus thesis by A23,A24,A25;
        end;
        hence thesis;
      end;
      thus
A26:  ET is U_FMT_local
      proof
        for x be Element of ET holds
        for V be Element of U_FMT x ex W be Element of U_FMT x st
        for y be Element of ET st y is Element of W holds
        V is Element of U_FMT y
        proof
          let t be Element of ET;
          set Z=(the BNbd of gen_filter(TMP)).t;
          reconsider t0=t as Element of TMP;
A28:      U_FMT t=<.(U_FMT t0).] by Def7;
A29:      U_FMT t0 = F(t0) by A5;
          then reconsider FT0=F(t0) as Subset-Family of the carrier of TMP;
          for V be Element of U_FMT t ex W be Element of U_FMT t st
          for y be Element of ET st y is Element of W holds
          V is Element of U_FMT y
          proof
            let V be Element of U_FMT t;
A30:        <.FT0.] is non empty
            proof
              the carrier of T in the topology of T by PRE_TOPC:def 1;
              then the carrier of T in FT0;
              then reconsider XX=the carrier of T as Element of FT0;
              XX in <.FT0.]
              proof
                XX is Element of FT0 & XX c= XX;
                hence thesis by CARDFIL2:def 8;
              end;
              hence thesis;
            end;
A31:        V in <.FT0.] by A30,A28,A29;
            consider V0 be Element of FT0 such that
A32:        V0 c= V by A31,CARDFIL2:def 8;
A33:        F(t0) is non empty
            proof
              the carrier of T in the topology of T by PRE_TOPC:def 1;
              then the carrier of T in F(t0);
              hence thesis;
            end;
            then V0 in F(t0);
            then consider OUV be Element of the topology of T such that
A34:        V0=OUV and
A35:        t0 in OUV;
            reconsider W=OUV as Element of U_FMT t
            by A28,A29,A34,CARDFIL2:def 8;
            take W;
            for y be Element of ET st y is Element of W holds
            V is Element of U_FMT y
            proof
              let y be Element of ET such that
A36:          y is Element of W;
              set Z=(the BNbd of gen_filter(TMP)).y;
              reconsider y0=y as Element of TMP;
A38:          U_FMT y0 = F(y0) by A5;
              then reconsider FY0=F(y0) as Subset-Family of the carrier of TMP;
A39:          V0 in F(y0) by A34,A36,A35;
              V0 in FT0 & FT0 c= bool the carrier of TMP by A33;
              then reconsider VV0=V0 as Subset of the carrier of TMP;
              V in <.FY0.] by A39,A32,A31,CARDFIL2:def 8;
              hence thesis by Def7,A38;
            end;
            hence thesis;
          end;
          hence thesis;
        end;
        hence thesis;
      end;
      thus the carrier of T = the carrier of ET;
      ex TT be FMT_TopSpace st TT=ET & Family_open_set(TT)=the topology of T
      proof
        reconsider TT=ET as FMT_TopSpace
        by A7,Th8,A18,A26;
        Family_open_set(TT)=the topology of T
        proof
A41:      Family_open_set(TT) c= the topology of T
          proof
            for t be object st t in Family_open_set(TT) holds
            t in the topology of T
            proof
              let t be object;
              assume t in Family_open_set(TT);
              then consider O be open Subset of TT such that
A42:          t=O;
              per cases;
              suppose O is empty;
                hence thesis by A42,PRE_TOPC:1;
              end;
              suppose not O is empty;
                reconsider O as Subset of T;
A44:            for x be Point of T st x in O ex b being Subset of T
                st b is a_neighborhood of x & b c= O
                proof
                  let x be Point of T;
                  assume
A45:              x in O;
                  reconsider x0=x as Element of ET;
A46:              O in U_FMT x0 by A45,Def1;
                  set Z=(the BNbd of gen_filter(TMP)).x0;
                  reconsider x1=x0 as Element of TMP;
                  O in <.(U_FMT x1).] by A46,Def7;
                  then consider b be Element of U_FMT x1 such that
A48:              b c= O by CARDFIL2:def 8;
                  U_FMT x1 is non empty & b is Element of U_FMT x1 by A6;
                  then b in U_FMT x1;
                  then b in F(x1) by A5;
                  then consider b0 be Element of the topology of T such that
A49:              b=b0 and
A50:              x1 in b0;
                  b0 is open;
                  hence thesis by A48,A49,A50,CONNSP_2:3;
                end;
                thus thesis by A44,CONNSP_2:7,A42,PRE_TOPC:def 2;
              end;
            end;
            hence thesis;
          end;
          the topology of T c= Family_open_set(TT)
          proof
            let t be object;
            assume
A51:        t in the topology of T;
            then reconsider t as Subset of TT;
            t is open
            proof
              for x be Element of ET st x in t holds t in U_FMT x
              proof
                let x be Element of ET;
                assume
A53:            x in t;
                set Z=(the BNbd of gen_filter(TMP)).x;
                reconsider x0=x as Element of TMP;
A55:            U_FMT x=<.(U_FMT x0).] by Def7;
                U_FMT x0 = F(x0) by A5;
                then reconsider FX0=F(x0) as
                Subset-Family of the carrier of TMP;
                t in F(x0) by A51,A53;
                then t in U_FMT x0 by A5;
                hence thesis by A55,CARDFIL2:def 8;
              end;
              hence thesis;
            end;
            hence thesis;
          end;
          hence thesis by A41;
        end;
        hence thesis;
      end;
      hence thesis;
    end;
    then consider ET be non empty strict FMT_Space_Str such that
A56:the carrier of T = the carrier of ET and
    ET is U_FMT_filter & ET is U_FMT_with_point & ET is U_FMT_local and
A57:ex TT be FMT_TopSpace st
    TT=ET & Family_open_set(TT)=the topology of T;
    consider TT be FMT_TopSpace such that
A58:TT=ET and
    Family_open_set(TT)=the topology of T by A57;
    take TT;
    thus thesis by A56,A57,A58;
  end;
