Lean library · module TopologyByExample.Spaces.WheelDetachedSpokes

The wheel with detached spokes

Source file

Fix an enumeration q₀, q₁, … of the rationals and let uₙ = (cos qₙ, sin qₙ); the points uₙ are distinct and dense in the unit circle. The spoke Aₙ is the segment of points t uₙ with 2⁻⁽ⁿ⁺¹⁾ ≤ t ≤ 1. The wheel with detached spokes is the union of the origin and all the spokes, with the subspace topology of the plane.

The spokes are pairwise disjoint and do not contain the origin, but they come arbitrarily close to it, and each point t uₙ of a spoke is a limit of the points t uₘ of other spokes. So each spoke is nowhere dense, and so is the origin, and the space, a countable union of them, is meagre: it is not of second category. It is connected: in a cover by two closed sets disjoint on the space, the one containing the origin contains all but finitely many spokes, and the outer ends uₙ of the others are limits of the outer ends of those. Off the origin the direction p / ‖p‖ of a point takes only the countably many values uₙ, so a connected set away from the origin lies in one spoke: the space is not locally connected, and no path leaves the origin.

Main definitions

Main statements

Tags

wheel with detached spokes, connected, meagre, locally connected

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 ratEnum

TopologyByExample.WheelDetachedSpokes.ratEnum

An enumeration of the rationals, a bijection ℕ ≃ ℚ.

def ratEnum : ℕ ≃ ℚ
:= (Denumerable.eqv ℚ).symm

definition dir

TopologyByExample.WheelDetachedSpokes.dir

The direction uₙ = (cos qₙ, sin qₙ) of the n-th spoke.

noncomputable def dir (n : ℕ) : ℝ × ℝ
:= (Real.cos (ratEnum n), Real.sin (ratEnum n))

definition pt

TopologyByExample.WheelDetachedSpokes.pt

The point t uₙ.

noncomputable def pt (n : ℕ) (t : ℝ) : ℝ × ℝ
:=
  (t * Real.cos (ratEnum n), t * Real.sin (ratEnum n))

definition spoke

TopologyByExample.WheelDetachedSpokes.spoke

The n-th spoke: the points t uₙ with 2⁻⁽ⁿ⁺¹⁾ ≤ t ≤ 1.

noncomputable def spoke (n : ℕ) : Set (ℝ × ℝ)
:= pt n '' Icc ((1 / 2 : ℝ) ^ (n + 1)) 1

definition wheel

TopologyByExample.WheelDetachedSpokes.wheel

The wheel with detached spokes: the origin and the spokes.

noncomputable def wheel : Set (ℝ × ℝ)
:= insert 0 (⋃ n, spoke n)

theorem continuous_pt

TopologyByExample.WheelDetachedSpokes.continuous_pt

theorem continuous_pt (n : ℕ) : Continuous (pt n)
Proof
:= by unfold pt; fun_prop

definition sqNorm

TopologyByExample.WheelDetachedSpokes.sqNorm

The squared Euclidean norm.

def sqNorm (p : ℝ × ℝ) : ℝ
:= p.1 ^ 2 + p.2 ^ 2

theorem continuous_sqNorm

TopologyByExample.WheelDetachedSpokes.continuous_sqNorm

theorem continuous_sqNorm : Continuous sqNorm
Proof
:= by unfold sqNorm; fun_prop

theorem sqNorm_pt

TopologyByExample.WheelDetachedSpokes.sqNorm_pt

theorem sqNorm_pt (n : ℕ) (t : ℝ) : sqNorm (pt n t) = t ^ 2
Proof
:= by
  simp only [sqNorm, pt]
  nlinarith [Real.cos_sq_add_sin_sq (ratEnum n : ℝ)]

theorem half_pow_pos

TopologyByExample.WheelDetachedSpokes.half_pow_pos

theorem half_pow_pos (n : ℕ) : (0 : ℝ) < (1 / 2) ^ (n + 1)
Proof
:= by positivity

theorem half_pow_le_one

TopologyByExample.WheelDetachedSpokes.half_pow_le_one

theorem half_pow_le_one (n : ℕ) : ((1 : ℝ) / 2) ^ (n + 1) ≤ 1
Proof
:=
  pow_le_one₀ (by norm_num) (by norm_num)

theorem pt_one_mem_spoke

TopologyByExample.WheelDetachedSpokes.pt_one_mem_spoke

The outer end uₙ of the n-th spoke.

theorem pt_one_mem_spoke (n : ℕ) : pt n 1 ∈ spoke n
Proof
:=
  ⟨1, ⟨half_pow_le_one n, le_rfl⟩, rfl⟩

theorem sqNorm_pos_of_mem_spoke

TopologyByExample.WheelDetachedSpokes.sqNorm_pos_of_mem_spoke

Points of spokes are at squared distance at least 2⁻²⁽ⁿ⁺¹⁾ from the origin; in particular they are not the origin.

theorem sqNorm_pos_of_mem_spoke {n : ℕ} {p : ℝ × ℝ} (hp : p ∈ spoke n) : 0 < sqNorm p
Proof
:= by
  obtain ⟨t, ⟨ht, -⟩, rfl⟩ := hp
  rw [sqNorm_pt]
  exact pow_pos ((half_pow_pos n).trans_le ht) 2

theorem dir_injective

TopologyByExample.WheelDetachedSpokes.dir_injective

The directions are pairwise distinct, since π is irrational.

theorem dir_injective : Function.Injective dir
Proof
:= by
  intro a b h
  simp only [dir, Prod.mk.injEq] at h
  have hc : Real.cos ((ratEnum a : ℝ) - ratEnum b) = 1 := by
    rw [Real.cos_sub, h.1, h.2]
    nlinarith [Real.cos_sq_add_sin_sq (ratEnum b : ℝ)]
  obtain ⟨k, hk⟩ := (Real.cos_eq_one_iff _).1 hc
  rcases eq_or_ne k 0 with rfl | hk0
  · simp only [Int.cast_zero, zero_mul] at hk
    exact ratEnum.injective (by exact_mod_cast (sub_eq_zero.1 hk.symm))
  · exfalso
    apply irrational_pi
    refine ⟨((ratEnum a - ratEnum b) / (2 * k) : ℚ), ?_⟩
    push_cast
    rw [← hk]
    field_simp

theorem disjoint_spoke

TopologyByExample.WheelDetachedSpokes.disjoint_spoke

Distinct spokes are disjoint.

theorem disjoint_spoke {m n : ℕ} (hmn : m ≠ n) : Disjoint (spoke m) (spoke n)
Proof
:= by
  rw [Set.disjoint_left]
  rintro _ ⟨t, ⟨ht, -⟩, rfl⟩ ⟨s, ⟨hs, -⟩, hst⟩
  have ht0 : 0 < t := (half_pow_pos m).trans_le ht
  have hs0 : 0 < s := (half_pow_pos n).trans_le hs
  have h2 := congrArg sqNorm hst
  rw [sqNorm_pt, sqNorm_pt] at h2
  have hts : s = t := by nlinarith
  subst hts
  apply hmn
  apply dir_injective
  simp only [pt, Prod.mk.injEq] at hst
  simp only [dir, Prod.mk.injEq]
  exact ⟨(mul_left_cancel₀ hs0.ne' hst.1).symm, (mul_left_cancel₀ hs0.ne' hst.2).symm⟩

theorem dist_pt_le

TopologyByExample.WheelDetachedSpokes.dist_pt_le

The distance from t uₘ to t uₙ is at most |qₘ - qₙ| for 0 ≤ t ≤ 1.

theorem dist_pt_le {m n : ℕ} {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t ≤ 1) :
    dist (pt m t) (pt n t) ≤ |(ratEnum m : ℝ) - ratEnum n|
Proof
:= by
  simp only [pt, Prod.dist_eq, Real.dist_eq]
  rw [← mul_sub, ← mul_sub, abs_mul, abs_mul, abs_of_nonneg ht0]
  refine max_le ?_ ?_
  · exact (mul_le_of_le_one_left (abs_nonneg _) ht1).trans (Real.abs_cos_sub_cos_le _ _)
  · exact (mul_le_of_le_one_left (abs_nonneg _) ht1).trans (Real.abs_sin_sub_sin_le _ _)

theorem exists_ge_abs_sub_lt

TopologyByExample.WheelDetachedSpokes.exists_ge_abs_sub_lt

Every rational is approached by qₘ for arbitrarily large m.

theorem exists_ge_abs_sub_lt (n N : ℕ) {δ : ℝ} (hδ : 0 < δ) :
    ∃ m, N ≤ m ∧ |(ratEnum m : ℝ) - ratEnum n| < δ
Proof
:= by
  obtain ⟨K, hK⟩ := exists_nat_one_div_lt hδ
  set r : ℕ → ℚ := fun k ↦ ratEnum n + 1 / ((k : ℚ) + K + 1)
  have hr : Function.Injective r := by
    intro a b h
    simp only [r, add_right_inj] at h
    have ha : (0 : ℚ) < (a : ℚ) + K + 1 := by positivity
    have hb : (0 : ℚ) < (b : ℚ) + K + 1 := by positivity
    rw [div_eq_div_iff ha.ne' hb.ne', one_mul, one_mul] at h
    exact_mod_cast (by linarith : (a : ℚ) = b)
  obtain ⟨_, ⟨k, rfl⟩, hm⟩ :=
    (Set.infinite_range_of_injective (ratEnum.symm.injective.comp hr)).exists_gt N
  refine ⟨_, hm.le, ?_⟩
  simp only [Function.comp_apply, Equiv.apply_symm_apply, r]
  push_cast
  rw [add_sub_cancel_left, abs_of_pos (by positivity)]
  refine lt_of_le_of_lt ?_ hK
  gcongr
  linarith [k.cast_nonneg' (α := ℝ)]

theorem exists_ge_dist_lt

TopologyByExample.WheelDetachedSpokes.exists_ge_dist_lt

The point t uₙ of a spoke is the limit of points t uₘ of spokes with arbitrarily large index m.

theorem exists_ge_dist_lt (n N : ℕ) {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t ≤ 1) {ε : ℝ} (hε : 0 < ε) :
    ∃ m, N ≤ m ∧ dist (pt m t) (pt n t) < ε
Proof
:= by
  obtain ⟨m, hm, h⟩ := exists_ge_abs_sub_lt n N hε
  exact ⟨m, hm, (dist_pt_le ht0 ht1).trans_lt h⟩

theorem isCompact_spoke

TopologyByExample.WheelDetachedSpokes.isCompact_spoke

theorem isCompact_spoke (n : ℕ) : IsCompact (spoke n)
Proof
:= isCompact_Icc.image (continuous_pt n)

theorem isPathConnected_spoke

TopologyByExample.WheelDetachedSpokes.isPathConnected_spoke

theorem isPathConnected_spoke (n : ℕ) : IsPathConnected (spoke n)
Proof
:=
  ((convex_Icc _ _).isPathConnected (nonempty_Icc.2 (half_pow_le_one n))).image (continuous_pt n)

theorem exists_mem_spoke

TopologyByExample.WheelDetachedSpokes.exists_mem_spoke

A point of the wheel other than the origin lies on a spoke.

theorem exists_mem_spoke {p : ℝ × ℝ} (hp : p ∈ wheel) (h : 0 < sqNorm p) : ∃ n, p ∈ spoke n
Proof
:= by
  rcases hp with rfl | hp
  · simp [sqNorm] at h
  · exact mem_iUnion.1 hp

definition direction

TopologyByExample.WheelDetachedSpokes.direction

The direction p / ‖p‖ of a nonzero point.

noncomputable def direction (p : ℝ × ℝ) : ℝ × ℝ
:=
  ((Real.sqrt (sqNorm p))⁻¹ * p.1, (Real.sqrt (sqNorm p))⁻¹ * p.2)

theorem continuousOn_direction

TopologyByExample.WheelDetachedSpokes.continuousOn_direction

theorem continuousOn_direction : ContinuousOn direction {p | 0 < sqNorm p}
Proof
:= by
  have h : ContinuousOn (fun p : ℝ × ℝ ↦ (Real.sqrt (sqNorm p))⁻¹) {p | 0 < sqNorm p} :=
    (Real.continuous_sqrt.comp continuous_sqNorm).continuousOn.inv₀ fun p hp ↦
      (Real.sqrt_pos.2 hp).ne'
  exact (h.mul continuous_fst.continuousOn).prodMk (h.mul continuous_snd.continuousOn)

theorem direction_of_mem_spoke

TopologyByExample.WheelDetachedSpokes.direction_of_mem_spoke

The direction of a point of the n-th spoke is uₙ.

theorem direction_of_mem_spoke {n : ℕ} {p : ℝ × ℝ} (hp : p ∈ spoke n) : direction p = dir n
Proof
:= by
  obtain ⟨t, ⟨ht, -⟩, rfl⟩ := hp
  have ht0 : 0 < t := (half_pow_pos n).trans_le ht
  rw [direction, sqNorm_pt, Real.sqrt_sq ht0.le]
  simp only [pt, dir, Prod.mk.injEq]
  constructor <;> field_simp

theorem subset_spoke_of_isPreconnected

TopologyByExample.WheelDetachedSpokes.subset_spoke_of_isPreconnected

A preconnected subset of the wheel away from the origin lies in a single spoke.

theorem subset_spoke_of_isPreconnected {s : Set (ℝ × ℝ)} (hs : IsPreconnected s)
    (hsub : s ⊆ wheel) (hpos : ∀ p ∈ s, 0 < sqNorm p) {n : ℕ} {p : ℝ × ℝ} (hp : p ∈ s)
    (hpn : p ∈ spoke n) : s ⊆ spoke n
Proof
:= by
  intro q hq
  obtain ⟨m, hm⟩ := exists_mem_spoke (hsub hq) (hpos q hq)
  have himg : direction '' s ⊆ range dir := by
    rintro _ ⟨r, hr, rfl⟩
    obtain ⟨k, hk⟩ := exists_mem_spoke (hsub hr) (hpos r hr)
    exact ⟨k, (direction_of_mem_spoke hk).symm⟩
  have heq := (countable_range dir).isTotallyDisconnected _ himg
    (hs.image _ (continuousOn_direction.mono hpos)) (mem_image_of_mem _ hq) (mem_image_of_mem _ hp)
  rw [direction_of_mem_spoke hm, direction_of_mem_spoke hpn] at heq
  exact dir_injective heq ▸ hm

theorem isPreconnected_wheel

TopologyByExample.WheelDetachedSpokes.isPreconnected_wheel

The wheel is connected.

theorem isPreconnected_wheel : IsPreconnected wheel
Proof
:= by
  rw [isPreconnected_iff_subset_of_disjoint_closed]
  -- the case where the origin lies in `a`
  have key : ∀ a b : Set (ℝ × ℝ), IsClosed a → IsClosed b → wheel ⊆ a ∪ b →
      wheel ∩ (a ∩ b) = ∅ → (0 : ℝ × ℝ) ∈ a → wheel ⊆ a := by
    intro a b ha hb hcov hdisj h0
    have hspoke : ∀ n, spoke n ⊆ a ∨ spoke n ⊆ b := fun n ↦
      isPreconnected_iff_subset_of_disjoint_closed.1
        (isPathConnected_spoke n).isConnected.isPreconnected a b ha hb
        ((subset_iUnion spoke n).trans (subset_insert _ _) |>.trans hcov)
        (eq_empty_of_subset_empty fun p ⟨hp, hab⟩ ↦
          hdisj ▸ (⟨Or.inr (mem_iUnion.2 ⟨n, hp⟩), hab⟩ : p ∈ wheel ∩ (a ∩ b)))
    have h0b : (0 : ℝ × ℝ) ∉ b := fun h ↦ by
      have : (0 : ℝ × ℝ) ∈ wheel ∩ (a ∩ b) := ⟨mem_insert _ _, h0, h⟩
      rw [hdisj] at this; exact this
    obtain ⟨δ, hδ, hball⟩ := Metric.isOpen_iff.1 hb.isOpen_compl 0 h0b
    obtain ⟨M, hM⟩ := exists_pow_lt_of_lt_one hδ (by norm_num : (1 / 2 : ℝ) < 1)
    -- spokes of index at least `M` come within `δ` of the origin, so lie in `a`
    have hlarge : ∀ m, M ≤ m → spoke m ⊆ a := by
      intro m hm
      refine (hspoke m).resolve_right fun hsub ↦ hball ?_ (hsub ⟨_, ⟨le_rfl,
        half_pow_le_one m⟩, rfl⟩)
      have ht : ((1 : ℝ) / 2) ^ (m + 1) < δ :=
        (pow_le_pow_of_le_one (by norm_num) (by norm_num) (by omega)).trans_lt hM
      have h1 := dist_pt_le (m := m) (n := m) (half_pow_pos m).le (half_pow_le_one m)
      simp only [mem_ball, dist_zero_right]
      calc ‖pt m ((1 / 2) ^ (m + 1))‖
          ≤ ((1 : ℝ) / 2) ^ (m + 1) := by
            simp only [pt, Prod.norm_def, Real.norm_eq_abs, abs_mul,
              abs_of_pos (half_pow_pos m)]
            exact max_le (mul_le_of_le_one_right (half_pow_pos m).le (Real.abs_cos_le_one _))
              (mul_le_of_le_one_right (half_pow_pos m).le (Real.abs_sin_le_one _))
        _ < δ := ht
    refine insert_subset h0 (iUnion_subset fun n ↦ ?_)
    rcases hspoke n with h | h
    · exact h
    · exfalso
      -- the outer end of the `n`-th spoke is a limit of outer ends of spokes in `a`
      have hmem : pt n 1 ∈ a := by
        refine ha.closure_subset (Metric.mem_closure_iff.2 fun ε hε ↦ ?_)
        obtain ⟨m, hm, hd⟩ := exists_ge_dist_lt n M zero_le_one le_rfl hε
        exact ⟨pt m 1, hlarge m hm (pt_one_mem_spoke m), by rw [dist_comm]; exact hd⟩
      have : pt n 1 ∈ wheel ∩ (a ∩ b) :=
        ⟨Or.inr (mem_iUnion.2 ⟨n, pt_one_mem_spoke n⟩), hmem, h (pt_one_mem_spoke n)⟩
      rw [hdisj] at this; exact this
  intro a b ha hb hcov hdisj
  rcases hcov (mem_insert 0 _) with h0 | h0
  · exact Or.inl (key a b ha hb hcov hdisj h0)
  · refine Or.inr (key b a hb ha (hcov.trans (union_comm a b).le) ?_ h0)
    rw [inter_comm b a]; exact hdisj

definition WheelDetachedSpokes

TopologyByExample.WheelDetachedSpokes

The wheel with detached spokes: the subspace WheelDetachedSpokes.wheel of the plane.

abbrev WheelDetachedSpokes : Type
:= WheelDetachedSpokes.wheel

On this site: Space: Wheel with detached spokes

definition hub

TopologyByExample.WheelDetachedSpokes.hub

The origin, the hub of the wheel.

def hub : WheelDetachedSpokes
:= ⟨0, mem_insert _ _⟩

definition ptW

TopologyByExample.WheelDetachedSpokes.ptW

The point t uₙ of the n-th spoke, as a point of the space.

noncomputable def ptW (n : ℕ) (t : ℝ) (ht : t ∈ Icc ((1 / 2 : ℝ) ^ (n + 1)) 1) :
    WheelDetachedSpokes
:=
  ⟨pt n t, Or.inr (mem_iUnion.2 ⟨n, t, ht, rfl⟩)⟩

instance

The space is nonempty.

instance : Nonempty WheelDetachedSpokes
Proof
:= ⟨hub⟩

theorem sigmaCompactSpace

TopologyByExample.WheelDetachedSpokes.sigmaCompactSpace

The wheel with detached spokes is σ-compact: the origin and countably many compact spokes.

theorem sigmaCompactSpace : SigmaCompactSpace WheelDetachedSpokes
Proof
:= by
  refine isSigmaCompact_iff_sigmaCompactSpace.1 ?_
  rw [wheel, insert_eq, ← sUnion_pair]
  refine isSigmaCompact_sUnion _ ((countable_singleton _).insert _) ?_
  rintro ⟨s, rfl | rfl⟩
  · exact isCompact_singleton.isSigmaCompact
  · exact isSigmaCompact_iUnion_of_isCompact _ isCompact_spoke

On this site: Wheel with detached spokes is σ-compact

theorem preconnectedSpace

TopologyByExample.WheelDetachedSpokes.preconnectedSpace

The wheel with detached spokes is connected.

theorem preconnectedSpace : PreconnectedSpace WheelDetachedSpokes
Proof
:=
  Subtype.preconnectedSpace isPreconnected_wheel

On this site: Wheel with detached spokes is connected

theorem not_locallyConnectedSpace

TopologyByExample.WheelDetachedSpokes.not_locallyConnectedSpace

The wheel with detached spokes is not locally connected, at the outer end u₀ of the first spoke: away from the origin a connected set lies in one spoke, but every neighbourhood of u₀ contains points of other spokes.

theorem not_locallyConnectedSpace : ¬LocallyConnectedSpace WheelDetachedSpokes
Proof
:= by
  intro h
  set e := ptW 0 1 ⟨half_pow_le_one 0, le_rfl⟩
  have hU : {p : WheelDetachedSpokes | 1 / 4 < sqNorm p} ∈ 𝓝 e :=
    (isOpen_lt continuous_const (continuous_sqNorm.comp continuous_subtypeVal)).mem_nhds
      (show 1 / 4 < sqNorm (pt 0 1) by rw [sqNorm_pt]; norm_num)
  obtain ⟨V, hV, hVc, hVU⟩ := locallyConnectedSpace_iff_connected_subsets.1 h e _ hU
  have hsub := subset_spoke_of_isPreconnected (hVc.image _ continuous_subtypeVal.continuousOn)
    (by rintro _ ⟨p, -, rfl⟩; exact p.property)
    (by rintro _ ⟨p, hp, rfl⟩; exact (by norm_num : (0 : ℝ) < 1 / 4).trans (hVU hp))
    (mem_image_of_mem _ (mem_of_mem_nhds hV)) (pt_one_mem_spoke 0)
  obtain ⟨u, hu, huV⟩ := (mem_nhds_subtype _ _ _).1 hV
  obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.1 hu
  obtain ⟨m, hm, hd⟩ := exists_ge_dist_lt 0 1 zero_le_one le_rfl hε
  have hmV : ptW m 1 ⟨half_pow_le_one m, le_rfl⟩ ∈ V := huV (hball hd)
  have := hsub (mem_image_of_mem _ hmV)
  exact Set.disjoint_left.1 (disjoint_spoke (by omega : m ≠ 0)) (pt_one_mem_spoke m) this

On this site: Wheel with detached spokes is not locally connected

theorem not_joined_hub

TopologyByExample.WheelDetachedSpokes.not_joined_hub

No path joins the outer end of the first spoke to the origin: along such a path the set of times at which it lies on the first spoke is closed, and also open, since near such a time the path stays away from the origin and so in one spoke.

theorem not_joined_hub : ¬Joined (ptW 0 1 ⟨half_pow_le_one 0, le_rfl⟩) hub
Proof
:= by
  rintro ⟨γ⟩
  set g : ℝ → ℝ × ℝ := fun t ↦ (γ.extend t : ℝ × ℝ) with hg_def
  have hg : Continuous g := continuous_subtypeVal.comp γ.continuous_extend
  have hmem : ∀ t, g t ∈ wheel := fun t ↦ (γ.extend t).property
  have hclosed : IsClosed {t | g t ∈ spoke 0} := (isCompact_spoke 0).isClosed.preimage hg
  have hopen : IsOpen {t | g t ∈ spoke 0} := by
    rw [Metric.isOpen_iff]
    intro t (ht : g t ∈ spoke 0)
    have hpos : 1 / 8 < sqNorm (g t) := by
      obtain ⟨s, ⟨hs, -⟩, hs'⟩ := ht
      rw [← hs', sqNorm_pt]
      norm_num at hs ⊢
      nlinarith
    have hU : g ⁻¹' {p | 1 / 8 < sqNorm p} ∈ 𝓝 t :=
      hg.continuousAt.preimage_mem_nhds
        ((isOpen_lt continuous_const continuous_sqNorm).mem_nhds hpos)
    obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.1 hU
    refine ⟨ε, hε, fun s hs ↦ ?_⟩
    exact subset_spoke_of_isPreconnected
      ((Real.ball_eq_Ioo t ε ▸ isPreconnected_Ioo).image g hg.continuousOn)
      (by rintro _ ⟨r, -, rfl⟩; exact hmem r)
      (by rintro _ ⟨r, hr, rfl⟩; exact (by norm_num : (0 : ℝ) < 1 / 8).trans (hball hr))
      (mem_image_of_mem g (Metric.mem_ball_self hε)) ht (mem_image_of_mem g hs)
  have hzero : g 0 = pt 0 1 := by simp only [hg_def, Path.extend_zero]; rfl
  have huniv := IsClopen.eq_univ ⟨hclosed, hopen⟩
    ⟨0, by simp only [mem_ofPred_eq, hzero]; exact pt_one_mem_spoke 0⟩
  have h1 : (1 : ℝ) ∈ {t | g t ∈ spoke 0} := huniv.symm ▸ mem_univ _
  have hone : g 1 = 0 := by simp only [hg_def, Path.extend_one]; rfl
  have := sqNorm_pos_of_mem_spoke (show g 1 ∈ spoke 0 from h1)
  rw [hone] at this
  simp [sqNorm] at this

theorem not_pathPreconnectedSpace

TopologyByExample.WheelDetachedSpokes.not_pathPreconnectedSpace

The wheel with detached spokes is not path connected.

theorem not_pathPreconnectedSpace : ¬PathPreconnectedSpace WheelDetachedSpokes
Proof
:= fun h ↦
  not_joined_hub (h.joined _ _)

On this site: Wheel with detached spokes is not path connected

theorem interior_eq_empty_of_forall

TopologyByExample.WheelDetachedSpokes.interior_eq_empty_of_forall

A closed subset of the space containing no point of the spokes of large index has empty interior, if each of its points is a limit of such points.

theorem interior_eq_empty_of_forall {S : Set WheelDetachedSpokes}
    (h : ∀ x ∈ S, ∀ ε > 0, ∃ y : WheelDetachedSpokes, y ∉ S ∧ dist (y : ℝ × ℝ) x < ε) :
    interior S = ∅
Proof
:= by
  refine eq_empty_of_forall_notMem fun x hx ↦ ?_
  obtain ⟨u, hu, huS⟩ := (mem_nhds_subtype _ _ _).1 (isOpen_interior.mem_nhds hx)
  obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.1 hu
  obtain ⟨y, hyS, hy⟩ := h x (interior_subset hx) ε hε
  exact hyS (interior_subset (huS (hball hy)))

theorem isNowhereDense_spoke

TopologyByExample.WheelDetachedSpokes.isNowhereDense_spoke

Each spoke is nowhere dense in the space: each of its points t uₙ is a limit of points t uₘ of other spokes.

theorem isNowhereDense_spoke (n : ℕ) :
    IsNowhereDense (((↑) : WheelDetachedSpokes → ℝ × ℝ) ⁻¹' spoke n)
Proof
:= by
  rw [((isCompact_spoke n).isClosed.preimage continuous_subtypeVal).isNowhereDense_iff]
  refine interior_eq_empty_of_forall fun x hx ε hε ↦ ?_
  obtain ⟨t, ⟨ht, ht1⟩, htx⟩ := hx
  have ht0 : 0 ≤ t := (half_pow_pos n).le.trans ht
  obtain ⟨m, hm, hd⟩ := exists_ge_dist_lt n (n + 1) ht0 ht1 hε
  have htm : t ∈ Icc ((1 / 2 : ℝ) ^ (m + 1)) 1 :=
    ⟨(pow_le_pow_of_le_one (by norm_num) (by norm_num) (by omega)).trans ht, ht1⟩
  refine ⟨ptW m t htm, fun hmem ↦ ?_, by rw [← htx]; exact hd⟩
  exact Set.disjoint_left.1 (disjoint_spoke (by omega : m ≠ n)) ⟨t, htm, rfl⟩ hmem

On this site: Wheel with detached spokes: Each spoke is nowhere dense

theorem isNowhereDense_hub

TopologyByExample.WheelDetachedSpokes.isNowhereDense_hub

The origin is nowhere dense in the space: it is the limit of the inner ends of the spokes.

theorem isNowhereDense_hub : IsNowhereDense ({hub} : Set WheelDetachedSpokes)
Proof
:= by
  rw [isClosed_singleton.isNowhereDense_iff]
  refine interior_eq_empty_of_forall fun x hx ε hε ↦ ?_
  rw [mem_singleton_iff] at hx
  subst hx
  obtain ⟨M, hM⟩ := exists_pow_lt_of_lt_one hε (by norm_num : (1 / 2 : ℝ) < 1)
  refine ⟨ptW M ((1 / 2) ^ (M + 1)) ⟨le_rfl, half_pow_le_one M⟩, fun h ↦ ?_, ?_⟩
  · have := sqNorm_pos_of_mem_spoke (n := M) ⟨_, ⟨le_rfl, half_pow_le_one M⟩, rfl⟩
    rw [mem_singleton_iff] at h
    rw [show pt M ((1 / 2) ^ (M + 1)) = 0 from congrArg Subtype.val h] at this
    simp [sqNorm] at this
  · simp only [ptW, hub, dist_zero_right]
    calc ‖pt M ((1 / 2) ^ (M + 1))‖
        ≤ ((1 : ℝ) / 2) ^ (M + 1) := by
          simp only [pt, Prod.norm_def, Real.norm_eq_abs, abs_mul, abs_of_pos (half_pow_pos M)]
          exact max_le (mul_le_of_le_one_right (half_pow_pos M).le (Real.abs_cos_le_one _))
            (mul_le_of_le_one_right (half_pow_pos M).le (Real.abs_sin_le_one _))
      _ ≤ (1 / 2) ^ M := pow_le_pow_of_le_one (by norm_num) (by norm_num) (by omega)
      _ < ε := hM

theorem not_not_isMeagre_univ

TopologyByExample.WheelDetachedSpokes.not_not_isMeagre_univ

The wheel with detached spokes is meagre in itself: it is the union of the origin and the spokes, countably many nowhere dense sets. So it is not of second category.

theorem not_not_isMeagre_univ : ¬¬IsMeagre (univ : Set WheelDetachedSpokes)
Proof
:= by
  refine not_not_intro (IsMeagre.mono ?_ (isNowhereDense_hub.isMeagre.union
    (isMeagre_iUnion fun n ↦ (isNowhereDense_spoke n).isMeagre)))
  rintro ⟨p, hp | hp⟩ -
  · exact Or.inl (Subtype.ext hp)
  · obtain ⟨n, hn⟩ := mem_iUnion.1 hp
    exact Or.inr (mem_iUnion.2 ⟨n, hn⟩)

On this site: Wheel with detached spokes is not of second category

theorem not_totallyPathDisconnectedSpace

TopologyByExample.WheelDetachedSpokes.not_totallyPathDisconnectedSpace

The wheel with detached spokes is not totally path disconnected: the first spoke is a path.

theorem not_totallyPathDisconnectedSpace : ¬TotallyPathDisconnectedSpace WheelDetachedSpokes
Proof
:= by
  intro h
  have h1 : pt 0 1 ∈ spoke 0 := pt_one_mem_spoke 0
  have h2 : pt 0 (1 / 2) ∈ spoke 0 := ⟨1 / 2, ⟨by norm_num, by norm_num⟩, rfl⟩
  have hj := (((isPathConnected_spoke 0).joinedIn _ h1 _ h2).mono fun p hp ↦
    show p ∈ wheel from Or.inr (mem_iUnion.2 ⟨0, hp⟩)).joined_subtype
  have := congrArg (fun p : WheelDetachedSpokes ↦ sqNorm p) (h.eq_of_joined _ _ hj)
  simp only [sqNorm_pt] at this
  norm_num at this

On this site: Wheel with detached spokes is not totally path disconnected