MathlibAnnex/Topology/ClosureSpace/Components.lean
Exact source · gss-v0.5.0
Fixed commit original · Raw UTF-8 source · Back to GSS Companion
Select a source link from a manuscript to highlight its exact range.
Technical identity
- Commit
ac405356bb98afed954da9b9c795d23cc8d5d149- SHA-256
f8a603680a6aa871b86d4c994dcec4514d7470deadf9a60466e110a9f572fd4f- Bytes
- 5940
1/-2Copyright (c) 2026 Ryotaro Tanaka. All rights reserved.3Released under Apache 2.0 license as described in the file LICENSE.4Authors: Ryotaro Tanaka5-/6module78public import MathlibAnnex.Topology.ClosureSpace.Maps9public import Mathlib.Logic.Relation1011/-!12# Components generated by nonclosed pairs1314The equivalence closure is the existing `Relation.EqvGen`. The generating relation15is symmetric; hence it describes exactly finite chains of nonclosed pairs, with16identity steps allowed. The component and its closure are kept separate.17-/1819@[expose] public section2021set_option autoImplicit false2223universe u v2425namespace ClosureSpace2627variable {α : Type u} {β : Type v}2829/-- Equality or a nonclosed two-point set. -/30def Linked (c : ClosureSpace α) (x y : α) : Prop := x = y ∨ ¬ c.IsClosed {x, y}3132theorem linked_refl (c : ClosureSpace α) (x : α) : c.Linked x x := Or.inl rfl3334theorem linked_symm (c : ClosureSpace α) {x y : α} (h : c.Linked x y) :35c.Linked y x := by36rcases h with h | h37· exact Or.inl h.symm38· apply Or.inr39intro hyx40apply h41have hset : ({x, y} : Set α) = {y, x} := by42apply Set.ext43intro z44simp only [Set.mem_insert_iff, Set.mem_singleton_iff, or_comm]45rw [hset]46exact hyx4748/-- The equivalence relation generated by linked pairs. -/49def componentSetoid (c : ClosureSpace α) : Setoid α := Relation.EqvGen.setoid c.Linked5051/-- Belonging to the same finite-chain component. -/52abbrev Related (c : ClosureSpace α) (x y : α) : Prop := (c.componentSetoid).r x y5354theorem related_refl (c : ClosureSpace α) (x : α) : c.Related x x :=55c.componentSetoid.iseqv.refl x5657theorem related_symm (c : ClosureSpace α) {x y : α} (h : c.Related x y) :58c.Related y x := c.componentSetoid.iseqv.symm h5960theorem related_trans (c : ClosureSpace α) {x y z : α}61(hxy : c.Related x y) (hyz : c.Related y z) : c.Related x z :=62c.componentSetoid.iseqv.trans hxy hyz6364theorem related_of_linked (c : ClosureSpace α) {x y : α} (h : c.Linked x y) :65c.Related x y := Relation.EqvGen.rel x y h6667/-- The equivalence class as an ambient subset. -/68def component (c : ClosureSpace α) (x : α) : Set α := {y | c.Related x y}6970theorem mem_component (c : ClosureSpace α) (x : α) : x ∈ c.component x :=71c.related_refl x7273theorem component_eq_of_related (c : ClosureSpace α) {x y : α} (h : c.Related x y) :74c.component x = c.component y := by75apply Set.ext76intro z77exact ⟨fun hxz => c.related_trans (c.related_symm h) hxz,78fun hyz => c.related_trans h hyz⟩7980/-- The closure of a component, not the component itself. -/81def componentClosure (c : ClosureSpace α) (x : α) : Set α := c.closure (c.component x)8283theorem mem_componentClosure (c : ClosureSpace α) (x : α) : x ∈ c.componentClosure x :=84c.subset_closure (c.component x) (c.mem_component x)8586/-- Finite continuity preserves linked pairs when the map is injective.87The injectivity assumption is essential. -/88theorem FinitelyContinuous.linked {c : ClosureSpace α} {d : ClosureSpace β}89{f : α → β} (hf : c.FinitelyContinuous d f) (hinj : Function.Injective f)90{x y : α} (hxy : c.Linked x y) : d.Linked (f x) (f y) := by91rcases hxy with hxy | hxy92· exact Or.inl (congrArg f hxy)93· apply Or.inr94intro hclosed95apply hxy96apply (c.isClosed_iff_closure_subset {x, y}).297intro z hz98have hz' := hf {x, y} ((Set.finite_singleton y).insert x) ⟨z, hz, rfl⟩99rw [Set.image_pair, (d.isClosed_iff {f x, f y}).1 hclosed] at hz'100rcases Set.mem_insert_iff.1 hz' with hx | hy101· exact Set.mem_insert_iff.2 (Or.inl (hinj hx))102· exact Set.mem_insert_iff.2103(Or.inr (Set.mem_singleton_iff.2 (hinj (Set.mem_singleton_iff.1 hy))))104105/-- An injective finitely continuous map preserves the equivalence closure. -/106theorem FinitelyContinuous.related {c : ClosureSpace α} {d : ClosureSpace β}107{f : α → β} (hf : c.FinitelyContinuous d f) (hinj : Function.Injective f)108{x y : α} (hxy : c.Related x y) : d.Related (f x) (f y) := by109change Relation.EqvGen c.Linked x y at hxy110change Relation.EqvGen d.Linked (f x) (f y)111induction hxy with112| rel a b hab => exact Relation.EqvGen.rel _ _ (hf.linked hinj hab)113| refl a => exact Relation.EqvGen.refl _114| symm a b _ ih => exact Relation.EqvGen.symm _ _ ih115| trans a b z _ _ ih₁ ih₂ => exact Relation.EqvGen.trans _ _ _ ih₁ ih₂116117theorem FiniteHomeomorph.related_iff {c : ClosureSpace α} {d : ClosureSpace β}118(h : FiniteHomeomorph c d) (x y : α) :119d.Related (h.toEquiv x) (h.toEquiv y) ↔ c.Related x y := by120constructor121· intro hxy122have h' := h.finitelyContinuous_invFun.related h.toEquiv.symm.injective hxy123change c.Related (h.toEquiv.symm (h.toEquiv x)) (h.toEquiv.symm (h.toEquiv y)) at h'124simpa only [Equiv.symm_apply_apply] using h'125· exact h.finitelyContinuous_toFun.related h.toEquiv.injective126127theorem FiniteHomeomorph.image_component {c : ClosureSpace α} {d : ClosureSpace β}128(h : FiniteHomeomorph c d) (x : α) :129h.toEquiv '' c.component x = d.component (h.toEquiv x) := by130apply Set.ext131intro y132constructor133· rintro ⟨z, hz, rfl⟩134exact (h.related_iff x z).2 hz135· intro hy136refine ⟨h.toEquiv.symm y, ?_, h.toEquiv.apply_symm_apply y⟩137apply (h.related_iff x (h.toEquiv.symm y)).1138change d.Related (h.toEquiv x) y at hy139simpa only [Equiv.apply_symm_apply] using hy140141theorem Homeomorph.image_componentClosure {c : ClosureSpace α} {d : ClosureSpace β}142(h : Homeomorph c d) (x : α) :143h.toEquiv '' c.componentClosure x = d.componentClosure (h.toEquiv x) := by144change h.toEquiv '' c.closure (c.component x) =145d.closure (d.component (h.toEquiv x))146rw [h.image_closure]147change d.closure (h.toFiniteHomeomorph.toEquiv '' c.component x) =148d.closure (d.component (h.toFiniteHomeomorph.toEquiv x))149rw [h.toFiniteHomeomorph.image_component]150151end ClosureSpace