Skip to content

Commit c468cc4

Browse files
committed
feat: generalize to
1 parent 18bbd3e commit c468cc4

7 files changed

Lines changed: 273 additions & 38 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7917,6 +7917,7 @@ public import Mathlib.Topology.Order.T5
79177917
public import Mathlib.Topology.Order.UpperLowerSetTopology
79187918
public import Mathlib.Topology.Order.WithTop
79197919
public import Mathlib.Topology.Partial
7920+
public import Mathlib.Topology.PartialHomeomorph.Defs
79207921
public import Mathlib.Topology.PartitionOfUnity
79217922
public import Mathlib.Topology.Path
79227923
public import Mathlib.Topology.Perfect

Mathlib/Topology/OpenPartialHomeomorph/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ theorem isOpen_image_iff_of_subset_source {s : Set X} (hs : s ⊆ e.source) :
122122

123123
/-- A `PartialEquiv` with continuous open forward map and open source is a
124124
`OpenPartialHomeomorph`. -/
125-
@[simps toPartialEquiv]
125+
@[simps toPartialHomeomorph_toPartialEquiv]
126126
def ofContinuousOpenRestrict (e : PartialEquiv X Y) (hc : ContinuousOn e e.source)
127127
(ho : IsOpenMap (e.source.restrict e)) (hs : IsOpen e.source) : OpenPartialHomeomorph X Y where
128128
toPartialEquiv := e
@@ -145,7 +145,7 @@ theorem coe_ofContinuousOpenRestrict_symm (e : PartialEquiv X Y) (hc : Continuou
145145

146146
/-- A `PartialEquiv` with continuous open forward map and open source is a
147147
`OpenPartialHomeomorph`. -/
148-
@[simps! toPartialEquiv]
148+
@[simps! toPartialHomeomorph_toPartialEquiv]
149149
def ofContinuousOpen (e : PartialEquiv X Y) (hc : ContinuousOn e e.source) (ho : IsOpenMap e)
150150
(hs : IsOpen e.source) : OpenPartialHomeomorph X Y :=
151151
ofContinuousOpenRestrict e hc (ho.restrict hs) hs

Mathlib/Topology/OpenPartialHomeomorph/Composition.lean

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ variable (e' : OpenPartialHomeomorph Y Z)
3737

3838
/-- Composition of two open partial homeomorphisms when the target of the first and the source of
3939
the second coincide. -/
40-
@[simps! apply symm_apply toPartialEquiv, simps! -isSimp source target]
40+
@[simps! apply symm_apply toPartialHomeomorph_toPartialEquiv, simps! -isSimp source target]
4141
protected def trans' (h : e.target = e'.source) : OpenPartialHomeomorph X Z where
4242
toPartialEquiv := PartialEquiv.trans' e.toPartialEquiv e'.toPartialEquiv h
4343
open_source := e.open_source
@@ -99,15 +99,15 @@ theorem inv_image_trans_target : e'.symm '' (e.trans e').target = e'.source ∩
9999

100100
theorem trans_assoc (e'' : OpenPartialHomeomorph Z Z') :
101101
(e.trans e').trans e'' = e.trans (e'.trans e'') :=
102-
toPartialEquiv_injective <| e.1.trans_assoc _ _
102+
toPartialHomeomorph_injective <| PartialHomeomorph.toPartialEquiv_injective <| e.1.trans_assoc _ _
103103

104104
@[simp, mfld_simps]
105105
theorem trans_refl : e.trans (OpenPartialHomeomorph.refl Y) = e :=
106-
toPartialEquiv_injective e.1.trans_refl
106+
toPartialHomeomorph_injective (PartialHomeomorph.toPartialEquiv_injective e.1.trans_refl)
107107

108108
@[simp, mfld_simps]
109109
theorem refl_trans : (OpenPartialHomeomorph.refl X).trans e = e :=
110-
toPartialEquiv_injective e.1.refl_trans
110+
toPartialHomeomorph_injective (PartialHomeomorph.toPartialEquiv_injective e.1.refl_trans)
111111

112112
theorem trans_ofSet {s : Set Y} (hs : IsOpen s) : e.trans (ofSet s hs) = e.restr (e ⁻¹' s) :=
113113
OpenPartialHomeomorph.ext _ _ (fun _ => rfl) (fun _ => rfl) <| by
@@ -131,7 +131,7 @@ theorem ofSet_trans_ofSet {s : Set X} (hs : IsOpen s) {s' : Set X} (hs' : IsOpen
131131
ext <;> simp [hs'.interior_eq]
132132

133133
theorem restr_trans (s : Set X) : (e.restr s).trans e' = (e.trans e').restr s :=
134-
toPartialEquiv_injective <|
134+
toPartialHomeomorph_injective <| PartialHomeomorph.toPartialEquiv_injective <|
135135
PartialEquiv.restr_trans e.toPartialEquiv e'.toPartialEquiv (interior s)
136136

137137
end trans
@@ -197,7 +197,8 @@ variable (e : X ≃ₜ Y) (e' : Y ≃ₜ Z)
197197
@[simp, mfld_simps]
198198
theorem trans_toOpenPartialHomeomorph : (e.trans e').toOpenPartialHomeomorph =
199199
e.toOpenPartialHomeomorph.trans e'.toOpenPartialHomeomorph :=
200-
OpenPartialHomeomorph.toPartialEquiv_injective <| Equiv.trans_toPartialEquiv _ _
200+
OpenPartialHomeomorph.toPartialHomeomorph_injective <|
201+
PartialHomeomorph.toPartialEquiv_injective <| Equiv.trans_toPartialEquiv _ _
201202

202203
/-- Precompose an open partial homeomorphism with a homeomorphism.
203204
We modify the source and target to have better definitional behavior. -/
@@ -212,7 +213,8 @@ def transOpenPartialHomeomorph (e : X ≃ₜ Y) (f' : OpenPartialHomeomorph Y Z)
212213

213214
theorem transOpenPartialHomeomorph_eq_trans (e : X ≃ₜ Y) (f' : OpenPartialHomeomorph Y Z) :
214215
e.transOpenPartialHomeomorph f' = e.toOpenPartialHomeomorph.trans f' :=
215-
OpenPartialHomeomorph.toPartialEquiv_injective <| Equiv.transPartialEquiv_eq_trans _ _
216+
OpenPartialHomeomorph.toPartialHomeomorph_injective <| PartialHomeomorph.toPartialEquiv_injective
217+
<| Equiv.transPartialEquiv_eq_trans _ _
216218

217219
@[simp, mfld_simps]
218220
theorem transOpenPartialHomeomorph_trans (e : X ≃ₜ Y) (f : OpenPartialHomeomorph Y Z)

Mathlib/Topology/OpenPartialHomeomorph/Constructions.lean

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ section Prod
7676

7777
/-- The product of two open partial homeomorphisms, as an open partial homeomorphism on the product
7878
space. -/
79-
@[simps! (attr := mfld_simps) -fullyApplied toPartialEquiv apply,
79+
@[simps! (attr := mfld_simps) -fullyApplied toPartialHomeomorph_toPartialEquiv apply,
8080
simps! -isSimp source target symm_apply]
8181
def prod (eX : OpenPartialHomeomorph X X') (eY : OpenPartialHomeomorph Y Y') :
8282
OpenPartialHomeomorph (X × Y) (X' × Y') where
@@ -100,7 +100,7 @@ theorem refl_prod_refl : (OpenPartialHomeomorph.refl X).prod (OpenPartialHomeomo
100100
theorem prod_trans (e : OpenPartialHomeomorph X Y) (f : OpenPartialHomeomorph Y Z)
101101
(e' : OpenPartialHomeomorph X' Y') (f' : OpenPartialHomeomorph Y' Z') :
102102
(e.prod e').trans (f.prod f') = (e.trans f).prod (e'.trans f') :=
103-
toPartialEquiv_injective <| e.1.prod_trans ..
103+
toPartialHomeomorph_injective <| PartialHomeomorph.toPartialEquiv_injective <| e.1.prod_trans ..
104104

105105
theorem prod_eq_prod_of_nonempty {eX eX' : OpenPartialHomeomorph X X'}
106106
{eY eY' : OpenPartialHomeomorph Y Y'} (h : (eX.prod eY).source.Nonempty) :
@@ -137,7 +137,7 @@ variable {ι : Type*} [Finite ι] {X Y : ι → Type*} [∀ i, TopologicalSpace
137137
[∀ i, TopologicalSpace (Y i)] (ei : ∀ i, OpenPartialHomeomorph (X i) (Y i))
138138

139139
/-- The product of a finite family of `OpenPartialHomeomorph`s. -/
140-
@[simps! toPartialEquiv apply symm_apply source target]
140+
@[simps! toPartialHomeomorph_toPartialEquiv apply symm_apply source target]
141141
def pi : OpenPartialHomeomorph (∀ i, X i) (∀ i, Y i) where
142142
toPartialEquiv := PartialEquiv.pi fun i => (ei i).toPartialEquiv
143143
open_source := isOpen_set_pi finite_univ fun i _ => (ei i).open_source
@@ -164,7 +164,7 @@ To ensure the maps `toFun` and `invFun` are inverse of each other on the new `so
164164
the definition assumes that the sets `s` and `t` are related both by `e.is_image` and `e'.is_image`.
165165
To ensure that the new maps are continuous on `source`/`target`, it also assumes that `e.source` and
166166
`e'.source` meet `frontier s` on the same set and `e x = e' x` on this intersection. -/
167-
@[simps! -fullyApplied toPartialEquiv apply]
167+
@[simps! -fullyApplied toPartialHomeomorph_toPartialEquiv apply]
168168
def piecewise (e e' : OpenPartialHomeomorph X Y) (s : Set X) (t : Set Y) [∀ x, Decidable (x ∈ s)]
169169
[∀ y, Decidable (y ∈ t)] (H : e.IsImage s t) (H' : e'.IsImage s t)
170170
(Hs : e.source ∩ frontier s = e'.source ∩ frontier s)
@@ -226,7 +226,8 @@ def transHomeomorph (e : OpenPartialHomeomorph X Y) (f' : Y ≃ₜ Z) : OpenPart
226226

227227
theorem transHomeomorph_eq_trans (e : OpenPartialHomeomorph X Y) (f' : Y ≃ₜ Z) :
228228
e.transHomeomorph f' = e.trans f'.toOpenPartialHomeomorph :=
229-
toPartialEquiv_injective <| PartialEquiv.transEquiv_eq_trans _ _
229+
toPartialHomeomorph_injective <| PartialHomeomorph.toPartialEquiv_injective
230+
<| PartialEquiv.transEquiv_eq_trans _ _
230231

231232
@[simp, mfld_simps]
232233
theorem transHomeomorph_transHomeomorph (e : OpenPartialHomeomorph X Y) (f' : Y ≃ₜ Z)

Mathlib/Topology/OpenPartialHomeomorph/Defs.lean

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Authors: Sébastien Gouëzel
55
-/
66
module
77

8-
public import Mathlib.Logic.Equiv.PartialEquiv
9-
public import Mathlib.Topology.ContinuousOn
8+
public import Mathlib.Topology.PartialHomeomorph.Defs
109

1110
/-!
1211
# Partial homeomorphisms: definitions
@@ -52,11 +51,9 @@ variable {X X' : Type*} {Y Y' : Type*} {Z Z' : Type*}
5251

5352
/-- Partial homeomorphisms, defined on open subsets of the space -/
5453
structure OpenPartialHomeomorph (X : Type*) (Y : Type*) [TopologicalSpace X]
55-
[TopologicalSpace Y] extends PartialEquiv X Y where
54+
[TopologicalSpace Y] extends PartialHomeomorph X Y where
5655
open_source : IsOpen source
5756
open_target : IsOpen target
58-
continuousOn_toFun : ContinuousOn toFun source
59-
continuousOn_invFun : ContinuousOn invFun target
6057

6158
namespace OpenPartialHomeomorph
6259

@@ -77,11 +74,9 @@ instance : CoeFun (OpenPartialHomeomorph X Y) fun _ => X → Y :=
7774
/-- The inverse of an open partial homeomorphism -/
7875
@[symm]
7976
protected def symm : OpenPartialHomeomorph Y X where
80-
toPartialEquiv := e.toPartialEquiv.symm
77+
toPartialHomeomorph := e.toPartialHomeomorph.symm
8178
open_source := e.open_target
8279
open_target := e.open_source
83-
continuousOn_toFun := e.continuousOn_invFun
84-
continuousOn_invFun := e.continuousOn_toFun
8580

8681
/-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
8782
because it is a composition of multiple projections. -/
@@ -99,18 +94,18 @@ theorem continuousOn_symm : ContinuousOn e.symm e.target :=
9994
e.continuousOn_invFun
10095

10196
@[simp, mfld_simps]
102-
theorem mk_coe (e : PartialEquiv X Y) (h1 h2 h3 h4) :
103-
(OpenPartialHomeomorph.mk e h1 h2 h3 h4 : X → Y) = e :=
97+
theorem mk_coe (e : PartialEquiv X Y) (a b c d) :
98+
(OpenPartialHomeomorph.mk (.mk e a b) c d : X → Y) = e :=
10499
rfl
105100

106101
@[simp, mfld_simps]
107102
theorem mk_coe_symm (e : PartialEquiv X Y) (a b c d) :
108-
((OpenPartialHomeomorph.mk e a b c d).symm : Y → X) = e.symm :=
103+
((OpenPartialHomeomorph.mk (.mk e a b) c d).symm : Y → X) = e.symm :=
109104
rfl
110105

111-
theorem toPartialEquiv_injective :
112-
Injective (toPartialEquiv : OpenPartialHomeomorph X Y → PartialEquiv X Y)
113-
| ⟨_, _, _, _, _⟩, ⟨_, _, _, _, _⟩, rfl => rfl
106+
theorem toPartialHomeomorph_injective :
107+
Injective (toPartialHomeomorph : OpenPartialHomeomorph X Y → PartialHomeomorph X Y)
108+
| ⟨_, _, _⟩, ⟨_, _, _⟩, rfl => rfl
114109

115110
/- Register a few simp lemmas to make sure that `simp` puts the application of a local
116111
homeomorphism in its normal form, i.e., in terms of its coercion to a function. -/
@@ -138,6 +133,14 @@ theorem coe_toPartialEquiv_symm : (e.toPartialEquiv.symm : Y → X) = e.symm :=
138133
theorem map_source {x : X} (h : x ∈ e.source) : e x ∈ e.target :=
139134
e.map_source' h
140135

136+
@[simp, mfld_simps]
137+
theorem coe_toPartialHomeomorph : (e.toPartialHomeomorph : X → Y) = e :=
138+
rfl
139+
140+
@[simp, mfld_simps]
141+
theorem coe_toPartialHomeomorph_symm : (e.toPartialHomeomorph.symm : Y → X) = e.symm :=
142+
rfl
143+
141144
/-- Variant of `map_source`, stated for images of subsets of `source`. -/
142145
lemma map_source'' : e '' e.source ⊆ e.target :=
143146
fun _ ⟨_, hx, hex⟩ ↦ mem_of_eq_of_mem (id hex.symm) (e.map_source' hx)
@@ -183,15 +186,13 @@ end Basic
183186

184187
/-- Interpret a `Homeomorph` as an `OpenPartialHomeomorph` by restricting it
185188
to an open set `s` in the domain and to `t` in the codomain. -/
186-
@[simps! -fullyApplied apply symm_apply toPartialEquiv,
189+
@[simps! -fullyApplied apply symm_apply toPartialHomeomorph,
187190
simps! -isSimp source target]
188191
def _root_.Homeomorph.toOpenPartialHomeomorphOfImageEq (e : X ≃ₜ Y) (s : Set X) (hs : IsOpen s)
189192
(t : Set Y) (h : e '' s = t) : OpenPartialHomeomorph X Y where
190-
toPartialEquiv := e.toPartialEquivOfImageEq s t h
193+
toPartialHomeomorph := e.toPartialHomeomorphOfImageEq s t h
191194
open_source := hs
192195
open_target := by simpa [← h]
193-
continuousOn_toFun := e.continuous.continuousOn
194-
continuousOn_invFun := e.symm.continuous.continuousOn
195196

196197
/-- A homeomorphism induces an open partial homeomorphism on the whole space -/
197198
@[simps! (attr := mfld_simps) -fullyApplied]
@@ -223,7 +224,8 @@ called `EqOnSource`. -/
223224
@[ext]
224225
protected theorem ext (e' : OpenPartialHomeomorph X Y) (h : ∀ x, e x = e' x)
225226
(hinv : ∀ x, e.symm x = e'.symm x) (hs : e.source = e'.source) : e = e' :=
226-
toPartialEquiv_injective (PartialEquiv.ext h hinv hs)
227+
toPartialHomeomorph_injective
228+
(PartialHomeomorph.ext e.toPartialHomeomorph e'.toPartialHomeomorph h hinv hs)
227229

228230
@[simp, mfld_simps]
229231
theorem symm_toPartialEquiv : e.symm.toPartialEquiv = e.toPartialEquiv.symm :=

Mathlib/Topology/OpenPartialHomeomorph/IsImage.lean

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ theorem isOpen_iff (h : e.IsImage s t) : IsOpen (e.source ∩ s) ↔ IsOpen (e.t
171171
h.preimage_eq' ▸ e.isOpen_inter_preimage hs⟩
172172

173173
/-- Restrict an `OpenPartialHomeomorph` to a pair of corresponding open sets. -/
174-
@[simps! -fullyApplied apply symm_apply toPartialEquiv]
174+
@[simps! -fullyApplied apply symm_apply toPartialHomeomorph_toPartialEquiv]
175175
def restr (h : e.IsImage s t) (hs : IsOpen (e.source ∩ s)) : OpenPartialHomeomorph X Y where
176176
toPartialEquiv := h.toPartialEquiv.restr
177177
open_source := hs
@@ -254,8 +254,8 @@ theorem restr_toPartialEquiv' (s : Set X) (hs : IsOpen s) :
254254

255255
theorem restr_eq_of_source_subset {e : OpenPartialHomeomorph X Y} {s : Set X} (h : e.source ⊆ s) :
256256
e.restr s = e :=
257-
toPartialEquiv_injective <| PartialEquiv.restr_eq_of_source_subset <|
258-
interior_maximal h e.open_source
257+
toPartialHomeomorph_injective <| PartialHomeomorph.toPartialEquiv_injective
258+
<| PartialEquiv.restr_eq_of_source_subset <| interior_maximal h e.open_source
259259

260260
@[simp, mfld_simps]
261261
theorem restr_univ {e : OpenPartialHomeomorph X Y} : e.restr univ = e :=
@@ -315,7 +315,8 @@ theorem eqOnSource_iff (e e' : OpenPartialHomeomorph X Y) :
315315

316316
/-- `EqOnSource` is an equivalence relation. -/
317317
instance eqOnSourceSetoid : Setoid (OpenPartialHomeomorph X Y) :=
318-
{ PartialEquiv.eqOnSourceSetoid.comap toPartialEquiv with r := EqOnSource }
318+
{ PartialEquiv.eqOnSourceSetoid.comap
319+
(fun x ↦ (toPartialHomeomorph x).toPartialEquiv) with r := EqOnSource }
319320

320321
theorem eqOnSource_refl : e ≈ e := Setoid.refl _
321322

@@ -359,7 +360,8 @@ theorem Set.EqOn.restr_eqOn_source {e e' : OpenPartialHomeomorph X Y}
359360

360361
theorem eq_of_eqOnSource_univ {e e' : OpenPartialHomeomorph X Y} (h : e ≈ e') (s : e.source = univ)
361362
(t : e.target = univ) : e = e' :=
362-
toPartialEquiv_injective <| PartialEquiv.eq_of_eqOnSource_univ _ _ h s t
363+
toPartialHomeomorph_injective <| PartialHomeomorph.toPartialEquiv_injective <|
364+
PartialEquiv.eq_of_eqOnSource_univ _ _ h s t
363365

364366
variable {s : Set X}
365367

0 commit comments

Comments
 (0)