Lean library · module TopologyByExample.Spaces.KTopology

The K-topology on the real line

Source file

Let K = {1 / n | n = 1, 2, 3, …}. The K-topology on ℝ (Smirnov's deleted sequence topology) is generated by the usual open sets together with the single set ℝ \ K. Its open sets are exactly the sets U \ B with U open in the usual topology and B ⊆ K.

The K-topology is finer than the usual topology, so it is Hausdorff, and it is second countable. It makes K closed while every neighbourhood of 0 comes arbitrarily close to K, so the closed set K and the point 0 cannot be separated by open sets. Hence the space is not regular, and in particular it is neither metrizable nor normal.

Away from 0 the K-topology agrees with the usual topology, so the sets {x | 1 / (m + 1) ≤ |x| ≤ n}, which are compact in the usual topology and avoid 0, are compact in the K-topology too. Together with {0} they show that ℝₖ is σ-compact.

Main definitions

Main statements

Notation

  • ℝₖ: the real line with the K-topology.

Separation axioms

Connectedness

The K-topology is connected, not path connected and not locally connected (TopologyByExample.KTopology.preconnectedSpace, TopologyByExample.KTopology.not_pathPreconnectedSpace, TopologyByExample.KTopology.not_locallyConnectedSpace). It agrees with the usual topology away from 0, so (-∞, 0) and (0, ∞) are connected, and 0 lies in the closure of both. A path from 0 to 1 would have a compact image containing all of the closed discrete set K = {1 / n}, which is infinite. A connected neighbourhood of 0 missing K would contain some positive point p and hence, being connected, the point 1 / n < p of K.

References

  • L. A. Steen and J. A. Seebach, Counterexamples in Topology, Example 64.
  • J. R. Munkres, Topology, §13 and §31.

Tags

K-topology, Smirnov's deleted sequence topology, counterexample, regular space, metrizable space

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

definition KTopology

TopologyByExample.KTopology

The real line with the K-topology (denoted ℝₖ within the TopologyByExample.KTopology namespace): the topology generated by the usual open sets together with ℝ \ K, where K = {1 / n | n = 1, 2, 3, …} is TopologyByExample.KTopology.kSet.

def KTopology : Type
:= ℝ

On this site: Space: K-topology on the real line

@[inherit_doc]
scoped[KTopology] notation "ℝₖ" => TopologyByExample.KTopology

definition kSet

TopologyByExample.KTopology.kSet

The set K = {1 / n | n = 1, 2, 3, …}, indexed as 1 / (n + 1) for n : ℕ.

def kSet : Set ℝ
:= range fun n : ℕ ↦ ((n : ℝ) + 1)⁻¹

theorem mem_kSet

TopologyByExample.KTopology.mem_kSet

theorem mem_kSet {x : ℝ} : x ∈ kSet ↔ ∃ n : ℕ, ((n : ℝ) + 1)⁻¹ = x
Proof
:= Iff.rfl

theorem inv_natCast_add_one_mem_kSet

TopologyByExample.KTopology.inv_natCast_add_one_mem_kSet

theorem inv_natCast_add_one_mem_kSet (n : ℕ) : ((n : ℝ) + 1)⁻¹ ∈ kSet
Proof
:= ⟨n, rfl⟩

theorem countable_kSet

TopologyByExample.KTopology.countable_kSet

theorem countable_kSet : kSet.Countable
Proof
:= countable_range _

theorem zero_notMem_kSet

TopologyByExample.KTopology.zero_notMem_kSet

theorem zero_notMem_kSet : (0 : ℝ) ∉ kSet
Proof
:= by
  rintro ⟨n, hn⟩
  exact (inv_pos.2 n.cast_add_one_pos).ne' hn

theorem eventually_mem_kSet_imp_eq

TopologyByExample.KTopology.eventually_mem_kSet_imp_eq

Each point of K has a neighbourhood meeting K only in that point.

theorem eventually_mem_kSet_imp_eq {x : ℝ} (hx : x ∈ kSet) : ∀ᶠ y in 𝓝 x, y ∈ kSet → y = x
Proof
:= by
  obtain ⟨n, rfl⟩ := hx
  have hne : ((n : ℝ) + 1)⁻¹ ≠ 0 := inv_ne_zero n.cast_add_one_pos.ne'
  have hmem : Ioo ((n : ℝ) + 1 / 2) (n + 3 / 2) ∈ 𝓝 ((n : ℝ) + 1)⁻¹⁻¹ := by
    rw [inv_inv]
    exact Ioo_mem_nhds (by linarith) (by linarith)
  filter_upwards [continuousAt_inv₀ hne hmem] with y hy hyK
  obtain ⟨m, rfl⟩ := hyK
  rw [mem_preimage, inv_inv, mem_Ioo] at hy
  have h₁ : m < n + 1 := by exact_mod_cast (show (m : ℝ) < n + 1 by linarith)
  have h₂ : n < m + 1 := by exact_mod_cast (show (n : ℝ) < m + 1 by linarith)
  rw [show m = n by omega]

definition toReal

TopologyByExample.KTopology.toReal

The identity map from ℝₖ to ℝ.

def toReal : ℝₖ ≃ ℝ
:= Equiv.refl ℝ

instance

The K-topology: the coarsest topology finer than the usual one in which ℝ \ K is open.

instance : TopologicalSpace ℝₖ
Proof
:=
  induced toReal inferInstance ⊓ generateFrom {toReal ⁻¹' kSetᶜ}

theorem continuous_toReal

TopologyByExample.KTopology.continuous_toReal

The K-topology is finer than the usual topology.

theorem continuous_toReal : Continuous toReal
Proof
:=
  continuous_iff_le_induced.2 inf_le_left

theorem isOpen_preimage_toReal

TopologyByExample.KTopology.isOpen_preimage_toReal

theorem isOpen_preimage_toReal {U : Set ℝ} (hU : IsOpen U) : IsOpen (toReal ⁻¹' U)
Proof
:=
  hU.preimage continuous_toReal

theorem isOpen_compl_kSet

TopologyByExample.KTopology.isOpen_compl_kSet

theorem isOpen_compl_kSet : IsOpen (toReal ⁻¹' kSetᶜ)
Proof
:=
  (inf_le_right : (inferInstance : TopologicalSpace ℝₖ) ≤ _) _
    (isOpen_generateFrom_of_mem rfl)

theorem isClosed_kSet

TopologyByExample.KTopology.isClosed_kSet

K is closed in the K-topology.

theorem isClosed_kSet : IsClosed (toReal ⁻¹' kSet)
Proof
:=
  isOpen_compl_iff.1 isOpen_compl_kSet

theorem nhds_eq_of_mem

TopologyByExample.KTopology.nhds_eq_of_mem

theorem nhds_eq_of_mem {x : ℝₖ} (hx : toReal x ∈ kSet) : 𝓝 x = comap toReal (𝓝 (toReal x))
Proof
:= by
  refine (nhds_inf (t₁ := induced toReal inferInstance) (t₂ := generateFrom _)).trans ?_
  rw [nhds_induced, nhds_generateFrom]
  simp [hx]

theorem nhds_eq_of_notMem

TopologyByExample.KTopology.nhds_eq_of_notMem

theorem nhds_eq_of_notMem {x : ℝₖ} (hx : toReal x ∉ kSet) :
    𝓝 x = comap toReal (𝓝[kSetᶜ] (toReal x))
Proof
:= by
  refine (nhds_inf (t₁ := induced toReal inferInstance) (t₂ := generateFrom _)).trans ?_
  rw [nhds_induced, nhds_generateFrom, nhdsWithin, comap_inf, comap_principal]
  simp only [mem_ofPred_eq, mem_singleton_iff, and_comm (a := x ∈ _), iInf_and, iInf_iInf_eq_left]
  exact congrArg _ (iInf_pos hx)

theorem nhds_basis_of_mem

TopologyByExample.KTopology.nhds_basis_of_mem

At a point of K, the neighbourhoods in the K-topology are the usual ones.

theorem nhds_basis_of_mem {x : ℝₖ} (hx : toReal x ∈ kSet) :
    (𝓝 x).HasBasis (0 < ·) fun ε ↦ toReal ⁻¹' Ioo (toReal x - ε) (toReal x + ε)
Proof
:= by
  rw [nhds_eq_of_mem hx]
  exact (nhds_basis_Ioo_pos _).comap _

theorem nhds_basis_of_notMem

TopologyByExample.KTopology.nhds_basis_of_notMem

At a point outside K, a basic neighbourhood in the K-topology is a usual one minus K.

theorem nhds_basis_of_notMem {x : ℝₖ} (hx : toReal x ∉ kSet) :
    (𝓝 x).HasBasis (0 < ·) fun ε ↦ toReal ⁻¹' (Ioo (toReal x - ε) (toReal x + ε) \ kSet)
Proof
:= by
  rw [nhds_eq_of_notMem hx]
  exact (nhdsWithin_hasBasis (nhds_basis_Ioo_pos _) _).comap _

theorem isOpen_iff

TopologyByExample.KTopology.isOpen_iff

The open sets of the K-topology are the sets U \ B with U open in ℝ and B ⊆ K.

theorem isOpen_iff {s : Set ℝₖ} :
    IsOpen s ↔ ∃ U : Set ℝ, IsOpen U ∧ ∃ B ⊆ kSet, s = toReal ⁻¹' (U \ B)
Proof
:= by
  constructor
  · intro hs
    have hsU : toReal '' s ⊆ interior (toReal '' s ∪ kSet) := by
      rintro _ ⟨x, hx, rfl⟩
      rw [mem_interior_iff_mem_nhds]
      by_cases hK : toReal x ∈ kSet
      · obtain ⟨t, ht, hts⟩ := mem_comap.1 (nhds_eq_of_mem hK ▸ hs.mem_nhds hx)
        refine mem_of_superset ht fun y hy ↦ .inl ⟨toReal.symm y, hts ?_, by simp⟩
        simpa using hy
      · obtain ⟨t, ht, hts⟩ := mem_comap.1 (nhds_eq_of_notMem hK ▸ hs.mem_nhds hx)
        obtain ⟨u, hu, hut⟩ := mem_nhdsWithin_iff_exists_mem_nhds_inter.1 ht
        refine mem_of_superset hu fun y hy ↦ or_iff_not_imp_right.2 fun hyK ↦
          ⟨toReal.symm y, hts ?_, by simp⟩
        simpa using hut ⟨hy, hyK⟩
    refine ⟨interior (toReal '' s ∪ kSet), isOpen_interior, interior (toReal '' s ∪ kSet) \
      toReal '' s, fun y hy ↦ (interior_subset hy.1).resolve_left hy.2, ?_⟩
    ext x
    have := @hsU (toReal x)
    simp only [mem_image_equiv, Equiv.symm_apply_apply, mem_preimage, Set.mem_sdiff, not_and,
      not_not] at this ⊢
    tauto
  · rintro ⟨U, hU, B, hB, rfl⟩
    rw [isOpen_iff_mem_nhds]
    rintro x ⟨hxU, hxB⟩
    by_cases hK : toReal x ∈ kSet
    · rw [nhds_eq_of_mem hK]
      filter_upwards [preimage_mem_comap (hU.mem_nhds hxU),
        (eventually_mem_kSet_imp_eq hK).comap toReal] with y hyU hy
      exact ⟨hyU, fun hyB ↦ hxB (hy (hB hyB) ▸ hyB)⟩
    · rw [nhds_eq_of_notMem hK]
      filter_upwards [preimage_mem_comap (inter_mem_nhdsWithin kSetᶜ (hU.mem_nhds hxU))]
        with y ⟨hyK, hyU⟩
      exact ⟨hyU, fun hyB ↦ hyK (hB hyB)⟩

instance instSecondCountableTopology

TopologyByExample.KTopology.instSecondCountableTopology

ℝₖ is second countable.

instance instSecondCountableTopology : SecondCountableTopology ℝₖ
Proof
:=
  secondCountableTopology_inf (secondCountableTopology_induced ℝₖ ℝ toReal)
    (@SecondCountableTopology.mk _ (generateFrom _) ⟨_, countable_singleton _, rfl⟩)

On this site: The K-topology on the real line is second countable

instance instT2Space

TopologyByExample.KTopology.instT2Space

ℝₖ is Hausdorff, since its topology is finer than the usual one.

instance instT2Space : T2Space ℝₖ
Proof
:=
  .of_injective_continuous toReal.injective continuous_toReal

On this site: The K-topology on the real line is Hausdorff

theorem not_disjoint_nhdsSet_kSet_nhds_zero

TopologyByExample.KTopology.not_disjoint_nhdsSet_kSet_nhds_zero

The closed set K and the point 0 have no disjoint neighbourhoods.

theorem not_disjoint_nhdsSet_kSet_nhds_zero :
    ¬Disjoint (𝓝ˢ (toReal ⁻¹' kSet)) (𝓝 (toReal.symm 0))
Proof
:= by
  rw [Filter.disjoint_iff]
  rintro ⟨W, hW, V, hV, hWV⟩
  have h0 : toReal (toReal.symm 0) ∉ kSet := by simpa using zero_notMem_kSet
  obtain ⟨ε, hε, hεV⟩ := (nhds_basis_of_notMem h0).mem_iff.1 hV
  obtain ⟨n, hn⟩ := exists_nat_one_div_lt hε
  rw [one_div] at hn
  have hx : toReal (toReal.symm ((n : ℝ) + 1)⁻¹) ∈ kSet := by
    simpa using inv_natCast_add_one_mem_kSet n
  obtain ⟨δ, hδ, hδW⟩ := (nhds_basis_of_mem hx).mem_iff.1 (mem_nhdsSet_iff_forall.1 hW _ hx)
  simp only [Equiv.apply_symm_apply] at hεV hδW
  have hpos : (0 : ℝ) < ((n : ℝ) + 1)⁻¹ := inv_pos.2 n.cast_add_one_pos
  obtain ⟨z, ⟨hzδ, hzε⟩, hzK⟩ := (countable_kSet.dense_compl ℝ).inter_open_nonempty
    (Ioo (((n : ℝ) + 1)⁻¹ - δ) (((n : ℝ) + 1)⁻¹ + δ) ∩ Ioo (0 - ε) (0 + ε))
    (isOpen_Ioo.inter isOpen_Ioo)
    ⟨((n : ℝ) + 1)⁻¹, ⟨by linarith, by linarith⟩, ⟨by linarith, by linarith⟩⟩
  refine Set.disjoint_left.1 hWV (show toReal.symm z ∈ W from hδW ?_) (hεV ?_)
  · simpa using hzδ
  · simpa using And.intro hzε hzK

On this site: K-topology on the real line: The point \(0\) and the set \(K\) cannot be separated

theorem not_regularSpace

TopologyByExample.KTopology.not_regularSpace

ℝₖ is not regular: the closed set K and the point 0 ∉ K cannot be separated.

theorem not_regularSpace : ¬RegularSpace ℝₖ
Proof
:= fun _ ↦
  not_disjoint_nhdsSet_kSet_nhds_zero <| disjoint_nhdsSet_nhds.2 <| by
    rw [isClosed_kSet.closure_eq]
    simpa using zero_notMem_kSet

On this site: The K-topology on the real line is not regular

theorem not_pseudoMetrizableSpace

TopologyByExample.KTopology.not_pseudoMetrizableSpace

ℝₖ is not pseudometrizable.

theorem not_pseudoMetrizableSpace : ¬PseudoMetrizableSpace ℝₖ
Proof
:= fun _ ↦
  not_regularSpace inferInstance

theorem not_metrizableSpace

TopologyByExample.KTopology.not_metrizableSpace

ℝₖ is not metrizable.

theorem not_metrizableSpace : ¬MetrizableSpace ℝₖ
Proof
:= fun _ ↦
  not_pseudoMetrizableSpace inferInstance

theorem not_normalSpace

TopologyByExample.KTopology.not_normalSpace

ℝₖ is not normal.

theorem not_normalSpace : ¬NormalSpace ℝₖ
Proof
:= fun _ ↦
  not_regularSpace inferInstance

theorem isClosed_insert_zero_kSet

TopologyByExample.KTopology.isClosed_insert_zero_kSet

K ∪ {0} is closed in ℝ: it is the range of a sequence together with its limit 0.

theorem isClosed_insert_zero_kSet : IsClosed (insert 0 kSet)
Proof
:= by
  have : Tendsto (fun n : ℕ ↦ ((n : ℝ) + 1)⁻¹) atTop (𝓝 0) := by
    simpa only [one_div] using tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)
  exact this.isCompact_insert_range.isClosed

theorem continuousAt_toReal_symm

TopologyByExample.KTopology.continuousAt_toReal_symm

Away from 0, the K-topology agrees with the usual topology: the identity from ℝ to ℝₖ is continuous at every x ≠ 0. At points of K the neighbourhoods are the usual ones; at other points x ≠ 0, the set ℝ \ (K ∪ {0}) is a usual neighbourhood of x missing K.

theorem continuousAt_toReal_symm {x : ℝ} (hx : x ≠ 0) : ContinuousAt toReal.symm x
Proof
:= by
  by_cases hK : x ∈ kSet
  · rw [ContinuousAt, nhds_eq_of_mem (by simpa using hK), tendsto_comap_iff]
    simp only [Function.comp_def, Equiv.apply_symm_apply]
    exact tendsto_id
  · rw [ContinuousAt, nhds_eq_of_notMem (by simpa using hK), tendsto_comap_iff]
    simp only [Function.comp_def, Equiv.apply_symm_apply]
    refine tendsto_nhdsWithin_iff.2 ⟨tendsto_id, ?_⟩
    filter_upwards [isClosed_insert_zero_kSet.isOpen_compl.mem_nhds (by simp [hx, hK])] with y hy
    exact fun h ↦ hy (.inr h)

On this site: K-topology on the real line: Away from \(0\) the K-topology agrees with the Euclidean topology

theorem isCompact_image_toReal_symm

TopologyByExample.KTopology.isCompact_image_toReal_symm

A set that is compact in the usual topology and does not contain 0 is compact in the K-topology.

theorem isCompact_image_toReal_symm {C : Set ℝ} (hC : IsCompact C) (h0 : (0 : ℝ) ∉ C) :
    IsCompact (toReal.symm '' C)
Proof
:=
  hC.image_of_continuousOn fun _ hx ↦
    (continuousAt_toReal_symm fun h ↦ h0 (h ▸ hx)).continuousWithinAt

On this site: K-topology on the real line: Euclidean compact sets not containing \(0\) are compact

instance instSigmaCompactSpace

TopologyByExample.KTopology.instSigmaCompactSpace

ℝₖ is σ-compact: it is the union of {0} and the sets {x | 1 / (m + 1) ≤ |x| ≤ n}, which are compact by isCompact_image_toReal_symm.

instance instSigmaCompactSpace : SigmaCompactSpace ℝₖ
Proof
:= by
  refine .of_countable (insert {toReal.symm 0} (range fun p : ℕ × ℕ ↦
    toReal.symm '' {x : ℝ | ((p.1 : ℝ) + 1)⁻¹ ≤ |x| ∧ |x| ≤ p.2})) ((countable_range _).insert _)
    ?_ ?_
  · simp only [forall_mem_insert, isCompact_singleton, forall_mem_range, true_and]
    rintro ⟨m, n⟩
    refine isCompact_image_toReal_symm (isCompact_Icc.of_isClosed_subset
      ((isClosed_le continuous_const continuous_abs).inter
        (isClosed_le continuous_abs continuous_const)) fun x hx ↦ abs_le.1 hx.2) fun h ↦ ?_
    have := h.1
    rw [abs_zero] at this
    exact (inv_pos.2 m.cast_add_one_pos).not_ge this
  · refine eq_univ_of_forall fun x ↦ ?_
    by_cases hx : toReal x = 0
    · exact mem_sUnion_of_mem (by simp [← hx]) (mem_insert _ _)
    · obtain ⟨m, hm⟩ := exists_nat_one_div_lt (abs_pos.2 hx)
      obtain ⟨n, hn⟩ := exists_nat_ge |toReal x|
      refine mem_sUnion.2 ⟨_, mem_insert_of_mem _ ⟨(m, n), rfl⟩, toReal x, ⟨?_, hn⟩,
        toReal.symm_apply_apply x⟩
      rw [← one_div]
      exact hm.le

On this site: The K-topology on the real line is σ-compact

Separation axioms

instance instT25Space

TopologyByExample.KTopology.instT25Space

The K-topology is Urysohn (T₂½): it is finer than the Euclidean topology of ℝ, which is.

instance instT25Space : T25Space KTopology
Proof
:=
  T25Space.of_injective_continuous toReal.injective continuous_toReal

On this site: The K-topology on the real line is Urysohn

Connectedness

theorem toReal_symm_zero_notMem

TopologyByExample.KTopology.toReal_symm_zero_notMem

The point 0 of the K-topology is not in K.

theorem toReal_symm_zero_notMem : toReal (toReal.symm 0) ∉ kSet
Proof
:= by
  simpa using zero_notMem_kSet

theorem exists_pos_mem_of_mem_nhds

TopologyByExample.KTopology.exists_pos_mem_of_mem_nhds

Every neighbourhood of 0 in the K-topology contains a positive point.

theorem exists_pos_mem_of_mem_nhds {V : Set KTopology} (hV : V ∈ 𝓝 (toReal.symm 0)) :
    ∃ p : ℝ, 0 < p ∧ p ∉ kSet ∧ toReal.symm p ∈ V
Proof
:= by
  obtain ⟨ε, hε, hεV⟩ := (nhds_basis_of_notMem toReal_symm_zero_notMem).mem_iff.1 hV
  obtain ⟨p, ⟨hp0, hpε⟩, hpK⟩ := (countable_kSet.dense_compl ℝ).inter_open_nonempty
    (Ioo 0 ε) isOpen_Ioo (nonempty_Ioo.2 hε)
  refine ⟨p, hp0, hpK, hεV ?_⟩
  simp only [mem_preimage, Equiv.apply_symm_apply]
  exact ⟨⟨by linarith, by linarith⟩, hpK⟩

theorem preconnectedSpace

TopologyByExample.KTopology.preconnectedSpace

The K-topology is connected. The sets (-∞, 0) and (0, ∞) are connected, the K-topology agreeing with the usual one away from 0, and 0 lies in the closure of each.

theorem preconnectedSpace : PreconnectedSpace KTopology
Proof
:= by
  have hcont (s : Set ℝ) (hs : (0 : ℝ) ∉ s) : ContinuousOn toReal.symm s := fun x hx ↦
    (continuousAt_toReal_symm fun h ↦ hs (h ▸ hx)).continuousWithinAt
  have hpos : IsPreconnected (toReal.symm '' Ioi 0) :=
    isPreconnected_Ioi.image _ (hcont _ fun h ↦ lt_irrefl _ h)
  have hneg : IsPreconnected (toReal.symm '' Iio 0) :=
    isPreconnected_Iio.image _ (hcont _ fun h ↦ lt_irrefl _ h)
  have hpos' : toReal.symm 0 ∈ closure (toReal.symm '' Ioi 0) :=
    mem_closure_iff_nhds.2 fun V hV ↦ by
      obtain ⟨p, hp, -, hpV⟩ := exists_pos_mem_of_mem_nhds hV
      exact ⟨_, hpV, p, hp, rfl⟩
  have hneg' : toReal.symm 0 ∈ closure (toReal.symm '' Iio 0) := by
    refine (mem_closure_iff_nhds_basis (nhds_basis_of_notMem toReal_symm_zero_notMem)).2
      fun ε hε ↦ ⟨toReal.symm (-(ε / 2)), ⟨-(ε / 2), by simp only [mem_Iio]; linarith, rfl⟩, ?_⟩
    simp only [mem_preimage, Equiv.apply_symm_apply, Set.mem_sdiff]
    refine ⟨⟨by linarith, by linarith⟩, fun ⟨n, hn⟩ ↦ ?_⟩
    have : (0 : ℝ) < ((n : ℝ) + 1)⁻¹ := inv_pos.2 n.cast_add_one_pos
    linarith
  have h := (hneg.subset_closure (subset_insert _ _) (insert_subset hneg' subset_closure)).union
    (toReal.symm 0) (mem_insert _ _) (mem_insert _ _)
    (hpos.subset_closure (subset_insert _ _) (insert_subset hpos' subset_closure))
  refine ⟨?_⟩
  convert h using 1
  refine (eq_univ_of_forall fun x ↦ ?_).symm
  rcases lt_trichotomy (toReal x) 0 with hx | hx | hx
  · exact .inl (.inr ⟨toReal x, hx, by simp⟩)
  · exact .inl (.inl (by rw [← hx]; simp))
  · exact .inr (.inr ⟨toReal x, hx, by simp⟩)

On this site: The K-topology on the real line is connected

theorem infinite_kSet

TopologyByExample.KTopology.infinite_kSet

The set K is infinite.

theorem infinite_kSet : kSet.Infinite
Proof
:=
  infinite_range_of_injective fun m n h ↦ by simpa using h

theorem isDiscrete_kSet

TopologyByExample.KTopology.isDiscrete_kSet

K is a discrete subset of the K-topology.

theorem isDiscrete_kSet : IsDiscrete (toReal ⁻¹' kSet)
Proof
:= by
  refine isDiscrete_iff_forall_mem_exists_isOpen.2 fun y hy ↦ ?_
  obtain ⟨W, hW, hWo, hyW⟩ := eventually_nhds_iff.1 (eventually_mem_kSet_imp_eq hy)
  refine ⟨toReal ⁻¹' W, isOpen_preimage_toReal hWo, ?_⟩
  ext z
  simp only [mem_inter_iff, mem_preimage, mem_singleton_iff]
  refine ⟨fun hz ↦ toReal.injective (hW _ hz.1 hz.2), ?_⟩
  rintro rfl
  exact ⟨hyW, hy⟩

theorem not_pathPreconnectedSpace

TopologyByExample.KTopology.not_pathPreconnectedSpace

The K-topology is not path connected: no path joins 0 to 1. The image of such a path would be compact and, by the intermediate value theorem, contain all of the closed set K, which is infinite and discrete.

theorem not_pathPreconnectedSpace : ¬PathPreconnectedSpace KTopology
Proof
:= fun h ↦ by
  obtain ⟨γ⟩ := h.joined (toReal.symm 0) (toReal.symm 1)
  have hIcc : Icc (0 : ℝ) 1 ⊆ range (toReal ∘ γ) := by
    simpa using intermediate_value_univ 0 1 (continuous_toReal.comp γ.continuous)
  have hsub : toReal ⁻¹' kSet ⊆ range γ := fun x hx ↦ by
    obtain ⟨n, hn⟩ := hx
    have hn0 : (0 : ℝ) < ((n : ℝ) + 1)⁻¹ := inv_pos.2 n.cast_add_one_pos
    have hn1 : ((n : ℝ) + 1)⁻¹ ≤ 1 := inv_le_one_of_one_le₀ (by simp)
    obtain ⟨t, ht⟩ := hIcc ⟨hn0.le, hn1⟩
    exact ⟨t, toReal.injective (ht.trans hn)⟩
  have hfin : (toReal ⁻¹' kSet).Finite :=
    (((isCompact_range γ.continuous).inter_left isClosed_kSet).finite
      (isDiscrete_kSet.mono inter_subset_left)).subset fun x hx ↦ ⟨hx, hsub hx⟩
  exact infinite_kSet (hfin.of_preimage toReal.surjective)

On this site: The K-topology on the real line is not path connected

theorem not_locallyConnectedSpace

TopologyByExample.KTopology.not_locallyConnectedSpace

The K-topology is not locally connected at 0. A connected open set containing 0 and missing K contains a positive point p; choosing 1 / n < p in K, the open sets (-∞, 1 / n) and (1 / n, ∞) would split it.

theorem not_locallyConnectedSpace : ¬LocallyConnectedSpace KTopology
Proof
:= fun h ↦ by
  obtain ⟨V, hVU, hVo, h0V, hVc⟩ := locallyConnectedSpace_iff_subsets_isOpen_isConnected.1 h
    (toReal.symm 0) _ (isOpen_compl_kSet.mem_nhds toReal_symm_zero_notMem)
  obtain ⟨p, hp, -, hpV⟩ := exists_pos_mem_of_mem_nhds (hVo.mem_nhds h0V)
  obtain ⟨n, hn⟩ := exists_nat_one_div_lt hp
  rw [one_div] at hn
  have hk : ((n : ℝ) + 1)⁻¹ ∈ kSet := inv_natCast_add_one_mem_kSet n
  have hk0 : (0 : ℝ) < ((n : ℝ) + 1)⁻¹ := inv_pos.2 n.cast_add_one_pos
  obtain ⟨z, -, hz₁, hz₂⟩ := hVc.isPreconnected _ _ (isOpen_preimage_toReal isOpen_Iio)
    (isOpen_preimage_toReal isOpen_Ioi) (fun x hx ↦ by
      rcases lt_trichotomy (toReal x) ((n : ℝ) + 1)⁻¹ with h | h | h
      · exact .inl h
      · exact absurd (h ▸ hk) (hVU hx)
      · exact .inr h)
    ⟨_, h0V, by simpa using hk0⟩ ⟨toReal.symm p, hpV, by simpa using hn⟩
  exact lt_asymm (show toReal z < _ from hz₁) hz₂

On this site: The K-topology on the real line is not locally connected

The K-topology

instance

The K-topology is nonempty.

instance : Nonempty KTopology
Proof
:= inferInstanceAs (Nonempty ℝ)

instance functionallyHausdorffSpace

TopologyByExample.KTopology.functionallyHausdorffSpace

The K-topology is functionally Hausdorff: the identity to ℝ is a continuous injection.

instance functionallyHausdorffSpace : FunctionallyHausdorffSpace KTopology
Proof
:=
  functionallyHausdorffSpace_iff_real.2 fun _ _ hxy ↦
    ⟨⟨toReal, continuous_toReal⟩, toReal.injective.ne hxy⟩

On this site: The K-topology on the real line is functionally Hausdorff

theorem not_semiregularSpace

TopologyByExample.KTopology.not_semiregularSpace

The K-topology is not semiregular. The open set ℝ \ K contains 0; any regular open set V with 0 ∈ V ⊆ ℝ \ K contains a set (-ε, ε) \ K, so its closure contains the usual open interval (-ε, ε), whose points of K then lie in the interior of the closure of V, that is, in V.

theorem not_semiregularSpace : ¬SemiregularSpace KTopology
Proof
:= by
  intro ⟨h⟩
  have h0 : toReal (toReal.symm 0) ∉ kSet := toReal_symm_zero_notMem
  obtain ⟨V, hVreg, h0V, hVK⟩ :=
    h.isOpen_iff.1 isOpen_compl_kSet (toReal.symm 0) (by simpa using h0)
  have hVo : IsOpen V := hVreg ▸ isOpen_interior
  obtain ⟨ε, hε, hεV⟩ := (nhds_basis_of_notMem h0).mem_iff.1 (hVo.mem_nhds h0V)
  have hsub : toReal ⁻¹' Ioo (-ε) ε ⊆ closure V := by
    intro x hx
    simp only [mem_preimage, Equiv.apply_symm_apply, zero_sub, zero_add] at hεV hx
    by_cases hxK : toReal x ∈ kSet
    · rw [mem_closure_iff_nhds_basis (nhds_basis_of_mem hxK)]
      intro δ hδ
      obtain ⟨p, ⟨hp1, hp2⟩, hpK⟩ := (countable_kSet.dense_compl ℝ).inter_open_nonempty
        (Ioo (toReal x - δ) (toReal x + δ) ∩ Ioo (-ε) ε) (isOpen_Ioo.inter isOpen_Ioo)
        ⟨toReal x, ⟨by linarith, by linarith⟩, hx⟩
      exact ⟨toReal.symm p, hεV (by simpa using ⟨hp2, hpK⟩), by simpa using hp1⟩
    · exact subset_closure (hεV ⟨hx, hxK⟩)
  have hint : toReal ⁻¹' Ioo (-ε) ε ⊆ V := by
    rw [← show interior (closure V) = V from hVreg]
    exact interior_maximal hsub (isOpen_preimage_toReal isOpen_Ioo)
  obtain ⟨n, hn⟩ := exists_nat_one_div_lt hε
  have hmem : toReal.symm ((n : ℝ) + 1)⁻¹ ∈ toReal ⁻¹' Ioo (-ε) ε := by
    have hpos : (0 : ℝ) < ((n : ℝ) + 1)⁻¹ := inv_pos.2 n.cast_add_one_pos
    simp only [mem_preimage, Equiv.apply_symm_apply, mem_Ioo]
    exact ⟨by linarith, by simpa [one_div] using hn⟩
  have := hVK (hint hmem)
  simp only [mem_preimage, Equiv.apply_symm_apply, mem_compl_iff] at this
  exact this (inv_natCast_add_one_mem_kSet n)

On this site: The K-topology on the real line is not semiregular

theorem not_pseudocompactSpace

TopologyByExample.KTopology.not_pseudocompactSpace

The K-topology is not pseudocompact: the identity to ℝ is an unbounded continuous real function.

theorem not_pseudocompactSpace : ¬PseudocompactSpace KTopology
Proof
:= by
  intro ⟨h⟩
  obtain ⟨⟨b, hb⟩, -⟩ := h ⟨toReal, continuous_toReal⟩
  obtain ⟨x, hx⟩ := exists_gt b
  exact (hb ⟨toReal.symm x, by simp⟩).not_gt hx

On this site: The K-topology on the real line is not pseudocompact

theorem not_totallyPathDisconnectedSpace

TopologyByExample.KTopology.not_totallyPathDisconnectedSpace

The K-topology is not totally path disconnected: t ↦ 1 + t is a path from 1 to 2, the K-topology agreeing with the usual topology away from 0.

theorem not_totallyPathDisconnectedSpace : ¬TotallyPathDisconnectedSpace KTopology
Proof
:= by
  intro ⟨h⟩
  have hcont : Continuous fun t : unitInterval ↦ toReal.symm (1 + (t : ℝ)) := by
    refine continuous_iff_continuousAt.2 fun t ↦ ?_
    have hne : (1 : ℝ) + t ≠ 0 := by have := t.property.1; linarith
    exact (continuousAt_toReal_symm hne).comp (f := fun t : unitInterval ↦ 1 + (t : ℝ))
      (continuous_const.add continuous_subtypeVal).continuousAt
  have hj : Joined (toReal.symm 1) (toReal.symm 2) :=
    ⟨{ toFun := fun t ↦ toReal.symm (1 + (t : ℝ))
       continuous_toFun := hcont
       source' := by simp
       target' := by norm_num }⟩
  have := congrArg toReal (h _ _ hj)
  norm_num at this

On this site: The K-topology on the real line is not totally path disconnected

theorem baireSpace

TopologyByExample.KTopology.baireSpace

The K-topology is a Baire space: it is finer than the usual topology, and every nonempty open set contains a nonempty usual open set (around a point other than 0, where the two topologies agree).

theorem baireSpace : BaireSpace KTopology
Proof
:= by
  refine baireSpace_of_continuous_of_surjective continuous_toReal toReal.surjective
    fun U hU ⟨x, hx⟩ ↦ ?_
  obtain ⟨y, hy0, hyU⟩ : ∃ y : ℝ, y ≠ 0 ∧ toReal.symm y ∈ U := by
    by_cases hx0 : toReal x = 0
    · obtain ⟨p, hp, -, hpU⟩ := exists_pos_mem_of_mem_nhds
        (by rw [← hx0, Equiv.symm_apply_apply]; exact hU.mem_nhds hx)
      exact ⟨p, hp.ne', hpU⟩
    · exact ⟨toReal x, hx0, by simpa using hx⟩
  have hnhds : toReal.symm ⁻¹' U ∈ 𝓝 y := continuousAt_toReal_symm hy0 (hU.mem_nhds hyU)
  refine ⟨interior (toReal.symm ⁻¹' U), isOpen_interior,
    ⟨y, mem_interior_iff_mem_nhds.2 hnhds⟩, fun z hz ↦ ?_⟩
  have hz' : toReal z ∈ toReal.symm ⁻¹' U := interior_subset (mem_preimage.1 hz)
  rwa [mem_preimage, Equiv.symm_apply_apply] at hz'

On this site: The K-topology on the real line is a Baire space

theorem not_isMeagre_univ

TopologyByExample.KTopology.not_isMeagre_univ

The K-topology is of second category in itself.

theorem not_isMeagre_univ : ¬IsMeagre (Set.univ : Set KTopology)
Proof
:=
  haveI := baireSpace
  not_isMeagre_univ_of_baireSpace