import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.ManifoldLocalInverse import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.TriangularBijective import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.SmoothSquareAction /-! # Endpoint inverses of actual square-time comparison families Compactness controls the whole moving interval. The endpoint-time differential retains its off-diagonal time term and has identity time row. -/ set_option autoImplicit false set_option maxSynthPendingDepth 3 open scoped Manifold ContDiff Bundle Topology open Filter universe u namespace PoincareMT.ReducedLength variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] def squareFamilyParameterDomain (Ξ© : Set (E Γ— ℝ)) (Ο„max : ℝ) : Set (E Γ— ℝ) := {z | z.2 ∈ Set.Ioo 0 Ο„max ∧ βˆ€ r ∈ Set.Icc (0 : ℝ) 1, (z.1, Real.sqrt z.2 * r) ∈ Ξ©} theorem isOpen_squareFamilyParameterDomain (Ξ© : Set (E Γ— ℝ)) (hΞ© : IsOpen Ξ©) (Ο„max : ℝ) : IsOpen (squareFamilyParameterDomain Ξ© Ο„max) := by rw [isOpen_iff_mem_nhds] intro z hz have hnear : βˆ€αΆ  w : E Γ— ℝ in 𝓝 z, βˆ€ r ∈ Set.Icc (0 : ℝ) 1, (w.1, Real.sqrt w.2 * r) ∈ Ξ© := by apply isCompact_Icc.eventually_forall_of_forall_eventually intro r hr have hc : Continuous (fun w : (E Γ— ℝ) Γ— ℝ ↦ (w.1.1, Real.sqrt w.1.2 * w.2)) := continuous_fst.fst.prodMk ((Real.continuous_sqrt.comp continuous_fst.snd).mul continuous_snd) exact hc.continuousAt.preimage_mem_nhds (hΞ©.mem_nhds (hz.2 r hr)) filter_upwards [(isOpen_univ.prod isOpen_Ioo).mem_nhds (show z ∈ Set.univ Γ—Λ’ Set.Ioo 0 Ο„max from ⟨Set.mem_univ _, hz.1⟩), hnear] with w hw hseg exact ⟨hw.2, hseg⟩ theorem squareFamilyParameterDomain_endpoint (Ξ© : Set (E Γ— ℝ)) (Ο„max : ℝ) (z : E Γ— ℝ) (hz : z ∈ squareFamilyParameterDomain Ξ© Ο„max) : (z.1, Real.sqrt z.2) ∈ Ξ© := by simpa only [mul_one] using hz.2 1 ⟨zero_le_one, le_rfl⟩ set_option backward.isDefEq.respectTransparency false in theorem squareFamilyEndpoint_contMDiffOn (f : E Γ— ℝ β†’ M) (Ξ© : Set (E Γ— ℝ)) (hf : ContMDiffOn (π“˜(ℝ, E Γ— ℝ)) (𝓑 n) ∞ f Ξ©) (Ο„max : ℝ) : ContMDiffOn (π“˜(ℝ, E Γ— ℝ)) (𝓑 n) ∞ (fun z ↦ f (z.1, Real.sqrt z.2)) (squareFamilyParameterDomain Ξ© Ο„max) := by have hi : ContDiffOn ℝ ∞ (fun z : E Γ— ℝ ↦ (z.1, Real.sqrt z.2)) (squareFamilyParameterDomain Ξ© Ο„max) := contDiffOn_fst.prodMk (contDiffOn_snd.sqrt (fun _ hz ↦ hz.1.1.ne')) exact hf.comp hi.contMDiffOn (fun z hz ↦ squareFamilyParameterDomain_endpoint Ξ© Ο„max z hz) set_option maxHeartbeats 1000000 in -- The full product-manifold derivative is identified before invoking the inverse theorem. set_option backward.isDefEq.respectTransparency false in theorem exists_squareFamily_endpoint_inverse (f : E Γ— ℝ β†’ M) (Ξ© : Set (E Γ— ℝ)) (hΞ© : IsOpen Ξ©) (hf : ContMDiffOn (π“˜(ℝ, E Γ— ℝ)) (𝓑 n) ∞ f Ξ©) (Ο„max : ℝ) (z : E Γ— ℝ) (hz : z ∈ squareFamilyParameterDomain Ξ© Ο„max) (hbij : Function.Bijective (mfderiv (π“˜(ℝ, E)) (𝓑 n) (fun x ↦ f (x, Real.sqrt z.2)) z.1)) : βˆƒ e : OpenPartialHomeomorph (E Γ— ℝ) (M Γ— ℝ), z ∈ e.source ∧ e.source βŠ† squareFamilyParameterDomain Ξ© Ο„max ∧ Set.EqOn e (fun w ↦ (f (w.1, Real.sqrt w.2), w.2)) e.source ∧ ContMDiffOn ((𝓑 n).prod (π“˜(ℝ, ℝ))) (π“˜(ℝ, E Γ— ℝ)) ∞ e.symm e.target := by let S := squareFamilyParameterDomain Ξ© Ο„max have hS := isOpen_squareFamilyParameterDomain Ξ© hΞ© Ο„max let H : E Γ— ℝ β†’ M := fun w ↦ f (w.1, Real.sqrt w.2) have hH : ContMDiffOn (π“˜(ℝ, E Γ— ℝ)) (𝓑 n) ∞ H S := squareFamilyEndpoint_contMDiffOn f Ξ© hf Ο„max have hHprod : ContMDiffOn ((π“˜(ℝ, E)).prod (π“˜(ℝ, ℝ))) (𝓑 n) ∞ H S := by convert! hH using 1 <;> simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] have hd := (hHprod.contMDiffAt (hS.mem_nhds hz)).mdifferentiableAt (by simp) let L := mfderiv ((π“˜(ℝ, E)).prod (π“˜(ℝ, ℝ))) ((𝓑 n).prod (π“˜(ℝ, ℝ))) (fun w : E Γ— ℝ ↦ (H w, w.2)) z have hLb : Function.Bijective L := by dsimp only [L] rw [mfderiv_prodMk hd mdifferentiableAt_snd, mfderiv_snd] apply (triangular_bijective_iff (E := E) (F := EuclideanSpace ℝ (Fin n)) _ (mfderiv (π“˜(ℝ, E)) (𝓑 n) (fun x ↦ f (x, Real.sqrt z.2)) z.1) ?_ ?_).mpr hbij Β· intro w rfl Β· intro w change mfderiv ((π“˜(ℝ, E)).prod (π“˜(ℝ, ℝ))) (𝓑 n) H z (w, 0) = _ rw [mfderiv_prod_eq_add_apply hd] simp only [map_zero, add_zero, H] rfl letI : ChartedSpace (EuclideanSpace ℝ (Fin n) Γ— ℝ) (M Γ— ℝ) := prodChartedSpace (EuclideanSpace ℝ (Fin n)) M ℝ ℝ letI : IsManifold (π“˜(ℝ, EuclideanSpace ℝ (Fin n) Γ— ℝ)) ∞ (M Γ— ℝ) := by rw [modelWithCornersSelf_prod] exact IsManifold.prod (I := 𝓑 n) (I' := π“˜(ℝ, ℝ)) M ℝ let Ξ¦ : E Γ— ℝ β†’ M Γ— ℝ := fun w ↦ (H w, w.2) have hΞ¦ : ContMDiffOn (π“˜(ℝ, E Γ— ℝ)) (π“˜(ℝ, EuclideanSpace ℝ (Fin n) Γ— ℝ)) ∞ Ξ¦ S := by convert! hHprod.prodMk contMDiffOn_snd using 1 <;> simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] have hfull : Function.Bijective (mfderiv (π“˜(ℝ, E Γ— ℝ)) (π“˜(ℝ, EuclideanSpace ℝ (Fin n) Γ— ℝ)) Ξ¦ z) := by convert! hLb using 1 <;> simp only [L, Ξ¦, modelWithCornersSelf_prod, chartedSpaceSelf_prod] congr 2 <;> simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] obtain ⟨e, hze, hsub, he, hinv, _⟩ := exists_manifold_local_inverse Ξ¦ S hS hΞ¦ z hz hfull refine ⟨e, hze, hsub, he, ?_⟩ convert! hinv using 1 <;> simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] end PoincareMT.ReducedLength