Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit d101e93

Browse files
committed
refactor(topology/discrete_quotient): review API (#18401)
Backport various changes I made to the API while porting to Lean 4 in leanprover-community/mathlib4#2157. * extend `setoid X`; * require only that the fibers are open in the definition, prove that they are clopen; * golf proofs, reuse lattice structure on `setoid`s; * use bundled continuous maps for `comap`; * swap LHS and RHS in some `simp` lemmas; * generalize the `order_bot` instance from a discrete space to a locally connected space; * prove that a discrete topological space is locally connected.
1 parent db53863 commit d101e93

3 files changed

Lines changed: 179 additions & 197 deletions

File tree

src/topology/category/Profinite/as_limit.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ variables (X : Profinite.{u})
4040

4141
/-- The functor `discrete_quotient X ⥤ Fintype` whose limit is isomorphic to `X`. -/
4242
def fintype_diagram : discrete_quotient X ⥤ Fintype :=
43-
{ obj := λ S, Fintype.of S,
43+
{ obj := λ S, by haveI := fintype.of_finite S; exact Fintype.of S,
4444
map := λ S T f, discrete_quotient.of_le f.le }
4545

4646
/-- An abbreviation for `X.fintype_diagram ⋙ Fintype_to_Profinite`. -/
@@ -56,9 +56,8 @@ instance is_iso_as_limit_cone_lift :
5656
is_iso ((limit_cone_is_limit X.diagram).lift X.as_limit_cone) :=
5757
is_iso_of_bijective _
5858
begin
59-
refine ⟨λ a b, _, λ a, _⟩,
60-
{ intro h,
61-
refine discrete_quotient.eq_of_proj_eq (λ S, _),
59+
refine ⟨λ a b h, _, λ a, _⟩,
60+
{ refine discrete_quotient.eq_of_forall_proj_eq (λ S, _),
6261
apply_fun (λ f : (limit_cone X.diagram).X, f.val S) at h,
6362
exact h },
6463
{ obtain ⟨b, hb⟩ := discrete_quotient.exists_of_compat

src/topology/connected.lean

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,10 @@ eq_of_subset_of_subset
678678
(set.mem_of_mem_of_subset mem_connected_component
679679
(is_connected_connected_component.subset_connected_component h)))
680680

681+
theorem connected_component_eq_iff_mem {x y : α} :
682+
connected_component x = connected_component y ↔ x ∈ connected_component y :=
683+
⟨λ h, h ▸ mem_connected_component, λ h, (connected_component_eq h).symm⟩
684+
681685
lemma connected_component_in_eq {x y : α} {F : set α} (h : y ∈ connected_component_in F x) :
682686
connected_component_in F x = connected_component_in F y :=
683687
begin
@@ -1168,6 +1172,14 @@ begin
11681172
λ ⟨V, ⟨hV, hxV, _⟩, hVU⟩, mem_nhds_iff.mpr ⟨V, hVU, hV, hxV⟩⟩⟩ }
11691173
end
11701174

1175+
/-- A space with discrete topology is a locally connected space. -/
1176+
@[priority 100]
1177+
instance discrete_topology.to_locally_connected_space (α) [topological_space α]
1178+
[discrete_topology α] : locally_connected_space α :=
1179+
locally_connected_space_iff_open_connected_subsets.2 $ λ x _U hU,
1180+
⟨{x}, singleton_subset_iff.2 $ mem_of_mem_nhds hU, is_open_discrete _, mem_singleton _,
1181+
is_connected_singleton⟩
1182+
11711183
lemma connected_component_in_mem_nhds [locally_connected_space α] {F : set α} {x : α}
11721184
(h : F ∈ 𝓝 x) :
11731185
connected_component_in F x ∈ 𝓝 x :=
@@ -1353,6 +1365,10 @@ begin
13531365
exact mem_connected_component
13541366
end
13551367

1368+
@[simp] theorem connected_component_eq_singleton [totally_disconnected_space α] (x : α) :
1369+
connected_component x = {x} :=
1370+
totally_disconnected_space_iff_connected_component_singleton.1 ‹_› x
1371+
13561372
/-- The image of a connected component in a totally disconnected space is a singleton. -/
13571373
@[simp] lemma continuous.image_connected_component_eq_singleton {β : Type*} [topological_space β]
13581374
[totally_disconnected_space β] {f : α → β} (h : continuous f) (a : α) :
@@ -1463,7 +1479,7 @@ not_congr coe_eq_coe
14631479

14641480
lemma coe_eq_coe' {x y : α} :
14651481
(x : connected_components α) = y ↔ x ∈ connected_component y :=
1466-
coe_eq_coe.trans ⟨λ h, h ▸ mem_connected_component, λ h, (connected_component_eq h).symm⟩
1482+
coe_eq_coe.trans connected_component_eq_iff_mem
14671483

14681484
instance [inhabited α] : inhabited (connected_components α) := ⟨↑(default : α)⟩
14691485

0 commit comments

Comments
 (0)