Skip to content

Commit 74a13ac

Browse files
chrisflavBergschaf
authored andcommitted
refactor(Topology): use WithTopology to define WithConstructibleTopology (leanprover-community#39621)
We replace the type synonym `WithConstructibleTopology` by `WithTopology _ (constructibleTopology X)`. This breaks the def-eq `X = WithConstructibleTopology X`, which was luckily not abused much yet.
1 parent 396a64e commit 74a13ac

3 files changed

Lines changed: 38 additions & 5 deletions

File tree

Mathlib/Topology/Compactness/Compact.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,12 @@ theorem disjoint_map_cocompact {g : X → Y} {f : Filter X} (hg : Continuous g)
961961
theorem isCompact_range [CompactSpace X] {f : X → Y} (hf : Continuous f) : IsCompact (range f) := by
962962
rw [← image_univ]; exact isCompact_univ.image hf
963963

964+
lemma Function.Surjective.compactSpace {f : X → Y} (hf : Continuous f) [CompactSpace X]
965+
(hf' : f.Surjective) : CompactSpace Y where
966+
isCompact_univ := by
967+
rw [← hf'.range_eq]
968+
exact isCompact_range hf
969+
964970
theorem isCompact_diagonal [CompactSpace X] : IsCompact (diagonal X) :=
965971
@range_diag X ▸ isCompact_range (continuous_id.prodMk continuous_id)
966972

Mathlib/Topology/Spectral/ConstructibleTopology.lean

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Johan Commelin, Jiedong Jiang, Christian Merten
66
module
77

88
public import Mathlib.Topology.Spectral.Basic
9+
public import Mathlib.Topology.WithTopology
910
public import Mathlib.Topology.JacobsonSpace
1011
public import Mathlib.Data.Set.Card
1112

@@ -43,14 +44,19 @@ def constructibleTopology (X : Type*) [TopologicalSpace X] : TopologicalSpace X
4344

4445
/-- A type synonym for `X` that is equipped with the constructible topology of `X`. -/
4546
@[nolint unusedArguments]
46-
def WithConstructibleTopology (X : Type*) [TopologicalSpace X] : Type _ :=
47-
X
48-
49-
instance : TopologicalSpace (WithConstructibleTopology X) :=
50-
fast_instance% constructibleTopology X
47+
abbrev WithConstructibleTopology (X : Type*) [TopologicalSpace X] : Type _ :=
48+
WithTopology X (constructibleTopology X)
5149

5250
open Topology
5351

52+
lemma WithConstructibleTopology.isOpen_iff {s : Set (WithConstructibleTopology X)} :
53+
IsOpen s ↔ IsOpen[constructibleTopology X] (WithTopology.toTopology _ ⁻¹' s) :=
54+
WithTopology.isOpen_iff _
55+
56+
lemma WithConstructibleTopology.isClosed_iff {s : Set (WithConstructibleTopology X)} :
57+
IsClosed s ↔ IsClosed[constructibleTopology X] (WithTopology.toTopology _ ⁻¹' s) :=
58+
WithTopology.isClosed_iff _
59+
5460
lemma IsCompact.isOpen_constructibleTopology_of_isOpen {s : Set X}
5561
(hs : IsCompact s) (ho : IsOpen s) : IsOpen[constructibleTopology X] s := by
5662
apply TopologicalSpace.isOpen_generateFrom_of_mem
@@ -86,6 +92,9 @@ spaces. -/
8692
instance compactSpace_withConstructibleTopology [CompactSpace X] [QuasiSober X]
8793
[PrespectralSpace X] [QuasiSeparatedSpace X] :
8894
CompactSpace (WithConstructibleTopology X) := by
95+
suffices h : @CompactSpace X (constructibleTopology X) from
96+
@Function.Surjective.compactSpace _ _ (constructibleTopology X) _ _
97+
(WithTopology.continuous_toTopology _) _ (WithTopology.toTopology_surjective _)
8998
let 𝔅 := constructibleTopologySubbasis X
9099
/- It suffices to check that any subset of `𝔅` for which every finite subset has non-empty
91100
intersection, has non-empty intersection. We argue by contradiction and by Zorn's

Mathlib/Topology/WithTopology.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,24 @@ lemma toTopology_inj {x y : X} : toTopology t x = toTopology t y ↔ x = y :=
6363
@[simp] lemma ofTopology_inj {x y : WithTopology X t} : ofTopology x = ofTopology y ↔ x = y :=
6464
(ofTopology_injective t).eq_iff
6565

66+
open Topology
67+
68+
lemma isOpen_iff {s : Set (WithTopology X t)} :
69+
IsOpen s ↔ IsOpen[t] (toTopology t ⁻¹' s) :=
70+
.rfl
71+
72+
lemma isClosed_iff {s : Set (WithTopology X t)} :
73+
IsClosed s ↔ IsClosed[t] (toTopology t ⁻¹' s) := by
74+
simp [← isOpen_compl_iff, isOpen_iff]
75+
76+
/-- If `X` is equipped with topology `t`, the map `X → WithTopology X t` is continuous. -/
77+
lemma continuous_toTopology : Continuous[t, _] (toTopology t) :=
78+
fun _ ↦ (·)⟩
79+
80+
/-- If `X` is equipped with topology `t`, the map `WithTopology X t → X` is continuous. -/
81+
lemma continuous_ofTopology : Continuous[_, t] (ofTopology (t := t)) :=
82+
fun _ ↦ (·)⟩
83+
6684
/-! ### Set-theoretic lemmas -/
6785

6886
open Set

0 commit comments

Comments
 (0)