import PoincareLib.Geometry.RicciFlow.Surgery.Metric.Distance.MetricPathLength import PoincareLib.Geometry.RicciFlow.CanonicalNeighborhood.Neck /-! # Intrinsic distance under a smooth metric identification Lengths are compared on the actual admissible C1 paths in the frozen intrinsic distance. The subsets may be closed: smoothness is required at their points in the ambient manifolds. This includes the retained central sphere of Morgan--Tian's surgery, p.340. -/ set_option autoImplicit false open scoped Manifold ContDiff Bundle ENNReal Topology open MeasureTheory universe u v namespace PoincareMT.MetricSurgery theorem pathELength_eq_lintegral_speed_Ioo {n : β„•} {X : Type u} [TopologicalSpace X] [ChartedSpace (EuclideanSpace ℝ (Fin n)) X] [IsManifold (𝓑 n) ∞ X] (g : RiemannianMetric n X) (gamma : ℝ β†’ X) (a b : ℝ) : g.pathELength gamma a b = ∫⁻ t in Set.Ioo a b, ENNReal.ofReal (metricPathSpeed g gamma t) := by let : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : X β†’ Type _) := ⟨g.toRiemannianMetric⟩ change Manifold.pathELength (𝓑 n) gamma a b = _ rw [Manifold.pathELength_eq_lintegral_mfderiv_Ioo] apply setLIntegral_congr_fun measurableSet_Ioo intro t _ dsimp only erw [← ofReal_norm, norm_eq_sqrt_real_inner] rfl variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] [ChartedSpace (EuclideanSpace ℝ (Fin 3)) Y] [IsManifold (𝓑 3) ∞ X] [IsManifold (𝓑 3) ∞ Y] omit [IsManifold (𝓑 3) ∞ X] [IsManifold (𝓑 3) ∞ Y] in theorem path_contMDiffOn_comp_at {f : X β†’ Y} {U : Set X} (hf : βˆ€ x ∈ U, ContMDiffAt (𝓑 3) (𝓑 3) ∞ f x) {gamma : ℝ β†’ X} (hgamma : ContMDiffOn π“˜(ℝ, ℝ) (𝓑 3) 1 gamma (Set.Icc (0 : ℝ) 1)) (hU : gamma '' Set.Icc (0 : ℝ) 1 βŠ† U) : ContMDiffOn π“˜(ℝ, ℝ) (𝓑 3) 1 (f ∘ gamma) (Set.Icc (0 : ℝ) 1) := by intro t ht exact ((hf (gamma t) (hU ⟨t, ht, rfl⟩)).of_le (by simp)).comp_contMDiffWithinAt t (hgamma t ht) set_option backward.isDefEq.respectTransparency false in theorem pathELength_comp_eq_of_pullback (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) {f : X β†’ Y} {U : Set X} (hf : βˆ€ x ∈ U, ContMDiffAt (𝓑 3) (𝓑 3) ∞ f x) (hmetric : βˆ€ x ∈ U, βˆ€ v w : TangentSpace (𝓑 3) x, h.inner (f x) (mfderiv (𝓑 3) (𝓑 3) f x v) (mfderiv (𝓑 3) (𝓑 3) f x w) = g.inner x v w) {gamma : ℝ β†’ X} (hgamma : ContMDiffOn π“˜(ℝ, ℝ) (𝓑 3) 1 gamma (Set.Icc (0 : ℝ) 1)) (hU : gamma '' Set.Icc (0 : ℝ) 1 βŠ† U) : h.pathELength (f ∘ gamma) 0 1 = g.pathELength gamma 0 1 := by rw [pathELength_eq_lintegral_speed_Ioo, pathELength_eq_lintegral_speed_Ioo] apply setLIntegral_congr_fun measurableSet_Ioo intro t ht have ht' : t ∈ Set.Icc (0 : ℝ) 1 := ⟨ht.1.le, ht.2.le⟩ have hgammaAt := ((hgamma t ht').contMDiffAt (Icc_mem_nhds ht.1 ht.2)).mdifferentiableAt (by simp) have hfAt := (hf (gamma t) (hU ⟨t, ht', rfl⟩)).mdifferentiableAt (by simp) change ENNReal.ofReal (h.tangentNorm (f (gamma t)) (mfderiv π“˜(ℝ, ℝ) (𝓑 3) (f ∘ gamma) t 1)) = ENNReal.ofReal (g.tangentNorm (gamma t) (mfderiv π“˜(ℝ, ℝ) (𝓑 3) gamma t 1)) rw [mfderiv_comp t hfAt hgammaAt] simp only [ContinuousLinearMap.comp_apply, Function.comp_apply, RiemannianMetric.tangentNorm, hmetric (gamma t) (hU ⟨t, ht', rfl⟩)] theorem intrinsicEDist_image_le_of_pullback (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) {f : X β†’ Y} {U : Set X} (hf : βˆ€ x ∈ U, ContMDiffAt (𝓑 3) (𝓑 3) ∞ f x) (hmetric : βˆ€ x ∈ U, βˆ€ v w : TangentSpace (𝓑 3) x, h.inner (f x) (mfderiv (𝓑 3) (𝓑 3) f x v) (mfderiv (𝓑 3) (𝓑 3) f x w) = g.inner x v w) (x y : X) : intrinsicEDist h (f '' U) (f x) (f y) ≀ intrinsicEDist g U x y := by apply le_sInf rintro L ⟨gamma, hgamma, hzero, hone, hU, rfl⟩ apply sInf_le refine ⟨f ∘ gamma, path_contMDiffOn_comp_at hf hgamma hU, ?_, ?_, ?_, ?_⟩ Β· simp only [Function.comp_apply, hzero] Β· simp only [Function.comp_apply, hone] Β· rintro _ ⟨t, ht, rfl⟩ exact ⟨gamma t, hU ⟨t, ht, rfl⟩, rfl⟩ Β· exact (pathELength_comp_eq_of_pullback g h hf hmetric hgamma hU).symm theorem intrinsicEDist_image_eq_of_inverse_pullbacks (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) {f : X β†’ Y} {k : Y β†’ X} {U : Set X} (hf : βˆ€ x ∈ U, ContMDiffAt (𝓑 3) (𝓑 3) ∞ f x) (hk : βˆ€ y ∈ f '' U, ContMDiffAt (𝓑 3) (𝓑 3) ∞ k y) (hinv : Set.LeftInvOn k f U) (hmetric : βˆ€ x ∈ U, βˆ€ v w : TangentSpace (𝓑 3) x, h.inner (f x) (mfderiv (𝓑 3) (𝓑 3) f x v) (mfderiv (𝓑 3) (𝓑 3) f x w) = g.inner x v w) (hmetricInv : βˆ€ y ∈ f '' U, βˆ€ v w : TangentSpace (𝓑 3) y, g.inner (k y) (mfderiv (𝓑 3) (𝓑 3) k y v) (mfderiv (𝓑 3) (𝓑 3) k y w) = h.inner y v w) {x y : X} (hx : x ∈ U) (hy : y ∈ U) : intrinsicEDist h (f '' U) (f x) (f y) = intrinsicEDist g U x y := by apply le_antisymm (intrinsicEDist_image_le_of_pullback g h hf hmetric x y) have himage : k '' (f '' U) = U := by ext z constructor Β· rintro ⟨_, ⟨w, hw, rfl⟩, rfl⟩ simpa only [hinv hw] using hw Β· intro hz exact ⟨f z, ⟨z, hz, rfl⟩, hinv hz⟩ have hle := intrinsicEDist_image_le_of_pullback h g hk hmetricInv (f x) (f y) simpa only [himage, hinv hx, hinv hy] using hle end PoincareMT.MetricSurgery