geometry.manifold.smooth_manifold_with_corners ⟷ Mathlib.Geometry.Manifold.SmoothManifoldWithCorners

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 -/
-import Analysis.Calculus.ContDiff
+import Analysis.Calculus.ContDiff.Basic
 import Geometry.Manifold.ChartedSpace
 
 #align_import geometry.manifold.smooth_manifold_with_corners from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
Diff
@@ -348,10 +348,10 @@ protected theorem closedEmbedding : ClosedEmbedding I :=
 #align model_with_corners.closed_embedding ModelWithCorners.closedEmbedding
 -/
 
-#print ModelWithCorners.closed_range /-
-theorem closed_range : IsClosed (range I) :=
-  I.ClosedEmbedding.closed_range
-#align model_with_corners.closed_range ModelWithCorners.closed_range
+#print ModelWithCorners.isClosed_range /-
+theorem isClosed_range : IsClosed (range I) :=
+  I.ClosedEmbedding.isClosed_range
+#align model_with_corners.closed_range ModelWithCorners.isClosed_range
 -/
 
 #print ModelWithCorners.map_nhds_eq /-
Diff
@@ -412,9 +412,9 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
   refine' ⟨fun h => _, fun h => _⟩
   Β· have := h.comp I.continuous_within_at (maps_to_preimage _ _)
     simp_rw [preimage_inter, preimage_preimage, I.left_inv, preimage_id', preimage_range,
-      inter_univ] at this 
-    rwa [Function.comp.assoc, I.symm_comp_self] at this 
-  Β· rw [← I.left_inv x] at h ; exact h.comp I.continuous_within_at_symm (inter_subset_left _ _)
+      inter_univ] at this
+    rwa [Function.comp.assoc, I.symm_comp_self] at this
+  Β· rw [← I.left_inv x] at h; exact h.comp I.continuous_within_at_symm (inter_subset_left _ _)
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
 -/
 
@@ -660,7 +660,7 @@ def contDiffGroupoid : StructureGroupoid H :=
           rw [preimage_inter, inter_assoc, inter_assoc]
           congr 1
           rw [inter_comm]
-        rw [this] at hv 
+        rw [this] at hv
         exact ⟨I.symm ⁻¹' v, v_open.preimage I.continuous_symm, by simpa, hv⟩
       congr := fun f g u hu fg hf => by
         apply hf.congr
@@ -742,14 +742,14 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
   by
   cases' he with he he_symm
   cases' he' with he' he'_symm
-  simp only at he he_symm he' he'_symm 
+  simp only at he he_symm he' he'_symm
   constructor <;> simp only [PartialEquiv.prod_source, PartialHomeomorph.prod_toLocalEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
+    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
     exact h3
   Β· have h3 := ContDiffOn.prod_map he_symm he'_symm
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
+    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
     exact h3
 #align cont_diff_groupoid_prod contDiffGroupoid_prod
@@ -1134,7 +1134,7 @@ theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
 in the source is a neighborhood of the preimage, within a set. -/
 theorem extend_preimage_mem_nhdsWithin {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝[s] x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I x := by
-  rwa [← map_extend_symm_nhds_within f I h, mem_map] at ht 
+  rwa [← map_extend_symm_nhds_within f I h, mem_map] at ht
 #align local_homeomorph.extend_preimage_mem_nhds_within PartialHomeomorph.extend_preimage_mem_nhdsWithin
 -/
 
@@ -1179,7 +1179,7 @@ theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs :
     (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)] f.extend I '' s :=
   by
-  rw [← f.extend_source I] at hs 
+  rw [← f.extend_source I] at hs
   rw [(f.extend I).image_eq_target_inter_inv_preimage hs]
   exact f.extend_symm_preimage_inter_range_eventually_eq_aux I hx
 #align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq PartialHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
@@ -1527,7 +1527,7 @@ in the source is a neighborhood of the preimage, within a set. -/
 theorem extChartAt_preimage_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source)
     (ht : t ∈ 𝓝[s] x') :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x' := by
-  rwa [← map_extChartAt_symm_nhdsWithin' I x h, mem_map] at ht 
+  rwa [← map_extChartAt_symm_nhdsWithin' I x h, mem_map] at ht
 #align ext_chart_at_preimage_mem_nhds_within' extChartAt_preimage_mem_nhdsWithin'
 -/
 
Diff
@@ -728,7 +728,7 @@ theorem symm_trans_mem_contDiffGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ contDiffGroupoid n I :=
   haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
     PartialHomeomorph.trans_symm_self _
-  StructureGroupoid.eq_on_source _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
+  StructureGroupoid.mem_of_eqOnSource _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
 #align symm_trans_mem_cont_diff_groupoid symm_trans_mem_contDiffGroupoid
 -/
 
Diff
@@ -450,12 +450,12 @@ section
 
 variable (π•œ E)
 
-#print modelWithCornersSelf_localEquiv /-
+#print modelWithCornersSelf_partialEquiv /-
 /-- In the trivial model with corners, the associated local equiv is the identity. -/
 @[simp, mfld_simps]
-theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toPartialEquiv = PartialEquiv.refl E :=
+theorem modelWithCornersSelf_partialEquiv : π“˜(π•œ, E).toPartialEquiv = PartialEquiv.refl E :=
   rfl
-#align model_with_corners_self_local_equiv modelWithCornersSelf_localEquiv
+#align model_with_corners_self_local_equiv modelWithCornersSelf_partialEquiv
 -/
 
 #print modelWithCornersSelf_coe /-
Diff
@@ -429,7 +429,7 @@ protected theorem locallyCompactSpace [LocallyCompactSpace E] (I : ModelWithCorn
     intro x
     rw [← I.symm_map_nhds_within_range]
     exact ((compact_basis_nhds (I x)).inf_principal _).map _
-  refine' locallyCompactSpace_of_hasBasis this _
+  refine' LocallyCompactSpace.of_hasBasis this _
   rintro x s ⟨-, hsc⟩
   exact (hsc.inter_right I.closed_range).image I.continuous_symm
 #align model_with_corners.locally_compact ModelWithCorners.locallyCompactSpace
Diff
@@ -136,7 +136,7 @@ define a smooth manifold with model space `H`, and model vector space `E`.
 @[ext, nolint has_nonempty_instance]
 structure ModelWithCorners (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
     [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] extends
-    LocalEquiv H E where
+    PartialEquiv H E where
   source_eq : source = univ
   unique_diff' : UniqueDiffOn π•œ to_local_equiv.target
   continuous_toFun : Continuous to_fun := by continuity
@@ -151,7 +151,7 @@ attribute [simp, mfld_simps] ModelWithCorners.source_eq
 def modelWithCornersSelf (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
     [NormedAddCommGroup E] [NormedSpace π•œ E] : ModelWithCorners π•œ E E
     where
-  toLocalEquiv := LocalEquiv.refl E
+  toPartialEquiv := PartialEquiv.refl E
   source_eq := rfl
   unique_diff' := uniqueDiffOn_univ
   continuous_toFun := continuous_id
@@ -175,8 +175,8 @@ instance : CoeFun (ModelWithCorners π•œ E H) fun _ => H β†’ E :=
 
 #print ModelWithCorners.symm /-
 /-- The inverse to a model with corners, only registered as a local equiv. -/
-protected def symm : LocalEquiv E H :=
-  I.toLocalEquiv.symm
+protected def symm : PartialEquiv E H :=
+  I.toPartialEquiv.symm
 #align model_with_corners.symm ModelWithCorners.symm
 -/
 
@@ -198,35 +198,35 @@ def Simps.symm_apply (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
 -/
 
 initialize_simps_projections ModelWithCorners (to_local_equiv_to_fun β†’ apply,
-  to_local_equiv_inv_fun β†’ symm_apply, toLocalEquiv_source β†’ source, toLocalEquiv_target β†’ target,
-  -toLocalEquiv)
+  to_local_equiv_inv_fun β†’ symm_apply, toPartialEquiv_source β†’ source, toPartialEquiv_target β†’
+  target, -toPartialEquiv)
 
-#print ModelWithCorners.toLocalEquiv_coe /-
+#print ModelWithCorners.toPartialEquiv_coe /-
 -- Register a few lemmas to make sure that `simp` puts expressions in normal form
 @[simp, mfld_simps]
-theorem toLocalEquiv_coe : (I.toLocalEquiv : H β†’ E) = I :=
+theorem toPartialEquiv_coe : (I.toPartialEquiv : H β†’ E) = I :=
   rfl
-#align model_with_corners.to_local_equiv_coe ModelWithCorners.toLocalEquiv_coe
+#align model_with_corners.to_local_equiv_coe ModelWithCorners.toPartialEquiv_coe
 -/
 
 #print ModelWithCorners.mk_coe /-
 @[simp, mfld_simps]
-theorem mk_coe (e : LocalEquiv H E) (a b c d) :
+theorem mk_coe (e : PartialEquiv H E) (a b c d) :
     ((ModelWithCorners.mk e a b c d : ModelWithCorners π•œ E H) : H β†’ E) = (e : H β†’ E) :=
   rfl
 #align model_with_corners.mk_coe ModelWithCorners.mk_coe
 -/
 
-#print ModelWithCorners.toLocalEquiv_coe_symm /-
+#print ModelWithCorners.toPartialEquiv_coe_symm /-
 @[simp, mfld_simps]
-theorem toLocalEquiv_coe_symm : (I.toLocalEquiv.symm : E β†’ H) = I.symm :=
+theorem toPartialEquiv_coe_symm : (I.toPartialEquiv.symm : E β†’ H) = I.symm :=
   rfl
-#align model_with_corners.to_local_equiv_coe_symm ModelWithCorners.toLocalEquiv_coe_symm
+#align model_with_corners.to_local_equiv_coe_symm ModelWithCorners.toPartialEquiv_coe_symm
 -/
 
 #print ModelWithCorners.mk_symm /-
 @[simp, mfld_simps]
-theorem mk_symm (e : LocalEquiv H E) (a b c d) :
+theorem mk_symm (e : PartialEquiv H E) (a b c d) :
     (ModelWithCorners.mk e a b c d : ModelWithCorners π•œ E H).symm = e.symm :=
   rfl
 #align model_with_corners.mk_symm ModelWithCorners.mk_symm
@@ -453,7 +453,7 @@ variable (π•œ E)
 #print modelWithCornersSelf_localEquiv /-
 /-- In the trivial model with corners, the associated local equiv is the identity. -/
 @[simp, mfld_simps]
-theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toLocalEquiv = LocalEquiv.refl E :=
+theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toPartialEquiv = PartialEquiv.refl E :=
   rfl
 #align model_with_corners_self_local_equiv modelWithCornersSelf_localEquiv
 -/
@@ -491,8 +491,8 @@ def ModelWithCorners.prod {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Ty
     {H' : Type w'} [TopologicalSpace H'] (I' : ModelWithCorners π•œ E' H') :
     ModelWithCorners π•œ (E Γ— E') (ModelProd H H') :=
   {
-    I.toLocalEquiv.Prod
-      I'.toLocalEquiv with
+    I.toPartialEquiv.Prod
+      I'.toPartialEquiv with
     toFun := fun x => (I x.1, I' x.2)
     invFun := fun x => (I.symm x.1, I'.symm x.2)
     source := {x | x.1 ∈ I.source ∧ x.2 ∈ I'.source}
@@ -512,7 +512,7 @@ def ModelWithCorners.pi {π•œ : Type u} [NontriviallyNormedField π•œ] {ΞΉ : Typ
     [βˆ€ i, TopologicalSpace (H i)] (I : βˆ€ i, ModelWithCorners π•œ (E i) (H i)) :
     ModelWithCorners π•œ (βˆ€ i, E i) (ModelPi H)
     where
-  toLocalEquiv := LocalEquiv.pi fun i => (I i).toLocalEquiv
+  toPartialEquiv := PartialEquiv.pi fun i => (I i).toPartialEquiv
   source_eq := by simp only [Set.pi_univ, mfld_simps]
   unique_diff' := UniqueDiffOn.pi ΞΉ E _ _ fun i _ => (I i).unique_diff'
   continuous_toFun := continuous_pi fun i => (I i).Continuous.comp (continuous_apply i)
@@ -538,12 +538,12 @@ variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddC
   [TopologicalSpace G] {G' : Type _} [TopologicalSpace G'] {I : ModelWithCorners π•œ E H}
   {J : ModelWithCorners π•œ F G}
 
-#print modelWithCorners_prod_toLocalEquiv /-
+#print modelWithCorners_prod_toPartialEquiv /-
 @[simp, mfld_simps]
-theorem modelWithCorners_prod_toLocalEquiv :
-    (I.Prod J).toLocalEquiv = I.toLocalEquiv.Prod J.toLocalEquiv :=
+theorem modelWithCorners_prod_toPartialEquiv :
+    (I.Prod J).toPartialEquiv = I.toPartialEquiv.Prod J.toPartialEquiv :=
   rfl
-#align model_with_corners_prod_to_local_equiv modelWithCorners_prod_toLocalEquiv
+#align model_with_corners_prod_to_local_equiv modelWithCorners_prod_toPartialEquiv
 -/
 
 #print modelWithCorners_prod_coe /-
@@ -743,7 +743,7 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
   cases' he with he he_symm
   cases' he' with he' he'_symm
   simp only at he he_symm he' he'_symm 
-  constructor <;> simp only [LocalEquiv.prod_source, PartialHomeomorph.prod_toLocalEquiv]
+  constructor <;> simp only [PartialEquiv.prod_source, PartialHomeomorph.prod_toLocalEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
     rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
     rw [← (I.prod I').image_eq]
@@ -940,8 +940,8 @@ namespace PartialHomeomorph
 /-- Given a chart `f` on a manifold with corners, `f.extend I` is the extended chart to the model
 vector space. -/
 @[simp, mfld_simps]
-def extend : LocalEquiv M E :=
-  f.toLocalEquiv ≫ I.toLocalEquiv
+def extend : PartialEquiv M E :=
+  f.toPartialEquiv ≫ I.toPartialEquiv
 #align local_homeomorph.extend PartialHomeomorph.extend
 -/
 
@@ -959,7 +959,7 @@ theorem extend_coe_symm : ⇑(f.extend I).symm = f.symm ∘ I.symm :=
 
 #print PartialHomeomorph.extend_source /-
 theorem extend_source : (f.extend I).source = f.source := by
-  rw [extend, LocalEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
+  rw [extend, PartialEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
 #align local_homeomorph.extend_source PartialHomeomorph.extend_source
 -/
 
@@ -971,7 +971,7 @@ theorem isOpen_extend_source : IsOpen (f.extend I).source := by rw [extend_sourc
 
 #print PartialHomeomorph.extend_target /-
 theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I := by
-  simp_rw [extend, LocalEquiv.trans_target, I.target_eq, I.to_local_equiv_coe_symm, inter_comm]
+  simp_rw [extend, PartialEquiv.trans_target, I.target_eq, I.to_local_equiv_coe_symm, inter_comm]
 #align local_homeomorph.extend_target PartialHomeomorph.extend_target
 -/
 
@@ -1029,7 +1029,7 @@ theorem map_extend_nhds {x : M} (hy : x ∈ f.source) :
 theorem extend_target_mem_nhdsWithin {y : M} (hy : y ∈ f.source) :
     (f.extend I).target ∈ 𝓝[range I] f.extend I y :=
   by
-  rw [← LocalEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
+  rw [← PartialEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
   exact image_mem_map (extend_source_mem_nhds _ _ hy)
 #align local_homeomorph.extend_target_mem_nhds_within PartialHomeomorph.extend_target_mem_nhdsWithin
 -/
@@ -1192,7 +1192,7 @@ theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs :
 theorem extend_coord_change_source :
     ((f.extend I).symm ≫ f'.extend I).source = I '' (f.symm ≫ₕ f').source :=
   by
-  simp_rw [LocalEquiv.trans_source, I.image_eq, extend_source, LocalEquiv.symm_source,
+  simp_rw [PartialEquiv.trans_source, I.image_eq, extend_source, PartialEquiv.symm_source,
     extend_target, inter_right_comm _ (range I)]
   rfl
 #align local_homeomorph.extend_coord_change_source PartialHomeomorph.extend_coord_change_source
@@ -1275,7 +1275,7 @@ variable [ChartedSpace H M] [ChartedSpace H' M']
 /-- The preferred extended chart on a manifold with corners around a point `x`, from a neighborhood
 of `x` to the model vector space. -/
 @[simp, mfld_simps]
-def extChartAt (x : M) : LocalEquiv M E :=
+def extChartAt (x : M) : PartialEquiv M E :=
   (chartAt H x).extend I
 #align ext_chart_at extChartAt
 -/
@@ -1624,7 +1624,7 @@ theorem extChartAt_self_apply {x y : H} : extChartAt I x y = I y :=
 #print extChartAt_model_space_eq_id /-
 /-- In the case of the manifold structure on a vector space, the extended charts are just the
 identity.-/
-theorem extChartAt_model_space_eq_id (x : E) : extChartAt π“˜(π•œ, E) x = LocalEquiv.refl E := by
+theorem extChartAt_model_space_eq_id (x : E) : extChartAt π“˜(π•œ, E) x = PartialEquiv.refl E := by
   simp only [mfld_simps]
 #align ext_chart_at_model_space_eq_id extChartAt_model_space_eq_id
 -/
Diff
@@ -392,7 +392,7 @@ theorem unique_diff_preimage {s : Set H} (hs : IsOpen s) :
 -/
 
 #print ModelWithCorners.unique_diff_preimage_source /-
-theorem unique_diff_preimage_source {Ξ² : Type _} [TopologicalSpace Ξ²] {e : LocalHomeomorph H Ξ²} :
+theorem unique_diff_preimage_source {Ξ² : Type _} [TopologicalSpace Ξ²] {e : PartialHomeomorph H Ξ²} :
     UniqueDiffOn π•œ (I.symm ⁻¹' e.source ∩ range I) :=
   I.unique_diff_preimage e.open_source
 #align model_with_corners.unique_diff_preimage_source ModelWithCorners.unique_diff_preimage_source
@@ -711,7 +711,7 @@ variable (n)
 #print ofSet_mem_contDiffGroupoid /-
 /-- An identity local homeomorphism belongs to the `C^n` groupoid. -/
 theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
-    LocalHomeomorph.ofSet s hs ∈ contDiffGroupoid n I :=
+    PartialHomeomorph.ofSet s hs ∈ contDiffGroupoid n I :=
   by
   rw [contDiffGroupoid, mem_groupoid_of_pregroupoid]
   suffices h : ContDiffOn π•œ n (I ∘ I.symm) (I.symm ⁻¹' s ∩ range I)
@@ -724,10 +724,10 @@ theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
 #print symm_trans_mem_contDiffGroupoid /-
 /-- The composition of a local homeomorphism from `H` to `M` and its inverse belongs to
 the `C^n` groupoid. -/
-theorem symm_trans_mem_contDiffGroupoid (e : LocalHomeomorph M H) :
+theorem symm_trans_mem_contDiffGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ contDiffGroupoid n I :=
-  haveI : e.symm.trans e β‰ˆ LocalHomeomorph.ofSet e.target e.open_target :=
-    LocalHomeomorph.trans_symm_self _
+  haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
+    PartialHomeomorph.trans_symm_self _
   StructureGroupoid.eq_on_source _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
 #align symm_trans_mem_cont_diff_groupoid symm_trans_mem_contDiffGroupoid
 -/
@@ -737,13 +737,13 @@ variable {E' H' : Type _} [NormedAddCommGroup E'] [NormedSpace π•œ E'] [Topolog
 #print contDiffGroupoid_prod /-
 /-- The product of two smooth local homeomorphisms is smooth. -/
 theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCorners π•œ E' H'}
-    {e : LocalHomeomorph H H} {e' : LocalHomeomorph H' H'} (he : e ∈ contDiffGroupoid ⊀ I)
+    {e : PartialHomeomorph H H} {e' : PartialHomeomorph H' H'} (he : e ∈ contDiffGroupoid ⊀ I)
     (he' : e' ∈ contDiffGroupoid ⊀ I') : e.Prod e' ∈ contDiffGroupoid ⊀ (I.Prod I') :=
   by
   cases' he with he he_symm
   cases' he' with he' he'_symm
   simp only at he he_symm he' he'_symm 
-  constructor <;> simp only [LocalEquiv.prod_source, LocalHomeomorph.prod_toLocalEquiv]
+  constructor <;> simp only [LocalEquiv.prod_source, PartialHomeomorph.prod_toLocalEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
     rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
     rw [← (I.prod I').image_eq]
@@ -795,7 +795,7 @@ theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type _} [NontriviallyNor
     {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M]
     (h :
-      βˆ€ e e' : LocalHomeomorph M H,
+      βˆ€ e e' : PartialHomeomorph M H,
         e ∈ atlas H M β†’
           e' ∈ atlas H M β†’
             ContDiffOn π•œ ⊀ (I ∘ e.symm ≫ₕ e' ∘ I.symm)
@@ -855,7 +855,7 @@ theorem chart_mem_maximalAtlas [SmoothManifoldWithCorners I M] (x : M) :
 variable {I}
 
 #print SmoothManifoldWithCorners.compatible_of_mem_maximalAtlas /-
-theorem compatible_of_mem_maximalAtlas {e e' : LocalHomeomorph M H} (he : e ∈ maximalAtlas I M)
+theorem compatible_of_mem_maximalAtlas {e e' : PartialHomeomorph M H} (he : e ∈ maximalAtlas I M)
     (he' : e' ∈ maximalAtlas I M) : e.symm.trans e' ∈ contDiffGroupoid ∞ I :=
   StructureGroupoid.compatible_of_mem_maximalAtlas he he'
 #align smooth_manifold_with_corners.compatible_of_mem_maximal_atlas SmoothManifoldWithCorners.compatible_of_mem_maximalAtlas
@@ -872,7 +872,7 @@ instance prod {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [Norme
     where compatible :=
     by
     rintro f g ⟨f1, f2, hf1, hf2, rfl⟩ ⟨g1, g2, hg1, hg2, rfl⟩
-    rw [LocalHomeomorph.prod_symm, LocalHomeomorph.prod_trans]
+    rw [PartialHomeomorph.prod_symm, PartialHomeomorph.prod_trans]
     have h1 := HasGroupoid.compatible (contDiffGroupoid ⊀ I) hf1 hg1
     have h2 := HasGroupoid.compatible (contDiffGroupoid ⊀ I') hf2 hg2
     exact contDiffGroupoid_prod h1 h2
@@ -881,15 +881,15 @@ instance prod {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [Norme
 
 end SmoothManifoldWithCorners
 
-#print LocalHomeomorph.singleton_smoothManifoldWithCorners /-
-theorem LocalHomeomorph.singleton_smoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ]
-    {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-    (I : ModelWithCorners π•œ E H) {M : Type _} [TopologicalSpace M] (e : LocalHomeomorph M H)
-    (h : e.source = Set.univ) :
+#print PartialHomeomorph.singleton_smoothManifoldWithCorners /-
+theorem PartialHomeomorph.singleton_smoothManifoldWithCorners {π•œ : Type _}
+    [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _}
+    [TopologicalSpace H] (I : ModelWithCorners π•œ E H) {M : Type _} [TopologicalSpace M]
+    (e : PartialHomeomorph M H) (h : e.source = Set.univ) :
     @SmoothManifoldWithCorners π•œ _ E _ _ H _ I M _ (e.singletonChartedSpace h) :=
   @SmoothManifoldWithCorners.mk' _ _ _ _ _ _ _ _ _ _ (id _) <|
     e.singleton_hasGroupoid h (contDiffGroupoid ∞ I)
-#align local_homeomorph.singleton_smooth_manifold_with_corners LocalHomeomorph.singleton_smoothManifoldWithCorners
+#align local_homeomorph.singleton_smooth_manifold_with_corners PartialHomeomorph.singleton_smoothManifoldWithCorners
 -/
 
 #print OpenEmbedding.singleton_smoothManifoldWithCorners /-
@@ -898,7 +898,7 @@ theorem OpenEmbedding.singleton_smoothManifoldWithCorners {π•œ : Type _} [Nontr
     (I : ModelWithCorners π•œ E H) {M : Type _} [TopologicalSpace M] [Nonempty M] {f : M β†’ H}
     (h : OpenEmbedding f) :
     @SmoothManifoldWithCorners π•œ _ E _ _ H _ I M _ h.singletonChartedSpace :=
-  (h.toLocalHomeomorph f).singleton_smoothManifoldWithCorners I (by simp)
+  (h.toPartialHomeomorph f).singleton_smoothManifoldWithCorners I (by simp)
 #align open_embedding.singleton_smooth_manifold_with_corners OpenEmbedding.singleton_smoothManifoldWithCorners
 -/
 
@@ -920,7 +920,7 @@ section ExtendedCharts
 open scoped Topology
 
 variable {π•œ E M H E' M' H' : Type _} [NontriviallyNormedField π•œ] [NormedAddCommGroup E]
-  [NormedSpace π•œ E] [TopologicalSpace H] [TopologicalSpace M] (f f' : LocalHomeomorph M H)
+  [NormedSpace π•œ E] [TopologicalSpace H] [TopologicalSpace M] (f f' : PartialHomeomorph M H)
   (I : ModelWithCorners π•œ E H) [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
   [TopologicalSpace M'] (I' : ModelWithCorners π•œ E' H') (x : M) {s t : Set M}
 
@@ -934,162 +934,162 @@ as `local_equiv`.
 -/
 
 
-namespace LocalHomeomorph
+namespace PartialHomeomorph
 
-#print LocalHomeomorph.extend /-
+#print PartialHomeomorph.extend /-
 /-- Given a chart `f` on a manifold with corners, `f.extend I` is the extended chart to the model
 vector space. -/
 @[simp, mfld_simps]
 def extend : LocalEquiv M E :=
   f.toLocalEquiv ≫ I.toLocalEquiv
-#align local_homeomorph.extend LocalHomeomorph.extend
+#align local_homeomorph.extend PartialHomeomorph.extend
 -/
 
-#print LocalHomeomorph.extend_coe /-
+#print PartialHomeomorph.extend_coe /-
 theorem extend_coe : ⇑(f.extend I) = I ∘ f :=
   rfl
-#align local_homeomorph.extend_coe LocalHomeomorph.extend_coe
+#align local_homeomorph.extend_coe PartialHomeomorph.extend_coe
 -/
 
-#print LocalHomeomorph.extend_coe_symm /-
+#print PartialHomeomorph.extend_coe_symm /-
 theorem extend_coe_symm : ⇑(f.extend I).symm = f.symm ∘ I.symm :=
   rfl
-#align local_homeomorph.extend_coe_symm LocalHomeomorph.extend_coe_symm
+#align local_homeomorph.extend_coe_symm PartialHomeomorph.extend_coe_symm
 -/
 
-#print LocalHomeomorph.extend_source /-
+#print PartialHomeomorph.extend_source /-
 theorem extend_source : (f.extend I).source = f.source := by
   rw [extend, LocalEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
-#align local_homeomorph.extend_source LocalHomeomorph.extend_source
+#align local_homeomorph.extend_source PartialHomeomorph.extend_source
 -/
 
-#print LocalHomeomorph.isOpen_extend_source /-
+#print PartialHomeomorph.isOpen_extend_source /-
 theorem isOpen_extend_source : IsOpen (f.extend I).source := by rw [extend_source];
   exact f.open_source
-#align local_homeomorph.is_open_extend_source LocalHomeomorph.isOpen_extend_source
+#align local_homeomorph.is_open_extend_source PartialHomeomorph.isOpen_extend_source
 -/
 
-#print LocalHomeomorph.extend_target /-
+#print PartialHomeomorph.extend_target /-
 theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I := by
   simp_rw [extend, LocalEquiv.trans_target, I.target_eq, I.to_local_equiv_coe_symm, inter_comm]
-#align local_homeomorph.extend_target LocalHomeomorph.extend_target
+#align local_homeomorph.extend_target PartialHomeomorph.extend_target
 -/
 
-#print LocalHomeomorph.mapsTo_extend /-
+#print PartialHomeomorph.mapsTo_extend /-
 theorem mapsTo_extend (hs : s βŠ† f.source) :
     MapsTo (f.extend I) s ((f.extend I).symm ⁻¹' s ∩ range I) :=
   by
   rw [maps_to', extend_coe, extend_coe_symm, preimage_comp, ← I.image_eq, image_comp,
     f.image_eq_target_inter_inv_preimage hs]
   exact image_subset _ (inter_subset_right _ _)
-#align local_homeomorph.maps_to_extend LocalHomeomorph.mapsTo_extend
+#align local_homeomorph.maps_to_extend PartialHomeomorph.mapsTo_extend
 -/
 
-#print LocalHomeomorph.extend_left_inv /-
+#print PartialHomeomorph.extend_left_inv /-
 theorem extend_left_inv {x : M} (hxf : x ∈ f.source) : (f.extend I).symm (f.extend I x) = x :=
   (f.extend I).left_inv <| by rwa [f.extend_source]
-#align local_homeomorph.extend_left_inv LocalHomeomorph.extend_left_inv
+#align local_homeomorph.extend_left_inv PartialHomeomorph.extend_left_inv
 -/
 
-#print LocalHomeomorph.extend_source_mem_nhds /-
+#print PartialHomeomorph.extend_source_mem_nhds /-
 theorem extend_source_mem_nhds {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝 x :=
   (isOpen_extend_source f I).mem_nhds <| by rwa [f.extend_source I]
-#align local_homeomorph.extend_source_mem_nhds LocalHomeomorph.extend_source_mem_nhds
+#align local_homeomorph.extend_source_mem_nhds PartialHomeomorph.extend_source_mem_nhds
 -/
 
-#print LocalHomeomorph.extend_source_mem_nhdsWithin /-
+#print PartialHomeomorph.extend_source_mem_nhdsWithin /-
 theorem extend_source_mem_nhdsWithin {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝[s] x :=
   mem_nhdsWithin_of_mem_nhds <| extend_source_mem_nhds f I h
-#align local_homeomorph.extend_source_mem_nhds_within LocalHomeomorph.extend_source_mem_nhdsWithin
+#align local_homeomorph.extend_source_mem_nhds_within PartialHomeomorph.extend_source_mem_nhdsWithin
 -/
 
-#print LocalHomeomorph.continuousOn_extend /-
+#print PartialHomeomorph.continuousOn_extend /-
 theorem continuousOn_extend : ContinuousOn (f.extend I) (f.extend I).source :=
   by
   refine' I.continuous.comp_continuous_on _
   rw [extend_source]
   exact f.continuous_on
-#align local_homeomorph.continuous_on_extend LocalHomeomorph.continuousOn_extend
+#align local_homeomorph.continuous_on_extend PartialHomeomorph.continuousOn_extend
 -/
 
-#print LocalHomeomorph.continuousAt_extend /-
+#print PartialHomeomorph.continuousAt_extend /-
 theorem continuousAt_extend {x : M} (h : x ∈ f.source) : ContinuousAt (f.extend I) x :=
   (continuousOn_extend f I).ContinuousAt <| extend_source_mem_nhds f I h
-#align local_homeomorph.continuous_at_extend LocalHomeomorph.continuousAt_extend
+#align local_homeomorph.continuous_at_extend PartialHomeomorph.continuousAt_extend
 -/
 
-#print LocalHomeomorph.map_extend_nhds /-
+#print PartialHomeomorph.map_extend_nhds /-
 theorem map_extend_nhds {x : M} (hy : x ∈ f.source) :
     map (f.extend I) (𝓝 x) = 𝓝[range I] f.extend I x := by
   rwa [extend_coe, (Β· ∘ Β·), ← I.map_nhds_eq, ← f.map_nhds_eq, map_map]
-#align local_homeomorph.map_extend_nhds LocalHomeomorph.map_extend_nhds
+#align local_homeomorph.map_extend_nhds PartialHomeomorph.map_extend_nhds
 -/
 
-#print LocalHomeomorph.extend_target_mem_nhdsWithin /-
+#print PartialHomeomorph.extend_target_mem_nhdsWithin /-
 theorem extend_target_mem_nhdsWithin {y : M} (hy : y ∈ f.source) :
     (f.extend I).target ∈ 𝓝[range I] f.extend I y :=
   by
   rw [← LocalEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
   exact image_mem_map (extend_source_mem_nhds _ _ hy)
-#align local_homeomorph.extend_target_mem_nhds_within LocalHomeomorph.extend_target_mem_nhdsWithin
+#align local_homeomorph.extend_target_mem_nhds_within PartialHomeomorph.extend_target_mem_nhdsWithin
 -/
 
-#print LocalHomeomorph.extend_target_subset_range /-
+#print PartialHomeomorph.extend_target_subset_range /-
 theorem extend_target_subset_range : (f.extend I).target βŠ† range I := by simp only [mfld_simps]
-#align local_homeomorph.extend_target_subset_range LocalHomeomorph.extend_target_subset_range
+#align local_homeomorph.extend_target_subset_range PartialHomeomorph.extend_target_subset_range
 -/
 
-#print LocalHomeomorph.nhdsWithin_extend_target_eq /-
+#print PartialHomeomorph.nhdsWithin_extend_target_eq /-
 theorem nhdsWithin_extend_target_eq {y : M} (hy : y ∈ f.source) :
     𝓝[(f.extend I).target] f.extend I y = 𝓝[range I] f.extend I y :=
   (nhdsWithin_mono _ (extend_target_subset_range _ _)).antisymm <|
     nhdsWithin_le_of_mem (extend_target_mem_nhdsWithin _ _ hy)
-#align local_homeomorph.nhds_within_extend_target_eq LocalHomeomorph.nhdsWithin_extend_target_eq
+#align local_homeomorph.nhds_within_extend_target_eq PartialHomeomorph.nhdsWithin_extend_target_eq
 -/
 
-#print LocalHomeomorph.continuousAt_extend_symm' /-
+#print PartialHomeomorph.continuousAt_extend_symm' /-
 theorem continuousAt_extend_symm' {x : E} (h : x ∈ (f.extend I).target) :
     ContinuousAt (f.extend I).symm x :=
   ContinuousAt.comp (f.continuousAt_symm h.2) I.continuous_symm.ContinuousAt
-#align local_homeomorph.continuous_at_extend_symm' LocalHomeomorph.continuousAt_extend_symm'
+#align local_homeomorph.continuous_at_extend_symm' PartialHomeomorph.continuousAt_extend_symm'
 -/
 
-#print LocalHomeomorph.continuousAt_extend_symm /-
+#print PartialHomeomorph.continuousAt_extend_symm /-
 theorem continuousAt_extend_symm {x : M} (h : x ∈ f.source) :
     ContinuousAt (f.extend I).symm (f.extend I x) :=
   continuousAt_extend_symm' f I <| (f.extend I).map_source <| by rwa [f.extend_source]
-#align local_homeomorph.continuous_at_extend_symm LocalHomeomorph.continuousAt_extend_symm
+#align local_homeomorph.continuous_at_extend_symm PartialHomeomorph.continuousAt_extend_symm
 -/
 
-#print LocalHomeomorph.continuousOn_extend_symm /-
+#print PartialHomeomorph.continuousOn_extend_symm /-
 theorem continuousOn_extend_symm : ContinuousOn (f.extend I).symm (f.extend I).target := fun y hy =>
   (continuousAt_extend_symm' _ _ hy).ContinuousWithinAt
-#align local_homeomorph.continuous_on_extend_symm LocalHomeomorph.continuousOn_extend_symm
+#align local_homeomorph.continuous_on_extend_symm PartialHomeomorph.continuousOn_extend_symm
 -/
 
-#print LocalHomeomorph.extend_symm_continuousWithinAt_comp_right_iff /-
+#print PartialHomeomorph.extend_symm_continuousWithinAt_comp_right_iff /-
 theorem extend_symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {g : M β†’ X}
     {s : Set M} {x : M} :
     ContinuousWithinAt (g ∘ (f.extend I).symm) ((f.extend I).symm ⁻¹' s ∩ range I) (f.extend I x) ↔
       ContinuousWithinAt (g ∘ f.symm) (f.symm ⁻¹' s) (f x) :=
   by convert I.symm_continuous_within_at_comp_right_iff <;> rfl
-#align local_homeomorph.extend_symm_continuous_within_at_comp_right_iff LocalHomeomorph.extend_symm_continuousWithinAt_comp_right_iff
+#align local_homeomorph.extend_symm_continuous_within_at_comp_right_iff PartialHomeomorph.extend_symm_continuousWithinAt_comp_right_iff
 -/
 
-#print LocalHomeomorph.isOpen_extend_preimage' /-
+#print PartialHomeomorph.isOpen_extend_preimage' /-
 theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
     IsOpen ((f.extend I).source ∩ f.extend I ⁻¹' s) :=
   (continuousOn_extend f I).isOpen_inter_preimage (isOpen_extend_source _ _) hs
-#align local_homeomorph.is_open_extend_preimage' LocalHomeomorph.isOpen_extend_preimage'
+#align local_homeomorph.is_open_extend_preimage' PartialHomeomorph.isOpen_extend_preimage'
 -/
 
-#print LocalHomeomorph.isOpen_extend_preimage /-
+#print PartialHomeomorph.isOpen_extend_preimage /-
 theorem isOpen_extend_preimage {s : Set E} (hs : IsOpen s) : IsOpen (f.source ∩ f.extend I ⁻¹' s) :=
   by rw [← extend_source f I]; exact is_open_extend_preimage' f I hs
-#align local_homeomorph.is_open_extend_preimage LocalHomeomorph.isOpen_extend_preimage
+#align local_homeomorph.is_open_extend_preimage PartialHomeomorph.isOpen_extend_preimage
 -/
 
-#print LocalHomeomorph.map_extend_nhdsWithin_eq_image /-
+#print PartialHomeomorph.map_extend_nhdsWithin_eq_image /-
 theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
     map (f.extend I) (𝓝[s] y) = 𝓝[f.extend I '' ((f.extend I).source ∩ s)] f.extend I y := by
   set e := f.extend I <;>
@@ -1101,64 +1101,64 @@ theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
           ((f.extend I).left_inv <| by rwa [f.extend_source])
           (continuous_at_extend_symm f I hy).ContinuousWithinAt
           (continuous_at_extend f I hy).ContinuousWithinAt
-#align local_homeomorph.map_extend_nhds_within_eq_image LocalHomeomorph.map_extend_nhdsWithin_eq_image
+#align local_homeomorph.map_extend_nhds_within_eq_image PartialHomeomorph.map_extend_nhdsWithin_eq_image
 -/
 
-#print LocalHomeomorph.map_extend_nhdsWithin /-
+#print PartialHomeomorph.map_extend_nhdsWithin /-
 theorem map_extend_nhdsWithin {y : M} (hy : y ∈ f.source) :
     map (f.extend I) (𝓝[s] y) = 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I y := by
   rw [map_extend_nhds_within_eq_image f I hy, nhdsWithin_inter, ←
     nhds_within_extend_target_eq _ _ hy, ← nhdsWithin_inter, (f.extend I).image_source_inter_eq',
     inter_comm]
-#align local_homeomorph.map_extend_nhds_within LocalHomeomorph.map_extend_nhdsWithin
+#align local_homeomorph.map_extend_nhds_within PartialHomeomorph.map_extend_nhdsWithin
 -/
 
-#print LocalHomeomorph.map_extend_symm_nhdsWithin /-
+#print PartialHomeomorph.map_extend_symm_nhdsWithin /-
 theorem map_extend_symm_nhdsWithin {y : M} (hy : y ∈ f.source) :
     map (f.extend I).symm (𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I y) = 𝓝[s] y :=
   by
   rw [← map_extend_nhds_within f I hy, map_map, map_congr, map_id]
   exact (f.extend I).LeftInvOn.EqOn.eventuallyEq_of_mem (extend_source_mem_nhds_within _ _ hy)
-#align local_homeomorph.map_extend_symm_nhds_within LocalHomeomorph.map_extend_symm_nhdsWithin
+#align local_homeomorph.map_extend_symm_nhds_within PartialHomeomorph.map_extend_symm_nhdsWithin
 -/
 
-#print LocalHomeomorph.map_extend_symm_nhdsWithin_range /-
+#print PartialHomeomorph.map_extend_symm_nhdsWithin_range /-
 theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
     map (f.extend I).symm (𝓝[range I] f.extend I y) = 𝓝 y := by
   rw [← nhdsWithin_univ, ← map_extend_symm_nhds_within f I hy, preimage_univ, univ_inter]
-#align local_homeomorph.map_extend_symm_nhds_within_range LocalHomeomorph.map_extend_symm_nhdsWithin_range
+#align local_homeomorph.map_extend_symm_nhds_within_range PartialHomeomorph.map_extend_symm_nhdsWithin_range
 -/
 
-#print LocalHomeomorph.extend_preimage_mem_nhdsWithin /-
+#print PartialHomeomorph.extend_preimage_mem_nhdsWithin /-
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 in the source is a neighborhood of the preimage, within a set. -/
 theorem extend_preimage_mem_nhdsWithin {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝[s] x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I x := by
   rwa [← map_extend_symm_nhds_within f I h, mem_map] at ht 
-#align local_homeomorph.extend_preimage_mem_nhds_within LocalHomeomorph.extend_preimage_mem_nhdsWithin
+#align local_homeomorph.extend_preimage_mem_nhds_within PartialHomeomorph.extend_preimage_mem_nhdsWithin
 -/
 
-#print LocalHomeomorph.extend_preimage_mem_nhds /-
+#print PartialHomeomorph.extend_preimage_mem_nhds /-
 theorem extend_preimage_mem_nhds {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝 x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝 (f.extend I x) :=
   by
   apply (continuous_at_extend_symm f I h).preimage_mem_nhds
   rwa [(f.extend I).left_inv]
   rwa [f.extend_source]
-#align local_homeomorph.extend_preimage_mem_nhds LocalHomeomorph.extend_preimage_mem_nhds
+#align local_homeomorph.extend_preimage_mem_nhds PartialHomeomorph.extend_preimage_mem_nhds
 -/
 
-#print LocalHomeomorph.extend_preimage_inter_eq /-
+#print PartialHomeomorph.extend_preimage_inter_eq /-
 /-- Technical lemma to rewrite suitably the preimage of an intersection under an extended chart, to
 bring it into a convenient form to apply derivative lemmas. -/
 theorem extend_preimage_inter_eq :
     (f.extend I).symm ⁻¹' (s ∩ t) ∩ range I =
       (f.extend I).symm ⁻¹' s ∩ range I ∩ (f.extend I).symm ⁻¹' t :=
   by mfld_set_tac
-#align local_homeomorph.extend_preimage_inter_eq LocalHomeomorph.extend_preimage_inter_eq
+#align local_homeomorph.extend_preimage_inter_eq PartialHomeomorph.extend_preimage_inter_eq
 -/
 
-#print LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux /-
+#print PartialHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux /-
 theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)]
       ((f.extend I).target ∩ (f.extend I).symm ⁻¹' s : Set _) :=
@@ -1171,10 +1171,10 @@ theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (h
   refine' (eventually_eq_univ.mpr _).symm.inter eventually_eq.rfl
   refine' I.continuous_at_symm.preimage_mem_nhds (f.open_target.mem_nhds _)
   simp_rw [f.extend_coe, Function.comp_apply, I.left_inv, f.maps_to hx]
-#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq_aux LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux
+#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq_aux PartialHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux
 -/
 
-#print LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq /-
+#print PartialHomeomorph.extend_symm_preimage_inter_range_eventuallyEq /-
 theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs : s βŠ† f.source)
     (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)] f.extend I '' s :=
@@ -1182,31 +1182,31 @@ theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs :
   rw [← f.extend_source I] at hs 
   rw [(f.extend I).image_eq_target_inter_inv_preimage hs]
   exact f.extend_symm_preimage_inter_range_eventually_eq_aux I hx
-#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
+#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq PartialHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
 -/
 
 /-! We use the name `extend_coord_change` for `(f'.extend I).symm ≫ f.extend I`. -/
 
 
-#print LocalHomeomorph.extend_coord_change_source /-
+#print PartialHomeomorph.extend_coord_change_source /-
 theorem extend_coord_change_source :
     ((f.extend I).symm ≫ f'.extend I).source = I '' (f.symm ≫ₕ f').source :=
   by
   simp_rw [LocalEquiv.trans_source, I.image_eq, extend_source, LocalEquiv.symm_source,
     extend_target, inter_right_comm _ (range I)]
   rfl
-#align local_homeomorph.extend_coord_change_source LocalHomeomorph.extend_coord_change_source
+#align local_homeomorph.extend_coord_change_source PartialHomeomorph.extend_coord_change_source
 -/
 
-#print LocalHomeomorph.extend_image_source_inter /-
+#print PartialHomeomorph.extend_image_source_inter /-
 theorem extend_image_source_inter :
     f.extend I '' (f.source ∩ f'.source) = ((f.extend I).symm ≫ f'.extend I).source := by
   simp_rw [f.extend_coord_change_source, f.extend_coe, image_comp I f, trans_source'', symm_symm,
     symm_target]
-#align local_homeomorph.extend_image_source_inter LocalHomeomorph.extend_image_source_inter
+#align local_homeomorph.extend_image_source_inter PartialHomeomorph.extend_image_source_inter
 -/
 
-#print LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin /-
+#print PartialHomeomorph.extend_coord_change_source_mem_nhdsWithin /-
 theorem extend_coord_change_source_mem_nhdsWithin {x : E}
     (hx : x ∈ ((f.extend I).symm ≫ f'.extend I).source) :
     ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] x :=
@@ -1214,35 +1214,35 @@ theorem extend_coord_change_source_mem_nhdsWithin {x : E}
   rw [f.extend_coord_change_source] at hx ⊒
   obtain ⟨x, hx, rfl⟩ := hx
   refine' I.image_mem_nhds_within _
-  refine' (LocalHomeomorph.open_source _).mem_nhds hx
-#align local_homeomorph.extend_coord_change_source_mem_nhds_within LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin
+  refine' (PartialHomeomorph.open_source _).mem_nhds hx
+#align local_homeomorph.extend_coord_change_source_mem_nhds_within PartialHomeomorph.extend_coord_change_source_mem_nhdsWithin
 -/
 
-#print LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin' /-
+#print PartialHomeomorph.extend_coord_change_source_mem_nhdsWithin' /-
 theorem extend_coord_change_source_mem_nhdsWithin' {x : M} (hxf : x ∈ f.source)
     (hxf' : x ∈ f'.source) : ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] f.extend I x :=
   by
   apply extend_coord_change_source_mem_nhds_within
   rw [← extend_image_source_inter]
   exact mem_image_of_mem _ ⟨hxf, hxf'⟩
-#align local_homeomorph.extend_coord_change_source_mem_nhds_within' LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin'
+#align local_homeomorph.extend_coord_change_source_mem_nhds_within' PartialHomeomorph.extend_coord_change_source_mem_nhdsWithin'
 -/
 
 variable {f f'}
 
 open SmoothManifoldWithCorners
 
-#print LocalHomeomorph.contDiffOn_extend_coord_change /-
+#print PartialHomeomorph.contDiffOn_extend_coord_change /-
 theorem contDiffOn_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) :
     ContDiffOn π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) ((f'.extend I).symm ≫ f.extend I).source :=
   by
   rw [extend_coord_change_source, I.image_eq]
   exact (StructureGroupoid.compatible_of_mem_maximalAtlas hf' hf).1
-#align local_homeomorph.cont_diff_on_extend_coord_change LocalHomeomorph.contDiffOn_extend_coord_change
+#align local_homeomorph.cont_diff_on_extend_coord_change PartialHomeomorph.contDiffOn_extend_coord_change
 -/
 
-#print LocalHomeomorph.contDiffWithinAt_extend_coord_change /-
+#print PartialHomeomorph.contDiffWithinAt_extend_coord_change /-
 theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) {x : E} (hx : x ∈ ((f'.extend I).symm ≫ f.extend I).source) :
     ContDiffWithinAt π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) (range I) x :=
@@ -1250,11 +1250,11 @@ theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maxi
   apply (cont_diff_on_extend_coord_change I hf hf' x hx).mono_of_mem
   rw [extend_coord_change_source] at hx ⊒
   obtain ⟨z, hz, rfl⟩ := hx
-  exact I.image_mem_nhds_within ((LocalHomeomorph.open_source _).mem_nhds hz)
-#align local_homeomorph.cont_diff_within_at_extend_coord_change LocalHomeomorph.contDiffWithinAt_extend_coord_change
+  exact I.image_mem_nhds_within ((PartialHomeomorph.open_source _).mem_nhds hz)
+#align local_homeomorph.cont_diff_within_at_extend_coord_change PartialHomeomorph.contDiffWithinAt_extend_coord_change
 -/
 
-#print LocalHomeomorph.contDiffWithinAt_extend_coord_change' /-
+#print PartialHomeomorph.contDiffWithinAt_extend_coord_change' /-
 theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) {x : M} (hxf : x ∈ f.source) (hxf' : x ∈ f'.source) :
     ContDiffWithinAt π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) (range I) (f'.extend I x) :=
@@ -1262,12 +1262,12 @@ theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ max
   refine' cont_diff_within_at_extend_coord_change I hf hf' _
   rw [← extend_image_source_inter]
   exact mem_image_of_mem _ ⟨hxf', hxf⟩
-#align local_homeomorph.cont_diff_within_at_extend_coord_change' LocalHomeomorph.contDiffWithinAt_extend_coord_change'
+#align local_homeomorph.cont_diff_within_at_extend_coord_change' PartialHomeomorph.contDiffWithinAt_extend_coord_change'
 -/
 
-end LocalHomeomorph
+end PartialHomeomorph
 
-open LocalHomeomorph
+open PartialHomeomorph
 
 variable [ChartedSpace H M] [ChartedSpace H' M']
 
Diff
@@ -1079,7 +1079,7 @@ theorem extend_symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {
 #print LocalHomeomorph.isOpen_extend_preimage' /-
 theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
     IsOpen ((f.extend I).source ∩ f.extend I ⁻¹' s) :=
-  (continuousOn_extend f I).preimage_open_of_open (isOpen_extend_source _ _) hs
+  (continuousOn_extend f I).isOpen_inter_preimage (isOpen_extend_source _ _) hs
 #align local_homeomorph.is_open_extend_preimage' LocalHomeomorph.isOpen_extend_preimage'
 -/
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 -/
-import Mathbin.Analysis.Calculus.ContDiff
-import Mathbin.Geometry.Manifold.ChartedSpace
+import Analysis.Calculus.ContDiff
+import Geometry.Manifold.ChartedSpace
 
 #align_import geometry.manifold.smooth_manifold_with_corners from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
 
Diff
@@ -418,8 +418,8 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
 -/
 
-#print ModelWithCorners.locally_compact /-
-protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
+#print ModelWithCorners.locallyCompactSpace /-
+protected theorem locallyCompactSpace [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
     LocallyCompactSpace H :=
   by
   have :
@@ -432,7 +432,7 @@ protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners
   refine' locallyCompactSpace_of_hasBasis this _
   rintro x s ⟨-, hsc⟩
   exact (hsc.inter_right I.closed_range).image I.continuous_symm
-#align model_with_corners.locally_compact ModelWithCorners.locally_compact
+#align model_with_corners.locally_compact ModelWithCorners.locallyCompactSpace
 -/
 
 open TopologicalSpace
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
-
-! This file was ported from Lean 3 source module geometry.manifold.smooth_manifold_with_corners
-! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.ContDiff
 import Mathbin.Geometry.Manifold.ChartedSpace
 
+#align_import geometry.manifold.smooth_manifold_with_corners from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
+
 /-!
 # Smooth manifolds (possibly with boundary or corners)
 
Diff
@@ -126,7 +126,6 @@ open Set Filter Function
 
 open scoped Manifold Filter Topology
 
--- mathport name: with_top.nat.top
 scoped[Manifold] notation "∞" => (⊀ : β„•βˆž)
 
 /-! ### Models with corners. -/
@@ -163,10 +162,8 @@ def modelWithCornersSelf (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Typ
 #align model_with_corners_self modelWithCornersSelf
 -/
 
--- mathport name: model_with_corners_self
 scoped[Manifold] notation "π“˜(" π•œ ", " E ")" => modelWithCornersSelf π•œ E
 
--- mathport name: model_with_corners_self.self
 scoped[Manifold] notation "π“˜(" π•œ ")" => modelWithCornersSelf π•œ π•œ
 
 section
@@ -207,11 +204,13 @@ initialize_simps_projections ModelWithCorners (to_local_equiv_to_fun β†’ apply,
   to_local_equiv_inv_fun β†’ symm_apply, toLocalEquiv_source β†’ source, toLocalEquiv_target β†’ target,
   -toLocalEquiv)
 
+#print ModelWithCorners.toLocalEquiv_coe /-
 -- Register a few lemmas to make sure that `simp` puts expressions in normal form
 @[simp, mfld_simps]
 theorem toLocalEquiv_coe : (I.toLocalEquiv : H β†’ E) = I :=
   rfl
 #align model_with_corners.to_local_equiv_coe ModelWithCorners.toLocalEquiv_coe
+-/
 
 #print ModelWithCorners.mk_coe /-
 @[simp, mfld_simps]
@@ -221,10 +220,12 @@ theorem mk_coe (e : LocalEquiv H E) (a b c d) :
 #align model_with_corners.mk_coe ModelWithCorners.mk_coe
 -/
 
+#print ModelWithCorners.toLocalEquiv_coe_symm /-
 @[simp, mfld_simps]
 theorem toLocalEquiv_coe_symm : (I.toLocalEquiv.symm : E β†’ H) = I.symm :=
   rfl
 #align model_with_corners.to_local_equiv_coe_symm ModelWithCorners.toLocalEquiv_coe_symm
+-/
 
 #print ModelWithCorners.mk_symm /-
 @[simp, mfld_simps]
@@ -253,31 +254,43 @@ protected theorem continuousWithinAt {s x} : ContinuousWithinAt I s x :=
 #align model_with_corners.continuous_within_at ModelWithCorners.continuousWithinAt
 -/
 
+#print ModelWithCorners.continuous_symm /-
 @[continuity]
 theorem continuous_symm : Continuous I.symm :=
   I.continuous_invFun
 #align model_with_corners.continuous_symm ModelWithCorners.continuous_symm
+-/
 
+#print ModelWithCorners.continuousAt_symm /-
 theorem continuousAt_symm {x} : ContinuousAt I.symm x :=
   I.continuous_symm.ContinuousAt
 #align model_with_corners.continuous_at_symm ModelWithCorners.continuousAt_symm
+-/
 
+#print ModelWithCorners.continuousWithinAt_symm /-
 theorem continuousWithinAt_symm {s x} : ContinuousWithinAt I.symm s x :=
   I.continuous_symm.ContinuousWithinAt
 #align model_with_corners.continuous_within_at_symm ModelWithCorners.continuousWithinAt_symm
+-/
 
+#print ModelWithCorners.continuousOn_symm /-
 theorem continuousOn_symm {s} : ContinuousOn I.symm s :=
   I.continuous_symm.ContinuousOn
 #align model_with_corners.continuous_on_symm ModelWithCorners.continuousOn_symm
+-/
 
+#print ModelWithCorners.target_eq /-
 @[simp, mfld_simps]
 theorem target_eq : I.target = range (I : H β†’ E) := by rw [← image_univ, ← I.source_eq];
   exact I.to_local_equiv.image_source_eq_target.symm
 #align model_with_corners.target_eq ModelWithCorners.target_eq
+-/
 
+#print ModelWithCorners.unique_diff /-
 protected theorem unique_diff : UniqueDiffOn π•œ (range I) :=
   I.target_eq β–Έ I.unique_diff'
 #align model_with_corners.unique_diff ModelWithCorners.unique_diff
+-/
 
 #print ModelWithCorners.left_inv /-
 @[simp, mfld_simps]
@@ -310,10 +323,12 @@ protected theorem rightInvOn : RightInvOn I.symm I (range I) :=
 #align model_with_corners.right_inv_on ModelWithCorners.rightInvOn
 -/
 
+#print ModelWithCorners.right_inv /-
 @[simp, mfld_simps]
 protected theorem right_inv {x : E} (hx : x ∈ range I) : I (I.symm x) = x :=
   I.RightInvOn hx
 #align model_with_corners.right_inv ModelWithCorners.right_inv
+-/
 
 #print ModelWithCorners.preimage_image /-
 theorem preimage_image (s : Set H) : I ⁻¹' (I '' s) = s :=
@@ -321,12 +336,14 @@ theorem preimage_image (s : Set H) : I ⁻¹' (I '' s) = s :=
 #align model_with_corners.preimage_image ModelWithCorners.preimage_image
 -/
 
+#print ModelWithCorners.image_eq /-
 protected theorem image_eq (s : Set H) : I '' s = I.symm ⁻¹' s ∩ range I :=
   by
   refine' (I.to_local_equiv.image_eq_target_inter_inv_preimage _).trans _
   Β· rw [I.source_eq]; exact subset_univ _
   Β· rw [inter_comm, I.target_eq, I.to_local_equiv_coe_symm]
 #align model_with_corners.image_eq ModelWithCorners.image_eq
+-/
 
 #print ModelWithCorners.closedEmbedding /-
 protected theorem closedEmbedding : ClosedEmbedding I :=
@@ -334,13 +351,17 @@ protected theorem closedEmbedding : ClosedEmbedding I :=
 #align model_with_corners.closed_embedding ModelWithCorners.closedEmbedding
 -/
 
+#print ModelWithCorners.closed_range /-
 theorem closed_range : IsClosed (range I) :=
   I.ClosedEmbedding.closed_range
 #align model_with_corners.closed_range ModelWithCorners.closed_range
+-/
 
+#print ModelWithCorners.map_nhds_eq /-
 theorem map_nhds_eq (x : H) : map I (𝓝 x) = 𝓝[range I] I x :=
   I.ClosedEmbedding.toEmbedding.map_nhds_eq x
 #align model_with_corners.map_nhds_eq ModelWithCorners.map_nhds_eq
+-/
 
 #print ModelWithCorners.map_nhdsWithin_eq /-
 theorem map_nhdsWithin_eq (s : Set H) (x : H) : map I (𝓝[s] x) = 𝓝[I '' s] I x :=
@@ -366,20 +387,27 @@ theorem symm_map_nhdsWithin_range (x : H) : map I.symm (𝓝[range I] I x) = 
 #align model_with_corners.symm_map_nhds_within_range ModelWithCorners.symm_map_nhdsWithin_range
 -/
 
+#print ModelWithCorners.unique_diff_preimage /-
 theorem unique_diff_preimage {s : Set H} (hs : IsOpen s) :
     UniqueDiffOn π•œ (I.symm ⁻¹' s ∩ range I) := by rw [inter_comm];
   exact I.unique_diff.inter (hs.preimage I.continuous_inv_fun)
 #align model_with_corners.unique_diff_preimage ModelWithCorners.unique_diff_preimage
+-/
 
+#print ModelWithCorners.unique_diff_preimage_source /-
 theorem unique_diff_preimage_source {Ξ² : Type _} [TopologicalSpace Ξ²] {e : LocalHomeomorph H Ξ²} :
     UniqueDiffOn π•œ (I.symm ⁻¹' e.source ∩ range I) :=
   I.unique_diff_preimage e.open_source
 #align model_with_corners.unique_diff_preimage_source ModelWithCorners.unique_diff_preimage_source
+-/
 
+#print ModelWithCorners.unique_diff_at_image /-
 theorem unique_diff_at_image {x : H} : UniqueDiffWithinAt π•œ (range I) (I x) :=
   I.unique_diff _ (mem_range_self _)
 #align model_with_corners.unique_diff_at_image ModelWithCorners.unique_diff_at_image
+-/
 
+#print ModelWithCorners.symm_continuousWithinAt_comp_right_iff /-
 theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H β†’ X} {s : Set H}
     {x : H} :
     ContinuousWithinAt (f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I x) ↔ ContinuousWithinAt f s x :=
@@ -391,7 +419,9 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
     rwa [Function.comp.assoc, I.symm_comp_self] at this 
   Β· rw [← I.left_inv x] at h ; exact h.comp I.continuous_within_at_symm (inter_subset_left _ _)
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
+-/
 
+#print ModelWithCorners.locally_compact /-
 protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
     LocallyCompactSpace H :=
   by
@@ -406,13 +436,16 @@ protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners
   rintro x s ⟨-, hsc⟩
   exact (hsc.inter_right I.closed_range).image I.continuous_symm
 #align model_with_corners.locally_compact ModelWithCorners.locally_compact
+-/
 
 open TopologicalSpace
 
+#print ModelWithCorners.secondCountableTopology /-
 protected theorem secondCountableTopology [SecondCountableTopology E] (I : ModelWithCorners π•œ E H) :
     SecondCountableTopology H :=
   I.ClosedEmbedding.toEmbedding.SecondCountableTopology
 #align model_with_corners.second_countable_topology ModelWithCorners.secondCountableTopology
+-/
 
 end ModelWithCorners
 
@@ -448,6 +481,7 @@ end
 
 section ModelWithCornersProd
 
+#print ModelWithCorners.prod /-
 /-- Given two model_with_corners `I` on `(E, H)` and `I'` on `(E', H')`, we define the model with
 corners `I.prod I'` on `(E Γ— E', model_prod H H')`. This appears in particular for the manifold
 structure on the tangent bundle to a manifold modelled on `(E, H)`: it will be modelled on
@@ -470,6 +504,7 @@ def ModelWithCorners.prod {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Ty
     continuous_toFun := I.continuous_toFun.Prod_map I'.continuous_toFun
     continuous_invFun := I.continuous_invFun.Prod_map I'.continuous_invFun }
 #align model_with_corners.prod ModelWithCorners.prod
+-/
 
 #print ModelWithCorners.pi /-
 /-- Given a finite family of `model_with_corners` `I i` on `(E i, H i)`, we define the model with
@@ -488,6 +523,7 @@ def ModelWithCorners.pi {π•œ : Type u} [NontriviallyNormedField π•œ] {ΞΉ : Typ
 #align model_with_corners.pi ModelWithCorners.pi
 -/
 
+#print ModelWithCorners.tangent /-
 /-- Special case of product model with corners, which is trivial on the second factor. This shows up
 as the model to tangent bundles. -/
 @[reducible]
@@ -496,6 +532,7 @@ def ModelWithCorners.tangent {π•œ : Type u} [NontriviallyNormedField π•œ] {E :
     (I : ModelWithCorners π•œ E H) : ModelWithCorners π•œ (E Γ— E) (ModelProd H E) :=
   I.Prod π“˜(π•œ, E)
 #align model_with_corners.tangent ModelWithCorners.tangent
+-/
 
 variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
   [NormedSpace π•œ E] {E' : Type _} [NormedAddCommGroup E'] [NormedSpace π•œ E'] {F : Type _}
@@ -504,32 +541,42 @@ variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddC
   [TopologicalSpace G] {G' : Type _} [TopologicalSpace G'] {I : ModelWithCorners π•œ E H}
   {J : ModelWithCorners π•œ F G}
 
+#print modelWithCorners_prod_toLocalEquiv /-
 @[simp, mfld_simps]
 theorem modelWithCorners_prod_toLocalEquiv :
     (I.Prod J).toLocalEquiv = I.toLocalEquiv.Prod J.toLocalEquiv :=
   rfl
 #align model_with_corners_prod_to_local_equiv modelWithCorners_prod_toLocalEquiv
+-/
 
+#print modelWithCorners_prod_coe /-
 @[simp, mfld_simps]
 theorem modelWithCorners_prod_coe (I : ModelWithCorners π•œ E H) (I' : ModelWithCorners π•œ E' H') :
     (I.Prod I' : _ Γ— _ β†’ _ Γ— _) = Prod.map I I' :=
   rfl
 #align model_with_corners_prod_coe modelWithCorners_prod_coe
+-/
 
+#print modelWithCorners_prod_coe_symm /-
 @[simp, mfld_simps]
 theorem modelWithCorners_prod_coe_symm (I : ModelWithCorners π•œ E H)
     (I' : ModelWithCorners π•œ E' H') :
     ((I.Prod I').symm : _ Γ— _ β†’ _ Γ— _) = Prod.map I.symm I'.symm :=
   rfl
 #align model_with_corners_prod_coe_symm modelWithCorners_prod_coe_symm
+-/
 
+#print modelWithCornersSelf_prod /-
 theorem modelWithCornersSelf_prod : π“˜(π•œ, E Γ— F) = π“˜(π•œ, E).Prod π“˜(π•œ, F) := by ext1; simp
 #align model_with_corners_self_prod modelWithCornersSelf_prod
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ModelWithCorners.range_prod /-
 theorem ModelWithCorners.range_prod : range (I.Prod J) = range I Γ—Λ’ range J := by
   simp_rw [← ModelWithCorners.target_eq]; rfl
 #align model_with_corners.range_prod ModelWithCorners.range_prod
+-/
 
 end ModelWithCornersProd
 
@@ -552,6 +599,7 @@ instance modelWithCornersSelf_boundaryless (π•œ : Type _) [NontriviallyNormedFi
 #align model_with_corners_self_boundaryless modelWithCornersSelf_boundaryless
 -/
 
+#print ModelWithCorners.range_eq_univ_prod /-
 /-- If two model with corners are boundaryless, their product also is -/
 instance ModelWithCorners.range_eq_univ_prod {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v}
     [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type w} [TopologicalSpace H]
@@ -564,6 +612,7 @@ instance ModelWithCorners.range_eq_univ_prod {π•œ : Type u} [NontriviallyNormed
   rw [← prod_range_range_eq, ModelWithCorners.Boundaryless.range_eq_univ,
     ModelWithCorners.Boundaryless.range_eq_univ, univ_prod_univ]
 #align model_with_corners.range_eq_univ_prod ModelWithCorners.range_eq_univ_prod
+-/
 
 end Boundaryless
 
@@ -628,6 +677,7 @@ def contDiffGroupoid : StructureGroupoid H :=
 
 variable {n}
 
+#print contDiffGroupoid_le /-
 /-- Inclusion of the groupoid of `C^n` local diffeos in the groupoid of `C^m` local diffeos when
 `m ≀ n` -/
 theorem contDiffGroupoid_le (h : m ≀ n) : contDiffGroupoid n I ≀ contDiffGroupoid m I :=
@@ -637,7 +687,9 @@ theorem contDiffGroupoid_le (h : m ≀ n) : contDiffGroupoid n I ≀ contDiffGro
   intro f s hfs
   exact ContDiffOn.of_le hfs h
 #align cont_diff_groupoid_le contDiffGroupoid_le
+-/
 
+#print contDiffGroupoid_zero_eq /-
 /-- The groupoid of `0`-times continuously differentiable maps is just the groupoid of all
 local homeomorphisms -/
 theorem contDiffGroupoid_zero_eq : contDiffGroupoid 0 I = continuousGroupoid H :=
@@ -655,9 +707,11 @@ theorem contDiffGroupoid_zero_eq : contDiffGroupoid 0 I = continuousGroupoid H :
   Β· refine' I.continuous.comp_continuous_on (u.symm.continuous_on.comp I.continuous_on_symm _)
     exact (maps_to_preimage _ _).mono_left (inter_subset_left _ _)
 #align cont_diff_groupoid_zero_eq contDiffGroupoid_zero_eq
+-/
 
 variable (n)
 
+#print ofSet_mem_contDiffGroupoid /-
 /-- An identity local homeomorphism belongs to the `C^n` groupoid. -/
 theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
     LocalHomeomorph.ofSet s hs ∈ contDiffGroupoid n I :=
@@ -668,7 +722,9 @@ theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
   have : ContDiffOn π•œ n id (univ : Set E) := cont_diff_id.cont_diff_on
   exact this.congr_mono (fun x hx => by simp [hx.2]) (subset_univ _)
 #align of_set_mem_cont_diff_groupoid ofSet_mem_contDiffGroupoid
+-/
 
+#print symm_trans_mem_contDiffGroupoid /-
 /-- The composition of a local homeomorphism from `H` to `M` and its inverse belongs to
 the `C^n` groupoid. -/
 theorem symm_trans_mem_contDiffGroupoid (e : LocalHomeomorph M H) :
@@ -677,9 +733,11 @@ theorem symm_trans_mem_contDiffGroupoid (e : LocalHomeomorph M H) :
     LocalHomeomorph.trans_symm_self _
   StructureGroupoid.eq_on_source _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
 #align symm_trans_mem_cont_diff_groupoid symm_trans_mem_contDiffGroupoid
+-/
 
 variable {E' H' : Type _} [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
 
+#print contDiffGroupoid_prod /-
 /-- The product of two smooth local homeomorphisms is smooth. -/
 theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCorners π•œ E' H'}
     {e : LocalHomeomorph H H} {e' : LocalHomeomorph H' H'} (he : e ∈ contDiffGroupoid ⊀ I)
@@ -698,6 +756,7 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
     rw [← (I.prod I').image_eq]
     exact h3
 #align cont_diff_groupoid_prod contDiffGroupoid_prod
+-/
 
 /-- The `C^n` groupoid is closed under restriction. -/
 instance : ClosedUnderRestriction (contDiffGroupoid n I) :=
@@ -725,13 +784,16 @@ class SmoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ] {
 #align smooth_manifold_with_corners SmoothManifoldWithCorners
 -/
 
+#print SmoothManifoldWithCorners.mk' /-
 theorem SmoothManifoldWithCorners.mk' {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
     [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M]
     [gr : HasGroupoid M (contDiffGroupoid ∞ I)] : SmoothManifoldWithCorners I M :=
   { gr with }
 #align smooth_manifold_with_corners.mk' SmoothManifoldWithCorners.mk'
+-/
 
+#print smoothManifoldWithCorners_of_contDiffOn /-
 theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type _} [NontriviallyNormedField π•œ]
     {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M]
@@ -748,6 +810,7 @@ theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type _} [NontriviallyNor
       haveI : HasGroupoid M (contDiffGroupoid ∞ I) := hasGroupoid_of_pregroupoid _ h
       apply StructureGroupoid.compatible }
 #align smooth_manifold_with_corners_of_cont_diff_on smoothManifoldWithCorners_of_contDiffOn
+-/
 
 #print model_space_smooth /-
 /-- For any model with corners, the model space is a smooth manifold -/
@@ -779,22 +842,29 @@ def maximalAtlas :=
 
 variable {M}
 
+#print SmoothManifoldWithCorners.subset_maximalAtlas /-
 theorem subset_maximalAtlas [SmoothManifoldWithCorners I M] : atlas H M βŠ† maximalAtlas I M :=
   StructureGroupoid.subset_maximalAtlas _
 #align smooth_manifold_with_corners.subset_maximal_atlas SmoothManifoldWithCorners.subset_maximalAtlas
+-/
 
+#print SmoothManifoldWithCorners.chart_mem_maximalAtlas /-
 theorem chart_mem_maximalAtlas [SmoothManifoldWithCorners I M] (x : M) :
     chartAt H x ∈ maximalAtlas I M :=
   StructureGroupoid.chart_mem_maximalAtlas _ x
 #align smooth_manifold_with_corners.chart_mem_maximal_atlas SmoothManifoldWithCorners.chart_mem_maximalAtlas
+-/
 
 variable {I}
 
+#print SmoothManifoldWithCorners.compatible_of_mem_maximalAtlas /-
 theorem compatible_of_mem_maximalAtlas {e e' : LocalHomeomorph M H} (he : e ∈ maximalAtlas I M)
     (he' : e' ∈ maximalAtlas I M) : e.symm.trans e' ∈ contDiffGroupoid ∞ I :=
   StructureGroupoid.compatible_of_mem_maximalAtlas he he'
 #align smooth_manifold_with_corners.compatible_of_mem_maximal_atlas SmoothManifoldWithCorners.compatible_of_mem_maximalAtlas
+-/
 
+#print SmoothManifoldWithCorners.prod /-
 /-- The product of two smooth manifolds with corners is naturally a smooth manifold with corners. -/
 instance prod {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
     [NormedSpace π•œ E] {E' : Type _} [NormedAddCommGroup E'] [NormedSpace π•œ E'] {H : Type _}
@@ -810,9 +880,11 @@ instance prod {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [Norme
     have h2 := HasGroupoid.compatible (contDiffGroupoid ⊀ I') hf2 hg2
     exact contDiffGroupoid_prod h1 h2
 #align smooth_manifold_with_corners.prod SmoothManifoldWithCorners.prod
+-/
 
 end SmoothManifoldWithCorners
 
+#print LocalHomeomorph.singleton_smoothManifoldWithCorners /-
 theorem LocalHomeomorph.singleton_smoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ]
     {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) {M : Type _} [TopologicalSpace M] (e : LocalHomeomorph M H)
@@ -821,7 +893,9 @@ theorem LocalHomeomorph.singleton_smoothManifoldWithCorners {π•œ : Type _} [Non
   @SmoothManifoldWithCorners.mk' _ _ _ _ _ _ _ _ _ _ (id _) <|
     e.singleton_hasGroupoid h (contDiffGroupoid ∞ I)
 #align local_homeomorph.singleton_smooth_manifold_with_corners LocalHomeomorph.singleton_smoothManifoldWithCorners
+-/
 
+#print OpenEmbedding.singleton_smoothManifoldWithCorners /-
 theorem OpenEmbedding.singleton_smoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ]
     {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) {M : Type _} [TopologicalSpace M] [Nonempty M] {f : M β†’ H}
@@ -829,6 +903,7 @@ theorem OpenEmbedding.singleton_smoothManifoldWithCorners {π•œ : Type _} [Nontr
     @SmoothManifoldWithCorners π•œ _ E _ _ H _ I M _ h.singletonChartedSpace :=
   (h.toLocalHomeomorph f).singleton_smoothManifoldWithCorners I (by simp)
 #align open_embedding.singleton_smooth_manifold_with_corners OpenEmbedding.singleton_smoothManifoldWithCorners
+-/
 
 namespace TopologicalSpace.Opens
 
@@ -873,26 +948,37 @@ def extend : LocalEquiv M E :=
 #align local_homeomorph.extend LocalHomeomorph.extend
 -/
 
+#print LocalHomeomorph.extend_coe /-
 theorem extend_coe : ⇑(f.extend I) = I ∘ f :=
   rfl
 #align local_homeomorph.extend_coe LocalHomeomorph.extend_coe
+-/
 
+#print LocalHomeomorph.extend_coe_symm /-
 theorem extend_coe_symm : ⇑(f.extend I).symm = f.symm ∘ I.symm :=
   rfl
 #align local_homeomorph.extend_coe_symm LocalHomeomorph.extend_coe_symm
+-/
 
+#print LocalHomeomorph.extend_source /-
 theorem extend_source : (f.extend I).source = f.source := by
   rw [extend, LocalEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
 #align local_homeomorph.extend_source LocalHomeomorph.extend_source
+-/
 
+#print LocalHomeomorph.isOpen_extend_source /-
 theorem isOpen_extend_source : IsOpen (f.extend I).source := by rw [extend_source];
   exact f.open_source
 #align local_homeomorph.is_open_extend_source LocalHomeomorph.isOpen_extend_source
+-/
 
+#print LocalHomeomorph.extend_target /-
 theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I := by
   simp_rw [extend, LocalEquiv.trans_target, I.target_eq, I.to_local_equiv_coe_symm, inter_comm]
 #align local_homeomorph.extend_target LocalHomeomorph.extend_target
+-/
 
+#print LocalHomeomorph.mapsTo_extend /-
 theorem mapsTo_extend (hs : s βŠ† f.source) :
     MapsTo (f.extend I) s ((f.extend I).symm ⁻¹' s ∩ range I) :=
   by
@@ -900,81 +986,113 @@ theorem mapsTo_extend (hs : s βŠ† f.source) :
     f.image_eq_target_inter_inv_preimage hs]
   exact image_subset _ (inter_subset_right _ _)
 #align local_homeomorph.maps_to_extend LocalHomeomorph.mapsTo_extend
+-/
 
+#print LocalHomeomorph.extend_left_inv /-
 theorem extend_left_inv {x : M} (hxf : x ∈ f.source) : (f.extend I).symm (f.extend I x) = x :=
   (f.extend I).left_inv <| by rwa [f.extend_source]
 #align local_homeomorph.extend_left_inv LocalHomeomorph.extend_left_inv
+-/
 
+#print LocalHomeomorph.extend_source_mem_nhds /-
 theorem extend_source_mem_nhds {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝 x :=
   (isOpen_extend_source f I).mem_nhds <| by rwa [f.extend_source I]
 #align local_homeomorph.extend_source_mem_nhds LocalHomeomorph.extend_source_mem_nhds
+-/
 
+#print LocalHomeomorph.extend_source_mem_nhdsWithin /-
 theorem extend_source_mem_nhdsWithin {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝[s] x :=
   mem_nhdsWithin_of_mem_nhds <| extend_source_mem_nhds f I h
 #align local_homeomorph.extend_source_mem_nhds_within LocalHomeomorph.extend_source_mem_nhdsWithin
+-/
 
+#print LocalHomeomorph.continuousOn_extend /-
 theorem continuousOn_extend : ContinuousOn (f.extend I) (f.extend I).source :=
   by
   refine' I.continuous.comp_continuous_on _
   rw [extend_source]
   exact f.continuous_on
 #align local_homeomorph.continuous_on_extend LocalHomeomorph.continuousOn_extend
+-/
 
+#print LocalHomeomorph.continuousAt_extend /-
 theorem continuousAt_extend {x : M} (h : x ∈ f.source) : ContinuousAt (f.extend I) x :=
   (continuousOn_extend f I).ContinuousAt <| extend_source_mem_nhds f I h
 #align local_homeomorph.continuous_at_extend LocalHomeomorph.continuousAt_extend
+-/
 
+#print LocalHomeomorph.map_extend_nhds /-
 theorem map_extend_nhds {x : M} (hy : x ∈ f.source) :
     map (f.extend I) (𝓝 x) = 𝓝[range I] f.extend I x := by
   rwa [extend_coe, (Β· ∘ Β·), ← I.map_nhds_eq, ← f.map_nhds_eq, map_map]
 #align local_homeomorph.map_extend_nhds LocalHomeomorph.map_extend_nhds
+-/
 
+#print LocalHomeomorph.extend_target_mem_nhdsWithin /-
 theorem extend_target_mem_nhdsWithin {y : M} (hy : y ∈ f.source) :
     (f.extend I).target ∈ 𝓝[range I] f.extend I y :=
   by
   rw [← LocalEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
   exact image_mem_map (extend_source_mem_nhds _ _ hy)
 #align local_homeomorph.extend_target_mem_nhds_within LocalHomeomorph.extend_target_mem_nhdsWithin
+-/
 
+#print LocalHomeomorph.extend_target_subset_range /-
 theorem extend_target_subset_range : (f.extend I).target βŠ† range I := by simp only [mfld_simps]
 #align local_homeomorph.extend_target_subset_range LocalHomeomorph.extend_target_subset_range
+-/
 
+#print LocalHomeomorph.nhdsWithin_extend_target_eq /-
 theorem nhdsWithin_extend_target_eq {y : M} (hy : y ∈ f.source) :
     𝓝[(f.extend I).target] f.extend I y = 𝓝[range I] f.extend I y :=
   (nhdsWithin_mono _ (extend_target_subset_range _ _)).antisymm <|
     nhdsWithin_le_of_mem (extend_target_mem_nhdsWithin _ _ hy)
 #align local_homeomorph.nhds_within_extend_target_eq LocalHomeomorph.nhdsWithin_extend_target_eq
+-/
 
+#print LocalHomeomorph.continuousAt_extend_symm' /-
 theorem continuousAt_extend_symm' {x : E} (h : x ∈ (f.extend I).target) :
     ContinuousAt (f.extend I).symm x :=
   ContinuousAt.comp (f.continuousAt_symm h.2) I.continuous_symm.ContinuousAt
 #align local_homeomorph.continuous_at_extend_symm' LocalHomeomorph.continuousAt_extend_symm'
+-/
 
+#print LocalHomeomorph.continuousAt_extend_symm /-
 theorem continuousAt_extend_symm {x : M} (h : x ∈ f.source) :
     ContinuousAt (f.extend I).symm (f.extend I x) :=
   continuousAt_extend_symm' f I <| (f.extend I).map_source <| by rwa [f.extend_source]
 #align local_homeomorph.continuous_at_extend_symm LocalHomeomorph.continuousAt_extend_symm
+-/
 
+#print LocalHomeomorph.continuousOn_extend_symm /-
 theorem continuousOn_extend_symm : ContinuousOn (f.extend I).symm (f.extend I).target := fun y hy =>
   (continuousAt_extend_symm' _ _ hy).ContinuousWithinAt
 #align local_homeomorph.continuous_on_extend_symm LocalHomeomorph.continuousOn_extend_symm
+-/
 
+#print LocalHomeomorph.extend_symm_continuousWithinAt_comp_right_iff /-
 theorem extend_symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {g : M β†’ X}
     {s : Set M} {x : M} :
     ContinuousWithinAt (g ∘ (f.extend I).symm) ((f.extend I).symm ⁻¹' s ∩ range I) (f.extend I x) ↔
       ContinuousWithinAt (g ∘ f.symm) (f.symm ⁻¹' s) (f x) :=
   by convert I.symm_continuous_within_at_comp_right_iff <;> rfl
 #align local_homeomorph.extend_symm_continuous_within_at_comp_right_iff LocalHomeomorph.extend_symm_continuousWithinAt_comp_right_iff
+-/
 
+#print LocalHomeomorph.isOpen_extend_preimage' /-
 theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
     IsOpen ((f.extend I).source ∩ f.extend I ⁻¹' s) :=
   (continuousOn_extend f I).preimage_open_of_open (isOpen_extend_source _ _) hs
 #align local_homeomorph.is_open_extend_preimage' LocalHomeomorph.isOpen_extend_preimage'
+-/
 
+#print LocalHomeomorph.isOpen_extend_preimage /-
 theorem isOpen_extend_preimage {s : Set E} (hs : IsOpen s) : IsOpen (f.source ∩ f.extend I ⁻¹' s) :=
   by rw [← extend_source f I]; exact is_open_extend_preimage' f I hs
 #align local_homeomorph.is_open_extend_preimage LocalHomeomorph.isOpen_extend_preimage
+-/
 
+#print LocalHomeomorph.map_extend_nhdsWithin_eq_image /-
 theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
     map (f.extend I) (𝓝[s] y) = 𝓝[f.extend I '' ((f.extend I).source ∩ s)] f.extend I y := by
   set e := f.extend I <;>
@@ -987,33 +1105,43 @@ theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
           (continuous_at_extend_symm f I hy).ContinuousWithinAt
           (continuous_at_extend f I hy).ContinuousWithinAt
 #align local_homeomorph.map_extend_nhds_within_eq_image LocalHomeomorph.map_extend_nhdsWithin_eq_image
+-/
 
+#print LocalHomeomorph.map_extend_nhdsWithin /-
 theorem map_extend_nhdsWithin {y : M} (hy : y ∈ f.source) :
     map (f.extend I) (𝓝[s] y) = 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I y := by
   rw [map_extend_nhds_within_eq_image f I hy, nhdsWithin_inter, ←
     nhds_within_extend_target_eq _ _ hy, ← nhdsWithin_inter, (f.extend I).image_source_inter_eq',
     inter_comm]
 #align local_homeomorph.map_extend_nhds_within LocalHomeomorph.map_extend_nhdsWithin
+-/
 
+#print LocalHomeomorph.map_extend_symm_nhdsWithin /-
 theorem map_extend_symm_nhdsWithin {y : M} (hy : y ∈ f.source) :
     map (f.extend I).symm (𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I y) = 𝓝[s] y :=
   by
   rw [← map_extend_nhds_within f I hy, map_map, map_congr, map_id]
   exact (f.extend I).LeftInvOn.EqOn.eventuallyEq_of_mem (extend_source_mem_nhds_within _ _ hy)
 #align local_homeomorph.map_extend_symm_nhds_within LocalHomeomorph.map_extend_symm_nhdsWithin
+-/
 
+#print LocalHomeomorph.map_extend_symm_nhdsWithin_range /-
 theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
     map (f.extend I).symm (𝓝[range I] f.extend I y) = 𝓝 y := by
   rw [← nhdsWithin_univ, ← map_extend_symm_nhds_within f I hy, preimage_univ, univ_inter]
 #align local_homeomorph.map_extend_symm_nhds_within_range LocalHomeomorph.map_extend_symm_nhdsWithin_range
+-/
 
+#print LocalHomeomorph.extend_preimage_mem_nhdsWithin /-
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 in the source is a neighborhood of the preimage, within a set. -/
 theorem extend_preimage_mem_nhdsWithin {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝[s] x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I x := by
   rwa [← map_extend_symm_nhds_within f I h, mem_map] at ht 
 #align local_homeomorph.extend_preimage_mem_nhds_within LocalHomeomorph.extend_preimage_mem_nhdsWithin
+-/
 
+#print LocalHomeomorph.extend_preimage_mem_nhds /-
 theorem extend_preimage_mem_nhds {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝 x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝 (f.extend I x) :=
   by
@@ -1021,7 +1149,9 @@ theorem extend_preimage_mem_nhds {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝 x
   rwa [(f.extend I).left_inv]
   rwa [f.extend_source]
 #align local_homeomorph.extend_preimage_mem_nhds LocalHomeomorph.extend_preimage_mem_nhds
+-/
 
+#print LocalHomeomorph.extend_preimage_inter_eq /-
 /-- Technical lemma to rewrite suitably the preimage of an intersection under an extended chart, to
 bring it into a convenient form to apply derivative lemmas. -/
 theorem extend_preimage_inter_eq :
@@ -1029,7 +1159,9 @@ theorem extend_preimage_inter_eq :
       (f.extend I).symm ⁻¹' s ∩ range I ∩ (f.extend I).symm ⁻¹' t :=
   by mfld_set_tac
 #align local_homeomorph.extend_preimage_inter_eq LocalHomeomorph.extend_preimage_inter_eq
+-/
 
+#print LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux /-
 theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)]
       ((f.extend I).target ∩ (f.extend I).symm ⁻¹' s : Set _) :=
@@ -1043,7 +1175,9 @@ theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (h
   refine' I.continuous_at_symm.preimage_mem_nhds (f.open_target.mem_nhds _)
   simp_rw [f.extend_coe, Function.comp_apply, I.left_inv, f.maps_to hx]
 #align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq_aux LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux
+-/
 
+#print LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq /-
 theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs : s βŠ† f.source)
     (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)] f.extend I '' s :=
@@ -1052,10 +1186,12 @@ theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs :
   rw [(f.extend I).image_eq_target_inter_inv_preimage hs]
   exact f.extend_symm_preimage_inter_range_eventually_eq_aux I hx
 #align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
+-/
 
 /-! We use the name `extend_coord_change` for `(f'.extend I).symm ≫ f.extend I`. -/
 
 
+#print LocalHomeomorph.extend_coord_change_source /-
 theorem extend_coord_change_source :
     ((f.extend I).symm ≫ f'.extend I).source = I '' (f.symm ≫ₕ f').source :=
   by
@@ -1063,13 +1199,17 @@ theorem extend_coord_change_source :
     extend_target, inter_right_comm _ (range I)]
   rfl
 #align local_homeomorph.extend_coord_change_source LocalHomeomorph.extend_coord_change_source
+-/
 
+#print LocalHomeomorph.extend_image_source_inter /-
 theorem extend_image_source_inter :
     f.extend I '' (f.source ∩ f'.source) = ((f.extend I).symm ≫ f'.extend I).source := by
   simp_rw [f.extend_coord_change_source, f.extend_coe, image_comp I f, trans_source'', symm_symm,
     symm_target]
 #align local_homeomorph.extend_image_source_inter LocalHomeomorph.extend_image_source_inter
+-/
 
+#print LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin /-
 theorem extend_coord_change_source_mem_nhdsWithin {x : E}
     (hx : x ∈ ((f.extend I).symm ≫ f'.extend I).source) :
     ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] x :=
@@ -1079,7 +1219,9 @@ theorem extend_coord_change_source_mem_nhdsWithin {x : E}
   refine' I.image_mem_nhds_within _
   refine' (LocalHomeomorph.open_source _).mem_nhds hx
 #align local_homeomorph.extend_coord_change_source_mem_nhds_within LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin
+-/
 
+#print LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin' /-
 theorem extend_coord_change_source_mem_nhdsWithin' {x : M} (hxf : x ∈ f.source)
     (hxf' : x ∈ f'.source) : ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] f.extend I x :=
   by
@@ -1087,11 +1229,13 @@ theorem extend_coord_change_source_mem_nhdsWithin' {x : M} (hxf : x ∈ f.source
   rw [← extend_image_source_inter]
   exact mem_image_of_mem _ ⟨hxf, hxf'⟩
 #align local_homeomorph.extend_coord_change_source_mem_nhds_within' LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin'
+-/
 
 variable {f f'}
 
 open SmoothManifoldWithCorners
 
+#print LocalHomeomorph.contDiffOn_extend_coord_change /-
 theorem contDiffOn_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) :
     ContDiffOn π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) ((f'.extend I).symm ≫ f.extend I).source :=
@@ -1099,7 +1243,9 @@ theorem contDiffOn_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtl
   rw [extend_coord_change_source, I.image_eq]
   exact (StructureGroupoid.compatible_of_mem_maximalAtlas hf' hf).1
 #align local_homeomorph.cont_diff_on_extend_coord_change LocalHomeomorph.contDiffOn_extend_coord_change
+-/
 
+#print LocalHomeomorph.contDiffWithinAt_extend_coord_change /-
 theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) {x : E} (hx : x ∈ ((f'.extend I).symm ≫ f.extend I).source) :
     ContDiffWithinAt π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) (range I) x :=
@@ -1109,7 +1255,9 @@ theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maxi
   obtain ⟨z, hz, rfl⟩ := hx
   exact I.image_mem_nhds_within ((LocalHomeomorph.open_source _).mem_nhds hz)
 #align local_homeomorph.cont_diff_within_at_extend_coord_change LocalHomeomorph.contDiffWithinAt_extend_coord_change
+-/
 
+#print LocalHomeomorph.contDiffWithinAt_extend_coord_change' /-
 theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) {x : M} (hxf : x ∈ f.source) (hxf' : x ∈ f'.source) :
     ContDiffWithinAt π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) (range I) (f'.extend I x) :=
@@ -1118,6 +1266,7 @@ theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ max
   rw [← extend_image_source_inter]
   exact mem_image_of_mem _ ⟨hxf', hxf⟩
 #align local_homeomorph.cont_diff_within_at_extend_coord_change' LocalHomeomorph.contDiffWithinAt_extend_coord_change'
+-/
 
 end LocalHomeomorph
 
@@ -1134,175 +1283,248 @@ def extChartAt (x : M) : LocalEquiv M E :=
 #align ext_chart_at extChartAt
 -/
 
+#print extChartAt_coe /-
 theorem extChartAt_coe : ⇑(extChartAt I x) = I ∘ chartAt H x :=
   rfl
 #align ext_chart_at_coe extChartAt_coe
+-/
 
+#print extChartAt_coe_symm /-
 theorem extChartAt_coe_symm : ⇑(extChartAt I x).symm = (chartAt H x).symm ∘ I.symm :=
   rfl
 #align ext_chart_at_coe_symm extChartAt_coe_symm
+-/
 
+#print extChartAt_source /-
 theorem extChartAt_source : (extChartAt I x).source = (chartAt H x).source :=
   extend_source _ _
 #align ext_chart_at_source extChartAt_source
+-/
 
+#print isOpen_extChartAt_source /-
 theorem isOpen_extChartAt_source : IsOpen (extChartAt I x).source :=
   isOpen_extend_source _ _
 #align is_open_ext_chart_at_source isOpen_extChartAt_source
+-/
 
+#print mem_extChartAt_source /-
 theorem mem_extChartAt_source : x ∈ (extChartAt I x).source := by
   simp only [extChartAt_source, mem_chart_source]
 #align mem_ext_chart_source mem_extChartAt_source
+-/
 
+#print extChartAt_target /-
 theorem extChartAt_target (x : M) :
     (extChartAt I x).target = I.symm ⁻¹' (chartAt H x).target ∩ range I :=
   extend_target _ _
 #align ext_chart_at_target extChartAt_target
+-/
 
+#print extChartAt_to_inv /-
 theorem extChartAt_to_inv : (extChartAt I x).symm ((extChartAt I x) x) = x :=
   (extChartAt I x).left_inv (mem_extChartAt_source I x)
 #align ext_chart_at_to_inv extChartAt_to_inv
+-/
 
+#print mapsTo_extChartAt /-
 theorem mapsTo_extChartAt (hs : s βŠ† (chartAt H x).source) :
     MapsTo (extChartAt I x) s ((extChartAt I x).symm ⁻¹' s ∩ range I) :=
   mapsTo_extend _ _ hs
 #align maps_to_ext_chart_at mapsTo_extChartAt
+-/
 
+#print extChartAt_source_mem_nhds' /-
 theorem extChartAt_source_mem_nhds' {x' : M} (h : x' ∈ (extChartAt I x).source) :
     (extChartAt I x).source ∈ 𝓝 x' :=
   extend_source_mem_nhds _ _ <| by rwa [← extChartAt_source I]
 #align ext_chart_at_source_mem_nhds' extChartAt_source_mem_nhds'
+-/
 
+#print extChartAt_source_mem_nhds /-
 theorem extChartAt_source_mem_nhds : (extChartAt I x).source ∈ 𝓝 x :=
   extChartAt_source_mem_nhds' I x (mem_extChartAt_source I x)
 #align ext_chart_at_source_mem_nhds extChartAt_source_mem_nhds
+-/
 
+#print extChartAt_source_mem_nhdsWithin' /-
 theorem extChartAt_source_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source) :
     (extChartAt I x).source ∈ 𝓝[s] x' :=
   mem_nhdsWithin_of_mem_nhds (extChartAt_source_mem_nhds' I x h)
 #align ext_chart_at_source_mem_nhds_within' extChartAt_source_mem_nhdsWithin'
+-/
 
+#print extChartAt_source_mem_nhdsWithin /-
 theorem extChartAt_source_mem_nhdsWithin : (extChartAt I x).source ∈ 𝓝[s] x :=
   mem_nhdsWithin_of_mem_nhds (extChartAt_source_mem_nhds I x)
 #align ext_chart_at_source_mem_nhds_within extChartAt_source_mem_nhdsWithin
+-/
 
+#print continuousOn_extChartAt /-
 theorem continuousOn_extChartAt : ContinuousOn (extChartAt I x) (extChartAt I x).source :=
   continuousOn_extend _ _
 #align continuous_on_ext_chart_at continuousOn_extChartAt
+-/
 
+#print continuousAt_extChartAt' /-
 theorem continuousAt_extChartAt' {x' : M} (h : x' ∈ (extChartAt I x).source) :
     ContinuousAt (extChartAt I x) x' :=
   continuousAt_extend _ _ <| by rwa [← extChartAt_source I]
 #align continuous_at_ext_chart_at' continuousAt_extChartAt'
+-/
 
+#print continuousAt_extChartAt /-
 theorem continuousAt_extChartAt : ContinuousAt (extChartAt I x) x :=
   continuousAt_extChartAt' _ _ (mem_extChartAt_source I x)
 #align continuous_at_ext_chart_at continuousAt_extChartAt
+-/
 
+#print map_extChartAt_nhds' /-
 theorem map_extChartAt_nhds' {x y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x) (𝓝 y) = 𝓝[range I] extChartAt I x y :=
   map_extend_nhds _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_nhds' map_extChartAt_nhds'
+-/
 
+#print map_extChartAt_nhds /-
 theorem map_extChartAt_nhds : map (extChartAt I x) (𝓝 x) = 𝓝[range I] extChartAt I x x :=
   map_extChartAt_nhds' I <| mem_extChartAt_source I x
 #align map_ext_chart_at_nhds map_extChartAt_nhds
+-/
 
+#print extChartAt_target_mem_nhdsWithin' /-
 theorem extChartAt_target_mem_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x y :=
   extend_target_mem_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
 #align ext_chart_at_target_mem_nhds_within' extChartAt_target_mem_nhdsWithin'
+-/
 
+#print extChartAt_target_mem_nhdsWithin /-
 theorem extChartAt_target_mem_nhdsWithin : (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x x :=
   extChartAt_target_mem_nhdsWithin' I x (mem_extChartAt_source I x)
 #align ext_chart_at_target_mem_nhds_within extChartAt_target_mem_nhdsWithin
+-/
 
+#print extChartAt_target_subset_range /-
 theorem extChartAt_target_subset_range : (extChartAt I x).target βŠ† range I := by
   simp only [mfld_simps]
 #align ext_chart_at_target_subset_range extChartAt_target_subset_range
+-/
 
+#print nhdsWithin_extChartAt_target_eq' /-
 theorem nhdsWithin_extChartAt_target_eq' {y : M} (hy : y ∈ (extChartAt I x).source) :
     𝓝[(extChartAt I x).target] extChartAt I x y = 𝓝[range I] extChartAt I x y :=
   nhdsWithin_extend_target_eq _ _ <| by rwa [← extChartAt_source I]
 #align nhds_within_ext_chart_at_target_eq' nhdsWithin_extChartAt_target_eq'
+-/
 
+#print nhdsWithin_extChartAt_target_eq /-
 theorem nhdsWithin_extChartAt_target_eq :
     𝓝[(extChartAt I x).target] (extChartAt I x) x = 𝓝[range I] (extChartAt I x) x :=
   nhdsWithin_extChartAt_target_eq' I x (mem_extChartAt_source I x)
 #align nhds_within_ext_chart_at_target_eq nhdsWithin_extChartAt_target_eq
+-/
 
+#print continuousAt_extChartAt_symm'' /-
 theorem continuousAt_extChartAt_symm'' {y : E} (h : y ∈ (extChartAt I x).target) :
     ContinuousAt (extChartAt I x).symm y :=
   continuousAt_extend_symm' _ _ h
 #align continuous_at_ext_chart_at_symm'' continuousAt_extChartAt_symm''
+-/
 
+#print continuousAt_extChartAt_symm' /-
 theorem continuousAt_extChartAt_symm' {x' : M} (h : x' ∈ (extChartAt I x).source) :
     ContinuousAt (extChartAt I x).symm (extChartAt I x x') :=
   continuousAt_extChartAt_symm'' I _ <| (extChartAt I x).map_source h
 #align continuous_at_ext_chart_at_symm' continuousAt_extChartAt_symm'
+-/
 
+#print continuousAt_extChartAt_symm /-
 theorem continuousAt_extChartAt_symm : ContinuousAt (extChartAt I x).symm ((extChartAt I x) x) :=
   continuousAt_extChartAt_symm' I x (mem_extChartAt_source I x)
 #align continuous_at_ext_chart_at_symm continuousAt_extChartAt_symm
+-/
 
+#print continuousOn_extChartAt_symm /-
 theorem continuousOn_extChartAt_symm : ContinuousOn (extChartAt I x).symm (extChartAt I x).target :=
   fun y hy => (continuousAt_extChartAt_symm'' _ _ hy).ContinuousWithinAt
 #align continuous_on_ext_chart_at_symm continuousOn_extChartAt_symm
+-/
 
+#print isOpen_extChartAt_preimage' /-
 theorem isOpen_extChartAt_preimage' {s : Set E} (hs : IsOpen s) :
     IsOpen ((extChartAt I x).source ∩ extChartAt I x ⁻¹' s) :=
   isOpen_extend_preimage' _ _ hs
 #align is_open_ext_chart_at_preimage' isOpen_extChartAt_preimage'
+-/
 
+#print isOpen_extChartAt_preimage /-
 theorem isOpen_extChartAt_preimage {s : Set E} (hs : IsOpen s) :
     IsOpen ((chartAt H x).source ∩ extChartAt I x ⁻¹' s) := by rw [← extChartAt_source I];
   exact isOpen_extChartAt_preimage' I x hs
 #align is_open_ext_chart_at_preimage isOpen_extChartAt_preimage
+-/
 
+#print map_extChartAt_nhdsWithin_eq_image' /-
 theorem map_extChartAt_nhdsWithin_eq_image' {y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x) (𝓝[s] y) =
       𝓝[extChartAt I x '' ((extChartAt I x).source ∩ s)] extChartAt I x y :=
   map_extend_nhdsWithin_eq_image _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_nhds_within_eq_image' map_extChartAt_nhdsWithin_eq_image'
+-/
 
+#print map_extChartAt_nhdsWithin_eq_image /-
 theorem map_extChartAt_nhdsWithin_eq_image :
     map (extChartAt I x) (𝓝[s] x) =
       𝓝[extChartAt I x '' ((extChartAt I x).source ∩ s)] extChartAt I x x :=
   map_extChartAt_nhdsWithin_eq_image' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_nhds_within_eq_image map_extChartAt_nhdsWithin_eq_image
+-/
 
+#print map_extChartAt_nhdsWithin' /-
 theorem map_extChartAt_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x) (𝓝[s] y) = 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x y :=
   map_extend_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_nhds_within' map_extChartAt_nhdsWithin'
+-/
 
+#print map_extChartAt_nhdsWithin /-
 theorem map_extChartAt_nhdsWithin :
     map (extChartAt I x) (𝓝[s] x) = 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x x :=
   map_extChartAt_nhdsWithin' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_nhds_within map_extChartAt_nhdsWithin
+-/
 
+#print map_extChartAt_symm_nhdsWithin' /-
 theorem map_extChartAt_symm_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x).symm (𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x y) =
       𝓝[s] y :=
   map_extend_symm_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_symm_nhds_within' map_extChartAt_symm_nhdsWithin'
+-/
 
+#print map_extChartAt_symm_nhdsWithin_range' /-
 theorem map_extChartAt_symm_nhdsWithin_range' {y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x).symm (𝓝[range I] extChartAt I x y) = 𝓝 y :=
   map_extend_symm_nhdsWithin_range _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_symm_nhds_within_range' map_extChartAt_symm_nhdsWithin_range'
+-/
 
+#print map_extChartAt_symm_nhdsWithin /-
 theorem map_extChartAt_symm_nhdsWithin :
     map (extChartAt I x).symm (𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x x) =
       𝓝[s] x :=
   map_extChartAt_symm_nhdsWithin' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_symm_nhds_within map_extChartAt_symm_nhdsWithin
+-/
 
+#print map_extChartAt_symm_nhdsWithin_range /-
 theorem map_extChartAt_symm_nhdsWithin_range :
     map (extChartAt I x).symm (𝓝[range I] extChartAt I x x) = 𝓝 x :=
   map_extChartAt_symm_nhdsWithin_range' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_symm_nhds_within_range map_extChartAt_symm_nhdsWithin_range
+-/
 
+#print extChartAt_preimage_mem_nhdsWithin' /-
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 in the source is a neighborhood of the preimage, within a set. -/
 theorem extChartAt_preimage_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source)
@@ -1310,19 +1532,25 @@ theorem extChartAt_preimage_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x' := by
   rwa [← map_extChartAt_symm_nhdsWithin' I x h, mem_map] at ht 
 #align ext_chart_at_preimage_mem_nhds_within' extChartAt_preimage_mem_nhdsWithin'
+-/
 
+#print extChartAt_preimage_mem_nhdsWithin /-
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of the
 base point is a neighborhood of the preimage, within a set. -/
 theorem extChartAt_preimage_mem_nhdsWithin (ht : t ∈ 𝓝[s] x) :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x :=
   extChartAt_preimage_mem_nhdsWithin' I x (mem_extChartAt_source I x) ht
 #align ext_chart_at_preimage_mem_nhds_within extChartAt_preimage_mem_nhdsWithin
+-/
 
+#print extChartAt_preimage_mem_nhds' /-
 theorem extChartAt_preimage_mem_nhds' {x' : M} (h : x' ∈ (extChartAt I x).source) (ht : t ∈ 𝓝 x') :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝 (extChartAt I x x') :=
   extend_preimage_mem_nhds _ _ (by rwa [← extChartAt_source I]) ht
 #align ext_chart_at_preimage_mem_nhds' extChartAt_preimage_mem_nhds'
+-/
 
+#print extChartAt_preimage_mem_nhds /-
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 is a neighborhood of the preimage. -/
 theorem extChartAt_preimage_mem_nhds (ht : t ∈ 𝓝 x) :
@@ -1331,7 +1559,9 @@ theorem extChartAt_preimage_mem_nhds (ht : t ∈ 𝓝 x) :
   apply (continuousAt_extChartAt_symm I x).preimage_mem_nhds
   rwa [(extChartAt I x).left_inv (mem_extChartAt_source _ _)]
 #align ext_chart_at_preimage_mem_nhds extChartAt_preimage_mem_nhds
+-/
 
+#print extChartAt_preimage_inter_eq /-
 /-- Technical lemma to rewrite suitably the preimage of an intersection under an extended chart, to
 bring it into a convenient form to apply derivative lemmas. -/
 theorem extChartAt_preimage_inter_eq :
@@ -1339,30 +1569,37 @@ theorem extChartAt_preimage_inter_eq :
       (extChartAt I x).symm ⁻¹' s ∩ range I ∩ (extChartAt I x).symm ⁻¹' t :=
   by mfld_set_tac
 #align ext_chart_at_preimage_inter_eq extChartAt_preimage_inter_eq
+-/
 
 /-! We use the name `ext_coord_change` for `(ext_chart_at I x').symm ≫ ext_chart_at I x`. -/
 
 
+#print ext_coord_change_source /-
 theorem ext_coord_change_source (x x' : M) :
     ((extChartAt I x').symm ≫ extChartAt I x).source =
       I '' ((chartAt H x').symm ≫ₕ chartAt H x).source :=
   extend_coord_change_source _ _ _
 #align ext_coord_change_source ext_coord_change_source
+-/
 
 open SmoothManifoldWithCorners
 
+#print contDiffOn_ext_coord_change /-
 theorem contDiffOn_ext_coord_change [SmoothManifoldWithCorners I M] (x x' : M) :
     ContDiffOn π•œ ⊀ (extChartAt I x ∘ (extChartAt I x').symm)
       ((extChartAt I x').symm ≫ extChartAt I x).source :=
   contDiffOn_extend_coord_change I (chart_mem_maximalAtlas I x) (chart_mem_maximalAtlas I x')
 #align cont_diff_on_ext_coord_change contDiffOn_ext_coord_change
+-/
 
+#print contDiffWithinAt_ext_coord_change /-
 theorem contDiffWithinAt_ext_coord_change [SmoothManifoldWithCorners I M] (x x' : M) {y : E}
     (hy : y ∈ ((extChartAt I x').symm ≫ extChartAt I x).source) :
     ContDiffWithinAt π•œ ⊀ (extChartAt I x ∘ (extChartAt I x').symm) (range I) y :=
   contDiffWithinAt_extend_coord_change I (chart_mem_maximalAtlas I x) (chart_mem_maximalAtlas I x')
     hy
 #align cont_diff_within_at_ext_coord_change contDiffWithinAt_ext_coord_change
+-/
 
 #print writtenInExtChartAt /-
 /-- Conjugating a function to write it in the preferred charts around `x`.
@@ -1375,13 +1612,17 @@ def writtenInExtChartAt (x : M) (f : M β†’ M') : E β†’ E' :=
 
 variable (π•œ)
 
+#print extChartAt_self_eq /-
 theorem extChartAt_self_eq {x : H} : ⇑(extChartAt I x) = I :=
   rfl
 #align ext_chart_at_self_eq extChartAt_self_eq
+-/
 
+#print extChartAt_self_apply /-
 theorem extChartAt_self_apply {x y : H} : extChartAt I x y = I y :=
   rfl
 #align ext_chart_at_self_apply extChartAt_self_apply
+-/
 
 #print extChartAt_model_space_eq_id /-
 /-- In the case of the manifold structure on a vector space, the extended charts are just the
@@ -1399,10 +1640,12 @@ theorem ext_chart_model_space_apply {x y : E} : extChartAt π“˜(π•œ, E) x y = y
 
 variable {π•œ}
 
+#print extChartAt_prod /-
 theorem extChartAt_prod (x : M Γ— M') :
     extChartAt (I.Prod I') x = (extChartAt I x.1).Prod (extChartAt I' x.2) := by
   simp only [mfld_simps]
 #align ext_chart_at_prod extChartAt_prod
+-/
 
 end ExtendedCharts
 
Diff
@@ -986,7 +986,6 @@ theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
           ((f.extend I).left_inv <| by rwa [f.extend_source])
           (continuous_at_extend_symm f I hy).ContinuousWithinAt
           (continuous_at_extend f I hy).ContinuousWithinAt
-      
 #align local_homeomorph.map_extend_nhds_within_eq_image LocalHomeomorph.map_extend_nhdsWithin_eq_image
 
 theorem map_extend_nhdsWithin {y : M} (hy : y ∈ f.source) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module geometry.manifold.smooth_manifold_with_corners
-! leanprover-community/mathlib commit ddec54a71a0dd025c05445d467f1a2b7d586a3ba
+! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Geometry.Manifold.ChartedSpace
 /-!
 # Smooth manifolds (possibly with boundary or corners)
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 A smooth manifold is a manifold modelled on a normed vector space, or a subset like a
 half-space (to get manifolds with boundaries) for which the changes of coordinates are smooth maps.
 We define a model with corners as a map `I : H β†’ E` embedding nicely the topological space `H` in
Diff
@@ -129,6 +129,7 @@ scoped[Manifold] notation "∞" => (⊀ : β„•βˆž)
 /-! ### Models with corners. -/
 
 
+#print ModelWithCorners /-
 /-- A structure containing informations on the way a space `H` embeds in a
 model vector space `E` over the field `π•œ`. This is all what is needed to
 define a smooth manifold with model space `H`, and model vector space `E`.
@@ -142,9 +143,11 @@ structure ModelWithCorners (π•œ : Type _) [NontriviallyNormedField π•œ] (E : T
   continuous_toFun : Continuous to_fun := by continuity
   continuous_invFun : Continuous inv_fun := by continuity
 #align model_with_corners ModelWithCorners
+-/
 
 attribute [simp, mfld_simps] ModelWithCorners.source_eq
 
+#print modelWithCornersSelf /-
 /-- A vector space is a model with corners. -/
 def modelWithCornersSelf (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
     [NormedAddCommGroup E] [NormedSpace π•œ E] : ModelWithCorners π•œ E E
@@ -155,6 +158,7 @@ def modelWithCornersSelf (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Typ
   continuous_toFun := continuous_id
   continuous_invFun := continuous_id
 #align model_with_corners_self modelWithCornersSelf
+-/
 
 -- mathport name: model_with_corners_self
 scoped[Manifold] notation "π“˜(" π•œ ", " E ")" => modelWithCornersSelf π•œ E
@@ -172,23 +176,29 @@ namespace ModelWithCorners
 instance : CoeFun (ModelWithCorners π•œ E H) fun _ => H β†’ E :=
   ⟨fun e => e.toFun⟩
 
+#print ModelWithCorners.symm /-
 /-- The inverse to a model with corners, only registered as a local equiv. -/
 protected def symm : LocalEquiv E H :=
   I.toLocalEquiv.symm
 #align model_with_corners.symm ModelWithCorners.symm
+-/
 
+#print ModelWithCorners.Simps.apply /-
 /-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
   because it is a composition of multiple projections. -/
 def Simps.apply (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _) [NormedAddCommGroup E]
     [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] (I : ModelWithCorners π•œ E H) : H β†’ E :=
   I
 #align model_with_corners.simps.apply ModelWithCorners.Simps.apply
+-/
 
+#print ModelWithCorners.Simps.symm_apply /-
 /-- See Note [custom simps projection] -/
-def Simps.symmApply (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _) [NormedAddCommGroup E]
+def Simps.symm_apply (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _) [NormedAddCommGroup E]
     [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] (I : ModelWithCorners π•œ E H) : E β†’ H :=
   I.symm
-#align model_with_corners.simps.symm_apply ModelWithCorners.Simps.symmApply
+#align model_with_corners.simps.symm_apply ModelWithCorners.Simps.symm_apply
+-/
 
 initialize_simps_projections ModelWithCorners (to_local_equiv_to_fun β†’ apply,
   to_local_equiv_inv_fun β†’ symm_apply, toLocalEquiv_source β†’ source, toLocalEquiv_target β†’ target,
@@ -200,35 +210,45 @@ theorem toLocalEquiv_coe : (I.toLocalEquiv : H β†’ E) = I :=
   rfl
 #align model_with_corners.to_local_equiv_coe ModelWithCorners.toLocalEquiv_coe
 
+#print ModelWithCorners.mk_coe /-
 @[simp, mfld_simps]
 theorem mk_coe (e : LocalEquiv H E) (a b c d) :
     ((ModelWithCorners.mk e a b c d : ModelWithCorners π•œ E H) : H β†’ E) = (e : H β†’ E) :=
   rfl
 #align model_with_corners.mk_coe ModelWithCorners.mk_coe
+-/
 
 @[simp, mfld_simps]
 theorem toLocalEquiv_coe_symm : (I.toLocalEquiv.symm : E β†’ H) = I.symm :=
   rfl
 #align model_with_corners.to_local_equiv_coe_symm ModelWithCorners.toLocalEquiv_coe_symm
 
+#print ModelWithCorners.mk_symm /-
 @[simp, mfld_simps]
 theorem mk_symm (e : LocalEquiv H E) (a b c d) :
     (ModelWithCorners.mk e a b c d : ModelWithCorners π•œ E H).symm = e.symm :=
   rfl
 #align model_with_corners.mk_symm ModelWithCorners.mk_symm
+-/
 
+#print ModelWithCorners.continuous /-
 @[continuity]
 protected theorem continuous : Continuous I :=
   I.continuous_toFun
 #align model_with_corners.continuous ModelWithCorners.continuous
+-/
 
+#print ModelWithCorners.continuousAt /-
 protected theorem continuousAt {x} : ContinuousAt I x :=
   I.Continuous.ContinuousAt
 #align model_with_corners.continuous_at ModelWithCorners.continuousAt
+-/
 
+#print ModelWithCorners.continuousWithinAt /-
 protected theorem continuousWithinAt {s x} : ContinuousWithinAt I s x :=
   I.ContinuousAt.ContinuousWithinAt
 #align model_with_corners.continuous_within_at ModelWithCorners.continuousWithinAt
+-/
 
 @[continuity]
 theorem continuous_symm : Continuous I.symm :=
@@ -256,35 +276,47 @@ protected theorem unique_diff : UniqueDiffOn π•œ (range I) :=
   I.target_eq β–Έ I.unique_diff'
 #align model_with_corners.unique_diff ModelWithCorners.unique_diff
 
+#print ModelWithCorners.left_inv /-
 @[simp, mfld_simps]
 protected theorem left_inv (x : H) : I.symm (I x) = x := by refine' I.left_inv' _; simp
 #align model_with_corners.left_inv ModelWithCorners.left_inv
+-/
 
+#print ModelWithCorners.leftInverse /-
 protected theorem leftInverse : LeftInverse I.symm I :=
   I.left_inv
 #align model_with_corners.left_inverse ModelWithCorners.leftInverse
+-/
 
+#print ModelWithCorners.injective /-
 theorem injective : Injective I :=
   I.LeftInverse.Injective
 #align model_with_corners.injective ModelWithCorners.injective
+-/
 
+#print ModelWithCorners.symm_comp_self /-
 @[simp, mfld_simps]
 theorem symm_comp_self : I.symm ∘ I = id :=
   I.LeftInverse.comp_eq_id
 #align model_with_corners.symm_comp_self ModelWithCorners.symm_comp_self
+-/
 
+#print ModelWithCorners.rightInvOn /-
 protected theorem rightInvOn : RightInvOn I.symm I (range I) :=
   I.LeftInverse.rightInvOn_range
 #align model_with_corners.right_inv_on ModelWithCorners.rightInvOn
+-/
 
 @[simp, mfld_simps]
 protected theorem right_inv {x : E} (hx : x ∈ range I) : I (I.symm x) = x :=
   I.RightInvOn hx
 #align model_with_corners.right_inv ModelWithCorners.right_inv
 
+#print ModelWithCorners.preimage_image /-
 theorem preimage_image (s : Set H) : I ⁻¹' (I '' s) = s :=
   I.Injective.preimage_image s
 #align model_with_corners.preimage_image ModelWithCorners.preimage_image
+-/
 
 protected theorem image_eq (s : Set H) : I '' s = I.symm ⁻¹' s ∩ range I :=
   by
@@ -293,9 +325,11 @@ protected theorem image_eq (s : Set H) : I '' s = I.symm ⁻¹' s ∩ range I :=
   Β· rw [inter_comm, I.target_eq, I.to_local_equiv_coe_symm]
 #align model_with_corners.image_eq ModelWithCorners.image_eq
 
+#print ModelWithCorners.closedEmbedding /-
 protected theorem closedEmbedding : ClosedEmbedding I :=
   I.LeftInverse.ClosedEmbedding I.continuous_symm I.Continuous
 #align model_with_corners.closed_embedding ModelWithCorners.closedEmbedding
+-/
 
 theorem closed_range : IsClosed (range I) :=
   I.ClosedEmbedding.closed_range
@@ -305,21 +339,29 @@ theorem map_nhds_eq (x : H) : map I (𝓝 x) = 𝓝[range I] I x :=
   I.ClosedEmbedding.toEmbedding.map_nhds_eq x
 #align model_with_corners.map_nhds_eq ModelWithCorners.map_nhds_eq
 
+#print ModelWithCorners.map_nhdsWithin_eq /-
 theorem map_nhdsWithin_eq (s : Set H) (x : H) : map I (𝓝[s] x) = 𝓝[I '' s] I x :=
   I.ClosedEmbedding.toEmbedding.map_nhdsWithin_eq s x
 #align model_with_corners.map_nhds_within_eq ModelWithCorners.map_nhdsWithin_eq
+-/
 
+#print ModelWithCorners.image_mem_nhdsWithin /-
 theorem image_mem_nhdsWithin {x : H} {s : Set H} (hs : s ∈ 𝓝 x) : I '' s ∈ 𝓝[range I] I x :=
   I.map_nhds_eq x β–Έ image_mem_map hs
 #align model_with_corners.image_mem_nhds_within ModelWithCorners.image_mem_nhdsWithin
+-/
 
+#print ModelWithCorners.symm_map_nhdsWithin_image /-
 theorem symm_map_nhdsWithin_image {x : H} {s : Set H} : map I.symm (𝓝[I '' s] I x) = 𝓝[s] x := by
   rw [← I.map_nhds_within_eq, map_map, I.symm_comp_self, map_id]
 #align model_with_corners.symm_map_nhds_within_image ModelWithCorners.symm_map_nhdsWithin_image
+-/
 
+#print ModelWithCorners.symm_map_nhdsWithin_range /-
 theorem symm_map_nhdsWithin_range (x : H) : map I.symm (𝓝[range I] I x) = 𝓝 x := by
   rw [← I.map_nhds_eq, map_map, I.symm_comp_self, map_id]
 #align model_with_corners.symm_map_nhds_within_range ModelWithCorners.symm_map_nhdsWithin_range
+-/
 
 theorem unique_diff_preimage {s : Set H} (hs : IsOpen s) :
     UniqueDiffOn π•œ (I.symm ⁻¹' s ∩ range I) := by rw [inter_comm];
@@ -375,21 +417,27 @@ section
 
 variable (π•œ E)
 
+#print modelWithCornersSelf_localEquiv /-
 /-- In the trivial model with corners, the associated local equiv is the identity. -/
 @[simp, mfld_simps]
 theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toLocalEquiv = LocalEquiv.refl E :=
   rfl
 #align model_with_corners_self_local_equiv modelWithCornersSelf_localEquiv
+-/
 
+#print modelWithCornersSelf_coe /-
 @[simp, mfld_simps]
 theorem modelWithCornersSelf_coe : (π“˜(π•œ, E) : E β†’ E) = id :=
   rfl
 #align model_with_corners_self_coe modelWithCornersSelf_coe
+-/
 
+#print modelWithCornersSelf_coe_symm /-
 @[simp, mfld_simps]
 theorem modelWithCornersSelf_coe_symm : (π“˜(π•œ, E).symm : E β†’ E) = id :=
   rfl
 #align model_with_corners_self_coe_symm modelWithCornersSelf_coe_symm
+-/
 
 end
 
@@ -420,6 +468,7 @@ def ModelWithCorners.prod {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Ty
     continuous_invFun := I.continuous_invFun.Prod_map I'.continuous_invFun }
 #align model_with_corners.prod ModelWithCorners.prod
 
+#print ModelWithCorners.pi /-
 /-- Given a finite family of `model_with_corners` `I i` on `(E i, H i)`, we define the model with
 corners `pi I` on `(Ξ  i, E i, model_pi H)`. See note [Manifold type tags] for explanation about
 `model_pi H`. -/
@@ -434,6 +483,7 @@ def ModelWithCorners.pi {π•œ : Type u} [NontriviallyNormedField π•œ] {ΞΉ : Typ
   continuous_toFun := continuous_pi fun i => (I i).Continuous.comp (continuous_apply i)
   continuous_invFun := continuous_pi fun i => (I i).continuous_symm.comp (continuous_apply i)
 #align model_with_corners.pi ModelWithCorners.pi
+-/
 
 /-- Special case of product model with corners, which is trivial on the second factor. This shows up
 as the model to tangent bundles. -/
@@ -482,18 +532,22 @@ end ModelWithCornersProd
 
 section Boundaryless
 
+#print ModelWithCorners.Boundaryless /-
 /-- Property ensuring that the model with corners `I` defines manifolds without boundary. -/
 class ModelWithCorners.Boundaryless {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
     [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) : Prop where
   range_eq_univ : range I = univ
 #align model_with_corners.boundaryless ModelWithCorners.Boundaryless
+-/
 
+#print modelWithCornersSelf_boundaryless /-
 /-- The trivial model with corners has no boundary -/
 instance modelWithCornersSelf_boundaryless (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
     [NormedAddCommGroup E] [NormedSpace π•œ E] : (modelWithCornersSelf π•œ E).Boundaryless :=
   ⟨by simp⟩
 #align model_with_corners_self_boundaryless modelWithCornersSelf_boundaryless
+-/
 
 /-- If two model with corners are boundaryless, their product also is -/
 instance ModelWithCorners.range_eq_univ_prod {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v}
@@ -521,6 +575,7 @@ variable {m n : β„•βˆž} {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type
 
 variable (n)
 
+#print contDiffGroupoid /-
 /-- Given a model with corners `(E, H)`, we define the groupoid of `C^n` transformations of `H` as
 the maps that are `C^n` when read in `E` through `I`. -/
 def contDiffGroupoid : StructureGroupoid H :=
@@ -566,6 +621,7 @@ def contDiffGroupoid : StructureGroupoid H :=
         simp only [mfld_simps] at hy1 ⊒
         rw [fg _ hy1] }
 #align cont_diff_groupoid contDiffGroupoid
+-/
 
 variable {n}
 
@@ -656,6 +712,7 @@ section SmoothManifoldWithCorners
 /-! ### Smooth manifolds with corners -/
 
 
+#print SmoothManifoldWithCorners /-
 /-- Typeclass defining smooth manifolds with corners with respect to a model with corners, over a
 field `π•œ` and with infinite smoothness to simplify typeclass search and statements later on. -/
 class SmoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
@@ -663,6 +720,7 @@ class SmoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ] {
     (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M] extends
     HasGroupoid M (contDiffGroupoid ∞ I) : Prop
 #align smooth_manifold_with_corners SmoothManifoldWithCorners
+-/
 
 theorem SmoothManifoldWithCorners.mk' {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
     [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
@@ -688,12 +746,14 @@ theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type _} [NontriviallyNor
       apply StructureGroupoid.compatible }
 #align smooth_manifold_with_corners_of_cont_diff_on smoothManifoldWithCorners_of_contDiffOn
 
+#print model_space_smooth /-
 /-- For any model with corners, the model space is a smooth manifold -/
 instance model_space_smooth {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
     [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
     {I : ModelWithCorners π•œ E H} : SmoothManifoldWithCorners I H :=
   { hasGroupoid_model_space _ _ with }
 #align model_space_smooth model_space_smooth
+-/
 
 end SmoothManifoldWithCorners
 
@@ -706,11 +766,13 @@ variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddC
   [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) (M : Type _)
   [TopologicalSpace M] [ChartedSpace H M]
 
+#print SmoothManifoldWithCorners.maximalAtlas /-
 /-- The maximal atlas of `M` for the smooth manifold with corners structure corresponding to the
 model with corners `I`. -/
 def maximalAtlas :=
   (contDiffGroupoid ∞ I).maximalAtlas M
 #align smooth_manifold_with_corners.maximal_atlas SmoothManifoldWithCorners.maximalAtlas
+-/
 
 variable {M}
 
@@ -799,12 +861,14 @@ as `local_equiv`.
 
 namespace LocalHomeomorph
 
+#print LocalHomeomorph.extend /-
 /-- Given a chart `f` on a manifold with corners, `f.extend I` is the extended chart to the model
 vector space. -/
 @[simp, mfld_simps]
 def extend : LocalEquiv M E :=
   f.toLocalEquiv ≫ I.toLocalEquiv
 #align local_homeomorph.extend LocalHomeomorph.extend
+-/
 
 theorem extend_coe : ⇑(f.extend I) = I ∘ f :=
   rfl
@@ -1014,13 +1078,13 @@ theorem extend_coord_change_source_mem_nhdsWithin {x : E}
   refine' (LocalHomeomorph.open_source _).mem_nhds hx
 #align local_homeomorph.extend_coord_change_source_mem_nhds_within LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin
 
-theorem extend_coord_change_source_mem_nhds_within' {x : M} (hxf : x ∈ f.source)
+theorem extend_coord_change_source_mem_nhdsWithin' {x : M} (hxf : x ∈ f.source)
     (hxf' : x ∈ f'.source) : ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] f.extend I x :=
   by
   apply extend_coord_change_source_mem_nhds_within
   rw [← extend_image_source_inter]
   exact mem_image_of_mem _ ⟨hxf, hxf'⟩
-#align local_homeomorph.extend_coord_change_source_mem_nhds_within' LocalHomeomorph.extend_coord_change_source_mem_nhds_within'
+#align local_homeomorph.extend_coord_change_source_mem_nhds_within' LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin'
 
 variable {f f'}
 
@@ -1059,12 +1123,14 @@ open LocalHomeomorph
 
 variable [ChartedSpace H M] [ChartedSpace H' M']
 
+#print extChartAt /-
 /-- The preferred extended chart on a manifold with corners around a point `x`, from a neighborhood
 of `x` to the model vector space. -/
 @[simp, mfld_simps]
 def extChartAt (x : M) : LocalEquiv M E :=
   (chartAt H x).extend I
 #align ext_chart_at extChartAt
+-/
 
 theorem extChartAt_coe : ⇑(extChartAt I x) = I ∘ chartAt H x :=
   rfl
@@ -1082,9 +1148,9 @@ theorem isOpen_extChartAt_source : IsOpen (extChartAt I x).source :=
   isOpen_extend_source _ _
 #align is_open_ext_chart_at_source isOpen_extChartAt_source
 
-theorem mem_ext_chart_source : x ∈ (extChartAt I x).source := by
+theorem mem_extChartAt_source : x ∈ (extChartAt I x).source := by
   simp only [extChartAt_source, mem_chart_source]
-#align mem_ext_chart_source mem_ext_chart_source
+#align mem_ext_chart_source mem_extChartAt_source
 
 theorem extChartAt_target (x : M) :
     (extChartAt I x).target = I.symm ⁻¹' (chartAt H x).target ∩ range I :=
@@ -1092,7 +1158,7 @@ theorem extChartAt_target (x : M) :
 #align ext_chart_at_target extChartAt_target
 
 theorem extChartAt_to_inv : (extChartAt I x).symm ((extChartAt I x) x) = x :=
-  (extChartAt I x).left_inv (mem_ext_chart_source I x)
+  (extChartAt I x).left_inv (mem_extChartAt_source I x)
 #align ext_chart_at_to_inv extChartAt_to_inv
 
 theorem mapsTo_extChartAt (hs : s βŠ† (chartAt H x).source) :
@@ -1106,13 +1172,13 @@ theorem extChartAt_source_mem_nhds' {x' : M} (h : x' ∈ (extChartAt I x).source
 #align ext_chart_at_source_mem_nhds' extChartAt_source_mem_nhds'
 
 theorem extChartAt_source_mem_nhds : (extChartAt I x).source ∈ 𝓝 x :=
-  extChartAt_source_mem_nhds' I x (mem_ext_chart_source I x)
+  extChartAt_source_mem_nhds' I x (mem_extChartAt_source I x)
 #align ext_chart_at_source_mem_nhds extChartAt_source_mem_nhds
 
-theorem extChartAt_source_mem_nhds_within' {x' : M} (h : x' ∈ (extChartAt I x).source) :
+theorem extChartAt_source_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source) :
     (extChartAt I x).source ∈ 𝓝[s] x' :=
   mem_nhdsWithin_of_mem_nhds (extChartAt_source_mem_nhds' I x h)
-#align ext_chart_at_source_mem_nhds_within' extChartAt_source_mem_nhds_within'
+#align ext_chart_at_source_mem_nhds_within' extChartAt_source_mem_nhdsWithin'
 
 theorem extChartAt_source_mem_nhdsWithin : (extChartAt I x).source ∈ 𝓝[s] x :=
   mem_nhdsWithin_of_mem_nhds (extChartAt_source_mem_nhds I x)
@@ -1122,13 +1188,13 @@ theorem continuousOn_extChartAt : ContinuousOn (extChartAt I x) (extChartAt I x)
   continuousOn_extend _ _
 #align continuous_on_ext_chart_at continuousOn_extChartAt
 
-theorem continuousAt_ext_chart_at' {x' : M} (h : x' ∈ (extChartAt I x).source) :
+theorem continuousAt_extChartAt' {x' : M} (h : x' ∈ (extChartAt I x).source) :
     ContinuousAt (extChartAt I x) x' :=
   continuousAt_extend _ _ <| by rwa [← extChartAt_source I]
-#align continuous_at_ext_chart_at' continuousAt_ext_chart_at'
+#align continuous_at_ext_chart_at' continuousAt_extChartAt'
 
 theorem continuousAt_extChartAt : ContinuousAt (extChartAt I x) x :=
-  continuousAt_ext_chart_at' _ _ (mem_ext_chart_source I x)
+  continuousAt_extChartAt' _ _ (mem_extChartAt_source I x)
 #align continuous_at_ext_chart_at continuousAt_extChartAt
 
 theorem map_extChartAt_nhds' {x y : M} (hy : y ∈ (extChartAt I x).source) :
@@ -1137,16 +1203,16 @@ theorem map_extChartAt_nhds' {x y : M} (hy : y ∈ (extChartAt I x).source) :
 #align map_ext_chart_at_nhds' map_extChartAt_nhds'
 
 theorem map_extChartAt_nhds : map (extChartAt I x) (𝓝 x) = 𝓝[range I] extChartAt I x x :=
-  map_extChartAt_nhds' I <| mem_ext_chart_source I x
+  map_extChartAt_nhds' I <| mem_extChartAt_source I x
 #align map_ext_chart_at_nhds map_extChartAt_nhds
 
-theorem extChartAt_target_mem_nhds_within' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem extChartAt_target_mem_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x y :=
   extend_target_mem_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
-#align ext_chart_at_target_mem_nhds_within' extChartAt_target_mem_nhds_within'
+#align ext_chart_at_target_mem_nhds_within' extChartAt_target_mem_nhdsWithin'
 
 theorem extChartAt_target_mem_nhdsWithin : (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x x :=
-  extChartAt_target_mem_nhds_within' I x (mem_ext_chart_source I x)
+  extChartAt_target_mem_nhdsWithin' I x (mem_extChartAt_source I x)
 #align ext_chart_at_target_mem_nhds_within extChartAt_target_mem_nhdsWithin
 
 theorem extChartAt_target_subset_range : (extChartAt I x).target βŠ† range I := by
@@ -1160,7 +1226,7 @@ theorem nhdsWithin_extChartAt_target_eq' {y : M} (hy : y ∈ (extChartAt I x).so
 
 theorem nhdsWithin_extChartAt_target_eq :
     𝓝[(extChartAt I x).target] (extChartAt I x) x = 𝓝[range I] (extChartAt I x) x :=
-  nhdsWithin_extChartAt_target_eq' I x (mem_ext_chart_source I x)
+  nhdsWithin_extChartAt_target_eq' I x (mem_extChartAt_source I x)
 #align nhds_within_ext_chart_at_target_eq nhdsWithin_extChartAt_target_eq
 
 theorem continuousAt_extChartAt_symm'' {y : E} (h : y ∈ (extChartAt I x).target) :
@@ -1174,7 +1240,7 @@ theorem continuousAt_extChartAt_symm' {x' : M} (h : x' ∈ (extChartAt I x).sour
 #align continuous_at_ext_chart_at_symm' continuousAt_extChartAt_symm'
 
 theorem continuousAt_extChartAt_symm : ContinuousAt (extChartAt I x).symm ((extChartAt I x) x) :=
-  continuousAt_extChartAt_symm' I x (mem_ext_chart_source I x)
+  continuousAt_extChartAt_symm' I x (mem_extChartAt_source I x)
 #align continuous_at_ext_chart_at_symm continuousAt_extChartAt_symm
 
 theorem continuousOn_extChartAt_symm : ContinuousOn (extChartAt I x).symm (extChartAt I x).target :=
@@ -1200,24 +1266,24 @@ theorem map_extChartAt_nhdsWithin_eq_image' {y : M} (hy : y ∈ (extChartAt I x)
 theorem map_extChartAt_nhdsWithin_eq_image :
     map (extChartAt I x) (𝓝[s] x) =
       𝓝[extChartAt I x '' ((extChartAt I x).source ∩ s)] extChartAt I x x :=
-  map_extChartAt_nhdsWithin_eq_image' I x (mem_ext_chart_source I x)
+  map_extChartAt_nhdsWithin_eq_image' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_nhds_within_eq_image map_extChartAt_nhdsWithin_eq_image
 
-theorem map_extChartAt_nhds_within' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem map_extChartAt_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x) (𝓝[s] y) = 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x y :=
   map_extend_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
-#align map_ext_chart_at_nhds_within' map_extChartAt_nhds_within'
+#align map_ext_chart_at_nhds_within' map_extChartAt_nhdsWithin'
 
 theorem map_extChartAt_nhdsWithin :
     map (extChartAt I x) (𝓝[s] x) = 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x x :=
-  map_extChartAt_nhds_within' I x (mem_ext_chart_source I x)
+  map_extChartAt_nhdsWithin' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_nhds_within map_extChartAt_nhdsWithin
 
-theorem map_extChartAt_symm_nhds_within' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem map_extChartAt_symm_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x).symm (𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x y) =
       𝓝[s] y :=
   map_extend_symm_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
-#align map_ext_chart_at_symm_nhds_within' map_extChartAt_symm_nhds_within'
+#align map_ext_chart_at_symm_nhds_within' map_extChartAt_symm_nhdsWithin'
 
 theorem map_extChartAt_symm_nhdsWithin_range' {y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x).symm (𝓝[range I] extChartAt I x y) = 𝓝 y :=
@@ -1227,27 +1293,27 @@ theorem map_extChartAt_symm_nhdsWithin_range' {y : M} (hy : y ∈ (extChartAt I
 theorem map_extChartAt_symm_nhdsWithin :
     map (extChartAt I x).symm (𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x x) =
       𝓝[s] x :=
-  map_extChartAt_symm_nhds_within' I x (mem_ext_chart_source I x)
+  map_extChartAt_symm_nhdsWithin' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_symm_nhds_within map_extChartAt_symm_nhdsWithin
 
 theorem map_extChartAt_symm_nhdsWithin_range :
     map (extChartAt I x).symm (𝓝[range I] extChartAt I x x) = 𝓝 x :=
-  map_extChartAt_symm_nhdsWithin_range' I x (mem_ext_chart_source I x)
+  map_extChartAt_symm_nhdsWithin_range' I x (mem_extChartAt_source I x)
 #align map_ext_chart_at_symm_nhds_within_range map_extChartAt_symm_nhdsWithin_range
 
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 in the source is a neighborhood of the preimage, within a set. -/
-theorem extChartAt_preimage_mem_nhds_within' {x' : M} (h : x' ∈ (extChartAt I x).source)
+theorem extChartAt_preimage_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source)
     (ht : t ∈ 𝓝[s] x') :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x' := by
-  rwa [← map_extChartAt_symm_nhds_within' I x h, mem_map] at ht 
-#align ext_chart_at_preimage_mem_nhds_within' extChartAt_preimage_mem_nhds_within'
+  rwa [← map_extChartAt_symm_nhdsWithin' I x h, mem_map] at ht 
+#align ext_chart_at_preimage_mem_nhds_within' extChartAt_preimage_mem_nhdsWithin'
 
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of the
 base point is a neighborhood of the preimage, within a set. -/
 theorem extChartAt_preimage_mem_nhdsWithin (ht : t ∈ 𝓝[s] x) :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x :=
-  extChartAt_preimage_mem_nhds_within' I x (mem_ext_chart_source I x) ht
+  extChartAt_preimage_mem_nhdsWithin' I x (mem_extChartAt_source I x) ht
 #align ext_chart_at_preimage_mem_nhds_within extChartAt_preimage_mem_nhdsWithin
 
 theorem extChartAt_preimage_mem_nhds' {x' : M} (h : x' ∈ (extChartAt I x).source) (ht : t ∈ 𝓝 x') :
@@ -1261,7 +1327,7 @@ theorem extChartAt_preimage_mem_nhds (ht : t ∈ 𝓝 x) :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝 ((extChartAt I x) x) :=
   by
   apply (continuousAt_extChartAt_symm I x).preimage_mem_nhds
-  rwa [(extChartAt I x).left_inv (mem_ext_chart_source _ _)]
+  rwa [(extChartAt I x).left_inv (mem_extChartAt_source _ _)]
 #align ext_chart_at_preimage_mem_nhds extChartAt_preimage_mem_nhds
 
 /-- Technical lemma to rewrite suitably the preimage of an intersection under an extended chart, to
@@ -1296,12 +1362,14 @@ theorem contDiffWithinAt_ext_coord_change [SmoothManifoldWithCorners I M] (x x'
     hy
 #align cont_diff_within_at_ext_coord_change contDiffWithinAt_ext_coord_change
 
+#print writtenInExtChartAt /-
 /-- Conjugating a function to write it in the preferred charts around `x`.
 The manifold derivative of `f` will just be the derivative of this conjugated function. -/
 @[simp, mfld_simps]
 def writtenInExtChartAt (x : M) (f : M β†’ M') : E β†’ E' :=
   extChartAt I' (f x) ∘ f ∘ (extChartAt I x).symm
 #align written_in_ext_chart_at writtenInExtChartAt
+-/
 
 variable (π•œ)
 
@@ -1313,15 +1381,19 @@ theorem extChartAt_self_apply {x y : H} : extChartAt I x y = I y :=
   rfl
 #align ext_chart_at_self_apply extChartAt_self_apply
 
+#print extChartAt_model_space_eq_id /-
 /-- In the case of the manifold structure on a vector space, the extended charts are just the
 identity.-/
 theorem extChartAt_model_space_eq_id (x : E) : extChartAt π“˜(π•œ, E) x = LocalEquiv.refl E := by
   simp only [mfld_simps]
 #align ext_chart_at_model_space_eq_id extChartAt_model_space_eq_id
+-/
 
+#print ext_chart_model_space_apply /-
 theorem ext_chart_model_space_apply {x y : E} : extChartAt π“˜(π•œ, E) x y = y :=
   rfl
 #align ext_chart_model_space_apply ext_chart_model_space_apply
+-/
 
 variable {π•œ}
 
Diff
@@ -413,7 +413,7 @@ def ModelWithCorners.prod {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Ty
       I'.toLocalEquiv with
     toFun := fun x => (I x.1, I' x.2)
     invFun := fun x => (I.symm x.1, I'.symm x.2)
-    source := { x | x.1 ∈ I.source ∧ x.2 ∈ I'.source }
+    source := {x | x.1 ∈ I.source ∧ x.2 ∈ I'.source}
     source_eq := by simp only [set_of_true, mfld_simps]
     unique_diff' := I.unique_diff'.Prod I'.unique_diff'
     continuous_toFun := I.continuous_toFun.Prod_map I'.continuous_toFun
Diff
@@ -135,8 +135,8 @@ define a smooth manifold with model space `H`, and model vector space `E`.
 -/
 @[ext, nolint has_nonempty_instance]
 structure ModelWithCorners (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
-  [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] extends
-  LocalEquiv H E where
+    [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] extends
+    LocalEquiv H E where
   source_eq : source = univ
   unique_diff' : UniqueDiffOn π•œ to_local_equiv.target
   continuous_toFun : Continuous to_fun := by continuity
@@ -342,9 +342,9 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
   refine' ⟨fun h => _, fun h => _⟩
   Β· have := h.comp I.continuous_within_at (maps_to_preimage _ _)
     simp_rw [preimage_inter, preimage_preimage, I.left_inv, preimage_id', preimage_range,
-      inter_univ] at this
-    rwa [Function.comp.assoc, I.symm_comp_self] at this
-  Β· rw [← I.left_inv x] at h; exact h.comp I.continuous_within_at_symm (inter_subset_left _ _)
+      inter_univ] at this 
+    rwa [Function.comp.assoc, I.symm_comp_self] at this 
+  Β· rw [← I.left_inv x] at h ; exact h.comp I.continuous_within_at_symm (inter_subset_left _ _)
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
 
 protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
@@ -484,8 +484,8 @@ section Boundaryless
 
 /-- Property ensuring that the model with corners `I` defines manifolds without boundary. -/
 class ModelWithCorners.Boundaryless {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-  [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-  (I : ModelWithCorners π•œ E H) : Prop where
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) : Prop where
   range_eq_univ : range I = univ
 #align model_with_corners.boundaryless ModelWithCorners.Boundaryless
 
@@ -532,7 +532,7 @@ def contDiffGroupoid : StructureGroupoid H :=
         rw [this]
         apply ContDiffOn.comp hg _
         · rintro x ⟨hx1, hx2⟩
-          simp only [mfld_simps] at hx1⊒
+          simp only [mfld_simps] at hx1 ⊒
           exact hx1.2
         Β· refine' hf.mono _
           rintro x ⟨hx1, hx2⟩
@@ -548,22 +548,22 @@ def contDiffGroupoid : StructureGroupoid H :=
         apply contDiffOn_of_locally_contDiffOn
         rintro y ⟨hy1, hy2⟩
         rcases mem_range.1 hy2 with ⟨x, hx⟩
-        rw [← hx] at hy1⊒
-        simp only [mfld_simps] at hy1⊒
+        rw [← hx] at hy1 ⊒
+        simp only [mfld_simps] at hy1 ⊒
         rcases H x hy1 with ⟨v, v_open, xv, hv⟩
         have : I.symm ⁻¹' (u ∩ v) ∩ range I = I.symm ⁻¹' u ∩ range I ∩ I.symm ⁻¹' v :=
           by
           rw [preimage_inter, inter_assoc, inter_assoc]
           congr 1
           rw [inter_comm]
-        rw [this] at hv
+        rw [this] at hv 
         exact ⟨I.symm ⁻¹' v, v_open.preimage I.continuous_symm, by simpa, hv⟩
       congr := fun f g u hu fg hf => by
         apply hf.congr
         rintro y ⟨hy1, hy2⟩
         rcases mem_range.1 hy2 with ⟨x, hx⟩
-        rw [← hx] at hy1⊒
-        simp only [mfld_simps] at hy1⊒
+        rw [← hx] at hy1 ⊒
+        simp only [mfld_simps] at hy1 ⊒
         rw [fg _ hy1] }
 #align cont_diff_groupoid contDiffGroupoid
 
@@ -628,14 +628,14 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
   by
   cases' he with he he_symm
   cases' he' with he' he'_symm
-  simp only at he he_symm he' he'_symm
+  simp only at he he_symm he' he'_symm 
   constructor <;> simp only [LocalEquiv.prod_source, LocalHomeomorph.prod_toLocalEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
+    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
     rw [← (I.prod I').image_eq]
     exact h3
   Β· have h3 := ContDiffOn.prod_map he_symm he'_symm
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
+    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
     rw [← (I.prod I').image_eq]
     exact h3
 #align cont_diff_groupoid_prod contDiffGroupoid_prod
@@ -659,9 +659,9 @@ section SmoothManifoldWithCorners
 /-- Typeclass defining smooth manifolds with corners with respect to a model with corners, over a
 field `π•œ` and with infinite smoothness to simplify typeclass search and statements later on. -/
 class SmoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-  [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-  (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M] extends
-  HasGroupoid M (contDiffGroupoid ∞ I) : Prop
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M] extends
+    HasGroupoid M (contDiffGroupoid ∞ I) : Prop
 #align smooth_manifold_with_corners SmoothManifoldWithCorners
 
 theorem SmoothManifoldWithCorners.mk' {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
@@ -945,7 +945,7 @@ theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
 in the source is a neighborhood of the preimage, within a set. -/
 theorem extend_preimage_mem_nhdsWithin {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝[s] x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I x := by
-  rwa [← map_extend_symm_nhds_within f I h, mem_map] at ht
+  rwa [← map_extend_symm_nhds_within f I h, mem_map] at ht 
 #align local_homeomorph.extend_preimage_mem_nhds_within LocalHomeomorph.extend_preimage_mem_nhdsWithin
 
 theorem extend_preimage_mem_nhds {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝 x) :
@@ -982,7 +982,7 @@ theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs :
     (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)] f.extend I '' s :=
   by
-  rw [← f.extend_source I] at hs
+  rw [← f.extend_source I] at hs 
   rw [(f.extend I).image_eq_target_inter_inv_preimage hs]
   exact f.extend_symm_preimage_inter_range_eventually_eq_aux I hx
 #align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
@@ -1008,7 +1008,7 @@ theorem extend_coord_change_source_mem_nhdsWithin {x : E}
     (hx : x ∈ ((f.extend I).symm ≫ f'.extend I).source) :
     ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] x :=
   by
-  rw [f.extend_coord_change_source] at hx⊒
+  rw [f.extend_coord_change_source] at hx ⊒
   obtain ⟨x, hx, rfl⟩ := hx
   refine' I.image_mem_nhds_within _
   refine' (LocalHomeomorph.open_source _).mem_nhds hx
@@ -1039,7 +1039,7 @@ theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maxi
     ContDiffWithinAt π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) (range I) x :=
   by
   apply (cont_diff_on_extend_coord_change I hf hf' x hx).mono_of_mem
-  rw [extend_coord_change_source] at hx⊒
+  rw [extend_coord_change_source] at hx ⊒
   obtain ⟨z, hz, rfl⟩ := hx
   exact I.image_mem_nhds_within ((LocalHomeomorph.open_source _).mem_nhds hz)
 #align local_homeomorph.cont_diff_within_at_extend_coord_change LocalHomeomorph.contDiffWithinAt_extend_coord_change
@@ -1240,7 +1240,7 @@ in the source is a neighborhood of the preimage, within a set. -/
 theorem extChartAt_preimage_mem_nhds_within' {x' : M} (h : x' ∈ (extChartAt I x).source)
     (ht : t ∈ 𝓝[s] x') :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x' := by
-  rwa [← map_extChartAt_symm_nhds_within' I x h, mem_map] at ht
+  rwa [← map_extChartAt_symm_nhds_within' I x h, mem_map] at ht 
 #align ext_chart_at_preimage_mem_nhds_within' extChartAt_preimage_mem_nhds_within'
 
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of the
Diff
@@ -121,7 +121,7 @@ universe u v w u' v' w'
 
 open Set Filter Function
 
-open Manifold Filter Topology
+open scoped Manifold Filter Topology
 
 -- mathport name: with_top.nat.top
 scoped[Manifold] notation "∞" => (⊀ : β„•βˆž)
@@ -780,7 +780,7 @@ end TopologicalSpace.Opens
 
 section ExtendedCharts
 
-open Topology
+open scoped Topology
 
 variable {π•œ E M H E' M' H' : Type _} [NontriviallyNormedField π•œ] [NormedAddCommGroup E]
   [NormedSpace π•œ E] [TopologicalSpace H] [TopologicalSpace M] (f f' : LocalHomeomorph M H)
Diff
@@ -248,9 +248,7 @@ theorem continuousOn_symm {s} : ContinuousOn I.symm s :=
 #align model_with_corners.continuous_on_symm ModelWithCorners.continuousOn_symm
 
 @[simp, mfld_simps]
-theorem target_eq : I.target = range (I : H β†’ E) :=
-  by
-  rw [← image_univ, ← I.source_eq]
+theorem target_eq : I.target = range (I : H β†’ E) := by rw [← image_univ, ← I.source_eq];
   exact I.to_local_equiv.image_source_eq_target.symm
 #align model_with_corners.target_eq ModelWithCorners.target_eq
 
@@ -259,10 +257,7 @@ protected theorem unique_diff : UniqueDiffOn π•œ (range I) :=
 #align model_with_corners.unique_diff ModelWithCorners.unique_diff
 
 @[simp, mfld_simps]
-protected theorem left_inv (x : H) : I.symm (I x) = x :=
-  by
-  refine' I.left_inv' _
-  simp
+protected theorem left_inv (x : H) : I.symm (I x) = x := by refine' I.left_inv' _; simp
 #align model_with_corners.left_inv ModelWithCorners.left_inv
 
 protected theorem leftInverse : LeftInverse I.symm I :=
@@ -294,8 +289,7 @@ theorem preimage_image (s : Set H) : I ⁻¹' (I '' s) = s :=
 protected theorem image_eq (s : Set H) : I '' s = I.symm ⁻¹' s ∩ range I :=
   by
   refine' (I.to_local_equiv.image_eq_target_inter_inv_preimage _).trans _
-  Β· rw [I.source_eq]
-    exact subset_univ _
+  Β· rw [I.source_eq]; exact subset_univ _
   Β· rw [inter_comm, I.target_eq, I.to_local_equiv_coe_symm]
 #align model_with_corners.image_eq ModelWithCorners.image_eq
 
@@ -328,9 +322,7 @@ theorem symm_map_nhdsWithin_range (x : H) : map I.symm (𝓝[range I] I x) = 
 #align model_with_corners.symm_map_nhds_within_range ModelWithCorners.symm_map_nhdsWithin_range
 
 theorem unique_diff_preimage {s : Set H} (hs : IsOpen s) :
-    UniqueDiffOn π•œ (I.symm ⁻¹' s ∩ range I) :=
-  by
-  rw [inter_comm]
+    UniqueDiffOn π•œ (I.symm ⁻¹' s ∩ range I) := by rw [inter_comm];
   exact I.unique_diff.inter (hs.preimage I.continuous_inv_fun)
 #align model_with_corners.unique_diff_preimage ModelWithCorners.unique_diff_preimage
 
@@ -352,8 +344,7 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
     simp_rw [preimage_inter, preimage_preimage, I.left_inv, preimage_id', preimage_range,
       inter_univ] at this
     rwa [Function.comp.assoc, I.symm_comp_self] at this
-  Β· rw [← I.left_inv x] at h
-    exact h.comp I.continuous_within_at_symm (inter_subset_left _ _)
+  Β· rw [← I.left_inv x] at h; exact h.comp I.continuous_within_at_symm (inter_subset_left _ _)
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
 
 protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
@@ -479,17 +470,12 @@ theorem modelWithCorners_prod_coe_symm (I : ModelWithCorners π•œ E H)
   rfl
 #align model_with_corners_prod_coe_symm modelWithCorners_prod_coe_symm
 
-theorem modelWithCornersSelf_prod : π“˜(π•œ, E Γ— F) = π“˜(π•œ, E).Prod π“˜(π•œ, F) :=
-  by
-  ext1
-  simp
+theorem modelWithCornersSelf_prod : π“˜(π•œ, E Γ— F) = π“˜(π•œ, E).Prod π“˜(π•œ, F) := by ext1; simp
 #align model_with_corners_self_prod modelWithCornersSelf_prod
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem ModelWithCorners.range_prod : range (I.Prod J) = range I Γ—Λ’ range J :=
-  by
-  simp_rw [← ModelWithCorners.target_eq]
-  rfl
+theorem ModelWithCorners.range_prod : range (I.Prod J) = range I Γ—Λ’ range J := by
+  simp_rw [← ModelWithCorners.target_eq]; rfl
 #align model_with_corners.range_prod ModelWithCorners.range_prod
 
 end ModelWithCornersProd
@@ -542,10 +528,7 @@ def contDiffGroupoid : StructureGroupoid H :=
     { property := fun f s => ContDiffOn π•œ n (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I)
       comp := fun f g u v hf hg hu hv huv =>
         by
-        have : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm :=
-          by
-          ext x
-          simp
+        have : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
         rw [this]
         apply ContDiffOn.comp hg _
         · rintro x ⟨hx1, hx2⟩
@@ -835,9 +818,7 @@ theorem extend_source : (f.extend I).source = f.source := by
   rw [extend, LocalEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
 #align local_homeomorph.extend_source LocalHomeomorph.extend_source
 
-theorem isOpen_extend_source : IsOpen (f.extend I).source :=
-  by
-  rw [extend_source]
+theorem isOpen_extend_source : IsOpen (f.extend I).source := by rw [extend_source];
   exact f.open_source
 #align local_homeomorph.is_open_extend_source LocalHomeomorph.isOpen_extend_source
 
@@ -924,9 +905,7 @@ theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
 #align local_homeomorph.is_open_extend_preimage' LocalHomeomorph.isOpen_extend_preimage'
 
 theorem isOpen_extend_preimage {s : Set E} (hs : IsOpen s) : IsOpen (f.source ∩ f.extend I ⁻¹' s) :=
-  by
-  rw [← extend_source f I]
-  exact is_open_extend_preimage' f I hs
+  by rw [← extend_source f I]; exact is_open_extend_preimage' f I hs
 #align local_homeomorph.is_open_extend_preimage LocalHomeomorph.isOpen_extend_preimage
 
 theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
@@ -1208,9 +1187,7 @@ theorem isOpen_extChartAt_preimage' {s : Set E} (hs : IsOpen s) :
 #align is_open_ext_chart_at_preimage' isOpen_extChartAt_preimage'
 
 theorem isOpen_extChartAt_preimage {s : Set E} (hs : IsOpen s) :
-    IsOpen ((chartAt H x).source ∩ extChartAt I x ⁻¹' s) :=
-  by
-  rw [← extChartAt_source I]
+    IsOpen ((chartAt H x).source ∩ extChartAt I x ⁻¹' s) := by rw [← extChartAt_source I];
   exact isOpen_extChartAt_preimage' I x hs
 #align is_open_ext_chart_at_preimage isOpen_extChartAt_preimage
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module geometry.manifold.smooth_manifold_with_corners
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit ddec54a71a0dd025c05445d467f1a2b7d586a3ba
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -853,6 +853,10 @@ theorem mapsTo_extend (hs : s βŠ† f.source) :
   exact image_subset _ (inter_subset_right _ _)
 #align local_homeomorph.maps_to_extend LocalHomeomorph.mapsTo_extend
 
+theorem extend_left_inv {x : M} (hxf : x ∈ f.source) : (f.extend I).symm (f.extend I x) = x :=
+  (f.extend I).left_inv <| by rwa [f.extend_source]
+#align local_homeomorph.extend_left_inv LocalHomeomorph.extend_left_inv
+
 theorem extend_source_mem_nhds {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝 x :=
   (isOpen_extend_source f I).mem_nhds <| by rwa [f.extend_source I]
 #align local_homeomorph.extend_source_mem_nhds LocalHomeomorph.extend_source_mem_nhds
@@ -1021,6 +1025,24 @@ theorem extend_image_source_inter :
     symm_target]
 #align local_homeomorph.extend_image_source_inter LocalHomeomorph.extend_image_source_inter
 
+theorem extend_coord_change_source_mem_nhdsWithin {x : E}
+    (hx : x ∈ ((f.extend I).symm ≫ f'.extend I).source) :
+    ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] x :=
+  by
+  rw [f.extend_coord_change_source] at hx⊒
+  obtain ⟨x, hx, rfl⟩ := hx
+  refine' I.image_mem_nhds_within _
+  refine' (LocalHomeomorph.open_source _).mem_nhds hx
+#align local_homeomorph.extend_coord_change_source_mem_nhds_within LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin
+
+theorem extend_coord_change_source_mem_nhds_within' {x : M} (hxf : x ∈ f.source)
+    (hxf' : x ∈ f'.source) : ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] f.extend I x :=
+  by
+  apply extend_coord_change_source_mem_nhds_within
+  rw [← extend_image_source_inter]
+  exact mem_image_of_mem _ ⟨hxf, hxf'⟩
+#align local_homeomorph.extend_coord_change_source_mem_nhds_within' LocalHomeomorph.extend_coord_change_source_mem_nhds_within'
+
 variable {f f'}
 
 open SmoothManifoldWithCorners
@@ -1043,6 +1065,15 @@ theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maxi
   exact I.image_mem_nhds_within ((LocalHomeomorph.open_source _).mem_nhds hz)
 #align local_homeomorph.cont_diff_within_at_extend_coord_change LocalHomeomorph.contDiffWithinAt_extend_coord_change
 
+theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
+    (hf' : f' ∈ maximalAtlas I M) {x : M} (hxf : x ∈ f.source) (hxf' : x ∈ f'.source) :
+    ContDiffWithinAt π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) (range I) (f'.extend I x) :=
+  by
+  refine' cont_diff_within_at_extend_coord_change I hf hf' _
+  rw [← extend_image_source_inter]
+  exact mem_image_of_mem _ ⟨hxf', hxf⟩
+#align local_homeomorph.cont_diff_within_at_extend_coord_change' LocalHomeomorph.contDiffWithinAt_extend_coord_change'
+
 end LocalHomeomorph
 
 open LocalHomeomorph

Changes in mathlib4

mathlib3
mathlib4
chore: classify porting notes referring to missing linters (#12098)

Reference the newly created issues #12094 and #12096, as well as the pre-existing #5171. Change all references to #10927 to #5171. Some of these changes were not labelled as "porting note"; change this for good measure.

Diff
@@ -138,7 +138,7 @@ scoped[Manifold] notation "∞" => (⊀ : β„•βˆž)
 model vector space `E` over the field `π•œ`. This is all what is needed to
 define a smooth manifold with model space `H`, and model vector space `E`.
 -/
-@[ext] -- Porting note: was nolint has_nonempty_instance
+@[ext] -- Porting note(#5171): was nolint has_nonempty_instance
 structure ModelWithCorners (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*)
     [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type*) [TopologicalSpace H] extends
     PartialEquiv H E where
doc: fix many more mathlib3 names in doc comments (#11987)

A mix of various changes; generated with a script and manually tweaked.

Diff
@@ -53,17 +53,17 @@ but add these assumptions later as needed. (Quite a few results still do not req
 
 As specific examples of models with corners, we define (in `Geometry.Manifold.Instances.Real`)
 * `modelWithCornersSelf ℝ (EuclideanSpace (Fin n))` for the model space used to define
-  `n`-dimensional real manifolds without boundary (with notation `𝓑 n` in the locale `manifold`)
+  `n`-dimensional real manifolds without boundary (with notation `𝓑 n` in the locale `Manifold`)
 * `ModelWithCorners ℝ (EuclideanSpace (Fin n)) (EuclideanHalfSpace n)` for the model space
   used to define `n`-dimensional real manifolds with boundary (with notation `π“‘βˆ‚ n` in the locale
-  `manifold`)
+  `Manifold`)
 * `ModelWithCorners ℝ (EuclideanSpace (Fin n)) (EuclideanQuadrant n)` for the model space used
   to define `n`-dimensional real manifolds with corners
 
 With these definitions at hand, to invoke an `n`-dimensional real manifold without boundary,
 one could use
 
-  `variables {n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace (Fin n)) M]
+  `variable {n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace (Fin n)) M]
    [SmoothManifoldWithCorners (𝓑 n) M]`.
 
 However, this is not the recommended way: a theorem proved using this assumption would not apply
@@ -74,7 +74,7 @@ In the same way, it would not apply to product manifolds, modelled on
 The right invocation does not focus on one specific construction, but on all constructions sharing
 the right properties, like
 
-  `variables {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
+  `variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
   {I : ModelWithCorners ℝ E E} [I.Boundaryless]
   {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [SmoothManifoldWithCorners I M]`
 
style: replace '.-/' by '. -/' (#11938)

Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.

Diff
@@ -1597,7 +1597,7 @@ theorem extChartAt_self_apply {x y : H} : extChartAt I x y = I y :=
 #align ext_chart_at_self_apply extChartAt_self_apply
 
 /-- In the case of the manifold structure on a vector space, the extended charts are just the
-identity.-/
+identity. -/
 theorem extChartAt_model_space_eq_id (x : E) : extChartAt π“˜(π•œ, E) x = PartialEquiv.refl E := by
   simp only [mfld_simps]
 #align ext_chart_at_model_space_eq_id extChartAt_model_space_eq_id
chore: remove some mathlib3 names in doc comments (#11931)
Diff
@@ -51,13 +51,13 @@ but add these assumptions later as needed. (Quite a few results still do not req
   we register them as `PartialEquiv`s.
   `extChartAt I x` is the canonical such partial equiv around `x`.
 
-As specific examples of models with corners, we define (in the file `real_instances.lean`)
+As specific examples of models with corners, we define (in `Geometry.Manifold.Instances.Real`)
 * `modelWithCornersSelf ℝ (EuclideanSpace (Fin n))` for the model space used to define
   `n`-dimensional real manifolds without boundary (with notation `𝓑 n` in the locale `manifold`)
-* `ModelWithCorners ℝ (EuclideanSpace (Fin n)) (euclidean_half_space n)` for the model space
+* `ModelWithCorners ℝ (EuclideanSpace (Fin n)) (EuclideanHalfSpace n)` for the model space
   used to define `n`-dimensional real manifolds with boundary (with notation `π“‘βˆ‚ n` in the locale
   `manifold`)
-* `ModelWithCorners ℝ (EuclideanSpace (Fin n)) (euclidean_quadrant n)` for the model space used
+* `ModelWithCorners ℝ (EuclideanSpace (Fin n)) (EuclideanQuadrant n)` for the model space used
   to define `n`-dimensional real manifolds with corners
 
 With these definitions at hand, to invoke an `n`-dimensional real manifold without boundary,
doc(SmoothManifoldWithCorners): document notation (#11933)

for models with corners and \infty

The first two docstrings are small modifications of the module docstring.

Diff
@@ -128,6 +128,7 @@ open Set Filter Function
 
 open scoped Manifold Filter Topology
 
+/-- The extended natural number `∞` -/
 scoped[Manifold] notation "∞" => (⊀ : β„•βˆž)
 
 /-! ### Models with corners. -/
golf: replace some apply foo.mpr by rw [foo] (#11515)

Sometimes, that line can be golfed into the next line. Inspired by a comment of @loefflerd; any decisions are my own.

Diff
@@ -652,7 +652,7 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
 instance : ClosedUnderRestriction (contDiffGroupoid n I) :=
   (closedUnderRestriction_iff_id_le _).mpr
     (by
-      apply StructureGroupoid.le_iff.mpr
+      rw [StructureGroupoid.le_iff]
       rintro e ⟨s, hs, hes⟩
       apply (contDiffGroupoid n I).mem_of_eqOnSource' _ _ _ hes
       exact ofSet_mem_contDiffGroupoid n I hs)
@@ -790,7 +790,7 @@ theorem symm_trans_mem_analyticGroupoid (e : PartialHomeomorph M H) :
 instance : ClosedUnderRestriction (analyticGroupoid I) :=
   (closedUnderRestriction_iff_id_le _).mpr
     (by
-      apply StructureGroupoid.le_iff.mpr
+      rw [StructureGroupoid.le_iff]
       rintro e ⟨s, hs, hes⟩
       apply (analyticGroupoid I).mem_of_eqOnSource' _ _ _ hes
       exact ofSet_mem_analyticGroupoid I hs)
chore: rename open_range to isOpen_range, closed_range to isClosed_range (#11438)

All these lemmas refer to the range of some function being open/range (i.e. isOpen or isClosed).

Diff
@@ -301,9 +301,11 @@ protected theorem closedEmbedding : ClosedEmbedding I :=
   I.leftInverse.closedEmbedding I.continuous_symm I.continuous
 #align model_with_corners.closed_embedding ModelWithCorners.closedEmbedding
 
-theorem closed_range : IsClosed (range I) :=
-  I.closedEmbedding.closed_range
-#align model_with_corners.closed_range ModelWithCorners.closed_range
+theorem isClosed_range : IsClosed (range I) :=
+  I.closedEmbedding.isClosed_range
+#align model_with_corners.closed_range ModelWithCorners.isClosed_range
+
+@[deprecated] alias closed_range := isClosed_range -- 2024-03-17
 
 theorem map_nhds_eq (x : H) : map I (𝓝 x) = 𝓝[range I] I x :=
   I.closedEmbedding.toEmbedding.map_nhds_eq x
@@ -359,7 +361,7 @@ protected theorem locallyCompactSpace [LocallyCompactSpace E] (I : ModelWithCorn
     exact ((compact_basis_nhds (I x)).inf_principal _).map _
   refine' .of_hasBasis this _
   rintro x s ⟨-, hsc⟩
-  exact (hsc.inter_right I.closed_range).image I.continuous_symm
+  exact (hsc.inter_right I.isClosed_range).image I.continuous_symm
 #align model_with_corners.locally_compact ModelWithCorners.locallyCompactSpace
 
 open TopologicalSpace
chore: replace Ξ» by fun (#11301)

Per the style guidelines, Ξ» is disallowed in mathlib. This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes

  • In lines I was modifying anyway, I also converted => to ↦.
  • Also contains some mild in-passing indentation fixes in Mathlib/Order/SupClosed.
  • Some doc comments still contained Lean 3 syntax Ξ» x, , which I also replaced.
Diff
@@ -82,8 +82,8 @@ Here, `I.Boundaryless` is a typeclass property ensuring that there is no boundar
 instance the case for `modelWithCornersSelf`, or products of these). Note that one could consider
 as a natural assumption to only use the trivial model with corners `modelWithCornersSelf ℝ E`,
 but again in product manifolds the natural model with corners will not be this one but the product
-one (and they are not defeq as `(Ξ»p : E Γ— F, (p.1, p.2))` is not defeq to the identity). So, it is
-important to use the above incantation to maximize the applicability of theorems.
+one (and they are not defeq as `(fun p : E Γ— F ↦ (p.1, p.2))` is not defeq to the identity).
+So, it is important to use the above incantation to maximize the applicability of theorems.
 
 ## Implementation notes
 
chore: Remove ball and bex from lemma names (#10816)

ball for "bounded forall" and bex for "bounded exists" are from experience very confusing abbreviations. This PR renames them to forall_mem and exists_mem in the few Set lemma names that mention them.

Also deprecate ball_image_of_ball, mem_image_elim, mem_image_elim_on since those lemmas are duplicates of the renamed lemmas (apart from argument order and implicitness, which I am also fixing by making the binder in the RHS of forall_mem_image semi-implicit), have obscure names and are completely unused.

Diff
@@ -1160,7 +1160,7 @@ only if `g` written in charts `f.extend I` and `f'.extend I'` is continuous on `
 theorem continuousOn_writtenInExtend_iff {f' : PartialHomeomorph M' H'} {g : M β†’ M'}
     (hs : s βŠ† f.source) (hmaps : MapsTo g s f'.source) :
     ContinuousOn (f'.extend I' ∘ g ∘ (f.extend I).symm) (f.extend I '' s) ↔ ContinuousOn g s := by
-  refine ball_image_iff.trans <| forallβ‚‚_congr fun x hx ↦ ?_
+  refine forall_mem_image.trans <| forallβ‚‚_congr fun x hx ↦ ?_
   refine (continuousWithinAt_congr_nhds ?_).trans
     (continuousWithinAt_writtenInExtend_iff _ _ _ (hs hx) (hmaps hx) hmaps)
   rw [← map_extend_nhdsWithin_eq_image_of_subset, ← map_extend_nhdsWithin]
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -137,7 +137,7 @@ scoped[Manifold] notation "∞" => (⊀ : β„•βˆž)
 model vector space `E` over the field `π•œ`. This is all what is needed to
 define a smooth manifold with model space `H`, and model vector space `E`.
 -/
-@[ext] -- porting note: was nolint has_nonempty_instance
+@[ext] -- Porting note: was nolint has_nonempty_instance
 structure ModelWithCorners (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*)
     [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type*) [TopologicalSpace H] extends
     PartialEquiv H E where
@@ -1188,7 +1188,7 @@ theorem extend_preimage_inter_eq :
   mfld_set_tac
 #align local_homeomorph.extend_preimage_inter_eq PartialHomeomorph.extend_preimage_inter_eq
 
--- porting note: an `aux` lemma that is no longer needed. Delete?
+-- Porting note: an `aux` lemma that is no longer needed. Delete?
 theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)]
       ((f.extend I).target ∩ (f.extend I).symm ⁻¹' s : Set _) := by
feat: Lemmas about (extChartAt I x).target being open if we're boundaryless (#10840)

(extChartAt I x).source is always open, so there are nice lemmas like

  1. isOpen_extChartAt_source
  2. extChartAt_source_mem_nhds
  3. extChartAt_source_mem_nhds'

(extChartAt I x).target fails to be open near manifold boundary points, but we recover the nice lemmas when I.Boundaryless.

Diff
@@ -1388,6 +1388,22 @@ theorem extChartAt_target_mem_nhdsWithin (x : M) :
   extChartAt_target_mem_nhdsWithin' I (mem_extChartAt_source I x)
 #align ext_chart_at_target_mem_nhds_within extChartAt_target_mem_nhdsWithin
 
+/-- If we're boundaryless, `extChartAt` has open target -/
+theorem isOpen_extChartAt_target [I.Boundaryless] (x : M) : IsOpen (extChartAt I x).target := by
+  simp_rw [extChartAt_target, I.range_eq_univ, inter_univ]
+  exact (PartialHomeomorph.open_target _).preimage I.continuous_symm
+
+/-- If we're boundaryless, `(extChartAt I x).target` is a neighborhood of the key point -/
+theorem extChartAt_target_mem_nhds [I.Boundaryless] (x : M) :
+    (extChartAt I x).target ∈ 𝓝 (extChartAt I x x) := by
+  convert extChartAt_target_mem_nhdsWithin I x
+  simp only [I.range_eq_univ, nhdsWithin_univ]
+
+/-- If we're boundaryless, `(extChartAt I x).target` is a neighborhood of any of its points -/
+theorem extChartAt_target_mem_nhds' [I.Boundaryless] {x : M} {y : E}
+    (m : y ∈ (extChartAt I x).target) : (extChartAt I x).target ∈ 𝓝 y :=
+  (isOpen_extChartAt_target I x).mem_nhds m
+
 theorem extChartAt_target_subset_range (x : M) : (extChartAt I x).target βŠ† range I := by
   simp only [mfld_simps]
 #align ext_chart_at_target_subset_range extChartAt_target_subset_range
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -1230,7 +1230,7 @@ theorem extend_coord_change_source_mem_nhdsWithin {x : E}
   rw [f.extend_coord_change_source] at hx ⊒
   obtain ⟨x, hx, rfl⟩ := hx
   refine' I.image_mem_nhdsWithin _
-  refine' (PartialHomeomorph.open_source _).mem_nhds hx
+  exact (PartialHomeomorph.open_source _).mem_nhds hx
 #align local_homeomorph.extend_coord_change_source_mem_nhds_within PartialHomeomorph.extend_coord_change_source_mem_nhdsWithin
 
 theorem extend_coord_change_source_mem_nhdsWithin' {x : M} (hxf : x ∈ f.source)
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -610,8 +610,8 @@ variable (n)
 theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
     PartialHomeomorph.ofSet s hs ∈ contDiffGroupoid n I := by
   rw [contDiffGroupoid, mem_groupoid_of_pregroupoid]
-  suffices h : ContDiffOn π•œ n (I ∘ I.symm) (I.symm ⁻¹' s ∩ range I)
-  Β· simp [h, contDiffPregroupoid]
+  suffices h : ContDiffOn π•œ n (I ∘ I.symm) (I.symm ⁻¹' s ∩ range I) by
+    simp [h, contDiffPregroupoid]
   have : ContDiffOn π•œ n id (univ : Set E) := contDiff_id.contDiffOn
   exact this.congr_mono (fun x hx => I.right_inv hx.2) (subset_univ _)
 #align of_set_mem_cont_diff_groupoid ofSet_mem_contDiffGroupoid
@@ -757,8 +757,8 @@ theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
   refine And.intro (ofSet_mem_contDiffGroupoid ∞ I hs) ?_
   apply mem_groupoid_of_pregroupoid.mpr
   suffices h : AnalyticOn π•œ (I ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
-      (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ I.symm) βŠ† interior (range I)
-  Β· simp only [PartialHomeomorph.ofSet_apply, id_comp, PartialHomeomorph.ofSet_toPartialEquiv,
+      (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ I.symm) βŠ† interior (range I) by
+    simp only [PartialHomeomorph.ofSet_apply, id_comp, PartialHomeomorph.ofSet_toPartialEquiv,
       PartialEquiv.ofSet_source, h, comp_apply, mem_range, image_subset_iff, true_and,
       PartialHomeomorph.ofSet_symm, PartialEquiv.ofSet_target, and_self]
     intro x hx
refactor(PartialHomeomorph): Remove explicit variable (x : M). (#10083)

Instead, supply it as needed.

This replaces an explicit argument (x : M) by an implicit {x : M} in the following lemmas:

  • extChartAt_source_mem_nhds'
  • extChartAt_source_mem_nhdsWithin'
  • continuousAt_extChartAt'
  • extChartAt_image_nhd_mem_nhds_of_boundaryless
  • extChartAt_target_mem_nhdsWithin'
  • nhdsWithin_extChartAt_target_eq'
  • continuousAt_extChartAt_symm'
  • continuousAt_extChartAt_symm''
  • map_extChartAt_nhdsWithin_eq_image'
  • map_extChartAt_nhdsWithin'
  • map_extChartAt_symm_nhdsWithin'
  • map_extChartAt_symm_nhdsWithin_range'
  • extChartAt_preimage_mem_nhdsWithin'
  • extChartAt_preimage_mem_nhdsWithin
  • extChartAt_preimage_mem_nhds'
  • extChartAt_preimage_mem_nhds

Co-authored-by: grunweg <grunweg@posteo.de>

Diff
@@ -940,7 +940,7 @@ open scoped Topology
 variable {π•œ E M H E' M' H' : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E]
   [NormedSpace π•œ E] [TopologicalSpace H] [TopologicalSpace M] (f f' : PartialHomeomorph M H)
   (I : ModelWithCorners π•œ E H) [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
-  [TopologicalSpace M'] (I' : ModelWithCorners π•œ E' H') (x : M) {s t : Set M}
+  [TopologicalSpace M'] (I' : ModelWithCorners π•œ E' H') {s t : Set M}
 
 /-!
 ### Extended charts
@@ -1282,27 +1282,27 @@ def extChartAt (x : M) : PartialEquiv M E :=
   (chartAt H x).extend I
 #align ext_chart_at extChartAt
 
-theorem extChartAt_coe : ⇑(extChartAt I x) = I ∘ chartAt H x :=
+theorem extChartAt_coe (x : M) : ⇑(extChartAt I x) = I ∘ chartAt H x :=
   rfl
 #align ext_chart_at_coe extChartAt_coe
 
-theorem extChartAt_coe_symm : ⇑(extChartAt I x).symm = (chartAt H x).symm ∘ I.symm :=
+theorem extChartAt_coe_symm (x : M) : ⇑(extChartAt I x).symm = (chartAt H x).symm ∘ I.symm :=
   rfl
 #align ext_chart_at_coe_symm extChartAt_coe_symm
 
-theorem extChartAt_source : (extChartAt I x).source = (chartAt H x).source :=
+theorem extChartAt_source (x : M) : (extChartAt I x).source = (chartAt H x).source :=
   extend_source _ _
 #align ext_chart_at_source extChartAt_source
 
-theorem isOpen_extChartAt_source : IsOpen (extChartAt I x).source :=
+theorem isOpen_extChartAt_source (x : M) : IsOpen (extChartAt I x).source :=
   isOpen_extend_source _ _
 #align is_open_ext_chart_at_source isOpen_extChartAt_source
 
-theorem mem_extChartAt_source : x ∈ (extChartAt I x).source := by
+theorem mem_extChartAt_source (x : M) : x ∈ (extChartAt I x).source := by
   simp only [extChartAt_source, mem_chart_source]
 #align mem_ext_chart_source mem_extChartAt_source
 
-theorem mem_extChartAt_target : extChartAt I x x ∈ (extChartAt I x).target :=
+theorem mem_extChartAt_target (x : M) : extChartAt I x x ∈ (extChartAt I x).target :=
   (extChartAt I x).map_source <| mem_extChartAt_source _ _
 
 theorem extChartAt_target (x : M) :
@@ -1318,44 +1318,44 @@ theorem uniqueDiffWithinAt_extChartAt_target (x : M) :
     UniqueDiffWithinAt π•œ (extChartAt I x).target (extChartAt I x x) :=
   uniqueDiffOn_extChartAt_target I x _ <| mem_extChartAt_target I x
 
-theorem extChartAt_to_inv : (extChartAt I x).symm ((extChartAt I x) x) = x :=
+theorem extChartAt_to_inv (x : M) : (extChartAt I x).symm ((extChartAt I x) x) = x :=
   (extChartAt I x).left_inv (mem_extChartAt_source I x)
 #align ext_chart_at_to_inv extChartAt_to_inv
 
-theorem mapsTo_extChartAt (hs : s βŠ† (chartAt H x).source) :
+theorem mapsTo_extChartAt {x : M} (hs : s βŠ† (chartAt H x).source) :
     MapsTo (extChartAt I x) s ((extChartAt I x).symm ⁻¹' s ∩ range I) :=
   mapsTo_extend _ _ hs
 #align maps_to_ext_chart_at mapsTo_extChartAt
 
-theorem extChartAt_source_mem_nhds' {x' : M} (h : x' ∈ (extChartAt I x).source) :
+theorem extChartAt_source_mem_nhds' {x x' : M} (h : x' ∈ (extChartAt I x).source) :
     (extChartAt I x).source ∈ 𝓝 x' :=
   extend_source_mem_nhds _ _ <| by rwa [← extChartAt_source I]
 #align ext_chart_at_source_mem_nhds' extChartAt_source_mem_nhds'
 
-theorem extChartAt_source_mem_nhds : (extChartAt I x).source ∈ 𝓝 x :=
-  extChartAt_source_mem_nhds' I x (mem_extChartAt_source I x)
+theorem extChartAt_source_mem_nhds (x : M) : (extChartAt I x).source ∈ 𝓝 x :=
+  extChartAt_source_mem_nhds' I (mem_extChartAt_source I x)
 #align ext_chart_at_source_mem_nhds extChartAt_source_mem_nhds
 
-theorem extChartAt_source_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source) :
+theorem extChartAt_source_mem_nhdsWithin' {x x' : M} (h : x' ∈ (extChartAt I x).source) :
     (extChartAt I x).source ∈ 𝓝[s] x' :=
-  mem_nhdsWithin_of_mem_nhds (extChartAt_source_mem_nhds' I x h)
+  mem_nhdsWithin_of_mem_nhds (extChartAt_source_mem_nhds' I h)
 #align ext_chart_at_source_mem_nhds_within' extChartAt_source_mem_nhdsWithin'
 
-theorem extChartAt_source_mem_nhdsWithin : (extChartAt I x).source ∈ 𝓝[s] x :=
+theorem extChartAt_source_mem_nhdsWithin (x : M) : (extChartAt I x).source ∈ 𝓝[s] x :=
   mem_nhdsWithin_of_mem_nhds (extChartAt_source_mem_nhds I x)
 #align ext_chart_at_source_mem_nhds_within extChartAt_source_mem_nhdsWithin
 
-theorem continuousOn_extChartAt : ContinuousOn (extChartAt I x) (extChartAt I x).source :=
+theorem continuousOn_extChartAt (x : M) : ContinuousOn (extChartAt I x) (extChartAt I x).source :=
   continuousOn_extend _ _
 #align continuous_on_ext_chart_at continuousOn_extChartAt
 
-theorem continuousAt_extChartAt' {x' : M} (h : x' ∈ (extChartAt I x).source) :
+theorem continuousAt_extChartAt' {x x' : M} (h : x' ∈ (extChartAt I x).source) :
     ContinuousAt (extChartAt I x) x' :=
   continuousAt_extend _ _ <| by rwa [← extChartAt_source I]
 #align continuous_at_ext_chart_at' continuousAt_extChartAt'
 
-theorem continuousAt_extChartAt : ContinuousAt (extChartAt I x) x :=
-  continuousAt_extChartAt' _ _ (mem_extChartAt_source I x)
+theorem continuousAt_extChartAt (x : M) : ContinuousAt (extChartAt I x) x :=
+  continuousAt_extChartAt' _ (mem_extChartAt_source I x)
 #align continuous_at_ext_chart_at continuousAt_extChartAt
 
 theorem map_extChartAt_nhds' {x y : M} (hy : y ∈ (extChartAt I x).source) :
@@ -1363,140 +1363,143 @@ theorem map_extChartAt_nhds' {x y : M} (hy : y ∈ (extChartAt I x).source) :
   map_extend_nhds _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_nhds' map_extChartAt_nhds'
 
-theorem map_extChartAt_nhds : map (extChartAt I x) (𝓝 x) = 𝓝[range I] extChartAt I x x :=
+theorem map_extChartAt_nhds (x : M) : map (extChartAt I x) (𝓝 x) = 𝓝[range I] extChartAt I x x :=
   map_extChartAt_nhds' I <| mem_extChartAt_source I x
 #align map_ext_chart_at_nhds map_extChartAt_nhds
 
-theorem map_extChartAt_nhds_of_boundaryless [I.Boundaryless] :
+theorem map_extChartAt_nhds_of_boundaryless [I.Boundaryless] (x : M) :
     map (extChartAt I x) (𝓝 x) = 𝓝 (extChartAt I x x) := by
   rw [extChartAt]
   exact map_extend_nhds_of_boundaryless (chartAt H x) I (mem_chart_source H x)
 
 variable {x} in
 theorem extChartAt_image_nhd_mem_nhds_of_boundaryless [I.Boundaryless]
-    (hx : s ∈ 𝓝 x) : extChartAt I x '' s ∈ 𝓝 (extChartAt I x x) := by
+    {x : M} (hx : s ∈ 𝓝 x) : extChartAt I x '' s ∈ 𝓝 (extChartAt I x x) := by
   rw [extChartAt]
   exact extend_image_nhd_mem_nhds_of_boundaryless _ I (mem_chart_source H x) hx
 
-theorem extChartAt_target_mem_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem extChartAt_target_mem_nhdsWithin' {x y : M} (hy : y ∈ (extChartAt I x).source) :
     (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x y :=
   extend_target_mem_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
 #align ext_chart_at_target_mem_nhds_within' extChartAt_target_mem_nhdsWithin'
 
-theorem extChartAt_target_mem_nhdsWithin : (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x x :=
-  extChartAt_target_mem_nhdsWithin' I x (mem_extChartAt_source I x)
+theorem extChartAt_target_mem_nhdsWithin (x : M) :
+    (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x x :=
+  extChartAt_target_mem_nhdsWithin' I (mem_extChartAt_source I x)
 #align ext_chart_at_target_mem_nhds_within extChartAt_target_mem_nhdsWithin
 
-theorem extChartAt_target_subset_range : (extChartAt I x).target βŠ† range I := by
+theorem extChartAt_target_subset_range (x : M) : (extChartAt I x).target βŠ† range I := by
   simp only [mfld_simps]
 #align ext_chart_at_target_subset_range extChartAt_target_subset_range
 
-theorem nhdsWithin_extChartAt_target_eq' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem nhdsWithin_extChartAt_target_eq' {x y : M} (hy : y ∈ (extChartAt I x).source) :
     𝓝[(extChartAt I x).target] extChartAt I x y = 𝓝[range I] extChartAt I x y :=
   nhdsWithin_extend_target_eq _ _ <| by rwa [← extChartAt_source I]
 #align nhds_within_ext_chart_at_target_eq' nhdsWithin_extChartAt_target_eq'
 
-theorem nhdsWithin_extChartAt_target_eq :
+theorem nhdsWithin_extChartAt_target_eq (x : M) :
     𝓝[(extChartAt I x).target] (extChartAt I x) x = 𝓝[range I] (extChartAt I x) x :=
-  nhdsWithin_extChartAt_target_eq' I x (mem_extChartAt_source I x)
+  nhdsWithin_extChartAt_target_eq' I (mem_extChartAt_source I x)
 #align nhds_within_ext_chart_at_target_eq nhdsWithin_extChartAt_target_eq
 
-theorem continuousAt_extChartAt_symm'' {y : E} (h : y ∈ (extChartAt I x).target) :
+theorem continuousAt_extChartAt_symm'' {x : M} {y : E} (h : y ∈ (extChartAt I x).target) :
     ContinuousAt (extChartAt I x).symm y :=
   continuousAt_extend_symm' _ _ h
 #align continuous_at_ext_chart_at_symm'' continuousAt_extChartAt_symm''
 
-theorem continuousAt_extChartAt_symm' {x' : M} (h : x' ∈ (extChartAt I x).source) :
+theorem continuousAt_extChartAt_symm' {x x' : M} (h : x' ∈ (extChartAt I x).source) :
     ContinuousAt (extChartAt I x).symm (extChartAt I x x') :=
-  continuousAt_extChartAt_symm'' I _ <| (extChartAt I x).map_source h
+  continuousAt_extChartAt_symm'' I <| (extChartAt I x).map_source h
 #align continuous_at_ext_chart_at_symm' continuousAt_extChartAt_symm'
 
-theorem continuousAt_extChartAt_symm : ContinuousAt (extChartAt I x).symm ((extChartAt I x) x) :=
-  continuousAt_extChartAt_symm' I x (mem_extChartAt_source I x)
+theorem continuousAt_extChartAt_symm (x : M) :
+    ContinuousAt (extChartAt I x).symm ((extChartAt I x) x) :=
+  continuousAt_extChartAt_symm' I (mem_extChartAt_source I x)
 #align continuous_at_ext_chart_at_symm continuousAt_extChartAt_symm
 
-theorem continuousOn_extChartAt_symm : ContinuousOn (extChartAt I x).symm (extChartAt I x).target :=
-  fun _y hy => (continuousAt_extChartAt_symm'' _ _ hy).continuousWithinAt
+theorem continuousOn_extChartAt_symm (x : M) :
+    ContinuousOn (extChartAt I x).symm (extChartAt I x).target :=
+  fun _y hy => (continuousAt_extChartAt_symm'' _ hy).continuousWithinAt
 #align continuous_on_ext_chart_at_symm continuousOn_extChartAt_symm
 
-theorem isOpen_extChartAt_preimage' {s : Set E} (hs : IsOpen s) :
+theorem isOpen_extChartAt_preimage' (x : M) {s : Set E} (hs : IsOpen s) :
     IsOpen ((extChartAt I x).source ∩ extChartAt I x ⁻¹' s) :=
   isOpen_extend_preimage' _ _ hs
 #align is_open_ext_chart_at_preimage' isOpen_extChartAt_preimage'
 
-theorem isOpen_extChartAt_preimage {s : Set E} (hs : IsOpen s) :
+theorem isOpen_extChartAt_preimage (x : M) {s : Set E} (hs : IsOpen s) :
     IsOpen ((chartAt H x).source ∩ extChartAt I x ⁻¹' s) := by
   rw [← extChartAt_source I]
   exact isOpen_extChartAt_preimage' I x hs
 #align is_open_ext_chart_at_preimage isOpen_extChartAt_preimage
 
-theorem map_extChartAt_nhdsWithin_eq_image' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem map_extChartAt_nhdsWithin_eq_image' {x y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x) (𝓝[s] y) =
       𝓝[extChartAt I x '' ((extChartAt I x).source ∩ s)] extChartAt I x y :=
   map_extend_nhdsWithin_eq_image _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_nhds_within_eq_image' map_extChartAt_nhdsWithin_eq_image'
 
-theorem map_extChartAt_nhdsWithin_eq_image :
+theorem map_extChartAt_nhdsWithin_eq_image (x : M) :
     map (extChartAt I x) (𝓝[s] x) =
       𝓝[extChartAt I x '' ((extChartAt I x).source ∩ s)] extChartAt I x x :=
-  map_extChartAt_nhdsWithin_eq_image' I x (mem_extChartAt_source I x)
+  map_extChartAt_nhdsWithin_eq_image' I (mem_extChartAt_source I x)
 #align map_ext_chart_at_nhds_within_eq_image map_extChartAt_nhdsWithin_eq_image
 
-theorem map_extChartAt_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem map_extChartAt_nhdsWithin' {x y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x) (𝓝[s] y) = 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x y :=
   map_extend_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_nhds_within' map_extChartAt_nhdsWithin'
 
-theorem map_extChartAt_nhdsWithin :
+theorem map_extChartAt_nhdsWithin (x : M) :
     map (extChartAt I x) (𝓝[s] x) = 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x x :=
-  map_extChartAt_nhdsWithin' I x (mem_extChartAt_source I x)
+  map_extChartAt_nhdsWithin' I (mem_extChartAt_source I x)
 #align map_ext_chart_at_nhds_within map_extChartAt_nhdsWithin
 
-theorem map_extChartAt_symm_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem map_extChartAt_symm_nhdsWithin' {x y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x).symm (𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x y) =
       𝓝[s] y :=
   map_extend_symm_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_symm_nhds_within' map_extChartAt_symm_nhdsWithin'
 
-theorem map_extChartAt_symm_nhdsWithin_range' {y : M} (hy : y ∈ (extChartAt I x).source) :
+theorem map_extChartAt_symm_nhdsWithin_range' {x y : M} (hy : y ∈ (extChartAt I x).source) :
     map (extChartAt I x).symm (𝓝[range I] extChartAt I x y) = 𝓝 y :=
   map_extend_symm_nhdsWithin_range _ _ <| by rwa [← extChartAt_source I]
 #align map_ext_chart_at_symm_nhds_within_range' map_extChartAt_symm_nhdsWithin_range'
 
-theorem map_extChartAt_symm_nhdsWithin :
+theorem map_extChartAt_symm_nhdsWithin (x : M) :
     map (extChartAt I x).symm (𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] extChartAt I x x) =
       𝓝[s] x :=
-  map_extChartAt_symm_nhdsWithin' I x (mem_extChartAt_source I x)
+  map_extChartAt_symm_nhdsWithin' I (mem_extChartAt_source I x)
 #align map_ext_chart_at_symm_nhds_within map_extChartAt_symm_nhdsWithin
 
-theorem map_extChartAt_symm_nhdsWithin_range :
+theorem map_extChartAt_symm_nhdsWithin_range (x : M) :
     map (extChartAt I x).symm (𝓝[range I] extChartAt I x x) = 𝓝 x :=
-  map_extChartAt_symm_nhdsWithin_range' I x (mem_extChartAt_source I x)
+  map_extChartAt_symm_nhdsWithin_range' I (mem_extChartAt_source I x)
 #align map_ext_chart_at_symm_nhds_within_range map_extChartAt_symm_nhdsWithin_range
 
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 in the source is a neighborhood of the preimage, within a set. -/
-theorem extChartAt_preimage_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source)
+theorem extChartAt_preimage_mem_nhdsWithin' {x x' : M} (h : x' ∈ (extChartAt I x).source)
     (ht : t ∈ 𝓝[s] x') :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x' := by
-  rwa [← map_extChartAt_symm_nhdsWithin' I x h, mem_map] at ht
+  rwa [← map_extChartAt_symm_nhdsWithin' I h, mem_map] at ht
 #align ext_chart_at_preimage_mem_nhds_within' extChartAt_preimage_mem_nhdsWithin'
 
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of the
 base point is a neighborhood of the preimage, within a set. -/
-theorem extChartAt_preimage_mem_nhdsWithin (ht : t ∈ 𝓝[s] x) :
+theorem extChartAt_preimage_mem_nhdsWithin {x : M} (ht : t ∈ 𝓝[s] x) :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x :=
-  extChartAt_preimage_mem_nhdsWithin' I x (mem_extChartAt_source I x) ht
+  extChartAt_preimage_mem_nhdsWithin' I (mem_extChartAt_source I x) ht
 #align ext_chart_at_preimage_mem_nhds_within extChartAt_preimage_mem_nhdsWithin
 
-theorem extChartAt_preimage_mem_nhds' {x' : M} (h : x' ∈ (extChartAt I x).source) (ht : t ∈ 𝓝 x') :
-    (extChartAt I x).symm ⁻¹' t ∈ 𝓝 (extChartAt I x x') :=
+theorem extChartAt_preimage_mem_nhds' {x x' : M} (h : x' ∈ (extChartAt I x).source)
+    (ht : t ∈ 𝓝 x') : (extChartAt I x).symm ⁻¹' t ∈ 𝓝 (extChartAt I x x') :=
   extend_preimage_mem_nhds _ _ (by rwa [← extChartAt_source I]) ht
 #align ext_chart_at_preimage_mem_nhds' extChartAt_preimage_mem_nhds'
 
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 is a neighborhood of the preimage. -/
-theorem extChartAt_preimage_mem_nhds (ht : t ∈ 𝓝 x) :
+theorem extChartAt_preimage_mem_nhds {x : M} (ht : t ∈ 𝓝 x) :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝 ((extChartAt I x) x) := by
   apply (continuousAt_extChartAt_symm I x).preimage_mem_nhds
   rwa [(extChartAt I x).left_inv (mem_extChartAt_source _ _)]
@@ -1504,7 +1507,7 @@ theorem extChartAt_preimage_mem_nhds (ht : t ∈ 𝓝 x) :
 
 /-- Technical lemma to rewrite suitably the preimage of an intersection under an extended chart, to
 bring it into a convenient form to apply derivative lemmas. -/
-theorem extChartAt_preimage_inter_eq :
+theorem extChartAt_preimage_inter_eq (x : M) :
     (extChartAt I x).symm ⁻¹' (s ∩ t) ∩ range I =
       (extChartAt I x).symm ⁻¹' s ∩ range I ∩ (extChartAt I x).symm ⁻¹' t :=
   by mfld_set_tac
chore: make (x : M) implicit in extChartAt_image_nhd_mem_nhds_of_boundaryless (#10081)

Fixes an oversight in #10001: x is already included in the hypothesis hx, so should be implicit. A follow-up PR will address this issue more systematically.

Diff
@@ -1372,10 +1372,11 @@ theorem map_extChartAt_nhds_of_boundaryless [I.Boundaryless] :
   rw [extChartAt]
   exact map_extend_nhds_of_boundaryless (chartAt H x) I (mem_chart_source H x)
 
+variable {x} in
 theorem extChartAt_image_nhd_mem_nhds_of_boundaryless [I.Boundaryless]
-    (h : s ∈ 𝓝 x) : extChartAt I x '' s ∈ 𝓝 (extChartAt I x x) := by
+    (hx : s ∈ 𝓝 x) : extChartAt I x '' s ∈ 𝓝 (extChartAt I x x) := by
   rw [extChartAt]
-  exact extend_image_nhd_mem_nhds_of_boundaryless _ I (mem_chart_source H x) h
+  exact extend_image_nhd_mem_nhds_of_boundaryless _ I (mem_chart_source H x) hx
 
 theorem extChartAt_target_mem_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x y :=
doc: @[inherit_doc] on notations (#9942)

Make all the notations that unambiguously should inherit the docstring of their definition actually inherit it.

Also write a few docstrings by hand. I only wrote the ones I was competent to write and which I was sure of. Some docstrings come from mathlib3 as they were lost during the early port.

This PR is only intended as a first pass There are many more docstrings to add.

Diff
@@ -159,7 +159,9 @@ def modelWithCornersSelf (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type
   continuous_invFun := continuous_id
 #align model_with_corners_self modelWithCornersSelf
 
-scoped[Manifold] notation "π“˜(" π•œ ", " E ")" => modelWithCornersSelf π•œ E
+@[inherit_doc] scoped[Manifold] notation "π“˜(" π•œ ", " E ")" => modelWithCornersSelf π•œ E
+
+/-- A normed field is a model with corners. -/
 scoped[Manifold] notation "π“˜(" π•œ ")" => modelWithCornersSelf π•œ π•œ
 
 section
feat: four small lemmas about extended charts (#10001)

From sphere-eversion; I'm just submitting them.

Diff
@@ -1025,12 +1025,21 @@ theorem map_extend_nhds {x : M} (hy : x ∈ f.source) :
   rwa [extend_coe, comp_apply, ← I.map_nhds_eq, ← f.map_nhds_eq, map_map]
 #align local_homeomorph.map_extend_nhds PartialHomeomorph.map_extend_nhds
 
+theorem map_extend_nhds_of_boundaryless [I.Boundaryless] {x : M} (hx : x ∈ f.source) :
+    map (f.extend I) (𝓝 x) = 𝓝 (f.extend I x) := by
+  rw [f.map_extend_nhds _ hx, I.range_eq_univ, nhdsWithin_univ]
+
 theorem extend_target_mem_nhdsWithin {y : M} (hy : y ∈ f.source) :
     (f.extend I).target ∈ 𝓝[range I] f.extend I y := by
   rw [← PartialEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
   exact image_mem_map (extend_source_mem_nhds _ _ hy)
 #align local_homeomorph.extend_target_mem_nhds_within PartialHomeomorph.extend_target_mem_nhdsWithin
 
+theorem extend_image_nhd_mem_nhds_of_boundaryless [I.Boundaryless] {x} (hx : x ∈ f.source)
+    {s : Set M} (h : s ∈ 𝓝 x) : (f.extend I) '' s ∈ 𝓝 ((f.extend I) x) := by
+  rw [← f.map_extend_nhds_of_boundaryless _ hx, Filter.mem_map]
+  filter_upwards [h] using subset_preimage_image (f.extend I) s
+
 theorem extend_target_subset_range : (f.extend I).target βŠ† range I := by simp only [mfld_simps]
 #align local_homeomorph.extend_target_subset_range PartialHomeomorph.extend_target_subset_range
 
@@ -1356,6 +1365,16 @@ theorem map_extChartAt_nhds : map (extChartAt I x) (𝓝 x) = 𝓝[range I] extC
   map_extChartAt_nhds' I <| mem_extChartAt_source I x
 #align map_ext_chart_at_nhds map_extChartAt_nhds
 
+theorem map_extChartAt_nhds_of_boundaryless [I.Boundaryless] :
+    map (extChartAt I x) (𝓝 x) = 𝓝 (extChartAt I x x) := by
+  rw [extChartAt]
+  exact map_extend_nhds_of_boundaryless (chartAt H x) I (mem_chart_source H x)
+
+theorem extChartAt_image_nhd_mem_nhds_of_boundaryless [I.Boundaryless]
+    (h : s ∈ 𝓝 x) : extChartAt I x '' s ∈ 𝓝 (extChartAt I x x) := by
+  rw [extChartAt]
+  exact extend_image_nhd_mem_nhds_of_boundaryless _ I (mem_chart_source H x) h
+
 theorem extChartAt_target_mem_nhdsWithin' {y : M} (hy : y ∈ (extChartAt I x).source) :
     (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x y :=
   extend_target_mem_nhdsWithin _ _ <| by rwa [← extChartAt_source I]
feat: add PartialHomeomorph.extend_target' (#9977)

Inspired by sphere-eversion; similar to PartialEquiv.image_source_eq_target.

Diff
@@ -980,6 +980,9 @@ theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I
   simp_rw [extend, PartialEquiv.trans_target, I.target_eq, I.toPartialEquiv_coe_symm, inter_comm]
 #align local_homeomorph.extend_target PartialHomeomorph.extend_target
 
+theorem extend_target' : (f.extend I).target = I '' f.target := by
+  rw [extend, PartialEquiv.trans_target'', I.source_eq, univ_inter, I.toPartialEquiv_coe]
+
 lemma isOpen_extend_target [I.Boundaryless] : IsOpen (f.extend I).target := by
   rw [extend_target, I.range_eq_univ, inter_univ]
   exact I.continuous_symm.isOpen_preimage _ f.open_target
chore: rename StructureGroupoid.eq_on_source' to StructureGroupoid.mem_of_eqOnSource' (#9802)

Since it refers to PartialEquiv.EqOnSource, the correct naming scheme should not be snake case eq_on_source. I also added mem_of_ because that's the target of the lemma, while EqOnSource is just a hypothesis.

There are no added lemmas or docstrings in this PR. It's all just renaming.

Diff
@@ -620,7 +620,7 @@ theorem symm_trans_mem_contDiffGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ contDiffGroupoid n I :=
   haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
     PartialHomeomorph.symm_trans_self _
-  StructureGroupoid.eq_on_source _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
+  StructureGroupoid.mem_of_eqOnSource _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
 #align symm_trans_mem_cont_diff_groupoid symm_trans_mem_contDiffGroupoid
 
 variable {E' H' : Type*} [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
@@ -650,7 +650,7 @@ instance : ClosedUnderRestriction (contDiffGroupoid n I) :=
     (by
       apply StructureGroupoid.le_iff.mpr
       rintro e ⟨s, hs, hes⟩
-      apply (contDiffGroupoid n I).eq_on_source' _ _ _ hes
+      apply (contDiffGroupoid n I).mem_of_eqOnSource' _ _ _ hes
       exact ofSet_mem_contDiffGroupoid n I hs)
 
 end contDiffGroupoid
@@ -780,7 +780,7 @@ theorem symm_trans_mem_analyticGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ analyticGroupoid I :=
   haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
     PartialHomeomorph.symm_trans_self _
-  StructureGroupoid.eq_on_source _ (ofSet_mem_analyticGroupoid I e.open_target) this
+  StructureGroupoid.mem_of_eqOnSource _ (ofSet_mem_analyticGroupoid I e.open_target) this
 
 /-- The analytic groupoid is closed under restriction. -/
 instance : ClosedUnderRestriction (analyticGroupoid I) :=
@@ -788,7 +788,7 @@ instance : ClosedUnderRestriction (analyticGroupoid I) :=
     (by
       apply StructureGroupoid.le_iff.mpr
       rintro e ⟨s, hs, hes⟩
-      apply (analyticGroupoid I).eq_on_source' _ _ _ hes
+      apply (analyticGroupoid I).mem_of_eqOnSource' _ _ _ hes
       exact ofSet_mem_analyticGroupoid I hs)
 
 /-- The analytic groupoid on a boundaryless charted space modeled on a complete vector space
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -6,9 +6,10 @@ Authors: SΓ©bastien GouΓ«zel
 import Mathlib.Analysis.Analytic.Basic
 import Mathlib.Analysis.Analytic.Composition
 import Mathlib.Analysis.Analytic.Linear
-import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension
 import Mathlib.Analysis.Calculus.FDeriv.Analytic
 import Mathlib.Geometry.Manifold.ChartedSpace
+import Mathlib.Analysis.NormedSpace.FiniteDimension
+import Mathlib.Analysis.Calculus.ContDiff.Basic
 
 #align_import geometry.manifold.smooth_manifold_with_corners from "leanprover-community/mathlib"@"ddec54a71a0dd025c05445d467f1a2b7d586a3ba"
 
chore: last localEquiv -> partialEquiv renames in lemma names (#9620)
Diff
@@ -374,9 +374,9 @@ variable (π•œ E)
 
 /-- In the trivial model with corners, the associated `PartialEquiv` is the identity. -/
 @[simp, mfld_simps]
-theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toPartialEquiv = PartialEquiv.refl E :=
+theorem modelWithCornersSelf_partialEquiv : π“˜(π•œ, E).toPartialEquiv = PartialEquiv.refl E :=
   rfl
-#align model_with_corners_self_local_equiv modelWithCornersSelf_localEquiv
+#align model_with_corners_self_local_equiv modelWithCornersSelf_partialEquiv
 
 @[simp, mfld_simps]
 theorem modelWithCornersSelf_coe : (π“˜(π•œ, E) : E β†’ E) = id :=
refactor: extract and name the pregroupoid underlying contDiffGroupoid (#9091)

This will be used for proving the inverse function theorem on manifolds.

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: grunweg <grunweg@posteo.de>

Diff
@@ -529,46 +529,48 @@ variable {m n : β„•βˆž} {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*
 
 variable (n)
 
-/-- Given a model with corners `(E, H)`, we define the groupoid of `C^n` transformations of `H` as
-the maps that are `C^n` when read in `E` through `I`. -/
+/-- Given a model with corners `(E, H)`, we define the pregroupoid of `C^n` transformations of `H`
+as the maps that are `C^n` when read in `E` through `I`. -/
+def contDiffPregroupoid : Pregroupoid H where
+  property f s := ContDiffOn π•œ n (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I)
+  comp {f g u v} hf hg _ _ _ := by
+    have : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
+    simp only [this]
+    refine hg.comp (hf.mono fun x ⟨hx1, hx2⟩ ↦ ⟨hx1.1, hx2⟩) ?_
+    rintro x ⟨hx1, _⟩
+    simp only [mfld_simps] at hx1 ⊒
+    exact hx1.2
+  id_mem := by
+    apply ContDiffOn.congr contDiff_id.contDiffOn
+    rintro x ⟨_, hx2⟩
+    rcases mem_range.1 hx2 with ⟨y, hy⟩
+    rw [← hy]
+    simp only [mfld_simps]
+  locality {f u} _ H := by
+    apply contDiffOn_of_locally_contDiffOn
+    rintro y ⟨hy1, hy2⟩
+    rcases mem_range.1 hy2 with ⟨x, hx⟩
+    rw [← hx] at hy1 ⊒
+    simp only [mfld_simps] at hy1 ⊒
+    rcases H x hy1 with ⟨v, v_open, xv, hv⟩
+    have : I.symm ⁻¹' (u ∩ v) ∩ range I = I.symm ⁻¹' u ∩ range I ∩ I.symm ⁻¹' v := by
+      rw [preimage_inter, inter_assoc, inter_assoc]
+      congr 1
+      rw [inter_comm]
+    rw [this] at hv
+    exact ⟨I.symm ⁻¹' v, v_open.preimage I.continuous_symm, by simpa, hv⟩
+  congr {f g u} _ fg hf := by
+    apply hf.congr
+    rintro y ⟨hy1, hy2⟩
+    rcases mem_range.1 hy2 with ⟨x, hx⟩
+    rw [← hx] at hy1 ⊒
+    simp only [mfld_simps] at hy1 ⊒
+    rw [fg _ hy1]
+
+/-- Given a model with corners `(E, H)`, we define the groupoid of invertible `C^n` transformations
+  of `H` as the invertible maps that are `C^n` when read in `E` through `I`. -/
 def contDiffGroupoid : StructureGroupoid H :=
-  Pregroupoid.groupoid
-    { property := fun f s => ContDiffOn π•œ n (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I)
-      comp := fun {f g u v} hf hg _ _ _ => by
-        have : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
-        simp only [this]
-        refine hg.comp (hf.mono ?_) ?_
-        · rintro x ⟨hx1, hx2⟩
-          exact ⟨hx1.1, hx2⟩
-        · rintro x ⟨hx1, _⟩
-          simp only [mfld_simps] at hx1 ⊒
-          exact hx1.2
-      id_mem := by
-        apply ContDiffOn.congr contDiff_id.contDiffOn
-        rintro x ⟨_, hx2⟩
-        rcases mem_range.1 hx2 with ⟨y, hy⟩
-        rw [← hy]
-        simp only [mfld_simps]
-      locality := fun {f u} _ H => by
-        apply contDiffOn_of_locally_contDiffOn
-        rintro y ⟨hy1, hy2⟩
-        rcases mem_range.1 hy2 with ⟨x, hx⟩
-        rw [← hx] at hy1 ⊒
-        simp only [mfld_simps] at hy1 ⊒
-        rcases H x hy1 with ⟨v, v_open, xv, hv⟩
-        have : I.symm ⁻¹' (u ∩ v) ∩ range I = I.symm ⁻¹' u ∩ range I ∩ I.symm ⁻¹' v := by
-          rw [preimage_inter, inter_assoc, inter_assoc]
-          congr 1
-          rw [inter_comm]
-        rw [this] at hv
-        exact ⟨I.symm ⁻¹' v, v_open.preimage I.continuous_symm, by simpa, hv⟩
-      congr := fun {f g u} _ fg hf => by
-        apply hf.congr
-        rintro y ⟨hy1, hy2⟩
-        rcases mem_range.1 hy2 with ⟨x, hx⟩
-        rw [← hx] at hy1 ⊒
-        simp only [mfld_simps] at hy1 ⊒
-        rw [fg _ hy1] }
+  Pregroupoid.groupoid (contDiffPregroupoid n I)
 #align cont_diff_groupoid contDiffGroupoid
 
 variable {n}
@@ -590,7 +592,7 @@ theorem contDiffGroupoid_zero_eq : contDiffGroupoid 0 I = continuousGroupoid H :
   -- we have to check that every partial homeomorphism belongs to `contDiffGroupoid 0 I`,
   -- by unfolding its definition
   change u ∈ contDiffGroupoid 0 I
-  rw [contDiffGroupoid, mem_groupoid_of_pregroupoid]
+  rw [contDiffGroupoid, mem_groupoid_of_pregroupoid, contDiffPregroupoid]
   simp only [contDiffOn_zero]
   constructor
   Β· refine' I.continuous.comp_continuousOn (u.continuousOn.comp I.continuousOn_symm _)
@@ -606,7 +608,7 @@ theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
     PartialHomeomorph.ofSet s hs ∈ contDiffGroupoid n I := by
   rw [contDiffGroupoid, mem_groupoid_of_pregroupoid]
   suffices h : ContDiffOn π•œ n (I ∘ I.symm) (I.symm ⁻¹' s ∩ range I)
-  Β· simp [h]
+  Β· simp [h, contDiffPregroupoid]
   have : ContDiffOn π•œ n id (univ : Set E) := contDiff_id.contDiffOn
   exact this.congr_mono (fun x hx => I.right_inv hx.2) (subset_univ _)
 #align of_set_mem_cont_diff_groupoid ofSet_mem_contDiffGroupoid
@@ -629,7 +631,8 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
   cases' he with he he_symm
   cases' he' with he' he'_symm
   simp only at he he_symm he' he'_symm
-  constructor <;> simp only [PartialEquiv.prod_source, PartialHomeomorph.prod_toPartialEquiv]
+  constructor <;> simp only [PartialEquiv.prod_source, PartialHomeomorph.prod_toPartialEquiv,
+    contDiffPregroupoid]
   Β· have h3 := ContDiffOn.prod_map he he'
     rw [← I.image_eq, ← I'.image_eq, prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
@@ -801,7 +804,7 @@ theorem mem_analyticGroupoid_of_boundaryless [CompleteSpace E] [I.Boundaryless]
   Β· intro he
     apply And.intro
     all_goals apply mem_groupoid_of_pregroupoid.mpr; simp only [I.image_eq, I.range_eq_univ,
-      interior_univ, subset_univ, and_true] at he ⊒
+      interior_univ, subset_univ, and_true, contDiffPregroupoid] at he ⊒
     · exact ⟨he.left.contDiffOn, he.right.contDiffOn⟩
     Β· exact he
 
chore(Analysis,Geometry): remove almost all autoImplicit (#9691)

After this PR, no file in Geometry uses autoImplicit, and in Analysis it's scoped to six declarations.

Diff
@@ -119,9 +119,6 @@ derivative will be `mfderiv I I' f`, instead of the more natural notations `Tang
 real and complex manifolds).
 -/
 
-set_option autoImplicit true
-
-
 noncomputable section
 
 universe u v w u' v' w'
@@ -1115,8 +1112,8 @@ theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
   rw [← nhdsWithin_univ, ← map_extend_symm_nhdsWithin f I hy, preimage_univ, univ_inter]
 #align local_homeomorph.map_extend_symm_nhds_within_range PartialHomeomorph.map_extend_symm_nhdsWithin_range
 
-theorem tendsto_extend_comp_iff {l : Filter Ξ±} {g : Ξ± β†’ M} (hg : βˆ€αΆ  z in l, g z ∈ f.source)
-    (hy : y ∈ f.source) :
+theorem tendsto_extend_comp_iff {Ξ± : Type*} {l : Filter Ξ±} {g : Ξ± β†’ M}
+    (hg : βˆ€αΆ  z in l, g z ∈ f.source) {y : M} (hy : y ∈ f.source) :
     Tendsto (f.extend I ∘ g) l (𝓝 (f.extend I y)) ↔ Tendsto g l (𝓝 y) := by
   refine ⟨fun h u hu ↦ mem_map.2 ?_, (continuousAt_extend _ _ hy).tendsto.comp⟩
   have := (f.continuousAt_extend_symm I hy).tendsto.comp h
@@ -1125,7 +1122,7 @@ theorem tendsto_extend_comp_iff {l : Filter Ξ±} {g : Ξ± β†’ M} (hg : βˆ€αΆ  z in
   simpa only [(· ∘ ·), extend_left_inv _ _ hz, mem_preimage] using hzu
 
 -- there is no definition `writtenInExtend` but we already use some made-up names in this file
-theorem continuousWithinAt_writtenInExtend_iff {f' : PartialHomeomorph M' H'} {g : M β†’ M'}
+theorem continuousWithinAt_writtenInExtend_iff {f' : PartialHomeomorph M' H'} {g : M β†’ M'} {y : M}
     (hy : y ∈ f.source) (hgy : g y ∈ f'.source) (hmaps : MapsTo g s f'.source) :
     ContinuousWithinAt (f'.extend I' ∘ g ∘ (f.extend I).symm)
       ((f.extend I).symm ⁻¹' s ∩ range I) (f.extend I y) ↔ ContinuousWithinAt g s y := by
chore(Function): rename some lemmas (#9738)
  • Merge Function.left_id and Function.comp.left_id into Function.id_comp.
  • Merge Function.right_id and Function.comp.right_id into Function.comp_id.
  • Merge Function.comp_const_right and Function.comp_const into Function.comp_const, use explicit arguments.
  • Move Function.const_comp to Mathlib.Init.Function, use explicit arguments.
Diff
@@ -711,7 +711,7 @@ def analyticGroupoid : StructureGroupoid H :=
             (f := (1 : E β†’L[π•œ] E)) (fun x _ => (1 : E β†’L[π•œ] E).analyticAt x)
             (fun z hz => (I.right_inv (interior_subset hz)).symm)
         Β· intro x hx
-          simp only [left_id, comp_apply, preimage_univ, univ_inter, mem_image] at hx
+          simp only [id_comp, comp_apply, preimage_univ, univ_inter, mem_image] at hx
           rcases hx with ⟨y, hy⟩
           rw [← hy.right, I.right_inv (interior_subset hy.left)]
           exact hy.left
@@ -755,7 +755,7 @@ theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
   apply mem_groupoid_of_pregroupoid.mpr
   suffices h : AnalyticOn π•œ (I ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
       (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ I.symm) βŠ† interior (range I)
-  Β· simp only [PartialHomeomorph.ofSet_apply, left_id, PartialHomeomorph.ofSet_toPartialEquiv,
+  Β· simp only [PartialHomeomorph.ofSet_apply, id_comp, PartialHomeomorph.ofSet_toPartialEquiv,
       PartialEquiv.ofSet_source, h, comp_apply, mem_range, image_subset_iff, true_and,
       PartialHomeomorph.ofSet_symm, PartialEquiv.ofSet_target, and_self]
     intro x hx
chore(Geometry/Manifold): use dot notation for IsOpen lemmas more (#9567)

While at it, switch from refine' to refine (easy cases only) in the lines I'm touching anyway.

Diff
@@ -765,7 +765,7 @@ theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
   apply And.intro
   Β· have : AnalyticOn π•œ (1 : E β†’L[π•œ] E) (univ : Set E) := (fun x _ => (1 : E β†’L[π•œ] E).analyticAt x)
     exact (this.mono (subset_univ (s.preimage (I.symm) ∩ interior (range I)))).congr
-      (IsOpen.inter (hs.preimage I.continuous_symm) isOpen_interior)
+      ((hs.preimage I.continuous_symm).inter isOpen_interior)
       fun z hz => (I.right_inv (interior_subset hz.right)).symm
   Β· intro x hx
     simp only [comp_apply, mem_image] at hx
chore(LocallyCompact): rename the "of basis" constructor (#9327)

Rename locallyCompactSpace_of_hasBasis to LocallyCompactSpace.of_hasBasis to allow the new-style dot notation.

Diff
@@ -357,7 +357,7 @@ protected theorem locallyCompactSpace [LocallyCompactSpace E] (I : ModelWithCorn
       fun s => I.symm '' (s ∩ range I) := fun x ↦ by
     rw [← I.symm_map_nhdsWithin_range]
     exact ((compact_basis_nhds (I x)).inf_principal _).map _
-  refine' locallyCompactSpace_of_hasBasis this _
+  refine' .of_hasBasis this _
   rintro x s ⟨-, hsc⟩
   exact (hsc.inter_right I.closed_range).image I.continuous_symm
 #align model_with_corners.locally_compact ModelWithCorners.locallyCompactSpace
chore: rename in PartialEquiv, Homeomorph, PartialHomeomorph (#9430)

Items 4-5 in reference Zulip

Also added symm and trans definitions for PartialEquiv, Homeomorph, and PartialHomeomorph.

Diff
@@ -619,7 +619,7 @@ the `C^n` groupoid. -/
 theorem symm_trans_mem_contDiffGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ contDiffGroupoid n I :=
   haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
-    PartialHomeomorph.trans_symm_self _
+    PartialHomeomorph.symm_trans_self _
   StructureGroupoid.eq_on_source _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
 #align symm_trans_mem_cont_diff_groupoid symm_trans_mem_contDiffGroupoid
 
@@ -778,7 +778,7 @@ the analytic groupoid. -/
 theorem symm_trans_mem_analyticGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ analyticGroupoid I :=
   haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
-    PartialHomeomorph.trans_symm_self _
+    PartialHomeomorph.symm_trans_self _
   StructureGroupoid.eq_on_source _ (ofSet_mem_analyticGroupoid I e.open_target) this
 
 /-- The analytic groupoid is closed under restriction. -/
feat: Boundaryless manifold (#9323)

This is a more general notion of boundaryless manifold than ModelWithCorners.Boundaryless, which requires the ModelWithCorners to map to the whole model vector space.

To justify this new type class, consider the interior of a manifold with non-empty boundary. It inherits a manifold structure via its embedding, and it would be convenient to use the same ModelWithCorners for the interior as for the whole space. Even though the interior is boundaryless, its inherited ModelWithCorners doesn't satisfy ModelWithCorners.Boundaryless.

Diff
@@ -478,7 +478,9 @@ end ModelWithCornersProd
 
 section Boundaryless
 
-/-- Property ensuring that the model with corners `I` defines manifolds without boundary. -/
+/-- Property ensuring that the model with corners `I` defines manifolds without boundary. This
+  differs from the more general `BoundarylessManifold`, which requires every point on the manifold
+  to be an interior point.  -/
 class ModelWithCorners.Boundaryless {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
     [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) : Prop where
refactor(*): change definition of Set.image2 etc (#9275)
  • Redefine Set.image2 to use βˆƒ a ∈ s, βˆƒ b ∈ t, f a b = c instead of βˆƒ a b, a ∈ s ∧ b ∈ t ∧ f a b = c.
  • Redefine Set.seq as Set.image2. The new definition is equal to the old one but rw [Set.seq] gives a different result.
  • Redefine Filter.mapβ‚‚ to use βˆƒ u ∈ f, βˆƒ v ∈ g, image2 m u v βŠ† s instead of βˆƒ u v, u ∈ f ∧ v ∈ g ∧ ...
  • Update lemmas like Set.mem_image2, Finset.mem_imageβ‚‚, Set.mem_mul, Finset.mem_div etc

The two reasons to make the change are:

  • βˆƒ a ∈ s, βˆƒ b ∈ t, _ is a simp-normal form, and
  • it looks a bit nicer.
Diff
@@ -889,7 +889,7 @@ instance prod {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedA
     [SmoothManifoldWithCorners I M] (M' : Type*) [TopologicalSpace M'] [ChartedSpace H' M']
     [SmoothManifoldWithCorners I' M'] : SmoothManifoldWithCorners (I.prod I') (M Γ— M') where
   compatible := by
-    rintro f g ⟨f1, f2, hf1, hf2, rfl⟩ ⟨g1, g2, hg1, hg2, rfl⟩
+    rintro f g ⟨f1, hf1, f2, hf2, rfl⟩ ⟨g1, hg1, g2, hg2, rfl⟩
     rw [PartialHomeomorph.prod_symm, PartialHomeomorph.prod_trans]
     have h1 := (contDiffGroupoid ⊀ I).compatible hf1 hg1
     have h2 := (contDiffGroupoid ⊀ I').compatible hf2 hg2
chore: audit remaining uses of "local homeomorphism" in comments (#9245)

Almost all of them should speak about partial homeomorphisms instead. In two cases, I decided removing the "local" was clearer than adding "partial".

Follow-up to #8982; complements #9238.

Diff
@@ -37,7 +37,7 @@ but add these assumptions later as needed. (Quite a few results still do not req
 * `modelWithCornersSelf π•œ E` :
   trivial model with corners structure on the space `E` embedded in itself by the identity.
 * `contDiffGroupoid n I` :
-  when `I` is a model with corners on `(π•œ, E, H)`, this is the groupoid of local homeos of `H`
+  when `I` is a model with corners on `(π•œ, E, H)`, this is the groupoid of partial homeos of `H`
   which are of class `C^n` over the normed field `π•œ`, when read in `E`.
 * `SmoothManifoldWithCorners I M` :
   a type class saying that the charted space `M`, modelled on the space `H`, has `C^∞` changes of
@@ -46,8 +46,9 @@ but add these assumptions later as needed. (Quite a few results still do not req
 * `extChartAt I x`:
   in a smooth manifold with corners with the model `I` on `(E, H)`, the charts take values in `H`,
   but often we may want to use their `E`-valued version, obtained by composing the charts with `I`.
-  Since the target is in general not open, we can not register them as local homeomorphisms, but
-  we register them as local equivs. `extChartAt I x` is the canonical such local equiv around `x`.
+  Since the target is in general not open, we can not register them as partial homeomorphisms, but
+  we register them as `PartialEquiv`s.
+  `extChartAt I x` is the canonical such partial equiv around `x`.
 
 As specific examples of models with corners, we define (in the file `real_instances.lean`)
 * `modelWithCornersSelf ℝ (EuclideanSpace (Fin n))` for the model space used to define
@@ -177,7 +178,7 @@ switch to this behavior later, doing it mid-port will break a lot of proofs. -/
 
 instance : CoeFun (ModelWithCorners π•œ E H) fun _ => H β†’ E := ⟨toFun'⟩
 
-/-- The inverse to a model with corners, only registered as a local equiv. -/
+/-- The inverse to a model with corners, only registered as a `PartialEquiv`. -/
 protected def symm : PartialEquiv E H :=
   I.toPartialEquiv.symm
 #align model_with_corners.symm ModelWithCorners.symm
@@ -374,7 +375,7 @@ section
 
 variable (π•œ E)
 
-/-- In the trivial model with corners, the associated local equiv is the identity. -/
+/-- In the trivial model with corners, the associated `PartialEquiv` is the identity. -/
 @[simp, mfld_simps]
 theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toPartialEquiv = PartialEquiv.refl E :=
   rfl
@@ -583,11 +584,11 @@ theorem contDiffGroupoid_le (h : m ≀ n) : contDiffGroupoid n I ≀ contDiffGro
 #align cont_diff_groupoid_le contDiffGroupoid_le
 
 /-- The groupoid of `0`-times continuously differentiable maps is just the groupoid of all
-local homeomorphisms -/
+partial homeomorphisms -/
 theorem contDiffGroupoid_zero_eq : contDiffGroupoid 0 I = continuousGroupoid H := by
   apply le_antisymm le_top
   intro u _
-  -- we have to check that every local homeomorphism belongs to `contDiffGroupoid 0 I`,
+  -- we have to check that every partial homeomorphism belongs to `contDiffGroupoid 0 I`,
   -- by unfolding its definition
   change u ∈ contDiffGroupoid 0 I
   rw [contDiffGroupoid, mem_groupoid_of_pregroupoid]
@@ -601,7 +602,7 @@ theorem contDiffGroupoid_zero_eq : contDiffGroupoid 0 I = continuousGroupoid H :
 
 variable (n)
 
-/-- An identity local homeomorphism belongs to the `C^n` groupoid. -/
+/-- An identity partial homeomorphism belongs to the `C^n` groupoid. -/
 theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
     PartialHomeomorph.ofSet s hs ∈ contDiffGroupoid n I := by
   rw [contDiffGroupoid, mem_groupoid_of_pregroupoid]
@@ -611,7 +612,7 @@ theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
   exact this.congr_mono (fun x hx => I.right_inv hx.2) (subset_univ _)
 #align of_set_mem_cont_diff_groupoid ofSet_mem_contDiffGroupoid
 
-/-- The composition of a local homeomorphism from `H` to `M` and its inverse belongs to
+/-- The composition of a partial homeomorphism from `H` to `M` and its inverse belongs to
 the `C^n` groupoid. -/
 theorem symm_trans_mem_contDiffGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ contDiffGroupoid n I :=
@@ -622,7 +623,7 @@ theorem symm_trans_mem_contDiffGroupoid (e : PartialHomeomorph M H) :
 
 variable {E' H' : Type*} [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
 
-/-- The product of two smooth local homeomorphisms is smooth. -/
+/-- The product of two smooth partial homeomorphisms is smooth. -/
 theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCorners π•œ E' H'}
     {e : PartialHomeomorph H H} {e' : PartialHomeomorph H' H'} (he : e ∈ contDiffGroupoid ⊀ I)
     (he' : e' ∈ contDiffGroupoid ⊀ I') : e.prod e' ∈ contDiffGroupoid ⊀ (I.prod I') := by
@@ -744,7 +745,7 @@ def analyticGroupoid : StructureGroupoid H :=
           rw [comp_apply, comp_apply, fg (I.symm y) hy.left.left] at hy
           exact hy.right }
 
-/-- An identity local homeomorphism belongs to the analytic groupoid. -/
+/-- An identity partial homeomorphism belongs to the analytic groupoid. -/
 theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
     PartialHomeomorph.ofSet s hs ∈ analyticGroupoid I := by
   rw [analyticGroupoid]
@@ -770,7 +771,7 @@ theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
     rw [← hy.right, I.right_inv (interior_subset hy.left.right)]
     exact hy.left.right
 
-/-- The composition of a local homeomorphism from `H` to `M` and its inverse belongs to
+/-- The composition of a partial homeomorphism from `H` to `M` and its inverse belongs to
 the analytic groupoid. -/
 theorem symm_trans_mem_analyticGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ analyticGroupoid I :=
@@ -788,7 +789,7 @@ instance : ClosedUnderRestriction (analyticGroupoid I) :=
       exact ofSet_mem_analyticGroupoid I hs)
 
 /-- The analytic groupoid on a boundaryless charted space modeled on a complete vector space
-consists of the local homeomorphisms which are analytic and have analytic inverse. -/
+consists of the partial homeomorphisms which are analytic and have analytic inverse. -/
 theorem mem_analyticGroupoid_of_boundaryless [CompleteSpace E] [I.Boundaryless]
     (e : PartialHomeomorph H H) :
     e ∈ analyticGroupoid I ↔ AnalyticOn π•œ (I ∘ e ∘ I.symm) (I '' e.source) ∧
feat: interior and boundary of a manifold (#8624)

We use the standard definition, with respect to the preferred charts at each point.

Open-ness of the interior is non-trivial, hence left to a future PR:

  • for instance, in finite dimensions this requires e.g. knowing the homology of spheres, which mathlib doesn't yet have.

Co-authored-by: Winston Yin <winstonyin@gmail.com>

Diff
@@ -976,6 +976,10 @@ theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I
   simp_rw [extend, PartialEquiv.trans_target, I.target_eq, I.toPartialEquiv_coe_symm, inter_comm]
 #align local_homeomorph.extend_target PartialHomeomorph.extend_target
 
+lemma isOpen_extend_target [I.Boundaryless] : IsOpen (f.extend I).target := by
+  rw [extend_target, I.range_eq_univ, inter_univ]
+  exact I.continuous_symm.isOpen_preimage _ f.open_target
+
 theorem mapsTo_extend (hs : s βŠ† f.source) :
     MapsTo (f.extend I) s ((f.extend I).symm ⁻¹' s ∩ range I) := by
   rw [mapsTo', extend_coe, extend_coe_symm, preimage_comp, ← I.image_eq, image_comp,
@@ -1023,6 +1027,19 @@ theorem extend_target_mem_nhdsWithin {y : M} (hy : y ∈ f.source) :
 theorem extend_target_subset_range : (f.extend I).target βŠ† range I := by simp only [mfld_simps]
 #align local_homeomorph.extend_target_subset_range PartialHomeomorph.extend_target_subset_range
 
+lemma interior_extend_target_subset_interior_range :
+    interior (f.extend I).target βŠ† interior (range I) := by
+  rw [f.extend_target, interior_inter, (f.open_target.preimage I.continuous_symm).interior_eq]
+  exact inter_subset_right _ _
+
+/-- If `y ∈ f.target` and `I y ∈ interior (range I)`,
+  then `I y` is an interior point of `(I ∘ f).target`. -/
+lemma mem_interior_extend_target {y : H} (hy : y ∈ f.target)
+    (hy' : I y ∈ interior (range I)) : I y ∈ interior (f.extend I).target := by
+  rw [f.extend_target, interior_inter, (f.open_target.preimage I.continuous_symm).interior_eq,
+    mem_inter_iff, mem_preimage]
+  exact ⟨mem_of_eq_of_mem (I.left_inv (y)) hy, hy'⟩
+
 theorem nhdsWithin_extend_target_eq {y : M} (hy : y ∈ f.source) :
     𝓝[(f.extend I).target] f.extend I y = 𝓝[range I] f.extend I y :=
   (nhdsWithin_mono _ (extend_target_subset_range _ _)).antisymm <|
chore: rename LocalEquiv to PartialEquiv (#8984)

The current name is misleading: there's no open set involved; it's just an equivalence between subsets of domain and target. zulip discussion

PEquiv is similarly named: this is fine, as they're different designs for the same concept.

Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>

Diff
@@ -141,9 +141,9 @@ define a smooth manifold with model space `H`, and model vector space `E`.
 @[ext] -- porting note: was nolint has_nonempty_instance
 structure ModelWithCorners (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*)
     [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type*) [TopologicalSpace H] extends
-    LocalEquiv H E where
+    PartialEquiv H E where
   source_eq : source = univ
-  unique_diff' : UniqueDiffOn π•œ toLocalEquiv.target
+  unique_diff' : UniqueDiffOn π•œ toPartialEquiv.target
   continuous_toFun : Continuous toFun := by continuity
   continuous_invFun : Continuous invFun := by continuity
 #align model_with_corners ModelWithCorners
@@ -153,7 +153,7 @@ attribute [simp, mfld_simps] ModelWithCorners.source_eq
 /-- A vector space is a model with corners. -/
 def modelWithCornersSelf (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*)
     [NormedAddCommGroup E] [NormedSpace π•œ E] : ModelWithCorners π•œ E E where
-  toLocalEquiv := LocalEquiv.refl E
+  toPartialEquiv := PartialEquiv.refl E
   source_eq := rfl
   unique_diff' := uniqueDiffOn_univ
   continuous_toFun := continuous_id
@@ -171,15 +171,15 @@ variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCom
 namespace ModelWithCorners
 
 /-- Coercion of a model with corners to a function. We don't use `e.toFun` because it is actually
-`e.toLocalEquiv.toFun`, so `simp` will apply lemmas about `toLocalEquiv`. While we may want to
+`e.toPartialEquiv.toFun`, so `simp` will apply lemmas about `toPartialEquiv`. While we may want to
 switch to this behavior later, doing it mid-port will break a lot of proofs. -/
 @[coe] def toFun' (e : ModelWithCorners π•œ E H) : H β†’ E := e.toFun
 
 instance : CoeFun (ModelWithCorners π•œ E H) fun _ => H β†’ E := ⟨toFun'⟩
 
 /-- The inverse to a model with corners, only registered as a local equiv. -/
-protected def symm : LocalEquiv E H :=
-  I.toLocalEquiv.symm
+protected def symm : PartialEquiv E H :=
+  I.toPartialEquiv.symm
 #align model_with_corners.symm ModelWithCorners.symm
 
 /-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
@@ -199,23 +199,23 @@ initialize_simps_projections ModelWithCorners (toFun β†’ apply, invFun β†’ symm_
 
 -- Register a few lemmas to make sure that `simp` puts expressions in normal form
 @[simp, mfld_simps]
-theorem toLocalEquiv_coe : (I.toLocalEquiv : H β†’ E) = I :=
+theorem toPartialEquiv_coe : (I.toPartialEquiv : H β†’ E) = I :=
   rfl
-#align model_with_corners.to_local_equiv_coe ModelWithCorners.toLocalEquiv_coe
+#align model_with_corners.to_local_equiv_coe ModelWithCorners.toPartialEquiv_coe
 
 @[simp, mfld_simps]
-theorem mk_coe (e : LocalEquiv H E) (a b c d) :
+theorem mk_coe (e : PartialEquiv H E) (a b c d) :
     ((ModelWithCorners.mk e a b c d : ModelWithCorners π•œ E H) : H β†’ E) = (e : H β†’ E) :=
   rfl
 #align model_with_corners.mk_coe ModelWithCorners.mk_coe
 
 @[simp, mfld_simps]
-theorem toLocalEquiv_coe_symm : (I.toLocalEquiv.symm : E β†’ H) = I.symm :=
+theorem toPartialEquiv_coe_symm : (I.toPartialEquiv.symm : E β†’ H) = I.symm :=
   rfl
-#align model_with_corners.to_local_equiv_coe_symm ModelWithCorners.toLocalEquiv_coe_symm
+#align model_with_corners.to_local_equiv_coe_symm ModelWithCorners.toPartialEquiv_coe_symm
 
 @[simp, mfld_simps]
-theorem mk_symm (e : LocalEquiv H E) (a b c d) :
+theorem mk_symm (e : PartialEquiv H E) (a b c d) :
     (ModelWithCorners.mk e a b c d : ModelWithCorners π•œ E H).symm = e.symm :=
   rfl
 #align model_with_corners.mk_symm ModelWithCorners.mk_symm
@@ -291,9 +291,9 @@ theorem preimage_image (s : Set H) : I ⁻¹' (I '' s) = s :=
 #align model_with_corners.preimage_image ModelWithCorners.preimage_image
 
 protected theorem image_eq (s : Set H) : I '' s = I.symm ⁻¹' s ∩ range I := by
-  refine' (I.toLocalEquiv.image_eq_target_inter_inv_preimage _).trans _
+  refine' (I.toPartialEquiv.image_eq_target_inter_inv_preimage _).trans _
   Β· rw [I.source_eq]; exact subset_univ _
-  Β· rw [inter_comm, I.target_eq, I.toLocalEquiv_coe_symm]
+  Β· rw [inter_comm, I.target_eq, I.toPartialEquiv_coe_symm]
 #align model_with_corners.image_eq ModelWithCorners.image_eq
 
 protected theorem closedEmbedding : ClosedEmbedding I :=
@@ -376,7 +376,7 @@ variable (π•œ E)
 
 /-- In the trivial model with corners, the associated local equiv is the identity. -/
 @[simp, mfld_simps]
-theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toLocalEquiv = LocalEquiv.refl E :=
+theorem modelWithCornersSelf_localEquiv : π“˜(π•œ, E).toPartialEquiv = PartialEquiv.refl E :=
   rfl
 #align model_with_corners_self_local_equiv modelWithCornersSelf_localEquiv
 
@@ -407,7 +407,7 @@ def ModelWithCorners.prod {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Ty
     (I : ModelWithCorners π•œ E H) {E' : Type v'} [NormedAddCommGroup E'] [NormedSpace π•œ E']
     {H' : Type w'} [TopologicalSpace H'] (I' : ModelWithCorners π•œ E' H') :
     ModelWithCorners π•œ (E Γ— E') (ModelProd H H') :=
-  { I.toLocalEquiv.prod I'.toLocalEquiv with
+  { I.toPartialEquiv.prod I'.toPartialEquiv with
     toFun := fun x => (I x.1, I' x.2)
     invFun := fun x => (I.symm x.1, I'.symm x.2)
     source := { x | x.1 ∈ I.source ∧ x.2 ∈ I'.source }
@@ -424,7 +424,7 @@ def ModelWithCorners.pi {π•œ : Type u} [NontriviallyNormedField π•œ] {ΞΉ : Typ
     {E : ΞΉ β†’ Type w} [βˆ€ i, NormedAddCommGroup (E i)] [βˆ€ i, NormedSpace π•œ (E i)] {H : ΞΉ β†’ Type u'}
     [βˆ€ i, TopologicalSpace (H i)] (I : βˆ€ i, ModelWithCorners π•œ (E i) (H i)) :
     ModelWithCorners π•œ (βˆ€ i, E i) (ModelPi H) where
-  toLocalEquiv := LocalEquiv.pi fun i => (I i).toLocalEquiv
+  toPartialEquiv := PartialEquiv.pi fun i => (I i).toPartialEquiv
   source_eq := by simp only [pi_univ, mfld_simps]
   unique_diff' := UniqueDiffOn.pi ΞΉ E _ _ fun i _ => (I i).unique_diff'
   continuous_toFun := continuous_pi fun i => (I i).continuous.comp (continuous_apply i)
@@ -448,10 +448,10 @@ variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCom
   {J : ModelWithCorners π•œ F G}
 
 @[simp, mfld_simps]
-theorem modelWithCorners_prod_toLocalEquiv :
-    (I.prod J).toLocalEquiv = I.toLocalEquiv.prod J.toLocalEquiv :=
+theorem modelWithCorners_prod_toPartialEquiv :
+    (I.prod J).toPartialEquiv = I.toPartialEquiv.prod J.toPartialEquiv :=
   rfl
-#align model_with_corners_prod_to_local_equiv modelWithCorners_prod_toLocalEquiv
+#align model_with_corners_prod_to_local_equiv modelWithCorners_prod_toPartialEquiv
 
 @[simp, mfld_simps]
 theorem modelWithCorners_prod_coe (I : ModelWithCorners π•œ E H) (I' : ModelWithCorners π•œ E' H') :
@@ -629,7 +629,7 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
   cases' he with he he_symm
   cases' he' with he' he'_symm
   simp only at he he_symm he' he'_symm
-  constructor <;> simp only [LocalEquiv.prod_source, PartialHomeomorph.prod_toLocalEquiv]
+  constructor <;> simp only [PartialEquiv.prod_source, PartialHomeomorph.prod_toPartialEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
     rw [← I.image_eq, ← I'.image_eq, prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
@@ -752,9 +752,9 @@ theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
   apply mem_groupoid_of_pregroupoid.mpr
   suffices h : AnalyticOn π•œ (I ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
       (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ I.symm) βŠ† interior (range I)
-  Β· simp only [PartialHomeomorph.ofSet_apply, left_id, PartialHomeomorph.ofSet_toLocalEquiv,
-      LocalEquiv.ofSet_source, h, comp_apply, mem_range, image_subset_iff, true_and,
-      PartialHomeomorph.ofSet_symm, LocalEquiv.ofSet_target, and_self]
+  Β· simp only [PartialHomeomorph.ofSet_apply, left_id, PartialHomeomorph.ofSet_toPartialEquiv,
+      PartialEquiv.ofSet_source, h, comp_apply, mem_range, image_subset_iff, true_and,
+      PartialHomeomorph.ofSet_symm, PartialEquiv.ofSet_target, and_self]
     intro x hx
     refine mem_preimage.mpr ?_
     rw [← I.right_inv (interior_subset hx.right)] at hx
@@ -942,7 +942,7 @@ variable {π•œ E M H E' M' H' : Type*} [NontriviallyNormedField π•œ] [NormedAdd
 In a smooth manifold with corners, the model space is the space `H`. However, we will also
 need to use extended charts taking values in the model vector space `E`. These extended charts are
 not `PartialHomeomorph` as the target is not open in `E` in general, but we can still register them
-as `LocalEquiv`.
+as `PartialEquiv`.
 -/
 
 
@@ -951,8 +951,8 @@ namespace PartialHomeomorph
 /-- Given a chart `f` on a manifold with corners, `f.extend I` is the extended chart to the model
 vector space. -/
 @[simp, mfld_simps]
-def extend : LocalEquiv M E :=
-  f.toLocalEquiv ≫ I.toLocalEquiv
+def extend : PartialEquiv M E :=
+  f.toPartialEquiv ≫ I.toPartialEquiv
 #align local_homeomorph.extend PartialHomeomorph.extend
 
 theorem extend_coe : ⇑(f.extend I) = I ∘ f :=
@@ -964,7 +964,7 @@ theorem extend_coe_symm : ⇑(f.extend I).symm = f.symm ∘ I.symm :=
 #align local_homeomorph.extend_coe_symm PartialHomeomorph.extend_coe_symm
 
 theorem extend_source : (f.extend I).source = f.source := by
-  rw [extend, LocalEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
+  rw [extend, PartialEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
 #align local_homeomorph.extend_source PartialHomeomorph.extend_source
 
 theorem isOpen_extend_source : IsOpen (f.extend I).source := by
@@ -973,7 +973,7 @@ theorem isOpen_extend_source : IsOpen (f.extend I).source := by
 #align local_homeomorph.is_open_extend_source PartialHomeomorph.isOpen_extend_source
 
 theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I := by
-  simp_rw [extend, LocalEquiv.trans_target, I.target_eq, I.toLocalEquiv_coe_symm, inter_comm]
+  simp_rw [extend, PartialEquiv.trans_target, I.target_eq, I.toPartialEquiv_coe_symm, inter_comm]
 #align local_homeomorph.extend_target PartialHomeomorph.extend_target
 
 theorem mapsTo_extend (hs : s βŠ† f.source) :
@@ -1016,7 +1016,7 @@ theorem map_extend_nhds {x : M} (hy : x ∈ f.source) :
 
 theorem extend_target_mem_nhdsWithin {y : M} (hy : y ∈ f.source) :
     (f.extend I).target ∈ 𝓝[range I] f.extend I y := by
-  rw [← LocalEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
+  rw [← PartialEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
   exact image_mem_map (extend_source_mem_nhds _ _ hy)
 #align local_homeomorph.extend_target_mem_nhds_within PartialHomeomorph.extend_target_mem_nhdsWithin
 
@@ -1178,7 +1178,7 @@ theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs :
 
 theorem extend_coord_change_source :
     ((f.extend I).symm ≫ f'.extend I).source = I '' (f.symm ≫ₕ f').source := by
-  simp_rw [LocalEquiv.trans_source, I.image_eq, extend_source, LocalEquiv.symm_source,
+  simp_rw [PartialEquiv.trans_source, I.image_eq, extend_source, PartialEquiv.symm_source,
     extend_target, inter_right_comm _ (range I)]
   rfl
 #align local_homeomorph.extend_coord_change_source PartialHomeomorph.extend_coord_change_source
@@ -1243,7 +1243,7 @@ variable [ChartedSpace H M] [ChartedSpace H' M']
 /-- The preferred extended chart on a manifold with corners around a point `x`, from a neighborhood
 of `x` to the model vector space. -/
 @[simp, mfld_simps]
-def extChartAt (x : M) : LocalEquiv M E :=
+def extChartAt (x : M) : PartialEquiv M E :=
   (chartAt H x).extend I
 #align ext_chart_at extChartAt
 
@@ -1530,7 +1530,7 @@ theorem extChartAt_self_apply {x y : H} : extChartAt I x y = I y :=
 
 /-- In the case of the manifold structure on a vector space, the extended charts are just the
 identity.-/
-theorem extChartAt_model_space_eq_id (x : E) : extChartAt π“˜(π•œ, E) x = LocalEquiv.refl E := by
+theorem extChartAt_model_space_eq_id (x : E) : extChartAt π“˜(π•œ, E) x = PartialEquiv.refl E := by
   simp only [mfld_simps]
 #align ext_chart_at_model_space_eq_id extChartAt_model_space_eq_id
 
@@ -1543,15 +1543,15 @@ variable {π•œ}
 theorem extChartAt_prod (x : M Γ— M') :
     extChartAt (I.prod I') x = (extChartAt I x.1).prod (extChartAt I' x.2) := by
   simp only [mfld_simps]
-  -- Porting note: `simp` can't use `LocalEquiv.prod_trans` here because of a type
+  -- Porting note: `simp` can't use `PartialEquiv.prod_trans` here because of a type
   -- synonym
-  rw [LocalEquiv.prod_trans]
+  rw [PartialEquiv.prod_trans]
 #align ext_chart_at_prod extChartAt_prod
 
 theorem extChartAt_comp [ChartedSpace H H'] (x : M') :
     (letI := ChartedSpace.comp H H' M'; extChartAt I x) =
-      (chartAt H' x).toLocalEquiv ≫ extChartAt I (chartAt H' x x) :=
-  LocalEquiv.trans_assoc ..
+      (chartAt H' x).toPartialEquiv ≫ extChartAt I (chartAt H' x x) :=
+  PartialEquiv.trans_assoc ..
 
 theorem writtenInExtChartAt_chartAt_comp [ChartedSpace H H'] (x : M') {y}
     (hy : y ∈ letI := ChartedSpace.comp H H' M'; (extChartAt I x).target) :
chore: rename LocalHomeomorph to PartialHomeomorph (#8982)

LocalHomeomorph evokes a "local homeomorphism": this is not what this means. Instead, this is a homeomorphism on an open set of the domain (extended to the whole space, by the junk value pattern). Hence, partial homeomorphism is more appropriate, and avoids confusion with IsLocallyHomeomorph.

A future PR will rename LocalEquiv to PartialEquiv.

Zulip discussion

Diff
@@ -330,7 +330,7 @@ theorem unique_diff_preimage {s : Set H} (hs : IsOpen s) :
   exact I.unique_diff.inter (hs.preimage I.continuous_invFun)
 #align model_with_corners.unique_diff_preimage ModelWithCorners.unique_diff_preimage
 
-theorem unique_diff_preimage_source {Ξ² : Type*} [TopologicalSpace Ξ²] {e : LocalHomeomorph H Ξ²} :
+theorem unique_diff_preimage_source {Ξ² : Type*} [TopologicalSpace Ξ²] {e : PartialHomeomorph H Ξ²} :
     UniqueDiffOn π•œ (I.symm ⁻¹' e.source ∩ range I) :=
   I.unique_diff_preimage e.open_source
 #align model_with_corners.unique_diff_preimage_source ModelWithCorners.unique_diff_preimage_source
@@ -603,7 +603,7 @@ variable (n)
 
 /-- An identity local homeomorphism belongs to the `C^n` groupoid. -/
 theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
-    LocalHomeomorph.ofSet s hs ∈ contDiffGroupoid n I := by
+    PartialHomeomorph.ofSet s hs ∈ contDiffGroupoid n I := by
   rw [contDiffGroupoid, mem_groupoid_of_pregroupoid]
   suffices h : ContDiffOn π•œ n (I ∘ I.symm) (I.symm ⁻¹' s ∩ range I)
   Β· simp [h]
@@ -613,10 +613,10 @@ theorem ofSet_mem_contDiffGroupoid {s : Set H} (hs : IsOpen s) :
 
 /-- The composition of a local homeomorphism from `H` to `M` and its inverse belongs to
 the `C^n` groupoid. -/
-theorem symm_trans_mem_contDiffGroupoid (e : LocalHomeomorph M H) :
+theorem symm_trans_mem_contDiffGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ contDiffGroupoid n I :=
-  haveI : e.symm.trans e β‰ˆ LocalHomeomorph.ofSet e.target e.open_target :=
-    LocalHomeomorph.trans_symm_self _
+  haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
+    PartialHomeomorph.trans_symm_self _
   StructureGroupoid.eq_on_source _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
 #align symm_trans_mem_cont_diff_groupoid symm_trans_mem_contDiffGroupoid
 
@@ -624,12 +624,12 @@ variable {E' H' : Type*} [NormedAddCommGroup E'] [NormedSpace π•œ E'] [Topologi
 
 /-- The product of two smooth local homeomorphisms is smooth. -/
 theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCorners π•œ E' H'}
-    {e : LocalHomeomorph H H} {e' : LocalHomeomorph H' H'} (he : e ∈ contDiffGroupoid ⊀ I)
+    {e : PartialHomeomorph H H} {e' : PartialHomeomorph H' H'} (he : e ∈ contDiffGroupoid ⊀ I)
     (he' : e' ∈ contDiffGroupoid ⊀ I') : e.prod e' ∈ contDiffGroupoid ⊀ (I.prod I') := by
   cases' he with he he_symm
   cases' he' with he' he'_symm
   simp only at he he_symm he' he'_symm
-  constructor <;> simp only [LocalEquiv.prod_source, LocalHomeomorph.prod_toLocalEquiv]
+  constructor <;> simp only [LocalEquiv.prod_source, PartialHomeomorph.prod_toLocalEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
     rw [← I.image_eq, ← I'.image_eq, prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
@@ -746,15 +746,15 @@ def analyticGroupoid : StructureGroupoid H :=
 
 /-- An identity local homeomorphism belongs to the analytic groupoid. -/
 theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
-    LocalHomeomorph.ofSet s hs ∈ analyticGroupoid I := by
+    PartialHomeomorph.ofSet s hs ∈ analyticGroupoid I := by
   rw [analyticGroupoid]
   refine And.intro (ofSet_mem_contDiffGroupoid ∞ I hs) ?_
   apply mem_groupoid_of_pregroupoid.mpr
   suffices h : AnalyticOn π•œ (I ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
       (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ I.symm) βŠ† interior (range I)
-  Β· simp only [LocalHomeomorph.ofSet_apply, left_id, LocalHomeomorph.ofSet_toLocalEquiv,
+  Β· simp only [PartialHomeomorph.ofSet_apply, left_id, PartialHomeomorph.ofSet_toLocalEquiv,
       LocalEquiv.ofSet_source, h, comp_apply, mem_range, image_subset_iff, true_and,
-      LocalHomeomorph.ofSet_symm, LocalEquiv.ofSet_target, and_self]
+      PartialHomeomorph.ofSet_symm, LocalEquiv.ofSet_target, and_self]
     intro x hx
     refine mem_preimage.mpr ?_
     rw [← I.right_inv (interior_subset hx.right)] at hx
@@ -772,10 +772,10 @@ theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
 
 /-- The composition of a local homeomorphism from `H` to `M` and its inverse belongs to
 the analytic groupoid. -/
-theorem symm_trans_mem_analyticGroupoid (e : LocalHomeomorph M H) :
+theorem symm_trans_mem_analyticGroupoid (e : PartialHomeomorph M H) :
     e.symm.trans e ∈ analyticGroupoid I :=
-  haveI : e.symm.trans e β‰ˆ LocalHomeomorph.ofSet e.target e.open_target :=
-    LocalHomeomorph.trans_symm_self _
+  haveI : e.symm.trans e β‰ˆ PartialHomeomorph.ofSet e.target e.open_target :=
+    PartialHomeomorph.trans_symm_self _
   StructureGroupoid.eq_on_source _ (ofSet_mem_analyticGroupoid I e.open_target) this
 
 /-- The analytic groupoid is closed under restriction. -/
@@ -790,7 +790,7 @@ instance : ClosedUnderRestriction (analyticGroupoid I) :=
 /-- The analytic groupoid on a boundaryless charted space modeled on a complete vector space
 consists of the local homeomorphisms which are analytic and have analytic inverse. -/
 theorem mem_analyticGroupoid_of_boundaryless [CompleteSpace E] [I.Boundaryless]
-    (e : LocalHomeomorph H H) :
+    (e : PartialHomeomorph H H) :
     e ∈ analyticGroupoid I ↔ AnalyticOn π•œ (I ∘ e ∘ I.symm) (I '' e.source) ∧
     AnalyticOn π•œ (I ∘ e.symm ∘ I.symm) (I '' e.target) := by
   apply Iff.intro
@@ -830,7 +830,7 @@ theorem SmoothManifoldWithCorners.mk' {π•œ : Type*} [NontriviallyNormedField 
 theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type*} [NontriviallyNormedField π•œ]
     {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) (M : Type*) [TopologicalSpace M] [ChartedSpace H M]
-    (h : βˆ€ e e' : LocalHomeomorph M H, e ∈ atlas H M β†’ e' ∈ atlas H M β†’
+    (h : βˆ€ e e' : PartialHomeomorph M H, e ∈ atlas H M β†’ e' ∈ atlas H M β†’
       ContDiffOn π•œ ⊀ (I ∘ e.symm ≫ₕ e' ∘ I.symm) (I.symm ⁻¹' (e.symm ≫ₕ e').source ∩ range I)) :
     SmoothManifoldWithCorners I M where
   compatible := by
@@ -875,7 +875,7 @@ theorem chart_mem_maximalAtlas [SmoothManifoldWithCorners I M] (x : M) :
 
 variable {I}
 
-theorem compatible_of_mem_maximalAtlas {e e' : LocalHomeomorph M H} (he : e ∈ maximalAtlas I M)
+theorem compatible_of_mem_maximalAtlas {e e' : PartialHomeomorph M H} (he : e ∈ maximalAtlas I M)
     (he' : e' ∈ maximalAtlas I M) : e.symm.trans e' ∈ contDiffGroupoid ∞ I :=
   StructureGroupoid.compatible_of_mem_maximalAtlas he he'
 #align smooth_manifold_with_corners.compatible_of_mem_maximal_atlas SmoothManifoldWithCorners.compatible_of_mem_maximalAtlas
@@ -889,7 +889,7 @@ instance prod {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedA
     [SmoothManifoldWithCorners I' M'] : SmoothManifoldWithCorners (I.prod I') (M Γ— M') where
   compatible := by
     rintro f g ⟨f1, f2, hf1, hf2, rfl⟩ ⟨g1, g2, hg1, hg2, rfl⟩
-    rw [LocalHomeomorph.prod_symm, LocalHomeomorph.prod_trans]
+    rw [PartialHomeomorph.prod_symm, PartialHomeomorph.prod_trans]
     have h1 := (contDiffGroupoid ⊀ I).compatible hf1 hg1
     have h2 := (contDiffGroupoid ⊀ I').compatible hf2 hg2
     exact contDiffGroupoid_prod h1 h2
@@ -897,21 +897,21 @@ instance prod {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedA
 
 end SmoothManifoldWithCorners
 
-theorem LocalHomeomorph.singleton_smoothManifoldWithCorners {π•œ : Type*} [NontriviallyNormedField π•œ]
-    {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
-    (I : ModelWithCorners π•œ E H) {M : Type*} [TopologicalSpace M] (e : LocalHomeomorph M H)
-    (h : e.source = Set.univ) :
+theorem PartialHomeomorph.singleton_smoothManifoldWithCorners
+    {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E]
+    {H : Type*} [TopologicalSpace H] (I : ModelWithCorners π•œ E H)
+    {M : Type*} [TopologicalSpace M] (e : PartialHomeomorph M H) (h : e.source = Set.univ) :
     @SmoothManifoldWithCorners π•œ _ E _ _ H _ I M _ (e.singletonChartedSpace h) :=
   @SmoothManifoldWithCorners.mk' _ _ _ _ _ _ _ _ _ _ (id _) <|
     e.singleton_hasGroupoid h (contDiffGroupoid ∞ I)
-#align local_homeomorph.singleton_smooth_manifold_with_corners LocalHomeomorph.singleton_smoothManifoldWithCorners
+#align local_homeomorph.singleton_smooth_manifold_with_corners PartialHomeomorph.singleton_smoothManifoldWithCorners
 
 theorem OpenEmbedding.singleton_smoothManifoldWithCorners {π•œ : Type*} [NontriviallyNormedField π•œ]
     {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) {M : Type*} [TopologicalSpace M] [Nonempty M] {f : M β†’ H}
     (h : OpenEmbedding f) :
     @SmoothManifoldWithCorners π•œ _ E _ _ H _ I M _ h.singletonChartedSpace :=
-  (h.toLocalHomeomorph f).singleton_smoothManifoldWithCorners I (by simp)
+  (h.toPartialHomeomorph f).singleton_smoothManifoldWithCorners I (by simp)
 #align open_embedding.singleton_smooth_manifold_with_corners OpenEmbedding.singleton_smoothManifoldWithCorners
 
 namespace TopologicalSpace.Opens
@@ -932,7 +932,7 @@ section ExtendedCharts
 open scoped Topology
 
 variable {π•œ E M H E' M' H' : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E]
-  [NormedSpace π•œ E] [TopologicalSpace H] [TopologicalSpace M] (f f' : LocalHomeomorph M H)
+  [NormedSpace π•œ E] [TopologicalSpace H] [TopologicalSpace M] (f f' : PartialHomeomorph M H)
   (I : ModelWithCorners π•œ E H) [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
   [TopologicalSpace M'] (I' : ModelWithCorners π•œ E' H') (x : M) {s t : Set M}
 
@@ -941,51 +941,51 @@ variable {π•œ E M H E' M' H' : Type*} [NontriviallyNormedField π•œ] [NormedAdd
 
 In a smooth manifold with corners, the model space is the space `H`. However, we will also
 need to use extended charts taking values in the model vector space `E`. These extended charts are
-not `LocalHomeomorph` as the target is not open in `E` in general, but we can still register them
+not `PartialHomeomorph` as the target is not open in `E` in general, but we can still register them
 as `LocalEquiv`.
 -/
 
 
-namespace LocalHomeomorph
+namespace PartialHomeomorph
 
 /-- Given a chart `f` on a manifold with corners, `f.extend I` is the extended chart to the model
 vector space. -/
 @[simp, mfld_simps]
 def extend : LocalEquiv M E :=
   f.toLocalEquiv ≫ I.toLocalEquiv
-#align local_homeomorph.extend LocalHomeomorph.extend
+#align local_homeomorph.extend PartialHomeomorph.extend
 
 theorem extend_coe : ⇑(f.extend I) = I ∘ f :=
   rfl
-#align local_homeomorph.extend_coe LocalHomeomorph.extend_coe
+#align local_homeomorph.extend_coe PartialHomeomorph.extend_coe
 
 theorem extend_coe_symm : ⇑(f.extend I).symm = f.symm ∘ I.symm :=
   rfl
-#align local_homeomorph.extend_coe_symm LocalHomeomorph.extend_coe_symm
+#align local_homeomorph.extend_coe_symm PartialHomeomorph.extend_coe_symm
 
 theorem extend_source : (f.extend I).source = f.source := by
   rw [extend, LocalEquiv.trans_source, I.source_eq, preimage_univ, inter_univ]
-#align local_homeomorph.extend_source LocalHomeomorph.extend_source
+#align local_homeomorph.extend_source PartialHomeomorph.extend_source
 
 theorem isOpen_extend_source : IsOpen (f.extend I).source := by
   rw [extend_source]
   exact f.open_source
-#align local_homeomorph.is_open_extend_source LocalHomeomorph.isOpen_extend_source
+#align local_homeomorph.is_open_extend_source PartialHomeomorph.isOpen_extend_source
 
 theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I := by
   simp_rw [extend, LocalEquiv.trans_target, I.target_eq, I.toLocalEquiv_coe_symm, inter_comm]
-#align local_homeomorph.extend_target LocalHomeomorph.extend_target
+#align local_homeomorph.extend_target PartialHomeomorph.extend_target
 
 theorem mapsTo_extend (hs : s βŠ† f.source) :
     MapsTo (f.extend I) s ((f.extend I).symm ⁻¹' s ∩ range I) := by
   rw [mapsTo', extend_coe, extend_coe_symm, preimage_comp, ← I.image_eq, image_comp,
     f.image_eq_target_inter_inv_preimage hs]
   exact image_subset _ (inter_subset_right _ _)
-#align local_homeomorph.maps_to_extend LocalHomeomorph.mapsTo_extend
+#align local_homeomorph.maps_to_extend PartialHomeomorph.mapsTo_extend
 
 theorem extend_left_inv {x : M} (hxf : x ∈ f.source) : (f.extend I).symm (f.extend I x) = x :=
   (f.extend I).left_inv <| by rwa [f.extend_source]
-#align local_homeomorph.extend_left_inv LocalHomeomorph.extend_left_inv
+#align local_homeomorph.extend_left_inv PartialHomeomorph.extend_left_inv
 
 /-- Variant of `f.extend_left_inv I`, stated in terms of images. -/
 lemma extend_left_inv' (ht: t βŠ† f.source) : ((f.extend I).symm ∘ (f.extend I)) '' t = t :=
@@ -993,71 +993,71 @@ lemma extend_left_inv' (ht: t βŠ† f.source) : ((f.extend I).symm ∘ (f.extend I
 
 theorem extend_source_mem_nhds {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝 x :=
   (isOpen_extend_source f I).mem_nhds <| by rwa [f.extend_source I]
-#align local_homeomorph.extend_source_mem_nhds LocalHomeomorph.extend_source_mem_nhds
+#align local_homeomorph.extend_source_mem_nhds PartialHomeomorph.extend_source_mem_nhds
 
 theorem extend_source_mem_nhdsWithin {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝[s] x :=
   mem_nhdsWithin_of_mem_nhds <| extend_source_mem_nhds f I h
-#align local_homeomorph.extend_source_mem_nhds_within LocalHomeomorph.extend_source_mem_nhdsWithin
+#align local_homeomorph.extend_source_mem_nhds_within PartialHomeomorph.extend_source_mem_nhdsWithin
 
 theorem continuousOn_extend : ContinuousOn (f.extend I) (f.extend I).source := by
   refine' I.continuous.comp_continuousOn _
   rw [extend_source]
   exact f.continuousOn
-#align local_homeomorph.continuous_on_extend LocalHomeomorph.continuousOn_extend
+#align local_homeomorph.continuous_on_extend PartialHomeomorph.continuousOn_extend
 
 theorem continuousAt_extend {x : M} (h : x ∈ f.source) : ContinuousAt (f.extend I) x :=
   (continuousOn_extend f I).continuousAt <| extend_source_mem_nhds f I h
-#align local_homeomorph.continuous_at_extend LocalHomeomorph.continuousAt_extend
+#align local_homeomorph.continuous_at_extend PartialHomeomorph.continuousAt_extend
 
 theorem map_extend_nhds {x : M} (hy : x ∈ f.source) :
     map (f.extend I) (𝓝 x) = 𝓝[range I] f.extend I x := by
   rwa [extend_coe, comp_apply, ← I.map_nhds_eq, ← f.map_nhds_eq, map_map]
-#align local_homeomorph.map_extend_nhds LocalHomeomorph.map_extend_nhds
+#align local_homeomorph.map_extend_nhds PartialHomeomorph.map_extend_nhds
 
 theorem extend_target_mem_nhdsWithin {y : M} (hy : y ∈ f.source) :
     (f.extend I).target ∈ 𝓝[range I] f.extend I y := by
   rw [← LocalEquiv.image_source_eq_target, ← map_extend_nhds f I hy]
   exact image_mem_map (extend_source_mem_nhds _ _ hy)
-#align local_homeomorph.extend_target_mem_nhds_within LocalHomeomorph.extend_target_mem_nhdsWithin
+#align local_homeomorph.extend_target_mem_nhds_within PartialHomeomorph.extend_target_mem_nhdsWithin
 
 theorem extend_target_subset_range : (f.extend I).target βŠ† range I := by simp only [mfld_simps]
-#align local_homeomorph.extend_target_subset_range LocalHomeomorph.extend_target_subset_range
+#align local_homeomorph.extend_target_subset_range PartialHomeomorph.extend_target_subset_range
 
 theorem nhdsWithin_extend_target_eq {y : M} (hy : y ∈ f.source) :
     𝓝[(f.extend I).target] f.extend I y = 𝓝[range I] f.extend I y :=
   (nhdsWithin_mono _ (extend_target_subset_range _ _)).antisymm <|
     nhdsWithin_le_of_mem (extend_target_mem_nhdsWithin _ _ hy)
-#align local_homeomorph.nhds_within_extend_target_eq LocalHomeomorph.nhdsWithin_extend_target_eq
+#align local_homeomorph.nhds_within_extend_target_eq PartialHomeomorph.nhdsWithin_extend_target_eq
 
 theorem continuousAt_extend_symm' {x : E} (h : x ∈ (f.extend I).target) :
     ContinuousAt (f.extend I).symm x :=
   (f.continuousAt_symm h.2).comp I.continuous_symm.continuousAt
-#align local_homeomorph.continuous_at_extend_symm' LocalHomeomorph.continuousAt_extend_symm'
+#align local_homeomorph.continuous_at_extend_symm' PartialHomeomorph.continuousAt_extend_symm'
 
 theorem continuousAt_extend_symm {x : M} (h : x ∈ f.source) :
     ContinuousAt (f.extend I).symm (f.extend I x) :=
   continuousAt_extend_symm' f I <| (f.extend I).map_source <| by rwa [f.extend_source]
-#align local_homeomorph.continuous_at_extend_symm LocalHomeomorph.continuousAt_extend_symm
+#align local_homeomorph.continuous_at_extend_symm PartialHomeomorph.continuousAt_extend_symm
 
 theorem continuousOn_extend_symm : ContinuousOn (f.extend I).symm (f.extend I).target := fun _ h =>
   (continuousAt_extend_symm' _ _ h).continuousWithinAt
-#align local_homeomorph.continuous_on_extend_symm LocalHomeomorph.continuousOn_extend_symm
+#align local_homeomorph.continuous_on_extend_symm PartialHomeomorph.continuousOn_extend_symm
 
 theorem extend_symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {g : M β†’ X}
     {s : Set M} {x : M} :
     ContinuousWithinAt (g ∘ (f.extend I).symm) ((f.extend I).symm ⁻¹' s ∩ range I) (f.extend I x) ↔
       ContinuousWithinAt (g ∘ f.symm) (f.symm ⁻¹' s) (f x) := by
   rw [← I.symm_continuousWithinAt_comp_right_iff]; rfl
-#align local_homeomorph.extend_symm_continuous_within_at_comp_right_iff LocalHomeomorph.extend_symm_continuousWithinAt_comp_right_iff
+#align local_homeomorph.extend_symm_continuous_within_at_comp_right_iff PartialHomeomorph.extend_symm_continuousWithinAt_comp_right_iff
 
 theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
     IsOpen ((f.extend I).source ∩ f.extend I ⁻¹' s) :=
   (continuousOn_extend f I).isOpen_inter_preimage (isOpen_extend_source _ _) hs
-#align local_homeomorph.is_open_extend_preimage' LocalHomeomorph.isOpen_extend_preimage'
+#align local_homeomorph.is_open_extend_preimage' PartialHomeomorph.isOpen_extend_preimage'
 
 theorem isOpen_extend_preimage {s : Set E} (hs : IsOpen s) : IsOpen (f.source ∩ f.extend I ⁻¹' s) :=
   by rw [← extend_source f I]; exact isOpen_extend_preimage' f I hs
-#align local_homeomorph.is_open_extend_preimage LocalHomeomorph.isOpen_extend_preimage
+#align local_homeomorph.is_open_extend_preimage PartialHomeomorph.isOpen_extend_preimage
 
 theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
     map (f.extend I) (𝓝[s] y) = 𝓝[f.extend I '' ((f.extend I).source ∩ s)] f.extend I y := by
@@ -1070,7 +1070,7 @@ theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
         ((f.extend I).left_inv <| by rwa [f.extend_source])
         (continuousAt_extend_symm f I hy).continuousWithinAt
         (continuousAt_extend f I hy).continuousWithinAt
-#align local_homeomorph.map_extend_nhds_within_eq_image LocalHomeomorph.map_extend_nhdsWithin_eq_image
+#align local_homeomorph.map_extend_nhds_within_eq_image PartialHomeomorph.map_extend_nhdsWithin_eq_image
 
 theorem map_extend_nhdsWithin_eq_image_of_subset {y : M} (hy : y ∈ f.source) (hs : s βŠ† f.source) :
     map (f.extend I) (𝓝[s] y) = 𝓝[f.extend I '' s] f.extend I y := by
@@ -1082,18 +1082,18 @@ theorem map_extend_nhdsWithin {y : M} (hy : y ∈ f.source) :
   rw [map_extend_nhdsWithin_eq_image f I hy, nhdsWithin_inter, ←
     nhdsWithin_extend_target_eq _ _ hy, ← nhdsWithin_inter, (f.extend I).image_source_inter_eq',
     inter_comm]
-#align local_homeomorph.map_extend_nhds_within LocalHomeomorph.map_extend_nhdsWithin
+#align local_homeomorph.map_extend_nhds_within PartialHomeomorph.map_extend_nhdsWithin
 
 theorem map_extend_symm_nhdsWithin {y : M} (hy : y ∈ f.source) :
     map (f.extend I).symm (𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I y) = 𝓝[s] y := by
   rw [← map_extend_nhdsWithin f I hy, map_map, Filter.map_congr, map_id]
   exact (f.extend I).leftInvOn.eqOn.eventuallyEq_of_mem (extend_source_mem_nhdsWithin _ _ hy)
-#align local_homeomorph.map_extend_symm_nhds_within LocalHomeomorph.map_extend_symm_nhdsWithin
+#align local_homeomorph.map_extend_symm_nhds_within PartialHomeomorph.map_extend_symm_nhdsWithin
 
 theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
     map (f.extend I).symm (𝓝[range I] f.extend I y) = 𝓝 y := by
   rw [← nhdsWithin_univ, ← map_extend_symm_nhdsWithin f I hy, preimage_univ, univ_inter]
-#align local_homeomorph.map_extend_symm_nhds_within_range LocalHomeomorph.map_extend_symm_nhdsWithin_range
+#align local_homeomorph.map_extend_symm_nhds_within_range PartialHomeomorph.map_extend_symm_nhdsWithin_range
 
 theorem tendsto_extend_comp_iff {l : Filter Ξ±} {g : Ξ± β†’ M} (hg : βˆ€αΆ  z in l, g z ∈ f.source)
     (hy : y ∈ f.source) :
@@ -1105,7 +1105,7 @@ theorem tendsto_extend_comp_iff {l : Filter Ξ±} {g : Ξ± β†’ M} (hg : βˆ€αΆ  z in
   simpa only [(· ∘ ·), extend_left_inv _ _ hz, mem_preimage] using hzu
 
 -- there is no definition `writtenInExtend` but we already use some made-up names in this file
-theorem continuousWithinAt_writtenInExtend_iff {f' : LocalHomeomorph M' H'} {g : M β†’ M'}
+theorem continuousWithinAt_writtenInExtend_iff {f' : PartialHomeomorph M' H'} {g : M β†’ M'}
     (hy : y ∈ f.source) (hgy : g y ∈ f'.source) (hmaps : MapsTo g s f'.source) :
     ContinuousWithinAt (f'.extend I' ∘ g ∘ (f.extend I).symm)
       ((f.extend I).symm ⁻¹' s ∩ range I) (f.extend I y) ↔ ContinuousWithinAt g s y := by
@@ -1122,7 +1122,7 @@ theorem continuousWithinAt_writtenInExtend_iff {f' : LocalHomeomorph M' H'} {g :
 
 /-- If `s βŠ† f.source` and `g x ∈ f'.source` whenever `x ∈ s`, then `g` is continuous on `s` if and
 only if `g` written in charts `f.extend I` and `f'.extend I'` is continuous on `f.extend I '' s`. -/
-theorem continuousOn_writtenInExtend_iff {f' : LocalHomeomorph M' H'} {g : M β†’ M'}
+theorem continuousOn_writtenInExtend_iff {f' : PartialHomeomorph M' H'} {g : M β†’ M'}
     (hs : s βŠ† f.source) (hmaps : MapsTo g s f'.source) :
     ContinuousOn (f'.extend I' ∘ g ∘ (f.extend I).symm) (f.extend I '' s) ↔ ContinuousOn g s := by
   refine ball_image_iff.trans <| forallβ‚‚_congr fun x hx ↦ ?_
@@ -1136,14 +1136,14 @@ in the source is a neighborhood of the preimage, within a set. -/
 theorem extend_preimage_mem_nhdsWithin {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝[s] x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I x := by
   rwa [← map_extend_symm_nhdsWithin f I h, mem_map] at ht
-#align local_homeomorph.extend_preimage_mem_nhds_within LocalHomeomorph.extend_preimage_mem_nhdsWithin
+#align local_homeomorph.extend_preimage_mem_nhds_within PartialHomeomorph.extend_preimage_mem_nhdsWithin
 
 theorem extend_preimage_mem_nhds {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝 x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝 (f.extend I x) := by
   apply (continuousAt_extend_symm f I h).preimage_mem_nhds
   rwa [(f.extend I).left_inv]
   rwa [f.extend_source]
-#align local_homeomorph.extend_preimage_mem_nhds LocalHomeomorph.extend_preimage_mem_nhds
+#align local_homeomorph.extend_preimage_mem_nhds PartialHomeomorph.extend_preimage_mem_nhds
 
 /-- Technical lemma to rewrite suitably the preimage of an intersection under an extended chart, to
 bring it into a convenient form to apply derivative lemmas. -/
@@ -1151,7 +1151,7 @@ theorem extend_preimage_inter_eq :
     (f.extend I).symm ⁻¹' (s ∩ t) ∩ range I =
       (f.extend I).symm ⁻¹' s ∩ range I ∩ (f.extend I).symm ⁻¹' t := by
   mfld_set_tac
-#align local_homeomorph.extend_preimage_inter_eq LocalHomeomorph.extend_preimage_inter_eq
+#align local_homeomorph.extend_preimage_inter_eq PartialHomeomorph.extend_preimage_inter_eq
 
 -- porting note: an `aux` lemma that is no longer needed. Delete?
 theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (hx : x ∈ f.source) :
@@ -1165,14 +1165,14 @@ theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (h
   refine' (eventuallyEq_univ.mpr _).symm.inter EventuallyEq.rfl
   refine' I.continuousAt_symm.preimage_mem_nhds (f.open_target.mem_nhds _)
   simp_rw [f.extend_coe, Function.comp_apply, I.left_inv, f.mapsTo hx]
-#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq_aux LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux
+#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq_aux PartialHomeomorph.extend_symm_preimage_inter_range_eventuallyEq_aux
 
 theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs : s βŠ† f.source)
     (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)] f.extend I '' s := by
   rw [← nhdsWithin_eq_iff_eventuallyEq, ← map_extend_nhdsWithin _ _ hx,
     map_extend_nhdsWithin_eq_image_of_subset _ _ hx hs]
-#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
+#align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq PartialHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
 
 /-! We use the name `extend_coord_change` for `(f'.extend I).symm ≫ f.extend I`. -/
 
@@ -1181,13 +1181,13 @@ theorem extend_coord_change_source :
   simp_rw [LocalEquiv.trans_source, I.image_eq, extend_source, LocalEquiv.symm_source,
     extend_target, inter_right_comm _ (range I)]
   rfl
-#align local_homeomorph.extend_coord_change_source LocalHomeomorph.extend_coord_change_source
+#align local_homeomorph.extend_coord_change_source PartialHomeomorph.extend_coord_change_source
 
 theorem extend_image_source_inter :
     f.extend I '' (f.source ∩ f'.source) = ((f.extend I).symm ≫ f'.extend I).source := by
   simp_rw [f.extend_coord_change_source, f.extend_coe, image_comp I f, trans_source'', symm_symm,
     symm_target]
-#align local_homeomorph.extend_image_source_inter LocalHomeomorph.extend_image_source_inter
+#align local_homeomorph.extend_image_source_inter PartialHomeomorph.extend_image_source_inter
 
 theorem extend_coord_change_source_mem_nhdsWithin {x : E}
     (hx : x ∈ ((f.extend I).symm ≫ f'.extend I).source) :
@@ -1195,8 +1195,8 @@ theorem extend_coord_change_source_mem_nhdsWithin {x : E}
   rw [f.extend_coord_change_source] at hx ⊒
   obtain ⟨x, hx, rfl⟩ := hx
   refine' I.image_mem_nhdsWithin _
-  refine' (LocalHomeomorph.open_source _).mem_nhds hx
-#align local_homeomorph.extend_coord_change_source_mem_nhds_within LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin
+  refine' (PartialHomeomorph.open_source _).mem_nhds hx
+#align local_homeomorph.extend_coord_change_source_mem_nhds_within PartialHomeomorph.extend_coord_change_source_mem_nhdsWithin
 
 theorem extend_coord_change_source_mem_nhdsWithin' {x : M} (hxf : x ∈ f.source)
     (hxf' : x ∈ f'.source) :
@@ -1204,7 +1204,7 @@ theorem extend_coord_change_source_mem_nhdsWithin' {x : M} (hxf : x ∈ f.source
   apply extend_coord_change_source_mem_nhdsWithin
   rw [← extend_image_source_inter]
   exact mem_image_of_mem _ ⟨hxf, hxf'⟩
-#align local_homeomorph.extend_coord_change_source_mem_nhds_within' LocalHomeomorph.extend_coord_change_source_mem_nhdsWithin'
+#align local_homeomorph.extend_coord_change_source_mem_nhds_within' PartialHomeomorph.extend_coord_change_source_mem_nhdsWithin'
 
 variable {f f'}
 
@@ -1215,7 +1215,7 @@ theorem contDiffOn_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtl
     ContDiffOn π•œ ⊀ (f.extend I ∘ (f'.extend I).symm) ((f'.extend I).symm ≫ f.extend I).source := by
   rw [extend_coord_change_source, I.image_eq]
   exact (StructureGroupoid.compatible_of_mem_maximalAtlas hf' hf).1
-#align local_homeomorph.cont_diff_on_extend_coord_change LocalHomeomorph.contDiffOn_extend_coord_change
+#align local_homeomorph.cont_diff_on_extend_coord_change PartialHomeomorph.contDiffOn_extend_coord_change
 
 theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) {x : E} (hx : x ∈ ((f'.extend I).symm ≫ f.extend I).source) :
@@ -1223,8 +1223,8 @@ theorem contDiffWithinAt_extend_coord_change [ChartedSpace H M] (hf : f ∈ maxi
   apply (contDiffOn_extend_coord_change I hf hf' x hx).mono_of_mem
   rw [extend_coord_change_source] at hx ⊒
   obtain ⟨z, hz, rfl⟩ := hx
-  exact I.image_mem_nhdsWithin ((LocalHomeomorph.open_source _).mem_nhds hz)
-#align local_homeomorph.cont_diff_within_at_extend_coord_change LocalHomeomorph.contDiffWithinAt_extend_coord_change
+  exact I.image_mem_nhdsWithin ((PartialHomeomorph.open_source _).mem_nhds hz)
+#align local_homeomorph.cont_diff_within_at_extend_coord_change PartialHomeomorph.contDiffWithinAt_extend_coord_change
 
 theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
     (hf' : f' ∈ maximalAtlas I M) {x : M} (hxf : x ∈ f.source) (hxf' : x ∈ f'.source) :
@@ -1232,11 +1232,11 @@ theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ max
   refine' contDiffWithinAt_extend_coord_change I hf hf' _
   rw [← extend_image_source_inter]
   exact mem_image_of_mem _ ⟨hxf', hxf⟩
-#align local_homeomorph.cont_diff_within_at_extend_coord_change' LocalHomeomorph.contDiffWithinAt_extend_coord_change'
+#align local_homeomorph.cont_diff_within_at_extend_coord_change' PartialHomeomorph.contDiffWithinAt_extend_coord_change'
 
-end LocalHomeomorph
+end PartialHomeomorph
 
-open LocalHomeomorph
+open PartialHomeomorph
 
 variable [ChartedSpace H M] [ChartedSpace H' M']
 
chore: rename lemmas containing "of_open" to match the naming convention (#8229)

Mostly, this means replacing "of_open" by "of_isOpen". A few lemmas names were misleading and are corrected differently. Zulip discussion.

Diff
@@ -1052,7 +1052,7 @@ theorem extend_symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {
 
 theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
     IsOpen ((f.extend I).source ∩ f.extend I ⁻¹' s) :=
-  (continuousOn_extend f I).preimage_open_of_open (isOpen_extend_source _ _) hs
+  (continuousOn_extend f I).isOpen_inter_preimage (isOpen_extend_source _ _) hs
 #align local_homeomorph.is_open_extend_preimage' LocalHomeomorph.isOpen_extend_preimage'
 
 theorem isOpen_extend_preimage {s : Set E} (hs : IsOpen s) : IsOpen (f.source ∩ f.extend I ⁻¹' s) :=
chore: split Mathlib.Analysis.Calculus.ContDiff.Basic (#8344)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -6,7 +6,7 @@ Authors: SΓ©bastien GouΓ«zel
 import Mathlib.Analysis.Analytic.Basic
 import Mathlib.Analysis.Analytic.Composition
 import Mathlib.Analysis.Analytic.Linear
-import Mathlib.Analysis.Calculus.ContDiff.Basic
+import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension
 import Mathlib.Analysis.Calculus.FDeriv.Analytic
 import Mathlib.Geometry.Manifold.ChartedSpace
 
chore: move Analysis/ContDiff to Analysis/ContDiff/Basic to make room for splitting (#8337)

No changes to content, or splitting, just a rename so there is room for more files.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -6,7 +6,7 @@ Authors: SΓ©bastien GouΓ«zel
 import Mathlib.Analysis.Analytic.Basic
 import Mathlib.Analysis.Analytic.Composition
 import Mathlib.Analysis.Analytic.Linear
-import Mathlib.Analysis.Calculus.ContDiff
+import Mathlib.Analysis.Calculus.ContDiff.Basic
 import Mathlib.Analysis.Calculus.FDeriv.Analytic
 import Mathlib.Geometry.Manifold.ChartedSpace
 
feat: miscellaneous lemmas about local homeomorphisms (#8062)
  • variant of extend_left_inv', stated in terms of images (instead of point-wise)
  • variant of map_source', stated for images of subsets (instead of point-wise)
  • a local homeomorphism and its inverse are open on its source

Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>

Diff
@@ -987,6 +987,10 @@ theorem extend_left_inv {x : M} (hxf : x ∈ f.source) : (f.extend I).symm (f.ex
   (f.extend I).left_inv <| by rwa [f.extend_source]
 #align local_homeomorph.extend_left_inv LocalHomeomorph.extend_left_inv
 
+/-- Variant of `f.extend_left_inv I`, stated in terms of images. -/
+lemma extend_left_inv' (ht: t βŠ† f.source) : ((f.extend I).symm ∘ (f.extend I)) '' t = t :=
+  EqOn.image_eq_self (fun _ hx ↦ f.extend_left_inv I (ht hx))
+
 theorem extend_source_mem_nhds {x : M} (h : x ∈ f.source) : (f.extend I).source ∈ 𝓝 x :=
   (isOpen_extend_source f I).mem_nhds <| by rwa [f.extend_source I]
 #align local_homeomorph.extend_source_mem_nhds LocalHomeomorph.extend_source_mem_nhds
feat: finite-dimensional manifolds are locally compact (#7822)

... assuming they're modelled over a locally compact field. (Currently, the only such instances in mathlib are $\mathbb{R}$ and $\mathbb{C}$. Once local compactness of the $p$-adic numbers is added to mathlib, this theorem will apply to them also.)

  • part of the road towards Sard's theorem
Diff
@@ -1563,3 +1563,21 @@ theorem writtenInExtChartAt_chartAt_symm_comp [ChartedSpace H H'] (x : M') {y}
   simp_all only [mfld_simps, chartAt_comp]
 
 end ExtendedCharts
+
+section Topology
+-- Let `M` be a topological manifold over the field π•œ.
+variable
+  {E : Type*} {π•œ : Type*} [NontriviallyNormedField π•œ]
+  [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
+  (I : ModelWithCorners π•œ E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M]
+  [HasGroupoid M (contDiffGroupoid 0 I)]
+
+/-- A finite-dimensional manifold modelled on a locally compact field
+  (such as ℝ, β„‚ or the `p`-adic numbers) is locally compact. -/
+lemma Manifold.locallyCompact_of_finiteDimensional [LocallyCompactSpace π•œ]
+    [FiniteDimensional π•œ E] : LocallyCompactSpace M := by
+  have : ProperSpace E := FiniteDimensional.proper π•œ E
+  have : LocallyCompactSpace H := I.locallyCompactSpace
+  exact ChartedSpace.locallyCompactSpace H M
+
+end Topology
chore: remove extraneous Set. qualifiers (#8053)

It's proposed that a code formatter remove those automatically, so we might as well remove them as we see them.

Diff
@@ -425,7 +425,7 @@ def ModelWithCorners.pi {π•œ : Type u} [NontriviallyNormedField π•œ] {ΞΉ : Typ
     [βˆ€ i, TopologicalSpace (H i)] (I : βˆ€ i, ModelWithCorners π•œ (E i) (H i)) :
     ModelWithCorners π•œ (βˆ€ i, E i) (ModelPi H) where
   toLocalEquiv := LocalEquiv.pi fun i => (I i).toLocalEquiv
-  source_eq := by simp only [Set.pi_univ, mfld_simps]
+  source_eq := by simp only [pi_univ, mfld_simps]
   unique_diff' := UniqueDiffOn.pi ΞΉ E _ _ fun i _ => (I i).unique_diff'
   continuous_toFun := continuous_pi fun i => (I i).continuous.comp (continuous_apply i)
   continuous_invFun := continuous_pi fun i => (I i).continuous_symm.comp (continuous_apply i)
@@ -631,11 +631,11 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
   simp only at he he_symm he' he'_symm
   constructor <;> simp only [LocalEquiv.prod_source, LocalHomeomorph.prod_toLocalEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
+    rw [← I.image_eq, ← I'.image_eq, prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
     exact h3
   Β· have h3 := ContDiffOn.prod_map he_symm he'_symm
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
+    rw [← I.image_eq, ← I'.image_eq, prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
     exact h3
 #align cont_diff_groupoid_prod contDiffGroupoid_prod
@@ -718,7 +718,7 @@ def analyticGroupoid : StructureGroupoid H :=
         apply And.intro
         Β· intro x hx
           rcases h (I.symm x) (mem_preimage.mp hx.left) with ⟨v, hv⟩
-          exact hv.right.right.left x ⟨Set.mem_preimage.mpr ⟨hx.left, hv.right.left⟩, hx.right⟩
+          exact hv.right.right.left x ⟨mem_preimage.mpr ⟨hx.left, hv.right.left⟩, hx.right⟩
         Β· apply mapsTo'.mp
           simp only [MapsTo]
           intro x hx
doc(Geometry/Manifold): manifolds are not required to be Hausdorff nor second countable (#7159)

For many results, these assumptions are not required. As finite-dimensional manifolds are commonly assumed to be Hausdorff and second countable, it seems worth to call this out explicitly.

Diff
@@ -25,6 +25,9 @@ With this groupoid at hand and the general machinery of charted spaces, we thus
 of `C^n` manifold with respect to any model with corners `I` on `(E, H)`. We also introduce a
 specific type class for `C^∞` manifolds as these are the most commonly used.
 
+Some texts assume manifolds to be Hausdorff and secound countable. We (in mathlib) assume neither,
+but add these assumptions later as needed. (Quite a few results still do not require them.)
+
 ## Main definitions
 
 * `ModelWithCorners π•œ E H` :
feat: Add analytic structure groupoid on models with corners (#6386)

Co-authored-by: Michael Lee <michael_lee1@brown.edu>

Diff
@@ -3,7 +3,11 @@ Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 -/
+import Mathlib.Analysis.Analytic.Basic
+import Mathlib.Analysis.Analytic.Composition
+import Mathlib.Analysis.Analytic.Linear
 import Mathlib.Analysis.Calculus.ContDiff
+import Mathlib.Analysis.Calculus.FDeriv.Analytic
 import Mathlib.Geometry.Manifold.ChartedSpace
 
 #align_import geometry.manifold.smooth_manifold_with_corners from "leanprover-community/mathlib"@"ddec54a71a0dd025c05445d467f1a2b7d586a3ba"
@@ -644,6 +648,162 @@ instance : ClosedUnderRestriction (contDiffGroupoid n I) :=
 
 end contDiffGroupoid
 
+section analyticGroupoid
+
+variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
+  [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) {M : Type*}
+  [TopologicalSpace M]
+
+/-- Given a model with corners `(E, H)`, we define the groupoid of analytic transformations of `H`
+as the maps that are analytic and map interior to interior when read in `E` through `I`. We also
+explicitly define that they are `C^∞` on the whole domain, since we are only requiring
+analyticity on the interior of the domain. -/
+def analyticGroupoid : StructureGroupoid H :=
+  (contDiffGroupoid ∞ I) βŠ“ Pregroupoid.groupoid
+    { property := fun f s => AnalyticOn π•œ (I ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
+        (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ f ∘ I.symm) βŠ† interior (range I)
+      comp := fun {f g u v} hf hg _ _ _ => by
+        simp only [] at hf hg ⊒
+        have comp : I ∘ (g ∘ f) ∘ I.symm = (I ∘ g ∘ I.symm) ∘ I ∘ f ∘ I.symm := by ext x; simp
+        apply And.intro
+        Β· simp only [comp, preimage_inter]
+          refine hg.left.comp (hf.left.mono ?_) ?_
+          Β· simp only [subset_inter_iff, inter_subset_right]
+            rw [inter_assoc]
+            simp
+          Β· intro x hx
+            apply And.intro
+            Β· rw [mem_preimage, comp_apply, I.left_inv]
+              exact hx.left.right
+            Β· apply hf.right
+              rw [mem_image]
+              exact ⟨x, ⟨⟨hx.left.left, hx.right⟩, rfl⟩⟩
+        Β· simp only [comp]
+          rw [image_comp]
+          intro x hx
+          rw [mem_image] at hx
+          rcases hx with ⟨x', hx'⟩
+          refine hg.right ⟨x', And.intro ?_ hx'.right⟩
+          apply And.intro
+          · have hx'1 : x' ∈ ((v.preimage f).preimage (I.symm)).image (I ∘ f ∘ I.symm) := by
+              refine image_subset (I ∘ f ∘ I.symm) ?_ hx'.left
+              rw [preimage_inter]
+              refine Subset.trans ?_ (inter_subset_right (u.preimage I.symm)
+                ((v.preimage f).preimage I.symm))
+              apply inter_subset_left
+            rcases hx'1 with ⟨x'', hx''⟩
+            rw [hx''.right.symm]
+            simp only [comp_apply, mem_preimage, I.left_inv]
+            exact hx''.left
+          Β· rw [mem_image] at hx'
+            rcases hx'.left with ⟨x'', hx''⟩
+            exact hf.right ⟨x'', ⟨⟨hx''.left.left.left, hx''.left.right⟩, hx''.right⟩⟩
+      id_mem := by
+        apply And.intro
+        Β· simp only [preimage_univ, univ_inter]
+          exact AnalyticOn.congr isOpen_interior
+            (f := (1 : E β†’L[π•œ] E)) (fun x _ => (1 : E β†’L[π•œ] E).analyticAt x)
+            (fun z hz => (I.right_inv (interior_subset hz)).symm)
+        Β· intro x hx
+          simp only [left_id, comp_apply, preimage_univ, univ_inter, mem_image] at hx
+          rcases hx with ⟨y, hy⟩
+          rw [← hy.right, I.right_inv (interior_subset hy.left)]
+          exact hy.left
+      locality := fun {f u} _ h => by
+        simp only [] at h
+        simp only [AnalyticOn]
+        apply And.intro
+        Β· intro x hx
+          rcases h (I.symm x) (mem_preimage.mp hx.left) with ⟨v, hv⟩
+          exact hv.right.right.left x ⟨Set.mem_preimage.mpr ⟨hx.left, hv.right.left⟩, hx.right⟩
+        Β· apply mapsTo'.mp
+          simp only [MapsTo]
+          intro x hx
+          rcases h (I.symm x) hx.left with ⟨v, hv⟩
+          apply hv.right.right.right
+          rw [mem_image]
+          have hx' := And.intro hx (mem_preimage.mpr hv.right.left)
+          rw [← mem_inter_iff, inter_comm, ← inter_assoc, ← preimage_inter, inter_comm v u] at hx'
+          exact ⟨x, ⟨hx', rfl⟩⟩
+      congr := fun {f g u} hu fg hf => by
+        simp only [] at hf ⊒
+        apply And.intro
+        Β· refine AnalyticOn.congr (IsOpen.inter (hu.preimage I.continuous_symm) isOpen_interior)
+            hf.left ?_
+          intro z hz
+          simp only [comp_apply]
+          rw [fg (I.symm z) hz.left]
+        Β· intro x hx
+          apply hf.right
+          rw [mem_image] at hx ⊒
+          rcases hx with ⟨y, hy⟩
+          refine ⟨y, ⟨hy.left, ?_⟩⟩
+          rw [comp_apply, comp_apply, fg (I.symm y) hy.left.left] at hy
+          exact hy.right }
+
+/-- An identity local homeomorphism belongs to the analytic groupoid. -/
+theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
+    LocalHomeomorph.ofSet s hs ∈ analyticGroupoid I := by
+  rw [analyticGroupoid]
+  refine And.intro (ofSet_mem_contDiffGroupoid ∞ I hs) ?_
+  apply mem_groupoid_of_pregroupoid.mpr
+  suffices h : AnalyticOn π•œ (I ∘ I.symm) (I.symm ⁻¹' s ∩ interior (range I)) ∧
+      (I.symm ⁻¹' s ∩ interior (range I)).image (I ∘ I.symm) βŠ† interior (range I)
+  Β· simp only [LocalHomeomorph.ofSet_apply, left_id, LocalHomeomorph.ofSet_toLocalEquiv,
+      LocalEquiv.ofSet_source, h, comp_apply, mem_range, image_subset_iff, true_and,
+      LocalHomeomorph.ofSet_symm, LocalEquiv.ofSet_target, and_self]
+    intro x hx
+    refine mem_preimage.mpr ?_
+    rw [← I.right_inv (interior_subset hx.right)] at hx
+    exact hx.right
+  apply And.intro
+  Β· have : AnalyticOn π•œ (1 : E β†’L[π•œ] E) (univ : Set E) := (fun x _ => (1 : E β†’L[π•œ] E).analyticAt x)
+    exact (this.mono (subset_univ (s.preimage (I.symm) ∩ interior (range I)))).congr
+      (IsOpen.inter (hs.preimage I.continuous_symm) isOpen_interior)
+      fun z hz => (I.right_inv (interior_subset hz.right)).symm
+  Β· intro x hx
+    simp only [comp_apply, mem_image] at hx
+    rcases hx with ⟨y, hy⟩
+    rw [← hy.right, I.right_inv (interior_subset hy.left.right)]
+    exact hy.left.right
+
+/-- The composition of a local homeomorphism from `H` to `M` and its inverse belongs to
+the analytic groupoid. -/
+theorem symm_trans_mem_analyticGroupoid (e : LocalHomeomorph M H) :
+    e.symm.trans e ∈ analyticGroupoid I :=
+  haveI : e.symm.trans e β‰ˆ LocalHomeomorph.ofSet e.target e.open_target :=
+    LocalHomeomorph.trans_symm_self _
+  StructureGroupoid.eq_on_source _ (ofSet_mem_analyticGroupoid I e.open_target) this
+
+/-- The analytic groupoid is closed under restriction. -/
+instance : ClosedUnderRestriction (analyticGroupoid I) :=
+  (closedUnderRestriction_iff_id_le _).mpr
+    (by
+      apply StructureGroupoid.le_iff.mpr
+      rintro e ⟨s, hs, hes⟩
+      apply (analyticGroupoid I).eq_on_source' _ _ _ hes
+      exact ofSet_mem_analyticGroupoid I hs)
+
+/-- The analytic groupoid on a boundaryless charted space modeled on a complete vector space
+consists of the local homeomorphisms which are analytic and have analytic inverse. -/
+theorem mem_analyticGroupoid_of_boundaryless [CompleteSpace E] [I.Boundaryless]
+    (e : LocalHomeomorph H H) :
+    e ∈ analyticGroupoid I ↔ AnalyticOn π•œ (I ∘ e ∘ I.symm) (I '' e.source) ∧
+    AnalyticOn π•œ (I ∘ e.symm ∘ I.symm) (I '' e.target) := by
+  apply Iff.intro
+  Β· intro he
+    have := mem_groupoid_of_pregroupoid.mp he.right
+    simp only [I.image_eq, I.range_eq_univ, interior_univ, subset_univ, and_true] at this ⊒
+    exact this
+  Β· intro he
+    apply And.intro
+    all_goals apply mem_groupoid_of_pregroupoid.mpr; simp only [I.image_eq, I.range_eq_univ,
+      interior_univ, subset_univ, and_true] at he ⊒
+    · exact ⟨he.left.contDiffOn, he.right.contDiffOn⟩
+    Β· exact he
+
+end analyticGroupoid
+
 section SmoothManifoldWithCorners
 
 /-! ### Smooth manifolds with corners -/
chore: rename 2 lemmas (#6767)
  • ChartedSpace.locallyCompact β†’ ChartedSpace.locallyCompactSpace
  • ModelWithCorners.locally_compact β†’ ModelWithCorners.locallyCompactSpace
Diff
@@ -343,7 +343,7 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
   Β· rw [← I.left_inv x] at h; exact h.comp I.continuousWithinAt_symm (inter_subset_left _ _)
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
 
-protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
+protected theorem locallyCompactSpace [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
     LocallyCompactSpace H := by
   have : βˆ€ x : H, (𝓝 x).HasBasis (fun s => s ∈ 𝓝 (I x) ∧ IsCompact s)
       fun s => I.symm '' (s ∩ range I) := fun x ↦ by
@@ -352,7 +352,7 @@ protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners
   refine' locallyCompactSpace_of_hasBasis this _
   rintro x s ⟨-, hsc⟩
   exact (hsc.inter_right I.closed_range).image I.continuous_symm
-#align model_with_corners.locally_compact ModelWithCorners.locally_compact
+#align model_with_corners.locally_compact ModelWithCorners.locallyCompactSpace
 
 open TopologicalSpace
 
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -111,6 +111,8 @@ derivative will be `mfderiv I I' f`, instead of the more natural notations `Tang
 real and complex manifolds).
 -/
 
+set_option autoImplicit true
+
 
 noncomputable section
 
chore: tidy various files (#6393)
Diff
@@ -66,10 +66,10 @@ The right invocation does not focus on one specific construction, but on all con
 the right properties, like
 
   `variables {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
-  {I : ModelWithCorners ℝ E E} [I.boundaryless]
+  {I : ModelWithCorners ℝ E E} [I.Boundaryless]
   {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [SmoothManifoldWithCorners I M]`
 
-Here, `I.boundaryless` is a typeclass property ensuring that there is no boundary (this is for
+Here, `I.Boundaryless` is a typeclass property ensuring that there is no boundary (this is for
 instance the case for `modelWithCornersSelf`, or products of these). Note that one could consider
 as a natural assumption to only use the trivial model with corners `modelWithCornersSelf ℝ E`,
 but again in product manifolds the natural model with corners will not be this one but the product
@@ -105,8 +105,8 @@ get lighter notations later on, but it did not turn out right, as on `E Γ— F` th
 model with corners, the trivial (identity) one, and the product one, and they are not defeq and one
 needs to indicate to Lean which one we want to use.
 This means that when talking on objects on manifolds one will most often need to specify the model
-with corners one is using. For instance, the tangent bundle will be `tangent_bundle I M` and the
-derivative will be `mfderiv I I' f`, instead of the more natural notations `tangent_bundle π•œ M` and
+with corners one is using. For instance, the tangent bundle will be `TangentBundle I M` and the
+derivative will be `mfderiv I I' f`, instead of the more natural notations `TangentBundle π•œ M` and
 `mfderiv π•œ f` (the field has to be explicit anyway, as some manifolds could be considered both as
 real and complex manifolds).
 -/
@@ -120,7 +120,6 @@ open Set Filter Function
 
 open scoped Manifold Filter Topology
 
--- mathport name: with_top.nat.top
 scoped[Manifold] notation "∞" => (⊀ : β„•βˆž)
 
 /-! ### Models with corners. -/
@@ -152,10 +151,7 @@ def modelWithCornersSelf (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type
   continuous_invFun := continuous_id
 #align model_with_corners_self modelWithCornersSelf
 
--- mathport name: model_with_corners_self
 scoped[Manifold] notation "π“˜(" π•œ ", " E ")" => modelWithCornersSelf π•œ E
-
--- mathport name: model_with_corners_self.self
 scoped[Manifold] notation "π“˜(" π•œ ")" => modelWithCornersSelf π•œ π•œ
 
 section
@@ -688,7 +684,7 @@ end SmoothManifoldWithCorners
 
 namespace SmoothManifoldWithCorners
 
-/- We restate in the namespace `smooth_manifolds_with_corners` some lemmas that hold for general
+/- We restate in the namespace `SmoothManifoldWithCorners` some lemmas that hold for general
 charted space with a structure groupoid, avoiding the need to specify the groupoid
 `contDiffGroupoid ∞ I` explicitly. -/
 variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
@@ -881,8 +877,8 @@ theorem continuousOn_extend_symm : ContinuousOn (f.extend I).symm (f.extend I).t
 theorem extend_symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {g : M β†’ X}
     {s : Set M} {x : M} :
     ContinuousWithinAt (g ∘ (f.extend I).symm) ((f.extend I).symm ⁻¹' s ∩ range I) (f.extend I x) ↔
-      ContinuousWithinAt (g ∘ f.symm) (f.symm ⁻¹' s) (f x) :=
-  by rw [← I.symm_continuousWithinAt_comp_right_iff]; rfl
+      ContinuousWithinAt (g ∘ f.symm) (f.symm ⁻¹' s) (f x) := by
+  rw [← I.symm_continuousWithinAt_comp_right_iff]; rfl
 #align local_homeomorph.extend_symm_continuous_within_at_comp_right_iff LocalHomeomorph.extend_symm_continuousWithinAt_comp_right_iff
 
 theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
@@ -1402,4 +1398,3 @@ theorem writtenInExtChartAt_chartAt_symm_comp [ChartedSpace H H'] (x : M') {y}
   simp_all only [mfld_simps, chartAt_comp]
 
 end ExtendedCharts
-
style: remove trailing whitespace and modify the linter to detect it (#6519)
Diff
@@ -340,8 +340,8 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
   refine' ⟨fun h => _, fun h => _⟩
   Β· have := h.comp I.continuousWithinAt (mapsTo_preimage _ _)
     simp_rw [preimage_inter, preimage_preimage, I.left_inv, preimage_id', preimage_range,
-      inter_univ] at this 
-    rwa [Function.comp.assoc, I.symm_comp_self] at this 
+      inter_univ] at this
+    rwa [Function.comp.assoc, I.symm_comp_self] at this
   Β· rw [← I.left_inv x] at h; exact h.comp I.continuousWithinAt_symm (inter_subset_left _ _)
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
 
@@ -555,7 +555,7 @@ def contDiffGroupoid : StructureGroupoid H :=
           rw [preimage_inter, inter_assoc, inter_assoc]
           congr 1
           rw [inter_comm]
-        rw [this] at hv 
+        rw [this] at hv
         exact ⟨I.symm ⁻¹' v, v_open.preimage I.continuous_symm, by simpa, hv⟩
       congr := fun {f g u} _ fg hf => by
         apply hf.congr
@@ -623,14 +623,14 @@ theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCor
     (he' : e' ∈ contDiffGroupoid ⊀ I') : e.prod e' ∈ contDiffGroupoid ⊀ (I.prod I') := by
   cases' he with he he_symm
   cases' he' with he' he'_symm
-  simp only at he he_symm he' he'_symm 
+  simp only at he he_symm he' he'_symm
   constructor <;> simp only [LocalEquiv.prod_source, LocalHomeomorph.prod_toLocalEquiv]
   Β· have h3 := ContDiffOn.prod_map he he'
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
+    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
     exact h3
   Β· have h3 := ContDiffOn.prod_map he_symm he'_symm
-    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3 
+    rw [← I.image_eq, ← I'.image_eq, Set.prod_image_image_eq] at h3
     rw [← (I.prod I').image_eq]
     exact h3
 #align cont_diff_groupoid_prod contDiffGroupoid_prod
@@ -970,7 +970,7 @@ theorem continuousOn_writtenInExtend_iff {f' : LocalHomeomorph M' H'} {g : M β†’
 in the source is a neighborhood of the preimage, within a set. -/
 theorem extend_preimage_mem_nhdsWithin {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝[s] x) :
     (f.extend I).symm ⁻¹' t ∈ 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I x := by
-  rwa [← map_extend_symm_nhdsWithin f I h, mem_map] at ht 
+  rwa [← map_extend_symm_nhdsWithin f I h, mem_map] at ht
 #align local_homeomorph.extend_preimage_mem_nhds_within LocalHomeomorph.extend_preimage_mem_nhdsWithin
 
 theorem extend_preimage_mem_nhds {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝 x) :
@@ -1268,7 +1268,7 @@ in the source is a neighborhood of the preimage, within a set. -/
 theorem extChartAt_preimage_mem_nhdsWithin' {x' : M} (h : x' ∈ (extChartAt I x).source)
     (ht : t ∈ 𝓝[s] x') :
     (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x' := by
-  rwa [← map_extChartAt_symm_nhdsWithin' I x h, mem_map] at ht 
+  rwa [← map_extChartAt_symm_nhdsWithin' I x h, mem_map] at ht
 #align ext_chart_at_preimage_mem_nhds_within' extChartAt_preimage_mem_nhdsWithin'
 
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of the
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -131,8 +131,8 @@ model vector space `E` over the field `π•œ`. This is all what is needed to
 define a smooth manifold with model space `H`, and model vector space `E`.
 -/
 @[ext] -- porting note: was nolint has_nonempty_instance
-structure ModelWithCorners (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
-    [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] extends
+structure ModelWithCorners (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*)
+    [NormedAddCommGroup E] [NormedSpace π•œ E] (H : Type*) [TopologicalSpace H] extends
     LocalEquiv H E where
   source_eq : source = univ
   unique_diff' : UniqueDiffOn π•œ toLocalEquiv.target
@@ -143,7 +143,7 @@ structure ModelWithCorners (π•œ : Type _) [NontriviallyNormedField π•œ] (E : T
 attribute [simp, mfld_simps] ModelWithCorners.source_eq
 
 /-- A vector space is a model with corners. -/
-def modelWithCornersSelf (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
+def modelWithCornersSelf (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*)
     [NormedAddCommGroup E] [NormedSpace π•œ E] : ModelWithCorners π•œ E E where
   toLocalEquiv := LocalEquiv.refl E
   source_eq := rfl
@@ -160,8 +160,8 @@ scoped[Manifold] notation "π“˜(" π•œ ")" => modelWithCornersSelf π•œ π•œ
 
 section
 
-variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
-  [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H] (I : ModelWithCorners π•œ E H)
+variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
+  [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners π•œ E H)
 
 namespace ModelWithCorners
 
@@ -179,14 +179,14 @@ protected def symm : LocalEquiv E H :=
 
 /-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
   because it is a composition of multiple projections. -/
-def Simps.apply (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _) [NormedAddCommGroup E]
-    [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] (I : ModelWithCorners π•œ E H) : H β†’ E :=
+def Simps.apply (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*) [NormedAddCommGroup E]
+    [NormedSpace π•œ E] (H : Type*) [TopologicalSpace H] (I : ModelWithCorners π•œ E H) : H β†’ E :=
   I
 #align model_with_corners.simps.apply ModelWithCorners.Simps.apply
 
 /-- See Note [custom simps projection] -/
-def Simps.symm_apply (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _) [NormedAddCommGroup E]
-    [NormedSpace π•œ E] (H : Type _) [TopologicalSpace H] (I : ModelWithCorners π•œ E H) : E β†’ H :=
+def Simps.symm_apply (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*) [NormedAddCommGroup E]
+    [NormedSpace π•œ E] (H : Type*) [TopologicalSpace H] (I : ModelWithCorners π•œ E H) : E β†’ H :=
   I.symm
 #align model_with_corners.simps.symm_apply ModelWithCorners.Simps.symm_apply
 
@@ -325,7 +325,7 @@ theorem unique_diff_preimage {s : Set H} (hs : IsOpen s) :
   exact I.unique_diff.inter (hs.preimage I.continuous_invFun)
 #align model_with_corners.unique_diff_preimage ModelWithCorners.unique_diff_preimage
 
-theorem unique_diff_preimage_source {Ξ² : Type _} [TopologicalSpace Ξ²] {e : LocalHomeomorph H Ξ²} :
+theorem unique_diff_preimage_source {Ξ² : Type*} [TopologicalSpace Ξ²] {e : LocalHomeomorph H Ξ²} :
     UniqueDiffOn π•œ (I.symm ⁻¹' e.source ∩ range I) :=
   I.unique_diff_preimage e.open_source
 #align model_with_corners.unique_diff_preimage_source ModelWithCorners.unique_diff_preimage_source
@@ -435,11 +435,11 @@ def ModelWithCorners.tangent {π•œ : Type u} [NontriviallyNormedField π•œ] {E :
   I.prod π“˜(π•œ, E)
 #align model_with_corners.tangent ModelWithCorners.tangent
 
-variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
-  [NormedSpace π•œ E] {E' : Type _} [NormedAddCommGroup E'] [NormedSpace π•œ E'] {F : Type _}
-  [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type _} [NormedAddCommGroup F'] [NormedSpace π•œ F']
-  {H : Type _} [TopologicalSpace H] {H' : Type _} [TopologicalSpace H'] {G : Type _}
-  [TopologicalSpace G] {G' : Type _} [TopologicalSpace G'] {I : ModelWithCorners π•œ E H}
+variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
+  [NormedSpace π•œ E] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace π•œ E'] {F : Type*}
+  [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type*} [NormedAddCommGroup F'] [NormedSpace π•œ F']
+  {H : Type*} [TopologicalSpace H] {H' : Type*} [TopologicalSpace H'] {G : Type*}
+  [TopologicalSpace G] {G' : Type*} [TopologicalSpace G'] {I : ModelWithCorners π•œ E H}
   {J : ModelWithCorners π•œ F G}
 
 @[simp, mfld_simps]
@@ -473,28 +473,28 @@ end ModelWithCornersProd
 section Boundaryless
 
 /-- Property ensuring that the model with corners `I` defines manifolds without boundary. -/
-class ModelWithCorners.Boundaryless {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+class ModelWithCorners.Boundaryless {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) : Prop where
   range_eq_univ : range I = univ
 #align model_with_corners.boundaryless ModelWithCorners.Boundaryless
 
-theorem ModelWithCorners.range_eq_univ {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+theorem ModelWithCorners.range_eq_univ {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) [I.Boundaryless] :
     range I = univ := ModelWithCorners.Boundaryless.range_eq_univ
 
 /-- If `I` is a `ModelWithCorners.Boundaryless` model, then it is a homeomorphism. -/
 @[simps (config := {simpRhs := true})]
-def ModelWithCorners.toHomeomorph {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+def ModelWithCorners.toHomeomorph {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
     (I : ModelWithCorners π•œ E H) [I.Boundaryless] : H β‰ƒβ‚œ E where
   __ := I
   left_inv := I.left_inv
   right_inv _ := I.right_inv <| I.range_eq_univ.symm β–Έ mem_univ _
 
 /-- The trivial model with corners has no boundary -/
-instance modelWithCornersSelf_boundaryless (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
+instance modelWithCornersSelf_boundaryless (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*)
     [NormedAddCommGroup E] [NormedSpace π•œ E] : (modelWithCornersSelf π•œ E).Boundaryless :=
   ⟨by simp⟩
 #align model_with_corners_self_boundaryless modelWithCornersSelf_boundaryless
@@ -518,8 +518,8 @@ section contDiffGroupoid
 /-! ### Smooth functions on models with corners -/
 
 
-variable {m n : β„•βˆž} {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
-  [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) {M : Type _}
+variable {m n : β„•βˆž} {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
+  [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) {M : Type*}
   [TopologicalSpace M]
 
 variable (n)
@@ -615,7 +615,7 @@ theorem symm_trans_mem_contDiffGroupoid (e : LocalHomeomorph M H) :
   StructureGroupoid.eq_on_source _ (ofSet_mem_contDiffGroupoid n I e.open_target) this
 #align symm_trans_mem_cont_diff_groupoid symm_trans_mem_contDiffGroupoid
 
-variable {E' H' : Type _} [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
+variable {E' H' : Type*} [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
 
 /-- The product of two smooth local homeomorphisms is smooth. -/
 theorem contDiffGroupoid_prod {I : ModelWithCorners π•œ E H} {I' : ModelWithCorners π•œ E' H'}
@@ -653,22 +653,22 @@ section SmoothManifoldWithCorners
 
 /-- Typeclass defining smooth manifolds with corners with respect to a model with corners, over a
 field `π•œ` and with infinite smoothness to simplify typeclass search and statements later on. -/
-class SmoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-    (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M] extends
+class SmoothManifoldWithCorners {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) (M : Type*) [TopologicalSpace M] [ChartedSpace H M] extends
     HasGroupoid M (contDiffGroupoid ∞ I) : Prop
 #align smooth_manifold_with_corners SmoothManifoldWithCorners
 
-theorem SmoothManifoldWithCorners.mk' {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-    (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M]
+theorem SmoothManifoldWithCorners.mk' {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) (M : Type*) [TopologicalSpace M] [ChartedSpace H M]
     [gr : HasGroupoid M (contDiffGroupoid ∞ I)] : SmoothManifoldWithCorners I M :=
   { gr with }
 #align smooth_manifold_with_corners.mk' SmoothManifoldWithCorners.mk'
 
-theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type _} [NontriviallyNormedField π•œ]
-    {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-    (I : ModelWithCorners π•œ E H) (M : Type _) [TopologicalSpace M] [ChartedSpace H M]
+theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type*} [NontriviallyNormedField π•œ]
+    {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) (M : Type*) [TopologicalSpace M] [ChartedSpace H M]
     (h : βˆ€ e e' : LocalHomeomorph M H, e ∈ atlas H M β†’ e' ∈ atlas H M β†’
       ContDiffOn π•œ ⊀ (I ∘ e.symm ≫ₕ e' ∘ I.symm) (I.symm ⁻¹' (e.symm ≫ₕ e').source ∩ range I)) :
     SmoothManifoldWithCorners I M where
@@ -678,8 +678,8 @@ theorem smoothManifoldWithCorners_of_contDiffOn {π•œ : Type _} [NontriviallyNor
 #align smooth_manifold_with_corners_of_cont_diff_on smoothManifoldWithCorners_of_contDiffOn
 
 /-- For any model with corners, the model space is a smooth manifold -/
-instance model_space_smooth {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
-    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+instance model_space_smooth {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
     {I : ModelWithCorners π•œ E H} : SmoothManifoldWithCorners I H :=
   { hasGroupoid_model_space _ _ with }
 #align model_space_smooth model_space_smooth
@@ -691,8 +691,8 @@ namespace SmoothManifoldWithCorners
 /- We restate in the namespace `smooth_manifolds_with_corners` some lemmas that hold for general
 charted space with a structure groupoid, avoiding the need to specify the groupoid
 `contDiffGroupoid ∞ I` explicitly. -/
-variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
-  [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) (M : Type _)
+variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
+  [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) (M : Type*)
   [TopologicalSpace M] [ChartedSpace H M]
 
 /-- The maximal atlas of `M` for the smooth manifold with corners structure corresponding to the
@@ -720,11 +720,11 @@ theorem compatible_of_mem_maximalAtlas {e e' : LocalHomeomorph M H} (he : e ∈
 #align smooth_manifold_with_corners.compatible_of_mem_maximal_atlas SmoothManifoldWithCorners.compatible_of_mem_maximalAtlas
 
 /-- The product of two smooth manifolds with corners is naturally a smooth manifold with corners. -/
-instance prod {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
-    [NormedSpace π•œ E] {E' : Type _} [NormedAddCommGroup E'] [NormedSpace π•œ E'] {H : Type _}
-    [TopologicalSpace H] {I : ModelWithCorners π•œ E H} {H' : Type _} [TopologicalSpace H']
-    {I' : ModelWithCorners π•œ E' H'} (M : Type _) [TopologicalSpace M] [ChartedSpace H M]
-    [SmoothManifoldWithCorners I M] (M' : Type _) [TopologicalSpace M'] [ChartedSpace H' M']
+instance prod {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
+    [NormedSpace π•œ E] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace π•œ E'] {H : Type*}
+    [TopologicalSpace H] {I : ModelWithCorners π•œ E H} {H' : Type*} [TopologicalSpace H']
+    {I' : ModelWithCorners π•œ E' H'} (M : Type*) [TopologicalSpace M] [ChartedSpace H M]
+    [SmoothManifoldWithCorners I M] (M' : Type*) [TopologicalSpace M'] [ChartedSpace H' M']
     [SmoothManifoldWithCorners I' M'] : SmoothManifoldWithCorners (I.prod I') (M Γ— M') where
   compatible := by
     rintro f g ⟨f1, f2, hf1, hf2, rfl⟩ ⟨g1, g2, hg1, hg2, rfl⟩
@@ -736,18 +736,18 @@ instance prod {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [Norme
 
 end SmoothManifoldWithCorners
 
-theorem LocalHomeomorph.singleton_smoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ]
-    {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-    (I : ModelWithCorners π•œ E H) {M : Type _} [TopologicalSpace M] (e : LocalHomeomorph M H)
+theorem LocalHomeomorph.singleton_smoothManifoldWithCorners {π•œ : Type*} [NontriviallyNormedField π•œ]
+    {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) {M : Type*} [TopologicalSpace M] (e : LocalHomeomorph M H)
     (h : e.source = Set.univ) :
     @SmoothManifoldWithCorners π•œ _ E _ _ H _ I M _ (e.singletonChartedSpace h) :=
   @SmoothManifoldWithCorners.mk' _ _ _ _ _ _ _ _ _ _ (id _) <|
     e.singleton_hasGroupoid h (contDiffGroupoid ∞ I)
 #align local_homeomorph.singleton_smooth_manifold_with_corners LocalHomeomorph.singleton_smoothManifoldWithCorners
 
-theorem OpenEmbedding.singleton_smoothManifoldWithCorners {π•œ : Type _} [NontriviallyNormedField π•œ]
-    {E : Type _} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
-    (I : ModelWithCorners π•œ E H) {M : Type _} [TopologicalSpace M] [Nonempty M] {f : M β†’ H}
+theorem OpenEmbedding.singleton_smoothManifoldWithCorners {π•œ : Type*} [NontriviallyNormedField π•œ]
+    {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) {M : Type*} [TopologicalSpace M] [Nonempty M] {f : M β†’ H}
     (h : OpenEmbedding f) :
     @SmoothManifoldWithCorners π•œ _ E _ _ H _ I M _ h.singletonChartedSpace :=
   (h.toLocalHomeomorph f).singleton_smoothManifoldWithCorners I (by simp)
@@ -757,8 +757,8 @@ namespace TopologicalSpace.Opens
 
 open TopologicalSpace
 
-variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddCommGroup E]
-  [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) {M : Type _}
+variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E]
+  [NormedSpace π•œ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners π•œ E H) {M : Type*}
   [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] (s : Opens M)
 
 instance : SmoothManifoldWithCorners I s :=
@@ -770,7 +770,7 @@ section ExtendedCharts
 
 open scoped Topology
 
-variable {π•œ E M H E' M' H' : Type _} [NontriviallyNormedField π•œ] [NormedAddCommGroup E]
+variable {π•œ E M H E' M' H' : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E]
   [NormedSpace π•œ E] [TopologicalSpace H] [TopologicalSpace M] (f f' : LocalHomeomorph M H)
   (I : ModelWithCorners π•œ E H) [NormedAddCommGroup E'] [NormedSpace π•œ E'] [TopologicalSpace H']
   [TopologicalSpace M'] (I' : ModelWithCorners π•œ E' H') (x : M) {s t : Set M}
feat: lemmas about writtenInExtChartAt (#5495)
Diff
@@ -1338,6 +1338,21 @@ def writtenInExtChartAt (x : M) (f : M β†’ M') : E β†’ E' :=
   extChartAt I' (f x) ∘ f ∘ (extChartAt I x).symm
 #align written_in_ext_chart_at writtenInExtChartAt
 
+theorem writtenInExtChartAt_chartAt {x : M} {y : E} (h : y ∈ (extChartAt I x).target) :
+    writtenInExtChartAt I I x (chartAt H x) y = y := by simp_all only [mfld_simps]
+
+theorem writtenInExtChartAt_chartAt_symm {x : M} {y : E} (h : y ∈ (extChartAt I x).target) :
+    writtenInExtChartAt I I (chartAt H x x) (chartAt H x).symm y = y := by
+  simp_all only [mfld_simps]
+
+theorem writtenInExtChartAt_extChartAt {x : M} {y : E} (h : y ∈ (extChartAt I x).target) :
+    writtenInExtChartAt I π“˜(π•œ, E) x (extChartAt I x) y = y := by
+  simp_all only [mfld_simps]
+
+theorem writtenInExtChartAt_extChartAt_symm {x : M} {y : E} (h : y ∈ (extChartAt I x).target) :
+    writtenInExtChartAt π“˜(π•œ, E) I (extChartAt I x x) (extChartAt I x).symm y = y := by
+  simp_all only [mfld_simps]
+
 variable (π•œ)
 
 theorem extChartAt_self_eq {x : H} : ⇑(extChartAt I x) = I :=
@@ -1368,5 +1383,23 @@ theorem extChartAt_prod (x : M Γ— M') :
   rw [LocalEquiv.prod_trans]
 #align ext_chart_at_prod extChartAt_prod
 
+theorem extChartAt_comp [ChartedSpace H H'] (x : M') :
+    (letI := ChartedSpace.comp H H' M'; extChartAt I x) =
+      (chartAt H' x).toLocalEquiv ≫ extChartAt I (chartAt H' x x) :=
+  LocalEquiv.trans_assoc ..
+
+theorem writtenInExtChartAt_chartAt_comp [ChartedSpace H H'] (x : M') {y}
+    (hy : y ∈ letI := ChartedSpace.comp H H' M'; (extChartAt I x).target) :
+    (letI := ChartedSpace.comp H H' M'; writtenInExtChartAt I I x (chartAt H' x) y) = y := by
+  letI := ChartedSpace.comp H H' M'
+  simp_all only [mfld_simps, chartAt_comp]
+
+theorem writtenInExtChartAt_chartAt_symm_comp [ChartedSpace H H'] (x : M') {y}
+    (hy : y ∈ letI := ChartedSpace.comp H H' M'; (extChartAt I x).target) :
+    ( letI := ChartedSpace.comp H H' M'
+      writtenInExtChartAt I I (chartAt H' x x) (chartAt H' x).symm y) = y := by
+  letI := ChartedSpace.comp H H' M'
+  simp_all only [mfld_simps, chartAt_comp]
+
 end ExtendedCharts
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
-
-! This file was ported from Lean 3 source module geometry.manifold.smooth_manifold_with_corners
-! leanprover-community/mathlib commit ddec54a71a0dd025c05445d467f1a2b7d586a3ba
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Calculus.ContDiff
 import Mathlib.Geometry.Manifold.ChartedSpace
 
+#align_import geometry.manifold.smooth_manifold_with_corners from "leanprover-community/mathlib"@"ddec54a71a0dd025c05445d467f1a2b7d586a3ba"
+
 /-!
 # Smooth manifolds (possibly with boundary or corners)
 
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -345,7 +345,7 @@ theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H 
     simp_rw [preimage_inter, preimage_preimage, I.left_inv, preimage_id', preimage_range,
       inter_univ] at this 
     rwa [Function.comp.assoc, I.symm_comp_self] at this 
-  Β· rw [← I.left_inv x] at h ; exact h.comp I.continuousWithinAt_symm (inter_subset_left _ _)
+  Β· rw [← I.left_inv x] at h; exact h.comp I.continuousWithinAt_symm (inter_subset_left _ _)
 #align model_with_corners.symm_continuous_within_at_comp_right_iff ModelWithCorners.symm_continuousWithinAt_comp_right_iff
 
 protected theorem locally_compact [LocallyCompactSpace E] (I : ModelWithCorners π•œ E H) :
feat: upgrade a boundaryless ModelWithCorners to a Homeomorph (#5508)
Diff
@@ -482,6 +482,20 @@ class ModelWithCorners.Boundaryless {π•œ : Type _} [NontriviallyNormedField 
   range_eq_univ : range I = univ
 #align model_with_corners.boundaryless ModelWithCorners.Boundaryless
 
+theorem ModelWithCorners.range_eq_univ {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) [I.Boundaryless] :
+    range I = univ := ModelWithCorners.Boundaryless.range_eq_univ
+
+/-- If `I` is a `ModelWithCorners.Boundaryless` model, then it is a homeomorphism. -/
+@[simps (config := {simpRhs := true})]
+def ModelWithCorners.toHomeomorph {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _}
+    [NormedAddCommGroup E] [NormedSpace π•œ E] {H : Type _} [TopologicalSpace H]
+    (I : ModelWithCorners π•œ E H) [I.Boundaryless] : H β‰ƒβ‚œ E where
+  __ := I
+  left_inv := I.left_inv
+  right_inv _ := I.right_inv <| I.range_eq_univ.symm β–Έ mem_univ _
+
 /-- The trivial model with corners has no boundary -/
 instance modelWithCornersSelf_boundaryless (π•œ : Type _) [NontriviallyNormedField π•œ] (E : Type _)
     [NormedAddCommGroup E] [NormedSpace π•œ E] : (modelWithCornersSelf π•œ E).Boundaryless :=
feat: smoothness in a vector bundle (#5494)

Add lemmas about smoothness in a smooth vector bundle. Also rename the old smoothOn_coordChange to smoothOn_coordChangeL.

Diff
@@ -1091,11 +1091,22 @@ theorem mem_extChartAt_source : x ∈ (extChartAt I x).source := by
   simp only [extChartAt_source, mem_chart_source]
 #align mem_ext_chart_source mem_extChartAt_source
 
+theorem mem_extChartAt_target : extChartAt I x x ∈ (extChartAt I x).target :=
+  (extChartAt I x).map_source <| mem_extChartAt_source _ _
+
 theorem extChartAt_target (x : M) :
     (extChartAt I x).target = I.symm ⁻¹' (chartAt H x).target ∩ range I :=
   extend_target _ _
 #align ext_chart_at_target extChartAt_target
 
+theorem uniqueDiffOn_extChartAt_target (x : M) : UniqueDiffOn π•œ (extChartAt I x).target := by
+  rw [extChartAt_target]
+  exact I.unique_diff_preimage (chartAt H x).open_target
+
+theorem uniqueDiffWithinAt_extChartAt_target (x : M) :
+    UniqueDiffWithinAt π•œ (extChartAt I x).target (extChartAt I x x) :=
+  uniqueDiffOn_extChartAt_target I x _ <| mem_extChartAt_target I x
+
 theorem extChartAt_to_inv : (extChartAt I x).symm ((extChartAt I x) x) = x :=
   (extChartAt I x).left_inv (mem_extChartAt_source I x)
 #align ext_chart_at_to_inv extChartAt_to_inv
feat: supporting lemmas for port of ContMDiff (#5428)

Instead of fixing a proof "as is", I'm golfing it and moving parts of it to lemmas.

Diff
@@ -896,6 +896,11 @@ theorem map_extend_nhdsWithin_eq_image {y : M} (hy : y ∈ f.source) :
         (continuousAt_extend f I hy).continuousWithinAt
 #align local_homeomorph.map_extend_nhds_within_eq_image LocalHomeomorph.map_extend_nhdsWithin_eq_image
 
+theorem map_extend_nhdsWithin_eq_image_of_subset {y : M} (hy : y ∈ f.source) (hs : s βŠ† f.source) :
+    map (f.extend I) (𝓝[s] y) = 𝓝[f.extend I '' s] f.extend I y := by
+  rw [map_extend_nhdsWithin_eq_image _ _ hy, inter_eq_self_of_subset_right]
+  rwa [extend_source]
+
 theorem map_extend_nhdsWithin {y : M} (hy : y ∈ f.source) :
     map (f.extend I) (𝓝[s] y) = 𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I y := by
   rw [map_extend_nhdsWithin_eq_image f I hy, nhdsWithin_inter, ←
@@ -914,6 +919,42 @@ theorem map_extend_symm_nhdsWithin_range {y : M} (hy : y ∈ f.source) :
   rw [← nhdsWithin_univ, ← map_extend_symm_nhdsWithin f I hy, preimage_univ, univ_inter]
 #align local_homeomorph.map_extend_symm_nhds_within_range LocalHomeomorph.map_extend_symm_nhdsWithin_range
 
+theorem tendsto_extend_comp_iff {l : Filter Ξ±} {g : Ξ± β†’ M} (hg : βˆ€αΆ  z in l, g z ∈ f.source)
+    (hy : y ∈ f.source) :
+    Tendsto (f.extend I ∘ g) l (𝓝 (f.extend I y)) ↔ Tendsto g l (𝓝 y) := by
+  refine ⟨fun h u hu ↦ mem_map.2 ?_, (continuousAt_extend _ _ hy).tendsto.comp⟩
+  have := (f.continuousAt_extend_symm I hy).tendsto.comp h
+  rw [extend_left_inv _ _ hy] at this
+  filter_upwards [hg, mem_map.1 (this hu)] with z hz hzu
+  simpa only [(· ∘ ·), extend_left_inv _ _ hz, mem_preimage] using hzu
+
+-- there is no definition `writtenInExtend` but we already use some made-up names in this file
+theorem continuousWithinAt_writtenInExtend_iff {f' : LocalHomeomorph M' H'} {g : M β†’ M'}
+    (hy : y ∈ f.source) (hgy : g y ∈ f'.source) (hmaps : MapsTo g s f'.source) :
+    ContinuousWithinAt (f'.extend I' ∘ g ∘ (f.extend I).symm)
+      ((f.extend I).symm ⁻¹' s ∩ range I) (f.extend I y) ↔ ContinuousWithinAt g s y := by
+  unfold ContinuousWithinAt
+  simp only [comp_apply]
+  rw [extend_left_inv _ _ hy, f'.tendsto_extend_comp_iff _ _ hgy,
+    ← f.map_extend_symm_nhdsWithin I hy, tendsto_map'_iff]
+  rw [← f.map_extend_nhdsWithin I hy, eventually_map]
+  filter_upwards [inter_mem_nhdsWithin _ (f.open_source.mem_nhds hy)] with z hz
+  rw [comp_apply, extend_left_inv _ _ hz.2]
+  exact hmaps hz.1
+
+-- there is no definition `writtenInExtend` but we already use some made-up names in this file
+
+/-- If `s βŠ† f.source` and `g x ∈ f'.source` whenever `x ∈ s`, then `g` is continuous on `s` if and
+only if `g` written in charts `f.extend I` and `f'.extend I'` is continuous on `f.extend I '' s`. -/
+theorem continuousOn_writtenInExtend_iff {f' : LocalHomeomorph M' H'} {g : M β†’ M'}
+    (hs : s βŠ† f.source) (hmaps : MapsTo g s f'.source) :
+    ContinuousOn (f'.extend I' ∘ g ∘ (f.extend I).symm) (f.extend I '' s) ↔ ContinuousOn g s := by
+  refine ball_image_iff.trans <| forallβ‚‚_congr fun x hx ↦ ?_
+  refine (continuousWithinAt_congr_nhds ?_).trans
+    (continuousWithinAt_writtenInExtend_iff _ _ _ (hs hx) (hmaps hx) hmaps)
+  rw [← map_extend_nhdsWithin_eq_image_of_subset, ← map_extend_nhdsWithin]
+  exacts [hs hx, hs hx, hs]
+
 /-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
 in the source is a neighborhood of the preimage, within a set. -/
 theorem extend_preimage_mem_nhdsWithin {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝[s] x) :
@@ -936,6 +977,7 @@ theorem extend_preimage_inter_eq :
   mfld_set_tac
 #align local_homeomorph.extend_preimage_inter_eq LocalHomeomorph.extend_preimage_inter_eq
 
+-- porting note: an `aux` lemma that is no longer needed. Delete?
 theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)]
       ((f.extend I).target ∩ (f.extend I).symm ⁻¹' s : Set _) := by
@@ -952,9 +994,8 @@ theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (h
 theorem extend_symm_preimage_inter_range_eventuallyEq {s : Set M} {x : M} (hs : s βŠ† f.source)
     (hx : x ∈ f.source) :
     ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =αΆ [𝓝 (f.extend I x)] f.extend I '' s := by
-  rw [← f.extend_source I] at hs 
-  rw [(f.extend I).image_eq_target_inter_inv_preimage hs]
-  exact f.extend_symm_preimage_inter_range_eventuallyEq_aux I hx
+  rw [← nhdsWithin_eq_iff_eventuallyEq, ← map_extend_nhdsWithin _ _ hx,
+    map_extend_nhdsWithin_eq_image_of_subset _ _ hx hs]
 #align local_homeomorph.extend_symm_preimage_inter_range_eventually_eq LocalHomeomorph.extend_symm_preimage_inter_range_eventuallyEq
 
 /-! We use the name `extend_coord_change` for `(f'.extend I).symm ≫ f.extend I`. -/
@@ -1236,8 +1277,16 @@ theorem extChartAt_preimage_inter_eq :
   by mfld_set_tac
 #align ext_chart_at_preimage_inter_eq extChartAt_preimage_inter_eq
 
-/-! We use the name `ext_coord_change` for `(extChartAt I x').symm ≫ extChartAt I x`. -/
+theorem ContinuousWithinAt.nhdsWithin_extChartAt_symm_preimage_inter_range
+    {f : M β†’ M'} {x : M} (hc : ContinuousWithinAt f s x) :
+    𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x x) =
+      𝓝[(extChartAt I x).target ∩
+        (extChartAt I x).symm ⁻¹' (s ∩ f ⁻¹' (extChartAt I' (f x)).source)] (extChartAt I x x) := by
+  rw [← (extChartAt I x).image_source_inter_eq', ← map_extChartAt_nhdsWithin_eq_image,
+    ← map_extChartAt_nhdsWithin, nhdsWithin_inter_of_mem']
+  exact hc (extChartAt_source_mem_nhds _ _)
 
+/-! We use the name `ext_coord_change` for `(extChartAt I x').symm ≫ extChartAt I x`. -/
 
 theorem ext_coord_change_source (x x' : M) :
     ((extChartAt I x').symm ≫ extChartAt I x).source =
feat: port Geometry.Manifold.SmoothManifoldWithCorners (#4636)

Dependencies 12 + 874

875 files ported (98.6%)
388486 lines ported (98.6%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file