import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Chart.ReaderCenteredInverse /-! Both local inverse identities of the actual centered chart reader. They retain the original manifold chart, so later finite C2 boundary coordinates have a genuine inverse on both neighborhoods. Source: Morrey ICM pp. 183-185; M64 finite-boundary-regularity derivation. Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. 447-449. -/ noncomputable section set_option autoImplicit false set_option warningAsError true open Set Filter open scoped Topology Manifold ContDiff namespace PoincareMT /-- The actual observed chart reader and its centered reconstruction are local inverses in both directions. Proof expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ theorem m64ChartReadable_centered_inverse_two_sided {n m : โ„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] {e : M โ†’ EuclideanSpace โ„ (Fin m)} (hread : M60.SUChartReadable (n := n) e) (p : M) : โˆƒ (T : EuclideanSpace โ„ (Fin m) โ†’L[โ„] EuclideanSpace โ„ (Fin n)) (P : EuclideanSpace โ„ (Fin n) โ†’ M), P 0 = p โˆง ContMDiffAt (๐“ก n) (๐“ก n) โˆž P 0 โˆง (โˆ€แถ  q in ๐“ p, P (T (e q - e p)) = q) โˆง โˆ€แถ  y in ๐“ 0, T (e (P y) - e p) = y := by obtain โŸจb, hb, T, hTโŸฉ := hread p let c := extChartAt (๐“ก n) b have hTp : T (e p) = c p := hT.self_of_nhds have hp : p โˆˆ c.source := hb have hcp : c p โˆˆ c.target := c.map_source hp let P : EuclideanSpace โ„ (Fin n) โ†’ M := fun y => c.symm (y + T (e p)) have hP0 : P 0 = p := by simp only [P, zero_add, hTp, c.left_inv hp] have hi : ContMDiffAt (๐“ก n) (๐“ก n) โˆž c.symm (c p) := (contMDiffOn_extChartAt_symm (n := โˆž) b).contMDiffAt ((isOpen_extChartAt_target b).mem_nhds hcp) have hP : ContMDiffAt (๐“ก n) (๐“ก n) โˆž P 0 := by have hi' : ContMDiffAt (๐“ก n) (๐“ก n) โˆž c.symm (0 + T (e p)) := by simpa only [zero_add, hTp] using hi exact hi'.comp 0 (contDiff_id.add contDiff_const).contMDiff.contMDiffAt refine โŸจT, P, hP0, hP, ?_, ?_โŸฉ ยท filter_upwards [hT, (isOpen_extChartAt_source b).mem_nhds hp] with q hq hqs change c.symm (T (e q - e p) + T (e p)) = q rw [map_sub, sub_add_cancel, hq, c.left_inv hqs] ยท have hlim : Tendsto P (๐“ 0) (๐“ p) := hP0 โ–ธ hP.continuousAt have htarget : โˆ€แถ  y in ๐“ (0 : EuclideanSpace โ„ (Fin n)), y + T (e p) โˆˆ c.target := by have hz : 0 + T (e p) โˆˆ c.target := by simpa only [zero_add, hTp] using hcp exact ((continuous_id.add continuous_const).tendsto 0).eventually ((isOpen_extChartAt_target b).mem_nhds hz) filter_upwards [hlim.eventually hT, htarget] with y hy hyt rw [map_sub, hy] change c (c.symm (y + T (e p))) - T (e p) = y rw [c.right_inv hyt, add_sub_cancel_right] end PoincareMT