import PoincareLib.Geometry.CurveShortening.Comparison.Analysis.Positive.MetricExtension import PoincareLib.Geometry.Riemannian.Metric.Pullback /-! Actual induced metrics near closed subsets of an immersed coordinate domain. Source: MT Lemma 19.31, pp. 464-466; trimmed-intrinsic-transport derivation, Section 6. Source and target dimensions may differ. -/ noncomputable section set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Filter open scoped Topology ContDiff Manifold Bundle namespace PoincareMT attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace normedSpaceTangentSpaceVectorSpace variable {m n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] /-- The actual pullback bilinear form for a map of possibly different dimensions. Source: MT Lemma 19.31, pp. 464-466; transport derivation, Section 6. -/ def m64ImmersionCoefficients (g : RiemannianMetric n M) (f : EuclideanSpace ℝ (Fin m) β†’ M) (x : EuclideanSpace ℝ (Fin m)) : EuclideanSpace ℝ (Fin m) β†’L[ℝ] EuclideanSpace ℝ (Fin m) β†’L[ℝ] ℝ := by let : NormedAddCommGroup (TangentSpace (𝓑 n) (f x)) := by unfold TangentSpace infer_instance let : NormedSpace ℝ (TangentSpace (𝓑 n) (f x)) := by unfold TangentSpace infer_instance exact ContinuousLinearMap.bilinearComp (g.inner (f x)) (mfderiv (𝓑 m) (𝓑 n) f x) (mfderiv (𝓑 m) (𝓑 n) f x) /-- Smoothness of the genuine induced bilinear form at a smooth point. Source: MT Lemma 19.31, pp. 464-466; transport derivation, Section 6. -/ theorem m64_contDiffAt_immersionCoefficients (g : RiemannianMetric n M) {f : EuclideanSpace ℝ (Fin m) β†’ M} {x : EuclideanSpace ℝ (Fin m)} (hf : ContMDiffAt (𝓑 m) (𝓑 n) ∞ f x) : ContDiffAt ℝ ∞ (m64ImmersionCoefficients g f) x := by apply contMDiffAt_iff_contDiffAt.mp apply contMDiffAt_clm_of_apply intro v apply contMDiffAt_clm_of_apply intro w have hg := (g.contMDiff (f x)).comp x hf have h := hg.clm_bundle_applyβ‚‚ (F₃ := ℝ) (E₃ := Bundle.Trivial M ℝ) (RiemannianMetric.contMDiffAt_mfderiv_const_vector hf v) (RiemannianMetric.contMDiffAt_mfderiv_const_vector hf w) have hh := (Bundle.contMDiffAt_totalSpace.mp h).2 simp only [Bundle.Trivial.fiberBundle_trivializationAt', Bundle.Trivial.trivialization_apply] at hh convert! hh using 1 /-- A smooth immersion near a closed coordinate set has a genuine global source metric and Levi-Civita connection, with the actual induced metric on a neighborhood of every point of the set. Source: MT Lemma 19.31, pp. 464-466; transport derivation, Sections 3 and 6. -/ theorem m64_exists_induced_metric_near (g : RiemannianMetric n M) {f : EuclideanSpace ℝ (Fin m) β†’ M} {S U : Set (EuclideanSpace ℝ (Fin m))} (hS : IsClosed S) (hU : IsOpen U) (hSU : S βŠ† U) (hf : ContMDiffOn (𝓑 m) (𝓑 n) ∞ f U) (hinj : βˆ€ x ∈ U, Function.Injective (mfderiv (𝓑 m) (𝓑 n) f x)) : βˆƒ (h : RiemannianMetric m (EuclideanSpace ℝ (Fin m))) (_D : LeviCivitaData h), βˆ€ x ∈ S, βˆ€αΆ  y in 𝓝 x, βˆ€ v w, h.inner y v w = g.inner (f y) (mfderiv (𝓑 m) (𝓑 n) f y v) (mfderiv (𝓑 m) (𝓑 n) f y w) := by have hB : ContDiffOn ℝ ∞ (m64ImmersionCoefficients g f) U := by intro x hx exact (m64_contDiffAt_immersionCoefficients g ((hf x hx).contMDiffAt (hU.mem_nhds hx))).contDiffWithinAt have hpos : βˆ€ x ∈ U, βˆ€ v, v β‰  0 β†’ 0 < m64ImmersionCoefficients g f x v v := by intro x hx v hv have hAv : mfderiv (𝓑 m) (𝓑 n) f x v β‰  0 := by intro hz exact hv ((hinj x hx) (by simpa using hz)) exact g.pos (f x) _ hAv obtain ⟨h, D, heq⟩ := m64_exists_metric_eq_nhds_of_isClosed hS hU hSU (m64ImmersionCoefficients g f) hB (fun x _ v w => g.symm (f x) _ _) hpos refine ⟨h, D, ?_⟩ intro x hx filter_upwards [heq x hx] with y hy intro v w exact congrArg (fun B => B v w) hy end PoincareMT