Skip to content

Commit fbec264

Browse files
committed
refactor(PartialHomeomorph): make (s : Opens \alpha) implicit (#10082)
It is always used in conjunction with a hypothesis `hs` about `s`. In Lean 3, these arguments were kept explicit on purpose: given a definition `myDef {x : α} (hx : MyProp x)`, if the proof of `hx` was nontrivial (not a variable), Lean would pretty-print it as `myDef _`. In Lean 4, setting `pp.proofs.withType` or `pp.proofs` to true makes such terms pretty-print as `myDef (x : MyProp)`. Hence, this workaround is no longer necessary. Follow-up to #9894.
1 parent 34bbb84 commit fbec264

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

Mathlib/Geometry/Manifold/ChartedSpace.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,8 +1146,8 @@ variable (s : Opens M)
11461146

11471147
/-- An open subset of a charted space is naturally a charted space. -/
11481148
protected instance instChartedSpace : ChartedSpace H s where
1149-
atlas := ⋃ x : s, {(chartAt H x.1).subtypeRestr s ⟨x⟩}
1150-
chartAt x := (chartAt H x.1).subtypeRestr s ⟨x⟩
1149+
atlas := ⋃ x : s, {(chartAt H x.1).subtypeRestr ⟨x⟩}
1150+
chartAt x := (chartAt H x.1).subtypeRestr ⟨x⟩
11511151
mem_chart_source x := ⟨trivial, mem_chart_source H x.1
11521152
chart_mem_atlas x := by
11531153
simp only [mem_iUnion, mem_singleton_iff]
@@ -1163,7 +1163,7 @@ protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G
11631163
rw [hc'.symm, mem_singleton_iff] at he'
11641164
rw [he, he']
11651165
refine' G.mem_of_eqOnSource _
1166-
(subtypeRestr_symm_trans_subtypeRestr s _ (chartAt H x) (chartAt H x'))
1166+
(subtypeRestr_symm_trans_subtypeRestr (s := s) _ (chartAt H x) (chartAt H x'))
11671167
apply closedUnderRestriction'
11681168
· exact G.compatible (chart_mem_atlas _ _) (chart_mem_atlas _ _)
11691169
· exact isOpen_inter_preimage_symm (chartAt _ _) s.2
@@ -1172,18 +1172,18 @@ protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G
11721172
theorem chartAt_subtype_val_symm_eventuallyEq (U : Opens M) {x : U} :
11731173
(chartAt H x.val).symm =ᶠ[𝓝 (chartAt H x.val x.val)] Subtype.val ∘ (chartAt H x).symm := by
11741174
set e := chartAt H x.val
1175-
have heUx_nhds : (e.subtypeRestr U ⟨x⟩).target ∈ 𝓝 (e x) := by
1176-
apply (e.subtypeRestr U ⟨x⟩).open_target.mem_nhds
1175+
have heUx_nhds : (e.subtypeRestr ⟨x⟩).target ∈ 𝓝 (e x) := by
1176+
apply (e.subtypeRestr ⟨x⟩).open_target.mem_nhds
11771177
exact e.map_subtype_source ⟨x⟩ (mem_chart_source _ _)
1178-
exact Filter.eventuallyEq_of_mem heUx_nhds (e.subtypeRestr_symm_eqOn U ⟨x⟩)
1178+
exact Filter.eventuallyEq_of_mem heUx_nhds (e.subtypeRestr_symm_eqOn ⟨x⟩)
11791179

11801180
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
11811181
(chartAt H (Set.inclusion hUV x)).symm
11821182
=ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
11831183
Set.inclusion hUV ∘ (chartAt H x).symm := by
11841184
set e := chartAt H (x : M)
1185-
have heUx_nhds : (e.subtypeRestr U ⟨x⟩).target ∈ 𝓝 (e x) := by
1186-
apply (e.subtypeRestr U ⟨x⟩).open_target.mem_nhds
1185+
have heUx_nhds : (e.subtypeRestr ⟨x⟩).target ∈ 𝓝 (e x) := by
1186+
apply (e.subtypeRestr ⟨x⟩).open_target.mem_nhds
11871187
exact e.map_subtype_source ⟨x⟩ (mem_chart_source _ _)
11881188
exact Filter.eventuallyEq_of_mem heUx_nhds <| e.subtypeRestr_symm_eqOn_of_le ⟨x⟩
11891189
⟨Set.inclusion hUV x⟩ hUV

Mathlib/Topology/PartialHomeomorph.lean

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,32 +1464,31 @@ open TopologicalSpace
14641464

14651465
variable (e : PartialHomeomorph X Y)
14661466

1467-
variable (s : Opens X) (hs : Nonempty s)
1467+
variable {s : Opens X} (hs : Nonempty s)
14681468

14691469
/-- The restriction of a partial homeomorphism `e` to an open subset `s` of the domain type
14701470
produces a partial homeomorphism whose domain is the subtype `s`. -/
14711471
noncomputable def subtypeRestr : PartialHomeomorph s Y :=
14721472
(s.partialHomeomorphSubtypeCoe hs).trans e
14731473
#align local_homeomorph.subtype_restr PartialHomeomorph.subtypeRestr
14741474

1475-
theorem subtypeRestr_def : e.subtypeRestr s hs = (s.partialHomeomorphSubtypeCoe hs).trans e :=
1475+
theorem subtypeRestr_def : e.subtypeRestr hs = (s.partialHomeomorphSubtypeCoe hs).trans e :=
14761476
rfl
14771477
#align local_homeomorph.subtype_restr_def PartialHomeomorph.subtypeRestr_def
14781478

14791479
@[simp, mfld_simps]
14801480
theorem subtypeRestr_coe :
1481-
((e.subtypeRestr s hs : PartialHomeomorph s Y) : s → Y) = Set.restrict ↑s (e : X → Y) :=
1481+
((e.subtypeRestr hs : PartialHomeomorph s Y) : s → Y) = Set.restrict ↑s (e : X → Y) :=
14821482
rfl
14831483
#align local_homeomorph.subtype_restr_coe PartialHomeomorph.subtypeRestr_coe
14841484

14851485
@[simp, mfld_simps]
1486-
theorem subtypeRestr_source : (e.subtypeRestr s hs).source = (↑) ⁻¹' e.source := by
1486+
theorem subtypeRestr_source : (e.subtypeRestr hs).source = (↑) ⁻¹' e.source := by
14871487
simp only [subtypeRestr_def, mfld_simps]
14881488
#align local_homeomorph.subtype_restr_source PartialHomeomorph.subtypeRestr_source
14891489

1490-
variable {s} in
14911490
theorem map_subtype_source {x : s} (hxe : (x : X) ∈ e.source) :
1492-
e x ∈ (e.subtypeRestr s hs).target := by
1491+
e x ∈ (e.subtypeRestr hs).target := by
14931492
refine' ⟨e.map_source hxe, _⟩
14941493
rw [s.partialHomeomorphSubtypeCoe_target, mem_preimage, e.leftInvOn hxe]
14951494
exact x.prop
@@ -1498,7 +1497,7 @@ theorem map_subtype_source {x : s} (hxe : (x : X) ∈ e.source) :
14981497
/- This lemma characterizes the transition functions of an open subset in terms of the transition
14991498
functions of the original space. -/
15001499
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph X Y) :
1501-
(f.subtypeRestr s hs).symm.trans (f'.subtypeRestr s hs) ≈
1500+
(f.subtypeRestr hs).symm.trans (f'.subtypeRestr hs) ≈
15021501
(f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
15031502
simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
15041503
have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
@@ -1515,17 +1514,17 @@ theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph X Y) :
15151514
simp only [mfld_simps, Setoid.refl]
15161515
#align local_homeomorph.subtype_restr_symm_trans_subtype_restr PartialHomeomorph.subtypeRestr_symm_trans_subtypeRestr
15171516

1518-
theorem subtypeRestr_symm_eqOn (U : Opens X) (hU : Nonempty U) :
1519-
EqOn e.symm (Subtype.val ∘ (e.subtypeRestr U hU).symm) (e.subtypeRestr U hU).target := by
1517+
theorem subtypeRestr_symm_eqOn {U : Opens X} (hU : Nonempty U) :
1518+
EqOn e.symm (Subtype.val ∘ (e.subtypeRestr hU).symm) (e.subtypeRestr hU).target := by
15201519
intro y hy
15211520
rw [eq_comm, eq_symm_apply _ _ hy.1]
15221521
· change restrict _ e _ = _
1523-
rw [← subtypeRestr_coe, (e.subtypeRestr U hU).right_inv hy]
1522+
rw [← subtypeRestr_coe, (e.subtypeRestr hU).right_inv hy]
15241523
· have := map_target _ hy; rwa [subtypeRestr_source] at this
15251524

15261525
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens X} (hU : Nonempty U) (hV : Nonempty V)
1527-
(hUV : U ≤ V) : EqOn (e.subtypeRestr V hV).symm (Set.inclusion hUV ∘ (e.subtypeRestr U hU).symm)
1528-
(e.subtypeRestr U hU).target := by
1526+
(hUV : U ≤ V) : EqOn (e.subtypeRestr hV).symm (Set.inclusion hUV ∘ (e.subtypeRestr hU).symm)
1527+
(e.subtypeRestr hU).target := by
15291528
set i := Set.inclusion hUV
15301529
intro y hy
15311530
dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢

0 commit comments

Comments
 (0)