Lean library · module TopologyByExample.Spaces.RealExtensions

Extensions of the real line and of the plane

Source file

Let D be a set of reals that is dense and has dense complement (the rationals or the irrationals). Steen and Seebach refine the Euclidean topology of ℝ using D in three ways:

  • the indiscrete extension TopologyByExample.IndiscreteExtension D: the topology generated by the Euclidean open sets and the sets D ∩ U, U Euclidean open (equivalently, by the Euclidean open sets and D itself);
  • the pointed extension TopologyByExample.PointedExtension D: the topology generated by the sets {x} ∪ (D ∩ U) with U Euclidean open and x ∈ U;
  • the discrete extension TopologyByExample.DiscreteExtension D: the topology generated by the Euclidean open sets and the singletons of points of D.

At D = ℚ and D = ℝ \ ℚ these give the indiscrete rational and irrational extensions, the pointed rational and irrational extensions and the discrete rational extension (the discrete irrational extension is the Michael line, TopologyByExample.MichaelLine). The rational extension of the plane TopologyByExample.RationalExtensionPlane is ℝ × ℝ with the points of ℚ × ℚ isolated and the sets {x} ∪ (ℚ² ∩ U) (U Euclidean open, x ∈ U) open.

Main definitions

Main statements

References

  • L. A. Steen and J. A. Seebach, Counterexamples in Topology, Examples 66–72.

This file was written by Claude (Anthropic's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.

Imports

Two general theorems

theorem preconnectedSpace_of_closure_eq

TopologyByExample.preconnectedSpace_of_closure_eq

If the closure, for a topology t', of every t'-open set equals its closure for a connected topology t, then t' is connected: a t'-clopen set equals its t-closure, as does its complement, so it is t-clopen.

theorem preconnectedSpace_of_closure_eq {X : Type*} {t t' : TopologicalSpace X}
    (hc : @PreconnectedSpace X t)
    (hcl : ∀ U : Set X, IsOpen[t'] U → closure[t'] U = closure[t] U) :
    @PreconnectedSpace X t'
Proof
:= by
  refine (@preconnectedSpace_iff_clopen X t').2 fun s hs ↦ ?_
  have hclosed : ∀ u : Set X, @IsClopen X t' u → IsClosed[t] u := fun u hu ↦ by
    rw [← @closure_eq_iff_isClosed X t, ← hcl u hu.2]
    exact (@closure_eq_iff_isClosed X t' u).2 hu.1
  have h1 := hclosed s hs
  have h2 : IsOpen[t] s := by
    rw [← @isClosed_compl_iff X t]
    exact hclosed sᶜ (@IsClopen.compl X t' s hs)
  exact (@isClopen_iff X t hc s).1 ⟨h1, h2⟩

On this site: Theorem: A topology in which open sets have the same closures as in a connected topology is connected

variable {X : Type*} [TopologicalSpace X] {f : X → ℝ} {D : Set X}

theorem interior_image_eq_empty_of_isCompact

TopologyByExample.interior_image_eq_empty_of_isCompact

Let f : X → ℝ be a continuous bijection and D ⊆ X an open set such that f '' D and f '' Dᶜ are dense. Then the image of a compact set has empty interior.

theorem interior_image_eq_empty_of_isCompact (hf : Continuous f) (hb : Bijective f)
    (hD : IsOpen D) (h1 : Dense (f '' D)) (h2 : Dense (f '' Dᶜ)) {K : Set X}
    (hK : IsCompact K) : interior (f '' K) = ∅
Proof
:= by
  by_contra hne
  have hV : (interior (f '' K)).Nonempty := ne_empty_iff_nonempty.1 hne
  have hcl : IsClosed (f '' (K ∩ Dᶜ)) := ((hK.inter_right hD.isClosed_compl).image hf).isClosed
  have hsub : interior (f '' K) ⊆ f '' (K ∩ Dᶜ) := by
    refine (h2.open_subset_closure_inter isOpen_interior).trans (closure_minimal ?_ hcl)
    rintro _ ⟨hy, a, ha, rfl⟩
    obtain ⟨b, hb', hba⟩ := interior_subset hy
    exact ⟨a, ⟨hb.1 hba ▸ hb', ha⟩, rfl⟩
  obtain ⟨_, hz, d, hd, rfl⟩ := h1.inter_open_nonempty _ isOpen_interior hV
  obtain ⟨c, ⟨-, hc⟩, hcd⟩ := hsub hz
  exact hc (hb.1 hcd ▸ hd)

theorem not_sigmaCompactSpace_and_totallyPathDisconnectedSpace

TopologyByExample.not_sigmaCompactSpace_and_totallyPathDisconnectedSpace

General theorem. Let f : X → ℝ be a continuous bijection and D ⊆ X an open set such that f '' D and f '' Dᶜ are dense in ℝ. Then X is not σ-compact, and every path in X is constant.

theorem not_sigmaCompactSpace_and_totallyPathDisconnectedSpace (hf : Continuous f)
    (hb : Bijective f) (hD : IsOpen D) (h1 : Dense (f '' D)) (h2 : Dense (f '' Dᶜ)) :
    ¬SigmaCompactSpace X ∧ TotallyPathDisconnectedSpace X
Proof
:= by
  have hint := fun {K : Set X} (hK : IsCompact K) ↦
    interior_image_eq_empty_of_isCompact hf hb hD h1 h2 hK
  refine ⟨fun _ ↦ ?_, ⟨fun x y ⟨γ⟩ ↦ ?_⟩⟩
  · have hU : ⋃ n, f '' compactCovering X n = univ := by
      rw [← image_iUnion, iUnion_compactCovering, image_univ, hb.2.range_eq]
    obtain ⟨n, hn⟩ := nonempty_interior_of_iUnion_of_closed
      (fun n ↦ ((isCompact_compactCovering X n).image hf).isClosed) hU
    rw [hint (isCompact_compactCovering X n)] at hn
    exact not_nonempty_empty hn
  · by_contra hxy
    have hne : f x ≠ f y := hb.1.ne hxy
    have hpc : IsPreconnected (f '' range γ) := by
      rw [← range_comp]
      exact isPreconnected_range (hf.comp γ.continuous)
    have hsub : uIcc (f x) (f y) ⊆ f '' range γ :=
      hpc.ordConnected.uIcc_subset ⟨x, ⟨0, γ.source⟩, rfl⟩ ⟨y, ⟨1, γ.target⟩, rfl⟩
    have hIoo : Ioo (min (f x) (f y)) (max (f x) (f y)) ⊆ interior (f '' range γ) :=
      interior_maximal (Ioo_subset_Icc_self.trans hsub) isOpen_Ioo
    rw [hint (isCompact_range γ.continuous)] at hIoo
    exact (nonempty_Ioo.2 (min_lt_max.2 hne)).not_subset_empty hIoo

On this site: Theorem: A refinement of the real line with an open set that is dense and codense is not σ-compact and has only constant paths

variable {X : Type*} [TopologicalSpace X]

theorem submetrizableSpace_of_continuous_injective

TopologyByExample.RealExtension.submetrizableSpace_of_continuous_injective

A space with a continuous injection into a metrizable space is submetrizable.

theorem submetrizableSpace_of_continuous_injective {Y : Type*} [TopologicalSpace Y]
    [MetrizableSpace Y] {f : X → Y} (hf : Continuous f) (hi : Injective f) :
    SubmetrizableSpace X
Proof
:= by
  refine ⟨⟨induced f inferInstance, continuous_iff_le_induced.1 hf, ?_⟩⟩
  let _ : TopologicalSpace X := induced f inferInstance
  exact (Topology.IsEmbedding.mk ⟨rfl⟩ hi).metrizableSpace

theorem not_pseudocompactSpace_of_continuous_surjective

TopologyByExample.RealExtension.not_pseudocompactSpace_of_continuous_surjective

A space with a continuous surjection onto ℝ is not pseudocompact.

theorem not_pseudocompactSpace_of_continuous_surjective {f : X → ℝ} (hf : Continuous f)
    (hs : Surjective f) : ¬PseudocompactSpace X
Proof
:= by
  intro ⟨h⟩
  obtain ⟨⟨b, hb⟩, -⟩ := h ⟨f, hf⟩
  obtain ⟨x, hx⟩ := hs (b + 1)
  have := hb ⟨x, rfl⟩
  simp only [ContinuousMap.coe_mk, hx] at this
  linarith

structure DenseTrace

TopologyByExample.RealExtension.DenseTrace

The hypothesis shared by the indiscrete and the pointed extensions: e : X ≃ ℝ is continuous, D is dense, and every neighbourhood of a point x contains e ⁻¹' (D ∩ U) for some Euclidean neighbourhood U of e x.

structure DenseTrace (e : X ≃ ℝ) (D : Set ℝ) : Prop where
  /-- The topology is finer than the Euclidean one. -/
  continuous : Continuous e
  /-- The set `D` is dense. -/
  dense : Dense D
  /-- Every neighbourhood contains the trace of `D` on a Euclidean neighbourhood. -/
  exists_subset : ∀ x : X, ∀ s ∈ 𝓝 x, ∃ U ∈ 𝓝 (e x), e ⁻¹' (D ∩ U) ⊆ s
variable {e : X ≃ ℝ} {D : Set ℝ} (h : DenseTrace e D)
include h

theorem inter_nonempty

TopologyByExample.RealExtension.DenseTrace.inter_nonempty

A nonempty open set meets e ⁻¹' D.

theorem inter_nonempty {O : Set X} (hO : IsOpen O) (hne : O.Nonempty) :
    (O ∩ e ⁻¹' D).Nonempty
Proof
:= by
  obtain ⟨x, hx⟩ := hne
  obtain ⟨U, hU, hUO⟩ := h.exists_subset x O (hO.mem_nhds hx)
  obtain ⟨d, hdD, hdU⟩ := h.dense.inter_nhds_nonempty hU
  refine ⟨e.symm d, hUO ?_, ?_⟩ <;> simp [hdD, hdU]

theorem dense_preimage

TopologyByExample.RealExtension.DenseTrace.dense_preimage

The set e ⁻¹' D is dense.

theorem dense_preimage : Dense (e ⁻¹' D)
Proof
:=
  dense_iff_inter_open.2 fun _ hO hne ↦ h.inter_nonempty hO hne

theorem closure_eq

TopologyByExample.RealExtension.DenseTrace.closure_eq

The closure of an open set is the preimage of the Euclidean closure of its image.

theorem closure_eq {O : Set X} (hO : IsOpen O) : closure O = e ⁻¹' closure (e '' O)
Proof
:= by
  refine subset_antisymm (fun x hx ↦ image_closure_subset_closure_image h.continuous
    ⟨x, hx, rfl⟩) fun x hx ↦ mem_closure_iff_nhds.2 fun s hs ↦ ?_
  obtain ⟨U, hU, hUs⟩ := h.exists_subset x s hs
  obtain ⟨_, hyU, o, ho, rfl⟩ := mem_closure_iff_nhds.1 hx _ (interior_mem_nhds.2 hU)
  have hO' : IsOpen (O ∩ e ⁻¹' interior U) := hO.inter (isOpen_interior.preimage h.continuous)
  obtain ⟨z, ⟨hzO, hzU⟩, hzD⟩ := h.inter_nonempty hO' ⟨o, ho, hyU⟩
  exact ⟨z, hUs ⟨hzD, interior_subset hzU⟩, hzO⟩

theorem interior_preimage

TopologyByExample.RealExtension.DenseTrace.interior_preimage

The interior of the preimage of a Euclidean closed set is the preimage of its Euclidean interior.

theorem interior_preimage {C : Set ℝ} (hC : IsClosed C) :
    interior (e ⁻¹' C) = e ⁻¹' interior C
Proof
:= by
  refine subset_antisymm (fun x hx ↦ ?_)
    (interior_maximal (preimage_mono interior_subset) (isOpen_interior.preimage h.continuous))
  obtain ⟨U, hU, hUC⟩ := h.exists_subset x _ (mem_interior_iff_mem_nhds.1 hx)
  have hDU : D ∩ interior U ⊆ C := fun y hy ↦ by
    have := hUC (show e.symm y ∈ e ⁻¹' (D ∩ U) by simpa using ⟨hy.1, interior_subset hy.2⟩)
    simpa using this
  have : interior U ⊆ C :=
    (h.dense.open_subset_closure_inter isOpen_interior).trans
      (closure_minimal ((inter_comm _ _).subset.trans hDU) hC)
  exact interior_maximal this isOpen_interior (mem_interior_iff_mem_nhds.2 hU)

theorem isRegularOpen_preimage_iff

TopologyByExample.RealExtension.DenseTrace.isRegularOpen_preimage_iff

A set is regular open exactly when its image is regular open in the Euclidean line.

theorem isRegularOpen_preimage_iff {R : Set ℝ} : IsRegularOpen (e ⁻¹' R) ↔ IsRegularOpen R
Proof
:= by
  have key : IsOpen (e ⁻¹' R) → interior (closure (e ⁻¹' R)) = e ⁻¹' interior (closure R) := by
    intro hO
    rw [h.closure_eq hO, e.image_preimage, h.interior_preimage isClosed_closure]
  refine ⟨fun hR ↦ ?_, fun hR ↦ ?_⟩
  · rw [isRegularOpen_iff] at hR ⊢
    have := key (hR ▸ isOpen_interior)
    rw [hR] at this
    exact (e.surjective.preimage_injective this).symm
  · have ho := hR.isOpen
    rw [isRegularOpen_iff] at hR ⊢
    rw [key (ho.preimage h.continuous), hR]

theorem not_semiregularSpace

TopologyByExample.RealExtension.DenseTrace.not_semiregularSpace

If some open set has an image that is not Euclidean open, the space is not semiregular.

theorem not_semiregularSpace {O : Set X} (hO : IsOpen O) (hO' : ¬IsOpen (e '' O)) :
    ¬SemiregularSpace X
Proof
:= by
  intro hs
  have hb := semiregularSpace_iff_isRegularOpen.1 hs
  refine hO' (isOpen_iff_mem_nhds.2 ?_)
  rintro _ ⟨a, ha, rfl⟩
  obtain ⟨t, ht, hat, htO⟩ := hb.exists_subset_of_mem_open ha hO
  have hreg : IsRegularOpen (e '' t) := by
    rw [← h.isRegularOpen_preimage_iff, e.preimage_image]
    exact ht
  exact mem_of_superset (hreg.isOpen.mem_nhds ⟨a, hat, rfl⟩) (image_mono htO)

theorem t2Space

TopologyByExample.RealExtension.DenseTrace.t2Space

The space is Hausdorff.

theorem t2Space : T2Space X
Proof
:= T2Space.of_injective_continuous e.injective h.continuous

theorem not_isOpen_singleton

TopologyByExample.RealExtension.DenseTrace.not_isOpen_singleton

No point is isolated.

theorem not_isOpen_singleton (x : X) : ¬IsOpen ({x} : Set X)
Proof
:= by
  intro hx
  obtain ⟨U, hU, hUs⟩ := h.exists_subset x _ (hx.mem_nhds rfl)
  obtain ⟨ε, hε, hεU⟩ := Metric.mem_nhds_iff.1 (interior_mem_nhds.2 hU)
  have hne : (interior U \ {e x}).Nonempty :=
    ⟨e x + ε / 2, hεU (by rw [Metric.mem_ball, Real.dist_eq]; rw [abs_of_pos] <;> linarith),
      by simp only [mem_singleton_iff]; linarith⟩
  obtain ⟨y, ⟨hyU, hyx⟩, hyD⟩ :=
    h.dense.inter_open_nonempty _ (isOpen_interior.sdiff isClosed_singleton) hne
  have := hUs (show e.symm y ∈ e ⁻¹' (D ∩ U) by simpa using ⟨hyD, interior_subset hyU⟩)
  rw [mem_singleton_iff] at this
  exact hyx (by rw [← this]; simp)

theorem preconnectedSpace

TopologyByExample.RealExtension.DenseTrace.preconnectedSpace

The space is connected.

theorem preconnectedSpace : PreconnectedSpace X
Proof
:= by
  have hc : @PreconnectedSpace X (induced e inferInstance) :=
    @DenseRange.preconnectedSpace ℝ X _ (induced e inferInstance) _ e.symm
      (by
        unfold DenseRange
        rw [e.symm.surjective.range_eq]
        exact @dense_univ X (induced e inferInstance))
      (continuous_induced_rng.2 (by simpa using continuous_id))
  refine preconnectedSpace_of_closure_eq hc fun U hU ↦ ?_
  ext x
  rw [h.closure_eq hU, mem_preimage, closure_induced]

theorem not_locallyConnectedSpace

TopologyByExample.RealExtension.DenseTrace.not_locallyConnectedSpace

The space is not locally connected, provided e ⁻¹' D is open and D has dense complement: a connected open set inside e ⁻¹' D is a single point, which is not open.

theorem not_locallyConnectedSpace (hDo : IsOpen (e ⁻¹' D)) (hDc : Dense Dᶜ) :
    ¬LocallyConnectedSpace X
Proof
:= by
  intro hl
  obtain ⟨d, hd⟩ := h.dense.nonempty
  obtain ⟨V, ⟨hVo, hxV, hVc⟩, hVD⟩ :=
    (LocallyConnectedSpace.open_connected_basis (e.symm d)).mem_iff.1
      (hDo.mem_nhds (show e.symm d ∈ e ⁻¹' D by simpa using hd))
  have hpc : IsPreconnected (e '' V) := hVc.isPreconnected.image _ h.continuous.continuousOn
  have hsub : e '' V ⊆ {d} := by
    rintro _ ⟨v, hv, rfl⟩
    by_contra hne
    have hne' : e v ≠ d := hne
    have hI : uIcc (e v) d ⊆ e '' V :=
      hpc.ordConnected.uIcc_subset ⟨v, hv, rfl⟩ ⟨e.symm d, hxV, by simp⟩
    obtain ⟨y, hy, hyD⟩ := hDc.inter_open_nonempty (Ioo (min (e v) d) (max (e v) d)) isOpen_Ioo
      (nonempty_Ioo.2 (min_lt_max.2 hne'))
    obtain ⟨w, hw, rfl⟩ := hI (Ioo_subset_Icc_self hy)
    exact hyD (hVD hw)
  have hV : V = {e.symm d} := by
    refine Subset.antisymm (fun v hv ↦ ?_) (singleton_subset_iff.2 hxV)
    have := hsub ⟨v, hv, rfl⟩
    rw [mem_singleton_iff] at this ⊢
    rw [← this]
    simp
  exact h.not_isOpen_singleton _ (hV ▸ hVo)

theorem isMeagre_univ

TopologyByExample.RealExtension.DenseTrace.isMeagre_univ

When D is countable and e ⁻¹' D is open, the space is of first category: the complement of e ⁻¹' D is closed with empty interior, and the points of e ⁻¹' D are closed and not isolated.

theorem isMeagre_univ (hDo : IsOpen (e ⁻¹' D)) (hc : D.Countable) : IsMeagre (univ : Set X)
Proof
:= by
  have := h.t2Space
  have hcov : univ = (e ⁻¹' D)ᶜ ∪ ⋃ d : D, {e.symm d} := by
    ext x
    by_cases hx : e x ∈ D
    · simp only [mem_univ, mem_union, mem_compl_iff, mem_preimage, mem_iUnion, mem_singleton_iff,
        true_iff]
      exact .inr ⟨⟨e x, hx⟩, by simp⟩
    · simp [hx]
  have : Countable D := hc.to_subtype
  rw [hcov]
  refine IsMeagre.union (IsNowhereDense.isMeagre ?_) (isMeagre_iUnion fun d ↦
    IsNowhereDense.isMeagre ?_)
  · rw [hDo.isClosed_compl.isNowhereDense_iff, ← subset_empty_iff]
    intro x hx
    obtain ⟨y, hy, hyD⟩ := h.inter_nonempty isOpen_interior ⟨x, hx⟩
    exact interior_subset hy hyD
  · rw [isClosed_singleton.isNowhereDense_iff, ← subset_empty_iff]
    intro x hx
    have hsub := interior_subset hx
    rw [mem_singleton_iff] at hsub
    subst hsub
    refine h.not_isOpen_singleton (e.symm d) ?_
    rw [← interior_eq_iff_isOpen]
    exact Subset.antisymm interior_subset (singleton_subset_iff.2 hx)

theorem baireSpace

TopologyByExample.RealExtension.DenseTrace.baireSpace

When e ⁻¹' D is open and D is completely metrizable (as a subspace of the Euclidean line), the space is a Baire space: e ⁻¹' D is a dense open subspace homeomorphic to D.

theorem baireSpace (hDo : IsOpen (e ⁻¹' D)) [IsCompletelyMetrizableSpace D] : BaireSpace X
Proof
:= by
  let g : e ⁻¹' D ≃ₜ D :=
    { toEquiv := e.subtypeEquiv fun _ ↦ Iff.rfl
      continuous_toFun := (h.continuous.comp continuous_subtypeVal).subtype_mk _
      continuous_invFun := by
        refine Continuous.subtype_mk (continuous_iff_continuousAt.2 fun y ↦ ?_) _
        refine continuousAt_def.2 fun s hs ↦ ?_
        obtain ⟨U, hU, hUs⟩ := h.exists_subset _ s hs
        rw [Equiv.apply_symm_apply] at hU
        rw [nhds_subtype]
        refine mem_of_superset (preimage_mem_comap hU) fun z hz ↦ hUs ?_
        simp only [mem_preimage, Equiv.apply_symm_apply]
        exact ⟨z.property, hz⟩ }
  have : IsCompletelyMetrizableSpace (e ⁻¹' D) := g.isClosedEmbedding.IsCompletelyMetrizableSpace
  exact baireSpace_of_isOpen_of_dense hDo h.dense_preimage

theorem not_isOpen_of_dense_compl

TopologyByExample.RealExtension.not_isOpen_of_dense_compl

A nonempty set with dense complement is not open.

theorem not_isOpen_of_dense_compl {D : Set ℝ} (hne : D.Nonempty) (hDc : Dense Dᶜ) :
    ¬IsOpen D
Proof
:= fun ho ↦ by
  obtain ⟨y, hy, hyc⟩ := hDc.inter_open_nonempty D ho hne
  exact hyc hy

theorem mk_compl_eq_continuum

TopologyByExample.RealExtension.mk_compl_eq_continuum

A countable set of reals has a complement of cardinality 𝔠.

theorem mk_compl_eq_continuum {D : Set ℝ} (hc : D.Countable) :
    Cardinal.mk (Dᶜ : Set ℝ) = Cardinal.continuum
Proof
:= by
  have : Countable D := hc.to_subtype
  rw [Cardinal.mk_compl_of_infinite, Cardinal.mk_real]
  rw [Cardinal.mk_real]
  exact Cardinal.mk_le_aleph0.trans_lt Cardinal.aleph0_lt_continuum

The indiscrete extension

definition IndiscreteExtension

TopologyByExample.IndiscreteExtension

The indiscrete extension of the real line by a set D ⊆ ℝ: the real line with the topology generated by the Euclidean open sets together with the sets D ∩ U, U Euclidean open.

@[nolint unusedArguments]
def IndiscreteExtension (_D : Set ℝ) : Type
:= ℝ
variable {D : Set ℝ}

definition toReal

TopologyByExample.IndiscreteExtension.toReal

The identity map from the indiscrete extension to the real line.

def toReal : IndiscreteExtension D ≃ ℝ
:= Equiv.refl ℝ

instance

The topology of the indiscrete extension: the coarsest topology containing the Euclidean open sets and D (hence also every D ∩ U with U Euclidean open).

instance : TopologicalSpace (IndiscreteExtension D)
Proof
:=
  induced toReal inferInstance ⊓ generateFrom {toReal ⁻¹' D}

theorem continuous_toReal

TopologyByExample.IndiscreteExtension.continuous_toReal

The topology is finer than the Euclidean one.

theorem continuous_toReal : Continuous (toReal : IndiscreteExtension D → ℝ)
Proof
:=
  continuous_iff_le_induced.2 inf_le_left

theorem isOpen_preimage

TopologyByExample.IndiscreteExtension.isOpen_preimage

The set D is open.

theorem isOpen_preimage : IsOpen (toReal ⁻¹' D : Set (IndiscreteExtension D))
Proof
:=
  TopologicalSpace.le_def.1 inf_le_right _ (isOpen_generateFrom_of_mem rfl)

theorem isOpen_preimage_inter

TopologyByExample.IndiscreteExtension.isOpen_preimage_inter

The set D ∩ U is open for every Euclidean open set U.

theorem isOpen_preimage_inter {U : Set ℝ} (hU : IsOpen U) :
    IsOpen (toReal ⁻¹' (D ∩ U) : Set (IndiscreteExtension D))
Proof
:=
  isOpen_preimage.inter (hU.preimage continuous_toReal)

theorem exists_subset_of_mem_nhds

TopologyByExample.IndiscreteExtension.exists_subset_of_mem_nhds

Every neighbourhood of a point contains the points of D in a Euclidean neighbourhood.

theorem exists_subset_of_mem_nhds {x : IndiscreteExtension D} {s : Set (IndiscreteExtension D)}
    (hs : s ∈ 𝓝 x) : ∃ U ∈ 𝓝 (toReal x), toReal ⁻¹' (D ∩ U) ⊆ s
Proof
:= by
  have hle : comap toReal (𝓝 (toReal x)) ⊓ 𝓟 (toReal ⁻¹' D) ≤ 𝓝 x := by
    have : 𝓝 x = @nhds _ (induced toReal inferInstance) x ⊓
        @nhds _ (generateFrom {toReal ⁻¹' D}) x :=
      nhds_inf (t₁ := induced toReal inferInstance) (t₂ := generateFrom {toReal ⁻¹' D})
    rw [this, nhds_induced, nhds_generateFrom]
    refine inf_le_inf_left _ (le_iInf₂ fun t ht ↦ ?_)
    rw [mem_singleton_iff.1 ht.2]
  obtain ⟨U, hU, hUs⟩ := mem_comap.1 (mem_inf_principal.1 (hle hs))
  exact ⟨U, hU, fun y hy ↦ hUs hy.2 hy.1⟩

theorem denseTrace

TopologyByExample.IndiscreteExtension.denseTrace

The indiscrete extension by a dense set has the DenseTrace property.

theorem denseTrace (hD : Dense D) : DenseTrace (toReal : IndiscreteExtension D ≃ ℝ) D
Proof
:=
  ⟨continuous_toReal, hD, fun _ _ ↦ exists_subset_of_mem_nhds⟩

theorem secondCountableTopology

TopologyByExample.IndiscreteExtension.secondCountableTopology

The indiscrete extension is second countable.

theorem secondCountableTopology : SecondCountableTopology (IndiscreteExtension D)
Proof
:=
  secondCountableTopology_inf (secondCountableTopology_induced _ _ toReal)
    (SecondCountableTopology.mk' (countable_singleton _))

theorem submetrizableSpace

TopologyByExample.IndiscreteExtension.submetrizableSpace

The indiscrete extension is submetrizable.

theorem submetrizableSpace : SubmetrizableSpace (IndiscreteExtension D)
Proof
:=
  submetrizableSpace_of_continuous_injective continuous_toReal toReal.injective

theorem not_pseudocompactSpace

TopologyByExample.IndiscreteExtension.not_pseudocompactSpace

The indiscrete extension is not pseudocompact.

theorem not_pseudocompactSpace : ¬PseudocompactSpace (IndiscreteExtension D)
Proof
:=
  not_pseudocompactSpace_of_continuous_surjective continuous_toReal toReal.surjective

theorem not_sigmaCompactSpace_and_totallyPathDisconnectedSpace'

TopologyByExample.IndiscreteExtension.not_sigmaCompactSpace_and_totallyPathDisconnectedSpace'

If D and its complement are dense, the indiscrete extension is not σ-compact and is totally path disconnected.

theorem not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' (hD : Dense D)
    (hDc : Dense Dᶜ) :
    ¬SigmaCompactSpace (IndiscreteExtension D) ∧
      TotallyPathDisconnectedSpace (IndiscreteExtension D)
Proof
:=
  not_sigmaCompactSpace_and_totallyPathDisconnectedSpace continuous_toReal toReal.bijective
    isOpen_preimage (by rwa [Equiv.image_preimage])
    (by rwa [← preimage_compl, Equiv.image_preimage])

theorem not_semiregularSpace

TopologyByExample.IndiscreteExtension.not_semiregularSpace

If D and its complement are dense, the indiscrete extension is not semiregular.

theorem not_semiregularSpace (hD : Dense D) (hDc : Dense Dᶜ) :
    ¬SemiregularSpace (IndiscreteExtension D)
Proof
:=
  (denseTrace hD).not_semiregularSpace isOpen_preimage
    (by rw [Equiv.image_preimage]; exact not_isOpen_of_dense_compl hD.nonempty hDc)

The pointed extension

definition PointedExtension

TopologyByExample.PointedExtension

The pointed extension of the real line by a set D ⊆ ℝ: the real line with the topology generated by the sets {x} ∪ (D ∩ U) with U Euclidean open and x ∈ U.

@[nolint unusedArguments]
def PointedExtension (_D : Set ℝ) : Type
:= ℝ
variable {D : Set ℝ}

definition toReal

TopologyByExample.PointedExtension.toReal

The identity map from the pointed extension to the real line.

def toReal : PointedExtension D ≃ ℝ
:= Equiv.refl ℝ
variable (D) in

definition generators

TopologyByExample.PointedExtension.generators

The generating sets of the pointed extension: {x} ∪ (D ∩ U) with U Euclidean open and x ∈ U.

def generators : Set (Set (PointedExtension D))
:=
  {s | ∃ x : ℝ, ∃ U : Set ℝ, IsOpen U ∧ x ∈ U ∧ s = toReal ⁻¹' insert x (D ∩ U)}

instance

The topology of the pointed extension.

instance : TopologicalSpace (PointedExtension D)
Proof
:= generateFrom (generators D)

theorem isOpen_preimage_insert

TopologyByExample.PointedExtension.isOpen_preimage_insert

The generating sets are open.

theorem isOpen_preimage_insert {x : ℝ} {U : Set ℝ} (hU : IsOpen U) (hx : x ∈ U) :
    IsOpen (toReal ⁻¹' insert x (D ∩ U) : Set (PointedExtension D))
Proof
:=
  isOpen_generateFrom_of_mem ⟨x, U, hU, hx, rfl⟩

theorem nhds_eq

TopologyByExample.PointedExtension.nhds_eq

The neighbourhoods of a point x are the sets containing x and the points of D in some Euclidean neighbourhood of x.

theorem nhds_eq (x : PointedExtension D) :
    𝓝 x = pure x ⊔ comap toReal (𝓝 (toReal x) ⊓ 𝓟 D)
Proof
:= by
  refine le_antisymm (fun s hs ↦ ?_) ?_
  · obtain ⟨hxs, t, ht, hts⟩ := mem_sup.1 hs
    obtain ⟨U, hUt, hU, hxU⟩ := mem_nhds_iff.1 (mem_inf_principal.1 ht)
    refine mem_of_superset ((isOpen_preimage_insert hU hxU).mem_nhds (by simp [toReal]))
      fun z hz ↦ ?_
    rcases hz with hz | ⟨hzD, hzU⟩
    · rwa [toReal.injective hz]
    · exact hts (hUt hzU hzD)
  · rw [nhds_generateFrom]
    refine le_iInf₂ fun s ⟨hxs, y, U, hU, hyU, hs⟩ ↦ le_principal_iff.2 (mem_sup.2 ⟨hxs, ?_⟩)
    subst hs
    have hxU : toReal x ∈ U := by
      rcases hxs with h | h
      · exact (show toReal x = y from h) ▸ hyU
      · exact h.2
    exact ⟨_, mem_inf_principal.2 (mem_of_superset (hU.mem_nhds hxU)
      fun z hz hzD ↦ Or.inr ⟨hzD, hz⟩), subset_rfl⟩

theorem mem_nhds_iff'

TopologyByExample.PointedExtension.mem_nhds_iff'

A set is a neighbourhood of x iff it contains x and the points of D in a Euclidean neighbourhood of x.

theorem mem_nhds_iff' {x : PointedExtension D} {s : Set (PointedExtension D)} :
    s ∈ 𝓝 x ↔ x ∈ s ∧ ∃ U ∈ 𝓝 (toReal x), toReal ⁻¹' (D ∩ U) ⊆ s
Proof
:= by
  rw [nhds_eq, mem_sup, mem_pure, mem_comap]
  refine and_congr_right fun _ ↦ ⟨fun ⟨t, ht, hts⟩ ↦ ?_, fun ⟨U, hU, hUs⟩ ↦ ?_⟩
  · exact ⟨_, mem_inf_principal.1 ht, fun z hz ↦ hts (hz.2 hz.1)⟩
  · exact ⟨D ∩ U, mem_inf_principal.2 (mem_of_superset hU fun z hz hzD ↦ ⟨hzD, hz⟩), hUs⟩

theorem continuous_toReal

TopologyByExample.PointedExtension.continuous_toReal

The topology is finer than the Euclidean one.

theorem continuous_toReal : Continuous (toReal : PointedExtension D → ℝ)
Proof
:=
  continuous_iff_continuousAt.2 fun x ↦ tendsto_def.2 fun V hV ↦
    mem_nhds_iff'.2 ⟨show toReal x ∈ V from mem_of_mem_nhds hV, V, hV, fun _ hz ↦ hz.2⟩

theorem isOpen_preimage

TopologyByExample.PointedExtension.isOpen_preimage

The set D is open.

theorem isOpen_preimage : IsOpen (toReal ⁻¹' D : Set (PointedExtension D))
Proof
:=
  isOpen_iff_mem_nhds.2 fun _ hx ↦ mem_nhds_iff'.2 ⟨hx, univ, univ_mem, fun _ hz ↦ hz.1⟩

theorem denseTrace

TopologyByExample.PointedExtension.denseTrace

The pointed extension by a dense set has the DenseTrace property.

theorem denseTrace (hD : Dense D) : DenseTrace (toReal : PointedExtension D ≃ ℝ) D
Proof
:=
  ⟨continuous_toReal, hD, fun _ _ hs ↦ (mem_nhds_iff'.1 hs).2⟩

theorem firstCountableTopology

TopologyByExample.PointedExtension.firstCountableTopology

The pointed extension is first countable.

theorem firstCountableTopology : FirstCountableTopology (PointedExtension D)
Proof
:=
  ⟨fun x ↦ by rw [nhds_eq]; infer_instance⟩

theorem separableSpace

TopologyByExample.PointedExtension.separableSpace

The pointed extension by a countable dense set is separable.

theorem separableSpace (hD : Dense D) (hc : D.Countable) : SeparableSpace (PointedExtension D)
Proof
:=
  ⟨⟨toReal ⁻¹' D, hc.preimage toReal.injective, (denseTrace hD).dense_preimage⟩⟩

theorem secondCountableTopology

TopologyByExample.PointedExtension.secondCountableTopology

The pointed extension by a set with countable complement is second countable: the sets {q} ∪ (D ∩ (a, b)) with q ∉ D, a < q < b rational, and D ∩ (a, b) with a, b rational, form a base.

theorem secondCountableTopology (hc : Dᶜ.Countable) :
    SecondCountableTopology (PointedExtension D)
Proof
:= by
  let f : ℝ × ℚ × ℚ → Set (PointedExtension D) := fun p ↦
    toReal ⁻¹' insert p.1 (D ∩ Ioo (p.2.1 : ℝ) p.2.2)
  let B : Set (Set (PointedExtension D)) :=
    {s | ∃ p : ℝ × ℚ × ℚ, p.1 ∈ Ioo (p.2.1 : ℝ) p.2.2 ∧ (p.1 ∉ D ∨ p.1 = p.2.1) ∧ s = f p} ∪
      range fun p : ℚ × ℚ ↦ toReal ⁻¹' (D ∩ Ioo (p.1 : ℝ) p.2)
  refine IsTopologicalBasis.secondCountableTopology (b := B) ?_ ?_
  · refine isTopologicalBasis_of_isOpen_of_nhds ?_ fun x u hxu hu ↦ ?_
    · rintro _ (⟨p, hp, -, rfl⟩ | ⟨p, rfl⟩)
      · exact isOpen_preimage_insert isOpen_Ioo hp
      · exact isOpen_preimage.inter (isOpen_Ioo.preimage continuous_toReal)
    · obtain ⟨-, U, hU, hUu⟩ := mem_nhds_iff'.1 (hu.mem_nhds hxu)
      obtain ⟨a, b, hab, hsub⟩ : ∃ a b : ℚ, toReal x ∈ Ioo (a : ℝ) b ∧ Ioo (a : ℝ) b ⊆ U := by
        obtain ⟨⟨l, r⟩, ⟨hl, hr⟩, hlr⟩ := (nhds_basis_Ioo (toReal x)).mem_iff.1 hU
        obtain ⟨a, ha1, ha2⟩ := exists_rat_btwn hl
        obtain ⟨b, hb1, hb2⟩ := exists_rat_btwn hr
        exact ⟨a, b, ⟨ha2, hb1⟩, (Ioo_subset_Ioo ha1.le hb2.le).trans hlr⟩
      by_cases hxD : toReal x ∈ D
      · refine ⟨_, .inr ⟨(a, b), rfl⟩, ⟨hxD, hab⟩, fun z hz ↦ hUu ⟨hz.1, hsub hz.2⟩⟩
      · refine ⟨f (toReal x, a, b), .inl ⟨_, hab, .inl hxD, rfl⟩, by simp [f], fun z hz ↦ ?_⟩
        rcases hz with hz | ⟨hzD, hzI⟩
        · rw [toReal.injective hz]
          exact hxu
        · exact hUu ⟨hzD, hsub hzI⟩
  · refine (((hc.union (countable_range ((↑) : ℚ → ℝ))).prod countable_univ).image f).union
      (countable_range _) |>.mono (union_subset_union_left _ ?_)
    rintro _ ⟨p, -, hp, rfl⟩
    refine ⟨p, ⟨?_, mem_univ _⟩, rfl⟩
    rcases hp with hp | hp
    · exact .inl hp
    · exact .inr ⟨p.2.1, hp.symm⟩

theorem submetrizableSpace

TopologyByExample.PointedExtension.submetrizableSpace

The pointed extension is submetrizable.

theorem submetrizableSpace : SubmetrizableSpace (PointedExtension D)
Proof
:=
  submetrizableSpace_of_continuous_injective continuous_toReal toReal.injective

theorem not_pseudocompactSpace

TopologyByExample.PointedExtension.not_pseudocompactSpace

The pointed extension is not pseudocompact.

theorem not_pseudocompactSpace : ¬PseudocompactSpace (PointedExtension D)
Proof
:=
  not_pseudocompactSpace_of_continuous_surjective continuous_toReal toReal.surjective

theorem not_sigmaCompactSpace_and_totallyPathDisconnectedSpace'

TopologyByExample.PointedExtension.not_sigmaCompactSpace_and_totallyPathDisconnectedSpace'

If D and its complement are dense, the pointed extension is not σ-compact and is totally path disconnected.

theorem not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' (hD : Dense D)
    (hDc : Dense Dᶜ) :
    ¬SigmaCompactSpace (PointedExtension D) ∧
      TotallyPathDisconnectedSpace (PointedExtension D)
Proof
:=
  not_sigmaCompactSpace_and_totallyPathDisconnectedSpace continuous_toReal toReal.bijective
    isOpen_preimage (by rwa [Equiv.image_preimage])
    (by rwa [← preimage_compl, Equiv.image_preimage])

theorem not_semiregularSpace

TopologyByExample.PointedExtension.not_semiregularSpace

If D and its complement are dense, the pointed extension is not semiregular.

theorem not_semiregularSpace (hD : Dense D) (hDc : Dense Dᶜ) :
    ¬SemiregularSpace (PointedExtension D)
Proof
:=
  (denseTrace hD).not_semiregularSpace isOpen_preimage
    (by rw [Equiv.image_preimage]; exact not_isOpen_of_dense_compl hD.nonempty hDc)

theorem exists_closed_discrete_continuum_le

TopologyByExample.PointedExtension.exists_closed_discrete_continuum_le

The points outside D form a closed discrete set, of cardinality 𝔠 when D is countable.

theorem exists_closed_discrete_continuum_le (hc : D.Countable) :
    ∃ s : Set (PointedExtension D), IsClosed s ∧ IsDiscrete s ∧
      Cardinal.continuum ≤ Cardinal.mk s
Proof
:= by
  refine ⟨toReal ⁻¹' Dᶜ, isOpen_preimage.isClosed_compl, ?_, ?_⟩
  · refine isDiscrete_iff_forall_mem_exists_isOpen.2 fun y hy ↦
      ⟨_, isOpen_preimage_insert (x := toReal y) isOpen_univ (mem_univ _), ?_⟩
    refine Subset.antisymm (fun z ⟨hz, hzc⟩ ↦ ?_) (singleton_subset_iff.2 ⟨by simp, hy⟩)
    rcases hz with hz | hz
    · exact toReal.injective hz
    · exact absurd hz.1 hzc
  · rw [← mk_compl_eq_continuum hc]
    exact (Cardinal.mk_congr (toReal.subtypeEquiv fun _ ↦ Iff.rfl)).ge

The discrete extension

definition DiscreteExtension

TopologyByExample.DiscreteExtension

The discrete extension of the real line by a set D ⊆ ℝ: the real line with the topology generated by the Euclidean open sets together with the singletons of points of D.

@[nolint unusedArguments]
def DiscreteExtension (_D : Set ℝ) : Type
:= ℝ
variable {D : Set ℝ}

definition toReal

TopologyByExample.DiscreteExtension.toReal

The identity map from the discrete extension to the real line.

def toReal : DiscreteExtension D ≃ ℝ
:= Equiv.refl ℝ

instance

The topology of the discrete extension: the coarsest topology containing the Euclidean open sets and the singletons of points of D.

instance : TopologicalSpace (DiscreteExtension D)
Proof
:=
  induced toReal inferInstance ⊓ generateFrom {s | ∃ d ∈ D, s = {toReal.symm d}}

theorem continuous_toReal

TopologyByExample.DiscreteExtension.continuous_toReal

The topology is finer than the Euclidean one.

theorem continuous_toReal : Continuous (toReal : DiscreteExtension D → ℝ)
Proof
:=
  continuous_iff_le_induced.2 inf_le_left

instance

The discrete extension is Hausdorff.

instance : T2Space (DiscreteExtension D)
Proof
:=
  T2Space.of_injective_continuous toReal.injective continuous_toReal

theorem isOpen_singleton

TopologyByExample.DiscreteExtension.isOpen_singleton

A point of D is isolated.

theorem isOpen_singleton {x : DiscreteExtension D} (hx : toReal x ∈ D) : IsOpen {x}
Proof
:=
  TopologicalSpace.le_def.1 inf_le_right _
    (isOpen_generateFrom_of_mem ⟨toReal x, hx, by simp⟩)

theorem nhds_of_mem

TopologyByExample.DiscreteExtension.nhds_of_mem

The neighbourhoods of a point of D.

theorem nhds_of_mem {x : DiscreteExtension D} (hx : toReal x ∈ D) : 𝓝 x = pure x
Proof
:=
  (isOpen_singleton_iff_nhds_eq_pure x).1 (isOpen_singleton hx)

theorem nhds_of_notMem

TopologyByExample.DiscreteExtension.nhds_of_notMem

The neighbourhoods of a point outside D are its Euclidean neighbourhoods.

theorem nhds_of_notMem {x : DiscreteExtension D} (hx : toReal x ∉ D) :
    𝓝 x = comap toReal (𝓝 (toReal x))
Proof
:= by
  have : 𝓝 x = @nhds _ (induced toReal inferInstance) x ⊓
      @nhds _ (generateFrom {s | ∃ d ∈ D, s = {toReal.symm d}}) x :=
    nhds_inf (t₁ := induced toReal inferInstance)
      (t₂ := generateFrom {s | ∃ d ∈ D, s = {toReal.symm d}})
  rw [this, nhds_induced, nhds_generateFrom]
  refine inf_eq_left.2 (le_iInf₂ fun s ⟨hxs, d, hd, hs⟩ ↦ ?_)
  rw [hs, mem_singleton_iff] at hxs
  exact absurd (show toReal x ∈ D by rw [hxs, Equiv.apply_symm_apply]; exact hd) hx

theorem isOpen_preimage

TopologyByExample.DiscreteExtension.isOpen_preimage

The set D is open.

theorem isOpen_preimage : IsOpen (toReal ⁻¹' D : Set (DiscreteExtension D))
Proof
:=
  isOpen_iff_mem_nhds.2 fun x hx ↦
    mem_nhds_iff.2 ⟨{x}, singleton_subset_iff.2 hx, isOpen_singleton hx, rfl⟩

theorem secondCountableTopology

TopologyByExample.DiscreteExtension.secondCountableTopology

The discrete extension by a countable set is second countable.

theorem secondCountableTopology (hc : D.Countable) :
    SecondCountableTopology (DiscreteExtension D)
Proof
:=
  secondCountableTopology_inf (secondCountableTopology_induced _ _ toReal)
    (SecondCountableTopology.mk' ((hc.image fun d ↦ ({toReal.symm d} : Set _)).mono
      (by rintro _ ⟨d, hd, rfl⟩; exact ⟨d, hd, rfl⟩)))

theorem isClopen_preimage_Ioo

TopologyByExample.DiscreteExtension.isClopen_preimage_Ioo

An interval with endpoints in D is open and closed.

theorem isClopen_preimage_Ioo {a b : ℝ} (ha : a ∈ D) (hb : b ∈ D) :
    IsClopen (toReal ⁻¹' Ioo a b : Set (DiscreteExtension D))
Proof
:= by
  refine ⟨?_, isOpen_Ioo.preimage continuous_toReal⟩
  refine isOpen_compl_iff.1 (isOpen_iff_mem_nhds.2 fun z hz ↦ ?_)
  by_cases hzD : toReal z ∈ D
  · exact mem_nhds_iff.2 ⟨{z}, singleton_subset_iff.2 hz, isOpen_singleton hzD, rfl⟩
  · have hz' : toReal z ∈ Iio a ∪ Ioi b := by
      simp only [mem_compl_iff, mem_preimage, mem_Ioo, not_and_or, not_lt] at hz
      rcases hz with h | h
      · exact .inl (h.lt_of_ne fun h' ↦ hzD (h' ▸ ha))
      · exact .inr (lt_of_le_of_ne h fun h' ↦ hzD (h' ▸ hb))
    refine mem_of_superset (continuous_toReal.continuousAt.preimage_mem_nhds
      ((isOpen_Iio.union isOpen_Ioi).mem_nhds hz')) fun w hw hw' ↦ ?_
    rcases hw with hw | hw
    · exact (lt_asymm hw hw'.1)
    · exact (lt_asymm hw hw'.2)

theorem zeroDimensionalSpace

TopologyByExample.DiscreteExtension.zeroDimensionalSpace

The discrete extension by a dense set is zero-dimensional: the singletons of points of D and the intervals with endpoints in D are open and closed and form a base.

theorem zeroDimensionalSpace (hD : Dense D) : ZeroDimensionalSpace (DiscreteExtension D)
Proof
:= by
  refine ZeroDimensionalSpace.of_hasBasis fun x ↦ ?_
  by_cases hx : toReal x ∈ D
  · refine ⟨Unit, fun _ ↦ True, fun _ ↦ {x}, fun _ _ ↦ ⟨isClosed_singleton, isOpen_singleton hx⟩,
      ?_⟩
    rw [nhds_of_mem hx]
    exact hasBasis_pure x
  · refine ⟨ℝ × ℝ, fun p ↦ p.1 ∈ D ∧ p.2 ∈ D ∧ p.1 < toReal x ∧ toReal x < p.2,
      fun p ↦ toReal ⁻¹' Ioo p.1 p.2, fun p hp ↦ isClopen_preimage_Ioo hp.1 hp.2.1, ?_⟩
    rw [nhds_of_notMem hx]
    refine HasBasis.comap _ ((nhds_basis_Ioo (toReal x)).to_hasBasis (fun p hp ↦ ?_)
      fun p hp ↦ ⟨p, hp.2.2, subset_rfl⟩)
    obtain ⟨a, ha, h1, h2⟩ := hD.exists_between hp.1
    obtain ⟨b, hb, h3, h4⟩ := hD.exists_between hp.2
    exact ⟨(a, b), ⟨ha, hb, h2, h3⟩, Ioo_subset_Ioo h1.le h4.le⟩

definition embedding

TopologyByExample.DiscreteExtension.embedding

The embedding x ↦ (x, (|x - d|⁻¹)_{d ∈ D}) of the discrete extension into ℝ × ℝ^D (with 0⁻¹ = 0).

def embedding (x : DiscreteExtension D) : ℝ × (D → ℝ)
:=
  (toReal x, fun d ↦ |toReal x - d|⁻¹)

theorem continuous_embedding

TopologyByExample.DiscreteExtension.continuous_embedding

The embedding is continuous.

theorem continuous_embedding : Continuous (embedding : DiscreteExtension D → ℝ × (D → ℝ))
Proof
:= by
  refine continuous_toReal.prodMk (continuous_pi fun d ↦ continuous_iff_continuousAt.2 fun x ↦ ?_)
  by_cases hx : toReal x = d
  · rw [ContinuousAt, nhds_of_mem (hx ▸ d.property)]
    exact tendsto_pure_nhds _ _
  · have : ContinuousAt (fun r : ℝ ↦ |r - d|⁻¹) (toReal x) :=
      ContinuousAt.inv₀ (by fun_prop) (by simpa [sub_eq_zero] using hx)
    exact this.comp continuous_toReal.continuousAt

theorem isClosed_graph_inv_abs_sub

TopologyByExample.DiscreteExtension.isClosed_graph_inv_abs_sub

The graph {(r, t) | t = |r - d|⁻¹} is closed in the plane (with 0⁻¹ = 0).

theorem isClosed_graph_inv_abs_sub (d : ℝ) : IsClosed {q : ℝ × ℝ | q.2 = |q.1 - d|⁻¹}
Proof
:= by
  have : {q : ℝ × ℝ | q.2 = |q.1 - d|⁻¹} = {q | q.2 * |q.1 - d| = 1} ∪ {(d, 0)} := by
    ext ⟨r, t⟩
    simp only [mem_ofPred_eq, mem_union, mem_singleton_iff, Prod.mk.injEq]
    by_cases hr : r = d
    · subst hr
      simp
    · have ha : |r - d| ≠ 0 := by simpa [sub_eq_zero] using hr
      simp only [hr, false_and, or_false]
      exact ⟨fun h ↦ by rw [h, inv_mul_cancel₀ ha], eq_inv_of_mul_eq_one_left⟩
  rw [this]
  exact (isClosed_eq (by fun_prop) continuous_const).union isClosed_singleton

theorem isClosedEmbedding_embedding

TopologyByExample.DiscreteExtension.isClosedEmbedding_embedding

The embedding is a closed embedding.

theorem isClosedEmbedding_embedding :
    Topology.IsClosedEmbedding (embedding : DiscreteExtension D → ℝ × (D → ℝ))
Proof
:= by
  refine ⟨⟨Topology.isInducing_iff_nhds.2 fun x ↦ le_antisymm
    (continuous_embedding.tendsto x).le_comap ?_,
    fun x y h ↦ toReal.injective (congrArg Prod.fst h)⟩, ?_⟩
  · by_cases hx : toReal x ∈ D
    · rw [nhds_of_mem hx]
      have hW : IsOpen ({p : ℝ × (D → ℝ) | p.2 ⟨toReal x, hx⟩ < 1} ∩
          {p | |p.1 - toReal x| < 1}) :=
        (isOpen_lt (continuous_apply _ |>.comp continuous_snd) continuous_const).inter
          (isOpen_lt (by fun_prop) continuous_const)
      refine le_pure_iff.2 ⟨_, hW.mem_nhds (by simp [embedding]), fun z hz ↦ ?_⟩
      simp only [embedding, mem_preimage, mem_inter_iff, mem_ofPred_eq] at hz
      by_contra hne
      have hpos : 0 < |toReal z - toReal x| :=
        abs_pos.2 (sub_ne_zero.2 fun h ↦ hne (toReal.injective h))
      have : 1 < |toReal z - toReal x|⁻¹ := (one_lt_inv₀ hpos).2 hz.2
      exact absurd hz.1 (not_lt.2 this.le)
    · rw [nhds_of_notMem hx]
      calc comap embedding (𝓝 (embedding x))
          ≤ comap embedding (comap Prod.fst (𝓝 (embedding x).1)) :=
            comap_mono (continuous_fst.tendsto _).le_comap
        _ = comap toReal (𝓝 (toReal x)) := by rw [comap_comap]; rfl
  · have : range (embedding : DiscreteExtension D → ℝ × (D → ℝ)) =
        ⋂ d : D, (fun p : ℝ × (D → ℝ) ↦ (p.1, p.2 d)) ⁻¹' {q | q.2 = |q.1 - d|⁻¹} := by
      ext p
      simp only [mem_range, mem_iInter, mem_preimage, mem_ofPred_eq]
      refine ⟨?_, fun h ↦ ⟨toReal.symm p.1, Prod.ext (by simp [embedding]) (funext fun d ↦ ?_)⟩⟩
      · rintro ⟨x, rfl⟩ d
        rfl
      · simp [embedding, h d]
    rw [this]
    exact isClosed_iInter fun d ↦ (isClosed_graph_inv_abs_sub d).preimage (by fun_prop)

theorem isCompletelyMetrizableSpace

TopologyByExample.DiscreteExtension.isCompletelyMetrizableSpace

The discrete extension by a countable set is completely metrizable.

theorem isCompletelyMetrizableSpace (hc : D.Countable) :
    IsCompletelyMetrizableSpace (DiscreteExtension D)
Proof
:=
  have : Countable D := hc.to_subtype
  isClosedEmbedding_embedding.IsCompletelyMetrizableSpace

theorem not_sigmaCompactSpace

TopologyByExample.DiscreteExtension.not_sigmaCompactSpace

If D and its complement are dense, the discrete extension is not σ-compact.

theorem not_sigmaCompactSpace (hD : Dense D) (hDc : Dense Dᶜ) :
    ¬SigmaCompactSpace (DiscreteExtension D)
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace continuous_toReal toReal.bijective
    isOpen_preimage (by rwa [Equiv.image_preimage])
    (by rwa [← preimage_compl, Equiv.image_preimage])).1

The rational extension of the plane

definition RationalExtensionPlane

TopologyByExample.RationalExtensionPlane

The rational extension of the plane: ℝ × ℝ in which each point of ℚ × ℚ is open, and each set {x} ∪ (ℚ² ∩ U) with U Euclidean open and x ∈ U is open.

def RationalExtensionPlane : Type
:= ℝ × ℝ

On this site: Space: Rational extension of the plane

definition toPlane

TopologyByExample.RationalExtensionPlane.toPlane

The identity map from the rational extension of the plane to the Euclidean plane.

def toPlane : RationalExtensionPlane ≃ ℝ × ℝ
:= Equiv.refl _

definition rationalPoints

TopologyByExample.RationalExtensionPlane.rationalPoints

The rational points ℚ × ℚ of the plane.

def rationalPoints : Set (ℝ × ℝ)
:= range ((↑) : ℚ → ℝ) ×ˢ range ((↑) : ℚ → ℝ)

theorem countable_rationalPoints

TopologyByExample.RationalExtensionPlane.countable_rationalPoints

The rational points are countable.

theorem countable_rationalPoints : rationalPoints.Countable
Proof
:=
  (countable_range _).prod (countable_range _)

theorem dense_rationalPoints

TopologyByExample.RationalExtensionPlane.dense_rationalPoints

The rational points are dense in the Euclidean plane.

theorem dense_rationalPoints : Dense rationalPoints
Proof
:=
  Rat.denseRange_cast.prod Rat.denseRange_cast

definition generators

TopologyByExample.RationalExtensionPlane.generators

The generating sets: the singletons of rational points and the sets {x} ∪ (ℚ² ∩ U) with U Euclidean open and x ∈ U.

def generators : Set (Set RationalExtensionPlane)
Definition
:=
  {s | ∃ d ∈ rationalPoints, s = {toPlane.symm d}} ∪
    {s | ∃ x : ℝ × ℝ, ∃ U : Set (ℝ × ℝ), IsOpen U ∧ x ∈ U ∧
      s = toPlane ⁻¹' insert x (rationalPoints ∩ U)}

instance

The topology of the rational extension of the plane.

instance : TopologicalSpace RationalExtensionPlane
Proof
:= generateFrom generators

theorem isOpen_singleton

TopologyByExample.RationalExtensionPlane.isOpen_singleton

A rational point is isolated.

theorem isOpen_singleton {x : RationalExtensionPlane} (hx : toPlane x ∈ rationalPoints) :
    IsOpen ({x} : Set RationalExtensionPlane)
Proof
:=
  isOpen_generateFrom_of_mem (.inl ⟨toPlane x, hx, by simp⟩)

theorem isOpen_preimage_insert

TopologyByExample.RationalExtensionPlane.isOpen_preimage_insert

The sets {x} ∪ (ℚ² ∩ U) are open.

theorem isOpen_preimage_insert {x : ℝ × ℝ} {U : Set (ℝ × ℝ)} (hU : IsOpen U) (hx : x ∈ U) :
    IsOpen (toPlane ⁻¹' insert x (rationalPoints ∩ U))
Proof
:=
  isOpen_generateFrom_of_mem (.inr ⟨x, U, hU, hx, rfl⟩)

theorem nhds_of_mem

TopologyByExample.RationalExtensionPlane.nhds_of_mem

The neighbourhoods of a rational point.

theorem nhds_of_mem {x : RationalExtensionPlane} (hx : toPlane x ∈ rationalPoints) :
    𝓝 x = pure x
Proof
:=
  (isOpen_singleton_iff_nhds_eq_pure x).1 (isOpen_singleton hx)

theorem nhds_of_notMem

TopologyByExample.RationalExtensionPlane.nhds_of_notMem

The neighbourhoods of a point outside ℚ²: the sets containing it and the rational points of a Euclidean neighbourhood of it.

theorem nhds_of_notMem {x : RationalExtensionPlane} (hx : toPlane x ∉ rationalPoints) :
    𝓝 x = pure x ⊔ comap toPlane (𝓝 (toPlane x) ⊓ 𝓟 rationalPoints)
Proof
:= by
  refine le_antisymm (fun s hs ↦ ?_) ?_
  · obtain ⟨hxs, t, ht, hts⟩ := mem_sup.1 hs
    obtain ⟨U, hUt, hU, hxU⟩ := mem_nhds_iff.1 (mem_inf_principal.1 ht)
    refine mem_of_superset ((isOpen_preimage_insert hU hxU).mem_nhds (by simp [toPlane]))
      fun z hz ↦ ?_
    rcases hz with hz | ⟨hzD, hzU⟩
    · rwa [toPlane.injective hz]
    · exact hts (hUt hzU hzD)
  · have hn : 𝓝 x = ⨅ s ∈ {s | x ∈ s ∧ s ∈ generators}, 𝓟 s := nhds_generateFrom
    rw [hn]
    refine le_iInf₂ fun s ⟨hxs, hs⟩ ↦ le_principal_iff.2 (mem_sup.2 ⟨hxs, ?_⟩)
    rcases hs with ⟨d, hd, rfl⟩ | ⟨y, U, hU, hyU, rfl⟩
    · rw [mem_singleton_iff] at hxs
      exact absurd (show toPlane x ∈ rationalPoints by rw [hxs, Equiv.apply_symm_apply]; exact hd)
        hx
    · have hxU : toPlane x ∈ U := by
        rcases hxs with h | h
        · exact (show toPlane x = y from h) ▸ hyU
        · exact h.2
      exact ⟨_, mem_inf_principal.2 (mem_of_superset (hU.mem_nhds hxU)
        fun z hz hzD ↦ Or.inr ⟨hzD, hz⟩), subset_rfl⟩

theorem exists_subset_of_mem_nhds

TopologyByExample.RationalExtensionPlane.exists_subset_of_mem_nhds

Every neighbourhood of a point x outside ℚ² contains the rational points of a Euclidean neighbourhood of x.

theorem exists_subset_of_mem_nhds {x : RationalExtensionPlane} (hx : toPlane x ∉ rationalPoints)
    {s : Set RationalExtensionPlane} (hs : s ∈ 𝓝 x) :
    ∃ U ∈ 𝓝 (toPlane x), toPlane ⁻¹' (rationalPoints ∩ U) ⊆ s
Proof
:= by
  rw [nhds_of_notMem hx] at hs
  obtain ⟨-, t, ht, hts⟩ := mem_sup.1 hs
  exact ⟨_, mem_inf_principal.1 ht, fun z hz ↦ hts (hz.2 hz.1)⟩

theorem continuous_toPlane

TopologyByExample.RationalExtensionPlane.continuous_toPlane

The topology is finer than the Euclidean one.

theorem continuous_toPlane : Continuous toPlane
Proof
:= by
  refine continuous_iff_continuousAt.2 fun x ↦ tendsto_def.2 fun V hV ↦ ?_
  by_cases hx : toPlane x ∈ rationalPoints
  · rw [nhds_of_mem hx]
    exact mem_pure.2 (show toPlane x ∈ V from mem_of_mem_nhds hV)
  · rw [nhds_of_notMem hx]
    exact mem_sup.2 ⟨show toPlane x ∈ V from mem_of_mem_nhds hV,
      ⟨V, mem_inf_of_left hV, subset_rfl⟩⟩

theorem isOpen_preimage_rationalPoints

TopologyByExample.RationalExtensionPlane.isOpen_preimage_rationalPoints

The rational points form an open set.

theorem isOpen_preimage_rationalPoints : IsOpen (toPlane ⁻¹' rationalPoints)
Proof
:=
  isOpen_iff_mem_nhds.2 fun x hx ↦
    mem_nhds_iff.2 ⟨{x}, singleton_subset_iff.2 hx, isOpen_singleton hx, rfl⟩

theorem preimage_interior_subset_closure

TopologyByExample.RationalExtensionPlane.preimage_interior_subset_closure

A point of the Euclidean interior of U lies in the closure of the rational points of U.

theorem preimage_interior_subset_closure (U : Set (ℝ × ℝ)) :
    toPlane ⁻¹' interior U ⊆ closure (toPlane ⁻¹' (rationalPoints ∩ U))
Proof
:= by
  intro z hz
  refine mem_closure_iff_nhds.2 fun s hs ↦ ?_
  by_cases hzD : toPlane z ∈ rationalPoints
  · exact ⟨z, mem_of_mem_nhds hs, hzD, interior_subset hz⟩
  · obtain ⟨V, hV, hVs⟩ := exists_subset_of_mem_nhds hzD hs
    obtain ⟨q, hqD, hqV, hqU⟩ :=
      dense_rationalPoints.inter_nhds_nonempty (inter_mem hV (isOpen_interior.mem_nhds hz))
    exact ⟨toPlane.symm q, hVs (by simp [hqD, hqV]), by simp [hqD, interior_subset hqU]⟩

On this site: Rational extension of the plane: The closure of the rational points of a set

instance firstCountableTopology

TopologyByExample.RationalExtensionPlane.firstCountableTopology

The rational extension of the plane is first countable.

instance firstCountableTopology : FirstCountableTopology RationalExtensionPlane
Proof
:=
  ⟨fun x ↦ by
    by_cases hx : toPlane x ∈ rationalPoints
    · rw [nhds_of_mem hx]; infer_instance
    · rw [nhds_of_notMem hx]; infer_instance⟩

On this site: The rational extension of the plane is first countable

instance separableSpace

TopologyByExample.RationalExtensionPlane.separableSpace

The rational extension of the plane is separable: the rational points are dense.

instance separableSpace : SeparableSpace RationalExtensionPlane
Proof
:= by
  refine ⟨⟨toPlane ⁻¹' rationalPoints, countable_rationalPoints.preimage toPlane.injective,
    dense_iff_inter_open.2 fun O hO ⟨x, hx⟩ ↦ ?_⟩⟩
  by_cases hxD : toPlane x ∈ rationalPoints
  · exact ⟨x, hx, hxD⟩
  · obtain ⟨U, hU, hUO⟩ := exists_subset_of_mem_nhds hxD (hO.mem_nhds hx)
    obtain ⟨q, hqD, hqU⟩ := dense_rationalPoints.inter_nhds_nonempty hU
    exact ⟨toPlane.symm q, hUO (by simp [hqD, hqU]), by simp [hqD]⟩

On this site: The rational extension of the plane is separable

instance submetrizableSpace

TopologyByExample.RationalExtensionPlane.submetrizableSpace

The rational extension of the plane is submetrizable.

instance submetrizableSpace : SubmetrizableSpace RationalExtensionPlane
Proof
:=
  submetrizableSpace_of_continuous_injective continuous_toPlane toPlane.injective

On this site: The rational extension of the plane is submetrizable

theorem not_pseudocompactSpace

TopologyByExample.RationalExtensionPlane.not_pseudocompactSpace

The rational extension of the plane is not pseudocompact.

theorem not_pseudocompactSpace : ¬PseudocompactSpace RationalExtensionPlane
Proof
:=
  not_pseudocompactSpace_of_continuous_surjective (f := fun x ↦ (toPlane x).1)
    (continuous_fst.comp continuous_toPlane) fun r ↦ ⟨toPlane.symm (r, 0), by simp⟩

On this site: The rational extension of the plane is not pseudocompact

instance scatteredSpace

TopologyByExample.RationalExtensionPlane.scatteredSpace

The rational extension of the plane is scattered: a rational point is isolated, and a point x outside ℚ² has the neighbourhood {x} ∪ ℚ².

instance scatteredSpace : ScatteredSpace RationalExtensionPlane
Proof
:= by
  refine ⟨fun s hs ↦ eq_empty_iff_forall_notMem.2 fun x hx ↦ ?_⟩
  by_cases h : ∃ y ∈ s, toPlane y ∈ rationalPoints
  · obtain ⟨y, hy, hyD⟩ := h
    obtain ⟨z, ⟨hz, -⟩, hzy⟩ := accPt_iff_nhds.1 (hs y hy) {y}
      (mem_nhds_iff.2 ⟨{y}, subset_rfl, isOpen_singleton hyD, rfl⟩)
    exact hzy hz
  · push Not at h
    obtain ⟨z, ⟨hz, hzs⟩, hzx⟩ := accPt_iff_nhds.1 (hs x hx) _
      ((isOpen_preimage_insert (x := toPlane x) isOpen_univ (mem_univ _)).mem_nhds
        (by simp [toPlane]))
    rcases hz with hz | hz
    · exact hzx (toPlane.injective hz)
    · exact h z hzs hz.1

On this site: The rational extension of the plane is scattered

definition sqrtTwoPoint

TopologyByExample.RationalExtensionPlane.sqrtTwoPoint

The point (√2, t) of the rational extension of the plane.

def sqrtTwoPoint (t : ℝ) : RationalExtensionPlane
:= toPlane.symm (√2, t)

theorem toPlane_sqrtTwoPoint_notMem

TopologyByExample.RationalExtensionPlane.toPlane_sqrtTwoPoint_notMem

The points (√2, t) are not rational points.

theorem toPlane_sqrtTwoPoint_notMem (t : ℝ) : toPlane (sqrtTwoPoint t) ∉ rationalPoints
Proof
:= by
  rintro ⟨⟨q, hq⟩, -⟩
  exact irrational_sqrt_two ⟨q, by simpa [sqrtTwoPoint] using hq⟩

theorem eventually_mem_of_isClopen

TopologyByExample.RationalExtensionPlane.eventually_mem_of_isClopen

A clopen set containing (√2, t) contains (√2, t') for all t' near t.

theorem eventually_mem_of_isClopen {A : Set RationalExtensionPlane} (hA : IsClopen A) {t : ℝ}
    (ht : sqrtTwoPoint t ∈ A) : ∀ᶠ t' in 𝓝 t, sqrtTwoPoint t' ∈ A
Proof
:= by
  obtain ⟨U, hU, hUA⟩ :=
    exists_subset_of_mem_nhds (toPlane_sqrtTwoPoint_notMem t) (hA.2.mem_nhds ht)
  have hc : Continuous fun t' : ℝ ↦ ((√2, t') : ℝ × ℝ) := by fun_prop
  have hmem : ∀ᶠ t' in 𝓝 t, ((√2, t') : ℝ × ℝ) ∈ interior U :=
    hc.continuousAt.preimage_mem_nhds (isOpen_interior.mem_nhds
      (mem_interior_iff_mem_nhds.2 (by simpa [sqrtTwoPoint] using hU)))
  refine hmem.mono fun t' ht' ↦ ?_
  have := preimage_interior_subset_closure U (show toPlane (sqrtTwoPoint t') ∈ interior U by
    simpa [sqrtTwoPoint] using ht')
  exact hA.1.closure_subset (closure_mono hUA this)

theorem not_totallySeparatedSpace

TopologyByExample.RationalExtensionPlane.not_totallySeparatedSpace

The rational extension of the plane is not totally separated: no clopen set contains (√2, 0) but not (√2, 1).

theorem not_totallySeparatedSpace : ¬TotallySeparatedSpace RationalExtensionPlane
Proof
:= by
  intro h
  have hne : sqrtTwoPoint 0 ≠ sqrtTwoPoint 1 := fun he ↦ by
    have := congrArg (fun x ↦ (toPlane x).2) he
    simp [sqrtTwoPoint] at this
  obtain ⟨A, hA, h0, h1⟩ := totallySeparatedSpace_iff_exists_isClopen.1 h hne
  let T : Set ℝ := {t | sqrtTwoPoint t ∈ A}
  have hT : IsClopen T := by
    refine ⟨?_, isOpen_iff_mem_nhds.2 fun t ht ↦ eventually_mem_of_isClopen hA ht⟩
    rw [← isOpen_compl_iff]
    exact isOpen_iff_mem_nhds.2 fun t ht ↦ eventually_mem_of_isClopen hA.compl ht
  rcases isClopen_iff.1 hT with h' | h'
  · have h0' : (0 : ℝ) ∈ T := h0
    rw [h'] at h0'
    exact h0'
  · exact h1 (show (1 : ℝ) ∈ T by rw [h']; trivial)

On this site: The rational extension of the plane is not totally separated

theorem not_semiregularSpace

TopologyByExample.RationalExtensionPlane.not_semiregularSpace

The rational extension of the plane is not semiregular: no regular open set R satisfies (√2, 0) ∈ R ⊆ {(√2, 0)} ∪ ℚ².

theorem not_semiregularSpace : ¬SemiregularSpace RationalExtensionPlane
Proof
:= by
  intro hs
  have hb := semiregularSpace_iff_isRegularOpen.1 hs
  have hx0 := toPlane_sqrtTwoPoint_notMem 0
  obtain ⟨R, hR, hxR, hRN⟩ := hb.exists_subset_of_mem_open
    (show sqrtTwoPoint 0 ∈ toPlane ⁻¹' insert (toPlane (sqrtTwoPoint 0)) (rationalPoints ∩ univ)
      by simp [toPlane])
    (isOpen_preimage_insert isOpen_univ (mem_univ _))
  obtain ⟨U, hU, hUR⟩ := exists_subset_of_mem_nhds hx0 (hR.isOpen.mem_nhds hxR)
  have hx0' : toPlane (sqrtTwoPoint 0) = (√2, 0) := by simp [sqrtTwoPoint]
  obtain ⟨ε, hε, hεU⟩ := Metric.mem_nhds_iff.1 (interior_mem_nhds.2 hU)
  rw [hx0'] at hεU
  obtain ⟨r, hr, hr1, hr2⟩ := exists_irrational_btwn (show √2 < √2 + ε by linarith)
  have hq : ((r, 0) : ℝ × ℝ) ∈ interior U := hεU (by
    rw [Metric.mem_ball, Prod.dist_eq, dist_self, Real.dist_eq, abs_of_pos (sub_pos.2 hr1)]
    exact max_lt (by linarith) hε)
  have hqD : ((r, 0) : ℝ × ℝ) ∉ rationalPoints := fun ⟨⟨q, hq⟩, _⟩ ↦ hr ⟨q, hq⟩
  have hsub : toPlane ⁻¹' insert (r, 0) (rationalPoints ∩ interior U) ⊆ closure R := by
    rintro z (hz | ⟨hzD, hzU⟩)
    · exact closure_mono hUR (preimage_interior_subset_closure U
        (show toPlane z ∈ interior U by rw [show toPlane z = (r, 0) from hz]; exact hq))
    · exact subset_closure (hUR ⟨hzD, interior_subset hzU⟩)
  have hmem : toPlane.symm (r, 0) ∈ R := by
    rw [← isRegularOpen_iff.1 hR]
    exact interior_maximal hsub (isOpen_preimage_insert isOpen_interior hq)
      (show toPlane (toPlane.symm (r, 0)) ∈ _ by rw [Equiv.apply_symm_apply]; exact .inl rfl)
  rcases hRN hmem with h | ⟨h, -⟩
  · rw [hx0', Equiv.apply_symm_apply] at h
    exact (ne_of_gt hr1) (congrArg Prod.fst h)
  · rw [Equiv.apply_symm_apply] at h
    exact hqD h

On this site: The rational extension of the plane is not semiregular

theorem exists_closed_discrete_continuum_le

TopologyByExample.RationalExtensionPlane.exists_closed_discrete_continuum_le

The points outside ℚ² form a closed discrete set of cardinality 𝔠.

theorem exists_closed_discrete_continuum_le :
    ∃ s : Set RationalExtensionPlane, IsClosed s ∧ IsDiscrete s ∧
      Cardinal.continuum ≤ Cardinal.mk s
Proof
:= by
  refine ⟨toPlane ⁻¹' rationalPointsᶜ, isOpen_preimage_rationalPoints.isClosed_compl, ?_, ?_⟩
  · refine isDiscrete_iff_forall_mem_exists_isOpen.2 fun y hy ↦
      ⟨_, isOpen_preimage_insert (x := toPlane y) isOpen_univ (mem_univ _), ?_⟩
    refine Subset.antisymm (fun z ⟨hz, hzc⟩ ↦ ?_) (singleton_subset_iff.2 ⟨by simp, hy⟩)
    rcases hz with hz | hz
    · exact toPlane.injective hz
    · exact absurd hz.1 hzc
  · have : Countable rationalPoints := countable_rationalPoints.to_subtype
    have hmk : Cardinal.mk (rationalPointsᶜ : Set (ℝ × ℝ)) = Cardinal.continuum := by
      have hR2 : Cardinal.mk (ℝ × ℝ) = Cardinal.continuum := by
        rw [Cardinal.mk_prod, Cardinal.lift_id, Cardinal.mk_real, Cardinal.continuum_mul_self]
      rw [Cardinal.mk_compl_of_infinite, hR2]
      rw [hR2]
      exact Cardinal.mk_le_aleph0.trans_lt Cardinal.aleph0_lt_continuum
    rw [← hmk]
    exact (Cardinal.mk_congr (toPlane.subtypeEquiv fun _ ↦ Iff.rfl)).ge

On this site: The rational extension of the plane has a closed discrete subset of cardinality \(\mathfrak{c}\)

instance

The rational extension of the plane is nonempty.

instance : Nonempty RationalExtensionPlane
Proof
:= ⟨toPlane.symm 0⟩

The extensions by the rationals and by the irrationals

theorem dense_range_ratCast

TopologyByExample.RealExtension.dense_range_ratCast

The rationals are dense.

theorem dense_range_ratCast : Dense (range ((↑) : ℚ → ℝ))
Proof
:= Rat.denseRange_cast

theorem dense_compl_range_ratCast

TopologyByExample.RealExtension.dense_compl_range_ratCast

The irrationals are dense.

theorem dense_compl_range_ratCast : Dense (range ((↑) : ℚ → ℝ))ᶜ
Proof
:= dense_irrational

theorem compl_setOf_irrational

TopologyByExample.RealExtension.compl_setOf_irrational

The complement of the irrationals is the set of rationals.

theorem compl_setOf_irrational : {x : ℝ | Irrational x}ᶜ = range ((↑) : ℚ → ℝ)
Proof
:= by
  ext x
  simp [Irrational]

theorem dense_compl_setOf_irrational

TopologyByExample.RealExtension.dense_compl_setOf_irrational

The rationals are dense: the complement of the irrationals is dense.

theorem dense_compl_setOf_irrational : Dense {x : ℝ | Irrational x}ᶜ
Proof
:= by
  rw [compl_setOf_irrational]
  exact Rat.denseRange_cast

instance

The irrationals, as a subspace of the Euclidean line, are completely metrizable.

instance : IsCompletelyMetrizableSpace {x : ℝ | Irrational x}
Proof
:=
  IsGδ.setOfPred_irrational.isCompletelyMetrizableSpace

instance

The indiscrete extension is nonempty.

instance {D : Set ℝ} : Nonempty (IndiscreteExtension D)
Proof
:= ⟨IndiscreteExtension.toReal.symm 0⟩

instance

The pointed extension is nonempty.

instance {D : Set ℝ} : Nonempty (PointedExtension D)
Proof
:= ⟨PointedExtension.toReal.symm 0⟩

instance

The discrete extension is nonempty.

instance {D : Set ℝ} : Nonempty (DiscreteExtension D)
Proof
:= ⟨DiscreteExtension.toReal.symm 0⟩

definition IndiscreteRationalExtension

TopologyByExample.IndiscreteRationalExtension

The indiscrete rational extension of the real line: the topology generated by the Euclidean open sets and the sets ℚ ∩ U, U Euclidean open.

abbrev IndiscreteRationalExtension : Type
:= IndiscreteExtension (range ((↑) : ℚ → ℝ))

On this site: Space: Indiscrete rational extension of the real line

definition IndiscreteIrrationalExtension

TopologyByExample.IndiscreteIrrationalExtension

The indiscrete irrational extension of the real line: the topology generated by the Euclidean open sets and the sets (ℝ \ ℚ) ∩ U, U Euclidean open.

abbrev IndiscreteIrrationalExtension : Type
:= IndiscreteExtension {x : ℝ | Irrational x}

On this site: Space: Indiscrete irrational extension of the real line

definition PointedRationalExtension

TopologyByExample.PointedRationalExtension

The pointed rational extension of the real line: the topology generated by the sets {x} ∪ (ℚ ∩ U), U Euclidean open, x ∈ U.

abbrev PointedRationalExtension : Type
:= PointedExtension (range ((↑) : ℚ → ℝ))

On this site: Space: Pointed rational extension of the real line

definition PointedIrrationalExtension

TopologyByExample.PointedIrrationalExtension

The pointed irrational extension of the real line: the topology generated by the sets {x} ∪ ((ℝ \ ℚ) ∩ U), U Euclidean open, x ∈ U.

abbrev PointedIrrationalExtension : Type
:= PointedExtension {x : ℝ | Irrational x}

On this site: Space: Pointed irrational extension of the real line

definition DiscreteRationalExtension

TopologyByExample.DiscreteRationalExtension

The discrete rational extension of the real line: the topology generated by the Euclidean open sets and the singletons of rationals.

abbrev DiscreteRationalExtension : Type
:= DiscreteExtension (range ((↑) : ℚ → ℝ))

On this site: Space: Discrete rational extension of the real line

theorem denseTrace

TopologyByExample.IndiscreteRationalExtension.denseTrace

The indiscrete rational extension has the DenseTrace property.

theorem denseTrace :
    DenseTrace (toReal : IndiscreteRationalExtension ≃ ℝ) (range ((↑) : ℚ → ℝ))
Proof
:=
  IndiscreteExtension.denseTrace dense_range_ratCast

instance submetrizableSpace

TopologyByExample.IndiscreteRationalExtension.submetrizableSpace

The indiscrete rational extension is submetrizable.

instance submetrizableSpace : SubmetrizableSpace IndiscreteRationalExtension
Proof
:=
  IndiscreteExtension.submetrizableSpace

On this site: The indiscrete rational extension of the real line is submetrizable

instance secondCountableTopology

TopologyByExample.IndiscreteRationalExtension.secondCountableTopology

The indiscrete rational extension is second countable.

instance secondCountableTopology : SecondCountableTopology IndiscreteRationalExtension
Proof
:=
  IndiscreteExtension.secondCountableTopology

On this site: The indiscrete rational extension of the real line is second countable

instance preconnectedSpace

TopologyByExample.IndiscreteRationalExtension.preconnectedSpace

The indiscrete rational extension is connected.

instance preconnectedSpace : PreconnectedSpace IndiscreteRationalExtension
Proof
:=
  denseTrace.preconnectedSpace

On this site: The indiscrete rational extension of the real line is connected

instance totallyPathDisconnectedSpace

TopologyByExample.IndiscreteRationalExtension.totallyPathDisconnectedSpace

The indiscrete rational extension is totally path disconnected.

instance totallyPathDisconnectedSpace : TotallyPathDisconnectedSpace IndiscreteRationalExtension
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' dense_range_ratCast
    dense_compl_range_ratCast).2

On this site: The indiscrete rational extension of the real line is totally path disconnected

theorem not_sigmaCompactSpace

TopologyByExample.IndiscreteRationalExtension.not_sigmaCompactSpace

The indiscrete rational extension is not σ-compact.

theorem not_sigmaCompactSpace : ¬SigmaCompactSpace IndiscreteRationalExtension
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' dense_range_ratCast
    dense_compl_range_ratCast).1

On this site: The indiscrete rational extension of the real line is not σ-compact

theorem not_locallyConnectedSpace

TopologyByExample.IndiscreteRationalExtension.not_locallyConnectedSpace

The indiscrete rational extension is not locally connected.

theorem not_locallyConnectedSpace : ¬LocallyConnectedSpace IndiscreteRationalExtension
Proof
:=
  denseTrace.not_locallyConnectedSpace isOpen_preimage dense_compl_range_ratCast

On this site: The indiscrete rational extension of the real line is not locally connected

theorem not_semiregularSpace

TopologyByExample.IndiscreteRationalExtension.not_semiregularSpace

The indiscrete rational extension is not semiregular.

theorem not_semiregularSpace : ¬SemiregularSpace IndiscreteRationalExtension
Proof
:=
  IndiscreteExtension.not_semiregularSpace dense_range_ratCast dense_compl_range_ratCast

On this site: The indiscrete rational extension of the real line is not semiregular

theorem not_pseudocompactSpace

TopologyByExample.IndiscreteRationalExtension.not_pseudocompactSpace

The indiscrete rational extension is not pseudocompact.

theorem not_pseudocompactSpace : ¬PseudocompactSpace IndiscreteRationalExtension
Proof
:=
  IndiscreteExtension.not_pseudocompactSpace

On this site: The indiscrete rational extension of the real line is not pseudocompact

theorem not_not_isMeagre_univ

TopologyByExample.IndiscreteRationalExtension.not_not_isMeagre_univ

The indiscrete rational extension is of first category in itself.

theorem not_not_isMeagre_univ : ¬¬IsMeagre (univ : Set IndiscreteRationalExtension)
Proof
:=
  not_not_intro (denseTrace.isMeagre_univ isOpen_preimage (countable_range _))

On this site: The indiscrete rational extension of the real line is not of second category

theorem closure_eq

TopologyByExample.IndiscreteRationalExtension.closure_eq

The closure of an open set is the preimage of the Euclidean closure of its image.

theorem closure_eq {O : Set IndiscreteRationalExtension} (hO : IsOpen O) :
    closure O = toReal ⁻¹' closure (toReal '' O)
Proof
:=
  denseTrace.closure_eq hO

On this site: Indiscrete rational extension of the real line: Open sets have their Euclidean closures

theorem isRegularOpen_preimage_iff

TopologyByExample.IndiscreteRationalExtension.isRegularOpen_preimage_iff

The regular open sets are the Euclidean regular open sets.

theorem isRegularOpen_preimage_iff {R : Set ℝ} :
    IsRegularOpen (toReal ⁻¹' R : Set IndiscreteRationalExtension) ↔ IsRegularOpen R
Proof
:=
  denseTrace.isRegularOpen_preimage_iff

On this site: Indiscrete rational extension of the real line: The regular open sets are the Euclidean regular open sets

theorem denseTrace

TopologyByExample.IndiscreteIrrationalExtension.denseTrace

The indiscrete irrational extension has the DenseTrace property.

theorem denseTrace :
    DenseTrace (toReal : IndiscreteIrrationalExtension ≃ ℝ) {x : ℝ | Irrational x}
Proof
:=
  IndiscreteExtension.denseTrace dense_irrational

instance submetrizableSpace

TopologyByExample.IndiscreteIrrationalExtension.submetrizableSpace

The indiscrete irrational extension is submetrizable.

instance submetrizableSpace : SubmetrizableSpace IndiscreteIrrationalExtension
Proof
:=
  IndiscreteExtension.submetrizableSpace

On this site: The indiscrete irrational extension of the real line is submetrizable

instance secondCountableTopology

TopologyByExample.IndiscreteIrrationalExtension.secondCountableTopology

The indiscrete irrational extension is second countable.

instance secondCountableTopology : SecondCountableTopology IndiscreteIrrationalExtension
Proof
:=
  IndiscreteExtension.secondCountableTopology

On this site: The indiscrete irrational extension of the real line is second countable

instance preconnectedSpace

TopologyByExample.IndiscreteIrrationalExtension.preconnectedSpace

The indiscrete irrational extension is connected.

instance preconnectedSpace : PreconnectedSpace IndiscreteIrrationalExtension
Proof
:=
  denseTrace.preconnectedSpace

On this site: The indiscrete irrational extension of the real line is connected

instance totallyPathDisconnectedSpace

TopologyByExample.IndiscreteIrrationalExtension.totallyPathDisconnectedSpace

The indiscrete irrational extension is totally path disconnected.

instance totallyPathDisconnectedSpace :
    TotallyPathDisconnectedSpace IndiscreteIrrationalExtension
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' dense_irrational
    dense_compl_setOf_irrational).2

On this site: The indiscrete irrational extension of the real line is totally path disconnected

theorem not_sigmaCompactSpace

TopologyByExample.IndiscreteIrrationalExtension.not_sigmaCompactSpace

The indiscrete irrational extension is not σ-compact.

theorem not_sigmaCompactSpace : ¬SigmaCompactSpace IndiscreteIrrationalExtension
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' dense_irrational
    dense_compl_setOf_irrational).1

On this site: The indiscrete irrational extension of the real line is not σ-compact

theorem not_locallyConnectedSpace

TopologyByExample.IndiscreteIrrationalExtension.not_locallyConnectedSpace

The indiscrete irrational extension is not locally connected.

theorem not_locallyConnectedSpace : ¬LocallyConnectedSpace IndiscreteIrrationalExtension
Proof
:=
  denseTrace.not_locallyConnectedSpace isOpen_preimage dense_compl_setOf_irrational

On this site: The indiscrete irrational extension of the real line is not locally connected

theorem not_semiregularSpace

TopologyByExample.IndiscreteIrrationalExtension.not_semiregularSpace

The indiscrete irrational extension is not semiregular.

theorem not_semiregularSpace : ¬SemiregularSpace IndiscreteIrrationalExtension
Proof
:=
  IndiscreteExtension.not_semiregularSpace dense_irrational dense_compl_setOf_irrational

On this site: The indiscrete irrational extension of the real line is not semiregular

theorem not_pseudocompactSpace

TopologyByExample.IndiscreteIrrationalExtension.not_pseudocompactSpace

The indiscrete irrational extension is not pseudocompact.

theorem not_pseudocompactSpace : ¬PseudocompactSpace IndiscreteIrrationalExtension
Proof
:=
  IndiscreteExtension.not_pseudocompactSpace

On this site: The indiscrete irrational extension of the real line is not pseudocompact

instance baireSpace

TopologyByExample.IndiscreteIrrationalExtension.baireSpace

The indiscrete irrational extension is a Baire space.

instance baireSpace : BaireSpace IndiscreteIrrationalExtension
Proof
:=
  denseTrace.baireSpace isOpen_preimage

On this site: The indiscrete irrational extension of the real line is a Baire space

theorem closure_eq

TopologyByExample.IndiscreteIrrationalExtension.closure_eq

The closure of an open set is the preimage of the Euclidean closure of its image.

theorem closure_eq {O : Set IndiscreteIrrationalExtension} (hO : IsOpen O) :
    closure O = toReal ⁻¹' closure (toReal '' O)
Proof
:=
  denseTrace.closure_eq hO

On this site: Indiscrete irrational extension of the real line: Open sets have their Euclidean closures

theorem isRegularOpen_preimage_iff

TopologyByExample.IndiscreteIrrationalExtension.isRegularOpen_preimage_iff

The regular open sets are the Euclidean regular open sets.

theorem isRegularOpen_preimage_iff {R : Set ℝ} :
    IsRegularOpen (toReal ⁻¹' R : Set IndiscreteIrrationalExtension) ↔ IsRegularOpen R
Proof
:=
  denseTrace.isRegularOpen_preimage_iff

On this site: Indiscrete irrational extension of the real line: The regular open sets are the Euclidean regular open sets

theorem denseTrace

TopologyByExample.PointedRationalExtension.denseTrace

The pointed rational extension has the DenseTrace property.

theorem denseTrace :
    DenseTrace (toReal : PointedRationalExtension ≃ ℝ) (range ((↑) : ℚ → ℝ))
Proof
:=
  PointedExtension.denseTrace dense_range_ratCast

instance submetrizableSpace

TopologyByExample.PointedRationalExtension.submetrizableSpace

The pointed rational extension is submetrizable.

instance submetrizableSpace : SubmetrizableSpace PointedRationalExtension
Proof
:=
  PointedExtension.submetrizableSpace

On this site: The pointed rational extension of the real line is submetrizable

instance firstCountableTopology

TopologyByExample.PointedRationalExtension.firstCountableTopology

The pointed rational extension is first countable.

instance firstCountableTopology : FirstCountableTopology PointedRationalExtension
Proof
:=
  PointedExtension.firstCountableTopology

On this site: The pointed rational extension of the real line is first countable

instance separableSpace

TopologyByExample.PointedRationalExtension.separableSpace

The pointed rational extension is separable.

instance separableSpace : SeparableSpace PointedRationalExtension
Proof
:=
  PointedExtension.separableSpace dense_range_ratCast (countable_range _)

On this site: The pointed rational extension of the real line is separable

instance preconnectedSpace

TopologyByExample.PointedRationalExtension.preconnectedSpace

The pointed rational extension is connected.

instance preconnectedSpace : PreconnectedSpace PointedRationalExtension
Proof
:=
  denseTrace.preconnectedSpace

On this site: The pointed rational extension of the real line is connected

instance totallyPathDisconnectedSpace

TopologyByExample.PointedRationalExtension.totallyPathDisconnectedSpace

The pointed rational extension is totally path disconnected.

instance totallyPathDisconnectedSpace : TotallyPathDisconnectedSpace PointedRationalExtension
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' dense_range_ratCast
    dense_compl_range_ratCast).2

On this site: The pointed rational extension of the real line is totally path disconnected

theorem not_locallyConnectedSpace

TopologyByExample.PointedRationalExtension.not_locallyConnectedSpace

The pointed rational extension is not locally connected.

theorem not_locallyConnectedSpace : ¬LocallyConnectedSpace PointedRationalExtension
Proof
:=
  denseTrace.not_locallyConnectedSpace isOpen_preimage dense_compl_range_ratCast

On this site: The pointed rational extension of the real line is not locally connected

theorem not_semiregularSpace

TopologyByExample.PointedRationalExtension.not_semiregularSpace

The pointed rational extension is not semiregular.

theorem not_semiregularSpace : ¬SemiregularSpace PointedRationalExtension
Proof
:=
  PointedExtension.not_semiregularSpace dense_range_ratCast dense_compl_range_ratCast

On this site: The pointed rational extension of the real line is not semiregular

theorem not_pseudocompactSpace

TopologyByExample.PointedRationalExtension.not_pseudocompactSpace

The pointed rational extension is not pseudocompact.

theorem not_pseudocompactSpace : ¬PseudocompactSpace PointedRationalExtension
Proof
:=
  PointedExtension.not_pseudocompactSpace

On this site: The pointed rational extension of the real line is not pseudocompact

theorem not_not_isMeagre_univ

TopologyByExample.PointedRationalExtension.not_not_isMeagre_univ

The pointed rational extension is of first category in itself.

theorem not_not_isMeagre_univ : ¬¬IsMeagre (univ : Set PointedRationalExtension)
Proof
:=
  not_not_intro (denseTrace.isMeagre_univ isOpen_preimage (countable_range _))

On this site: The pointed rational extension of the real line is not of second category

theorem exists_closed_discrete_continuum_le

TopologyByExample.PointedRationalExtension.exists_closed_discrete_continuum_le

The irrationals form a closed discrete set of cardinality 𝔠.

theorem exists_closed_discrete_continuum_le :
    ∃ s : Set PointedRationalExtension, IsClosed s ∧ IsDiscrete s ∧
      Cardinal.continuum ≤ Cardinal.mk s
Proof
:=
  PointedExtension.exists_closed_discrete_continuum_le (countable_range _)

On this site: The pointed rational extension of the real line has a closed discrete subset of cardinality \(\mathfrak{c}\)

theorem closure_eq

TopologyByExample.PointedRationalExtension.closure_eq

The closure of an open set is the preimage of the Euclidean closure of its image.

theorem closure_eq {O : Set PointedRationalExtension} (hO : IsOpen O) :
    closure O = toReal ⁻¹' closure (toReal '' O)
Proof
:=
  denseTrace.closure_eq hO

On this site: Pointed rational extension of the real line: Open sets have their Euclidean closures

theorem isRegularOpen_preimage_iff

TopologyByExample.PointedRationalExtension.isRegularOpen_preimage_iff

The regular open sets are the Euclidean regular open sets.

theorem isRegularOpen_preimage_iff {R : Set ℝ} :
    IsRegularOpen (toReal ⁻¹' R : Set PointedRationalExtension) ↔ IsRegularOpen R
Proof
:=
  denseTrace.isRegularOpen_preimage_iff

On this site: Pointed rational extension of the real line: The regular open sets are the Euclidean regular open sets

theorem denseTrace

TopologyByExample.PointedIrrationalExtension.denseTrace

The pointed irrational extension has the DenseTrace property.

theorem denseTrace :
    DenseTrace (toReal : PointedIrrationalExtension ≃ ℝ) {x : ℝ | Irrational x}
Proof
:=
  PointedExtension.denseTrace dense_irrational

instance submetrizableSpace

TopologyByExample.PointedIrrationalExtension.submetrizableSpace

The pointed irrational extension is submetrizable.

instance submetrizableSpace : SubmetrizableSpace PointedIrrationalExtension
Proof
:=
  PointedExtension.submetrizableSpace

On this site: The pointed irrational extension of the real line is submetrizable

instance secondCountableTopology

TopologyByExample.PointedIrrationalExtension.secondCountableTopology

The pointed irrational extension is second countable.

instance secondCountableTopology : SecondCountableTopology PointedIrrationalExtension
Proof
:=
  PointedExtension.secondCountableTopology (by
    rw [compl_setOf_irrational]
    exact countable_range _)

On this site: The pointed irrational extension of the real line is second countable

instance preconnectedSpace

TopologyByExample.PointedIrrationalExtension.preconnectedSpace

The pointed irrational extension is connected.

instance preconnectedSpace : PreconnectedSpace PointedIrrationalExtension
Proof
:=
  denseTrace.preconnectedSpace

On this site: The pointed irrational extension of the real line is connected

instance totallyPathDisconnectedSpace

TopologyByExample.PointedIrrationalExtension.totallyPathDisconnectedSpace

The pointed irrational extension is totally path disconnected.

instance totallyPathDisconnectedSpace : TotallyPathDisconnectedSpace PointedIrrationalExtension
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' dense_irrational
    dense_compl_setOf_irrational).2

On this site: The pointed irrational extension of the real line is totally path disconnected

theorem not_sigmaCompactSpace

TopologyByExample.PointedIrrationalExtension.not_sigmaCompactSpace

The pointed irrational extension is not σ-compact.

theorem not_sigmaCompactSpace : ¬SigmaCompactSpace PointedIrrationalExtension
Proof
:=
  (not_sigmaCompactSpace_and_totallyPathDisconnectedSpace' dense_irrational
    dense_compl_setOf_irrational).1

On this site: The pointed irrational extension of the real line is not σ-compact

theorem not_locallyConnectedSpace

TopologyByExample.PointedIrrationalExtension.not_locallyConnectedSpace

The pointed irrational extension is not locally connected.

theorem not_locallyConnectedSpace : ¬LocallyConnectedSpace PointedIrrationalExtension
Proof
:=
  denseTrace.not_locallyConnectedSpace isOpen_preimage dense_compl_setOf_irrational

On this site: The pointed irrational extension of the real line is not locally connected

theorem not_semiregularSpace

TopologyByExample.PointedIrrationalExtension.not_semiregularSpace

The pointed irrational extension is not semiregular.

theorem not_semiregularSpace : ¬SemiregularSpace PointedIrrationalExtension
Proof
:=
  PointedExtension.not_semiregularSpace dense_irrational dense_compl_setOf_irrational

On this site: The pointed irrational extension of the real line is not semiregular

theorem not_pseudocompactSpace

TopologyByExample.PointedIrrationalExtension.not_pseudocompactSpace

The pointed irrational extension is not pseudocompact.

theorem not_pseudocompactSpace : ¬PseudocompactSpace PointedIrrationalExtension
Proof
:=
  PointedExtension.not_pseudocompactSpace

On this site: The pointed irrational extension of the real line is not pseudocompact

instance baireSpace

TopologyByExample.PointedIrrationalExtension.baireSpace

The pointed irrational extension is a Baire space.

instance baireSpace : BaireSpace PointedIrrationalExtension
Proof
:=
  denseTrace.baireSpace isOpen_preimage

On this site: The pointed irrational extension of the real line is a Baire space

theorem closure_eq

TopologyByExample.PointedIrrationalExtension.closure_eq

The closure of an open set is the preimage of the Euclidean closure of its image.

theorem closure_eq {O : Set PointedIrrationalExtension} (hO : IsOpen O) :
    closure O = toReal ⁻¹' closure (toReal '' O)
Proof
:=
  denseTrace.closure_eq hO

On this site: Pointed irrational extension of the real line: Open sets have their Euclidean closures

theorem isRegularOpen_preimage_iff

TopologyByExample.PointedIrrationalExtension.isRegularOpen_preimage_iff

The regular open sets are the Euclidean regular open sets.

theorem isRegularOpen_preimage_iff {R : Set ℝ} :
    IsRegularOpen (toReal ⁻¹' R : Set PointedIrrationalExtension) ↔ IsRegularOpen R
Proof
:=
  denseTrace.isRegularOpen_preimage_iff

On this site: Pointed irrational extension of the real line: The regular open sets are the Euclidean regular open sets

instance isCompletelyMetrizableSpace

TopologyByExample.DiscreteRationalExtension.isCompletelyMetrizableSpace

The discrete rational extension is completely metrizable.

instance isCompletelyMetrizableSpace : IsCompletelyMetrizableSpace DiscreteRationalExtension
Proof
:=
  DiscreteExtension.isCompletelyMetrizableSpace (countable_range _)

On this site: The discrete rational extension of the real line is completely metrizable

instance zeroDimensionalSpace

TopologyByExample.DiscreteRationalExtension.zeroDimensionalSpace

The discrete rational extension is zero-dimensional.

instance zeroDimensionalSpace : ZeroDimensionalSpace DiscreteRationalExtension
Proof
:=
  DiscreteExtension.zeroDimensionalSpace dense_range_ratCast

On this site: The discrete rational extension of the real line is zero-dimensional

instance secondCountableTopology

TopologyByExample.DiscreteRationalExtension.secondCountableTopology

The discrete rational extension is second countable.

instance secondCountableTopology : SecondCountableTopology DiscreteRationalExtension
Proof
:=
  DiscreteExtension.secondCountableTopology (countable_range _)

On this site: The discrete rational extension of the real line is second countable

theorem not_sigmaCompactSpace

TopologyByExample.DiscreteRationalExtension.not_sigmaCompactSpace

The discrete rational extension is not σ-compact.

theorem not_sigmaCompactSpace : ¬SigmaCompactSpace DiscreteRationalExtension
Proof
:=
  DiscreteExtension.not_sigmaCompactSpace dense_range_ratCast dense_compl_range_ratCast

On this site: The discrete rational extension of the real line is not σ-compact

theorem isClosedEmbedding_embedding

TopologyByExample.DiscreteRationalExtension.isClosedEmbedding_embedding

The embedding x ↦ (x, (|x - q|⁻¹)_{q ∈ ℚ}) (with 0⁻¹ = 0) is a closed embedding of the discrete rational extension into ℝ × ℝ^ℚ.

theorem isClosedEmbedding_embedding :
    Topology.IsClosedEmbedding
      (embedding : DiscreteRationalExtension → ℝ × (range ((↑) : ℚ → ℝ) → ℝ))
Proof
:=
  DiscreteExtension.isClosedEmbedding_embedding

On this site: Discrete rational extension of the real line: A closed embedding into \(\mathbb{R} \times \mathbb{R}^{\mathbb{Q}}\)