reserve Y for TopStruct;
reserve X for non empty TopSpace;
reserve X for almost_discrete non empty TopSpace;

theorem Th56:
  for A being Subset of X holds A is maximal_discrete implies A is dense
proof
  let A be Subset of X;
  assume
A1: A is maximal_discrete;
  then
A2: A is discrete;
  assume A is not dense;
  then Cl A <> the carrier of X by TOPS_3:def 2;
  then (the carrier of X) \ Cl A <> {} by Lm3;
  then consider a being object such that
A3: a in (the carrier of X) \ Cl A by XBOOLE_0:def 1;
  reconsider a as Point of X by A3;
  set B = A \/ {a};
A4: A c= B by XBOOLE_1:7;
A5: now
    let x be Point of X;
    assume x in B;
    then
A6: x in A or x in {a} by XBOOLE_0:def 3;
    now
      per cases by A6,TARSKI:def 1;
      suppose
A7:     x in A;
        then consider G being Subset of X such that
A8:     G is open and
A9:     A /\ G = {x} by A2,Th26;
        now
          take E = Cl A /\ G;
A10:      B /\ E = (A /\ E) \/ ({a} /\ E) by XBOOLE_1:23;
          Cl A is open by TDLAT_3:22;
          hence E is open by A8;
A11:      {x} c= E by A9,PRE_TOPC:18,XBOOLE_1:26;
          E c= Cl A by XBOOLE_1:17;
          then not a in E by A3,XBOOLE_0:def 5;
          then {a} misses E by ZFMISC_1:50;
          then
A12:      {a} /\ E = {};
          {x} c= B by A4,A7,ZFMISC_1:31;
          then
A13:      {x} c= B /\ E by A11,XBOOLE_1:19;
          A /\ E c= A /\ G by XBOOLE_1:17,26;
          hence B /\ E = {x} by A9,A13,A12,A10;
        end;
        hence ex E being Subset of X st E is open & B /\ E = {x};
      end;
      suppose
A14:    x = a;
        now
          take G = [#]X \ Cl A;
A15:      B /\ G = (A /\ G) \/ ({a} /\ G) by XBOOLE_1:23;
A16:      G = (Cl A)`;
          hence G is open;
          A c= Cl A by PRE_TOPC:18;
          then A misses G by A16,SUBSET_1:24;
          then
A17:      A /\ G = {};
          {a} c= G by A3,ZFMISC_1:31;
          hence B /\ G = {x} by A14,A17,A15,XBOOLE_1:28;
        end;
        hence ex G being Subset of X st G is open & B /\ G = {x};
      end;
    end;
    hence ex G being Subset of X st G is open & B /\ G = {x};
  end;
  A c= Cl A by PRE_TOPC:18;
  then
A18: not a in A by A3,XBOOLE_0:def 5;
  ex D being Subset of X st D is discrete & A c= D & A <> D
  proof
    take B;
    thus B is discrete by A5,Th31;
    thus A c= B by XBOOLE_1:7;
     A <> B by A18,ZFMISC_1:31,XBOOLE_1:7;
    hence thesis;
  end;
  hence contradiction by A1;
end;
