
theorem Th50:
  for S, T being TopSpace
  st [#]S c= [#]T & ex K being prebasis of S, L being prebasis of T
    st K = INTERSECTION(L,{[#]S})
  holds S is SubSpace of T
proof
  let S, T be TopSpace;
  assume A1: [#]S c= [#]T;
  given K being prebasis of S, L being prebasis of T such that
    A2: K = INTERSECTION(L,{[#]S});
  :: the basic idea is to take the canonical bases from the prebases and
  :: show the condition of the theorem above
  reconsider K0 = FinMeetCl K as Basis of S by YELLOW_9:23;
  reconsider L0 = FinMeetCl L as Basis of T by YELLOW_9:23;
  for x being object holds x in K0 iff x in INTERSECTION(L0,{[#]S})
  proof
    let x be object;
    hereby
      assume A3: x in K0;
      then reconsider A = x as Subset of S;
      consider X being Subset-Family of S such that
        A4: X c= K & X is finite & A = Intersect X by A3, CANTOR_1:def 3;
      per cases;
      suppose A5: X <> {};
        then A6: A = meet X by A4, SETFAM_1:def 9;
        defpred P[object,object] means ex D being Subset of T
          st $1 = D /\ [#]S & $2 = D;
        A7: for x being object st x in X ex y being object st y in L & P[x,y]
        proof
          let x be object;
          assume x in X;
          then consider D, S0 being set such that
            A8: D in L & S0 in {[#]S} & x = D /\ S0 by A2, A4, SETFAM_1:def 5;
          take D;
          thus D in L by A8;
          reconsider D0 = D as Subset of T by A8;
          take D0;
          thus thesis by A8, TARSKI:def 1;
        end;
        consider f being Function such that
          A9: dom f = X & rng f c= L and
          A10: for x being object st x in X holds P[x,f.x]
          from FUNCT_1:sch 6(A7);
        reconsider Y = rng f as Subset-Family of T by A9, XBOOLE_1:1;
        set B = meet Y;
        A11: Y is finite by A4, A9, FINSET_1:8;
A12:    f <> {} by A5, A9;
        then B = Intersect Y by SETFAM_1:def 9;
        then A13: B in L0 by A9, A11, CANTOR_1:def 3;
        for y being object holds y in A iff y in B /\ [#]S
        proof
          let y be object;
          hereby
            assume A14: y in A;
            for D being set st D in Y holds y in D
            proof
              let D be set;
              assume D in Y;
              then consider C being object such that
                A15: C in dom f & f.C = D by FUNCT_1:def 3;
              reconsider C as set by TARSKI:1;
              A16: ex D0 being Subset of T st
                C = D0 /\ [#]S & D = D0 by A9, A10, A15;
              y in C by A6, A9, A14, A15, SETFAM_1:def 1;
              hence thesis by A16, TARSKI:def 3, XBOOLE_1:17;
            end;
            then A17: y in B by A12, SETFAM_1:def 1;
            the carrier of S = [#]S by STRUCT_0:def 3;
            hence y in B /\ [#]S by A14, A17, XBOOLE_0:def 4;
          end;
          assume y in B /\ [#]S;
          then A18: y in B & y in [#]S by XBOOLE_0:def 4;
          for C being set st C in X holds y in C
          proof
            let C be set;
            assume A19: C in X;
            then consider D being Subset of T such that
              A20: C = D /\ [#]S & f.C = D by A10;
            D in Y by A9, A19, A20, FUNCT_1:def 3;
            then y in D by A18, SETFAM_1:def 1;
            hence thesis by A18, A20, XBOOLE_0:def 4;
          end;
          hence thesis by A5, A6, SETFAM_1:def 1;
        end;
        then A21: A = B /\ [#]S by TARSKI:2;
        [#]S in {[#]S} by TARSKI:def 1;
        hence x in INTERSECTION(L0,{[#]S}) by A13, A21, SETFAM_1:def 5;
      end;
      suppose X = {};
        then A22: A = the carrier of S by A4, SETFAM_1:def 9
          .= [#]S by STRUCT_0:def 3;
        ex B, S0 being set st B in L0 & S0 in {[#]S} & A = B /\ S0
        proof
          take [#]T, [#]S;
          set Y = the empty Subset-Family of T;
          A23: Y c= L & Y is finite by XBOOLE_1:2;
          Intersect Y = the carrier of T by SETFAM_1:def 9
            .= [#]T by STRUCT_0:def 3;
          hence thesis by A1, A22, XBOOLE_1:28,TARSKI:def 1,A23,CANTOR_1:def 3;
        end;
        hence x in INTERSECTION(L0,{[#]S}) by SETFAM_1:def 5;
      end;
    end;
    assume x in INTERSECTION(L0,{[#]S});
    then consider B, S0 being set such that
      A24: B in L0 & S0 in {[#]S} & x = B /\ S0 by SETFAM_1:def 5;
    consider Y being Subset-Family of T such that
      A25: Y c= L & Y is finite & B = Intersect Y by A24, CANTOR_1:def 3;
    per cases;
    suppose A26: Y <> {};
      defpred P[object,object] means ex D being Subset of T
        st $2 = D /\ [#]S & $1 = D;
      A27: for x being object st x in Y ex y being object st y in K & P[x,y]
      proof
        let x be object;
        assume A28: x in Y;
        then reconsider D = x as Subset of T;
        take D /\ [#]S;
        [#]S in {[#]S} by TARSKI:def 1;
        hence D /\ [#]S in K by A2, A25, A28, SETFAM_1:def 5;
        take D;
        thus thesis;
      end;
      consider f being Function such that
        A29: dom f = Y & rng f c= K and
        A30: for x being object st x in Y holds P[x,f.x]
        from FUNCT_1:sch 6(A27);
      reconsider X = rng f as Subset-Family of S by A29, XBOOLE_1:1;
      A31: X is finite by A25, A29, FINSET_1:8;
      a32:f <> {} by A26, A29;
      reconsider A = x as set by TARSKI:1;
      for y being object holds y in A iff
        for M being set st M in X holds y in M
      proof
        let y be object;
        hereby
          assume A33: y in A;
          let M be set;
          assume M in X;
          then consider D being object such that
            A34: D in dom f & f.D = M by FUNCT_1:def 3;
          consider D0 being Subset of T such that
            A35: M = D0 /\ [#]S & D = D0 by A29, A30, A34;
          y in B by A24, A33, XBOOLE_0:def 4;
          then y in meet Y by A25, A26, SETFAM_1:def 9;
          then A36: y in D0 by A29, A34, A35, SETFAM_1:def 1;
          y in S0 by A24, A33, XBOOLE_0:def 4;
          then y in [#]S by A24, TARSKI:def 1;
          hence y in M by A36, A35, XBOOLE_0:def 4;
        end;
        assume A37: for M being set st M in X holds y in M;
        for M being set st M in Y holds y in M
        proof
          let M be set;
          assume A38: M in Y;
          then consider D being Subset of T such that
            A39: f.M = D /\ [#]S & M = D by A30;
          M /\ [#]S in X by A29, A38, A39, FUNCT_1:3;
          then y in M /\ [#]S by A37;
          hence thesis by XBOOLE_1:17, TARSKI:def 3;
        end;
        then y in meet Y by A26, SETFAM_1:def 1;
        then A40: y in B by A25, A26, SETFAM_1:def 9;
        set M0 = the Element of Y;
        consider D0 being Subset of T such that
          A41: f.M0 = D0 /\ [#]S & M0 = D0 by A26, A30;
        M0 /\ [#]S in X by A29, A26, A41, FUNCT_1:3;
        then y in M0 /\ [#]S by A37;
        then y in [#]S by XBOOLE_1:17, TARSKI:def 3;
        then y in S0 by A24, TARSKI:def 1;
        hence thesis by A24, A40, XBOOLE_0:def 4;
      end;
      then A = meet X by a32, SETFAM_1:def 1;
      then x = Intersect X by a32, SETFAM_1:def 9;
      hence thesis by A29, A31, CANTOR_1:def 3;
    end;
    suppose Y = {};
      then A42: B = the carrier of T by A25, SETFAM_1:def 9
        .= [#]T by STRUCT_0:def 3;
      set X = the empty Subset-Family of S;
      [#]S = the carrier of S by STRUCT_0:def 3;
      then a43: X c= K & X is finite & [#]S = Intersect X
        by XBOOLE_1:2, SETFAM_1:def 9;
      x = B /\ [#]S by A24, TARSKI:def 1
        .= [#]S by A1, A42, XBOOLE_1:28;
      hence thesis by a43, CANTOR_1:def 3;
    end;
  end;
  hence thesis by TARSKI:2, Th49;
end;
