Lean library · module TopologyByExample.Theorems.LocallyConnectedPaths
Small connected chains in locally connected metric spaces
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
variable {X : Type*} [MetricSpace X] [LocallyConnectedSpace X]
definition SmallLink
TopologyByExample.LocallyConnectedPaths.SmallLink
Two points belonging to one small open connected set.
def SmallLink (ε : ℝ) (x y : X) : Prop
:=
∃ V : Set X, IsOpen V ∧ IsConnected V ∧ x ∈ V ∧ y ∈ V ∧
∀ u ∈ V, ∀ v ∈ V, dist u v < ε
theorem exists_small_neighbourhood
TopologyByExample.LocallyConnectedPaths.exists_small_neighbourhood
Local connectedness supplies connected neighbourhoods of small diameter.
theorem exists_small_neighbourhood (x : X) {ε : ℝ} (hε : 0 < ε) :
∃ V : Set X, IsOpen V ∧ IsConnected V ∧ x ∈ V ∧
∀ u ∈ V, ∀ v ∈ V, dist u v < ε
Proof
:= by
obtain ⟨V, ⟨hVo, hxV, hVc⟩, hV⟩ :=
(LocallyConnectedSpace.open_connected_basis x).mem_iff.mp
(ball_mem_nhds x (half_pos hε))
refine ⟨V, hVo, hVc, hxV, fun u hu v hv ↦ ?_⟩
have hu' : dist u x < ε / 2 := hV hu
have hv' : dist v x < ε / 2 := hV hv
calc
dist u v ≤ dist u x + dist x v := dist_triangle _ _ _
_ < ε := by rw [dist_comm x v]; linarith
theorem smallLink_chain
TopologyByExample.LocallyConnectedPaths.smallLink_chain
Connectedness turns small connected neighbourhoods into finite chains.
theorem smallLink_chain [PreconnectedSpace X] {ε : ℝ} (hε : 0 < ε) (x y : X) :
Relation.ReflTransGen (SmallLink ε) x y
Proof
:= by
let A : Set X := {z | Relation.ReflTransGen (SmallLink ε) x z}
have hAo : IsOpen A := isOpen_iff_mem_nhds.mpr fun z hz ↦ by
obtain ⟨V, hVo, hVc, hzV, hV⟩ := exists_small_neighbourhood z hε
exact Filter.mem_of_superset (hVo.mem_nhds hzV) fun w hw ↦
hz.tail ⟨V, hVo, hVc, hzV, hw, hV⟩
have hAc : IsOpen Aᶜ := isOpen_iff_mem_nhds.mpr fun z hz ↦ by
obtain ⟨V, hVo, hVc, hzV, hV⟩ := exists_small_neighbourhood z hε
refine Filter.mem_of_superset (hVo.mem_nhds hzV) fun w hw hwA ↦ ?_
exact hz (hwA.tail ⟨V, hVo, hVc, hw, hzV, hV⟩)
have he : A = univ := IsClopen.eq_univ ⟨by simpa using hAc.isClosed_compl, hAo⟩
⟨x, Relation.ReflTransGen.refl⟩
change y ∈ A
rw [he]
exact mem_univ y
definition SmallLinkWithin
TopologyByExample.LocallyConnectedPaths.SmallLinkWithin
A small link whose witnessing neighbourhood lies in a prescribed set.
def SmallLinkWithin (ε : ℝ) (U : Set X) (x y : X) : Prop
:=
∃ V : Set X, V ⊆ U ∧ IsOpen V ∧ IsConnected V ∧ x ∈ V ∧ y ∈ V ∧
∀ u ∈ V, ∀ v ∈ V, dist u v < ε
theorem smallLink_chain_within
TopologyByExample.LocallyConnectedPaths.smallLink_chain_within
Chains can be refined inside any connected open neighbourhood.
theorem smallLink_chain_within {U : Set X} (hU : IsOpen U) (hUc : IsPreconnected U)
{ε : ℝ} (hε : 0 < ε) {x y : X} (hx : x ∈ U) (hy : y ∈ U) :
Relation.ReflTransGen (SmallLinkWithin ε U) x y
Proof
:= by
let : LocallyConnectedSpace U := hU.isOpenEmbedding_subtypeVal.locallyConnectedSpace
let : PreconnectedSpace U := isPreconnected_iff_preconnectedSpace.mp hUc
have h := smallLink_chain hε (⟨x, hx⟩ : U) ⟨y, hy⟩
refine Relation.ReflTransGen.lift (fun z : U ↦ (z : X)) (fun a b hab ↦ ?_) _ _ h
obtain ⟨V, hVo, hVc, ha, hb, hV⟩ := hab
refine ⟨Subtype.val '' V, ?_, hU.isOpenMap_subtypeVal V hVo,
hVc.image _ continuous_subtypeVal.continuousOn, mem_image_of_mem _ ha,
mem_image_of_mem _ hb, ?_⟩
· rintro z ⟨w, _, rfl⟩
exact w.property
· rintro u ⟨a, ha, rfl⟩ v ⟨b, hb, rfl⟩
exact hV a ha b hb
theorem finite_chain
TopologyByExample.LocallyConnectedPaths.finite_chain
A reflexive transitive relation witness gives a finite sequence of links.
theorem finite_chain {α : Type*} {r : α → α → Prop} {a b : α}
(h : Relation.ReflTransGen r a b) :
∃ n : ℕ, ∃ f : ℕ → α, f 0 = a ∧ f n = b ∧ ∀ i < n, r (f i) (f (i + 1))
Proof
:= by
classical
induction h with
| refl => exact ⟨0, fun _ ↦ a, rfl, rfl, fun i hi ↦ (Nat.not_lt_zero i hi).elim⟩
| @tail b c hab hbc ih =>
obtain ⟨n, f, hf0, hfn, hf⟩ := ih
refine ⟨n + 1, Function.update f (n + 1) c, ?_, by simp, fun i hi ↦ ?_⟩
· simpa using hf0
· by_cases hin : i = n
· subst i
simpa [Function.update_of_ne (show n ≠ n + 1 by omega), hfn] using hbc
· have hil : i < n := by omega
simpa [Function.update_of_ne (show i ≠ n + 1 by omega),
Function.update_of_ne (show i + 1 ≠ n + 1 by omega)] using hf i hil
theorem finite_small_chain_within
TopologyByExample.LocallyConnectedPaths.finite_small_chain_within
A connected open set admits finite refinements by small connected open sets.
theorem finite_small_chain_within {U : Set X} (hU : IsOpen U) (hUc : IsPreconnected U)
{ε : ℝ} (hε : 0 < ε) {x y : X} (hx : x ∈ U) (hy : y ∈ U) :
∃ n : ℕ, ∃ f : ℕ → X, f 0 = x ∧ f n = y ∧
∀ i < n, SmallLinkWithin ε U (f i) (f (i + 1))
Proof
:=
finite_chain (smallLink_chain_within hU hUc hε hx hy)