Theory Topology_ZF_9

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

    Copyright (C) 2013 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 9

theory Topology_ZF_9
imports Topology_ZF_2 Group_ZF_2 Topology_ZF_7 Topology_ZF_8
begin

subsectionGroup of homeomorphisms
textThis theory file deals with the fact the set homeomorphisms of a topological space into itself
 forms a group.

textFirst, we define the set of homeomorphisms.

definition
  "HomeoG(T)  {f:TT. IsAhomeomorphism(T,T,f)}"

textThe homeomorphisms are closed by composition.

lemma (in topology0) homeo_composition:
  assumes "fHomeoG(T)""gHomeoG(T)"
  shows "Composition(T)`f, gHomeoG(T)"
proof-
  from assms have fun:"fTT""gTT" and homeo:"IsAhomeomorphism(T,T,f)""IsAhomeomorphism(T,T,g)" unfolding HomeoG_def
    by auto
  from fun have "f O gTT" using comp_fun by auto moreover
  from homeo have bij:"fbij(T,T)""gbij(T,T)" and cont:"IsContinuous(T,T,f)""IsContinuous(T,T,g)" and contconv:
    "IsContinuous(T,T,converse(f))""IsContinuous(T,T,converse(g))" unfolding IsAhomeomorphism_def by auto
  from bij have "f O gbij(T,T)" using comp_bij by auto moreover
  from cont have "IsContinuous(T,T,f O g)" using comp_cont by auto moreover
  have "converse(f O g)=converse(g) O converse(f)" using converse_comp by auto
  with contconv have "IsContinuous(T,T,converse(f O g))" using comp_cont by auto ultimately
  have "f O gHomeoG(T)" unfolding HomeoG_def IsAhomeomorphism_def by auto
  then show ?thesis using func_ZF_5_L2 fun by auto
qed

textThe identity function is a homeomorphism.

lemma (in topology0) homeo_id:
  shows "id(T)HomeoG(T)"
proof-
  have "converse(id(T)) O id(T)=id(T)" using left_comp_inverse id_bij by auto
  then have "converse(id(T))=id(T)" using right_comp_id by auto
  then show ?thesis unfolding HomeoG_def IsAhomeomorphism_def using id_cont id_type id_bij
    by auto
qed

textThe homeomorphisms form a monoid and its neutral element is the identity.

theorem (in topology0) homeo_submonoid:
  shows "IsAmonoid(HomeoG(T),restrict(Composition(T),HomeoG(T)×HomeoG(T)))" 
  "TheNeutralElement(HomeoG(T),restrict(Composition(T),HomeoG(T)×HomeoG(T)))=id(T)"
proof-
  have cl:"HomeoG(T) {is closed under} Composition(T)" unfolding IsOpClosed_def using homeo_composition by auto
  moreover have sub:"HomeoG(T)TT" unfolding HomeoG_def by auto moreover
  have ne:"TheNeutralElement(TT, Composition(T))HomeoG(T)" using homeo_id Group_ZF_2_5_L2(2) by auto
  ultimately show "IsAmonoid(HomeoG(T),restrict(Composition(T),HomeoG(T)×HomeoG(T)))" using Group_ZF_2_5_L2(1)
    monoid0.group0_1_T1 unfolding monoid0_def by force
  from cl sub ne have "TheNeutralElement(HomeoG(T),restrict(Composition(T),HomeoG(T)×HomeoG(T)))=TheNeutralElement(TT, Composition(T))" 
    using Group_ZF_2_5_L2(1) group0_1_L6 by blast moreover
  have "id(T)=TheNeutralElement(TT, Composition(T))" using Group_ZF_2_5_L2(2) by auto
  ultimately show "TheNeutralElement(HomeoG(T),restrict(Composition(T),HomeoG(T)×HomeoG(T)))=id(T)" by auto
qed

textThe homeomorphisms form a group, with the composition.

theorem(in topology0) homeo_group:
  shows "IsAgroup(HomeoG(T),restrict(Composition(T),HomeoG(T)×HomeoG(T)))"
proof-
  {
    fix x assume AS:"xHomeoG(T)"
    then have surj:"xsurj(T,T)" and bij:"xbij(T,T)" unfolding HomeoG_def IsAhomeomorphism_def bij_def by auto
    from bij have "converse(x)bij(T,T)" using bij_converse_bij by auto
    with bij have conx_fun:"converse(x)TT""xTT" unfolding bij_def inj_def by auto
    from surj have id:"x O converse(x)=id(T)" using right_comp_inverse by auto
    from conx_fun have "Composition(T)`x,converse(x)=x O converse(x)" using func_ZF_5_L2 by auto
    with id have "Composition(T)`x,converse(x)=id(T)" by auto
    moreover have "converse(x)HomeoG(T)" unfolding HomeoG_def using conx_fun(1) homeo_inv AS unfolding HomeoG_def
      by auto
    ultimately have "MHomeoG(T). Composition(T)`x,M=id(T)" by auto
  }
  then have "xHomeoG(T). MHomeoG(T). Composition(T)`x,M=id(T)" by auto
  then show ?thesis using homeo_submonoid definition_of_group by auto
qed

subsectionExamples computed

textAs a first example, we show that the group of homeomorphisms of the cocardinal
topology is the group of bijective functions.

theorem homeo_cocardinal:
  assumes "InfCard(Q)"
  shows "HomeoG(CoCardinal(X,Q))=bij(X,X)"
proof
  from assms have n:"Q0" unfolding InfCard_def by auto
  then show "HomeoG(CoCardinal(X,Q))  bij(X, X)" unfolding HomeoG_def IsAhomeomorphism_def
    using union_cocardinal by auto
  {
    fix f assume a:"fbij(X,X)"
    then have "converse(f)bij(X,X)" using bij_converse_bij by auto
    then have cinj:"converse(f)inj(X,X)" unfolding bij_def by auto
    from a have fun:"fXX" unfolding bij_def inj_def by auto
    then have two:"two_top_spaces0((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)" unfolding two_top_spaces0_def
      using union_cocardinal assms n CoCar_is_topology by auto
    {
      fix N assume "N{is closed in}(CoCardinal(X,Q))"
      then have N_def:"N=X  (NPow(X)  NQ)" using closed_sets_cocardinal n by auto
      then have "restrict(converse(f),N)bij(N,converse(f)``N)" using cinj restrict_bij by auto
      then have "Nf-``N" unfolding vimage_def eqpoll_def by auto
      then have "f-``NN" using eqpoll_sym by auto
      with N_def have "N=X  (f-``NQ  NPow(X))" using eq_lesspoll_trans by auto
      with fun have "f-``N=X  (f-``NQ  (f-``N)Pow(X))" using func1_1_L3 func1_1_L4 by auto
      then have "f-``N {is closed in}(CoCardinal(X,Q))" using closed_sets_cocardinal n by auto
    }
    then have "N. N{is closed in}(CoCardinal(X,Q))  f-``N {is closed in}(CoCardinal(X,Q))" by auto
    then have "IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)" using two_top_spaces0.Top_ZF_2_1_L4 
      two_top_spaces0.Top_ZF_2_1_L3 two_top_spaces0.Top_ZF_2_1_L2 two by auto
  }
  then have "fbij(X,X). IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)" by auto
  then have "fbij(X,X). IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)  IsContinuous((CoCardinal(X,Q)),(CoCardinal(X,Q)),converse(f))"
    using bij_converse_bij by auto
  then have "fbij(X,X). IsAhomeomorphism((CoCardinal(X,Q)),(CoCardinal(X,Q)),f)" unfolding IsAhomeomorphism_def
    using n union_cocardinal by auto
  then show "bij(X,X)HomeoG((CoCardinal(X,Q)))" unfolding HomeoG_def bij_def inj_def using n union_cocardinal
    by auto
qed

textThe group of homeomorphism of the excluded set is a direct product of the bijections on $X\setminus T$
  and the bijections on $X\cap T$.

theorem homeo_excluded:
  shows "HomeoG(ExcludedSet(X,T))={fbij(X,X). f``(X-T)=(X-T)}"
proof
  have sub1:"X-TX" by auto
  {
    fix g assume "gHomeoG(ExcludedSet(X,T))"
    then have fun:"g:XX" and bij:"gbij(X,X)" and hom:"IsAhomeomorphism((ExcludedSet(X,T)),(ExcludedSet(X,T)),g)" unfolding HomeoG_def
      using union_excludedset unfolding IsAhomeomorphism_def by auto
    {
      assume A:"g``(X-T)=X" and B:"XT0"
      have rfun:"restrict(g,X-T):X-TX" using fun restrict_fun sub1 by auto moreover
      from A fun have "{g`aa. aaX-T}=X" using func_imagedef sub1 by auto
      then have "xX. x{g`aa. aaX-T}" by auto
      then have "xX. aaX-T. x=g`aa" by auto
      then have "xX. aaX-T. x=restrict(g,X-T)`aa" by auto
      with A have surj:"restrict(g,X-T)surj(X-T,X)" using rfun unfolding surj_def by auto
      from B obtain d where "dX""dT" by auto
      with bij have "g`dX" using apply_funtype unfolding bij_def inj_def by auto
      then obtain s where "restrict(g,X-T)`s=g`d""sX-T" using surj unfolding surj_def by blast
      then have "g`s=g`d" by auto
      with dXsX-T have "s=d" using bij unfolding bij_def inj_def by auto
      then have "False" using sX-T dT by auto
    }
    then have "g``(X-T)=X  XT=0" by auto
    then have reg:"g``(X-T)=X  X-T=X" by auto
    then have "g``(X-T)=X  g``(X-T)=X-T" by auto
    then have "g``(X-T)=X  g{fbij(X,X). f``(X-T)=(X-T)}" using bij by auto moreover
    {
      fix gg
      assume A:"gg``(X-T)X" and hom2:"IsAhomeomorphism((ExcludedSet(X,T)),(ExcludedSet(X,T)),gg)"
      from hom2 have fun:"ggXX" and bij:"ggbij(X,X)" unfolding IsAhomeomorphism_def bij_def inj_def using union_excludedset by auto
      have sub:"X-T(ExcludedSet(X,T))" using union_excludedset by auto
      with hom2 have "gg``(Interior(X-T,(ExcludedSet(X,T))))=Interior(gg``(X-T),(ExcludedSet(X,T)))"
        using int_top_invariant by auto moreover
      from sub1 have "Interior(X-T,(ExcludedSet(X,T)))=X-T" using interior_set_excludedset by auto
      ultimately have "gg``(X-T)=Interior(gg``(X-T),(ExcludedSet(X,T)))" by auto moreover
      have ss:"gg``(X-T)X" using fun func1_1_L6(2) by auto
      then have "Interior(gg``(X-T),(ExcludedSet(X,T))) = (gg``(X-T))-T" using interior_set_excludedset A
        by auto
      ultimately have eq:"gg``(X-T)=(gg``(X-T))-T" by auto
      {
        assume "(gg``(X-T))T0"
        then obtain t where "tT" and im:"tgg``(X-T)" by blast
        then have "t(gg``(X-T))-T" by auto
        then have "False" using eq im by auto 
      }
      then have "(gg``(X-T))T=0" by auto
      then have "gg``(X-T)X-T" using ss by blast
    }
    then have "gg. gg``(X-T)X  IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),gg) gg``(X-T)X-T" by auto moreover
    from bij have conbij:"converse(g)bij(X,X)" using bij_converse_bij by auto
    then have confun:"converse(g)XX" unfolding bij_def inj_def by auto
    {
      assume A:"converse(g)``(X-T)=X" and B:"XT0"
      have rfun:"restrict(converse(g),X-T):X-TX" using confun restrict_fun sub1 by auto moreover
      from A confun have "{converse(g)`aa. aaX-T}=X" using func_imagedef sub1 by auto
      then have "xX. x{converse(g)`aa. aaX-T}" by auto
      then have "xX. aaX-T. x=converse(g)`aa" by auto
      then have "xX. aaX-T. x=restrict(converse(g),X-T)`aa" by auto
      with A have surj:"restrict(converse(g),X-T)surj(X-T,X)" using rfun unfolding surj_def by auto
      from B obtain d where "dX""dT" by auto
      with conbij have "converse(g)`dX" using apply_funtype unfolding bij_def inj_def by auto
      then obtain s where "restrict(converse(g),X-T)`s=converse(g)`d""sX-T" using surj unfolding surj_def by blast
      then have "converse(g)`s=converse(g)`d" by auto
      with dXsX-T have "s=d" using conbij unfolding bij_def inj_def by auto
      then have "False" using sX-T dT by auto
    }
    then have "converse(g)``(X-T)=X  XT=0" by auto
    then have "converse(g)``(X-T)=X  X-T=X" by auto
    then have "converse(g)``(X-T)=X  g-``(X-T)=(X-T)" unfolding vimage_def by auto
    then have G:"converse(g)``(X-T)=X  g``(g-``(X-T))=g``(X-T)" by auto
    have GG:"g``(g-``(X-T))=(X-T)" using sub1 surj_image_vimage bij unfolding bij_def by auto
    with G have "converse(g)``(X-T)=X  g``(X-T)=X-T" by auto
    then have "converse(g)``(X-T)=X  g{fbij(X,X). f``(X-T)=(X-T)}" using bij by auto moreover
    from hom have "IsAhomeomorphism(ExcludedSet(X,T), ExcludedSet(X,T), converse(g))" using homeo_inv by auto
    moreover note hom ultimately have "g{fbij(X,X). f``(X-T)=(X-T)}  (g``(X-T)X-T  converse(g)``(X-T)X-T)"
      by force
    then have "g{fbij(X,X). f``(X-T)=(X-T)}  (g``(X-T)X-T  g-``(X-T)X-T)" unfolding vimage_def by auto moreover
    have "g-``(X-T)X-T  g``(g-``(X-T))g``(X-T)" using func1_1_L8 by auto
    with GG have "g-``(X-T)X-T  (X-T)g``(X-T)" by force
    ultimately have "g{fbij(X,X). f``(X-T)=(X-T)}  (g``(X-T)X-T  (X-T)g``(X-T))" by auto
    then have "g{fbij(X,X). f``(X-T)=(X-T)}" using bij by auto
  }
  then show "HomeoG(ExcludedSet(X,T)){fbij(X,X). f``(X-T)=(X-T)}" by auto
  {
    fix g assume as:"gbij(X,X)""g``(X-T)=X-T"
    then have inj:"ginj(X,X)" and im:"g-``(g``(X-T))=g-``(X-T)" unfolding bij_def by auto
    from inj have "g-``(g``(X-T))=X-T" using inj_vimage_image sub1 by force
    with im have as_3:"g-``(X-T)=X-T" by auto
    {
      fix A
      assume "A(ExcludedSet(X,T))"
      then have "A=XAT=0" "AX" unfolding ExcludedSet_def by auto
      then have "AX-TA=X" by auto moreover
      {
        assume "A=X"
        with as(1) have "g``A=X" using surj_range_image_domain unfolding bij_def by auto
      }
      moreover
      {
        assume "AX-T"
        then have "g``Ag``(X-T)" using func1_1_L8 by auto
        then have "g``A(X-T)" using as(2)  by auto
      }
      ultimately have "g``A(X-T)  g``A=X" by auto
      then have "g``A(ExcludedSet(X,T))" unfolding ExcludedSet_def by auto
    }
    then have "A(ExcludedSet(X,T)). g``A(ExcludedSet(X,T))" by auto moreover
    {
      fix A assume "A(ExcludedSet(X,T))"
      then have "A=XAT=0" "AX" unfolding ExcludedSet_def by auto
      then have "AX-TA=X" by auto moreover
      {
        assume "A=X"
        with as(1) have "g-``A=X" using func1_1_L4 unfolding bij_def inj_def by auto
      }
      moreover
      {
        assume "AX-T"
        then have "g-``Ag-``(X-T)" using func1_1_L8 by auto
        then have "g-``A(X-T)" using as_3 by auto
      }
      ultimately have "g-``A(X-T)  g-``A=X" by auto
      then have "g-``A(ExcludedSet(X,T))" unfolding ExcludedSet_def by auto
    }
    then have "IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),g)" unfolding IsContinuous_def by auto moreover
    note as(1) ultimately have "IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),g)" 
      using union_excludedset bij_cont_open_homeo by auto
    with as(1) have "gHomeoG(ExcludedSet(X,T))" unfolding bij_def inj_def HomeoG_def using union_excludedset by auto
  }
  then show "{f  bij(X, X) . f `` (X - T) = X - T}  HomeoG(ExcludedSet(X,T))" by auto
qed

textWe now give some lemmas that will help us compute HomeoG(IncludedSet(X,T))›.

lemma cont_in_cont_ex:
  assumes "IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f)" "f:XX" "TX"
  shows "IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f)"
proof-
  from assms(2,3) have two:"two_top_spaces0(IncludedSet(X,T),IncludedSet(X,T),f)" using union_includedset includedset_is_topology 
    unfolding two_top_spaces0_def by auto
  {
    fix A assume "A(ExcludedSet(X,T))"
    then have "AT=0  A=X""AX" unfolding ExcludedSet_def by auto
    then have "A{is closed in}(IncludedSet(X,T))" using closed_sets_includedset assms by auto
    then have "f-``A{is closed in}(IncludedSet(X,T))" using two_top_spaces0.TopZF_2_1_L1 assms(1)
      two assms includedset_is_topology by auto
    then have "(f-``A)T=0  f-``A=X""f-``AX" using closed_sets_includedset assms(1,3) by auto
    then have "f-``A(ExcludedSet(X,T))" unfolding ExcludedSet_def by auto
  }
  then show "IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f)" unfolding IsContinuous_def by auto
qed

lemma cont_ex_cont_in:
  assumes "IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f)" "f:XX" "TX"
  shows "IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f)"
proof-
  from assms(2) have two:"two_top_spaces0(ExcludedSet(X,T),ExcludedSet(X,T),f)" using union_excludedset excludedset_is_topology 
    unfolding two_top_spaces0_def by auto
  {
    fix A assume "A(IncludedSet(X,T))"
    then have "TA  A=0""AX" unfolding IncludedSet_def by auto
    then have "A{is closed in}(ExcludedSet(X,T))" using closed_sets_excludedset assms by auto
    then have "f-``A{is closed in}(ExcludedSet(X,T))" using two_top_spaces0.TopZF_2_1_L1 assms(1)
      two assms excludedset_is_topology by auto
    then have "T(f-``A)  f-``A=0""f-``AX" using closed_sets_excludedset assms(1,3) by auto
    then have "f-``A(IncludedSet(X,T))" unfolding IncludedSet_def by auto
  }
  then show "IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f)" unfolding IsContinuous_def by auto
qed

textThe previous lemmas imply that the group of homeomorphisms of the included set topology
is the same as the one of the excluded set topology.

lemma homeo_included:
  assumes "TX"
  shows "HomeoG(IncludedSet(X,T))={f  bij(X, X) . f `` (X - T) = X - T}"
proof-
  {
    fix f assume "fHomeoG(IncludedSet(X,T))"
    then have hom:"IsAhomeomorphism(IncludedSet(X,T),IncludedSet(X,T),f)" and fun:"fXX" and
      bij:"fbij(X,X)" unfolding HomeoG_def IsAhomeomorphism_def using union_includedset assms by auto
    then have cont:"IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f)" unfolding IsAhomeomorphism_def by auto
    then have "IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f)" using cont_in_cont_ex fun assms by auto moreover
    {
      from hom have cont1:"IsContinuous(IncludedSet(X,T),IncludedSet(X,T),converse(f))" unfolding IsAhomeomorphism_def by auto moreover
      have "converse(f):XX" using bij_converse_bij bij unfolding bij_def inj_def by auto moreover
      note assms ultimately 
      have "IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),converse(f))" using cont_in_cont_ex assms by auto
    }
    then have "IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),converse(f))" by auto
    moreover note bij ultimately
    have "IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),f)" unfolding IsAhomeomorphism_def
      using union_excludedset by auto
    with fun have "fHomeoG(ExcludedSet(X,T))" unfolding HomeoG_def using union_excludedset by auto
  }
  then have "HomeoG(IncludedSet(X,T))HomeoG(ExcludedSet(X,T))" by auto moreover
  {
    fix f assume "fHomeoG(ExcludedSet(X,T))"
    then have hom:"IsAhomeomorphism(ExcludedSet(X,T),ExcludedSet(X,T),f)" and fun:"fXX" and
      bij:"fbij(X,X)" unfolding HomeoG_def IsAhomeomorphism_def using union_excludedset assms by auto
    then have cont:"IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),f)" unfolding IsAhomeomorphism_def by auto
    then have "IsContinuous(IncludedSet(X,T),IncludedSet(X,T),f)" using cont_ex_cont_in fun assms by auto moreover
    {
      from hom have cont1:"IsContinuous(ExcludedSet(X,T),ExcludedSet(X,T),converse(f))" unfolding IsAhomeomorphism_def by auto moreover
      have "converse(f):XX" using bij_converse_bij bij unfolding bij_def inj_def by auto moreover
      note assms ultimately 
      have "IsContinuous(IncludedSet(X,T),IncludedSet(X,T),converse(f))" using cont_ex_cont_in assms by auto
    }
    then have "IsContinuous(IncludedSet(X,T),IncludedSet(X,T),converse(f))" by auto
    moreover note bij ultimately
    have "IsAhomeomorphism(IncludedSet(X,T),IncludedSet(X,T),f)" unfolding IsAhomeomorphism_def
      using union_includedset assms by auto
    with fun have "fHomeoG(IncludedSet(X,T))" unfolding HomeoG_def using union_includedset assms by auto
  }
  then have "HomeoG(ExcludedSet(X,T))HomeoG(IncludedSet(X,T))" by auto ultimately
  show ?thesis using homeo_excluded by auto
qed

textFinally, let's compute part of the group of homeomorphisms of an order topology.

lemma homeo_order:
  assumes "IsLinOrder(X,r)""x y. xyxXyX"
  shows "ord_iso(X,r,X,r)HomeoG(OrdTopology X r)"
proof
  fix f assume "ford_iso(X,r,X,r)"
  then have bij:"fbij(X,X)" and ord:"xX. yX. x, y  r  f ` x, f ` y  r"
    unfolding ord_iso_def by auto
  have twoSpac:"two_top_spaces0(OrdTopology X r,OrdTopology X r,f)" unfolding two_top_spaces0_def
    using bij unfolding bij_def inj_def using union_ordtopology[OF assms] Ordtopology_is_a_topology(1)[OF assms(1)]
    by auto
  {
    fix c d assume A:"cX""dX"
    {
      fix x assume AA:"xX""xc""xd""c,xr""x,dr"
      then have "f`c,f`xr""f`x,f`dr" using A(2,1) ord by auto moreover
      {
        assume "f`x=f`c  f`x=f`d"
        then have "x=cx=d" using bij unfolding bij_def inj_def using A(2,1) AA(1) by auto
        then have "False" using AA(2,3) by auto
      }
      then have "f`xf`c""f`xf`d" by auto moreover
      have "f`xX" using bij unfolding bij_def inj_def using apply_type AA(1) by auto
      ultimately have "f`xIntervalX(X,r,f`c,f`d)" unfolding IntervalX_def Interval_def by auto
    }
    then have "{f`x. xIntervalX(X,r,c,d)}IntervalX(X,r,f`c,f`d)" unfolding IntervalX_def Interval_def by auto
    moreover
    {
      fix y assume "yIntervalX(X,r,f`c,f`d)"
      then have y:"yX""yf`c""yf`d""f`c,yr""y,f`dr" unfolding IntervalX_def Interval_def by auto
      then obtain s where s:"sX""y=f`s" using bij unfolding bij_def surj_def by auto
      {
        assume "s=cs=d"
        then have "f`s=f`cf`s=f`d" by auto
        then have "False" using s(2) y(2,3) by auto
      }
      then have "sc""sd" by auto moreover
      have "c,sr""s,dr" using y(4,5) s ord A(2,1) by auto moreover
      note s(1) ultimately have "sIntervalX(X,r,c,d)" unfolding IntervalX_def Interval_def by auto
      then have "y{f`x. xIntervalX(X,r,c,d)}" using s(2) by auto
    }
    ultimately have "{f`x. xIntervalX(X,r,c,d)}=IntervalX(X,r,f`c,f`d)" by auto moreover
    have "IntervalX(X,r,c,d)X" unfolding IntervalX_def by auto moreover
    have "f:XX" using bij unfolding bij_def surj_def by auto ultimately
    have "f``IntervalX(X,r,c,d)=IntervalX(X,r,f`c,f`d)" using func_imagedef by auto
  }
  then have inter:"cX. dX. f``IntervalX(X,r,c,d)=IntervalX(X,r,f`c,f`d)  f`cX  f`dX" using bij 
    unfolding bij_def inj_def by auto
  {
    fix c assume A:"cX"
    {
      fix x assume AA:"xX""xc""c,xr"
      then have "f`c,f`xr" using A ord by auto moreover
      {
        assume "f`x=f`c"
        then have "x=c" using bij unfolding bij_def inj_def using A AA(1) by auto
        then have "False" using AA(2) by auto
      }
      then have "f`xf`c" by auto moreover
      have "f`xX" using bij unfolding bij_def inj_def using apply_type AA(1) by auto
      ultimately have "f`xRightRayX(X,r,f`c)" unfolding RightRayX_def by auto
    }
    then have "{f`x. xRightRayX(X,r,c)}RightRayX(X,r,f`c)" unfolding RightRayX_def by auto
    moreover
    {
      fix y assume "yRightRayX(X,r,f`c)"
      then have y:"yX""yf`c""f`c,yr" unfolding RightRayX_def by auto
      then obtain s where s:"sX""y=f`s" using bij unfolding bij_def surj_def by auto
      {
        assume "s=c"
        then have "f`s=f`c" by auto
        then have "False" using s(2) y(2) by auto
      }
      then have "sc" by auto moreover
      have "c,sr" using y(3) s ord A by auto moreover
      note s(1) ultimately have "sRightRayX(X,r,c)" unfolding RightRayX_def by auto
      then have "y{f`x. xRightRayX(X,r,c)}" using s(2) by auto
    }
    ultimately have "{f`x. xRightRayX(X,r,c)}=RightRayX(X,r,f`c)" by auto moreover
    have "RightRayX(X,r,c)X" unfolding RightRayX_def by auto moreover
    have "f:XX" using bij unfolding bij_def surj_def by auto ultimately
    have "f``RightRayX(X,r,c)=RightRayX(X,r,f`c)" using func_imagedef by auto
  }
  then have rray:"cX. f``RightRayX(X,r,c)=RightRayX(X,r,f`c)  f`cX" using bij 
    unfolding bij_def inj_def by auto
  {
    fix c assume A:"cX"
    {
      fix x assume AA:"xX""xc""x,cr"
      then have "f`x,f`cr" using A ord by auto moreover
      {
        assume "f`x=f`c"
        then have "x=c" using bij unfolding bij_def inj_def using A AA(1) by auto
        then have "False" using AA(2) by auto
      }
      then have "f`xf`c" by auto moreover
      have "f`xX" using bij unfolding bij_def inj_def using apply_type AA(1) by auto
      ultimately have "f`xLeftRayX(X,r,f`c)" unfolding LeftRayX_def by auto
    }
    then have "{f`x. xLeftRayX(X,r,c)}LeftRayX(X,r,f`c)" unfolding LeftRayX_def by auto
    moreover
    {
      fix y assume "yLeftRayX(X,r,f`c)"
      then have y:"yX""yf`c""y,f`cr" unfolding LeftRayX_def by auto
      then obtain s where s:"sX""y=f`s" using bij unfolding bij_def surj_def by auto
      {
        assume "s=c"
        then have "f`s=f`c" by auto
        then have "False" using s(2) y(2) by auto
      }
      then have "sc" by auto moreover
      have "s,cr" using y(3) s ord A by auto moreover
      note s(1) ultimately have "sLeftRayX(X,r,c)" unfolding LeftRayX_def by auto
      then have "y{f`x. xLeftRayX(X,r,c)}" using s(2) by auto
    }
    ultimately have "{f`x. xLeftRayX(X,r,c)}=LeftRayX(X,r,f`c)" by auto moreover
    have "LeftRayX(X,r,c)X" unfolding LeftRayX_def by auto moreover
    have "f:XX" using bij unfolding bij_def surj_def by auto ultimately
    have "f``LeftRayX(X,r,c)=LeftRayX(X,r,f`c)" using func_imagedef by auto
  }
  then have lray:"cX. f``LeftRayX(X,r,c)=LeftRayX(X,r,f`c)f`cX" using bij 
    unfolding bij_def inj_def by auto
  have r1:"U{IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X} 
    {RightRayX(X, r, b) . b  X}. f``U({IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X} 
    {RightRayX(X, r, b) . b  X})" apply safe prefer 3 using rray apply blast prefer 2 using lray apply blast
    using inter apply auto
    proof-
     fix xa y assume "xaX""yX"
     then have "f`xaX""f`yX" using bij unfolding bij_def inj_def by auto
     then show "xX. yaX. IntervalX(X, r, f ` xa, f ` y) = IntervalX(X, r, x, ya)" by auto
    qed
  have r2:"{IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X}  {RightRayX(X, r, b) . b  X}(OrdTopology X r)"
    using base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] by blast
  {
    fix U assume "U{IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X}  {RightRayX(X, r, b) . b  X}"
    with r1 have "f``U{IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X}  {RightRayX(X, r, b) . b  X}"
      by auto
    with r2 have "f``U(OrdTopology X r)" by blast
  }
  then have "U{IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X} 
    {RightRayX(X, r, b) . b  X}. f``U(OrdTopology X r)" by blast
  then have f_open:"U(OrdTopology X r). f``U(OrdTopology X r)" using two_top_spaces0.base_image_open[OF twoSpac Ordtopology_is_a_topology(2)[OF assms(1)]]
    by auto
  {
    fix c d assume A:"cX""dX"
    then obtain cc dd where pre:"f`cc=c""f`dd=d""ccX""ddX" using bij unfolding bij_def surj_def by blast
    with inter have "f `` IntervalX(X, r, cc, dd) = IntervalX(X, r,  c,  d)" by auto
    then have "f-``(f``IntervalX(X, r, cc, dd)) = f-``(IntervalX(X, r,  c,  d))" by auto 
    moreover
    have "IntervalX(X, r, cc, dd)X" unfolding IntervalX_def by auto moreover
    have "finj(X,X)" using bij unfolding bij_def by auto ultimately
    have "IntervalX(X, r, cc, dd)=f-``IntervalX(X, r,  c,  d)" using inj_vimage_image by auto
    moreover
    from pre(3,4) have "IntervalX(X, r, cc, dd){IntervalX(X,r,e1,e2). e1,e2X×X}" by auto
    ultimately have "f-``IntervalX(X, r,  c,  d)(OrdTopology X r)" using
      base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] by auto
  }
  then have inter:"cX. dX. f-``IntervalX(X, r,  c,  d)(OrdTopology X r)" by auto
  {
    fix c assume A:"cX"
    then obtain cc where pre:"f`cc=c""ccX" using bij unfolding bij_def surj_def by blast
    with rray have "f `` RightRayX(X, r, cc) = RightRayX(X, r,  c)" by auto
    then have "f-``(f``RightRayX(X, r, cc)) = f-``(RightRayX(X, r,  c))" by auto 
    moreover
    have "RightRayX(X, r, cc)X" unfolding RightRayX_def by auto moreover
    have "finj(X,X)" using bij unfolding bij_def by auto ultimately
    have "RightRayX(X, r, cc)=f-``RightRayX(X, r,  c)" using inj_vimage_image by auto
    moreover
    from pre(2) have "RightRayX(X, r, cc){RightRayX(X,r,e2). e2X}" by auto
    ultimately have "f-``RightRayX(X, r,  c)(OrdTopology X r)" using
      base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] by auto
  }
  then have rray:"cX. f-``RightRayX(X, r,  c)(OrdTopology X r)" by auto
  {
    fix c assume A:"cX"
    then obtain cc where pre:"f`cc=c""ccX" using bij unfolding bij_def surj_def by blast
    with lray have "f `` LeftRayX(X, r, cc) = LeftRayX(X, r,  c)" by auto
    then have "f-``(f``LeftRayX(X, r, cc)) = f-``(LeftRayX(X, r,  c))" by auto 
    moreover
    have "LeftRayX(X, r, cc)X" unfolding LeftRayX_def by auto moreover
    have "finj(X,X)" using bij unfolding bij_def by auto ultimately
    have "LeftRayX(X, r, cc)=f-``LeftRayX(X, r,  c)" using inj_vimage_image by auto
    moreover
    from pre(2) have "LeftRayX(X, r, cc){LeftRayX(X,r,e2). e2X}" by auto
    ultimately have "f-``LeftRayX(X, r,  c)(OrdTopology X r)" using
      base_sets_open[OF Ordtopology_is_a_topology(2)[OF assms(1)]] by auto
  }
  then have lray:"cX. f-``LeftRayX(X, r,  c)(OrdTopology X r)" by auto
  {
    fix U assume "U{IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X}  {RightRayX(X, r, b) . b  X}"
    with lray inter rray have "f-``U(OrdTopology X r)" by auto
  }
  then have "U{IntervalX(X, r, b, c) . b,c  X × X}  {LeftRayX(X, r, b) . b  X}  {RightRayX(X, r, b) . b  X}.
    f-``U(OrdTopology X r)" by blast
  then have fcont:"IsContinuous(OrdTopology X r,OrdTopology X r,f)" using two_top_spaces0.Top_ZF_2_1_L5[OF twoSpac
    Ordtopology_is_a_topology(2)[OF assms(1)]] by auto
  from fcont f_open bij have "IsAhomeomorphism(OrdTopology X r,OrdTopology X r,f)" using bij_cont_open_homeo
    union_ordtopology[OF assms] by auto
  then show "fHomeoG(OrdTopology X r)" unfolding HomeoG_def using bij union_ordtopology[OF assms]
    unfolding bij_def inj_def by auto
qed
      
textThis last example shows that order isomorphic sets give homeomorphic
topological spaces.

subsectionProperties preserved by functions

textThe continuous image of a connected space is connected.

theorem (in two_top_spaces0) cont_image_conn:
  assumes "IsContinuous(τ1,τ2,f)" "fsurj(X1,X2)" "τ1{is connected}"
  shows "τ2{is connected}"
proof-
  {
    fix U
    assume Uop:"Uτ2" and Ucl:"U{is closed in}τ2"
    from Uop assms(1) have "f-``Uτ1" unfolding IsContinuous_def by auto moreover
    from Ucl assms(1) have  "f-``U{is closed in}τ1" using TopZF_2_1_L1 by auto ultimately
    have disj:"f-``U=0  f-``U=τ1" using assms(3) unfolding IsConnected_def by auto moreover
    {
      assume as:"f-``U0"
      then have "U0" using func1_1_L13 by auto
      from as disj have "f-``U=τ1" by auto
      then have "f``(f-``U)=f``(τ1)" by auto moreover
      have "Uτ2" using Uop by blast ultimately
      have "U=f``(τ1)" using surj_image_vimage assms(2) Uop by force
      then have "τ2=U" using surj_range_image_domain assms(2) by auto
    }
    moreover
    {
      assume as:"U0"
      from Uop have s:"Uτ2" by auto
      with as obtain u where uU:"uU" by auto
      with s have "uτ2" by auto
      with assms(2) obtain w where "f`w=u""wτ1" unfolding surj_def X1_def X2_def by blast
      with uU have "wf-``U" using func1_1_L15 assms(2) unfolding surj_def by auto
      then have "f-``U0" by auto
    }
    ultimately have "U=0U=τ2" by auto
  }
  then show ?thesis unfolding IsConnected_def by auto
qed

textEvery continuous function from a space which has some property P›
  and a space which has the property anti(P)›, given that
  this property is preserved by continuous functions, if follows that the range of the function
  is in the spectrum. Applied to connectedness, it follows that continuous functions from
  a connected space to a totally-disconnected one are constant.

corollary(in two_top_spaces0) cont_conn_tot_disc:
  assumes "IsContinuous(τ1,τ2,f)" "τ1{is connected}" "τ2{is totally-disconnected}" "f:X1X2" "X10"
  shows "qX2. wX1. f`(w)=q"
proof-
  from assms(4) have surj:"fsurj(X1,range(f))" using fun_is_surj by auto
  have sub:"range(f)X2" using func1_1_L5B assms(4) by auto
  from assms(1) have cont:"IsContinuous(τ1,τ2{restricted to}range(f),f)" using restr_image_cont range_image_domain
    assms(4) by auto
  have union:"(τ2{restricted to}range(f))=range(f)" unfolding RestrictedTo_def using sub by auto
  then have "two_top_spaces0(τ1,τ2{restricted to}range(f),f)" unfolding two_top_spaces0_def
    using surj unfolding surj_def using tau1_is_top topology0.Top_1_L4 unfolding topology0_def using tau2_is_top
    by auto
  then have conn:"(τ2{restricted to}range(f)){is connected}" using two_top_spaces0.cont_image_conn surj assms(2) cont
    union by auto
  then have "range(f){is in the spectrum of}IsConnected" using assms(3) sub unfolding IsTotDis_def antiProperty_def
    using union by auto
  then have "range(f)1" using conn_spectrum by auto moreover
  from assms(5) have "f``X10" using func1_1_L15A assms(4) by auto
  then have "range(f)0" using range_image_domain assms(4) by auto
  ultimately obtain q where uniq:"range(f)={q}" using lepoll_1_is_sing by blast
  {
    fix w assume "wX1"
    then have "f`wrange(f)" using func1_1_L5A(2) assms(4) by auto
    with uniq have "f`w=q" by auto
  }
  then have "wX1. f`w=q" by auto
  then show ?thesis using uniq sub by auto
qed

textThe continuous image of a compact space is compact.

theorem (in two_top_spaces0) cont_image_com:
  assumes "IsContinuous(τ1,τ2,f)" "fsurj(X1,X2)" "X1{is compact of cardinal}K{in}τ1"
  shows "X2{is compact of cardinal}K{in}τ2"
proof-
  have "X2τ2" by auto moreover
  {
    fix U assume as:"X2U" "Uτ2"
    then have P:"{f-``V. VU}τ1" using assms(1) unfolding IsContinuous_def by auto
    from as(1) have "f-``X2  f-``(U)" by blast
    then have "f-``X2  converse(f)``(U)" unfolding vimage_def by auto moreover
    have "converse(f)``(U)=(VU. converse(f)``V)" using image_UN by force ultimately
    have "f-``X2  (VU. converse(f)``V)" by auto
    then have "f-``X2  (VU. f-``V)" unfolding vimage_def by auto
    then have "X1  (VU. f-``V)" using func1_1_L4 assms(2) unfolding surj_def by force
    then have "X1  {f-``V. VU}" by auto
    with P assms(3) have "NPow({f-``V. VU}). X1  N  NK" unfolding IsCompactOfCard_def by auto
    then obtain N where "NPow({f-``V. VU})" "X1  N" "NK" by auto
    then have fin:"NK" and sub:"N{f-``V. VU}" and cov:"X1  N" unfolding FinPow_def by auto
    from sub have "{f``R. RN}{f``(f-``V). VU}" by auto moreover
    have "VU. Vτ2" using as(2) by auto ultimately
    have "{f``R. RN}U" using surj_image_vimage assms(2) by auto moreover
    let ?FN="{R,f``R. RN}"
    have FN:"?FN:N{f``R. RN}" unfolding Pi_def function_def domain_def by auto
    {
      fix S assume "S{f``R. RN}"
      then obtain R where R_def:"RN""f``R=S" by auto
      then have "R,f``R?FN" by auto
      then have "?FN`R=f``R" using FN apply_equality by auto
      then have "RN. ?FN`R=S" using R_def by auto
    }
    then have surj:"?FNsurj(N,{f``R. RN})" unfolding surj_def using FN by force
    from fin have N:"NK" "Ord(K)" using assms(3) lesspoll_imp_lepoll unfolding IsCompactOfCard_def
      using Card_is_Ord by auto
    then have "{f``R. RN}N" using surj_fun_inv_2 surj by auto
    then have "{f``R. RN}K" using fin lesspoll_trans1 by blast
    moreover
    have "{f``R. RN}=f``(N)" using image_UN by auto
    then have "f``X1  {f``R. RN}" using cov by blast
    then have "X2  {f``R. RN}" using assms(2) surj_range_image_domain by auto
    ultimately have "NNPow(U). X2  NN  NNK" by auto
  }
  then have "UPow(τ2). X2  U  (NNPow(U). X2  NN  NNK)" by auto
  ultimately show ?thesis using assms(3) unfolding IsCompactOfCard_def by auto
qed

textAs it happends to connected spaces, a continuous function from a compact space
to an anti-compact space has finite range.

corollary (in two_top_spaces0) cont_comp_anti_comp:
  assumes "IsContinuous(τ1,τ2,f)" "X1{is compact in}τ1" "τ2{is anti-compact}" "f:X1X2" "X10"
  shows "Finite(range(f))" and "range(f)0"
proof-
  from assms(4) have surj:"fsurj(X1,range(f))" using fun_is_surj by auto
  have sub:"range(f)X2" using func1_1_L5B assms(4) by auto
  from assms(1) have cont:"IsContinuous(τ1,τ2{restricted to}range(f),f)" using restr_image_cont range_image_domain
    assms(4) by auto
  have union:"(τ2{restricted to}range(f))=range(f)" unfolding RestrictedTo_def using sub by auto
  then have "two_top_spaces0(τ1,τ2{restricted to}range(f),f)" unfolding two_top_spaces0_def
    using surj unfolding surj_def using tau1_is_top topology0.Top_1_L4 unfolding topology0_def using tau2_is_top
    by auto
  then have "range(f){is compact in}(τ2{restricted to}range(f))" using surj two_top_spaces0.cont_image_com cont union 
    assms(2) Compact_is_card_nat by force
  then have "range(f){is in the spectrum of}(λT. (T) {is compact in}T)" using assms(3) sub unfolding IsAntiComp_def antiProperty_def
    using union by auto
  then show "Finite(range(f))" using compact_spectrum by auto moreover
  from assms(5) have "f``X10" using func1_1_L15A assms(4) by auto
  then show "range(f)0" using range_image_domain assms(4) by auto
qed

textAs a consequence, it follows that quotient topological spaces of
compact (connected) spaces are compact (connected).

corollary(in topology0) compQuot:
  assumes "(T){is compact in}T" "equiv(T,r)"
  shows "(T)//r{is compact in}({quotient by}r)"
proof-
  have surj:"{b,r``{b}. bT}surj(T,(T)//r)" using quotient_proj_surj by auto
  moreover have tot:"({quotient by}r)=(T)//r" using total_quo_equi assms(2) by auto
  ultimately have cont:"IsContinuous(T,{quotient by}r,{b,r``{b}. bT})" using quotient_func_cont
    EquivQuo_def assms(2) by auto
  from surj tot have "two_top_spaces0(T,{quotient by}r,{b,r``{b}. bT})" unfolding two_top_spaces0_def
    using topSpaceAssum equiv_quo_is_top assms(2) unfolding surj_def by auto
  with surj cont tot assms(1) show ?thesis using two_top_spaces0.cont_image_com Compact_is_card_nat by force
qed

corollary(in topology0) ConnQuot:
  assumes "T{is connected}" "equiv(T,r)"
  shows "({quotient by}r){is connected}"
proof-
  have surj:"{b,r``{b}. bT}surj(T,(T)//r)" using quotient_proj_surj by auto
  moreover have tot:"({quotient by}r)=(T)//r" using total_quo_equi assms(2) by auto
  ultimately have cont:"IsContinuous(T,{quotient by}r,{b,r``{b}. bT})" using quotient_func_cont
    EquivQuo_def assms(2) by auto
  from surj tot have "two_top_spaces0(T,{quotient by}r,{b,r``{b}. bT})" unfolding two_top_spaces0_def
    using topSpaceAssum equiv_quo_is_top assms(2) unfolding surj_def by auto
  with surj cont tot assms(1) show ?thesis using two_top_spaces0.cont_image_conn by force
qed

end