import PoincareLib.Geometry.Manifold.InverseFunction import Mathlib.Topology.IsLocalHomeomorph /-! # A smooth nonsingular map is a local homeomorphism The Euclidean inverse function theorem in the actual preferred charts provides local inverse branches on manifolds without boundary. This turns the injective angular differential into the topological local homeomorphism in Morgan--Tian, Claim 16.10, pp. 374-375; see M44 derivation 46. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Filter open scoped Manifold ContDiff Topology namespace Poincare /-- A smooth map between equal-dimensional Euclidean manifolds with bijective differentials is a local homeomorphism. Source: the angular projection in Claim 16.10; M44 derivation 46. -/ theorem isLocalHomeomorph_of_mfderiv_bijective {n : โ„•} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) N] [IsManifold (๐“ก n) โˆž M] [IsManifold (๐“ก n) โˆž N] {f : M โ†’ N} (hf : ContMDiff (๐“ก n) (๐“ก n) โˆž f) (hbij : โˆ€ x, Function.Bijective (mfderiv (๐“ก n) (๐“ก n) f x)) : IsLocalHomeomorph f := by rw [isLocalHomeomorph_iff_isLocalHomeomorphOn_univ] apply IsLocalHomeomorphOn.mk intro x _ let c : OpenPartialHomeomorph M (EuclideanSpace โ„ (Fin n)) := chartAt (EuclideanSpace โ„ (Fin n)) x let d : OpenPartialHomeomorph N (EuclideanSpace โ„ (Fin n)) := chartAt (EuclideanSpace โ„ (Fin n)) (f x) let F := writtenInExtChartAt (๐“ก n) (๐“ก n) x f have hF : ContDiffAt โ„ โˆž F (c x) := by simpa [F, c, contDiffWithinAt_univ] using (contMDiffAt_iff.mp (hf x)).2 have hderiv : mfderiv (๐“ก n) (๐“ก n) f x = fderiv โ„ F (c x) := by rw [mfderiv, if_pos ((hf x).mdifferentiableAt (by simp))] simp [F, c] have hFbij : Function.Bijective (fderiv โ„ F (c x)) := by rw [โ† hderiv]; exact hbij x let A := ContinuousLinearEquiv.ofBijective (fderiv โ„ F (c x)) (LinearMap.ker_eq_bot.mpr hFbij.1) (LinearMap.range_eq_top.mpr hFbij.2) have hdF : HasFDerivAt F (A : EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n)) (c x) := (hF.differentiableAt (by simp)).hasFDerivAt let H := hF.toOpenPartialHomeomorph F hdF (by simp) have hF_eq : F = d โˆ˜ f โˆ˜ c.symm := by ext y simp [F, c, d, writtenInExtChartAt, extChartAt, OpenPartialHomeomorph.extend] let e := ((c.trans H).trans d.symm).restrOpen (f โปยน' d.source) (d.open_source.preimage hf.continuous) have hcx : x โˆˆ c.source := mem_chart_source _ _ have hdx : f x โˆˆ d.source := mem_chart_source _ _ have hex : x โˆˆ e.source := by refine โŸจโŸจโŸจhcx, hF.mem_toOpenPartialHomeomorph_source hdF (by simp)โŸฉ, ?_โŸฉ, hdxโŸฉ change F (c x) โˆˆ d.target rw [hF_eq, Function.comp_apply, Function.comp_apply, c.left_inv hcx] exact d.map_source hdx refine โŸจe, hex, ?_โŸฉ intro y hy change f y = d.symm (F (c y)) rw [hF_eq, Function.comp_apply, Function.comp_apply, c.left_inv hy.1.1.1, d.left_inv hy.2] end Poincare