Lean library · module TopologyByExample.Theorems.BiconnectedObstructions

Disjoint connected sets in a biconnected space

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
variable {X : Type*} [TopologicalSpace X]

definition SeparatedInUnion

TopologyByExample.SeparatedInUnion

private def SeparatedInUnion (a b : Set X) : Prop
:=
  Disjoint a (closure b) ∧ Disjoint b (closure a)

theorem exists_separation

TopologyByExample.exists_separation

private theorem exists_separation {s : Set X} (hs : ¬ IsPreconnected s) :
    ∃ a b, a.Nonempty ∧ b.Nonempty ∧ a ∪ b = s ∧ SeparatedInUnion a b
Proof
:= by
  rw [isPreconnected_iff_subset_of_disjoint_closed] at hs
  push Not at hs
  obtain ⟨u, v, hu, hv, hcov, hd, hnu, hnv⟩ := hs
  obtain ⟨x, hxs, hxv⟩ := Set.not_subset.mp hnv
  obtain ⟨y, hys, hyu⟩ := Set.not_subset.mp hnu
  have hdis {z : X} (hz : z ∈ s) (hzu : z ∈ u) (hzv : z ∈ v) : False := by
    have h : z ∈ s ∩ (u ∩ v) := ⟨hz, hzu, hzv⟩
    rwa [hd] at h
  refine ⟨s ∩ u, s ∩ v, ⟨x, hxs, (hcov hxs).resolve_right hxv⟩,
    ⟨y, hys, (hcov hys).resolve_left hyu⟩, by grind, ?_, ?_⟩
  · exact Set.disjoint_left.mpr fun _ ha hb ↦
      hdis ha.1 ha.2 (closure_minimal inter_subset_right hv hb)
  · exact Set.disjoint_left.mpr fun _ hb ha ↦
      hdis hb.1 (closure_minimal inter_subset_right hu ha) hb.2

theorem subset_one_side

TopologyByExample.subset_one_side

private theorem subset_one_side {s a b : Set X} (hs : IsPreconnected s)
    (hcov : s ⊆ a ∪ b) (hd : SeparatedInUnion a b) : s ⊆ a ∨ s ⊆ b
Proof
:= by
  have ha := Set.disjoint_left.mp hd.1
  have hb := Set.disjoint_left.mp hd.2
  have hc : s ⊆ closure a ∪ closure b :=
    hcov.trans (union_subset_union subset_closure subset_closure)
  have hi : s ∩ (closure a ∩ closure b) = ∅ := by
    apply eq_empty_iff_forall_notMem.mpr
    intro x ⟨hx, hxa, hxb⟩
    exact (hcov hx).elim (fun h ↦ ha h hxb) (fun h ↦ hb h hxa)
  exact (isPreconnected_iff_subset_of_disjoint_closed.mp hs _ _ isClosed_closure
    isClosed_closure hc hi).imp
    (fun h _ hx ↦ (hcov hx).resolve_right (fun hs ↦ hb hs (h hx)))
    (fun h _ hx ↦ (hcov hx).resolve_left (fun hs ↦ ha hs (h hx)))

theorem join_one_side

TopologyByExample.join_one_side

private theorem join_one_side [PreconnectedSpace X] {s a b : Set X} (hs : IsPreconnected s)
    (hc : a ∪ b = sᶜ) (hd : SeparatedInUnion a b) : IsPreconnected (s ∪ b)
Proof
:= by
  by_contra hn
  obtain ⟨c, d, hcn, hdn, hcd, hsep⟩ := exists_separation hn
  have contra {c d : Set X} (hcn : c.Nonempty) (hn : d.Nonempty) (hcd : c ∪ d = s ∪ b)
      (hsep : SeparatedInUnion c d) (hsc : s ⊆ c) : False := by
    have hdb : d ⊆ b := by
      intro x hx
      have : x ∈ s ∪ b := hcd ▸ Or.inr hx
      apply this.resolve_left
      intro hxs
      exact Set.disjoint_left.mp hsep.1 (hsc hxs) (subset_closure hx)
    have hse : SeparatedInUnion (a ∪ c) d := by
      constructor
      · exact disjoint_union_left.mpr ⟨hd.1.mono_right (closure_mono hdb), hsep.1⟩
      · rw [closure_union]
        exact disjoint_union_right.mpr ⟨hd.2.mono_left hdb, hsep.2⟩
    have hall : (univ : Set X) ⊆ (a ∪ c) ∪ d := by
      intro x _
      by_cases hxs : x ∈ s
      · exact Or.inl (Or.inr (hsc hxs))
      have hab : x ∈ a ∪ b := hc.symm ▸ hxs
      rcases hab with ha | hb
      · exact Or.inl (Or.inl ha)
      · have hc' : x ∈ c ∪ d := hcd.symm ▸ Or.inr hb
        exact hc'.imp_left Or.inr
    rcases subset_one_side isPreconnected_univ hall hse with hl | hr
    · obtain ⟨x, hx⟩ := hn
      exact Set.disjoint_left.mp hse.1 (hl trivial) (subset_closure hx)
    · obtain ⟨x, hx⟩ := hcn
      exact Set.disjoint_left.mp hse.1 (Or.inr hx) (subset_closure (hr trivial))
  have hcov : s ⊆ c ∪ d := hcd.symm ▸ subset_union_left
  rcases subset_one_side hs hcov hsep with hsc | hsd
  · exact contra hcn hdn hcd hsep hsc
  · exact contra hdn hcn ((union_comm d c).trans hcd) ⟨hsep.2, hsep.1⟩ hsd

theorem isPreconnected_compl_connectedComponentIn_compl

TopologyByExample.isPreconnected_compl_connectedComponentIn_compl

The complement of a component of the complement of a preconnected set is preconnected.

theorem isPreconnected_compl_connectedComponentIn_compl [PreconnectedSpace X] {q : Set X}
    (hq : IsPreconnected q) {x : X} (hx : x ∉ q) :
    IsPreconnected (connectedComponentIn qᶜ x)ᶜ
Proof
:= by
  let t := connectedComponentIn qᶜ x
  have htx : x ∈ t := mem_connectedComponentIn hx
  have hts : t ⊆ qᶜ := connectedComponentIn_subset _ _
  have hqt : q ⊆ tᶜ := fun _ hq ht ↦ hts ht hq
  by_contra hn
  obtain ⟨a, b, han, hbn, hab, habs⟩ := exists_separation hn
  have contra {a b : Set X} (hb : b.Nonempty) (hab : a ∪ b = tᶜ)
      (hsep : SeparatedInUnion a b) (hqa : q ⊆ a) : False := by
    have hconn : IsPreconnected (t ∪ b) :=
      join_one_side isPreconnected_connectedComponentIn hab hsep
    have havoid : t ∪ b ⊆ qᶜ := union_subset hts fun _ hby hqy ↦
      Set.disjoint_left.mp hsep.1 (hqa hqy) (subset_closure hby)
    have hmax : t ∪ b ⊆ t := hconn.subset_connectedComponentIn (Or.inl htx) havoid
    obtain ⟨y, hy⟩ := hb
    have hy' : y ∈ tᶜ := hab ▸ Or.inr hy
    exact hy' (hmax (Or.inr hy))
  rcases subset_one_side hq (hab.symm ▸ hqt) habs with ha | hb
  · exact contra hbn hab habs ha
  · exact contra han ((union_comm b a).trans hab) ⟨habs.2, habs.1⟩ hb

theorem subsingleton_or_subsingleton

TopologyByExample.BiconnectedSpace.subsingleton_or_subsingleton

Two disjoint preconnected subsets of a biconnected space cannot both be nondegenerate.

theorem BiconnectedSpace.subsingleton_or_subsingleton [BiconnectedSpace X] {p q : Set X}
    (hp : IsPreconnected p) (hq : IsPreconnected q) (hd : Disjoint p q) :
    p.Subsingleton ∨ q.Subsingleton
Proof
:= by
  rcases p.eq_empty_or_nonempty with rfl | ⟨x, hx⟩
  · exact Or.inl subsingleton_empty
  let t := connectedComponentIn qᶜ x
  have hpc : p ⊆ qᶜ := Set.disjoint_left.mp hd
  have hpt : p ⊆ t := hp.subset_connectedComponentIn hx hpc
  have hqt : q ⊆ tᶜ := fun _ hqy hty ↦ connectedComponentIn_subset qᶜ x hty hqy
  have htc : IsPreconnected tᶜ := isPreconnected_compl_connectedComponentIn_compl hq (hpc hx)
  exact (partition_subsingleton t tᶜ isPreconnected_connectedComponentIn htc
    disjoint_compl_right (union_compl_self t)).imp (fun h ↦ h.anti hpt) (fun h ↦ h.anti hqt)

On this site: Theorem: Disjoint connected subsets of a biconnected space

theorem eq_of_continuous

TopologyByExample.BiconnectedSpace.eq_of_continuous

Every continuous map from a locally connected preconnected space to a Hausdorff biconnected space is constant.

theorem BiconnectedSpace.eq_of_continuous [BiconnectedSpace X] [T2Space X]
    {D : Type*} [TopologicalSpace D] [LocallyConnectedSpace D] [PreconnectedSpace D]
    {f : D → X} (hf : Continuous f) (x y : D) : f x = f y
Proof
:= by
  by_contra hxy
  obtain ⟨u, v, hu, hv, hxu, hyv, hd⟩ := t2_separation hxy
  have small {x y : D} {u : Set X} (hne : f x ≠ f y) (hu : IsOpen u) (hx : f x ∈ u) :
      ∃ a ⊆ u, IsPreconnected a ∧ ¬ a.Subsingleton := by
    by_contra hn
    push Not at hn
    let F := f ⁻¹' {f x}
    have hclosed : IsClosed F := isClosed_singleton.preimage hf
    have hopen : IsOpen F := by
      apply isOpen_iff_mem_nhds.mpr
      intro t ht
      have he : f t = f x := ht
      have htu : f t ∈ u := he ▸ hx
      obtain ⟨a, has, hao, hta, hac⟩ := locallyConnectedSpace_iff_subsets_isOpen_isConnected.mp
        ‹LocallyConnectedSpace D› t _ ((hu.preimage hf).mem_nhds htu)
      have hsg := hn (f '' a) (image_subset_iff.mpr has)
        (hac.isPreconnected.image f hf.continuousOn)
      exact Filter.mem_of_superset (hao.mem_nhds hta) fun z hz ↦
        (hsg (mem_image_of_mem f hz) (mem_image_of_mem f hta)).trans he
    have hall : F = univ := IsClopen.eq_univ ⟨hclosed, hopen⟩ ⟨x, rfl⟩
    exact hne (show f y = f x from (hall ▸ mem_univ y : y ∈ F)).symm
  obtain ⟨a, hau, hac, han⟩ := small hxy hu hxu
  obtain ⟨b, hbv, hbc, hbn⟩ := small (Ne.symm hxy) hv hyv
  exact (subsingleton_or_subsingleton hac hbc (hd.mono hau hbv)).elim han hbn

On this site: Theorem: Continuous maps into Hausdorff biconnected spaces

theorem totallyPathDisconnectedSpace

TopologyByExample.BiconnectedSpace.totallyPathDisconnectedSpace

A Hausdorff biconnected space is totally path disconnected.

theorem BiconnectedSpace.totallyPathDisconnectedSpace [BiconnectedSpace X] [T2Space X] :
    TotallyPathDisconnectedSpace X
Proof
:= by
  refine ⟨fun x y ⟨p⟩ ↦ ?_⟩
  let : LocallyPathConnectedSpace unitInterval := (convex_Icc (0 : ℝ) 1).locallyPathConnectedSpace
  simpa using eq_of_continuous p.continuous 0 1

On this site: Theorem: Hausdorff biconnected spaces are totally path disconnected

theorem subsingleton_of_locallyConnectedSpace

TopologyByExample.BiconnectedSpace.subsingleton_of_locallyConnectedSpace

A locally connected Hausdorff biconnected space has at most one point.

theorem BiconnectedSpace.subsingleton_of_locallyConnectedSpace [BiconnectedSpace X] [T2Space X]
    [LocallyConnectedSpace X] : Subsingleton X
Proof
:=
  ⟨eq_of_continuous continuous_id⟩

On this site: Theorem: Locally connected Hausdorff biconnected spaces have at most one point

theorem not_injective_path

TopologyByExample.BiconnectedSpace.not_injective_path

A biconnected space admits no injective path.

theorem BiconnectedSpace.not_injective_path [BiconnectedSpace X] {x y : X} (p : Path x y) :
    ¬ Function.Injective p
Proof
:= by
  intro hi
  let a : unitInterval := ⟨1 / 3, by constructor <;> norm_num⟩
  let b : unitInterval := ⟨2 / 3, by constructor <;> norm_num⟩
  have h0a : 0 < a := by change (0 : ℝ) < 1 / 3; norm_num
  have hab : a < b := by change (1 : ℝ) / 3 < 2 / 3; norm_num
  have hb1 : b < 1 := by change (2 : ℝ) / 3 < 1; norm_num
  have hd : Disjoint (Icc 0 a) (Icc b 1) :=
    Set.disjoint_left.mpr fun _ h₁ h₂ ↦ hab.not_ge (h₂.1.trans h₁.2)
  have hc := subsingleton_or_subsingleton (isPreconnected_Icc.image p p.continuous.continuousOn)
    (isPreconnected_Icc.image p p.continuous.continuousOn) (Set.disjoint_image_of_injective hi hd)
  rcases hc with h | h
  · exact h0a.ne (hi.subsingleton_image_iff.mp h (left_mem_Icc.mpr h0a.le)
      (right_mem_Icc.mpr h0a.le))
  · exact hb1.ne (hi.subsingleton_image_iff.mp h (left_mem_Icc.mpr hb1.le)
      (right_mem_Icc.mpr hb1.le))

theorem subsingleton_of_arcConnectedSpace

TopologyByExample.BiconnectedSpace.subsingleton_of_arcConnectedSpace

An arc-connected biconnected space has at most one point.

theorem BiconnectedSpace.subsingleton_of_arcConnectedSpace [BiconnectedSpace X]
    [ArcConnectedSpace X] : Subsingleton X
Proof
:= by
  refine ⟨fun x y ↦ ?_⟩
  by_contra h
  obtain ⟨p, hp⟩ := ArcConnectedSpace.exists_injective_path x y h
  exact not_injective_path p hp

On this site: Theorem: Arc-connected biconnected spaces have at most one point

theorem discreteTopology_of_locallyArcConnectedSpace

TopologyByExample.BiconnectedSpace.discreteTopology_of_locallyArcConnectedSpace

A locally arc-connected biconnected space is discrete.

theorem BiconnectedSpace.discreteTopology_of_locallyArcConnectedSpace [BiconnectedSpace X]
    [LocallyArcConnectedSpace X] : DiscreteTopology X
Proof
:= by
  apply discreteTopology_iff_isOpen_singleton.mpr
  intro x
  obtain ⟨V, ho, hx, _, hArc⟩ := LocallyArcConnectedSpace.exists_open x univ isOpen_univ trivial
  have hs : V ⊆ {x} := by
    intro y hy
    by_contra hn
    have hxy : (⟨y, hy⟩ : V) ≠ ⟨x, hx⟩ := fun e ↦ hn (congrArg Subtype.val e)
    obtain ⟨p, hi⟩ := hArc.exists_injective_path _ _ hxy
    exact not_injective_path (p.map continuous_subtypeVal) (Subtype.val_injective.comp hi)
  rwa [← hs.antisymm (singleton_subset_iff.mpr hx)]

On this site: Theorem: Locally arc-connected biconnected spaces are discrete