Lean library · module TopologyByExample.Theorems.CompactComplementLocalArcs

Local arcs in the compact-complement real line

Source file

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

Imports

theorem arcJoined_escape

TopologyByExample.CompactComplement.arcJoined_escape

An injective ray escaping every compact set extends to an arc starting at any point outside the ray.

private theorem arcJoined_escape {U : Set CompactComplement} {x y : U} (f : ℝ → ℝ)
    (hf : Continuous f) (hi : Function.Injective f) (hlim : Tendsto f atTop (cocompact ℝ))
    (hy : ofReal (f 1) = y.val) (hU : ∀ r ≥ 1, ofReal (f r) ∈ U)
    (hx : ∀ r ≥ 1, ofReal (f r) ≠ x.val) : ArcJoined x y
Proof
:= by
  let g (s : ℝ) := if s ≤ 0 then x.val else ofReal (f s⁻¹)
  have hg : Continuous g := by
    apply continuous_iff_continuousAt.mpr
    intro s
    rcases lt_trichotomy s 0 with hs | rfl | hs
    · apply (continuousAt_const (y := x.val)).congr
      filter_upwards [Iio_mem_nhds hs] with t ht
      simp [g, (mem_Iio.mp ht).le]
    · change Tendsto g (𝓝 0) (𝓝 (g 0))
      rw [← nhdsLE_sup_nhdsGT, tendsto_sup, show g 0 = x.val by simp [g]]
      constructor
      · apply tendsto_const_nhds.congr'
        filter_upwards [self_mem_nhdsWithin] with t ht
        simp [g, mem_Iic.mp ht]
      · apply tendsto_nhds_of_tendsto_cocompact
        apply (hlim.comp tendsto_inv_nhdsGT_zero).congr'
        filter_upwards [self_mem_nhdsWithin] with t ht
        simp [g, (mem_Ioi.mp ht).not_ge]
    · apply (continuous_ofReal.continuousAt.comp (hf.continuousAt.comp
        (continuousAt_inv₀ hs.ne'))).congr
      filter_upwards [Ioi_mem_nhds hs] with t ht
      simp [g, (mem_Ioi.mp ht).not_ge]
  have hgU (s : unitInterval) : g s ∈ U := by
    by_cases hs : (s : ℝ) ≤ 0
    · simp [g, hs]
    · simpa [g, hs] using hU _ ((one_le_inv₀ (lt_of_not_ge hs)).mpr s.property.2)
  let p : Path x y :=
    { toFun := fun t ↦ ⟨g t, hgU t⟩
      continuous_toFun := (hg.comp continuous_subtypeVal).subtype_mk _
      source' := Subtype.ext (by simp [g])
      target' := Subtype.ext (by simpa [g, not_le_of_gt (zero_lt_one : (0 : ℝ) < 1)] using hy) }
  refine fun _ ↦ ⟨p, fun a b hab ↦ Subtype.ext ?_⟩
  have he : g a = g b := congrArg Subtype.val hab
  by_cases ha : (a : ℝ) ≤ 0 <;> by_cases hb : (b : ℝ) ≤ 0
  · exact (le_antisymm ha a.property.1).trans (le_antisymm hb b.property.1).symm
  · simp only [g, ha, hb, ↓reduceIte] at he
    exact (hx _ ((one_le_inv₀ (lt_of_not_ge hb)).mpr b.property.2) he.symm).elim
  · simp only [g, ha, hb, ↓reduceIte] at he
    exact (hx _ ((one_le_inv₀ (lt_of_not_ge ha)).mpr a.property.2) he).elim
  · simp only [g, ha, hb, ↓reduceIte] at he
    exact inv_injective (hi (toReal.symm.injective he))

theorem arcJoined_of_le

TopologyByExample.CompactComplement.arcJoined_of_le

private theorem arcJoined_of_le {p q : ℚ} {n : ℕ} (x y : basicSet p q n)
    (hxy : toReal x ≤ toReal y) : ArcJoined x y
Proof
:= by
  intro hne
  have hlt : toReal x < toReal y := lt_of_le_of_ne hxy (fun he ↦ hne (Subtype.ext
    (toReal.injective he)))
  have hx := x.property
  have hy := y.property
  simp only [basicSet, mem_ofPred_eq, mem_union, mem_Icc, not_or] at hx hy
  by_cases hxL : toReal x < -n
  · let f (r : ℝ) := toReal x + 1 - r
    have hf : Tendsto f atTop (cocompact ℝ) :=
      (tendsto_atBot_add_const_left _ (toReal x + 1) tendsto_neg_atTop_atBot).mono_right
        atBot_le_cocompact
    apply (ArcJoined.symm (arcJoined_escape (x := y) (y := x) f (by fun_prop)
      (fun a b h ↦ by dsimp [f] at h; linarith) hf (by simp [f]) ?_ ?_)) hne
    · intro r hr
      simp only [basicSet, mem_ofPred_eq, mem_union, mem_Icc, not_or, toReal_ofReal, f]
      have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg _
      constructor <;> rintro ⟨h1, h2⟩
      · linarith
      · exact hx.2 ⟨by linarith, by linarith⟩
    · intro r hr he
      have he' := congrArg toReal he
      simp only [f, toReal_ofReal] at he'
      linarith
  by_cases hyR : (n : ℝ) < toReal y
  · let f (r : ℝ) := toReal y - 1 + r
    have hf : Tendsto f atTop (cocompact ℝ) :=
      (tendsto_atTop_add_const_left _ (toReal y - 1) tendsto_id).mono_right atTop_le_cocompact
    apply arcJoined_escape (x := x) (y := y) f (by fun_prop)
      (fun a b h ↦ by dsimp [f] at h; linarith) hf (by simp [f]) ?_ ?_ hne
    · intro r hr
      simp only [basicSet, mem_ofPred_eq, mem_union, mem_Icc, not_or, toReal_ofReal, f]
      have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg _
      constructor <;> rintro ⟨h1, h2⟩
      · exact hy.1 ⟨by linarith, by linarith⟩
      · linarith
    · intro r hr he
      have he' := congrArg toReal he
      simp only [f, toReal_ofReal] at he'
      linarith
  let S := Icc (toReal x) (toReal y)
  have hmem (z : S) : ofReal z.val ∈ basicSet p q n := by
    simp only [basicSet, mem_ofPred_eq, mem_union, mem_Icc, not_or, toReal_ofReal]
    constructor <;> rintro ⟨h1, h2⟩
    · exact hx.1 ⟨not_lt.mp hxL, z.property.1.trans h2⟩
    · exact hy.2 ⟨h1.trans z.property.2, not_lt.mp hyR⟩
  let F (z : S) : basicSet p q n := ⟨ofReal z.val, hmem z⟩
  let a : S := ⟨_, le_rfl, hxy⟩
  let b : S := ⟨_, hxy, le_rfl⟩
  have h : ArcJoined a b := (arcConnectedSpace_of_convex (convex_Icc _ _)).exists_injective_path a b
  have hi : Function.Injective F := fun a b he ↦ Subtype.ext
    (congrArg (fun z : basicSet p q n ↦ toReal z.val) he)
  exact (h.map ((continuous_ofReal.comp continuous_subtypeVal).subtype_mk _) hi) hne

theorem locallyArcConnectedSpace

TopologyByExample.CompactComplement.locallyArcConnectedSpace

The compact complement topology on the real line is locally arc connected.

theorem locallyArcConnectedSpace : LocallyArcConnectedSpace CompactComplement
Proof
:= by
  refine ⟨fun x U hU hx ↦ ?_⟩
  obtain ⟨V, ⟨⟨p, q, n⟩, rfl⟩, hxV, hVU⟩ :=
    isTopologicalBasis_basicSet.exists_subset_of_mem_open hx hU
  refine ⟨_, isOpen_basicSet _ _ _, hxV, hVU, ⟨fun a b ↦ ?_⟩⟩
  rcases le_total (toReal a) (toReal b) with h | h
  · exact arcJoined_of_le a b h
  · exact (arcJoined_of_le b a h).symm

On this site: The compact complement topology is locally arc connected