Theory Lindelof_Spaces

sectionβ€ΉLindel\"of spacesβ€Ί

theory Lindelof_Spaces
imports T1_Spaces
begin

definition Lindelof_space where
  "Lindelof_space X ≑
        βˆ€π’°. (βˆ€U ∈ 𝒰. openin X U) ∧ ⋃𝒰 = topspace X
            ⟢ (βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† 𝒰 ∧ ⋃𝒱 = topspace X)"

lemma Lindelof_spaceD:
  "⟦Lindelof_space X; β‹€U. U ∈ 𝒰 ⟹ openin X U; ⋃𝒰 = topspace X⟧
  ⟹ βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† 𝒰 ∧ ⋃𝒱 = topspace X"
  by (auto simp: Lindelof_space_def)

lemma Lindelof_space_alt:
   "Lindelof_space X ⟷
        (βˆ€π’°. (βˆ€U ∈ 𝒰. openin X U) ∧ topspace X βŠ† ⋃𝒰
             ⟢ (βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† 𝒰 ∧ topspace X βŠ† ⋃𝒱))"
  unfolding Lindelof_space_def
  using openin_subset by fastforce

lemma compact_imp_Lindelof_space:
   "compact_space X ⟹ Lindelof_space X"
  unfolding Lindelof_space_def compact_space
  by (meson uncountable_infinite)

lemma Lindelof_space_topspace_empty:
   "topspace X = {} ⟹ Lindelof_space X"
  using compact_imp_Lindelof_space compact_space_topspace_empty by blast

lemma Lindelof_space_Union:
  assumes 𝒰: "countable 𝒰" and lin: "β‹€U. U ∈ 𝒰 ⟹ Lindelof_space (subtopology X U)"
  shows "Lindelof_space (subtopology X (⋃𝒰))"
proof -
  have "βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† β„± ∧ ⋃𝒰 ∩ ⋃𝒱 = topspace X ∩ ⋃𝒰"
    if β„±: "β„± βŠ† Collect (openin X)" and UF: "⋃𝒰 ∩ ⋃ℱ = topspace X ∩ ⋃𝒰"
    for β„±
  proof -
    have "β‹€U. ⟦U ∈ 𝒰; U ∩ ⋃ℱ = topspace X ∩ U⟧
               ⟹ βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† β„± ∧ U ∩ ⋃𝒱 = topspace X ∩ U"
      using lin β„±
      unfolding Lindelof_space_def openin_subtopology_alt Ball_def subset_iff [symmetric]
      by (simp add: all_subset_image imp_conjL ex_countable_subset_image)
    then obtain g where g: "β‹€U. ⟦U ∈ 𝒰; U ∩ ⋃ℱ = topspace X ∩ U⟧
                               ⟹ countable (g U) ∧ (g U) βŠ† β„± ∧ U ∩ ⋃(g U) = topspace X ∩ U"
      by metis
    show ?thesis
    proof (intro exI conjI)
      show "countable (⋃(g ` 𝒰))"
        using Int_commute UF g  by (fastforce intro: countable_UN [OF 𝒰])
      show "⋃(g ` 𝒰) βŠ† β„±"
        using g UF by blast
      show "⋃𝒰 ∩ ⋃(⋃(g ` 𝒰)) = topspace X ∩ ⋃𝒰"
      proof
        show "⋃𝒰 ∩ ⋃(⋃(g ` 𝒰)) βŠ† topspace X ∩ ⋃𝒰"
          using g UF by blast
        show "topspace X ∩ ⋃𝒰 βŠ† ⋃𝒰 ∩ ⋃(⋃(g ` 𝒰))"
        proof clarsimp
          show "βˆƒyβˆˆπ’°. βˆƒW∈g y. x ∈ W"
            if "x ∈ topspace X" "x ∈ V" "V ∈ 𝒰" for x V
          proof -
            have "V ∩ ⋃ℱ = topspace X ∩ V"
              using UF β€ΉV ∈ 𝒰› by blast
            with that g [OF β€ΉV ∈ 𝒰›]  show ?thesis by blast
          qed
        qed
      qed
    qed
  qed
  then show ?thesis
      unfolding Lindelof_space_def openin_subtopology_alt Ball_def subset_iff [symmetric]
      by (simp add: all_subset_image imp_conjL ex_countable_subset_image)
qed

lemma countable_imp_Lindelof_space:
  assumes "countable(topspace X)"
  shows "Lindelof_space X"
proof -
  have "Lindelof_space (subtopology X (⋃x ∈ topspace X. {x}))"
  proof (rule Lindelof_space_Union)
    show "countable ((Ξ»x. {x}) ` topspace X)"
      using assms by blast
    show "Lindelof_space (subtopology X U)"
      if "U ∈ (λx. {x}) ` topspace X" for U
    proof -
      have "compactin X U"
        using that by force
      then show ?thesis
        by (meson compact_imp_Lindelof_space compact_space_subtopology)
    qed
  qed
  then show ?thesis
    by simp
qed
lemma Lindelof_space_subtopology:
   "Lindelof_space(subtopology X S) ⟷
        (βˆ€π’°. (βˆ€U ∈ 𝒰. openin X U) ∧ topspace X ∩ S βŠ† ⋃𝒰
            ⟢ (βˆƒV. countable V ∧ V βŠ† 𝒰 ∧ topspace X ∩ S βŠ† ⋃V))"
proof -
  have *: "(S ∩ ⋃𝒰 = topspace X ∩ S) = (topspace X ∩ S βŠ† ⋃𝒰)"
    if "β‹€x. x ∈ 𝒰 ⟹ openin X x" for 𝒰
    by (blast dest: openin_subset [OF that])
  moreover have "(𝒱 βŠ† 𝒰 ∧ S ∩ ⋃𝒱 = topspace X ∩ S) = (𝒱 βŠ† 𝒰 ∧ topspace X ∩ S βŠ† ⋃𝒱)"
    if "βˆ€x. x ∈ 𝒰 ⟢ openin X x" "topspace X ∩ S βŠ† ⋃𝒰" "countable 𝒱" for 𝒰 𝒱
    using that * by blast
  ultimately show ?thesis
    unfolding Lindelof_space_def openin_subtopology_alt Ball_def
    apply (simp add: all_subset_image imp_conjL ex_countable_subset_image flip: subset_iff)
    apply (intro all_cong1 imp_cong ex_cong, auto)
    done
qed

lemma Lindelof_space_subtopology_subset:
   "S βŠ† topspace X
        ⟹ (Lindelof_space(subtopology X S) ⟷
             (βˆ€π’°. (βˆ€U ∈ 𝒰. openin X U) ∧ S βŠ† ⋃𝒰
                 ⟢ (βˆƒV. countable V ∧ V βŠ† 𝒰 ∧ S βŠ† ⋃V)))"
  by (metis Lindelof_space_subtopology topspace_subtopology topspace_subtopology_subset)

lemma Lindelof_space_closedin_subtopology:
  assumes X: "Lindelof_space X" and clo: "closedin X S"
  shows "Lindelof_space (subtopology X S)"
proof -
  have "S βŠ† topspace X"
    by (simp add: clo closedin_subset)
  then show ?thesis
  proof (clarsimp simp add: Lindelof_space_subtopology_subset)
    show "βˆƒV. countable V ∧ V βŠ† β„± ∧ S βŠ† ⋃V"
      if "βˆ€Uβˆˆβ„±. openin X U" and "S βŠ† ⋃ℱ" for β„±
    proof -
      have "βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† insert (topspace X - S) β„± ∧ ⋃𝒱 = topspace X"
      proof (rule Lindelof_spaceD [OF X, of "insert (topspace X - S) β„±"])
        show "openin X U"
          if "U ∈ insert (topspace X - S) β„±" for U
          using that β€Ήβˆ€Uβˆˆβ„±. openin X Uβ€Ί clo by blast
        show "⋃(insert (topspace X - S) β„±) = topspace X"
          apply auto
          apply (meson in_mono openin_closedin_eq that(1))
          using UnionE β€ΉS βŠ† ⋃ℱ› by auto
      qed
      then obtain 𝒱 where "countable 𝒱" "𝒱 βŠ† insert (topspace X - S) β„±" "⋃𝒱 = topspace X"
        by metis
      with β€ΉS βŠ† topspace Xβ€Ί
      show ?thesis
        by (rule_tac x="(𝒱 - {topspace X - S})" in exI) auto
    qed
  qed
qed

lemma Lindelof_space_continuous_map_image:
  assumes X: "Lindelof_space X" and f: "continuous_map X Y f" and fim: "f ` (topspace X) = topspace Y"
  shows "Lindelof_space Y"
proof -
  have "βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† 𝒰 ∧ ⋃𝒱 = topspace Y"
    if 𝒰: "β‹€U. U ∈ 𝒰 ⟹ openin Y U" and UU: "⋃𝒰 = topspace Y" for 𝒰
  proof -
    define 𝒱 where "𝒱 ≑ (Ξ»U. {x ∈ topspace X. f x ∈ U}) ` 𝒰"
    have "β‹€V. V ∈ 𝒱 ⟹ openin X V"
      unfolding 𝒱_def using 𝒰 continuous_map f by fastforce
    moreover have "⋃𝒱 = topspace X"
      unfolding 𝒱_def using UU fim by fastforce
    ultimately have "βˆƒπ’². countable 𝒲 ∧ 𝒲 βŠ† 𝒱 ∧ ⋃𝒲 = topspace X"
      using X by (simp add: Lindelof_space_def)
    then obtain π’ž where "countable π’ž" "π’ž βŠ† 𝒰" and π’ž: "(⋃Uβˆˆπ’ž. {x ∈ topspace X. f x ∈ U}) = topspace X"
      by (metis (no_types, lifting) 𝒱_def countable_subset_image)
    moreover have "β‹ƒπ’ž = topspace Y"
    proof
      show "β‹ƒπ’ž βŠ† topspace Y"
        using UU π’ž β€Ήπ’ž βŠ† 𝒰› by fastforce
      have "y ∈ β‹ƒπ’ž" if "y ∈ topspace Y" for y
      proof -
        obtain x where "x ∈ topspace X" "y = f x"
          using that fim by (metis β€Ήy ∈ topspace Yβ€Ί imageE)
        with π’ž show ?thesis by auto
      qed
      then show "topspace Y βŠ† β‹ƒπ’ž" by blast
    qed
    ultimately show ?thesis
      by blast
  qed
  then show ?thesis
    unfolding Lindelof_space_def
    by auto
qed

lemma Lindelof_space_quotient_map_image:
   "⟦quotient_map X Y q; Lindelof_space X⟧ ⟹ Lindelof_space Y"
  by (meson Lindelof_space_continuous_map_image quotient_imp_continuous_map quotient_imp_surjective_map)

lemma Lindelof_space_retraction_map_image:
   "⟦retraction_map X Y r; Lindelof_space X⟧ ⟹ Lindelof_space Y"
  using Abstract_Topology.retraction_imp_quotient_map Lindelof_space_quotient_map_image by blast

lemma locally_finite_cover_of_Lindelof_space:
  assumes X: "Lindelof_space X" and UU: "topspace X βŠ† ⋃𝒰" and fin: "locally_finite_in X 𝒰"
  shows "countable 𝒰"
proof -
  have UU_eq: "⋃𝒰 = topspace X"
    by (meson UU fin locally_finite_in_def subset_antisym)
  obtain T where T: "β‹€x. x ∈ topspace X ⟹ openin X (T x) ∧ x ∈ T x ∧ finite {U ∈ 𝒰. U ∩ T x β‰  {}}"
    using fin unfolding locally_finite_in_def by metis
  then obtain I where "countable I" "I βŠ† topspace X" and I: "topspace X βŠ† ⋃(T ` I)"
    using X unfolding Lindelof_space_alt
    by (drule_tac x="image T (topspace X)" in spec) (auto simp: ex_countable_subset_image)
  show ?thesis
  proof (rule countable_subset)
    have "β‹€i. i ∈ I ⟹ countable {U ∈ 𝒰. U ∩ T i β‰  {}}"
      using T
      by (meson β€ΉI βŠ† topspace Xβ€Ί in_mono uncountable_infinite)
    then show "countable (insert {} (⋃i∈I. {U ∈ 𝒰. U ∩ T i β‰  {}}))"
      by (simp add: β€Ήcountable Iβ€Ί)
  qed (use UU_eq I in auto)
qed


lemma Lindelof_space_proper_map_preimage:
  assumes f: "proper_map X Y f" and Y: "Lindelof_space Y"
  shows "Lindelof_space X"
proof (clarsimp simp: Lindelof_space_alt)
  show "βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† 𝒰 ∧ topspace X βŠ† ⋃𝒱"
    if 𝒰: "βˆ€Uβˆˆπ’°. openin X U" and sub_UU: "topspace X βŠ† ⋃𝒰" for 𝒰
  proof -
    have "βˆƒπ’±. finite 𝒱 ∧ 𝒱 βŠ† 𝒰 ∧ {x ∈ topspace X. f x = y} βŠ† ⋃𝒱" if "y ∈ topspace Y" for y
    proof (rule compactinD)
      show "compactin X {x ∈ topspace X. f x = y}"
        using f proper_map_def that by fastforce
    qed (use sub_UU 𝒰 in auto)
    then obtain 𝒱 where 𝒱: "β‹€y. y ∈ topspace Y ⟹ finite (𝒱 y) ∧ 𝒱 y βŠ† 𝒰 ∧ {x ∈ topspace X. f x = y} βŠ† ⋃(𝒱 y)"
      by meson
    define 𝒲 where "𝒲 ≑ (Ξ»y. topspace Y - image f (topspace X - ⋃(𝒱 y))) ` topspace Y"
    have "βˆ€U ∈ 𝒲. openin Y U"
      using f 𝒰 𝒱 unfolding 𝒲_def proper_map_def closed_map_def
      by (simp add: closedin_diff openin_Union openin_diff subset_iff)
    moreover have "topspace Y βŠ† ⋃𝒲"
      using 𝒱 unfolding 𝒲_def by clarsimp fastforce
    ultimately have "βˆƒπ’±. countable 𝒱 ∧ 𝒱 βŠ† 𝒲 ∧ topspace Y βŠ† ⋃𝒱"
      using Y by (simp add: Lindelof_space_alt)
    then obtain I where "countable I" "I βŠ† topspace Y"
      and I: "topspace Y βŠ† (⋃i∈I. topspace Y - f ` (topspace X - ⋃(𝒱 i)))"
      unfolding 𝒲_def ex_countable_subset_image by metis
    show ?thesis
    proof (intro exI conjI)
      have "β‹€i. i ∈ I ⟹ countable (𝒱 i)"
        by (meson 𝒱 β€ΉI βŠ† topspace Yβ€Ί in_mono uncountable_infinite)
      with β€Ήcountable Iβ€Ί show "countable (⋃(𝒱 ` I))"
        by auto
      show "⋃(𝒱 ` I) βŠ† 𝒰"
        using 𝒱 β€ΉI βŠ† topspace Yβ€Ί by fastforce
      show "topspace X βŠ† ⋃(⋃(𝒱 ` I))"
      proof
        show "x ∈ ⋃ (⋃ (𝒱 ` I))" if "x ∈ topspace X" for x
        proof -
          have "f x ∈ topspace Y"
            by (meson f image_subset_iff proper_map_imp_subset_topspace that)
          then show ?thesis
            using that I by auto
        qed
      qed
    qed
  qed
qed

lemma Lindelof_space_perfect_map_image:
   "⟦Lindelof_space X; perfect_map X Y f⟧ ⟹ Lindelof_space Y"
  using Lindelof_space_quotient_map_image perfect_imp_quotient_map by blast

lemma Lindelof_space_perfect_map_image_eq:
   "perfect_map X Y f ⟹ Lindelof_space X ⟷ Lindelof_space Y"
  using Lindelof_space_perfect_map_image Lindelof_space_proper_map_preimage perfect_map_def by blast

end