Theory Topology_ZF_examples

(* 
    This file is a part of IsarMathLib - 
    a library of formalized mathematics written for Isabelle/Isar.

    Copyright (C) 2012 Daniel de la Concepcion

    This program is free software; Redistribution and use in source and binary forms, 
    with or without modification, are permitted provided that the following conditions are met:

   1. Redistributions of source code must retain the above copyright notice, 
   this list of conditions and the following disclaimer.
   2. Redistributions in binary form must reproduce the above copyright notice, 
   this list of conditions and the following disclaimer in the documentation and/or 
   other materials provided with the distribution.
   3. The name of the author may not be used to endorse or promote products 
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *)

section Topology - examples

theory Topology_ZF_examples imports Topology_ZF Cardinal_ZF

begin

text
  This theory deals with some concrete examples of topologies.


subsectionCoCardinal Topology 

text In this section we define and prove the basic properties of 
the co-cardinal topology on a set $X$.

textThe collection of subsets of a set whose complement
is strictly bounded by a cardinal is a topology given some assumptions
on the cardinal.

definition 
"CoCardinal(X,T)  {FPow(X). X-F  T} {0}"

textFor any set and any infinite cardinal we prove that
CoCardinal(X,Q)› forms a topology. The proof is done
with an infinite cardinal, but it is obvious that the set Q›
can be any set equipollent with an infinite cardinal.
It is a topology also if the set where the topology is defined is
too small or the cardinal too large; in this case, as it is later proved the topology
is a discrete topology. And the last case corresponds with "Q=1"› which translates
in the indiscrete topology.

lemma CoCar_is_topology:
  assumes "InfCard (Q)"
  shows "CoCardinal(X,Q) {is a topology}"
proof -
  let ?T = "CoCardinal(X,Q)"
  {
    fix M
    assume A:"MPow(?T)"
    hence "M?T" by auto
    then have "MPow(X)" using CoCardinal_def by auto
    then have "MPow(X)" by auto
    moreover
    {
      assume B:"M=0"
      then have "M?T" using CoCardinal_def by auto
    }
    moreover
    {
      assume B:"M={0}"
      then have "M?T" using CoCardinal_def by auto
    }
    moreover
    {
      assume B:"M 0" "M{0}"
      from B obtain T where C:"TM" and "T0" by auto
      with A have D:"X-T  (Q)" using CoCardinal_def by auto
      from C have "X-MX-T" by blast
      with D have "X-M (Q)" using subset_imp_lepoll lesspoll_trans1 by blast
    }
    ultimately have "M?T" using CoCardinal_def by auto
  }
  moreover
  {
    fix U and V
    assume "U?T" and "V?T"
    then have A:"U=0  (UPow(X)  X-U (Q))" and
      B:"V=0  (VPow(X)  X-V (Q))" using CoCardinal_def by auto
    hence D:"UPow(X)""VPow(X)" by auto
    have C:"X-(U  V)=(X-U)(X-V)" by fast
    with A B C have "UV=0(UVPow(X)  X-(U  V) (Q))" using less_less_imp_un_less assms
      by auto
    then have "UV?T" using CoCardinal_def by auto
  }
  ultimately show ?thesis using IsATopology_def by auto
qed

text We can use theorems proven in topology0› context for the co-cardinal topology. 

theorem topology0_CoCardinal:
  assumes "InfCard(T)"
  shows "topology0(CoCardinal(X,T))"
  using topology0_def CoCar_is_topology assms by auto

textIt can also be proven that if CoCardinal(X,T)› is a topology,
 X≠0, Card(T)› and T≠0›; then T› is an infinite cardinal,  X≺T›
or T=1›.
It follows from the fact that the union of two closed sets is closed. Choosing the appropriate cardinals, the cofinite and the cocountable topologies
are obtained. 

The cofinite topology is a very special topology because it is closely
related to the separation axiom $T_1$. It also appears naturally in algebraic geometry.

definition
  Cofinite ("CoFinite _" 90) where
  "CoFinite X  CoCardinal(X,nat)"

textCocountable topology in fact consists of the empty set and all cocountable subsets of $X$.

definition
  Cocountable ("CoCountable _" 90) where
  "CoCountable X  CoCardinal(X,csucc(nat))"

subsectionTotal set, Closed sets, Interior, Closure and Boundary

textThere are several assertions that can be done to the
 CoCardinal(X,T)› topology. In each case, we will not assume 
sufficient conditions for  CoCardinal(X,T)› to be a topology, but
they will be enough to do the calculations in every posible case.

textThe topology is defined in the set $X$

lemma union_cocardinal:
  assumes "T0"
  shows " CoCardinal(X,T) = X"
proof-
  have X:"X-X=0" by auto
  have "0  0" by auto
  with assms have "01""1 T" using not_0_is_lepoll_1 lepoll_imp_lesspoll_succ by auto
  then have "0T" using lesspoll_trans2  by auto
  with X have "(X-X)T" by auto
  then have "XCoCardinal(X,T)" using CoCardinal_def by auto
  hence "X CoCardinal(X,T)" by blast
  then show  " CoCardinal(X,T)=X" using CoCardinal_def by auto
qed

textThe closed sets are the small subsets of $X$ and $X$ itself.

lemma closed_sets_cocardinal:
  assumes "T0"
  shows "D {is closed in} CoCardinal(X,T)  (DPow(X)  DT)  D=X"
proof-
  {
    assume A:"D  X" "X - D  CoCardinal(X,T) "" D  X"
    from A(1,3) have "X-(X-D)=D" "X-D0" by auto
    with A(2) have "DT" using CoCardinal_def by simp
  }
  with assms have "D {is closed in} CoCardinal(X,T)  (DPow(X)   DT) D=X" using IsClosed_def
    union_cocardinal by auto
  moreover
  {
    assume A:"D  T""D  X"
    from A(2) have "X-(X-D)=D" by blast
    with A(1) have "X-(X-D) T" by auto
    then have "X-D CoCardinal(X,T)" using CoCardinal_def by auto
  }
  with assms have "(DPow(X)   DT) D {is closed in} CoCardinal(X,T)" using union_cocardinal
    IsClosed_def by auto
  moreover
  have "X-X=0" by auto
  then have "X-X CoCardinal(X,T)"using CoCardinal_def by auto
  with assms have "X{is closed in} CoCardinal(X,T)" using union_cocardinal
    IsClosed_def by auto
  ultimately show ?thesis by auto
qed

textThe interior of a set is itself if it is open or 0› if
it isn't open.

lemma interior_set_cocardinal:
  assumes noC: "T0" and "AX"
  shows "Interior(A,CoCardinal(X,T))= (if ((X-A)  T) then A else 0)"
proof-
  from assms(2) have dif_dif:"X-(X-A)=A" by blast
  {
    assume "(X-A)  T"
    then have "(X-A)Pow(X)  (X-A)  T" by auto
    with noC have "(X-A) {is closed in} CoCardinal(X,T)" using closed_sets_cocardinal
      by auto
    with noC have "X-(X-A)CoCardinal(X,T)" using IsClosed_def union_cocardinal
      by auto
    with dif_dif have "ACoCardinal(X,T)" by auto
    hence "A{UCoCardinal(X,T). U  A}" by auto
    hence a1:"A{UCoCardinal(X,T). U  A}" by auto
    have a2:"{UCoCardinal(X,T). U  A}A" by blast
    from a1 a2 have "Interior(A,CoCardinal(X,T))=A" using Interior_def by auto}
  moreover
  {
    assume as:"~((X-A)  T)"
    {
      fix U
      assume "U A"
      hence "X-A  X-U" by blast
      then have Q:"X-A  X-U" using subset_imp_lepoll by auto
      {
        assume "X-U T"
        with Q have "X-A T" using lesspoll_trans1 by auto
        with as have "False"  by auto
      }
      hence "~((X-U)  T)" by auto
      then have "UCoCardinal(X,T)U=0" using CoCardinal_def by auto
    }
    hence "{UCoCardinal(X,T). U  A}{0}" by blast
    then have "Interior(A,CoCardinal(X,T))=0" using Interior_def by auto
  }
  ultimately show ?thesis by auto
qed

text $X$ is a closed set that contains $A$.
This lemma is necessary because we cannot
use the lemmas proven in the topology0› context since
 T≠0"} › is too weak for
 CoCardinal(X,T)› to be a topology.

lemma X_closedcov_cocardinal:
  assumes "T0" "AX"
  shows "XClosedCovers(A,CoCardinal(X,T))" using ClosedCovers_def
  using union_cocardinal closed_sets_cocardinal assms by auto

textThe closure of a set is itself if it is closed or X› if
it isn't closed.

lemma closure_set_cocardinal:
  assumes "T0""AX"
  shows "Closure(A,CoCardinal(X,T))=(if (A  T) then A else X)"
proof-
  {
    assume "A  T"
    with assms have "A {is closed in} CoCardinal(X,T)" using closed_sets_cocardinal by auto
    with assms(2) have "A {D  Pow(X). D {is closed in} CoCardinal(X,T)  AD}" by auto
    with assms(1) have S:"AClosedCovers(A,CoCardinal(X,T))" using ClosedCovers_def
      using union_cocardinal by auto
    hence l1:"ClosedCovers(A,CoCardinal(X,T))A" by blast
    from S have l2:"A  ClosedCovers(A,CoCardinal(X,T))" 
      unfolding  ClosedCovers_def by auto
    from l1 l2 have "Closure(A,CoCardinal(X,T))=A" using Closure_def
      by auto
  }
  moreover
  {
    assume as:"¬ A  T"
    {
      fix U
      assume "AU"
      then have Q:"A  U" using subset_imp_lepoll by auto
      {
        assume "U T"
        with Q have "A T" using lesspoll_trans1 by auto
        with as have "False" by auto
      }
      hence "¬ U  T" by auto
      with assms(1) have "¬(U {is closed in} CoCardinal(X,T))  U=X" using closed_sets_cocardinal
      by auto
    }
    with assms(1) have "UPow(X). U{is closed in}CoCardinal(X,T)  AUU=X"
      by auto
    with assms(1) have "ClosedCovers(A,CoCardinal(X,T)){X}" 
      using union_cocardinal using ClosedCovers_def by auto
    with assms have "ClosedCovers(A,CoCardinal(X,T))={X}" using X_closedcov_cocardinal
      by auto
    then have " Closure(A,CoCardinal(X,T)) = X " using Closure_def by auto
  }
  ultimately show ?thesis by auto
qed

textThe boundary of a set is empty if $A$ and $X-A$ are closed,
 X› if not $A$ neither $X-A$ are closed and; if only one is closed,
then the closed one is its boundary.

lemma boundary_cocardinal:
  assumes "T0""AX"
  shows "Boundary(A,CoCardinal(X,T)) = (if A T then (if  (X-A) T then 0 else A) else (if  (X-A) T then X-A else X))"
proof-
  from assms(2) have "X-A  X" by auto
  {
    assume AS: "AT" "X-A  T"
    with assms X-A  X have
      "Closure(X-A,CoCardinal(X,T)) = X-A" and "Closure(A,CoCardinal(X,T)) = A"
      using closure_set_cocardinal by auto
    with assms(1) have "Boundary(A,CoCardinal(X,T)) = 0"  
      using Boundary_def  union_cocardinal by auto
  }
  moreover
  {
    assume AS: "~(AT)" "X-A  T"
    with assms X-A  X have
      "Closure(X-A,CoCardinal(X,T)) = X-A" and "Closure(A,CoCardinal(X,T)) = X"
      using closure_set_cocardinal by auto 
    with assms(1) have "Boundary(A,CoCardinal(X,T))=X-A" using Boundary_def
      union_cocardinal by auto
  }
  moreover
  {
    assume AS:"~(AT)" "~(X-A  T)"
    with assms X-A  X have
      "Closure(X-A,CoCardinal(X,T))=X" and "Closure(A,CoCardinal(X,T))=X"
      using closure_set_cocardinal by auto 
    with assms(1) have "Boundary(A,CoCardinal(X,T))=X" using Boundary_def union_cocardinal
      by auto
  }
  moreover
  {
    assume AS:"A T" "~(X-AT)"
    with assms X-A  X have 
      "Closure(X-A,CoCardinal(X,T))=X" and "Closure(A,CoCardinal(X,T)) = A"
      using closure_set_cocardinal by auto
    with assms have "Boundary(A,CoCardinal(X,T))=A" using Boundary_def union_cocardinal
      by auto
  }
  ultimately show ?thesis by auto
qed

textIf the set is too small or the cardinal too large, then the topology
is just the discrete topology.

lemma discrete_cocardinal:
  assumes "XT"
  shows "CoCardinal(X,T) = Pow(X)"
proof
  {
    fix U
    assume "UCoCardinal(X,T)"
    then have "U  Pow(X)" using CoCardinal_def by auto
  }
  then show "CoCardinal(X,T)  Pow(X)" by auto
  {
    fix U
    assume A:"U  Pow(X)"
    then have "X-U  X" by auto
    then have "X-U X" using subset_imp_lepoll by auto
    then have "X-U T" using lesspoll_trans1 assms by auto
    with A have "UCoCardinal(X,T)" using CoCardinal_def
      by auto
  }
  then show "Pow(X)  CoCardinal(X,T)" by auto
qed

textIf the cardinal is taken as  T=1 › then the topology is indiscrete.

lemma indiscrete_cocardinal:
  shows "CoCardinal(X,1) = {0,X}"
proof
  {
    fix Q
    assume "Q  CoCardinal(X,1)"
    then have "Q  Pow(X)" and "Q=0  X-Q1" using CoCardinal_def by auto
    then have "Q  Pow(X)" and "Q=0  X-Q=0" using lesspoll_succ_iff lepoll_0_iff by auto
    then have "Q=0  Q=X" by blast
  }
  then show "CoCardinal(X,1)  {0, X}" by auto
  have "0  CoCardinal(X,1)" using CoCardinal_def by auto
  moreover
  have "01" and "X-X=0" using lesspoll_succ_iff by auto
  then have "XCoCardinal(X,1)" using CoCardinal_def by auto
  ultimately show "{0, X}  CoCardinal(X,1) " by auto
qed

textThe topological subspaces of the CoCardinal(X,T)› topology
are also CoCardinal topologies.

lemma subspace_cocardinal:
  shows "CoCardinal(X,T) {restricted to} Y = CoCardinal(YX,T)"
proof
  {
    fix M
    assume "M  (CoCardinal(X,T) {restricted to} Y)"
    then obtain A where A1:"A  CoCardinal(X,T)" "M=Y  A" using RestrictedTo_def by auto
    then have "M  Pow(X  Y)" using CoCardinal_def by auto
    moreover
    from A1 have "(Y  X)-M = (Y  X)-A" using CoCardinal_def by auto
    with (Y  X)-M = (Y  X)-A have "(Y  X)-M X-A" by auto
    then have "(Y  X)-M  X-A" using subset_imp_lepoll by auto
    with A1 have "(Y  X)-M  T  M=0" using lesspoll_trans1 CoCardinal_def
      by auto
    ultimately have "M  CoCardinal(YX, T)" using CoCardinal_def
      by auto
  }
  then show "CoCardinal(X,T) {restricted to} Y  CoCardinal(YX,T)" by auto
  {
    fix M
    let ?A = "M  (X-Y)"
    assume A:"M  CoCardinal(Y  X,T)"
    {
      assume "M=0"
      hence "M=0  Y" by auto
      then have "MCoCardinal(X,T) {restricted to} Y" using RestrictedTo_def
        CoCardinal_def by auto
    }
    moreover
    {
      assume AS:"M0"
      from A AS have A1:"(MPow(Y  X)  (Y  X)-MT)" using CoCardinal_def by auto
      hence "?APow(X)" by blast
      moreover
      have "X-?A=(Y  X)-M" by blast
      with A1 have "X-?A T" by auto
      ultimately have "?ACoCardinal(X,T)" using CoCardinal_def by auto
      then have AT:"Y  ?ACoCardinal(X,T) {restricted to} Y" using RestrictedTo_def
        by auto
      have "Y  ?A=Y  M" by blast
      also from A1 have "=M" by auto
      finally have "Y  ?A=M" by simp
      with AT have "MCoCardinal(X,T) {restricted to} Y"
        by auto
    }
    ultimately have "MCoCardinal(X,T) {restricted to} Y" by auto
  }
  then show "CoCardinal(Y  X, T)  CoCardinal(X,T) {restricted to} Y" by auto
qed

subsectionExcluded Set Topology

textIn this section, we consider all the subsets of a set
which have empty intersection with a fixed set.

text The excluded set topology consists of subsets of $X$ that are disjoint with a fixed set $U$. 

definition "ExcludedSet(X,U)  {FPow(X). U  F=0} {X}"

textFor any set; we prove that
ExcludedSet(X,Q)› forms a topology.

theorem excludedset_is_topology:
  shows "ExcludedSet(X,Q) {is a topology}"
proof-
  {
    fix M
    assume "M  Pow(ExcludedSet(X,Q))"
    then have A:"M{FPow(X). Q  F=0} {X}" using ExcludedSet_def by auto
    hence "MPow(X)" by auto
    moreover
    {
      have B:"Q M={Q T. TM}" by auto
      {
        assume "XM"
        with A have "M{FPow(X). Q  F=0}" by auto
        with B have "Q  M=0" by auto
      }
      moreover
      {
        assume "XM"
        with A have "M=X" by auto
      }
      ultimately have  "Q  M=0  M=X" by auto
    }
    ultimately have "MExcludedSet(X,Q)" using ExcludedSet_def by auto
  }
  moreover
  {
    fix U V
    assume "UExcludedSet(X,Q)" "VExcludedSet(X,Q)"
    then have "UPow(X)""VPow(X)""U=X U  Q=0""V=X V  Q=0" using ExcludedSet_def by auto
    hence "UPow(X)""VPow(X)""(U  V)=X  Q(U  V)=0" by auto
    then have "(U  V)ExcludedSet(X,Q)" using ExcludedSet_def by auto
  }
  ultimately show ?thesis using IsATopology_def by auto
qed

textWe can use topology0›  when discussing excluded set topology. 

theorem topology0_excludedset:
  shows "topology0(ExcludedSet(X,T))"
  using topology0_def excludedset_is_topology by auto

textChoosing a singleton set, it is considered a point in excluded topology.

definition
  "ExcludedPoint(X,p)  ExcludedSet(X,{p})"

subsectionTotal set, closed sets, interior, closure and boundary

textHere we discuss what are closed sets, interior, closure and boundary in excluded set topology.

textThe topology is defined in the set $X$

lemma union_excludedset:
  shows "ExcludedSet(X,T) = X"
proof-
  have "X ExcludedSet(X,T)" using ExcludedSet_def by auto
  then show ?thesis using ExcludedSet_def by auto
qed

textThe closed sets are those which contain the set (X ∩ T)› and 0›.

lemma closed_sets_excludedset:
  shows "D {is closed in}ExcludedSet(X,T)  (DPow(X)  (X  T)  D)  D=0"
proof-
  {
    fix x
    assume A:"D  X" "X-D ExcludedSet(X,T)" "D0" "xT" "xX"
    from A(1) have B:"X-(X-D)=D" by auto
    from A(2) have "T(X-D)=0 X-D=X" using ExcludedSet_def by auto
    hence "T(X-D)=0 X-(X-D)=X-X" by auto
    with B have "T(X-D)=0 D=X-X" by auto
    hence "T(X-D)=0 D=0" by auto
    with A(3) have "T(X-D)=0" by auto
    with A(4) have "xX-D" by auto
    with A(5) have "xD" by auto
  }
  moreover
  {
    assume A:"XTD" "DX"
    from A(1) have "X-DX-(XT)" by auto
    also have " = X-T" by auto
    finally have "T(X-D) = 0" by auto
    moreover
    have "X-D  Pow(X)" by auto
    ultimately have "X-D ExcludedSet(X,T)" using ExcludedSet_def by auto
  }
  ultimately show ?thesis using IsClosed_def union_excludedset ExcludedSet_def 
    by auto
qed

textThe interior of a set is itself if it is X› or the difference with the set T›

lemma interior_set_excludedset:
  assumes "AX"
  shows "Interior(A,ExcludedSet(X,T)) = (if A=X then X else A-T)"
proof-
  {
    assume A:"AX"
    from assms have "A-T ExcludedSet(X,T)" using ExcludedSet_def by auto
    then have "A-TInterior(A,ExcludedSet(X,T))"
    using Interior_def by auto
    moreover
    {
      fix U
      assume "U ExcludedSet(X,T)" "UA"
      then have "TU=0  U=X""UA" using ExcludedSet_def by auto
      with A assms have "TU=0""UA" by auto
      then have "U-T=U""U-TA-T" by auto 
      then have "UA-T" by auto
    }
    then have "Interior(A,ExcludedSet(X,T))A-T" using Interior_def by auto
    ultimately have "Interior(A,ExcludedSet(X,T))=A-T" by auto
  }
  moreover
  have "XExcludedSet(X,T)" using ExcludedSet_def
  union_excludedset by auto
  then have "Interior(X,ExcludedSet(X,T)) = X" using topology0.Top_2_L3
  topology0_excludedset by auto
  ultimately show ?thesis by auto
qed

textThe closure of a set is itself if it is 0› or
the union with T›.

lemma closure_set_excludedset:
  assumes "AX"
  shows "Closure(A,ExcludedSet(X,T))=(if A=0 then 0 else A (X T))"
proof-
  have "0ClosedCovers(0,ExcludedSet(X,T))" using ClosedCovers_def
    closed_sets_excludedset by auto
  then have "Closure(0,ExcludedSet(X,T))0" using Closure_def by auto
  hence "Closure(0,ExcludedSet(X,T))=0" by blast
  moreover
  {
    assume A:"A0"
    with assms have "(A(XT)) {is closed in}ExcludedSet(X,T)" using closed_sets_excludedset  
      by blast
    then have "(A (X T)) {D  Pow(X). D {is closed in}ExcludedSet(X,T)  AD}"
    using assms by auto
    then have "(A (X T))ClosedCovers(A,ExcludedSet(X,T))" unfolding ClosedCovers_def
    using union_excludedset by auto
    then have l1:"ClosedCovers(A,ExcludedSet(X,T))  (A (X T))" by blast
    {
      fix U
      assume "UClosedCovers(A,ExcludedSet(X,T))"
      then have "U{is closed in}ExcludedSet(X,T)" and "AU" using ClosedCovers_def
       union_excludedset by auto
      then have "U=0(XT)U" and "AU" using closed_sets_excludedset
       by auto
      with A have "(XT)U""AU" by auto
      hence "(XT)AU" by auto
    }
    with assms have "(A (X T))  ClosedCovers(A,ExcludedSet(X,T))" 
      using topology0.Top_3_L3 topology0_excludedset union_excludedset 
      by auto
    with l1 have "ClosedCovers(A,ExcludedSet(X,T)) = (A(XT))" by auto
    then have "Closure(A, ExcludedSet(X,T)) = A(XT)" using Closure_def 
      by auto
  }
  ultimately show ?thesis by auto
qed

textThe boundary of a set is 0› if $A$ is X› or 0›, and X∩T› in other case. 

lemma boundary_excludedset:
  assumes "AX"
  shows "Boundary(A,ExcludedSet(X,T)) = (if A=0A=X then 0 else XT)"
proof-
  {
    have "Closure(0,ExcludedSet(X,T))=0""Closure(X - 0,ExcludedSet(X,T))=X"
    using closure_set_excludedset by auto
    then have "Boundary(0,ExcludedSet(X,T)) = 0"using Boundary_def using
      union_excludedset assms by auto
  }
  moreover
  {
    have "X-X=0" by blast
    then have "Closure(X,ExcludedSet(X,T)) = X" and "Closure(X-X,ExcludedSet(X,T)) = 0"
    using closure_set_excludedset by auto
    then have "Boundary(X,ExcludedSet(X,T)) = 0"unfolding Boundary_def using
      union_excludedset by auto
  }
  moreover
  {
    assume "A0" and "AX"
    then have "X-A0" using assms by auto 
    with assms A0 AX have "Closure(A,ExcludedSet(X,T)) = A  (XT)"
      using closure_set_excludedset by simp 
    moreover 
    from AX have "X-A  X" by blast
    with X-A0 have "Closure(X-A,ExcludedSet(X,T)) = (X-A)  (XT)"
      using closure_set_excludedset by simp
    ultimately have "Boundary(A,ExcludedSet(X,T)) = XT" 
      using Boundary_def union_excludedset by auto
  }
  ultimately show ?thesis by auto
qed

subsectionSpecial cases and subspaces

textThis section provides some miscellaneous facts about excluded set topologies. 

textThe excluded set topology is equal in the sets T› and X∩T›.

lemma smaller_excludedset:
  shows "ExcludedSet(X,T) = ExcludedSet(X,(XT))"
proof
  show "ExcludedSet(X,T)  ExcludedSet(X, XT)" and "ExcludedSet(X, XT) ExcludedSet(X,T)" 
    unfolding ExcludedSet_def by auto 
qed 

textIf the set which is excluded is disjoint with X›,
then the topology is discrete.

lemma empty_excludedset:
  assumes "TX=0"
  shows "ExcludedSet(X,T) = Pow(X)"
proof
  from assms show "ExcludedSet(X,T)  Pow(X)"  using smaller_excludedset ExcludedSet_def 
    by auto
  from assms show "Pow(X) ExcludedSet(X,T)" unfolding ExcludedSet_def by blast
qed

textThe topological subspaces of the ExcludedSet X T› topology
are also ExcludedSet topologies.

lemma subspace_excludedset:
  shows "ExcludedSet(X,T) {restricted to} Y = ExcludedSet(Y  X, T)"
proof
  {
    fix M
    assume "M(ExcludedSet(X,T) {restricted to} Y)"
    then obtain A where A1:"A:ExcludedSet(X,T)" "M=Y  A" unfolding RestrictedTo_def by auto
    then have "MPow(X  Y)" unfolding ExcludedSet_def by auto
    moreover
    from A1 have "TM=0M=YX" unfolding ExcludedSet_def by blast
    ultimately have "M  ExcludedSet(Y  X,T)" unfolding ExcludedSet_def
      by auto
  }
  then show "ExcludedSet(X,T) {restricted to} Y  ExcludedSet(YX,T)" by auto
  {
    fix M
    let ?A = "M   ((XY-T)-Y)"
    assume A:"M  ExcludedSet(YX,T)"
    {
      assume "M = Y  X"
      then have "M  ExcludedSet(X,T) {restricted to} Y" unfolding RestrictedTo_def
        ExcludedSet_def by auto
    }
    moreover
    {
      assume AS:"MY  X"
      from A AS have A1:"(MPow(Y  X)  TM=0)" unfolding ExcludedSet_def by auto
      then have "?APow(X)" by blast
      moreover
      have "T?A=TM" by blast
      with A1 have "T?A=0" by auto
      ultimately have "?A ExcludedSet(X,T)" unfolding ExcludedSet_def by auto
      then have AT:"Y  ?A ExcludedSet(X,T) {restricted to} Y" unfolding RestrictedTo_def
        by auto
      have "Y  ?A=Y  M" by blast
      also have "=M" using A1 by auto
      finally have "Y?A = M" by simp
      with AT have "M ExcludedSet(X,T) {restricted to} Y" by auto
    }
    ultimately have "M ExcludedSet(X,T) {restricted to} Y" by auto
  }
  then show "ExcludedSet(Y  X,T)  ExcludedSet(X,T) {restricted to} Y" by auto
qed

subsectionIncluded Set Topology

textIn this section we consider the subsets of a set which contain a fixed set.
The family defined in this section and the one in the previous section are
dual; meaning that the closed set of one are the open sets of the other.

text We define the included set topology as the collection of supersets of some fixed subset
  of the space $X$. 

definition 
  "IncludedSet(X,U)  {FPow(X). U  F}  {0}"

text In the next theorem we prove that IncludedSet X Q› forms a topology.

theorem includedset_is_topology:
  shows "IncludedSet(X,Q) {is a topology}"
proof-
  {
    fix M
    assume "M  Pow(IncludedSet(X,Q))"
    then have A:"M{FPow(X). Q  F} {0}" using IncludedSet_def by auto
    then have "MPow(X)" by auto
    moreover
    have"Q M M=0" using A by blast
    ultimately have "MIncludedSet(X,Q)" using IncludedSet_def by auto
  }
  moreover
  {
    fix U V
    assume "UIncludedSet(X,Q)" "VIncludedSet(X,Q)"
    then have "UPow(X)""VPow(X)""U=0 QU""V=0 QV" using IncludedSet_def by auto
    then have "UPow(X)""VPow(X)""(U  V)=0  Q(U  V)" by auto
    then have "(U  V)IncludedSet(X,Q)" using IncludedSet_def by auto
  }
  ultimately show ?thesis using IsATopology_def by auto
qed

text We can reference the theorems proven in the topology0› context when discussing
  the included set topology.

theorem topology0_includedset:
  shows "topology0(IncludedSet(X,T))"
  using topology0_def includedset_is_topology by auto

textChoosing a singleton set, it is considered a point excluded
  topology. In the following lemmas and theorems, when neccessary
  it will be considered that T≠0› and T⊆X›. 
  These cases will appear in the special cases section.

definition
  IncludedPoint ("IncludedPoint _ _" 90) where
  "IncludedPoint X p  IncludedSet(X,{p})"

subsectionBasic topological notions in included set topology

text This section discusses total set, closed sets, interior, closure and boundary 
  for included set topology. 

textThe topology is defined in the set $X$.

lemma union_includedset:
  assumes "TX "
  shows "IncludedSet(X,T) = X"
proof-
  from assms have "X  IncludedSet(X,T)" using IncludedSet_def by auto
  then show "IncludedSet(X,T) = X" using IncludedSet_def by auto
qed

textThe closed sets are those which are disjoint with T›
 and X›.

lemma closed_sets_includedset:
  assumes "TX"
  shows "D {is closed in} IncludedSet(X,T)  (DPow(X)   (D  T)=0) D=X"
proof-
  have "X-X=0" by blast
  then have "X-XIncludedSet(X,T)" using IncludedSet_def by auto
  moreover
  {
    assume A:"D  X" "X - D  IncludedSet(X,T) "" D  X"
    from A(2) have "T(X-D) X-D=0" using IncludedSet_def by auto
    with A(1) have "T(X-D) D=X" by blast 
    with A(3) have "T(X-D)" by auto
    hence "DT=0" by blast
  }
  moreover
  {
    assume A:"DT=0""DX"
    from A(1) assms have "T(X-D)" by blast
    then have "X-DIncludedSet(X,T)" using IncludedSet_def by auto
  }
  ultimately show ?thesis using IsClosed_def union_includedset assms by auto
qed

textThe interior of a set is itself if it is open or the empty set if it isn't.

lemma interior_set_includedset:
  assumes "AX"
  shows "Interior(A,IncludedSet(X,T))= (if TA then A else 0)"
proof-
  {
    fix x
    assume A:"Interior(A,IncludedSet(X,T))  0 ""xT"
    have "Interior(A,IncludedSet(X,T))  IncludedSet(X,T)" using
      topology0.Top_2_L2 topology0_includedset by auto
    with A(1) have "T  Interior(A,IncludedSet(X,T))" using IncludedSet_def
      by auto
    with A(2) have "x  Interior(A,IncludedSet(X,T))" by auto
    then have "xA" using topology0.Top_2_L1 topology0_includedset by auto}
    moreover
  {
    assume "TA"
    with assms have "AIncludedSet(X,T)" using IncludedSet_def by auto
    then have "Interior(A,IncludedSet(X,T)) = A" using topology0.Top_2_L3
      topology0_includedset by auto
  }
  ultimately show ?thesis by auto
qed

textThe closure of a set is itself if it is closed or the whole space if it is not.

lemma closure_set_includedset:
  assumes "AX" "TX"
  shows "Closure(A,IncludedSet(X,T)) = (if TA=0 then A else X)"
proof-
  {
    assume AS:"TA=0"
    then have "A {is closed in} IncludedSet(X,T)" using closed_sets_includedset
      assms by auto
    with assms(1) have "Closure(A,IncludedSet(X,T))=A" using topology0.Top_3_L8
      topology0_includedset union_includedset assms(2) by auto
  }
  moreover
  {
    assume AS:"TA  0"
    have "XClosedCovers(A,IncludedSet(X,T))" using ClosedCovers_def
      closed_sets_includedset union_includedset assms by auto
    then have l1:"ClosedCovers(A,IncludedSet(X,T))X" using Closure_def
      by auto
    moreover
    {
      fix U
      assume "UClosedCovers(A,IncludedSet(X,T))"  
      then have "U{is closed in}IncludedSet(X,T)""AU" using ClosedCovers_def
        by auto
      then have "U=X(TU)=0""AU" using closed_sets_includedset assms(2)
        by auto
      then have "U=X(TA)=0" by auto
      then have "U=X" using AS by auto
    }
    then have "X  ClosedCovers(A,IncludedSet(X,T))" using topology0.Top_3_L3
      topology0_includedset union_includedset assms by auto
    ultimately have "ClosedCovers(A,IncludedSet(X,T))=X" by auto
    then have "Closure(A,IncludedSet(X,T)) = X "
      using Closure_def by auto
  }
  ultimately show ?thesis by auto
qed

textThe boundary of a set is X-A› if $A$ contains T› completely, is A› if $X-A$ contains T›
  completely and X› if T› is divided between the two sets. 
  The case where T=0› is considered as a special case.

lemma boundary_includedset:
  assumes "AX" "TX" "T0"
  shows "Boundary(A,IncludedSet(X,T))=(if TA then X-A else (if TA=0 then A else X))"
proof -
  from AX have "X-A  X" by auto
  {
    assume "TA"
    with assms(2,3) have "TA0" and "T(X-A)=0" by auto
    with assms(1,2)  X-A  X  have
      "Closure(A,IncludedSet(X,T)) = X" and "Closure(X-A,IncludedSet(X,T)) = (X-A)"
      using closure_set_includedset by auto 
    with assms(2) have "Boundary(A,IncludedSet(X,T)) = X-A" 
      using Boundary_def union_includedset by auto
  }
  moreover
  {
    assume "~(TA)" and "TA=0"
    with assms(2) have "T(X-A)0" by auto 
    with assms(1,2) TA=0 X-A  X have
      "Closure(A,IncludedSet(X,T)) = A" and "Closure(X-A,IncludedSet(X,T)) = X"
      using  closure_set_includedset by auto
    with assms(1,2) have "Boundary(A,IncludedSet(X,T))=A" using Boundary_def union_includedset
      by auto
  }
  moreover
  {
    assume "~(TA)" and "TA  0"
    with assms(1,2) have "T(X-A)  0" by auto
    with assms(1,2) TA0  X-A  X have
      "Closure(A,IncludedSet(X,T)) = X" and "Closure(X-A,IncludedSet(X,T)) = X"
      using closure_set_includedset by auto 
    with assms(2) have "Boundary(A,IncludedSet(X,T)) = X" 
      using Boundary_def union_includedset  by auto
  }
  ultimately show ?thesis by auto
qed

subsectionSpecial cases and subspaces

text In this section we discuss  some corner cases 
  when some parameters in our definitions are empty and 
  provide some facts about subspaces in included set topologies. 

textThe topology is discrete if  T=0 ›

lemma smaller_includedset:
  shows "IncludedSet(X,0) = Pow(X)"
proof
  show "IncludedSet(X,0)  Pow(X)" and "Pow(X)  IncludedSet(X,0)"
    unfolding IncludedSet_def by auto
qed

textIf the set which is included is not a subset of X›,
then the topology is trivial.

lemma empty_includedset:
  assumes "~(TX)"
  shows "IncludedSet(X,T) = {0}"
proof
  from assms show "IncludedSet(X,T)  {0}" and "{0}  IncludedSet(X,T)"
    unfolding IncludedSet_def by auto
qed

textThe topological subspaces of the IncludedSet(X,T)› topology
are also IncludedSet topologies. The trivial case does not fit the idea
in the demonstration because if Y⊆X›  then IncludedSet(Y∩X, Y∩T)›
is never trivial. There is no need for a separate proof because
the only subspace of the trivial topology is itself.

lemma subspace_includedset:
  assumes "TX"
  shows "IncludedSet(X,T) {restricted to} Y = IncludedSet(YX,YT)"
proof
  {
    fix M
    assume "M  (IncludedSet(X,T) {restricted to} Y)"
    then obtain A where A1:"A:IncludedSet(X,T)" "M = YA" unfolding RestrictedTo_def 
      by auto
    then have "M  Pow(XY)" unfolding IncludedSet_def by auto
    moreover
    from A1 have "YTM  M=0" unfolding IncludedSet_def by blast
    ultimately have "M  IncludedSet(YX, YT)" unfolding IncludedSet_def
      by auto
  }
  then show "IncludedSet(X,T) {restricted to} Y  IncludedSet(YX, YT)" 
    by auto
  {
    fix M
    let ?A = "M  T"
    assume A:"M  IncludedSet(YX, YT)"
    {
      assume "M=0"
      then have "MIncludedSet(X,T) {restricted to} Y" unfolding RestrictedTo_def
        IncludedSet_def by auto
    }
    moreover
    {
      assume AS:"M0"
      from A AS have A1:"MPow(YX)  YTM" unfolding IncludedSet_def by auto
      then have "?APow(X)" using assms by blast
      moreover
      have "T?A" by blast
      ultimately have "?A  IncludedSet(X,T)" unfolding IncludedSet_def by auto
      then have AT:"Y  ?A  IncludedSet(X,T) {restricted to} Y"unfolding RestrictedTo_def
        by auto
      from A1 have "Y  ?A=Y  M" by blast
      also from A1 have "=M" by auto
      finally have "Y?A = M" by simp 
      with AT have "M  IncludedSet(X,T) {restricted to} Y"
        by auto
    }
    ultimately have "M  IncludedSet(X,T) {restricted to} Y" by auto
  }
  thus "IncludedSet(YX, YT)  IncludedSet(X,T) {restricted to} Y" by auto
qed

end